openai / gpt-6.1-sol / high / high effort preferred over xai / grok-4.7-efficient / low / low 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 / low / low effort answer
The missing invariant is that a published review-boot sibling is valid only for the currently adopted review-pack version, and must be cleared or replaced in the same locked transaction that changes that version.
**Invariant.** `review_boot_json` / `review_boot_pack_sha256` are either null or a digest of the `inspection.json` bytes of the inspection’s current `review_pack_path` + `review_pack_job_id`. A path or producer-job change must drop the previous sibling before commit. A stamp may publish boot only while holding that row lock and only when path and job still match the artifact. A retry whose pointer is already current must republish boot when the sibling is null or sha-mismatched, without a second invalidation. A failed stamp must not leave the previous version’s boot in place.
**Where it breaks.** `adopt_review_pack` (`review_pack_adoption.py` 120–164) updates the pointer, invalidates acceptance, and audits `AUTO_INVALIDATE_REVIEW_PACK_CHANGE`, but never reads or writes the boot columns. An identical retry (`version_changed` false, 163–164) is a pure no-op, so it cannot repair a boot stamp that failed after the pointer commit. `stamp_review_boot` / `persist_review_boot_from_bytes` (`review_boot.py` 155–208) are best-effort, swallow all errors, use `db.get` without `FOR UPDATE`, and do not compare path or job to the bytes. Consequences under the three stresses:
- Partial failure: pointer commit succeeds, boot stamp logs and returns; GET first-paint still serves the previous pack’s zones, cards, and start.
- Retry: second adopt sees the same path and job, skips invalidation and skips boot, so the stale sibling sticks.
- Changed inspection state / races: an unlocked `persist_review_boot_from_bytes` can commit pack A’s boot after pack B is adopted, or commit boot for bytes whose adopt later rolls back. In-place `inspection.json` writers in the same packet (`save_inspection_start` 2874–2896, `regenerate_heatmap` 3923–3954) also change bytes that boot hashes (`review_boot.py` 126–127, 133–151) without restamping, so `review_boot_pack_sha256` no longer names the adopted object. `serve_review_pack_file` does not consult boot at all.
**Smallest cohesive correction.** In `adopt_review_pack`, on `version_changed`, set `review_boot_json` and `review_boot_pack_sha256` to null in that same locked transaction (before the audit write). Add optional `pack_bytes`. After the pointer assignment, and also on the unchanged retry path, if `pack_bytes` is present and the row’s path/job equal `new_path`/`new_job_id`, call `apply_review_boot`. On retry, apply only when the stored boot sha differs, so a missed stamp is repaired without another `AUTO_INVALIDATE`. Change `stamp_review_boot` and `persist_review_boot_from_bytes` to require `expected_path` and `expected_job_id`, `SELECT … FOR UPDATE`, and no-op on mismatch — do not write boot for a pack that is not yet the adopted pointer. Callers that stamp before adopt should pass bytes into adopt instead. Same rule for `save_inspection_start` and `regenerate_heatmap`: after a successful `inspection.json` put, `apply_review_boot` on the written bytes under the inspection lock already held, or clear the boot columns if stamping fails, so a sha is never left pointing at the pre-write object.
**Regression coverage.** (1) A→B adopt with pre-existing boot and no bytes nulls both boot columns and still invalidates and audits. (2) A→B adopt with bytes leaves `review_boot_pack_sha256 == sha256(bytes)` and `boot["pack_sha256"]` equal to that digest; a rollback of the adopt transaction restores the old boot. (3) Stale-job rejection does not clear boot. (4) Retry with the same path and job and bytes, boot already null, republishes boot and does not emit a second `AUTO_INVALIDATE`. (5) `persist_review_boot_from_bytes` with a mismatched expected path/job does not overwrite boot after a committed adopt. (6) `save_inspection_start` updates boot `inspection_start_s` and boot sha to the written bytes; if the boot flush fails, boot columns are null rather than the pre-write slice.
**Alternatives discarded.** Track-data binding already fails closed on a changed read (`review_pack.py` 4186–4226); inspection.json enrichment fail-open is a different policy and does not explain stale first-paint after pack switch. Certification lock/sidecar recovery is local and already idempotent. Unlocked boot writes are not fixed by logging.
**Missing evidence.** Callers of `adopt_review_pack` and `stamp_review_boot`, and the GET that serves `review_boot_json`, are outside this packet. Severity of first-paint mismatch depends on that reader treating boot as authoritative until pack bytes arrive — the boot module states that, but the reader is not here. `Inspection` column definitions are also outside the packet; the correction assumes those two attributes exist as assigned in `apply_review_boot`.
**Next action.** Implement the clear-or-restamp inside `adopt_review_pack` plus the locked path/job check on the boot writers, with the six regressions above. Do not keep an independent best-effort stamp that can commit a sibling for a non-current pack.
Primary judge's stated reason
Prefer A because its correction and fault-injection coverage preserve coherence when storage publication succeeds but the DB transaction fails. This is a weak comparative preference, not an established material quality gap: B is more immediately actionable for the narrower boot-switch problem, and an independent review could favor that smaller scope.
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_33a2d6bc029be692b0081346d92329f63621209505adfe39210e60fda294f20e. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.