Skip to content

fix(docs): fail CI when the guide's versions drift; correct server ownership - #222

Merged
lg2m merged 4 commits into
mainfrom
fix/eng-979-ge0-1-versions
Sep 30, 2026
Merged

lg2m merged 4 commits into
mainfrom
fix/eng-979-ge0-1-versions

Conversation

@lg2m

@lg2m lg2m commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Base: main (#186 merged; rebased onto v0.1.5). Bottom of the GE0 stack: this → #223 → #224. The first commit folds in the GE0 plan split that #186 did not carry.
Slice GE0.1 of docs/plans/guide-expansion.md · Linear ENG-979 (parent ENG-928).

What changes for users

Four fixes to what the live docs site says:

  • Quitting the TUI. The site said runs "keep going" after you quit. That is only true under qq serve. A qq that started its own server cancels its queued and running runs when it quits (history is kept). tui.md now has an Exiting section that explains both cases and how to keep runs alive.
  • qq run and a running server. The site said qq run connects to the running server. It never does. It exits 4 with session store is owned by another running qq process while a TUI or qq serve is open. This is now in headless.md, the exit-code table, and a troubleshooting entry keyed on the real message.
  • Stale versions. Nine stale version samples are fixed: install pins, the --version samples, and the qq doctor sample, which showed protocol 27 / store schema 34 (the build is 30 / 39).
  • design/protocol.md. It said PROTOCOL_VERSION = 28 (the code is 30) and had no entries for 29 or 30. It now has both: 29 adds max and 30 adds default, each with its store schemas.

How staleness is prevented from now on

Two new tests in src/docs_truth.rs. They run in cargo test, so CI fails on drift:

Test Fails when
every_product_version_in_the_guide_is_one_current_release the QQ versions in docs/guide/ and README.md are not all one version, or that version is neither CARGO_PKG_VERSION nor the previous CHANGELOG.md release. A string that is not QQ's version sits on a line ending with <!-- not-qq-version --> (the Codex client version); only that line is exempt.
every_compatibility_number_in_the_guide_is_this_builds any protocol N / capabilities N / descriptor N / store schema N in the guide differs from this build's, or design/protocol.md doesn't read PROTOCOL_VERSION = <current> and have a Version <current> … paragraph.

This follows the release rule from v0.1.5 (#228). The bump PR leaves the guide's pins alone, because the site deploys on merge, before the tag's assets exist. That is why the first test also accepts the previous release. After the assets are published, the new cargo xtask release --docs moves every pin at once (runbook step 6). It replaces whole tokens only: 10.1.4, 0.1.40 and 0.1.4.1 are left alone, as the unit tests show. The bump itself no longer rewrites docs.

Both tests failed first on the stale references (red), then passed after the fixes (green).

Verification

  • In a throwaway worktree, a scratch cargo xtask release 0.1.6 left the pins on 0.1.5, and docs-truth passed. cargo xtask release --docs then moved 9 references across cli.md, install.md and troubleshooting.md, and docs-truth passed again.
  • A planted mixed pin (0.1.4 next to 0.1.5) failed the test, and so did a stale one (0.1.3).
  • The prose was checked on a build of this branch with an isolated HOME:
    • qq serve plus qq run gives exit 4 and the quoted message.
    • The qq doctor sample matches real output.
    • SessionRuntime::shutdown cancels every unfinished run; the existing test shutdown_cancels_running_and_queued_prompts_before_returning covers it.
  • Checks run:
    • 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 internal links resolve)

Compatibility and performance

Docs and tests only, plus the release tool. No runtime, wire or store change, and no hot path touched.

Next in the stack

  • GE0.2: every qq … and RON sample in the guide is executed against the real CLI and config loader in CI.
  • GE0.3: the reference tables (policy managed-only keys, precedence, the TUI command table, troubleshooting messages) are checked against the code. This also fixes Alt-Up and the six managed-only keys.

@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-29T04:58:51.082417Z 6501e9a 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: 5181a5201a

ℹ️ 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 xtask/src/release.rs Resolved
Comment thread src/docs_truth.rs Resolved
Comment thread xtask/src/release.rs Resolved
Comment thread docs/guide/headless.md Resolved
@lg2m
lg2m force-pushed the fix/eng-979-ge0-1-versions branch from 5181a52 to 00fa9a0 Compare September 29, 2026 04:04
@lg2m
lg2m changed the base branch from docs/eng-928-guide-expansion-plan to main September 29, 2026 04:04

@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: 00fa9a0d6c

ℹ️ 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 docs/plans/progress/guide-expansion.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: 405c7c2948

ℹ️ 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/runbooks/release.md Resolved
@lg2m
lg2m added this pull request to stack #225 September 29, 2026 04:41
…nership

Two docs-truth tests make version drift a CI failure:
- Every QQ version in docs/guide and README.md must equal the workspace
  version; strings that are not QQ's go in FOREIGN_VERSIONS with a reason.
- Every protocol, capabilities, descriptor and store-schema number the
  guide states must equal this build's, and design/protocol.md must name
  and describe the current PROTOCOL_VERSION.

`cargo xtask release X.Y.Z` now rewrites the old version in those files
and commits them with the bump, so a release keeps the guide passing.

Fix what the tests found: stale 0.1.2/0.1.3 pins and samples, the doctor
sample's protocol 27 / descriptor 9 / store schema 34, and
design/protocol.md stuck at 28 with no 29/30 paragraphs.

Also correct the server-ownership prose (checked on a build):
- Quitting a TUI that started its own server cancels its runs; runs
  continue only under `qq serve`.
- `qq run` never connects to a server. It exits 4 with "session store is
  owned by another running qq process" while a TUI or `qq serve` is open.

Linear: ENG-979
…acked files only

- cargo xtask release rewrites only tracked, regular guide/README files
  (from `git ls-files`), never an untracked draft or a symlink target.
- Foreign versions are exempt per line via a shared `<!-- not-qq-version -->`
  marker that both the release rewrite and docs-truth honour, rather than
  per (file, token). A stale QQ sample equal to a foreign token on the same
  page now fails, and a QQ release equal to a foreign version leaves the
  marked line alone.
- The compatibility check also reads the hyphenated `store-schema N`.
- Server-ownership prose, checked on a build:
  - A second TUI attaches to the first TUI's server, and quitting the
    first cancels runs from both.
  - A concurrent `qq run` also holds the store and makes another exit 4;
    separate data directories avoid it.
- Condense the GE0.1 ledger receipt to the workflow's 15-line limit.

Linear: ENG-979
v0.1.5 (#228) moved the rule: the bump PR must not move the guide's
version pins, because the site deploys on merge before the tag's assets
exist; a follow-up docs PR moves them. GE0.1's exact-equality check and
bump-time rewrite contradicted that.

- docs-truth: every QQ version in the guide and README is one version,
  the manifest's or the previous CHANGELOG.md release; stale or mixed
  pins still fail.
- `cargo xtask release X.Y.Z` no longer rewrites docs.
  `cargo xtask release --docs` moves every pin from the previous release
  to the manifest version for runbook step 6 (no commit).
- runbook documents both.

Linear: ENG-979
@lg2m
lg2m force-pushed the fix/eng-979-ge0-1-versions branch from 6501e9a to 7f300be 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.

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