Repository navigation
Sync reviewer guidance into coding-agent instruction files - #162
Open
ebetancourt wants to merge 1 commit into
Open
ebetancourt wants to merge 1 commit into
ebetancourt wants to merge 1 commit into
Conversation
Add proofline.guidance: apply_review_guidance and write_review_guidance keep one managed block of the repository's reviewer guidance in files such as AGENTS.md and CLAUDE.md, and python -m proofline.guidance [--check] PATH... fetches the guidance once and syncs each file, or prints a diff and exits 1 when a file is stale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
A repository's Proofline reviewer guidance is the set of rules its pull requests are checked against. Coding agents read
AGENTS.mdorCLAUDE.mdbefore they write code, but they never see that guidance. They write code that breaks a rule, open a pull request, and the reviewer flags it. If the guidance is in the agent's instruction file, the agent follows the same rules before the pull request exists.Who it helps
What it adds
proofline/guidance.py:apply_review_guidance(text, guidance) -> stradds, replaces or removes one managed block between<!-- proofline:review-guidance:start -->and<!-- proofline:review-guidance:end -->.write_review_guidance(path, guidance, *, check=False) -> boolapplies it to a file and returns whether the file changed. Withcheck=Trueit writes nothing.python -m proofline.guidance [--check] PATH...fetches the guidance once withget_review_guidanceand syncs each file.--checkprints a unified diff and exits 1 when a file is stale. The IDs come from--organization-id/--repository-idorPROOFLINE_ORGANIZATION_ID/PROOFLINE_REPOSITORY_ID, as in the README's other examples, and the token fromPROOFLINE_TOKEN.tests/test_guidance.py: 21 tests, using the repository's loopbackServerfor the CLI. No network.Decisions
scripts/contracts.pyties the clients' public methods to API operations, so a helper on the clients would need a contract exception. If you'd rather have them onProoflineClientandAsyncProoflineClient, the move is small and I'm happy to make it.CLAUDE.mdsymlinked toAGENTS.mdstays a symlink.ValueError. The CLI reads and applies every file before writing any, so one malformed file changes nothing. It exits 2 with the reason, or with the HTTP status and problem detail when the request is refused.## Proofline review guidanceheading, one sentence tells the agent that Proofline reviews pull requests against this guidance and that it is synced, so changes belong in Proofline rather than in the file.guidancecan be theRepositoryGuidancethatget_review_guidancereturns or a string, so callers don't have to handleUNSET.How it was verified
python3 scripts/check.pypasses: generated code matches the contract,scripts/contracts.py(operation coverage and outcome vocabulary),ruff check,ruff format --check,mypy proofline scripts,pytest(255 passed), and the wheel and source-distribution install smoke tests.CLAUDE.mdsymlink toAGENTS.md, each marker error, check mode, and the CLI: one fetch for several files, the diff and exit code of--check, removal when guidance is unset, no writes when one file is malformed, a refused request, and missing IDs.