Skip to content

docs(mcpx): re-sync story.md's AGENTS.md quote and guard it with a test - #374

Merged
dezren39 merged 1 commit into
mainfrom
sweep/365-story-agents-md
Oct 20, 2026
Merged

dezren39 merged 1 commit into
mainfrom
sweep/365-story-agents-md

Conversation

@dezren39

@dezren39 dezren39 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Fixes #365

Problem

docs/story.md presents an abridged quote of pkgs/mcpx/AGENTS.md, but both had drifted apart silently:

  • story.md said AGENTS.md is 109 lines in two places (:21, :2890); it is 120 (grew in d107815).
  • 2 of the quoted lines no longer matched AGENTS.md verbatim: step 3 (now also covers per-tool types and catalog --budget) and the Scripts intro (now the globalThis no-imports text).
  • No test referenced story.md, so the rot was invisible — the same failure TestParityDocumentIsCurrent guards docs/parity.md against.

Solution

  • Re-sync the two quoted passages to AGENTS.md's current text, correct both line counts to 120, and fix the abridgement note to name what is actually omitted now (profiles, the script contract, the secrets section).
  • New 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.md joins parity.md in treefmt.toml's excludes: prettier rewrites *emphasis* to _emphasis_ inside the quoted block itself (verified: prettier --write on story.md changes the quoted against *your* working directory line), 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.
  • Full internal/cli suite PASS (26.2s); internal/defaults (story.md link checks) PASS; gofmt/vet clean; taplo check on treefmt.toml PASS.
  • Single-repo: mcpx source lives only in this repo (dezren39/nix consumes it via a pinned source-only input, picked up on its next pin bump).

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

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
@dezren39
dezren39 requested a review from a team as a code owner October 20, 2026 00:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T00:11:29.070887Z 23e7dd8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3f1cc08-e4ae-4473-bd8f-58fda6bdb080
📥 Commits

Reviewing files that changed from the base of the PR and between fc34ab9 and 23e7dd8.

📒 Files selected for processing: 3
  • pkgs/mcpx/docs/story.md
  • pkgs/mcpx/internal/cli/story_test.go
  • treefmt.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +35 to +38
inAgents := make(map[string]bool, len(agentLines))
for _, l := range agentLines {
inAgents[l] = true
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@dezren39
dezren39 merged commit 04063ae into main Oct 20, 2026
17 checks passed
@dezren39
dezren39 deleted the sweep/365-story-agents-md branch October 20, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpx docs: story.md's AGENTS.md claims are stale again (109 vs 120 lines) and no test guards them

1 participant