Skip to content

fix(lifecycle): gate Codex research on fresh evidence and preserve risk bans - #595

Merged
Pigbibi merged 3 commits into
mainfrom
codex/hitl-runner-20260908
Sep 8, 2026
Merged

fix(lifecycle): gate Codex research on fresh evidence and preserve risk bans#595
Pigbibi merged 3 commits into
mainfrom
codex/hitl-runner-20260908

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Old or undated drift observations could be treated as current and start research. The probe now preserves observation time and matching source identity, uses an explicit replay clock and a seven-calendar-day default validity window, and rejects stale, future or unavailable evidence. Existing REVIEW/CRITICAL risk prohibitions remain effective even when research is unavailable. Missing dates remain null across storage and reporting.

The autopilot binds to the existing actionable research cycle with subscription-based diagnosis, bounded search, strict WFA/OOS evidence, paired shadow and confirmed console delivery. Research defaults to Codex; AI_GATEWAY_RESEARCH_PROVIDERS explicitly permits Cursor or Codex→Cursor admission routing through the gateway. Missing callbacks stop before AI/optimization, quota deferral is retained, and human acceptance does not grant live authority. Old gateways/SDKs cannot silently accept the new route; admitted task and route identity are checked, failures are sanitized, and a submitted job never retries through the reliability/API fallback.

Console delivery now reads the exact ticket before and after creation. A confirmed 404 permits one POST; unavailable reads do not authorize writes, and an uncertain write is reconciled without another POST from the same callback. Full candidate, budget, evidence and state must match, including Python/JavaScript numeric serialization. The normal research cycle and CLI share saved-ticket decision recovery; matching accept/reject decisions are saved atomically as intent only, while pending or just-recovered profiles skip new research in that cycle. Existing terminal tickets are idempotent no-ops; cross-run experiment dispatch/deduplication remains separate integration work.

Validation: 219 tests and 14 subtests passed across 16 related files, including 32 freshness cases. Full Ruff passed after removing one duplicate test import; the affected 11 probe tests also passed. Independent review checked date/source consumers and ran 12 additional offline assertions. Existing strict cycle and paired-shadow fixtures passed; they are not real forward-shadow evidence.

Decision-recovery follow-up: 171 related tests and 97 subtests passed, including 46 new regression cases. Independent localhost HTTP integration used the real QRT Worker with synthetic in-memory KV/session to verify submit/readback, duplicate suppression, anonymous/stale-candidate rejection, accept/reject recovery and no live authority. Each case made exactly one ticket POST. This validates application wiring, not deployed authentication, durable cloud KV or real research/shadow evidence.

Subscription consumer validation: four related files passed with 103 tests and 26 subtests. Independent review reproduced incorrect task binding and raw error propagation; both now have failing-before/fixed-after regressions and independent closure. Ruff and diff checks passed. These are offline checks, not Cursor model or billing validation.

Adoption: deploy/install the service and SDK from QuantStrategyLab/AIAuditBridge#165 before enabling the consumer route. Adopt the new probe and risk mapper together from one QPK package; copying only the probe can lose retained risk prohibitions. No deployment, dependency-pin rollout, model call or trading action is performed by this PR. A real experiment job and approved data/shadow bindings remain outstanding.

…sk bans

Co-Authored-By: Codex <noreply@openai.com>
Pigbibi and others added 2 commits September 8, 2026 23:59
Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit d12309d into main Sep 8, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/hitl-runner-20260908 branch September 8, 2026 18:08
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