Repository navigation
Description
Current repair scope (2026-09-23)
This existing failure now blocks the authorized workflow correction in #73 / PR #74. The canonical dependency graph remains in #73. A deterministic diagnostic using the repository-pinned SQLite 3.46.0 reproduces the duplicate-trigger error on a stale connection while a fresh connection observes the trigger absent. This supports a fixture schema-cache explanation; the rollback mechanism below was the initial hypothesis, not a verified cause.
Observable outcome: both audit-failure rollback scenarios retain their assertions and run with independent fresh fixtures, removing pooled DROP/recreate schema churn. Only crates/consolebook-server/tests/retention.rs may change. No runtime, migration, dependency or CI/gate changes are needed.
Acceptance: inspect the minimal diff, run the unchanged full local and hosted gates on the frozen candidate, preserve failed evidence, verify exact merged main, archive/read back evidence and remove only owned resources. Repair is the direct prerequisite for the already authorized #73 merge/cleanup. Effort follows the owner's current no-default-cap policy; no separate owner budget was supplied.
Completed: PR #75 merged as f154004374d897d8419d2b9dca9275ed996cc904, exact-main tree verified against candidate 0e2a21a, full local and hosted gates passed (176 Rust / 10 browser each), evidence archived and read back, and only owned branch/worktree removed.
Next action: continue #73 / #74; no further #70 work remains.
Initial report (preserved)
What happens
crates/consolebook-server/tests/retention.rs::authority_and_policy_failures_leave_no_partial_state fails on CI, deterministically so far (2/2 attempts on one head), with its own fixture injection rather than a product assertion:
thread 'authority_and_policy_failures_leave_no_partial_state' panicked at crates/consolebook-server/tests/retention.rs:607:212:
inject: Database(SqliteError { code: 1, message: "trigger fail_retention_audit already exists" })
Line 607 is the test's second CREATE TRIGGER fail_retention_audit. The first is created at 583, dropped at 605 (.expect("remove") did not panic), and then re-created at 607 — where SQLite says it already exists. So the DROP TRIGGER did not take effect, even though it reported no error.
Evidence
- Runs: 34664913384 (attempt 1 and the
--failedrerun) — both failed at the same line with the same message;cargo test --workspaceotherwise green in the same job. - The head that failed is
afed873oncodex/34-draft-refused-text, whose diff againstmain(7936a4e) touches no Rust file (git diff --stat 7936a4e..afed873→docs/development.mdplus fourweb/files). The retention test and the code it exercises are byte-identical tomain. - Locally (Linux, same toolchain,
cargo test --workspace): 0 failures, twice; the retention binary alone: 10/10, six consecutive runs; the single test alone: 12/12. - Earlier CI run of the same branch before it was rebased:
cargo test --workspacegreen (34661983530).
Why it looks pre-existing rather than introduced
The failing sequence is inside the test's own setup and depends on a DROP TRIGGER that the test observed as successful. The most plausible mechanism is transactional: if the DROP executes on a pooled connection that still has an uncommitted write transaction open (or whose queued ROLLBACK lands after it), the drop is undone and the trigger reappears. That would make the test sensitive to connection reuse and timing rather than to any product behaviour — which also fits the CI-only reproduction, given that the same Rust code is green on main's PR run and on every local run.
Suggested fix (for whoever owns it)
Make the injection and its removal explicit about the connection and the transaction, for example:
- take one connection (
let mut conn = fx.pool.acquire().await?) and run theCREATE/DROP/CREATEon it, so a pooled connection cannot interleave a transaction with the DDL; and/or DROP TRIGGER IF EXISTS fail_retention_auditbefore eachCREATE, so a leftover trigger is removed rather than fatal; and/or- assert the drop's effect (
SELECT 1 FROM sqlite_master WHERE type = 'trigger' AND name = ...) before re-creating.
Impact
It is the only thing standing between #67 and a green pr-gate: the branch's own Rust, web, and browser gates are green, and the branch adds no Rust code. Filing it separately as the repository guidance asks rather than folding a retention-test change into a web-only PR.
Activity
TusanHomichi commentedon Sep 23, 2026
Hosted gate failure — preserved, not retried
Candidate
1ec841a7ccdb3a7c79fd5e321f635b0385da88f8failed hosted run 35883145504. The four-file policy diff changes no Rust source or tests.Web install/check/build, Rust formatting and Clippy passed.
cargo test --workspacefailed intests/retention.rs::authority_and_policy_failures_leave_no_partial_stateat line 607:The retention suite reported 9 passed / 1 failed. The explicit server build and hosted browser steps were skipped. This matches the existing symptom in #70; its proposed mechanism remains a hypothesis pending investigation. The local receipt remains a local pass, not a substitute for hosted acceptance.
Full failed log preserved locally at
/data/dev/home/.codex/tmp/consolebook-repair-policy-20260923/hosted-failed.log, SHA-256c1b07fce01e4966c7991b2a171b4390148a0f49ae316995d9c79bcd8ad63a751; run metadata is archived beside it. No hosted rerun has been requested. Sol/max is investigating the fixture and pinned dependency behavior read-only; the parent retains the docs-only scope and integration decision.Next action: establish a supported cause or precise blocker for #70, then determine the smallest legitimate repair path without weakening or bypassing the gate.
TusanHomichi commentedon Sep 23, 2026
Supported mechanism and frozen repair
Candidate
0e2a21aecd216520f7b6b07154eb63adb3c77431(tree332ad374d6dc12104f0ae4a30c02629df7d53086) splits the authority and policy audit-failure cases into separate fresh fixtures. The one-file diff is +6/-5 lines and retains every product call and rollback assertion.Sol/max reproduced the exact error using pinned SQLx 0.8.6 and SQLite 3.46.0. The parent independently compiled the diagnostic against the bundled SQLite source and checked these observations:
A stale connection-local schema view is enough to produce the error. The absent trigger observed by an independent connection is a negative control for an undropped trigger in this sequence; it supersedes the earlier speculative rollback explanation. The full hosted run's connection assignment was not traced, so that final attribution remains an inference. SQLite's maintainer describes the same class of schema-cache preparation behavior.
The exact pinned parser checks the trigger hash before schema refresh (
sqlite3.c:151900-151912). Detailed findings, probe sources and lockfile remain in/data/dev/home/.codex/tmp/consolebook-repair-policy-20260923/retention-investigation/. The independent compile/run receipt is/data/dev/home/.codex/tmp/consolebook-retention-fixtures-20260923/schema-probe-reviewed.json(actual commands, timing and hashes). Reviewed log SHA-256:2901d03be27fc58cbccaa94077ba4921c1c8c4fa0238f8c49b9f95a5c7b570a2.No original assertions were removed, and no retries, IF EXISTS, pool restrictions, runtime/migration changes or gate exemptions were introduced. Required gates are now running against the frozen repair. Requested model routes are recorded from native spawn/assignment records; individual per-turn runtime metadata is not exposed.
TusanHomichi commentedon Sep 23, 2026
Candidate verification receipt
Candidate
0e2a21aecd216520f7b6b07154eb63adb3c77431; tree332ad374d6dc12104f0ae4a30c02629df7d53086. Recorded 2026-09-23T15:59:06.034027+00:00. All local checks below ran as the unprivilegeddevuser in the isolated issue worktree; none changed tracked files. Local output hashes were independently regenerated from actual files.web-ciweb-checkweb-buildfmtclippyrust-testsbinarybrowser-installbrowserRust: 27 reported suite summaries, 176 passed, 0 failed, 0 ignored; no load, recovery, or production-readiness claim.
Commands and working directories:
Actual local output evidence:
{ "target/debug/consolebook-server": "bd2491e35fa5665935b17645c7385c918a0bf88c018c61819305ec7d332f043d", "asset_manifest": { "path": "/data/dev/home/.codex/tmp/consolebook-retention-fixtures-20260923/browser-assets.json", "sha256": "eb31f061b3b17c7f23651f0c3e9ab426ee8ec7234521af445f6d3b50adc128aa", "files": 46 } }The
web-build,binary, andbrowserasset manifests are compared by hash; the binary exercised by the browser suite is hashed after the explicit build and again after E2E. Hosted results use their separate GitHub run record and are not relabeled as local runs.Log SHA-256 values (raw logs and JSON receipts retained in the local archive):
Independent model review of
0e2a21aecd216520f7b6b07154eb63adb3c77431, retained Astra/max assignment: no substantive findings. Each test owns a distinct temporary database and pool. Both failure injections, service calls, and every explicit rollback assertion remain intact. No runtime, schema, dependency or gate changes. The diagnostic supports a stale-schema mechanism, not a claim to have observed the failed hosted run's exact connection assignment. No edits or gates were run by the reviewer. Per-turn runtime routing is not exposed by the native tool; the requested route is recorded here.Reviewed
tests/retention.rsSHA-256:bdccd5b09531a16557d00776c69ae30b8a7f82fa9eadc43a11499005e649690b.Hosted run 35885138099 is separate and still running. No merge has occurred.
TusanHomichi commentedon Sep 23, 2026
Integration evidence archive
PR #75 merged as
f154004374d897d8419d2b9dca9275ed996cc904. Remote main was fetched and local main fast-forwarded to that exact SHA. Its tree332ad374d6dc12104f0ae4a30c02629df7d53086equals tested candidate0e2a21aecd216520f7b6b07154eb63adb3c77431; the candidate is an ancestor and the merged parents are recorded. No new test execution on the merge SHA is claimed.Acceptance evidence: supported diagnosis; local gates and independent review; successful hosted run. Local and hosted suites each passed 176 Rust and 10 browser tests. The local retention binary passed 11/11, including both isolated rollback scenarios. Hosted raw-log SHA-256:
f0b4230467370430f5747b7b943df22459daf9a8d9efecdf8512f0a6f29403e6. Hosted binaries/assets were not downloaded, so no hosted artifact hash is claimed.Only one test fixture file changed. All original product calls and assertions remain. The arbitrary repair cap is superseded by the owner's active instruction; the pending policy PR #74 persists that correction. No broader product, deployment or unrelated merge authority was used.
All five pre-existing untracked files match their initial SHA-256 values. Local main has no tracked changes. Full local receipts, logs, independent review and exact-main proof remain in
/data/dev/home/.codex/tmp/consolebook-retention-fixtures-20260923/; diagnostic sources remain in the linked #73 archive. Main-proof SHA-256:411ce415532446555d62a1377cac8fd9755f91bfc65c7fe7667094dada9d6e3b.Next action: read this archive back, remove only branch/worktree
codex/70-isolate-retention-fixtures, close #70 and unlock policy integration after #74's own gates. The original #74 failed run remains preserved.TusanHomichi commentedon Sep 23, 2026
Cleanup verified: removed only the
codex/70-isolate-retention-fixtureslocal/remote branch and its owned worktree after archive read-back. No task-owned gate/server processes remain. The unrelated worktrees and all five original untracked file hashes are unchanged.#70 is complete at main
f154004374d897d8419d2b9dca9275ed996cc904. The next authorized action is final verification/integration of #74 under the canonical #73 graph.docs: describe 0.1.0 in the roadmap and README