Skip to content

test(codex): CI contract for install/uninstall + credential flow#166

Merged
GuyMoses merged 4 commits into
mainfrom
sig-171-codex-install-contract
Jul 14, 2026
Merged

test(codex): CI contract for install/uninstall + credential flow#166
GuyMoses merged 4 commits into
mainfrom
sig-171-codex-install-contract

Conversation

@GuyMoses

@GuyMoses GuyMoses commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Stacked on #165 (M3). Adds CI + test coverage for the Codex install path, which previously had none.

What's covered

Offline contracts in the install-config-contract job (mirror Cursor's D/E/F, no live Codex / API):

  • G — config-file and env-var credentials both reach a real OTLP request through codex-on-event.sh.
  • Hinstall-codex.sh appends the managed block + 10 [hooks.state] pre-trust entries to config.toml, preserving a pre-existing user hook + setting (real tomllib parse).
  • Iuninstall-codex.sh strips only the managed block; user content survives.

Live end-to-end in the e2e job — TestE2EFullFlowWithCodex now runs the real install-codex.sh against a hermetic HOME/XDG_STATE_HOME, then drives live Codex with no --dangerously-bypass-hook-trust against what the installer produced. One test spans installer → config.toml merge + pre-trust → live Codex → OTLP, so a break anywhere (merge, trust hash, hook contract) fails here. Verified locally: install skips the download (pre-staged binary), registers + pre-trusts, connectivity passes, then 3 spans (chat + 2 tools) land with no bypass.

Installer change

install-codex.sh now skips the binary/bootstrap download when already present — a real idempotency win, and what lets both Contract H and the e2e pre-stage a locally-built binary and run the merge without a published release (Codex has none until M4, SIG-172).

The contracts are deterministic and API-free (always run); the e2e adds live trust-acceptance proof (needs OPENAI_API_KEY, which is set — the job is green). Together they cover install, uninstall, credential flow, and live trust.

SIG-171

@GuyMoses
GuyMoses requested a review from a team as a code owner July 12, 2026 15:25
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Comment thread .github/workflows/ci.yml
Base automatically changed from sig-171-m3-codex-install-hook-trust to main July 14, 2026 11:06
GuyMoses and others added 2 commits July 14, 2026 14:15
Add Codex Contracts G/H/I to the install-config-contract job, mirroring
the Cursor ones (D/E/F) — the Codex install scripts previously had zero CI
coverage:
  G: config-file AND env-var credentials both reach a real OTLP request
     through codex-on-event.sh.
  H: install-codex.sh appends the managed block + 10 [hooks.state] pre-trust
     entries to config.toml, preserving a user-authored hook and setting
     (asserted with a real TOML parser).
  I: uninstall-codex.sh strips only the managed block, leaving user content.

install-codex.sh now skips the binary/bootstrap download when they're
already present — a real idempotency improvement that also lets Contract H
pre-stage a locally-built binary and run the merge without a release (Codex
has none until M4). Validated locally end-to-end.

SIG-171

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Instead of calling emit-codex-hooks directly, TestE2EFullFlowWithCodex now
runs the real install-codex.sh against a hermetic HOME + XDG_STATE_HOME
(binary + bootstrap pre-staged so the not-yet-published release download is
skipped), then drives live Codex with no bypass against what the installer
produced. One test now covers the whole path — installer → config.toml
merge + pre-trust → live Codex → OTLP — so a break anywhere surfaces here.

Removes the writeCodexHooksTrusted shim in favor of installCodex +
codexPluginVersion/unameOSArch helpers.

SIG-171

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GuyMoses
GuyMoses force-pushed the sig-171-codex-install-contract branch from c5f7a9a to 7ed2ee6 Compare July 14, 2026 11:16
@GuyMoses
GuyMoses requested a review from bertschneider July 14, 2026 11:18
@GuyMoses
GuyMoses merged commit 9796547 into main Jul 14, 2026
7 checks passed
@GuyMoses
GuyMoses deleted the sig-171-codex-install-contract branch July 14, 2026 14:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants