docs: comprehensive AGENTS.md domain coverage#30
Merged
Conversation
Each domain's contract (parsed by src/runtime/contracts.ts) now documents every non-test source file with its purpose and cross-file/cross-domain relationships, instead of only the 4-5 most central files. Biggest change is src/runtime/AGENTS.md (~45 files grouped by subsystem: state machine, contracts, plan/task tools, artifacts, recovery flows, TDD, git sync, status/UI, timers, misc). Also touches src/storage, src/instructions, src/settings, src/session, src/AGENTS.md, instructions/AGENTS.md, and .github/AGENTS.md. src/git, src/guard, src/worktree, src/project-local, and the root AGENTS.md were already adequate and left untouched. Verified with `npx vitest run src/runtime/contracts.test.ts` (schema parses without errors for all 14 AGENTS.md files) and full `npx vitest run` (378/378 passing). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lings Adds short inline comments at the source of invariants that were only documented (if at all) in AGENTS.md, so the constraint is visible right where it could be silently broken: atomic-write guarantees in storage/fs.ts, the state.json normalization blast radius, the dual-gate tool-policy<->stage-behavior coupling (guard + runtime sides), strict stage/step ordering with recovery as the sole exception, the AGENTS.md-only write restriction in contracts.ts, the three-layer instructions merge order, settings worktree-field precedence, worktree path/gitignore/git-watcher couplings, and the session header version contract in handoff.ts. No behavior changes - comments only. Verified with `npx vitest run` (378/378 passing), `npx tsc --noEmit` (clean), and `npx biome check` (clean) on all touched files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.