feat: review_only input and an enumeration check in the monthly prompt
tests / unittest (push) Successful in 23s
tests / unittest (push) Successful in 23s
review_only names listed documents the drafter may read but not edit. They stay in stage 1, are listed separately in the prompt, and a change to one fails the run like a change outside docs. Each entry must match a docs pattern. The monthly prompt now makes checking every list and count in the top-level documents against the repository the drafter's main job. Mode-specific text moves to prompts/mode-pr.md and prompts/mode-monthly.md; the pr text is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f39409e62c
commit
9dea56ce98
15 files changed
+223
-29
No files matched your search
@@ -12,16 +12,15 @@ from pathlib import Path
|
||||
from docs_review import git
|
||||
from docs_review.changes import changed_names, parse_name_status
|
||||
from docs_review.draft import (
|
||||
DraftResult, build_prompt, diff_payload, parse_last_head, parse_summary,
|
||||
render_pr_body, should_skip,
|
||||
DraftResult, build_prompt, diff_payload, load_template, parse_last_head,
|
||||
parse_summary, render_pr_body, should_skip,
|
||||
)
|
||||
from docs_review.drafter import draft_in_sandbox
|
||||
from docs_review.flags import Flag, compute_flags
|
||||
from docs_review.inputs import Inputs, expand_patterns
|
||||
from docs_review.inputs import Inputs, expand_patterns, split_review_only
|
||||
from docs_review.report import STAGE1_MARKER, render_clean, render_comment, stage1_json
|
||||
from docs_review.tree import read_in_tree
|
||||
|
||||
TASK_PROMPT = Path(__file__).resolve().parent.parent / "prompts" / "task.md"
|
||||
CLOSED_BRANCH_NOTE = (
|
||||
"docs-review/pr-{n} was closed without merging; delete that branch to get new drafts."
|
||||
)
|
||||
@@ -210,9 +209,11 @@ def run_pr(inputs: Inputs, forge, env: Mapping[str, str], cwd: Path, args: PrArg
|
||||
MERGE_CONFLICT_NOTE.format(n=args.number), docs_pr=pr_no)
|
||||
return 0
|
||||
|
||||
editable, read_only = split_review_only(docs, inputs.review_only)
|
||||
prompt = build_prompt(
|
||||
TASK_PROMPT.read_text(encoding="utf-8"), mode="pr", pr=args.number,
|
||||
flags_json=flags_json, payload=payload, docs=docs, top_level=inputs.top_level,
|
||||
load_template("pr"), mode="pr", pr=args.number,
|
||||
flags_json=flags_json, payload=payload, docs=editable, review_only=read_only,
|
||||
top_level=inputs.top_level,
|
||||
guide_path=inputs.doc_guide,
|
||||
)
|
||||
drafted = draft_in_sandbox(inputs, prompt, cwd, env)
|
||||
|
||||
Reference in new issue
Block a user