Skip to content

Codex MCP servers at user scope so every worktree inherits the token tools; --pinned-versions coverage check - #289

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
claude/codex-mcp-scope-pinned-versions-20260925
Sep 25, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
claude/codex-mcp-scope-pinned-versions-20260925

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Root cause (primary sources)

  • Codex loads a project .codex/config.toml only by walking from the project root to the current directory (developers.openai.com/codex, config-advanced). A git worktree is its own project root, and this repo's .codex/ is excluded through .git/info/exclude.
  • codex mcp add has no scope flag and always writes CODEX_HOME (codex mcp add --help, codex-cli 0.155.1).
  • So workflow and Codex workers in /tmp worktrees got none of the servers.

Applied on the workstation and read back (native, not only templates)

Check, from a fresh detached worktree at origin/main Before After
codex mcp list --json context-mode (plugin) only ai-memory, codebase-memory, context-mode, headroom, qmd, serena, socraticode
adoption_status.py --profile token-efficiency --client-wiring → client_wiring.complete false true
Each stdio server started from that worktree with the template's launcher (MCPorter ad-hoc list --stdio) — serena 23 tools, socraticode 26, headroom 3, codebase-memory 17, qmd 4; ai-memory /healthz 200
--pinned-versions — matched: codex, claude-code, qmd. Mismatched: rtk, markitdown, ai-memory, mcporter, which the cleanup session moved ahead of its pin-move PRs, so the divergence is intended. Unchecked: context-mode (npm-metadata); repomix, headroom, toon, ccusage, serena and socraticode have no Linux pin entry

On this host the six servers were added with the native codex mcp add, because the host has no adoption/hosts/<host>.json for render_config.py. SocratiCode keeps its pinned, versioned dist/index.js path, because its recipe creates no bin/ link, so a pin move updates the template and the host together.

Repair round (after the independent review)

The read-only review found two bugs in the new version_output_matches, both in code new to this PR and neither reachable by any pin checked in today:

  • Crash on a non-numeric minimum floor. A floor such as 2.0.0.dev0 raised and emptied the whole report.
  • Unanchored exact match. It was a substring test, so 2.10 matched 12.10.0.

Commit 698958a4 ports the bootstrap's own rules exactly:

  • exact is bounded by (^|[^0-9.])…([^0-9.]|$);
  • minimum uses a ported version_at_least that returns no-match for a non-numeric part.

It adds regression tests for both, and for six malformed pins-file shapes. The unit suite goes from 54 to 57 tests, all passing. The host coverage result is unchanged (complete: true; the same matched and mismatched sets).

Local commands run

validate.yml's offline validate-job steps, in order (zizmor/actionlint in CI only), plus evidence_manifest.py --check -> 0 failures
verdict_review_gate.py (from a worktree at origin/main) --root . --base origin/main -> no verdict rows changed
python -m unittest (uv Python 3.13 with jsonschema/PyYAML/numpy; PROMOTION_GATE_PYTHON set) -> Ran 5606 tests, OK (skipped=613) before the repair; after it: tests.test_adoption_status Ran 57, OK, and the validate list again, 0 failures

Residuals

  • Unchecked components: the seven have no Linux pin entry (context-mode is npm-metadata). Completing adoption/pins-linux-x86_64.json and bootstrap-linux.sh for them is the next PR; it makes new hosts install the whole token-efficiency profile.
  • ai-memory scoping in worktrees: workspace and project name resolution for agents in worktrees (.ai-memory.toml is untracked) is unchanged. Agents pass them per call.
  • Main checkout config: the main checkout's untracked project config still holds identical definitions, which take precedence there. A re-render reduces it to jcodemunch.
  • Codex trust step: Codex hooks after the ai-memory 2.4.0 cutover still await the user's /hooks trust step.
  • Review: the Codex cross-family review is skipped (resets 2026-09-30 23:50). The independent review is a separate read-only session.

🤖 Generated with Claude Code

…nned-versions coverage check

Codex loads a project .codex/config.toml only from the project root it runs in,
and the main checkout's copy is untracked, so Codex workers in fresh worktrees
had none of the token-practice MCP servers (coverage check complete=false).
The Codex user template now carries serena, socraticode, ai-memory, headroom,
codebase-memory and qmd; the project template keeps only jcodemunch (#240); the
context-mode cwd override is dropped. adoption_status.py gains an opt-in
--pinned-versions that runs only a pin's declared "exec" version_probe (#251)
and never an npm-metadata one. Applied on the workstation with codex mcp add
and read back from a fresh worktree: complete false -> true, all six servers
start. Decision: docs/decisions/2026-09-25-codex-mcp-scope.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 25, 2026
@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.

…, numeric minimum)

The independent review of #289 found two bugs in the new version_output_matches: a non-numeric minimum floor (e.g. 2.0.0.dev0) raised and emptied the whole report, and exact was an unanchored substring test (2.10 matched 12.10.0). Both now follow adoption/bootstrap-linux.sh: exact is bounded by (^|[^0-9.])...([^0-9.]|$), and minimum compares numeric parts via a ported version_at_least that returns no-match on a non-numeric part. Regression tests for both, plus malformed pins files. The host coverage result is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins
seathatflowsinourveins merged commit c303d8e into main Sep 25, 2026
23 of 26 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/codex-mcp-scope-pinned-versions-20260925 branch September 25, 2026 21:48
seathatflowsinourveins added a commit that referenced this pull request Sep 25, 2026
…, token wiring and local-model eval gates (#297)

* Grand-dashboard checkpoint: memory lifecycle v2, retrieval quality v2, token wiring and local-model eval gates

Adds four dated foundation gates for work that merged today (#289, #292, #293, and the #281 local-model receipts), inserted after the existing memory-lifecycle gate; no existing entry changed. States use the renderer's public metadata token alphabet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Re-run checks with the PR body's SOTA sources section

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Cross-family review (Codex CLI 0.155.1, gpt-6-astra, model_reasoning_effort=max, read-only sandbox), 2026-09-26. Run by the workstation coordinator against a clean checkout of main after merge. Supported findings get a repair PR (one repair round; residuals recorded).

DEFECTS FOUND

  • medium | adoption/templates/project.codex.config.template.toml:18 | Removing context-mode’s explicit project binding introduces cross-worktree ambiguity. The pinned Codex plugin declares cwd: "."; its resolver falls back to the newest Codex session. A two-session fixture resolved caller A to worktree B. | Fix: Restore deterministic per-worktree CONTEXT_MODE_PROJECT_DIR binding and verify concurrent sessions before removing the override.

  • medium | scripts/adoption_status.py:507 | Probe exit status is ignored. A real subprocess exiting 42 with the expected version in its error message returned checked: true, matches_pin: true. | Fix: Require returncode == 0 before accepting a match; add a regression covering failed probes whose diagnostics contain the pin.

  • medium | scripts/adoption_status.py:502 | The timeout kills only the immediate process. A reproduction returned after 0.2 seconds while its child remained running, violating the bounded-probe guarantee. | Fix: Run probes in an isolated process group and clean up descendants on timeout, interruption and completion, matching the bootstrap’s lifecycle handling.

  • medium | docs/decisions/2026-09-25-codex-mcp-scope.md:199 | The native_proven classification and PR’s workstation results lack retained execution artifacts. No evidence file contains the claimed client_wiring or --pinned-versions outputs; the narrative omits exact launcher invocations, exit codes and run metadata required by the acceptance policy. | Fix: Retain sanitized commands and actual returned results, or downgrade these claims to unverified host reports.

seathatflowsinourveins added a commit that referenced this pull request Sep 26, 2026
…ycle, context-mode Codex binding, retained coverage evidence (#333)

Repairs the GPT-6 cross-family findings on #289, #297, #300 and #303.

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins added a commit that referenced this pull request Sep 26, 2026
…ecks, four real limits, and a correction to #296's QMD row (#343)

* Record the token stack inside native Codex sessions, and correct #296's QMD row

Codex side of #296: one native `codex exec` session per tool (codex-cli
0.155.1, gpt-6-astra, effort max) in a dedicated worktree, using RTK's
standing instructions, the Context Mode plugin, the #289 user-scope MCP
servers and the CLIs. 11 of 15 tools pass their answer checks; RTK +17782
saved for the run-only worktree; nine exact o200k comparisons from 28.2% to
99.8%; Codex-returned usage 7,085,015 input (6,253,312 cached) and 164,906
output over 17 sessions. The four failures are real limits: jCodeMunch is
project-scoped (#240), QMD's catalog index excludes adoption/, Repomix
--compress dropped a declaration, Context Hub lacks the upstream facts.
#296's QMD PASS retrieved a wrong document for its question; its README now
says so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Sanitize the Codex E2E receipt after cross-family review (PR #343)

Codex review (gpt-6-astra, read-only) confirmed every number and evidence
class and asked for three fixes: replace the live-clone path, the
session-derived codebase-memory project id and the SocratiCode collection id
with placeholders, and state the QMD document count per attempt (121, then
122 as the live index grew).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant