Repository navigation
feat(codex): Group B — host-observation attestation + app-server CWD proof (dogfood-remediation) - #2625
Conversation
Group B (host-observation-attestation) keystone for the dogfood remediation wish. - Add production CodexHostObservation: one immutable typed result of runtime/plugin-observable facts only (plugin facts, bounded sanitized advisory stderr, optional child self-report, cache-family witness, typed failure). Accepts advisory stderr only with exit 0 + exactly one schema-valid JSON stdout; rejects timeout/overflow/nonzero-exit/ malformed-or-duplicate JSON/invalid-version/duplicate-registration/ unsafe-cache. It never carries raw thread/start.cwd or control facts. - Add the pure authenticated-delivery-record assessment (matching|absent|invalid|mismatch) plus the stable delivery-incomplete result (authority none, exit 1, deliveryComplete false). - Enforce the assessment inside beginActivation immediately before the first journal write; a non-matching re-observed record refuses with zero mutation, so no stale permit bypasses the inner guard. Map the new begin result through the executor. - Extract the pure release-version grammar + stripControl into a leaf module so host-observation can share them with no import cycle; re- export from codex-activation for existing importers. - Add the black-box CodexCwdEvidence harness and a real codex app-server integration proof: MCP child effective process.cwd() equals a Codex- launched control by string + OS directory identity for root, nested, symlink-normalized, and linked-worktree layouts, with sequential and concurrent two-repo threads, per-case raw request + PID + effective CWD + tagged sentinel, and no PID crossing a differing effective CWD. Skips honestly when no runnable codex app-server is available.
|
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: 728233f9bb
ℹ️ 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".
| const child = spawn(codexCommand, ['app-server'], { | ||
| env: { ...process.env, CODEX_HOME: codexHome, RUST_LOG: 'error' }, | ||
| stdio: ['pipe', 'pipe', 'pipe'], | ||
| }) as ChildProcessWithoutNullStreams; |
There was a problem hiding this comment.
Handle missing Codex before spawning app-server
In environments without a codex binary, this spawn() emits an error event that is not handled by the returned harness path, so the integration suite reports an unhandled test error instead of honoring the advertised skip path. I reproduced this by running bun test tests/integration/codex-app-server-cwd.test.ts with no codex on PATH; the always-run gate passed, the cases were skipped, but Bun still exited with an unhandled ENOENT.
Useful? React with 👍 / 👎.
| const harnessRoot = mkdtempSync(join(tmpdir(), 'genie-cwd-evidence-')); | ||
| const codexHome = join(harnessRoot, 'codex-home'); | ||
| mkdirSync(codexHome, { recursive: true }); | ||
| writeFileSync(join(codexHome, 'config.toml'), 'model = "gpt-5-codex"\n', 'utf8'); |
There was a problem hiding this comment.
Inherit the active Codex model in the harness
This writes a fixed gpt-5-codex model into the temporary Codex home, so the black-box CWD proof depends on that exact model continuing to exist and being available instead of using the runner's active/default model. If the model name is unavailable or retired, the test can fail before exercising CWD behavior, and the repository contract says Codex agents should inherit the active model rather than hardcoding unstable identifiers.
AGENTS.md reference: AGENTS.md:L36-L36
Useful? React with 👍 / 👎.
the harness spawned codex async; a missing binary emitted an unhandled 'error' (ENOENT) at module load that escaped the caller's try/catch and aborted the whole file (CI: 1 fail + 2 errors). add a synchronous codex --version preflight that throws a caught error (=> honest skip) plus a benign child 'error' listener so a late spawn failure rejects initialize instead of throwing. codex-absent: 1 pass/7 skip/0 fail; codex-present: 8/0.
…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 1 of
codex-plugin-dogfood-remediation. Group B — the DAG keystone (Groups A and D depend on this shipping).What
CodexHostObservation(src/lib/codex-host-observation.ts): one immutable result of only runtime/plugin-observable facts — never carries rawthread/start.cwdor control-process facts.tests/integration/codex-app-server-cwd.test.ts+tests/support/codex-cwd-evidence.ts): drives one pinned long-lived realcodexapp-server; sequential + concurrent two-repo threads; child-vs-control exact string + dev:ino identity; symlink + case normalization where the FS supports it. Ran 8/0 against codex-cli 0.144.4 (not skipped; self-gates where no app-server exists).matching|absent|invalid|mismatch) + stabledelivery-incompleteresult (authority:none, exit 1, deliveryComplete:false).beginActivationImplimmediately before the first journal write; a non-matching record refuses with zero mutation (no journal, no plugin add, released lease) — proven by a real mutation-spy test + matching-record control. Stale permits cannot bypass it.Validation (reproduced by orchestrator)
bun test src/lib/codex-host-observation.test.ts src/lib/codex-activation.test.ts src/lib/codex-activation-executor.test.ts tests/integration/codex-app-server-cwd.test.ts→ 165 pass / 0 fail. typecheck/lint/dead-code/complexity-budget clean.Adversarial execution review: SHIP (0 gaps), independently reproduced. Orchestrator re-ran the full suite incl. the live app-server proof and inspected the guard source + spy test.