Skip to content

fix(docs): run every guide sample against the real CLI and loader in CI - #223

Merged
lg2m merged 1 commit into
fix/eng-979-ge0-1-versionsfrom
fix/eng-979-ge0-2-samples
Sep 30, 2026
Merged

lg2m merged 1 commit into
fix/eng-979-ge0-1-versionsfrom
fix/eng-979-ge0-2-samples

Conversation

@lg2m

@lg2m lg2m commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #222 (GE0.1). Merge order: #222 → this.
Slice GE0.2 of docs/plans/guide-expansion.md · Linear ENG-979.

What changes for users

Every copyable sample in the guide now works when pasted. Fixed:

  • Policy sample. Pasting the policy sample into config.ron failed with managed-only policy settings are only allowed in managed configuration, because it mixed in six administrator-only keys. The keys any layer may set are now one sample, and the managed-only keys are a separate managed.ron sample, which also shows the three deny_* keys.
  • Session ids. The resume hint and qq run --session showed ULID-style 01J… ids. Real ids are 32 hex characters, and the old form fails with identifier must contain 32 hexadecimal characters.
  • MCP pin. It was truncated (5a1f…e9c0), which the loader rejects. It is now a full digest, with a pointer to qq mcp inspect.
  • Pack and Bedrock Mantle samples. The pack manifest's mcp value and the Mantle snippet were not valid RON.
  • Doctor sample. It was missing the mcp row that qq doctor prints.

How staleness is prevented

Three new tests in src/docs_truth.rs, part of cargo test:

Test What it runs
every_ron_sample_in_the_guide_loads Each ```ron block is written to an isolated temp config tree and loaded by the real ConfigLoader (or load_tui_config) as the file its fence names: bare ron is config.ron; ron managed.ron, ron pack.ron and ron tui.ron name the others. Every model route the resolved snapshot reports must be in its provider's catalog.
every_qq_command_in_the_guide_parses Every qq … line in ```sh blocks and every inline `qq …` span goes through the real clap Cli. Synopses (capital placeholders, …, <…>, […]) are skipped, and prose may name a command without its required arguments.
output_samples_in_the_guide_match_the_code The qq doctor sample lists CHECK_NAMES in order; quickstart shows resume_hint exactly; the headless exit-code table has a row per HeadlessStatus with its code.

Checking that each test can fail: I planted one defect of each kind and confirmed each test names it. The defects were: a typo'd flag in an sh block, a typo'd inline subcommand, a nonexistent model route, a renamed MCP key, an invalid pack enum value, a bad tui.ron chord, and a dropped doctor row. All tests failed first on the real defects above.

Verification

  • cargo fmt --check
  • cargo clippy --workspace --all-targets --all-features -D warnings
  • cargo test --workspace (0 failures)
  • the exact-test guard
  • nub run build (479 links resolve)

Compatibility and performance

Guide and tests only. The new tests run in about 30 ms. No runtime change.

Next in the stack

GE0.3: the reference tables (managed-only markings, precedence rows, the TUI command table, troubleshooting messages) are checked against the code. This fixes Alt-Up and the policy table's "any" markings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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 ⚠️ Failed 2026-09-29T03:54:23.041032Z 1e38a4b 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.

Three docs-truth tests make sample drift a CI failure:
- Every ```ron block loads through the real ConfigLoader as the file its
  fence names (config.ron by default; managed.ron, pack.ron, tui.ron when
  titled), and every model route it resolves to is in the catalog.
- Every `qq …` command in sh blocks and inline spans parses with the real
  clap CLI.
- The doctor sample, resume hint and exit-code table match the code.

Fix what they found:
- The policy sample put six managed-only keys in a block a user could
  copy (PolicyOutsideManaged). They are now a separate managed.ron sample.
- The pack and Mantle samples were not valid RON.
- The MCP pin was truncated.
- The doctor sample was missing the mcp row.
- Session ids were ULID-style `01J…`; real ids are 32 hex characters.

Linear: ENG-979
@lg2m
lg2m force-pushed the fix/eng-979-ge0-2-samples branch from a0aaad7 to 8d2011c Compare September 30, 2026 07:34
@lg2m
lg2m merged commit 2979fbb into main Sep 30, 2026
6 checks passed
@lg2m
lg2m deleted the fix/eng-979-ge0-2-samples branch September 30, 2026 20:21
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.

1 participant