Skip to content

增加新命令及部分功能优化 - #88

Open
yangda611 wants to merge 6 commits into
lingfengQAQ:masterfrom
yangda611:master
Open

增加新命令及部分功能优化#88
yangda611 wants to merge 6 commits into
lingfengQAQ:masterfrom
yangda611:master

Conversation

@yangda611

Copy link
Copy Markdown

feat: 增强章节管理与仪表盘文档

  • 新增 /webnovel-delete/webnovel-rewrite,支持按范围删除/重写章节并自动清理派生数据
  • README 增补命令总览:统一梳理 Claude Code 插件命令与 CLI 子命令,并给出 100 章后偏纲的推荐修复流程
  • context-agent / reviewer 增加「虚构声明」(避免出现敏感词导致部分AI请求被拒),并强化情节节点履约要求(CBN/CPN/CEN、must_cover/forbidden 必须在任务书中逐项落地)
  • 增强了去文本的AI味

codex and others added 5 commits May 5, 2026 16:04
… CLI and docs

### Motivation

- Provide a batch automation entrypoint to run write/heal/nightly pipelines across chapter ranges to reduce manual orchestration.
- Provide a tool to detect and optionally mark ASCII snake_case (pinyin/English) dirty entities for downstream cleanup.
- Expose these features through the unified CLI and document common plugin/CLI workflows for everyday and ops use.

### Description

- Extended the CLI in `webnovel-writer/scripts/data_modules/webnovel.py` to add `orchestrate` and `entity-clean` subcommands and forward them to new scripts.
- Added `webnovel-writer/scripts/orchestrate.py` which implements range parsing, runs `preflight`, optional `review-pipeline`, `chapter-commit`, and optional vector indexing repair, and emits a JSON report.
- Added `webnovel-writer/scripts/entity_cleanup.py` which scans the `entities` table for ASCII snake_case IDs/names and optionally writes rows into an `invalid_facts` table for later handling.
- Updated `README.md` and `docs/guides/commands.md` to include an overview of the new plugin commands, unified CLI examples, `orchestrate` usage, and a recommended repair workflow for large projects.

### Testing

- Ran basic CLI smoke checks by invoking `python -X utf8 "<CLAUDE_PLUGIN_ROOT>/scripts/webnovel.py" orchestrate --help` and `python -X utf8 "<CLAUDE_PLUGIN_ROOT>/scripts/webnovel.py" entity-clean --help`, which returned help text successfully.
- Executed `orchestrate` locally against a sample project with `--chapters 1-3` and `--json-report-out` to verify report generation and the script exit behavior, and the run completed and produced a JSON report.
- Ran `entity_cleanup.py` against a test SQLite `index.db` and validated that it listed dirty entities and inserted `invalid_facts` rows when `--mark-invalid` was passed.
feat:新增一键 autofix 修复链与实体脏数据治理

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3f3c07a6a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if isinstance(data.get("blocking_count"), int):
return data.get("blocking_count", 0) > 0
issues = data.get("issues") or []
return any(bool(item.get("blocking")) for item in issues if isinstance(item, dict))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat critical review issues as blocking

When a reviewer emits a critical issue without an explicit blocking field, review_pipeline parses it as blocking via ReviewIssue.__post_init__, but this check rereads the raw JSON and only tests item.get("blocking"). In that valid review-result shape, orchestrate write/nightly continues to chapter-commit even though the parsed review has blocking_count > 0, so chapters with critical blockers can be accepted and projected.

Useful? React with 👍 / 👎.

)
for item in rows:
cur.execute(
"INSERT INTO invalid_facts (source_type, source_id, reason, marked_by, chapter, status) VALUES (?, ?, ?, ?, ?, 'pending')",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Insert invalid facts using the project schema

On initialized projects, invalid_facts is already created by index_manager with chapter_discovered and confirmed_at, not chapter/resolved_at; because CREATE TABLE IF NOT EXISTS leaves that table unchanged, entity-clean --mark-invalid fails with no column named chapter as soon as it finds a dirty entity. The insert should use the existing schema (or the shared mark_invalid_fact helper) so the advertised cleanup command works on real project databases.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants