fix(state): repair legacy usage-profile migration stamp - #534
Conversation
Agent: iapp-factory-coordinator
Preserve the thread-monitor migration at version 68, restamp only the legacy PR #528 usage-profile lease checksum as version 69, and reject future duplicate state migration versions. Agent: iapp-factory-coordinator
Retain main compatibility checks while adding checksum-guarded repair coverage for legacy PR #528 usage-profile lease stamps. Agent: iapp-factory-coordinator
|
[ERDOS-R5-PR534-INITIAL-07BFB452] Exact candidate controls: P1 BLOCKER — required migration compatibility gate is absent: the candidate adds no deterministic negative regression that seeds an unknown/malformed/mismatched version-68 checksum, invokes the real startup path, and proves the row is left untouched and startup rejects it. The only positive legacy fixture clones the current embedded 0069 migration and changes its version to 68, so the fixture and repair guard derive from the same mutable checksum rather than independently pinning the known PR #528 artifact. This fails the explicit fail-closed regression requirement for a function that mutates _sqlx_migrations. RUN_CONTROL SDK 31342729444 head=07bfb452 status=completed conclusion=success; CLI 31342729483 head=07bfb452 status=completed conclusion=success; rust-ci 31342729504 head=07bfb452 status=completed conclusion=success. Remaining dependencies: Bazel 31342729506 head=07bfb452 status=in_progress; exact-main rust-ci-full 31341543610 head=90582651 status=in_progress. Focused remediation only: add the exact negative checksum regression and independently pin/verify the PR #528 checksum fixture; same reviewer handles at most two remediation cycles. |
Archive the exact PR #528 migration bytes, pin their checksum independently, and prove unknown version-68 stamps fail closed without mutation. Agent: iapp-factory-coordinator
|
[REVIEW] GO — #534 @ 07bfb45 — lens: correctness+security+gates, reviewer Trebius (1 of 1) Reviewed the exact candidate against fresh What I ran and read:
Authoritative forge checks read by name:
Blocking P0/P1 findings: none. The migration repair is reachable only for a version-68 row whose checksum exactly matches the historical PR #528 usage-profile migration. Those historical SQL bytes equal the current version-69 migration bytes. Under the existing startup lock, the repair re-stamps that row to 69, then the normal migrator applies the retained thread-monitor migration at 68. Fresh databases, current version-68 monitor stamps, unrelated rows, and checksum mismatches do not satisfy the update predicate. Non-blocking follow-up:
|
|
[REVIEW] GO — Fable 5 fixed reviewer f4d54596. Exact head 07bfb45, tree 65b3ded13b4e9cdf5d66fb98d720f6f5966dd1a2; current main and PR base 9058265. Hosted rollup: total=28 pending=0 failed=0, all required CI SUCCESS. Acceptance passed: duplicate versions are rejected; canonical state migrations remain 68 thread-monitor and 69 usage-profile; the PR #528 legacy stamp is repaired only on exact checksum match while unknown divergence hard-fails; fresh and normal initialization remain valid; zero reachable in-scope P0/P1 defects remain. Non-blocking: unrelated migrator guard widening, a narrower negative-test refinement, and optional checksum constant pinning. |
|
[REVIEW] GO — #534 @ 4485ffb — lens: correctness+security+gates, reviewer Trebius (1 of 1) This replaces my stale GO for What I ran and read:
Authoritative forge checks read by name:
Blocking P0/P1 findings: none. The remediation independently pins the historical checksum and fixture, proves the archived bytes match the pinned PR #528 object, and exercises the real startup path with an unknown version-68 checksum. The negative regression verifies startup rejects the mismatch and preserves the migration row byte-for-byte. Bazel compile data already includes Non-blocking follow-ups: none introduced by the focused remediation. |
References Todos task 2637d518-f731-4221-8985-2218c495ce39.
PR #532 fixed fresh state initialization by preserving thread-monitor authorization as migration 0068 and moving usage-profile leases to 0069. This follow-up adds a deterministic state-migrator duplicate-version regression and repairs legacy databases created from downloadable PR #528 artifacts, where usage-profile leases was recorded at version 68. Without the repair, SQLx rejects startup with
UNIQUE constraint failed: _sqlx_migrations.version/ migration version mismatch before the current 0068 migration can apply.The compatibility repair is checksum-guarded: it changes only the historical version-68 usage-profile lease stamp to 69, then normal migration applies the preserved thread-monitor 0068 migration.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.