Skip to content

feat(review): the pin follows the lock - #249

Merged
haribo merged 2 commits into
developfrom
feat/248-the-pin-follows-the-lock
Sep 11, 2026
Merged

feat(review): the pin follows the lock#249
haribo merged 2 commits into
developfrom
feat/248-the-pin-follows-the-lock

Conversation

@haribo

@haribo haribo commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • ADR 0024 (let the pin follow the lock instead of the review status #248, validated): the displayed edition is derived, never stored — a live lock shows the edition stamped at claim, a case nobody holds always reads at the latest; cases.current_edition_id is gone with AdvanceCurrentEdition and ReleaseToLatestEdition, and intake stops skipping to-review cases (the dd9c192d95e0 freeze: evidence hidden to protect a reviewer who did not exist)
  • One resolver behind every read and stamp: displayedEdition (lock → latest) feeds factsOf, the grid's resolveEdition, comment anchors, reference stamps, coverage restores
  • A delivery still advances the case at once (a delivery advances the case onto the edition that carries it #142): deliver re-stamps the live lock onto the latest — nothing to do when nobody holds
  • The audit's gap closed: when a review settles, the state re-derives against the latest edition, past the saver's own lock — otherwise a case could stamp accepted blind to an edition already waiting
  • One rule added during implementation, flagged for review: a claim is fresh (on-load — re-stamps onto the latest) or a heartbeat (keeps the bytes). Reloading is leaving and coming back; without the distinction a reload raced its own keepalive release and showed one edition or the other by timing. In the ADR, in the contract (POST lock {fresh}), in the client
  • Migration 00022 (case_locks.edition_id, drop of the stored pin), exercised Up→Down→Up

Test plan

  • The issue's two validation tests: TestAFreeCaseReadsAtTheLatestEdition (the dd9c192d95e0 shape — a video landed after birth shows), TestAHeldCaseKeepsItsBytesUntilTheLockDies (held bytes stable through a push, latest after expiry, no write in between)
  • TestADeliveryAdvancesTheCaseOntoItsEdition green through the re-stamp, untouched
  • grep -rn current_edition_id apps/server/ answers only the migrations
  • Full gates: gen-check, be-check, be-test (12), db-test, fe-check, fe-test (110), fe-test-e2e (64)

Existing tests reworked (the issue pre-approved the list; two more surfaced):

  • TestAnIntakeDoesNotMoveTheBytesUnderAReviewer — now holds the lock, as the guarantee requires
  • TestACaseCatchesUpOnceItsReviewEndsTestACaseCatchesUpAsSoonAsNobodyHoldsIt
  • TestAnOlderEditionDoesNotDrawAStepBornLater needed nothing: it pins through the explicit edition parameter, which survives
  • Surfaced by the run: TestAnOlderEditionCanStillBeRead's second half carried the status premise (default read frozen) — it now asserts the free case reads the latest; TestACommentAnchorsToTheCaptureItWasWrittenAbout's fixture passes the anchor edition AttachCommentVariant now requires

Closes #248

@haribo
haribo merged commit ed0b21e into develop Sep 11, 2026
5 checks passed
@haribo
haribo deleted the feat/248-the-pin-follows-the-lock branch September 11, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

let the pin follow the lock instead of the review status

1 participant