Skip to content

docs(mux): repoint three citations at the code they name - #1504

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
docs/mux-claim-corrections
Sep 24, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
docs/mux-claim-corrections

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Three citations in lib/src/protocol/mux/LIFECYCLE.md resolved to real, non-blank, unrelated lines; three field declarations named the wrong container and the wrong owner; and one CHANGELOG.md sentence named the wrong reason for a coverage gap. Documentation only.

1. §4.2 — Context.streams push: mod.rs:648-649 → mod.rs:773

648-649 are listener.get_sticky_name().to_string() and listener.get_sozu_id_header().to_string(), arguments of the HttpContext::new(...) call that opens Context::create_stream. The push the bullet describes is self.streams.push(stream) at mod.rs:773, past the Recycle-reuse early return the bullet names as its own precondition.

2. §3.1 — Unlinked transitions in H1: h1.rs:995-1052 → h1.rs:1042-1099

995 is a format string inside ConnectionH1::end_stream's wrong-stream error! guard; 1052 is a debug_assert! argument. The four StreamState::Unlinked assignments the range is meant to bracket are at 1042, 1061, 1091 and 1099. It was exact when written — fbc83edf carried h1.rs:737-772 against assignments at 737, 745, 767 and 772 — and successive renumberings walked it off them while keeping it plausible.

3. §7.5 — HEADERS liveness refresh: h2.rs:5387 → h2.rs:5421

5387 is log_context!(self) inside error!("… header_block_fragment out of bounds of zero.storage"). The refresh is self.stream_table.touch_activity(stream_id, self.now) at h2.rs:5421, under the comment that names it. Two commits have now renumbered this citation faithfully and still onto the wrong statement: #1501 took it 5376 → 5384, then #1497 took it 5384 → 5387. Each move preserved the pointer and neither preserved the claim. A re-anchor preserves the pointer, not the claim.

4. CHANGELOG.md — #1484's coverage note

The entry said shared::drain_tls_close_notify's two uncovered lines were uncovered "because nothing calls that function at all". It has two production callers: the Position::Server arms of ConnectionH1::close (h1.rs:953) and ConnectionH2::close (h2.rs:6358), each importing it from shared.rs. What #1484 measured is that its own six-test fixture never reaches them.

Only that causal clause changed. Every count, probe tally and mutation result in that historical entry was true as measured and is left exactly as written — a CHANGELOG is a log, not a live dashboard. The replacement cites by symbol rather than line, so it cannot rot.

5. §7.2 — the three per-stream reap caches: wrong container and wrong owner

ConnectionH2.stream_last_activity_at: HashMap<StreamId, Instant>, ConnectionH2.stream_fc_stalled_since: HashMap<StreamId, Instant> and ConnectionH2.stream_fc_stalled_progress: HashMap<StreamId, usize> → H2StreamTable.<name>: BTreeMap<…> for all three.

Both halves are wrong, and have been since #1415's stream-slot-bookkeeping extraction. The three are private BTreeMap fields of H2StreamTable (h2_stream_table.rs:139, :143, :147, built by BTreeMap::new() at :177-179); enumerating ConnectionH2's 34 struct fields finds none of those names.

#1415 converted them for the determinism reason its own CHANGELOG entry records — collect_timed_out's union decided which of several simultaneously-timed-out streams was RST_STREAM'd first, and a HashMap made that order vary across restarts — and it updated §4.1's wire-map bullet, but left §7.2 on the pre-extraction shape. Reading §7.2's container name as a determinism claim currently inverts the guarantee the code provides.

No rule could have caught these. Every rule in check_doc_citations.py resolves a path:NNN or a fenced quote, and a sentence naming a type and a container carries neither — these sat in no rule's surface at all. So the class was swept directly instead: every ConnectionH2.<field> reference in LIFECYCLE.md checked against the real struct. The only stale ones left are three ConnectionH2.streams references (:55, :396, :428) which belong to the streams → BTreeMap changeset, not here.

The new CHANGELOG paragraph cites H2StreamTable and H2StreamTable::new by symbol, not by line: that module is being edited concurrently, CHANGELOG.md is outside the gate's surface (doc/** and **/LIFECYCLE.md only), so a pinned line number there would rot silently — exactly the disease this branch treats.

Why the gate passed all three

check_doc_citations.py's drift rule keys its exemption on the citation tuple as it stood in the base revision of the citing document. A span the changeset re-anchored is counted exempt and never compared — and a renumbering is a re-anchor. All three sat in that blind spot, each landing on a line that is real and non-blank, which is all the resolver rules ask.

The sweep, and its ratio

Note that --base <the same SHA the tree is at> compares HEAD to itself and yields an exempt set of 0 by construction — a no-op dressed as a clean bill. The base has to be calibrated to the window the errors were born in:

Deliberately not changed

