Skip to content

End a follower whose log is replaced, and trim the event-log page to its explainer role - #1095

Merged
max-sixty merged 2 commits into
mainfrom
follow-and-explainer
Sep 24, 2026
Merged

max-sixty merged 2 commits into
mainfrom
follow-and-explainer

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Refinements from a review of #1075 (leaf events --follow) and #1091 (the event-log explainer).

The follower ends when its log is replaced.

  • Before this, follow_events kept its byte offset across an inode change. A log renamed into place stalled the follower silently, and a longer replacement would have been printed from the middle under the wrong seqs.
  • It now remembers the inode of the file it first opened. It ends with the existing <log> is gone error (exit 1) when the inode changes, when the file is shorter than what was read, or when the file vanishes between the stat and the open.
  • test_events_follow_ends_when_its_log_is_replaced covers it and times out without the guard.

Startup skips parsing what --after excludes. The lines at or before --after are counted, not parsed. With --after 199999 on a log of 200k events, the first event arrives in 0.04 s at 82 MB, down from 0.43 s at 390 MB.

events.md.

  • "Following the log" moves after the paragraph on dependency identities and meaning.creates, which Follow a page's event log with leaf events --follow #1075 had cut off from Admission.
  • It drops the "public format" promise, which AGENTS.md "Stage" contradicts, and keeps the rule that a reader drops fields and kinds it does not recognise.
  • It states the exit-1 case.

Page tests.

  • The captured log's lf-note anchors are now derived from the record layout and compared with the page. When regenerated records shift lines, the test fails and prints the values to use.
  • The verb-table test now compares the Unit and Record columns as well as tag and verb.

Page prose.

  • The reports and follow sections are cut to one sentence of mechanism each, plus a link to the rule, so they no longer copy packages.md and events.md.
  • The eyebrow says "how it works".
  • The Layers table no longer uses "envelope". It names what the door adds, and it lists the log's kinds by group.

Tests. Everyday suite: 1359 passed. scripts/site.py builds 84 pages. leaf version check --render is clean in light and dark.

🤖 Generated with Claude Code

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits September 23, 2026 23:48
`leaf events --follow` kept its byte offset across a log renamed into
place, so it stalled or printed the new file's middle under the old
numbering. It now remembers the inode it first opened and ends with the
"is gone" error when the log becomes another file or shorter than what it
read. Startup counts the lines at or before `--after` without parsing
them: at 200k events, first output drops from 0.43 s and 390 MB to
0.04 s and 82 MB.

events.md: "Following the log" moves after Admission's dependency
paragraph, drops the public-format stability promise (keeping the rule
that a reader skips fields and kinds it does not know), and states the
exit-1 case.

docs/event-log.html: the agent-report and change-feed sections become
one sentence each plus a link to the rule, the eyebrow reads "how it
works", and the Layers table names what the door stamps and what kinds
the log holds. The page test now derives where each captured-log note
belongs from the record layout, and the verb-table test compares the
Unit and Record columns against the registries as well as the verbs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/scripts/leaf/event_log.py
@max-sixty
max-sixty merged commit 6fecbf0 into main Sep 24, 2026
5 checks passed
@max-sixty
max-sixty deleted the follow-and-explainer branch September 24, 2026 07:22
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.

2 participants