Repository navigation
fix(learning): retain live work credit until acknowledged - #4096
Conversation
|
Astra / Codex source review: approve exact edaf611, contingent on completed CI and the separate canary lifecycle/ratchet correction. Reviewed the turn-owned callback across directed and held-work drivers, the actual adapter receipt attachment, immutable revision replacement, per-row served identity, DataRecord decoding and durable matching acceptance before deletion. The published diff contains exactly the six expected files; the separately merged ledger overlay and Windows CLI validation overlay are excluded. Native receipt: 132 relevant tests passed on the combined validation tree; the only subsequent semantic edit was an equivalent predicate simplification. Final normal Clippy passed with zero diagnostics on changed lines; strict global Clippy is explicitly not clean. The real driver/SQLite failures were repaired in production seams, not by weakening fixtures. This repairs staging and the existing verdict consumer. It does not prove ordinary-work review authority, cumulative-revision deduplication, training completion, adoption or learned gain; cards6c36c24d/a346b3b0 remain required. Deployment evidence must follow the eventual merged build. |
|
CI at head Both failures are in the newer base: the serving census fixture observed The separately reported 132 native tests and normal Clippy receipt remain unchanged; no new Cargo run or production edit was made during this CI diagnosis. — Astra / Codex S6 |
edaf611 to
d5c6386
Compare
Long directed Persona turns could execute and remember many tool calls without retaining task credit until the entire turn settled. Held-work turns had a separate persona-global callback, with replacement IDs and no generation receipts.
Both live paths now lend a turn-owned capture to the existing shared driver. It awaits an atomic snapshot every four completed acts and at settlement, preserving submitted request IDs and actual served/fault receipts. Changed content gets a distinct revision ID; identical retries reuse their ID. Failed replacements preserve prior evidence and uncertain predecessors are retired in the next successful atomic write.
The live faculty now attaches ordered generation receipts at its actual adapter boundary, including failed/corrective attempts, independently of optional disk capture. Settlement reads the existing DataRecord envelope before decoding its credit entity; malformed or incomplete lists fail visibly with rows retained.
Settlement uses each revision’s own serving lane and passes its ID to the destination’s existing idempotency primitive. Only a matching durable acceptance receipt permits deletion; a stale drain cannot delete a newer revision. Failed outcomes, missing claims, mixed/unknown models, refusals and unacknowledged submissions remain staged. Durable acceptance is independent of later training dispatch success.
This does not add an ordinary-project verdict source or claim trained capability. It repairs capture and the existing verdict consumer without inferring success from card closure. A verdict can currently arrive during a continuing turn; a later verdict may accept a cumulative successor containing earlier acts. Immutable revision idempotency does not deduplicate that overlap across the existing activity lifecycle boundary. Ordered request receipts retain its provenance. Existing staging probes now include elapsed_ms for the awaited capture cost.
Validation: 132 native tests passed on the combined tree (25 act/observe, 15 training producer, 70 live faculty, 2 ledger, 20 source hygiene), with default features and four jobs. The two ledger files are a separately reviewed overlay now merged by #4091 and are excluded from this PR. The new driver/SQLite regressions initially failed on empty live receipts and the wrong ORM envelope; both passed after repairing those production boundaries. Only destination submission responses are scripted in the settlement fixture.
Normal Clippy passed. Strict Clippy reported 607 library / 743 library-test promoted diagnostics. Exact source mapping found one introduced nonminimal boolean expression; the remaining diagnostics map to unchanged source. Exact diff-line triage isolated that new finding; the equivalent predicate simplification is applied. Final normal Clippy passed with zero diagnostics on changed lines (846 unique diagnostics mapped to unchanged source). No lint allowances or baseline changes. The 132-test receipt predates only that equivalent predicate cleanup. Root source review and formatting checks passed; published-head CI remains authoritative for this branch.
Remaining lifecycle work is tracked on cards 6c36c24d (bind reviewed outcomes to exact revisions without cumulative overlap) and a346b3b0 (retry retained outcomes independently and page the current unbounded settlement read). An incomplete count/query snapshot or malformed list stays retained rather than silently transferring a subset.