|
1 | 1 | # CK-08R3A — Implement bounded EvidenceService physical queries |
2 | | -**Status:** Conditional Ready after final-shared authority merge/exact-main; implementation remains permitted_not_accepted |
| 2 | + |
| 3 | +**Status:** Completed on merge; PR #417 hosted-green and exact-main verified at `38537f6cee42ad4ba2fb6e45354e410053c7a7cd` |
| 4 | + |
3 | 5 | **Recommended owner:** `worker evidence-physical-query`; Sol-class |
| 6 | + |
4 | 7 | **Accounting:** [TASK_PACKETS.md](../TASK_PACKETS.md); [REMAINING_EXECUTION_PLAN.md](../REMAINING_EXECUTION_PLAN.md); [AGENT_FIRST_CLEAN_CUTOVER.md](../AGENT_FIRST_CLEAN_CUTOVER.md) |
5 | | -**Goal:** Independently reinspect/reapply bounded EvidenceService SQL. |
6 | | -**Blocker:** R3 commit `a28e9cdbff8e48d334712a449fdcee111c725673`/artifact `ae9107eda155a21b9bd9ef5a77971007d00864b772c3a23bc521652b5b17d471` exposed unbounded plans. The lifecycle-session authority is based on exact main `7d5a4b1717db78891fd2c38d8803d7fe2f922986`; it revokes successor `718ff7032d050b13cb7fac1f857d0c99879d0ef3b13c57c39b55514fc610a88b` and the entity-leading `659c1957…` candidate for inner temp sorts, scale growth, and rate-card page-scope regression. It permits only the exact atomic seven-production/nine-support cohort, including persisted `lifecycle_transitions.session_id` and `evidence_lifecycle_by_session_order`, plus the linked fixture/DDL/schema identities; no implementation is accepted yet. |
7 | | -**Dependencies:** Accepted R0 plus this authority merge/exact-main. [Supersession authority](../../decisions/evidence/ck08r3a/evidence-service-supersession-authority.json) keeps the exact-main predecessor and selected successor permitted_not_accepted until evidence. The linked [schema/publication requalification authority](../../decisions/evidence/ck08r3a/schema-publication-requalification-authority.json) and [final-shared authority](../../decisions/evidence/ck08r3a/final-shared-authority.json) additionally bind the exact 42-table/57-index digest, independent DDL, frozen synthetic publication fixtures, and tiny-accounting EXPLAIN identity; they do not accept implementation. |
8 | | -**Owned files/interfaces:** EvidenceService and the exact atomic lifecycle-support cohort. The authority permits only the seven production paths and nine support paths named in the final-shared artifact, including the exact `analytical.sql` evidence-order indexes and matching `storage/schema.py` contract digest; all other query/contracts/cursor/selectors/publication/projection/public/package/schema changes remain forbidden. |
9 | | -**Produces:** Bounded SQL/tests and bound digest evidence; no R3 scale. |
10 | | -**Independent truth source:** Test evaluator imports no production query/helper; applies selector/view/cursor, seven-part order, `limit + 1`. |
11 | | -**Consumer seam:** `EvidenceService.read()` stays one query-only snapshot; keyset/order/limit precede decode. |
12 | | -**Parallelism:** Disjoint from R1A,07R1A,QG1A; fresh task; blocked run is reproduction. |
13 | | -**Non-goals:** unbound DDL/schema/projection/API/budget/timing/R1/QG1/07R1/R3/R4/RG/09. |
14 | | -**Invariants:** Preserve selector/version/view/direction/cursor/publication, ties/missing/late/base/tail, gap-free/query-only/one-snapshot, exact zero-based nonnegative source-rank equality (including rank 0 and rank >0), <=100 rows/16384 bytes; synthetic; wheel <=1,000,000, sdist <=2,000,000. |
15 | | -**Required tests/checks:** First/deep forward/backward EXPLAIN rejects `SCAN stream`, `MATERIALIZE model_calls_visible`, `AUTOMATIC COVERING INDEX`, and every `USE TEMP B-TREE FOR ORDER BY` except the exact portable one-row session-branch exception. The exception requires full plan ids/parents, the unique leftmost session-event ancestry, and the contiguous session/occurrence/manifestation sibling chain; independent rows/order/decode bound; valid active `rate_card` summary plus empty timeline/calls pages; regressions/authority/GitNexus; `just v/vc`; reviewer/PR/CI/merge/exact-main. |
16 | | -**Acceptance:** The exact source/support cohort, evidence-order DDL, schema-contract identities, fixture manifests, and rank/provenance evidence in the authority match byte-for-byte; session-scoped first pages and all other deep forward/backward pages remain marker-free and bounded with 0/1,000/5,000 unrelated foreign lifecycle rows, while SQLite 3.45.1 may show at most one `USE TEMP B-TREE FOR ORDER BY` only for the structurally proven deep timeline/allowance session branch; all bounds and selector compatibility pass; generic drift forbidden. Predecessor/foreign artifacts are rejected before application query, mutation, repair, or promotion without migration or compatibility views. |
17 | | -**Failure/rollback:** Divergence/gate/broader-authority need stops; no retry-only/blind copy. |
18 | | -**Handoff:** SHA/PR/digests/plans/measurements/review/CI/exact-main/risks; then instruct coordinator to resume implementation worker `019fbe2b-20e8-78b2-a687-0231b159d0c7` in a fresh exact-main worktree before any fresh `test_engineer evidence-scale` R3 task. |
19 | | -**Cleanup/docs:** Retain blocker; preserve R3A→R3 and R4 join. |
20 | | -**Suggested commit:** `fix: bound evidence physical queries` |
| 8 | + |
| 9 | +**Goal:** Replace the retained unbounded EvidenceService physical plan with bounded, query-only, session-scoped keyset execution. |
| 10 | + |
| 11 | +**Historical blocker:** R3 commit `a28e9cdbff8e48d334712a449fdcee111c725673` and artifact `ae9107eda155a21b9bd9ef5a77971007d00864b772c3a23bc521652b5b17d471` exposed unbounded plans. PR #417 supersedes the rejected `718ff703…` and entity-leading `659c1957…` candidates while preserving them as read-only evidence. |
| 12 | + |
| 13 | +**Dependencies:** Accepted CK-08R0 plus all linked CK-08R3A authorities merged and exact-main verified before implementation acceptance. |
| 14 | + |
| 15 | +**Owned files/interfaces:** The exact atomic seven-production/nine-support cohort bound by repository authority, including EvidenceService, publication rank/order persistence, lifecycle storage, evidence-order DDL/schema, synthetic fixtures, and focused physical tests. No unrelated query, projection, public API, package, roadmap, CK-07, R1, R3, R4, RG, or CK-09 implementation. |
| 16 | + |
| 17 | +**Produces:** Accepted bounded EvidenceService SQL, exact physical-plan tests, and linked synthetic evidence; no CK-08R3 scale artifact. |
| 18 | + |
| 19 | +**Independent truth source:** A synthetic evaluator that imports no production query helper and independently applies selector, view, cursor, seven-part order, and `limit + 1`. |
| 20 | + |
| 21 | +**Consumer seam:** `EvidenceService.read()` remains a query-only single snapshot; scope, keyset order, and `limit + 1` precede decoding. |
| 22 | + |
| 23 | +**Parallelism:** The historical implementation lane is closed. CK-08R3 may start only after this accounting merge makes it Ready; CK-07R1, R1B, and QG1 remain independently held. |
| 24 | + |
| 25 | +**Non-goals:** New production behavior, migration or compatibility paths, selector/API expansion, projection admission, budget or timing changes, CK-07/R1/QG1 changes, CK-08R3 scale execution, R4/RG accounting, or CK-09 dispatch. |
| 26 | + |
| 27 | +**Invariants:** Preserve selector/version/view/direction/cursor/publication semantics; ties, missing, late, base, and tail behavior; gap-free query-only pagination; exact zero-based nonnegative source-rank equality, including valid rank 0 and preserved rank >0; at most 100 rows and 16,384 bytes; synthetic data only; wheel at most 1,000,000 bytes and sdist at most 2,000,000 bytes. |
| 28 | + |
| 29 | +**Required tests/checks:** First/deep forward/backward EXPLAIN rejects `SCAN stream`, `MATERIALIZE model_calls_visible`, `AUTOMATIC COVERING INDEX`, and every `USE TEMP B-TREE FOR ORDER BY` except the exact portable one-row session-branch exception. The exception requires full plan ids/parents, unique leftmost session-event ancestry, and the contiguous session/occurrence/manifestation equality chain. Validate independent rows/order/decode bounds, valid active `rate_card` summary plus empty timeline/calls pages, authority identities, GitNexus, `just v`, `just vc`, one reviewer, hosted CI, merge, and exact-main. |
| 30 | + |
| 31 | +**Acceptance:** Exact source/support, DDL/schema, fixture, rank/provenance, and authority identities match byte-for-byte. Session-scoped first pages and all other deep pages remain marker-free and bounded across 0/1,000/5,000 unrelated lifecycle rows. SQLite 3.45.1 may show at most one structurally proven deep timeline/allowance session-branch temp sort; all result truth, cursor, callback, and selector bounds remain invariant. Predecessor/foreign artifacts are rejected before application query, mutation, repair, or promotion without migration or compatibility views. |
| 32 | + |
| 33 | +**Completion evidence:** PR #417 reused the existing worker and PR lineage, passed hosted run `30972312554` for Console and Python 3.10/3.14, and squash-merged at `38537f6cee42ad4ba2fb6e45354e410053c7a7cd`. The selected 16-path cohort had zero authority identity mismatches. Premerge focused validation passed 136 tests with one skip; dual SQLite 3.45.1/3.53.3 passed 12/12; `just vp`, `just v`, `just vc`, build, distribution, release-safety, and the single final reviewer passed. Fresh exact-main was clean with exact identities and 46 authority/scope/documentation tests passing. A duplicate postmerge full runtime rerun did not complete because host ENOSPC caused SQLite disk-I/O/temp-file failures; no product assertion failed, so this remains an environment-only limitation rather than a claimed passed rerun. |
| 34 | + |
| 35 | +**Failure/rollback:** Preserve the first divergence or gate failure and stop; never blind-copy a candidate, weaken physical bounds, or treat an unchanged retry as evidence. |
| 36 | + |
| 37 | +**Handoff:** Record SHA, PR/CI, identities, plans, measurements, review, exact-main, risks, and environment limitations. The coordinator may create an uncreated CK-08R3 task only after the merged machine DAG records it Ready. |
| 38 | + |
| 39 | +**Cleanup/docs:** Preserve historical blockers and the R3A→R3→R4 dependency chain. |
| 40 | + |
| 41 | +**Suggested commit:** `docs: record CK-08R3A acceptance` |
0 commit comments