Skip to content

feat(codex): Group B — host-observation attestation + app-server CWD proof (dogfood-remediation) - #2625

Merged
namastex888 merged 6 commits into
devfrom
wish/dogfood-B
Jul 22, 2026
Merged

namastex888 merged 6 commits into
devfrom
wish/dogfood-B

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Wave 1 of codex-plugin-dogfood-remediation. Group B — the DAG keystone (Groups A and D depend on this shipping).

What

  • Production CodexHostObservation (src/lib/codex-host-observation.ts): one immutable result of only runtime/plugin-observable facts — never carries raw thread/start.cwd or control-process facts.
  • Live black-box CWD proof (tests/integration/codex-app-server-cwd.test.ts + tests/support/codex-cwd-evidence.ts): drives one pinned long-lived real codex app-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).
  • Authenticated-record assessment (matching|absent|invalid|mismatch) + stable delivery-incomplete result (authority:none, exit 1, deliveryComplete:false).
  • Pre-mutation activation guard: re-observes inside beginActivationImpl immediately 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.
  • Bounded single-observation parser (advisory PATH stderr accepted only with exit 0 + one schema-valid JSON; rejects timeout/overflow/nonzero/malformed/dup/invalid-version/unsafe-cache); record-tampering fixtures for every bound field.

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.

release-bot and others added 5 commits July 22, 2026 18:11
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.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4d838ad8-4b1c-458f-a6d5-e5e3228bb22a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wish/dogfood-B

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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: 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".

Comment on lines +123 to +126
const child = spawn(codexCommand, ['app-server'], {
env: { ...process.env, CODEX_HOME: codexHome, RUST_LOG: 'error' },
stdio: ['pipe', 'pipe', 'pipe'],
}) as ChildProcessWithoutNullStreams;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
@namastex888
namastex888 merged commit 0ec32bb into dev Jul 22, 2026
16 checks passed
lirazsiri pushed a commit to lirazsiri/genie that referenced this pull request Jul 28, 2026
…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.
@automagik-genie
automagik-genie deleted the wish/dogfood-B branch September 25, 2026 04:51
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