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
@@ -8,12 +8,12 @@ from collections.abc import Mapping
|
||||
from pathlib import Path
|
||||
|
||||
from docs_review import git
|
||||
from docs_review.draft import build_prompt, parse_summary, render_pr_body
|
||||
from docs_review.draft import build_prompt, load_template, parse_summary, render_pr_body
|
||||
from docs_review.drafter import draft_in_sandbox
|
||||
from docs_review.flags import Flag, compute_flags, group_uncovered, whole_repo_changes
|
||||
from docs_review.inputs import Inputs, expand_patterns
|
||||
from docs_review.inputs import Inputs, expand_patterns, split_review_only
|
||||
from docs_review.report import MONTHLY_MARKER, render_issue, stage1_json
|
||||
from docs_review.run_pr import TASK_PROMPT, read_guide, read_texts
|
||||
from docs_review.run_pr import read_guide, read_texts
|
||||
|
||||
MONTHLY_PREFIX = "docs-review/monthly-"
|
||||
MONTH_PATTERN = re.compile(r"^\d{4}-(0[1-9]|1[0-2])$")
|
||||
@@ -123,9 +123,11 @@ def run_monthly(inputs: Inputs, forge, env: Mapping[str, str], cwd: Path,
|
||||
MERGE_CONFLICT_NOTE.format(branch=reuse["head"]["ref"], base=base))
|
||||
return 0
|
||||
flags_json = json.dumps(stage1_json(flags, mode="monthly", head_sha=month))
|
||||
editable, read_only = split_review_only(docs, inputs.review_only)
|
||||
prompt = build_prompt(
|
||||
TASK_PROMPT.read_text(encoding="utf-8"), mode="monthly", pr=None,
|
||||
flags_json=flags_json, payload=NO_DIFF_PAYLOAD, docs=docs,
|
||||
load_template("monthly"), mode="monthly", pr=None,
|
||||
flags_json=flags_json, payload=NO_DIFF_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