Repository navigation
#611 Nightly doc-accuracy reviewer opens a draft PR with its fixes - #612
Merged
Merged
Conversation
…fixes, not just issues [no-ut] Filing an issue throws the verification away. The job already reads the source and confirms file:line on both sides; serialising that to prose means the next human re-derives all of it before they dare trust it. The #604-#608 batch cost a full session re-reading DagScheduler.cs to confirm what the bot already knew. A diff carries the verification in a form you can check by looking at it. Split into two jobs, and the split is the security boundary rather than organisation. `review` keeps contents:read and holds the LLM plus the author-controlled input; its only output is a patch. `open-pr` holds the write token, contains no LLM, and sees nothing but a patch that already passed a doc/-only path allowlist. Actions permissions have no path or branch scope, so "may commit to doc/ on a non-main branch" cannot be expressed as a token grant — narrowing it has to be structural, and main's protection currently requires neither reviews nor checks. Claude edits files; it does not author diff text. Hunk headers encode exact line numbers and context counts, git apply rejects the whole patch on any mismatch, and models miscount context lines — so git diff derives the patch mechanically from edits the model is actually good at making. Merge main into the branch rather than rebase: a rebase rewrites it and could only be pushed with --force, which would clobber whatever was committed there by hand. Merge keeps every push a fast-forward. A conflict aborts, comments on the PR and fails the run; nothing is ever auto-resolved. The extra merge commits never reach main because the repo squash-merges. Issues are still filed unchanged — they are this layer's dedup ledger, and Fixes #N in the PR body means merging closes them so the ledger self-cleans. The path guard checks tracked paths only. Matching on git status would have failed every single run, because the scope step leaves merged.json, prs.txt and aff_*.json untracked in the workspace; untracked files are never staged, so they cannot reach the patch anyway. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SVvtTh6p1AJoSX85AGcAhF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #611
Extends the Layer-2 nightly reviewer (#490) so it applies the fixes it finds and opens a draft PR, instead of only filing issues.
Why
Filing an issue throws the verification away. The job already reads the source and confirms
file:lineon both sides — serialising that to prose means the next human re-derives all of it before they dare trust it. The #604–#608 batch (PR #610) is the measurement: the bot had verified every claim, and the fix still cost a full session of re-readingDagScheduler.csto confirm what the bot already knew.The job split is the security boundary
reviewcontents: **read**,issues: writedoc/. Output: a patch artifact.open-prcontents: write,pull-requests: writedoc-drift/nightly, opens/updates the draft PR.The existing workflow header documents prompt injection as expected and pins the worst case at "one stray issue". Granting the LLM step
contents: writewould move that to "arbitrary commit onmain" — andmain's protection currently requires neither reviews nor status checks. Actionspermissions:has no path or branch scope, so "may commit todoc/on a non-main branch" is not expressible as a token grant. Narrowing it has to be structural.A path guard between the jobs fails the run if any tracked file outside
doc/was touched.Two decisions worth reviewing
Claude edits files; it does not author diff text. Unified-diff hunk headers encode exact line numbers and context counts,
git applyrejects the whole patch on any mismatch, and models miscount context lines.git diffderives the patch mechanically.git merge origin/main, not rebase. A rebase rewrites the branch and could only be pushed with--force— which would clobber commits pushed to that branch by hand. Merge keeps every push a fast-forward, so plaingit pushalways suffices. Conflict → abort, comment on the PR, fail the run; never auto-resolved. The merge commits never reachmainbecause the repo squash-merges.Verified, not just written
run:block passesbash -n.src/edit → fails. The first case was a bug I introduced —scopeleavesmerged.json/prs.txt/aff_*.jsonuntracked in the workspace, so agit status-based guard would have failed every single run. It now checks tracked paths only; untracked files are never staged, so they cannot reach the patch anyway.Fixesdedup:#601suppressed as already-present,#60kept despite being a substring (grep -vxF).open-prrehearsal against a sandbox with a diverged branch, a hand-pushed maintainer commit on it, and an advancedmain: merge OK →git apply --3wayclean → push with no--force→ the maintainer's edit survived intact in both the file and the history.The one acceptance criterion still open is a real nightly run on the runner — can be forced early with
workflow_dispatch.Not in scope
typhon-claudein thereviewjob. The reviewer never readsclaude/, which is exactly why all five [doc-drift] system-types README incorrectly states one failure cannot abort the tick #604–[doc-drift] 10-runtime.md lifecycle hooks table omits OnTickAborted / FatalStop; RuntimeOptions table omits SystemExceptionPolicy #608 suggested fixes were incomplete — they missed D3 (engine-track exemption) and D1 (system-vs-chunk granularity), both stated in the design doc andrules/runtime-scheduling.md. Worth doing, but it putsTYPHON_CLAUDE_TOKENinto the job that reads hostile input, so it is a deliberate security call rather than a freebie.🤖 Generated with Claude Code
https://claude.ai/code/session_01SVvtTh6p1AJoSX85AGcAhF