LIFECYCLE.md:2023 (h2.rs:6330-6428) and :2040 (h2.rs:6367-6427) have exact range starts, and ends that stop ~6 lines short of the closing brace (6433 / 6435), landing on an error! argument inside the very block they describe. Imprecise, not misdirecting — a different class, and the clipping predates this window.

Validation

Documentation-only; no Rust file touched, so the Rust battery establishes nothing about it and was not run.

python3 .github/scripts/check_doc_citations.py --root .                  -> exit 0
python3 .github/scripts/check_doc_citations.py --root . --base 42ed6bac  -> exit 0
python3 .github/scripts/check_doc_citations.py --root . --base d192407b  -> exit 0
python3 .github/scripts/check_doc_citations.py --audit --root .          -> exit 0 (advisory)

…e code

lib/src/protocol/mux/LIFECYCLE.md carried three `path:NNN` citations that
resolved to real, non-blank, unrelated lines, which is all any rule in
check_doc_citations.py asks of them:

- §4.2 put the `Context.streams` push at `mod.rs:713-714`. Those are
  `listener.get_sticky_name().to_string()` and
  `listener.get_sozu_id_header().to_string()`, arguments of the
  `HttpContext::new(...)` call that opens `Context::create_stream`. The push is
  `self.streams.push(stream)` at `mod.rs:773`.
- §3.1's `Unlinked` bullet read `h1.rs:995-1052`. `995` is a format string in
  `ConnectionH1::end_stream`'s wrong-stream `error!` guard and `1052` is a
  `debug_assert!` argument; the four `StreamState::Unlinked` assignments the
  range is meant to bracket are `h1.rs:1042-1099`. It was exact at fbc83ed
  (`h1.rs:737-772` against assignments at 737, 745, 767 and 772) and successive
  renumberings walked it off them.
- §7.5's arm-site list read `h2.rs:5387`, which is `log_context!(self)` inside
  an `error!` for an out-of-bounds header block fragment. The HEADERS liveness
  refresh is `self.stream_table.touch_activity(stream_id, self.now)` at
  `h2.rs:5421`. The two commits directly below this one each renumbered that
  citation and neither noticed: #1501 moved it from `h2.rs:5376` to
  `h2.rs:5384`, and #1497 from `h2.rs:5384` to `h2.rs:5387`. Both moves were
  faithful and both landed on `log_context!(self)`: a re-anchor preserves the
  pointer, not the claim.

§7.2 described all three per-stream reap caches as `ConnectionH2` fields
holding a `HashMap`. Both halves are wrong and have been since #1415's
stream-slot-bookkeeping extraction: `stream_last_activity_at`,
`stream_fc_stalled_since` and `stream_fc_stalled_progress` are private
`BTreeMap` fields of `H2StreamTable`, built by `BTreeMap::new()` in
`H2StreamTable::new`, and `ConnectionH2` declares no field of any of those
names. #1415 converted them for the determinism reason its own CHANGELOG entry
records and updated §4.1's wire-map bullet, but left §7.2 on the pre-extraction
shape, so the section now inverts the ordering guarantee the code provides.
Cited by symbol rather than line: that module is being edited under #1338.

CHANGELOG.md's #1484 entry said `shared::drain_tls_close_notify`'s two
uncovered lines were uncovered "because nothing calls that function at all". It
has two production callers, the `Position::Server` arms of `ConnectionH1::close`
and `ConnectionH2::close`. What #1484 measured is that its own six-test fixture
never reaches them. Only that causal clause changed; every count and probe tally
in that historical entry was true as measured and is left as written.

The three citations sat in the drift rule's exemption: it keys on the citation
tuple as it stood in the base revision of the citing document, so a renumbered
span is counted exempt and never compared. Measured at 42ed6ba over the window
they were renumbered in, --base f2082b6 --show reported 133 exempt cited ends
across 91 doc sites; 11 are fenced blocks the pinned-quote rule already compares
verbatim, and reading the remaining 80 against the code they name found 77
correct and these three wrong. --base 42ed6ba --show on this tree exempts 109
more, the spans #1501's and #1497's renumberings re-anchored: 15 pinned fences,
the 4 repaired here, and 90 that anchor on byte-identical text before and after
them. --audit
reports 7 findings on this tree, all 7 the heuristic pairing a prose symbol with
a line eight or more away from it. The three §7.2 declarations were in no rule's
surface at all: every rule resolves a `path:NNN` or a fenced quote, and a
sentence naming a type and a container carries neither. Sweeping LIFECYCLE.md
for the same shape leaves only the three `ConnectionH2.streams` references that

Documentation only: no production code, no test, no dependency and no
Cargo.lock entry changes.

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS force-pushed the docs/mux-claim-corrections branch from dbe0059 to f60bb4c Compare September 24, 2026 14:37
@FlorentinDUBOIS
FlorentinDUBOIS merged commit ddc50f7 into main Sep 24, 2026
28 checks passed
@FlorentinDUBOIS
FlorentinDUBOIS deleted the docs/mux-claim-corrections branch September 24, 2026 15:36
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