feat: persist TEPP accepted receipts as transport evidence (v2.12.11) - #496
Conversation
A live AnalysisRunAccepted envelope with a remote run id stays Running and is stored as transport evidence. It is not a measurement and does not invent a theta. Empty accepted envelopes and missing transport stay Failed. Login no longer mounts Admin settings with an undefined token. Refs: #277
|
@opencode-agent independent exact-head review requested. This identity cannot self-approve. Head
Please review this exact head. Squash-merge only after independent approval and current checks. Issues #79 and #87 stay open. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Resolved the live ADR-number collision on exact head |
|
Exact-head follow-up at
No production code or fixture abstraction changed. Fresh exact-head CodeGraph worktree evidence:
Hosted checks must evaluate this new head; no prior-head result is being reused. |
|
Still needs independent exact-head APPROVE. Author/bot COMMENTED reviews are not an approval. Do not self-approve. |
|
Resolved the current open-stack migration filename collision without changing ADR 0162 or TEPP receipt behavior.
Exact pushed head: |
…v21219' into feat/tepp-accepted-receipt-v21211
Existing volumes still replay 0171. A Running TEPP receipt names the next action as a status check, not a calibrated score.
| elif outcome.persist_kind == _PERSIST_RECEIPT and outcome.envelope is not None: | ||
| if await _persist_tepp_accepted_receipt( | ||
| conn, | ||
| analysis_run_id=analysis_run_id, | ||
| envelope=outcome.envelope, | ||
| request=request, | ||
| knowledge_cutoff=locked["knowledge_cutoff"], | ||
| ): | ||
| return False | ||
| status_code = _FAILED | ||
| failure_code = "tepp_receipt_not_persisted" |
There was a problem hiding this comment.
📝 Info: Conflicting re-check revokes a durable receipt
A re-check envelope classified as a receipt but carrying a remote run id or request digest that differs from the stored receipt makes _persist_tepp_accepted_receipt return False, so analysis_run_start.py:988-998 marks the run Failed / tepp_receipt_not_persisted and delivers the outbox. This revokes a previously Running acceptance. ADR 0162 documents this as fail-closed, so it reads as intentional.
Was this helpful? React with 👍 or 👎 to provide feedback.
This PR added one new, properly-documented nosemgrep suppression (with a preceding Safe SQL: reason, matching the required pattern) but never updated the hardcoded EXPECTED_SQL_SUPPRESSION_COUNT constant. Verified all 39 suppressions pass the format checks; only the count was stale. Verified: 1054 Python tests pass.
Resolved 6 conflicts: - CHANGELOG.md: reordered this PR's 2.12.11 entry below the base's now-renumbered 2.12.20 entry (no more duplicate 2.12.19 version). - docker/postgres-init/migrate.sh: unioned migration allowlist across 0171 (this PR's TEPP-receipt migration) and 0173 (base's clock-skew migration). - tests/test_migration_replay.py: kept both replay tests, ordered numerically. - backend/app/analysis_run_start.py: base's clock-skew fix (#524) dropped the timestamp parameter from _append_status entirely (ADR 0171 - never bind Python datetime.now as occurrence). Removed this PR's now-incompatible now/finished clamping and the stale extra positional arg to _append_status, which would have raised a TypeError at runtime had it been merged as a naive union. - tests/test_analysis_run_start.py: merged import lists. - frontend/src/App.test.tsx: kept this PR's superset assertion (checks both sessionStorage and localStorage via the shared OIDC_RETURN_URL_STORAGE_KEY constant). Verified: 1059 Python tests pass, frontend build/lint clean, 362 frontend tests pass.
a861ce0
into
feat/oidc-return-remember-login-v21219
- Snapshot: protected main 63876eb (#422), 37 open PRs, 19 open issues. - Record the org-wide Strix provider failure (NIM ~70s / OpenAI-direct ~5s exits) and its durable repair ContextualWisdomLab/.github#1263, including the ten base-merged paths the prior merge commit had reverted and how they were restored. - Record the ADR 0109 shared login repair applied to eight pre-repair branches (#521, #522, #552-556 set, #558, #560), verified locally with frontend lint/test/build before each push. - Replace stale §3 inventory with the current 37-head queue grouped by product surface, SKOS/leftover-map ladder, repairs, integration, and docs. - Refresh §5 rows whose referenced PRs have since landed (#496/#507/#515, #544/#559 channel-weight hardening) and rewrite §10 as the autonomous ascending-order merge loop. - Note #368 closed as superseded. Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
Product result
A live TEPP
accepted/queued/runningenvelope that carries a remote run id no longer looks like a product failure. The local analysis run stays Running and stores the receipt as transport evidence. The receipt is not a calibrated measurement and does not invent a theta.Root cause
ADR 0022 treated any non-completed TEPP envelope as Failed /
tepp_result_not_persisted. TEPP's publishedAnalysisRunAcceptedis a durable submission receipt, not a temporal measurement. Treating it as Failed hid a successful accept; treating it as Succeeded would manufacture a scientific result from transport evidence.Issue #277. Completed-result polling remains blocked on ContextualWisdomLab/TEPP#156.
What this head changes
tepp_not_available; completed+result → Succeeded +analysis_run_tepp_result; accepted/queued/running with a remote run id → persistanalysis_run_tepp_accepted_receiptand stay Running; empty accepted → Failed /tepp_result_not_persisted.tepp_not_available. Do not change seed to Running.{remote_run_id, accepted_status_code, received_at}. Next-action copy says the receipt is not a calibrated score.returnUrlFromLocation+rememberOidcReturnUrland no longer mounts Admin settings with an undefined token, so this head's frontend gate is not poisoned by main.Migration
0171only (not 0103/0104/0105). ADR 0162 amends ADR 0022.Local verification
Exact head:
288125acb1e6939ca0b99c0c4af2aacaadaffc79uv run --extra dev --with asyncpg --with redis pytest tests/test_tepp_accepted_receipt.py tests/test_analysis_run_start.py tests/test_seed_tepp_run.py tests/test_migration_replay.py tests/test_static_sql_review_contracts.py: 48 passedpnpm exec tsc -b: passedpnpm exec vitest run src/App.test.tsx src/oidcReturnUrl.test.ts: 84 passedNo real records, identifiers, provider credentials, or runtime secrets are included. Synthetic fixtures only.
Remaining protected gates