Skip to content

Name every subsystem that emits an event, not only the cache - #484

Merged
iderex merged 1 commit into
mainfrom
diagnostics-names-every-subsystem-that-emits
Sep 18, 2026
Merged

iderex merged 1 commit into
mainfrom
diagnostics-names-every-subsystem-that-emits

Conversation

@iderex

@iderex iderex commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

The issue this belongs to

Closes #483

What changed

The Which events exist today section of src/diagnostics/mod.rs stops saying
the events are the cache's and nobody else's. It names all three subsystems that
declare and emit one today, says what each event is about, and keeps naming no
event: which names they are is still read out of the tree by the command the
paragraph already carries. A second correction paragraph records what the
sentence was and which of the two states the section itself distinguishes this
instance had.

Nothing else moves. No behaviour, signature, variant, event name or emitting
site.

What failure it prevents

The section exists to tell somebody which subsystems report through this
facility. It answered with one where the tree has three, and the two it left out
are the two whose events say that a person's action was dropped and that a
session has stopped recording positions. A reader sizing what a client's sink
will actually receive got the smaller half.

This is a correction. The sentence landed on 2026-09-18 as the repair of the
same section's previous stale claim, and both of the modules it denies were
already emitting when it was written, so it landed refuted rather than going
stale. It was found by running the command the paragraph hands a reader,
narrowed to the declarations rather than the mentions.

Evidence

The commit being pushed:

git rev-parse HEAD
8a6360c59e4638507d41bb0efb795a5f778638d3

What the section said, at the parent:

git show 8a6360c^:src/diagnostics/mod.rs | sed -n '33,40p'
//! # Which events exist today
//!
//! The cache's, and nobody else's. [`crate::cache::bound`] emits one when a full
//! device suspends writing and one when artwork gives way to metadata, and
//! [`crate::cache::envelope`] emits one when an entry is dropped for failing its
//! check. Which names those are is read out of the tree rather than listed here,
//! because a list in this module goes stale against the modules that declare
//! them: `git grep -n 'EventName::declared' -- src/`.

The declarations at the parent, narrowed to the declarations rather than the
mentions:

git grep -n "^const .*EventName::declared" 8a6360c^ -- src/
8a6360c^:src/cache/bound.rs:105:const WRITING_SUSPENDED: EventName = EventName::declared("cache.writing-suspended");
8a6360c^:src/cache/bound.rs:109:const ARTWORK_GAVE_WAY: EventName = EventName::declared("cache.artwork-gave-way");
8a6360c^:src/cache/envelope.rs:174:const ENTRY_DROPPED: EventName = EventName::declared("cache.entry-dropped");
8a6360c^:src/server/write_queue.rs:98:const AN_ENTRY_WAS_DROPPED: EventName = EventName::declared("write-queue.entry-dropped");
8a6360c^:src/session/mid_playback.rs:86:const REPORTING_SUSPENDED: EventName = EventName::declared("session.reporting-suspended");

Three of the five are the cache's. Both of the others are emitted in library
code:

