Skip to content

Pins a late event before and after the reap - #153

Merged
johnnyt merged 1 commit into
mainfrom
sr-n0y4-late-partner-after-reap
Oct 2, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sr-n0y4-late-partner-after-reap

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 2, 2026

Copy link
Copy Markdown
Member

Pins what a late event meets once its execution has finished, before and after StatifierRouter.Addresses.reap/3 deletes the execution's address row, under each create mode, and records the trade as the host's. Nothing under lib/ changes.

Bead: sr-n0y4.

What changes

  • Tests. StatifierRouter.LatePartnerTest (test/statifier_router/late_partner_test.exs), over the parcel chart and the parcel scan bindings already in the test support:
    • :if_absent: a late delivered scan is dropped: finished before the reap, and after the reap it opens a second execution for the parcel;
    • :if_absent: the longest dedupe horizon of any enabled binding naming the document is what keeps the row, and a disabled binding's longer horizon does not count;
    • :never: the late scan is dropped: finished before the reap and dropped: no_execution after it, creating nothing;
    • :never: its cost, a delivered scan that arrives before its loaded scan is lost;
    • :always_new: every scan opens its own execution before and after a reap, which finds no row.
  • Record. A dated Note at the foot of docs/adr/0002-addressing.md: the knob is the dedupe horizon, a document no enabled binding names (one reached only through the execution target) has a horizon of zero, a per-mode table of what a late event meets, and create: :never on the partner binding as the first-line answer with its cost. A refusing create mode and a tombstone kept past the address row are left for a later record.
  • README. One paragraph in "The host schedules the reapers", after the Addresses.reap/2 paragraph, naming the same knob and trade.

No changelog fragment: tests and docs only, which changelog.d/README.md excludes.

Provenance

The trade documented as the host's, with no new create mode and no tombstone in this change: ruled by the operator, 2026-10-01.

Direction check of the Note

Every claim was read against main at the branch's base. The horizon is the longest horizon_ms of the enabled bindings naming the document, read per call (the private horizons/1 of StatifierRouter.Addresses, reached through reap/3), and counted from terminal_seen_at (ADR-0002, sections 5 and 6; the private due?/3). A dedupe row's expires_at is the delivery's time plus the same horizon_ms (StatifierRouter.Dedupe.claim/4). The per-mode table matches ADR-0003, section 4 and the private by_mode/4 and absent/4 of StatifierRouter.Delivery; the "after" column of if_absent is the created path's outcome, created_and_delivered or dropped: unmatched_event (ADR-0004), and the test shows the second for a scan the chart's first state does not take. always_new writing no row is ADR-0002, section 7. The Note opens with the house sentence, cites by anchor, and the diff removes zero lines under docs/adr/.

Verification

  • Full mix quality green on the committed tree: the isolated stage, the suite, Dialyzer, Docs and Doc links.
  • The kit's pre-request review round ran on the branch (a diff critic and a test critic); its accepted findings are in this commit: the if_absent after-reap cell names both outcomes, the Note says terminal_seen_at is never earlier than the finish, the knob test orders the longest horizon first and carries a disabled binding, and the Note's tests bullet says exactly what is pinned.
  • Each new test was sabotaged against the lib/ lines it covers and went red on an assertion; the mutation is noted above each test.

Adds tests and a dated Note on ADR-0002 for a late event whose
execution has finished. Before the reap deletes its address row the
event is dropped as finished; after it, an if_absent binding opens a
second execution for the key, a never binding drops the event as
no_execution, and an always_new binding opens a new execution either
way. The Note and the README reaper paragraph name the knob: the
longest dedupe horizon of any enabled binding naming the document.
Nothing under lib/ changes.

Refs: sr-n0y4
@johnnyt
johnnyt merged commit ff7028c into main Oct 2, 2026
1 check passed
@johnnyt
johnnyt deleted the sr-n0y4-late-partner-after-reap branch October 2, 2026 10:19
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.

1 participant