Skip to content

feat(codex): Group D — immutable delivery repair + .install-version lifecycle (dogfood-remediation) - #2628

Merged
namastex888 merged 1 commit into
devfrom
wish/dogfood-D
Jul 22, 2026
Merged

namastex888 merged 1 commit into
devfrom
wish/dogfood-D

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Wave 2 of codex-plugin-dogfood-remediation. Group D (depends on B, now shipped).

What

  • One-shot delivery repair (update/install): before an already-current return, consumes Group B's assessAuthenticatedDelivery; pins channel + immutable target version/platform + release tag/name + manifest bytes/digest before download; downloads the exact named asset, computes SHA-256 after, authenticates it against the GitHub attestation/cosign anchors (repo/predicate/workflow/OIDC), persists the computed digest; extracts privately, proves candidate VERSION/binary/plugin-tree vs installed bytes, takes the lifecycle lease, rechecks the pinned channel before publish. A channel advance routes to ordinary upgrade and never mints a record for stale bytes.
  • State-unchanged-on-failure: any provenance/signature/digest/platform/extraction/lease/installed-byte/intent/reobservation failure leaves record/journal/plugin/cache/config/roles untouched and reports deliveryComplete: false. Repeated repair neither re-downloads nor republishes. No-network fast path for matching records.
  • .install-version lifecycle module: canonical VERSION authoritative; retire the legacy marker only after successful install/update convergence, preserve exact prior bytes/tree on failure, idempotent across present/absent layouts. Deferred install publishes its matching record before the exit-2 handoff.
  • update/install do not prompt, reconcile project config, mutate journal/enabled/plugin state, or converge roles — they return the setup activation handoff.

Validation (reproduced by orchestrator)

bun test over the 8 Group-D files (codex-delivery, update, install, install-promote, install-version-marker, uninstall, codex-delivery-bootstrap, codex-delivery-repair) → 397 pass / 0 fail, codex-present and codex-absent (network/attestation fully stubbed via injected seams). typecheck clean; dead-code (knip) clean.

Adversarial execution review: SHIP, ciPortability confirmed. One tracked MEDIUM (below).

Tracked follow-up (Group E)

uninstallInstallVersionMarker is exported + unit-tested but not yet called by the uninstall command (behavior is already correct — .install-version is removed by the digest-verified wholesale GENIE_HOME child removal, since it's deliberately absent from preservedGenieDirEntry). Wiring the explicit symlink-safe typed removal must be done with awareness of the digest-bound removal, so it's folded into Group E (lifecycle-surface integration) rather than rushed here.

… lifecycle

Group D (immutable-delivery-repair): let update/install repair a MISSING
authenticated delivery record for the installed target exactly once, without
activation and without redefining the target from a moving channel.

- src/genie-commands/codex-delivery-repair.ts: the injectable repair
  orchestrator — pin channel/version/platform/tag/name + manifest digest
  before download, download the exact asset, SHA-256 after, authenticate via
  the existing attestation/cosign anchors, prove the candidate against
  canonical installed bytes, recheck the channel under the lease (advance =>
  ordinary upgrade, mint no stale record), reobserve + publish once. No-network
  fast path for matching records; every failure leaves state unchanged with
  deliveryComplete:false.
- src/lib/install-version-marker.ts: the ONE .install-version lifecycle module
  (D-owned). Retire on convergence success, preserve on failure/unsafe,
  idempotent uninstall for either layout. Canonical VERSION stays authoritative.
- src/lib/codex-activation.ts: additively extend the delivery record + publish
  input to carry the immutable attestation tuple (platform/tag/name/manifest/
  artifact/binary/root); the store parser round-trips them.
- update.ts: repair before the already-current return; retire the marker after
  successful convergence.
- install.ts: deferred install publishes its matching record before the exit-2
  handoff (idempotent); retire the marker on convergence success.

All network/attestation/codex is stubbed in tests; the suite passes with codex
present AND stripped from PATH (0 fail, 0 errors).
@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: b9e3bae4-26d0-4883-8647-ab395c006568

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-D

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: 30bf66fef9

ℹ️ 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 +2039 to +2040
const registration = snapshot.query.status === 'ok' ? snapshot.query.registration : { present: false as const };
const installedGeneration = registration.present && registration.version ? registration.version.canonical : null;

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 Skip repair handoff when Codex cannot be observed

When the Codex CLI is not installed or codex plugin list fails, this branch fabricates an absent registration. If the same-version repair then publishes the missing delivery record, handoffFor(null, target) maps it to activation-pending, so an otherwise already-current genie update on a non-Codex machine can download the tarball and exit 2 with the Codex setup trailer. Treat query failure/absent registration like the existing delivery classifier's non-pending absent case and skip the handoff instead.

Useful? React with 👍 / 👎.

@namastex888
namastex888 merged commit e6de730 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-D 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