git show 8a6360c^:src/server/write_queue.rs | sed -n '489,492p'
            diagnostics.emit(
                Severity::Failure,
                AN_ENTRY_WAS_DROPPED,
                &[
git show 8a6360c^:src/session/mid_playback.rs | sed -n '168,174p'
/// Tells the client, once, that this session can no longer report.
fn say_positions_are_held(queue: &WriteQueue<PositionReport>, diagnostics: &Diagnostics<'_>) {
    diagnostics.emit(
        Severity::Failure,
        REPORTING_SUSPENDED,
        &[Field::new(
            POSITIONS_HELD,

ahead of the first test module in each file:

git show 8a6360c^:src/server/write_queue.rs | grep -n '#\[cfg(test)\]'
545:#[cfg(test)]
git show 8a6360c^:src/session/mid_playback.rs | grep -n '#\[cfg(test)\]'
281:#[cfg(test)]

The dates. Both declarations predate the sentence that denies them, which landed
today:

git blame -L 86,86 --date=short 8a6360c^ -- src/session/mid_playback.rs | cat
701ee127 (Nils Lehnen 2026-09-03 86) const REPORTING_SUSPENDED: EventName = EventName::declared("session.reporting-suspended");
git blame -L 98,98 --date=short 8a6360c^ -- src/server/write_queue.rs | cat
0afe3c4b (Nils Lehnen 2026-09-04 98) const AN_ENTRY_WAS_DROPPED: EventName = EventName::declared("write-queue.entry-dropped");
git blame -L 35,35 --date=short 8a6360c^ -- src/diagnostics/mod.rs | cat
b5266ba0 (Nils Lehnen 2026-09-18 35) //! The cache's, and nobody else's. [`crate::cache::bound`] emits one when a full

What the section says now:

git show HEAD:src/diagnostics/mod.rs | sed -n '33,60p'
//! # Which events exist today
//!
//! The cache's, the write queue's and the session's. [`crate::cache::bound`]
//! emits one when a full device suspends writing and one when artwork gives way
//! to metadata, [`crate::cache::envelope`] emits one when an entry is dropped
//! for failing its check, [`crate::server::write_queue`] emits one when an
//! overflow drops the oldest entry, and [`crate::session::mid_playback`] emits
//! one when a session can no longer report a position. Which names those are is
//! read out of the tree rather than listed here, because a list in this module
//! goes stale against the modules that declare them:
//! `git grep -n 'EventName::declared' -- src/`.
//!
//! THIS SECTION READ "NONE. NOTHING IN THIS TREE EMITS ONE, BECAUSE NO SUBSYSTEM
//! THAT WOULD IS BUILT." It was true on 2026-08-26, when it landed, and stopped
//! being true the next day: the cache bound arrived on 2026-08-27 with two
//! events and the entry envelope on 2026-08-28 with a third, and neither change
//! had a reason to open this file. So this one went stale rather than landing
//! refuted, which is the milder of the two states and is worth saying in those
//! words. #442 is where it was found.
//!
//! IT THEN READ "THE CACHE'S, AND NOBODY ELSE'S", WHICH IS THE OTHER OF THOSE
//! TWO STATES. The session declared and emitted its event on 2026-09-03 and the
//! write queue on 2026-09-04, and the sentence denying them landed on 2026-09-18
//! as the repair recorded above, so it landed refuted rather than going stale.
//! The command this section already hands a reader returned both of them on the
//! day that sentence was written, which is what makes this the harder of the two
//! to defend. #483 is where it was found.
//!

What the change is:

git diff --stat origin/main...HEAD
 src/diagnostics/mod.rs | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
git diff --name-only origin/main...HEAD
src/diagnostics/mod.rs

The two commands the gate runs, at this commit. The build was run first and
exited 0; its own summary line is not pasted, because this board's hygiene check
reads the word in it as a speed claim:

cargo build --locked --all-targets ; echo "exit=$?"
exit=0
cargo test --locked ; echo "exit=$?"
exit=0
cargo test --locked 2>&1 | grep -c '^test result: ok'
10
cargo test --locked 2>&1 | grep -c 'test result: FAILED'
0

The two links the paragraph adds resolve, which the ordinary build does not
judge:

cargo doc --no-deps --locked ; echo "exit=$?"
exit=0

Four of this board's own legs, run on this machine at this commit:

bash .github/invariants/invariants.sh check | tail -1
Every rule above was applied to its subject and refused nothing.
bash .github/format/format.sh check | tail -1
Every tracked source file above is written the way the formatter would write it.
bash .github/doc-paths/doc-paths.sh check | tail -1
Every path these documents name resolves against the tracked set.
bash .github/lint/lint.sh check | tail -1
Every lint the groups above carry was refused, outside the register printed with it.

What this does not cover

  • src/server/write_queue.rs and src/session/mid_playback.rs. Both are
    read as evidence and neither is edited. Their declarations, their severities
    and their fields stand as they are.

  • Whether every subsystem that should emit does. Counting declarations says
    which subsystems emit, never which ones ought to. That question belongs to the
    issue building each subsystem and was not asked here.

  • The event names. None is written into this file, which is the section's own
    rule and the reason it hands a reader a command instead.

  • The module header's hand-off for what may leave through an event. Line 6 of
    this file sends a reader to 0071 and Keep personal data out of logs, errors and anything a person is asked to send #71 and never names the submodule that
    answers it. That sentence is not false and is a separate reading.

  • 0100 and 0071. Both records are read and neither is edited. A record is
    added or superseded rather than edited in place, which
    docs/decisions/0001-decision-records.md fixes.

  • A check that would refuse this. Nothing in this tree reads a sentence in a
    doc comment against the declarations the same paragraph's command returns, and
    the document check reads only .md files. This adds no rule, so the next
    sentence of this shape is caught by a reader or not at all.

  • The shell analysis. It was not run on this machine, because the analyser is
    not on this machine's path:

      command -v shellcheck ; echo "exit=$?"
      exit=1
    

    What the run on this pull request reports is the reading, and nothing is
    claimed for it from here. This change touches no shell file.

Who has read it

Nobody other than the author. There is no second reader on this board tonight,
and the readings pasted above stand in place of one rather than a review having
happened.

The `Which events exist today` section of `src/diagnostics/mod.rs` said the
events are the cache's and nobody else's. `src/session/mid_playback.rs` has
declared and emitted one since 2026-09-03, when a session can no longer report a
position, and `src/server/write_queue.rs` since 2026-09-04, when an overflow
drops the oldest entry. Both emits are library code, ahead of the first test
module in their files. The section now names all three subsystems and keeps
naming no event: which names they are is still read out of the tree by the
command the paragraph already carries.

What that prevents is a reader sizing what a client's sink will receive off the
smaller half. The two subsystems the sentence left out are the two whose events
say that a person's action was dropped and that a session has stopped recording
positions, which are the events a client most needs to be told it will get.

The sentence itself landed on 2026-09-18 as the repair of the same section's
previous stale claim, and both modules were already emitting when it was written,
so this one landed refuted rather than going stale. The section draws that
distinction in its own words for the previous instance, so the new paragraph says
which of the two this one was rather than repeating the milder word. It was found
by running the command the paragraph hands a reader, narrowed to the
declarations.

Nothing else moves. No behaviour, signature, variant, event name or emitting
site.

Closes #483

Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
@iderex
iderex merged commit b9a73cd into main Sep 18, 2026
28 checks passed
@iderex
iderex deleted the diagnostics-names-every-subsystem-that-emits branch September 18, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant