Repository navigation
docs(mcpx): re-sync story.md's AGENTS.md quote and guard it with a test - #374
Conversation
story.md claimed AGENTS.md is 109 lines (twice); it is 120. Two quoted lines no longer matched the file: step 3 (now covers per-tool types and catalog --budget) and the Scripts intro (now the globalThis no-imports text). Re-sync both, correct both counts, and fix the abridgement note to name what is actually left out (profiles, script contract, secrets). Add TestStoryDocumentIsCurrent (mirrors TestParityDocumentIsCurrent): every non-empty line of story.md's quoted block must be a verbatim line of AGENTS.md, and both stated line counts must equal its real length. It fails on the pre-fix tree with exactly those four divergences. story.md joins parity.md in treefmt.toml's excludes: prettier rewrites *emphasis* to _emphasis_ inside the quoted block itself, so the file can never be prettier-formatted without breaking the verbatim quote the new test guards. Fixes #365
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23e7dd8f1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| inAgents := make(map[string]bool, len(agentLines)) | ||
| for _, l := range agentLines { | ||
| inAgents[l] = true | ||
| } |
There was a problem hiding this comment.
Preserve quote ordering when validating source lines
If AGENTS.md later reorders existing lines while story.md retains their old order, this test still passes because it reduces the source to an unordered set and checks only membership; the same is true if the quote duplicates any valid line. That leaves the new drift guard green even though the fenced block no longer represents an abridged verbatim quote. Validate the quoted lines as an ordered subsequence of AGENTS.md instead.
Useful? React with 👍 / 👎.
Fixes #365
Problem
docs/story.mdpresents an abridged quote ofpkgs/mcpx/AGENTS.md, but both had drifted apart silently:typesandcatalog --budget) and the Scripts intro (now theglobalThisno-imports text).TestParityDocumentIsCurrentguardsdocs/parity.mdagainst.Solution
TestStoryDocumentIsCurrent(internal/cli/story_test.go, mirroring the parity guard): every non-empty line of story.md's quoted block must be a verbatim line of AGENTS.md, and both stated line counts must equal the file's real length. Verified it fails on the pre-fix tree with exactly the four divergences above, and passes after.pkgs/mcpx/docs/story.mdjoinsparity.mdintreefmt.toml's excludes: prettier rewrites*emphasis*to_emphasis_inside the quoted block itself (verified:prettier --writeon story.md changes the quotedagainst *your* working directoryline), so the file can never be prettier-formatted without breaking the verbatim quote the new test guards — the same structural conflict as parity.md.Verification
TestStoryDocumentIsCurrent: FAIL pre-fix (4 errors: 2 quote lines, 2 counts), PASS post-fix.internal/clisuite PASS (26.2s);internal/defaults(story.md link checks) PASS; gofmt/vet clean; taplo check on treefmt.toml PASS.Need help on this PR? Tag
@codesmith-botwith what you need.