Skip to content

fix(citations): retarget the core crate's upstream citations at rsync 3.5.0 - #7321

Merged
oferchen merged 2 commits into
masterfrom
fix/citation-pin-cohort
Aug 14, 2026
Merged

oferchen merged 2 commits into
masterfrom
fix/citation-pin-cohort

Conversation

@oferchen

@oferchen oferchen commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Clears the core ratchet, which five open PRs currently inherit (#7301, #7304, #7313, #7314, #7315, #7316). Comment-only — no behaviour change.

before   FAIL: core suspected-drift rose 3 -> 4
after    core: suspected-drift=0

Why these went stale

#7305 moved the pinned upstream source from 3.4.4 to 3.5.0. Ten PRs authored before that flip merged after it (git log 21c46555b..master), landing 3.4.4 line numbers in a tree the gate resolves against 3.5.0. A pin move is not a one-changeset event — it silently invalidates every branch already in flight.

What changed

Every target verified against both tarballs. Only the first is a mechanical retarget.

# site cited → how it was located
1 flags.rs generator.c:298 :304 anchor unique; context byte-identical
2 daemon_transfer/connection/mod.rs clientserver.c:382 :425 by the @ERROR handler
3 flags.rs options.c:2852-2857 :3018-3023 by args[ac++] = "--super"
4 invocation/tests.rs (×2) options.c:2850-2851 :3016-3017 by args[ac++] = "--only-write-batch=X"
5 invocation/tests.rs main.c:1839, sender.c:217 :1919, :501 by construct — not reported by the ratchet

⚠ Do not treat the audit's candidate column as a fix list

Rows 2-4 have non-unique anchors — rprintf(FERROR, " and if (am_sender) each resolve to three places in 3.5.0, and io_error |= IOERR_GENERAL occurs 19 times in flist.c. So the audit reports candidates, not answers.

It is worse than merely non-committal. For row 2 the audit offered:

clientserver.c:382 'rprintf(FERROR, "'  ->  3.5.0@[205, 211, 220]

The correct line is 425 — not in that list at all. Every candidate sits in the greeting/protocol-error block; the actual site is the @ERROR handler further down. Anyone retargeting to the first suggestion would have shipped a citation that resolves cleanly, passes the hard gate, and points at unrelated code — strictly worse than leaving it stale, because the next reader has no reason to doubt it.

Each site here was instead located by its enclosing construct and confirmed by byte-identical surrounding context.

Rows 3-4 were already correct 3.4.4 ranges; the audit flagged them only because it anchors on the range's prose (if (am_sender)), which is not on the cited line. Those comments are now re-anchored on strings that are unique in options.c, so the audit can resolve them rather than guess — this is the recurrence fix, not just the retarget.

Row 5 is the one the gate could never have caught

main.c:1839 and sender.c:217 sit mid-sentence in a doc comment, on lines that do not contain the word upstream — the only lines the drift audit inspects. Both were stale. sender.c moved by +284 where options.c moved by +166, so a bulk offset would have been wrong; each was located by its construct (if (write_batch < 0) dry_run = 1 and f_xfer = write_batch < 0 ? batch_fd : f_out).

Baseline

core drops 4 → 0, so its baseline goes 3 → 0 in this commit. The baseline file requires lowering when citations are fixed: leaving it at 3 keeps accepting drift that no longer exists and hides the next regression under that headroom.

Out of scope, deliberately

Verification

Measured on ce8c63dd1:

  • python3 tools/ci/citation_drift_audit.py --ratchet — core: suspected-drift=0
  • cargo xtask citations — 7826 citations, all resolve
  • cargo fmt --all -- --check — clean

No cargo build needed, so master's drop_devices breakage (#7319) does not gate this.

… 3.5.0

#7305 moved the pinned upstream source from 3.4.4 to 3.5.0. Ten PRs
authored before that flip merged after it, so their citations name 3.4.4
line numbers in a tree the gate resolves against 3.5.0. This clears the
`core` ratchet, which five open PRs currently inherit:

    FAIL: core suspected-drift rose 3 -> 4     (before)
    core: suspected-drift=0                    (after)

Every target was verified against BOTH tarballs. Only the first is a
mechanical retarget; the rest needed the enclosing construct because the
anchor the audit extracts is not unique in its file.

1. flags.rs  generator.c:298 -> :304
   `io_error & IOERR_GENERAL` is unique; surrounding context is
   byte-identical.

2. daemon_transfer/connection/mod.rs  clientserver.c:382 -> :425
   `rprintf(FERROR, "` occurs many times. The site is the `@ERROR`
   handler, located by `strncmp(line, "@error", 6)` (3.4.4:381 ->
   3.5.0:424) and confirmed by byte-identical context.

3. flags.rs  options.c:2852-2857 -> :3018-3023
4. invocation/tests.rs  options.c:2850-2851 -> :3016-3017  (two sites)
   Both were already correct 3.4.4 RANGES; the audit flagged them only
   because it anchors on the range's prose (`if (am_sender)`), which
   occurs three times in options.c and is not on the cited line. The
   blocks are byte-identical at a constant +166. The comments are
   re-anchored on `args[ac++] = "--super"` and
   `args[ac++] = "--only-write-batch=X"`, each unique in options.c, so
   the audit can resolve them instead of guessing.

5. invocation/tests.rs  main.c:1839 -> :1919, sender.c:217 -> :501
   ⚠ Neither was reported by the ratchet - it only inspects lines
   containing the word `upstream`, and these sit mid-sentence in a doc
   comment. Both were stale. `sender.c` moved by +284 where options.c
   moved by +166, so an offset applied in bulk would have been wrong;
   each was located by its construct (`if (write_batch < 0) dry_run = 1`
   and `f_xfer = write_batch < 0 ? batch_fd : f_out`).

`core` drops 4 -> 0, so its baseline goes 3 -> 0 in the same commit, as
the baseline file requires - leaving it at 3 would keep accepting drift
that no longer exists and hide the next regression under that headroom.

Deliberately out of scope:
- `protocol` (`flist.c:758`) - the identical fix is already in #7318.
- `daemon` (`clientserver.c:1559`) - same cohort, fixed on #7314.

Measured on ce8c63d: `tools/ci/citation_drift_audit.py --ratchet`
reports core=0; `cargo xtask citations` passes (7826 citations);
`cargo fmt --all -- --check` clean.
@oferchen
oferchen force-pushed the fix/citation-pin-cohort branch from ff82327 to f473d80 Compare August 14, 2026 05:17
@oferchen oferchen changed the title fix(citations): retarget three pin-stale citations at rsync 3.5.0 fix(citations): retarget the core crate's upstream citations at rsync 3.5.0 Aug 14, 2026
@oferchen
oferchen enabled auto-merge (squash) August 14, 2026 06:00
@github-actions github-actions Bot added the bug Something isn't working label Aug 14, 2026
@oferchen
oferchen merged commit f52dc15 into master Aug 14, 2026
65 of 67 checks passed
@oferchen
oferchen deleted the fix/citation-pin-cohort branch August 14, 2026 09:16
oferchen added a commit that referenced this pull request Aug 24, 2026
… 3.5.0 (#7321)

#7305 moved the pinned upstream source from 3.4.4 to 3.5.0. Ten PRs
authored before that flip merged after it, so their citations name 3.4.4
line numbers in a tree the gate resolves against 3.5.0. This clears the
`core` ratchet, which five open PRs currently inherit:

    FAIL: core suspected-drift rose 3 -> 4     (before)
    core: suspected-drift=0                    (after)

Every target was verified against BOTH tarballs. Only the first is a
mechanical retarget; the rest needed the enclosing construct because the
anchor the audit extracts is not unique in its file.

1. flags.rs  generator.c:298 -> :304
   `io_error & IOERR_GENERAL` is unique; surrounding context is
   byte-identical.

2. daemon_transfer/connection/mod.rs  clientserver.c:382 -> :425
   `rprintf(FERROR, "` occurs many times. The site is the `@ERROR`
   handler, located by `strncmp(line, "@error", 6)` (3.4.4:381 ->
   3.5.0:424) and confirmed by byte-identical context.

3. flags.rs  options.c:2852-2857 -> :3018-3023
4. invocation/tests.rs  options.c:2850-2851 -> :3016-3017  (two sites)
   Both were already correct 3.4.4 RANGES; the audit flagged them only
   because it anchors on the range's prose (`if (am_sender)`), which
   occurs three times in options.c and is not on the cited line. The
   blocks are byte-identical at a constant +166. The comments are
   re-anchored on `args[ac++] = "--super"` and
   `args[ac++] = "--only-write-batch=X"`, each unique in options.c, so
   the audit can resolve them instead of guessing.

5. invocation/tests.rs  main.c:1839 -> :1919, sender.c:217 -> :501
   ⚠ Neither was reported by the ratchet - it only inspects lines
   containing the word `upstream`, and these sit mid-sentence in a doc
   comment. Both were stale. `sender.c` moved by +284 where options.c
   moved by +166, so an offset applied in bulk would have been wrong;
   each was located by its construct (`if (write_batch < 0) dry_run = 1`
   and `f_xfer = write_batch < 0 ? batch_fd : f_out`).

`core` drops 4 -> 0, so its baseline goes 3 -> 0 in the same commit, as
the baseline file requires - leaving it at 3 would keep accepting drift
that no longer exists and hide the next regression under that headroom.

Deliberately out of scope:
- `protocol` (`flist.c:758`) - the identical fix is already in #7318.
- `daemon` (`clientserver.c:1559`) - same cohort, fixed on #7314.

Measured on 30b95b7: `tools/ci/citation_drift_audit.py --ratchet`
reports core=0; `cargo xtask citations` passes (7826 citations);
`cargo fmt --all -- --check` clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant