Skip to content

ci: range-check release-prefixed upstream citations instead of skipping them - #7607

Merged
oferchen merged 2 commits into
masterfrom
ci/citation-gate-release-prefix
Sep 2, 2026
Merged

oferchen merged 2 commits into
masterfrom
ci/citation-gate-release-prefix

Conversation

@oferchen

@oferchen oferchen commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Rebased onto 92e50ab. Scope shrank from 31 files to 9: #7601, #7603 and #7605
landed the citation retargets this PR originally carried, so that half is
dropped as superseded. What remains is the half nothing else covers - the gate
that makes those retargets checkable - plus one sweep they left behind.

The hole

resolve_upstream_path returns ForeignUpstream for any cited path carrying a
/ that is not a manifest key, on the rule that a directory rsync does not ship
names a different project. A citation written as
target/interop/upstream-src/rsync-3.5.0/delete.c:191 matches that rule, so the
gate skips it - and the skip continues above tally.names_checked, so it
leaves no trace in a report whose stated job is telling "clean" apart from
"examined nothing".

Measured on master at 92e50ab:

master this PR
names checked 8718 8831
ranges checked 8718 8831
skipped as foreign 379, invisible 10, reported
permitted at a non-pinned release n/a 256, reported

113 of those 379 skips name the PINNED release - 34 spelling the full unpack
prefix, 79 spelling the bare rsync-3.5.0/ directory - so their line numbers
have never been checked by anything.

That set includes the citations #7601, #7603 and #7605 have just rewritten. The
retarget sweep landed its new line numbers into the one shape the gate does not
read, so the sweep is currently unverified. This PR is what verifies it: with
the gate widened, all 113 pass, but nothing proved that until now.

The change

  • A leading [target/interop/upstream-src/]rsync-<VER>/ is split off before
    resolution, so a prefixed citation of the pinned release is range-checked
    exactly as the bare form is. Both spellings work; a rsync- directory that is
    not a version number is not stripped.
  • A citation naming any other release becomes Violation::UnpinnedRelease, a
    hard failure - it names rsync at a version this tree no longer builds against,
    which is a stale citation, not an out-of-scope one.
  • Under a pinned prefix, a tail that resolves nowhere is Missing, not
    ForeignUpstream.
  • The skip is counted before the continue, and execute prints the skipped
    and permitted totals.

After: 8831/8831 checked, 10 skipped - all zsync's genuinely foreign
librcksum/.

Exemptions

CONTRIBUTING.md and xtask/src/commands/citations.rs document this gate and
must be able to spell a rejected citation to show what it rejects. docs/ mixes
live reference with historical record, and a note describing upstream at 3.4.1
is accurate because it names the old release - 253 citations across 70
files
, stated in-code rather than discovered later. The exemption covers only
the new arm; a phantom file or an out-of-range line still fails everywhere.

Non-vacuity proof

A gate that only ever passes was never tested, so both new arms were driven end
to end against a probe file added to the tree:

upstream: target/interop/upstream-src/rsync-3.4.1/flist.c:999999
upstream: target/interop/upstream-src/rsync-3.5.0/flist.c:999999
upstream: rsync-3.5.0/flist.c:999999

Line 999999 exists in no rsync release.

Master's gate: exit 0, reporting 8718 name(s) and 8718 line range(s) checked - byte for byte the tally without the probe. Invisible, not merely
tolerated.

This gate: exit 1:

xtask/citation_gate_probe.txt:2: cites rsync-3.4.1/flist.c:999999, but the pin is rsync 3.5.0; ...
xtask/citation_gate_probe.txt:3: cites flist.c:999999 but flist.c has 3760 lines
xtask/citation_gate_probe.txt:4: cites flist.c:999999 but flist.c has 3760 lines

Those three are the only violations in the tree. Probe removed before commit.

The sweep #7601 left behind

checksum.c:285 claims the schar *buf cast. At the pin that cast is line
307; line 285 is now case CSUM_SHA256: inside a digest switch. #7601
corrected three instances of this string and left nine - all in range,
all green under both gates, all making the identical claim. Swept here.

This is the failure mode the gate's own module docs name: a finder only
surfaces what its heuristic matched, so working a finding list is not a sweep.

The remaining nine are why the module docs tell you to grep the defect string
before closing.

Gates

  • cargo fmt --all -- --check - clean
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings - clean
  • cargo nextest run -p xtask - 438/439; 24/24 citation tests pass. The one
    failure, validate::support::tests::backdated_tree_populates_and_backdates_the_root,
    is pre-existing and macOS-only (it shells out to touch -d @1614830767, which
    BSD touch rejects) and is in a file this change does not touch.
  • cargo xtask citations - green, 8831/8831
  • python3 tools/ci/citation_drift_audit.py - per-crate counts identical to
    master in all 21 crates
    ; --ratchet passes. No baseline change.

CI is red on a pre-existing master failure, not on this change

nextest (stable), nextest (nightly) and both Feature flag combinations
jobs fail on one test, the same one in every job:

tests/daemon_session_error_keeps_listener.rs:169
session_error_does_not_stop_the_accept_loop
first client must be dropped mid-session, not answered;
got ["@ERROR: Unknown module '@RSYNCD: 32.0 md5 md4'"]

Measured, not assumed: pristine current master (603d101de) content checked
out into a clean worktree - none of this PR present - fails identically,
same assertion, same message. Independently, every changed line under crates/
in this PR is a comment (diffing out //, ///, //! leaves an empty set),
and xtask is not linked into that test binary.

The failing assertion is that test's own non-vacuity guard, not the property
it exists to prove: the three property assertions above it pass. The daemon
answers the provoker instead of dropping it, having parsed the client's greeting
line as a module name.

nextest (stable) cancelled at 1329/33460 tests on that failure, so it never
reached most of the suite. The checks that actually exercise this change both
pass:

  • Upstream citations resolve - pass (this is cargo xtask citations, the gate)
  • Upstream citations track 3.5.0 - pass (the drift ratchet)

plus fmt + clippy, macOS (stable), Windows (stable), interop and
upstream-testsuite. This PR should go green once master is repaired; the
breakage is tracked with the daemon owner.

@github-actions github-actions Bot added the ci label Sep 1, 2026
…ng them

`resolve_upstream_path` returns `ForeignUpstream` for any cited path carrying a
`/` that is not a manifest key, on the rule that a directory rsync does not ship
names a different project. A citation written as
`target/interop/upstream-src/rsync-3.5.0/delete.c:191` matches that rule, so the
gate skips it - and the skip `continue`s above `tally.names_checked`, so it
leaves no trace in a report whose stated job is telling "clean" apart from
"examined nothing".

Measured on master at 92e50ab: 8718 names and 8718 ranges checked, and 379
citations skipped. 113 of those 379 name the PINNED release - 34 spelling the
full unpack prefix, 79 spelling the bare `rsync-3.5.0/` directory - so their
line numbers have never been checked by anything. That set includes the
citations #7601, #7603 and #7605 have just rewritten: the retarget sweep landed
its new line numbers into the one shape the gate does not read.

Three changes:

- A leading `[target/interop/upstream-src/]rsync-<VER>/` is split off before
  resolution, so a prefixed citation of the pinned release resolves to a
  manifest key and is range-checked exactly as the bare form is. A `rsync-`
  directory that is not a version number is not stripped.
- A citation naming any other release becomes `Violation::UnpinnedRelease`, a
  hard failure. It names rsync at a version this tree no longer builds against,
  which is a stale citation, not an out-of-scope one.
- Under a pinned prefix, a tail that resolves nowhere is `Missing` rather than
  `ForeignUpstream`: the prefix asserts the release outright, so it cannot be
  another project.
- The skip is counted before the `continue`, and `execute` prints the skipped
  and permitted totals, so a population that grows again grows in the open.

After: 8831 names and 8831 ranges checked, 10 skipped - all of them zsync's
genuinely foreign `librcksum/`.

Two exemptions from the unpinned-release arm, both scoped, neither covering the
phantom-file or out-of-range arms. `CONTRIBUTING.md` and
`xtask/src/commands/citations.rs` document this gate and have to be able to
spell a rejected citation to show what it rejects. `docs/` mixes live reference
with historical record, and a note describing upstream at 3.4.1 is accurate
because it names the old release; 253 citations across 70 files there name a
non-pinned release, and sorting record from reference needs a reader per file.

Non-vacuity, both arms, end to end. A probe file citing
`rsync-3.4.1/flist.c:999999`, `rsync-3.5.0/flist.c:999999` and the bare
`rsync-3.5.0/` spelling of the same - a line no rsync release has - was added to
the tree. Against master's gate: exit 0, tally `8718 name(s) and 8718 line
range(s)`, byte for byte the tally without the probe, so the probe was invisible
rather than tolerated. Against this gate: exit 1, the 3.4.1 line reported as
unpinned and both 3.5.0 spellings reported as out of range, and those three are
the only violations in the tree. The probe was removed before commit.

Also sweeps nine citations of `checksum.c:285`, which claims the `schar *buf`
cast. At the pin that cast is line 307; 285 is now `case CSUM_SHA256:` inside a
digest switch. #7601 corrected three instances of this string and left nine,
which is the failure mode the gate's own docs name: a finder only surfaces what
its heuristic matched, so working a finding list is not a sweep. All nine are in
range and were green under both gates.
@oferchen
oferchen merged commit 8946ced into master Sep 2, 2026
72 checks passed
@oferchen
oferchen deleted the ci/citation-gate-release-prefix branch September 2, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant