Repository navigation
feat(codex): Group A — project-route-context, empty-board masquerade closed (dogfood-remediation) - #2629
Conversation
…y context Group A (project-route-context) of codex-plugin-dogfood-remediation. - Add resolveProjectContext in v5/genie-db: four-value model (effectiveLaunchCwd, worktreeConfigRoot, absolute gitCommonDir, genieStorageRoot=dirname(gitCommonDir)) with typed states project-context-unavailable / project-database-unavailable / unsupported-project-layout. Bare/submodule/external-git-dir are rejected before any DB lookup; nested repos stop at their own boundary; linked worktrees keep config under the linked root but read the DB under the common root's parent. - Wire the resolver into the shared MCP server loop (opt-in) so genie mcp fails closed with a structured error instead of masquerading as a healthy empty board; ui-bridge is unaffected. Re-resolve only until the context settles ok. - Add genieFacadeMcpEntry (<GENIE_HOME>/bin/genie, args [mcp], no cwd) and make genie init always reconcile one marker-owned Codex route independent of plugin and delivery state; remove the verified-current gate. - Remove the Codex plugin MCP route: drop mcpServers + MCP capability from the Codex manifest and delete plugins/genie/.mcp.json; retain Claude's inline launcher and its regression coverage. Reconcile build + smoke gates. - Tests: resolver fixtures for every layout, fail-closed absent-db, facade marker, plugin-route removal, and a two-repo migration integration test.
…flake openReadonlyDb opened the read-only handle with a raw bun:sqlite call, bypassing the shared sqlite-open primitive that sets busy_timeout first. Under concurrent access a straggling WAL writer surfaced as an instant -32603 "database is locked". Apply BUSY_TIMEOUT_MS to the readonly connection (valid on readonly, no file mutation; absent-db still throws before the pragma so the degrade-to-null contract holds). Quiesce the Group-A test writers with wal_checkpoint(TRUNCATE) before readers open.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13e9fcc5d4
ℹ️ 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".
| "developerName": "Namastex Labs", | ||
| "category": "Developer Tools", | ||
| "capabilities": ["Skills", "Hooks", "MCP"], | ||
| "capabilities": ["Skills", "Hooks"], |
There was a problem hiding this comment.
Restore Codex health checks after removing plugin MCP
Removing the Codex plugin MCP declaration makes the newly shipped plugin fail Genie's existing activation health path: probeCodexGeniePlugin() still delegates to inspectCodexPluginMcpUsability(), which requires manifest.mcpServers === './.mcp.json', and proveCodexPluginHealth() rejects any snapshot with usable !== true. In an install/update/doctor run against this manifest, the active plugin is therefore reported as unusable (or the setup/update proof aborts) even though the project fallback is now the intended route; update those probes/checks to validate the new project-route contract instead of the removed plugin route.
Useful? React with 👍 / 👎.
| const { MCP_TOOLS, openReadonlyDb, resolveProjectContext } = await import('../lib/v5/mcp-tools.js'); | ||
| const { runMcpServerLoop } = await import('../lib/v5/mcp-server.js'); | ||
| await runMcpServerLoop({ | ||
| tools: MCP_TOOLS, | ||
| openReadonlyDb, | ||
| // Fail-closed: missing repository context / genie.db / unsupported layouts | ||
| // surface as a typed MCP error instead of a healthy-looking empty board. | ||
| resolveContext: resolveProjectContext, |
There was a problem hiding this comment.
Keep health-session MCP probes out of fail-closed CWDs
Injecting resolveProjectContext into every genie mcp session means a tools/call from a non-Git or no-DB cwd now returns isError: true; however the activation proof still launches runBoundedCodexMcpSession() from a fresh mkdtemp directory and requires genie_wish_status to return a non-error result. Once setup/update reaches that proof, the bounded session will fail on project-context-unavailable instead of proving the plugin launcher, so seed a real initialized project for the health probe or relax the probe to accept the new fail-closed result.
Useful? React with 👍 / 👎.
Group A removed the Codex plugin MCP route (no manifest mcpServers, no MCP capability, no plugin .mcp.json); the marker-owned project .codex/config.toml is now the Codex MCP path and Claude keeps its inline launcher. proveCodexPluginHealth still required snapshot.usable (Codex-MCP-route usability) and a read-only wish_status that returned isError:false, so a fresh install --integrations codex rejected the post-A plugin as unhealthy and smoke:codex failed. Redefine plugin health: a healthy plugin provides skills + hooks + the retained Claude mcp-launcher.cjs and does NOT register a Codex MCP route. Drop the snapshot.usable gate (usable stays the project-route signal for isUsableCodexPlugin). The bounded health session now accepts a fail-closed typed no-project-context wish_status (project-context-unavailable / project-database-unavailable / unsupported-project-layout) as read-only-healthy, since the throwaway probe cwd is not a project — the launcher spawning and speaking MCP is the signal, an absent board there is expected. Any other tool error is still rejected. Update reject-matrix + health-session tests to the new contract; manifest/.mcp.json absence assertions unchanged.
…s, IN_PROGRESS The H3 SessionStart line surfaced ledger drift: waves 1+2 shipped 2026-07-22 (PRs automagik-si#2625/automagik-si#2626/automagik-si#2628/automagik-si#2629, per-group SHIP reviews, validations reproduced) but their evidence and criteria were never recorded; status still read APPROVED with execution long underway. - status APPROVED -> IN_PROGRESS - 41 evidence-backed criteria ticked (5 -> 46/67): Groups A-D ACs + global criteria owned by merged groups; deliberately NOT ticked: the two live 'codex mcp get genie --json' operator proofs, Group F/G criteria, and all post-merge QA rows - appended the waves-1+2 evidence block, the seven live-QA fixes (automagik-si#2631-automagik-si#2634, automagik-si#2636), Group E's actual merge commit (4be6917), and the open automagik-si#2633-deferred follow-up (pre-A route-arm retirement) Adversarially verified pre-commit by the pm-ledger-verify workflow: 0 must-fix; its 4 advisory findings (defect count, untracked follow-up, unrecorded E merge) are incorporated above.
Wave 2 of
codex-plugin-dogfood-remediation. Group A (gated on Group B's SHIP, now merged).What
resolveProjectContextreturns typedproject-context-unavailable/project-database-unavailable/unsupported-project-layoutbefore any MCP tool can serialize empty success; bare/submodule/external-git-dir layouts are rejected, never falling outward or to cache.effectiveLaunchCwd, separateworktreeConfigRoot, absolutegitCommonDir(git rev-parse --path-format=absolute --git-common-dir),genieStorageRoot = dirname(gitCommonDir); the only DB candidate is<genieStorageRoot>/.genie/genie.db. Neverchdir, never considers the plugin cache. Stops at the nearest nested repo; linked worktrees keep config at the linked root while the DB follows gitCommonDir.genie initalways reconciles one marker-owned.codex/config.tomlroute (facadeGENIE_HOME/bin/genie,args=['mcp'], no cwd override), independent of plugin/delivery state, atomic writes, unrelated TOML preserved byte-for-byte. Unowned/damaged/malformed routes are classified and never rewritten.mcpServers+.mcp.json; Claude's separate inline launcher retained and still covered.Validation (reproduced by orchestrator)
bun testover the 5 Group-A files → 94 pass / 0 fail, codex-present AND codex-stripped-from-PATH. typecheck clean; the suite makes zero livecodexcalls (CI-portable).Review + fix
Adversarial review caught a HIGH:
openReadonlyDbbypassedsqlite-open.ts'sbusy_timeout, flaking "database is locked" 4/5 runs under the codex-stripped (CI) condition. Fixed — the readonly open now applies the sharedBUSY_TIMEOUT_MS, and the new tests checkpoint (wal_checkpoint(TRUNCATE)) before closing writers. Re-verified 33 consecutive clean runs codex-stripped (fixer 19 + orchestrator 14).Deferred to Group E (config-layer diagnostics, per Decision 15)
Distinct typed states for untrusted-config, global same-key route, effective-layer shadowing, route-collision, route-shadowed, project-trust-required — these are doctor/init diagnostics, not read-only-MCP-server states. AC3's live
codex mcp getcheck is for post-merge live QA (kept out of CI per the portability rule).