Skip to content

retention: every sweep reaches every record class and says what it did — card presses go with their events, the watcher keeps thirty days - #48

Merged
itswl merged 1 commit into
mainfrom
sweeps-reach-every-record
Nov 9, 2026
Merged

itswl merged 1 commit into
mainfrom
sweeps-reach-every-record

Conversation

@itswl

@itswl itswl commented Nov 9, 2026

Copy link
Copy Markdown
Owner

A second deployment running copies of these files upgraded its runtime this week. The new version began closing orphaned sessions at startup under a new end reason, its daily cleanup matched only sessions that had never ended, and six hundred piled up over six days with nothing said. Asked of this repository, the same question had two answers.

The pipe's purge never reached card presses. card_actions has no foreign key to events, so when the retention purge deleted an event its presses stayed, forever, while the purge's own comment promises a ledger that does not grow forever. The purge now deletes a press once its event is gone and the press is older than the window. A press on an event kept for a queued promise stays, and so does a young one. The test for the purge now plants a press on each of its three events and checks which survive.

press on event after the purge press after the purge
the settled old event purged purged
the old event with a queued delivery kept kept
the fresh event kept kept

The watcher kept every round. The investigator keeps case files and transcripts forever by default, because an investigation is recall. The watcher's case files are rounds, one every twenty minutes of the working day, read back by the signer's settlement for at most an hour and grepped by the next round for the same subject. Measured on the stopped work stack's volume:

record class on the watcher's volume, 2026-09-04 to 10-09
case files 356
telemetry files 317
audit day files 36

The work compose now sets HOOKPROBE_RETENTION_DAYS to 30 on that node alone, through WATCH_RETENTION_DAYS; 0 keeps everything. The planner and the work runner keep the default. The audit chain is verified over its last seven day files and its first line in the window may point outside it, so a swept day is never a break.

Every sweep says what it did. The judge's hourly purge logs its count like the pipe's. The investigator's two sweeps count the files they could not remove or inspect and warn on every run, where they used to skip them in silence and read as healthy; a test makes the results directory read-only and requires the warning.

Not done, and why. A per-table row count on the console, and an integrity check of the ledgers after an abrupt host stop: the doctor script knows no ledger paths, and the deployment that measured such a stop found its ledger intact. The decision note records both.

Nothing is deployed; the work stack stays stopped. The pipe, judge and investigator changes ship at the next release.

Gate: STACK GATE GREEN locally; CI read back before merging.

…d — the pipe purges card presses with their events, the watcher keeps thirty days

Asked of each sweep which records it never reaches: card_actions was the one
pipe table no sweep touched. It has no foreign key to events, so the presses
of purged events stayed forever while the purge's comment promised a bounded
ledger. The purge now deletes a press once its event is gone and the press is
older than the window; a press on an event kept for a queued promise stays.

The investigator keeps case files forever by default, which is right for
investigations and wrong for the watcher, whose case files are rounds: five
weeks left 356 case files, 317 telemetry files and 36 audit days on its volume
with nothing removing them. The work compose sets HOOKPROBE_RETENTION_DAYS to
30 on that node alone (WATCH_RETENTION_DAYS). The audit chain is verified over
its last seven day files, so a swept day is never a break.

The judge's purge logs its count like the pipe's, and the investigator's two
sweeps count the files they could not remove or inspect and warn on every run
instead of skipping them in silence. A second deployment running copies of
these files found the shape this week: an upgrade began writing records its
daily cleanup could not reach, and six hundred piled up unsaid.
@itswl
itswl merged commit 6232297 into main Nov 9, 2026
12 checks passed
@itswl
itswl deleted the sweeps-reach-every-record branch November 9, 2026 04:14
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