Skip to content

test(cli): bind the shipped agentGuide const to the flag-registry parity check - #87

Open
suhaanthayyil wants to merge 1 commit into
mainfrom
test/agent-guide-const-parity
Open

test(cli): bind the shipped agentGuide const to the flag-registry parity check#87
suhaanthayyil wants to merge 1 commit into
mainfrom
test/agent-guide-const-parity

Conversation

@suhaanthayyil

@suhaanthayyil suhaanthayyil commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/entireio/entire-graph/trails/40

#81 bound AGENTS.md's claims to the real argument parsers and the help.go flag registry.
The artifact that actually ships is the agentGuide const in internal/cli/agents.go — it is
what agent-guide prints and what init-agents writes into a consuming project's
.entire/graph-agent.md. Nothing held it to that contract, so a parser or flag rename could
stay green in CI while every install carried a guide telling agents to use a flag that no
longer parses.

  • Factored the existing test body into checkGuideClaims, with an origin label so a drift
    report still names the text that has to change. The AGENTS.md test keeps its assertions and
    its message wording.
  • Added TestAgentGuideConstMatchesFlagRegistry, which runs the same contract over the const
    in-package, with no file read.
  • Taught parseGuideClaims to treat 4-space/tab-indented Markdown code blocks as invocations,
    alongside fenced blocks. Without this the const contributes zero flag claims: it uses the
    indented form throughout, while AGENTS.md uses fences. AGENTS.md has no indented code
    lines, so this is a no-op for the existing test. Covered by
    TestParseGuideIndentedCodeClaims.

The const now contributes 9 command claims and 20 flag claims. Mutation-checked: inserting a
--bogus-mutant flag into the const's reference block fails
TestAgentGuideConstMatchesFlagRegistry on both the parser and the help-registry assertion.

$ go test ./internal/cli/ -run 'AgentGuide' -count=1
ok  	github.com/entireio/entire-graph/internal/cli	0.957s

$ go test ./internal/cli/ -count=1
ok  	github.com/entireio/entire-graph/internal/cli	3.812s

$ go vet ./internal/cli/
(clean)

Test-only change; no production code touched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant