Skip to content

fix(docs): check the guide's reference tables against the code in CI - #224

Merged
lg2m merged 8 commits into
fix/eng-979-ge0-2-samplesfrom
fix/eng-979-ge0-3-tables
Sep 30, 2026
Merged

lg2m merged 8 commits into
fix/eng-979-ge0-2-samplesfrom
fix/eng-979-ge0-3-tables

Conversation

@lg2m

@lg2m lg2m commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #223 (GE0.2). Merge order: #222 → #223 → this.
Slice GE0.3 of docs/plans/guide-expansion.md · Linear ENG-979. Last of the three GE0 sub-slices.

What changes for users

  • Policy table. Six policy keys (allowed_providers, denied_providers, max_output_tokens, require_https, allow_custom_providers, allow_literal_secrets) were documented as settable by any layer. They are administrator-only: a user config that sets them fails with managed-only policy settings are only allowed in managed configuration. The table now says so, and points users at the top-level max_output_tokens instead.
  • Keys. Alt-Up was documented as "focus the parent session". It pulls back the newest queued draft. The parent is Esc, when nothing else claims it; the footnote says what does.
  • Precedence table. It now lists QQ_JEV_APPROVAL, QQ_APPROVAL_DELEGATE, and the exact MDM identifiers: macOS dev.qq/ManagedConfig, and Windows HKLM\Software\Policies\dev.qq\ManagedConfig (REG_SZ).
  • Command table. tui.md "Every command" is now one row per command, exactly as the help overlay lists it.

How staleness is prevented

Test Fails when
qq-config: published_managed_only_policy_keys_are_exactly_the_ones_a_user_layer_rejects the new MANAGED_ONLY_POLICY_FIELD_NAMES differs from the set the loader actually refuses from a user layer. It is proven by loading each key from a Global and a Managed source.
policy_table_marks_exactly_the_managed_only_keys a policy row's "Who may set it" disagrees with that list, or a policy key has no row
precedence_table_names_every_override_and_mdm_source a QQ_* override the loader reads, or an MDM source, is missing from the precedence table
tui_command_table_is_the_registry the table's rows, titles, slashes or default keys differ from the qq-tui command registry (a rebound default, or an added or removed command)
troubleshooting_headings_quote_real_messages a quoted heading contains text no QQ source prints

For the table check, qq-tui now exports command_rows(). The tui.ron default chords moved from literals in SettingsBuilder::default to settings::default_chords(action), which both the builder and the registry read. There is no second copy to drift, and all 330 qq-tui tests pass unchanged.

Checking that each test can fail: I planted one defect per test (a policy key marked "any layer", a dropped QQ_* override, a changed chord, a reworded message), and each test named its defect.

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 (480 links resolve)

Compatibility and performance

  • qq-config gains one public const.
  • qq-tui gains CommandRow and command_rows(). The key-dispatch path is unchanged; the defaults are read once, as before.
  • No runtime, wire or store change.

After this stack

GE0 is done. Every version, runnable sample, and reference table in the guide is now a CI failure when it drifts. The next pages (GE10 concepts, GE5 keybindings, GE4 environment, …) each extend these same tests as they land.

@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 ✅ Completed 2026-09-29T06:05:35.355498Z eb64707 New commits
ℹ️ 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.

@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: 199d1e3323

ℹ️ 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 thread docs/guide/tui.md Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
@lg2m
lg2m force-pushed the fix/eng-979-ge0-3-tables branch from 2aec07a to 697a413 Compare September 29, 2026 04:30

@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: 697a413553

ℹ️ 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 thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread docs/guide/tui.md Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
@lg2m
lg2m added this pull request to stack #225 September 29, 2026 04:41
@lg2m
lg2m force-pushed the fix/eng-979-ge0-3-tables branch from 697a413 to 3dc6b5c Compare September 29, 2026 04:55

@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: 3dc6b5c99c

ℹ️ 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 thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread docs/guide/tui.md Resolved

@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: 9b0a63c84e

ℹ️ 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 thread src/docs_truth.rs Resolved
Comment thread docs/guide/permissions.md Resolved

@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: 6dfca7e073

ℹ️ 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 thread src/docs_truth.rs Resolved
Comment thread docs/guide/tui.md Resolved

@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: 74c7395d66

ℹ️ 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 thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread docs/guide/tui.md Resolved
Comment thread crates/qq-config/src/tests.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread src/docs_truth.rs Resolved

@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: eb64707196

ℹ️ 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 thread docs/guide/configuration.md Resolved
Comment thread docs/guide/tui.md Resolved
Four docs-truth tests, plus one in qq-config, fail CI when a reference
table drifts:
- The policy table must mark managed-only keys `managed layers only`.
  qq-config publishes MANAGED_ONLY_POLICY_FIELD_NAMES and a test proves it
  equals the set a user layer is refused with PolicyOutsideManaged.
- The precedence table must name every QQ_* override and both MDM sources.
- tui.md "Every command" must be one row per registry command with exactly
  its slashes and default chords. qq-tui exports command_rows(), and the
  tui.ron defaults move to settings::default_chords so there is one source.
- Every troubleshooting heading must quote text the code can print.

Fix what they found:
- Six policy keys were marked settable by any layer.
- The precedence table lacked QQ_JEV_APPROVAL, QQ_APPROVAL_DELEGATE and
  the Windows policy.
- Alt-Up was documented as focus-parent (it pulls back a queued draft; Esc
  focuses the parent).

Linear: ENG-979
… messages

- policy: a row naming a key the loader does not accept, or a key listed
  twice, fails; previously a removed key's stale row passed.
- precedence: each QQ_* variable must be an exact code span in its own
  row (QQ_CONFIG explicit, QQ_CONFIG_CONTENT inline, the rest overrides)
  and nowhere else; unknown QQ_* spans fail. Substring matching let a
  misplaced or suffixed name pass.
- tui command table: a duplicate title fails.
- troubleshooting: headings are matched against string literals from
  production code only (comments, test modules and tests/ are excluded).
  Each clause must occur in one literal, where a `{…}` placeholder matches
  one rendered token, not arbitrary text.
- tui.md: Esc dismisses only an error notice for the focused session, not
  every notice (app.rs handle_compose_key).

Linear: ENG-979
… contextual keys

- troubleshooting check: remove every `#[cfg(test)]` item, whatever its
  name (probe_tests, tests_support, gated fns and imports), not only
  `mod tests`.
- Quoted spans stay literal, so fixed commands in a message such as
  `qq ask "<prompt>"` are compared; only `…` is a placeholder.
- The xAI missing-credential heading is composed at run time, so it is
  rendered through the real CredentialStore and compared exactly.
- The keyring heading now quotes the real backend name (`OS keyring`),
  asserted against CredentialBackend's Display; the other keyring heading
  quotes `credential `…`` as the template does.
- tui command table: `?`, `Enter`, `Esc` and `Esc Esc` are checked on their
  own rows through an explicit per-command mapping instead of being dropped
  from every row.
- tui.md: an open `@` completion list also claims Esc first.

Linear: ENG-979
… every policy cell

- troubleshooting check: collect literals only from files a non-test build
  compiles, found by following `mod name;` declarations from each crate
  root and skipping any declaration gated by a cfg(test) attribute. Files
  gated on their parent's `mod` line (src/docs_truth.rs,
  qq-tui/src/fixtures.rs, qq-provider test_support) are now excluded; the
  walk reaches 172 production files.
- policy table: a non-managed key's cell must read `any layer` or
  `any; …`, so false guidance such as "administrator only" on allow_tools
  fails.
- Esc: at an approval prompt it denies the call and at a question it
  declines, so it never focuses the parent there (app.rs mode() /
  handle_approval_key, pinned by
  approval_prompt_captures_keys_and_sends_the_decision). permissions.md
  said Esc "leaves the prompt open"; it now says Esc denies, like `n`.

Linear: ENG-979
…during an amendment

- `cfg_requires_test` evaluates the predicate. `test`, `all(… test …)`,
  and `any(test, feature = …)` are test-only; `any(test, target_os = …)`
  ships. Both the test-item stripper and the module walk use it, so
  `#[cfg(all(test, feature = "native"))] mod tests` and qq-core's
  `all(test, unix)` fixtures are excluded.
- permissions.md: after Shift-Y / Shift-N, Esc first cancels the note and
  leaves the prompt open (handle_approval_key's amendment branch).

Linear: ENG-979
…ses overlays first

- configuration.md: allow_tools / allow_shell_prefixes / allow_hosts /
  shell_env are "any layer except an organization manifest"; enroll and
  refresh reject a manifest that sets them (RemotePolicyGrantsForbidden).
- qq-config publishes ORGANIZATION_FORBIDDEN_POLICY_FIELD_NAMES; the
  behavioral test now parses every key from user, managed, MDM, and
  organization sources, and the docs check enforces the three labels.
- tui.md: an open picker, palette, or overlay claims Esc before focus
  moves to the parent.

Linear: ENG-979
@lg2m
lg2m force-pushed the fix/eng-979-ge0-3-tables branch from eb64707 to dfcff83 Compare September 30, 2026 07:34
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@lg2m
lg2m merged commit 2c9b712 into main Sep 30, 2026
6 checks passed
@lg2m
lg2m deleted the fix/eng-979-ge0-3-tables 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