openai / gpt-6.1-sol / high / high effort preferred over xai / grok-4.7-efficient / high / high effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Assess the review-pack boot, retrieval, and adoption boundaries for architectural consistency under retries, changed inspection state, and partial failure. Identify a concrete invariant that is missing or inconsistently enforced, trace its path through the supplied implementation, and propose the smallest cohesive correction plus regression coverage.
openai / gpt-6.1-sol / high / high effort answer
## Finding: boot state is not bound to the adopted pack version
**High confidence:** the supplied implementation permits the current pack pointer, boot payload, and retrieved pack bytes to describe different versions.
**Missing invariant:** changing the adopted artifact must atomically replace or invalidate its derived boot state; delayed writers must not restore boot data from an obsolete version.
### Evidence and reproducible triggers
All paths below are under `[REDACTED: private project name]/backend/app/`.
1. **Adoption preserves old boot state.**
`services/review_pack_adoption.py:120–162` updates the path/job, invalidates acceptance, and audits the version change—but neither updates nor clears `review_boot_json` or `review_boot_pack_sha256`.
Reproduction:
- Populate boot from pack A using `apply_review_boot` (`services/review_boot.py:144–152`).
- Adopt pack B with a different path or job.
- The inspection now points to B while retaining A’s boot payload and SHA.
- Retrieval selects the current pointer B (`routers/review_pack.py:4068–4121`).
2. **A delayed boot writer can overwrite newer state.**
Both boot persistence functions select only by inspection ID, without checking the expected pack path/job:
- Caller-owned transaction: `services/review_boot.py:155–182`.
- Dedicated session: `services/review_boot.py:185–208`.
After B is adopted, a delayed `persist_review_boot_from_bytes(id, bytes_A)` can successfully install A’s boot again. Rejecting older jobs during adoption (`services/review_pack_adoption.py:101–118`) does not protect this separate write boundary.
3. **Successful in-place edits also cause divergence.**
Inspection-start changes rewrite `inspection.json` at `routers/review_pack.py:2873–2881`; heatmap regeneration rewrites it at `3951–3954`. Neither visible path refreshes boot. Inspection-start is particularly concrete: boot contains that field (`services/review_boot.py:126`), so the displayed start and stored boot start can differ after a successful request.
4. **Failure preserves potentially stale boot.**
Invalid pack bytes make `apply_review_boot` return `False` without clearing previous columns (`services/review_boot.py:146–152`). Persistence exceptions are non-blocking (`177–182`, `203–208`). Heatmap publication also precedes the DB commit; a subsequent failure rolls back DB state but leaves changed storage bytes (`routers/review_pack.py:3954–3983`).
### Implications
Boot is a free-floating projection rather than an adopted-version projection. This permits obsolete first-paint locations/start markers and makes retries capable of reversing newer boot state.
There is also a related certification boundary: adoption defines version changes exclusively through path/job differences (`services/review_pack_adoption.py:120–122`). Changed bytes at the same path/job are therefore invisible to that invalidation mechanism. The supplied router rewrite paths do not visibly invoke it.
The track-response SHA does not solve this: it attests the canonical footage trajectory, not the complete pack or boot payload (`routers/review_pack.py:423–497`, `4208–4236`).
## Smallest cohesive correction
Centralize **publication plus adoption of a version-bound boot projection**, rather than adding unconditional stamping calls:
- On every adopted version change, replace boot from the candidate’s exact bytes in the adoption transaction, or clear both boot columns when boot is unavailable.
- Require background boot writers to supply an expected artifact identity and verify it under the same inspection lock before writing. Obsolete attempts must be no-ops.
- Route inspection-start and heatmap publications through that boundary.
- Use an immutable revision key for changed published bytes, with an expected-current-version check for edits. Upload the revision first; then atomically commit its pointer, boot, acceptance/sign-off transition, and audit.
The immutable revision is necessary for the supplied partial-failure ordering: merely stamping boot after overwriting the existing object still leaves changed storage paired with rolled-back DB state. An unsuccessful DB adoption should leave only an unreferenced candidate, not modify the currently referenced artifact.
## Regression coverage
1. **A → B adoption:** B’s pointer and boot commit together; unavailable boot clears A’s projection.
2. **Delayed A writer:** after B adoption, attempting to persist A leaves B’s state unchanged.
3. **Retries:** identical adoption is idempotent; older-job adoption changes neither pointer nor boot; A → B → A does not revive prior proof.
4. **In-place edit replacement:** start/heatmap edits publish a revision whose boot SHA matches its exact bytes.
5. **Fault injection:** fail upload, boot derivation, audit/flush, and commit separately. Assert the previously adopted artifact remains coherent and failed candidates cannot become current through a delayed boot write.
6. **Concurrent edits:** an edit based on A cannot overwrite already-adopted B.
## Limits and discarded conclusions
- The inspection-detail reader and frontend reconciliation are outside the packet. Thus **state divergence is established; actual stale UI rendering is not**.
- Cache implementation and adoption call sites are outside the packet; their freshness or caller-level safeguards cannot be assessed.
- Strict older-job rejection and same-version adoption no-ops are useful existing controls. Null-job handling, explicit ordering bypass, and compensation overrides are not independently proven defects.
**Next action:** implement and test the version-bound publication contract before adding more best-effort boot writes.
*Direct analysis of the supplied immutable snapshot; no execution or external inspection.*
xai / grok-4.7-efficient / high / high effort answer
The missing invariant is that a review boot is valid only for the currently adopted pack generation. `review_boot_json` / `review_boot_pack_sha256` may be published or left in place only while the locked inspection’s `review_pack_path` and `review_pack_job_id` still identify the bytes that were hashed. Adoption, boot publish, and pack retrieval/mutation do not enforce that together, so retries, in-place edits, and partial failure can paint one generation while serving another.
**Evidence.** `adopt_review_pack` treats a path or producer-job change as a new certification generation and invalidates acceptance in that same locked transaction (`review_pack_adoption.py` 69–78, 120–162). It never clears `review_boot_json` or `review_boot_pack_sha256`. A stale older job returns with no mutation (101–118), which is correct, but nothing stops a late boot write from that same older attempt.
`stamp_review_boot` loads with `db.get` and flushes boot columns inside a savepoint, with no row lock, no `populate_existing`, and no path/job compare (`review_boot.py` 155–182). Failures are swallowed. `persist_review_boot_from_bytes` commits on a separate session with the same unconditional write (185–208). `apply_review_boot` returns false on malformed bytes and leaves the previous boot (144–152). Reproducible trigger: job 11 adopts path P11 and commits; job 10’s `persist_review_boot_from_bytes` (or an identity-map `stamp_review_boot`) then writes boot columns only. The pointer stays P11; first-paint boot is job 10’s slice, including a different `inspection_start_s` (`review_boot.py` 123–130). Same-path regeneration is the same hole: adoption changes only `review_pack_job_id` (docstring 72–74) while the old boot remains.
Retrieval does not close the gap. The router never reads or updates boot. `save_inspection_start` and `regenerate_heatmap` already hold `for_update`, then rewrite `inspection.json` (and therefore its SHA) without restamping or clearing boot (`review_pack.py` 2841–2896, 3788–3983). Heatmap regen puts storage before the DB commit; on cache/audit failure it rolls the DB back and leaves the new object in place (3954–3982), so boot still names the pre-regen bytes. `serve_review_pack_file` snapshots `review_pack_path`, closes the session, and serves those bytes (4068–4118, 4260–4347). It binds pack path and a hash only for `track_data.json` (402–419, 4174–4236), not for `inspection.json`. GET also overlays `user_overrides.inspection_start_s` (4280–4282) while boot copies only the pack field. After a successful start save those can be reconciled on the next GET only if override sync actually put; if `inspection.json` is written and `sync_override_inspection_start` then raises (2874–2881), the pack has the new start, the override still has the old one, and the next GET paints the override. Boot matches neither.
**Smallest correction.** Fail closed to “no boot” rather than a foreign boot.
1. In `adopt_review_pack`, on `version_changed` only, set both boot columns to `None` on the already-locked row before the audit, and record that clear in the audit changes. Do not clear on `stale_job`.
2. Extend `stamp_review_boot`, `persist_review_boot_from_bytes`, and `persist_review_boot_from_path` with `expected_path` and `expected_job_id`. Re-load with `with_for_update()` and `populate_existing=True`. Write boot only if `review_pack_path == expected_path` and `review_pack_job_id == expected_job_id`. Otherwise return without writing. Callers must adopt, then stamp, so a stamp-before-adopt no-ops and the adopt clear stands. Keep the savepoint swallow only after that compare, so a failed restamp cannot restore the previous generation.
3. In `save_inspection_start`, sync the override before treating the pack put as committed: on sync failure, put the original `inspection_bytes` back and raise before `db.commit()`. On success, `apply_review_boot` on the locked row from the bytes just written, then commit. In `regenerate_heatmap`, clear boot on the locked row in the transaction that commits the prescan cache; in the existing rollback handler, best-effort clear boot again so a storage-ahead-of-DB failure cannot keep the old slice. Do not publish boot from the router’s in-progress fallback path.
**Regression coverage.** (1) Path change, same-path job change, and path→None clear both boot columns; `stale_job` does not. (2) After job 11 is adopted, persist/stamp of job 10 bytes no-ops; a matching job 11 retry may stamp. (3) Malformed bytes after adopt leave boot null, not the previous payload. (4) `save_inspection_start` leaves `review_boot_pack_sha256` equal to SHA-256 of the written object and `inspection_start_s` equal to the saved value; a forced sync failure leaves the previous object bytes. (5) Heatmap regen DB rollback does not leave boot SHA equal to the pre-regen bytes once the new object has been put.
**Discarded.** Certification lock sidecar recovery already fails closed and replays. Supporting-evidence attach skips ids already stored. Override size checks in `load_override_inspection_start` and `sync_override_inspection_start` agree on skip. Those are not this seam. Omitting `inspection_start_s` from boot would hide the symptom and break the documented first-paint contract; generation binding fixes it if stamp happens after the bytes that retrieval will serve.
**Uncertainty.** Callers of adopt/stamp, the `Inspection` column definitions, and `GET /inspections/{id}` (the documented boot consumer) are outside this packet. If that GET does not compare `review_boot_pack_sha256` to the adopted object, writer-side CAS is necessary but not a complete read-side backstop. `get_inspection_json_bytes` behavior is also outside the packet.
**Next action.** Implement the adopt-clear plus path/job compare-and-set first, then the two router mutation sites, then the five regressions above.Primary judge's stated reason
Weak, forced preference for B: its correction and fault-injection coverage more coherently preserve the adopted artifact across storage-success/DB-failure boundaries. This is not an established material quality gap; A offers a more localized implementation plan, and an independent review could reasonably prioritize that advantage.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: b60a358e-7993-4567-b86d-c5b92705bbea. Pair: brp1_98c87584033dd8ef19fa4b0cf35eb1dbb5b02dc6cd7e0aef53074fe00f37cf32. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.