Skip to content

Gate rebuilds on native GPU proof#1028

Merged
TheGreenCedar merged 5 commits into
dev/codestory-nextfrom
codex/1025-gpu-pre-repair-gate
Jul 12, 2026
Merged

Gate rebuilds on native GPU proof#1028
TheGreenCedar merged 5 commits into
dev/codestory-nextfrom
codex/1025-gpu-pre-repair-gate

Conversation

@TheGreenCedar

@TheGreenCedar TheGreenCedar commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Context

Agent sidecar repair could begin a long semantic rebuild after detecting an accelerator and reaching the embedding endpoint without proving that the exact selected runtime performed meaningful accelerator work. A failed retry could also leave an older verified broker proof visible.

Closes #1025
Refs #884

What Changed

  • added a five-second embedding smoke before ready-repair and direct Agent-profile retrieval indexing
  • bound proof to the persisted namespace, endpoint, requested provider/device, and unchanged runtime identity
  • require current positive GPU offload logs plus measured smoke latency
  • validate native launch identity before and after the smoke
  • persist and validate running Docker container ID/start identity before and after the smoke
  • overwrite stale verified broker proof with gpu_unverified on gate failure
  • keep CPU-allowed policy degraded and explicitly classify external accelerator endpoints as unverified
  • documented the operator contract and updated the changelog

CI Failure and Root Fix

The first workspace run failed four retrieval_bootstrap_contracts because Docker identity persistence inspected a container even for --skip-compose bootstrap. The initial correction exposed a second lifecycle edge: identity captured before a possible force-recreate could immediately become stale.

The final path leaves skip-compose bootstrap observational, performs any Compose refresh first, then captures the final running container ID/start tuple and atomically writes it into sidecar state. The Agent rebuild gate still fails closed when no bound identity exists.

How To Review

  1. Follow ensure_embedding_accelerator_smoke_for_runtime through native, Docker, external, and CPU-allowed branches.
  2. Confirm both run_ready_repair_with_native_embedding_lease and Agent retrieval index invoke the gate before run_indexing_blocking.
  3. Check broker failure persistence and exact request/runtime identity regression tests.
  4. Confirm final Docker identity publication occurs after the optional refresh path and is skipped for --skip-compose.

Verification

  • cargo test -p codestory-cli --test retrieval_bootstrap_contracts --locked -- --nocapture — 6 passed
  • cargo test -p codestory-retrieval sidecar_state_replacement_is_complete_and_leaves_no_temp_file --locked -- --nocapture — passed; covers atomic recreated-identity replacement
  • cargo test -p codestory-retrieval --locked — 337 passed, 2 ignored; integration suites passed
  • cargo test -p codestory-retrieval accelerator_smoke -- --nocapture — 4 passed
  • cargo test -p codestory-retrieval container_identity_requires_running_state -- --nocapture — passed
  • cargo test -p codestory-cli failed_smoke_replaces_verified_proof_for_current_runtime -- --nocapture — passed
  • cargo test -p codestory-cli ready_repair_ --locked -- --nocapture — 35 unit tests and ready-command integration passed
  • cargo clippy -p codestory-retrieval -p codestory-cli --all-targets --all-features --locked -- -D warnings
  • node .github/scripts/check-doc-links.mjs
  • git diff --check

Risk

The gate intentionally fails closed for accelerator-required external endpoints because CodeStory cannot bind provider-owned process/log identity. Live physical-GPU proof remains a post-merge environment check; deterministic tests cover the decision logic without requiring GPU hardware. No screenshot-visible UI changed.

@TheGreenCedar TheGreenCedar force-pushed the codex/1025-gpu-pre-repair-gate branch from 02832a1 to 1316b2d Compare July 12, 2026 21:57
@TheGreenCedar TheGreenCedar force-pushed the codex/1025-gpu-pre-repair-gate branch from 1316b2d to 2c9af43 Compare July 12, 2026 22:35
@TheGreenCedar TheGreenCedar merged commit 1b2aa63 into dev/codestory-next Jul 12, 2026
17 checks passed
@TheGreenCedar TheGreenCedar deleted the codex/1025-gpu-pre-repair-gate branch July 12, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant