You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI-assisted contributions (and new human contributors) currently reconstruct the project's load-bearing conventions from scattered sources: ARCHITECTURE.md, prompt-content test javadocs, issue history, and the code itself. Several rules are easy to violate without knowing they exist — every AI call must go through ReviewTokenLedger; prompt constants are concatenated into budget-overhead estimates in three places; PrReviewPromptsContentTest pins guidance that specific issues fought for; @UserMessage placement is guarded by dedicated tests. Violations surface late, as review findings or broken budgets, instead of never happening.
This matters more during the #669 refactor, where prompts, budgeting, and the call graph are all being restructured at once.
Proposed Solution
Add an AGENTS.md at the repo root as the single agent-facing engineering doc, and keep any assistant-specific files (e.g. CLAUDE.md) as one-line pointers to it. Content:
The invariants: token-ledger gating, REVIEW_MAX_AI_CALLS accounting, the three prompt-overhead estimation sites, prompt-content pinning tests, the eval corpus (-Peval) as the recall gate, the lockstep rule for prompt constant + @V param + inputs record + assembler.
The map: package responsibilities, where each pipeline stage lives, which test doubles exist for streaming (FakeTokenStream and friends).
Kept current by convention: a PR that changes an invariant updates AGENTS.md in the same diff.
Alternatives Considered
Keep relying on ARCHITECTURE.md + test javadocs — describes structure well, but the invariants and why-nots stay implicit and get rediscovered the hard way.
Priority
Nice to have — but cheapest right before the v0.7 refactor, which is when the invariants will be under the most pressure.
Problem Statement
AI-assisted contributions (and new human contributors) currently reconstruct the project's load-bearing conventions from scattered sources:
ARCHITECTURE.md, prompt-content test javadocs, issue history, and the code itself. Several rules are easy to violate without knowing they exist — every AI call must go throughReviewTokenLedger; prompt constants are concatenated into budget-overhead estimates in three places;PrReviewPromptsContentTestpins guidance that specific issues fought for;@UserMessageplacement is guarded by dedicated tests. Violations surface late, as review findings or broken budgets, instead of never happening.This matters more during the #669 refactor, where prompts, budgeting, and the call graph are all being restructured at once.
Proposed Solution
Add an
AGENTS.mdat the repo root as the single agent-facing engineering doc, and keep any assistant-specific files (e.g.CLAUDE.md) as one-line pointers to it. Content:REVIEW_MAX_AI_CALLSaccounting, the three prompt-overhead estimation sites, prompt-content pinning tests, the eval corpus (-Peval) as the recall gate, the lockstep rule for prompt constant +@Vparam + inputs record + assembler.FakeTokenStreamand friends).finish_reason=lengthper fix(ai): stop retrying a response truncated at the length cap #495). Recording the failure reason is what stops the alternative from being re-proposed.Alternatives Considered
ARCHITECTURE.md+ test javadocs — describes structure well, but the invariants and why-nots stay implicit and get rediscovered the hard way.Priority
Nice to have — but cheapest right before the v0.7 refactor, which is when the invariants will be under the most pressure.