Skip to content

docs(protocol): retarget name.rs upstream citations at the 3.5.0 pin - #7318

Merged
oferchen merged 2 commits into
masterfrom
fix/name-rs-citation-sweep
Aug 14, 2026
Merged

oferchen merged 2 commits into
masterfrom
fix/name-rs-citation-sweep

Conversation

@oferchen

Copy link
Copy Markdown
Owner

crates/protocol/src/flist/read/name.rs carried twelve flist.c: citations, all still naming 3.4.4 line numbers. The gate is pinned at 3.5.0, so all twelve were stale — but only one was visible.

Why the pin is 3.5.0

xtask/src/commands/citations.rs:61  MANIFEST_PATH     = "tools/ci/upstream-3.5.0-lines.tsv"
xtask/src/commands/citations.rs:64  PINNED_SOURCE_DIR = "target/interop/upstream-src/rsync-3.5.0"
git ls-tree origin/master tools/ci/ | grep tsv  ->  upstream-3.5.0-lines.tsv   (the only one)

⚠ .github/workflows/citations.yml:27 says the gate reads tools/ci/upstream-3.4.4-lines.tsv. That file does not exist — the comment is false and is what made this citation look correct. Worth fixing separately; it is not touched here.

The retarget

The cited region shifts by a constant +83 between releases and the constructs are otherwise byte-identical, so this is a pure retarget with no semantic change.

construct 3.4.4 3.5.0
recv_file_entry() name reading 760-800 843-883
XMIT_LONG_NAME / read_varint30 731-734 814-817
iconv block 757-764 840-847
io_error |= IOERR_GENERAL 758 841
FERROR_UTF8 message 759-762 842-845
pathname safety check 768-772 851-855
!relative_paths absolute reject 769 852

841, not 1316. Both are iconvbufs(ic_recv, ...) < 0 inside recv_file_entry under the same #ifdef ICONV_OPTION, so a line number alone cannot separate them. The rprintf below each does: 841 is FERROR_UTF8 / "cannot convert filename"; 1316 is FERROR_XFER / "cannot convert symlink data for", gated on sender_symlink_iconv. This site calls cannot_convert_filename_message, so it is the filename converter.

One correction beyond the retarget: three sites cited flist.c:768 exit_cleanup(RERR_UNSUPPORTED), but 768 (now 851) is the block-opening if, not the exit_cleanup. They now name 854, the call itself.

Why a sweep and not a one-liner

Only the io_error |= IOERR_GENERA anchor is tracked by the drift gate. The other eleven have no anchor string, so patching just the flagged line would have left eleven known-wrong citations behind and reported success. That invisible class is task 652.

Verification

MEASURED  tools/ci/citation_drift_audit.py
  before   protocol: string-anchored=56 suspected-drift=1 (2%) unresolved=24
  after    protocol: string-anchored=56 suspected-drift=0 (0%) unresolved=24

Each new target was read from the pinned 3.5.0 source rather than inferred from the offset:

814  if (xflags & XMIT_LONG_NAME)
841  io_error |= IOERR_GENERAL;
842  rprintf(FERROR_UTF8,
852  && (clean_fname(thisname, CFN_REFUSE_DOT_DOT_DIRS) < 0 || (!relative_paths && *thisname == '/'))) {
854  exit_cleanup(RERR_UNSUPPORTED);

unresolved=24 is unchanged and out of scope — those are anchors that resolve at no line in 3.5.0, task 652's third class.

Comments only; no code changes, so nothing to test beyond the gate.

The citation gate is pinned at 3.5.0 (`xtask/src/commands/citations.rs`
MANIFEST_PATH / PINNED_SOURCE_DIR), and `tools/ci/upstream-3.4.4-lines.tsv`
does not exist. Every `flist.c:` citation in this file still named a 3.4.4
line, so all twelve were stale; the drift gate could only see one of them.

The whole cited region shifts by a constant +83 between the two releases
(731 -> 814, 757 -> 840, 768 -> 851), and the constructs are otherwise
byte-identical, so this is a pure retarget with no semantic change:

  recv_file_entry() name reading   760-800  ->  843-883
  XMIT_LONG_NAME / read_varint30   731-734  ->  814-817
  iconv block                      757-764  ->  840-847
  io_error |= IOERR_GENERAL            758  ->      841
  FERROR_UTF8 message              759-762  ->  842-845
  pathname safety check            768-772  ->  851-855
  !relative_paths absolute reject       769  ->      852

One correction beyond the retarget: three sites cited
`flist.c:768 exit_cleanup(RERR_UNSUPPORTED)`, but 768 (now 851) is the
block-opening `if`, not the `exit_cleanup`. They now name 854, which is the
call itself.

Only the `io_error |= IOERR_GENERA` anchor was visible to the drift gate; the
other eleven have no tracked anchor and would have survived a one-line patch
to the flagged citation. That invisible class is task 652.

MEASURED: tools/ci/citation_drift_audit.py
  before  protocol: string-anchored=56 suspected-drift=1 (2%)
  after   protocol: string-anchored=56 suspected-drift=0 (0%)
Each new target verified against the pinned 3.5.0 source, not inferred from
the offset: 814 `if (xflags & XMIT_LONG_NAME)`, 841 `io_error |= IOERR_GENERAL;`,
842 `rprintf(FERROR_UTF8,`, 852 the clean_fname/relative_paths test,
854 `exit_cleanup(RERR_UNSUPPORTED);`.

Comments only; no code changes.
@oferchen
oferchen enabled auto-merge (squash) August 14, 2026 04:56
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 14, 2026
oferchen added a commit that referenced this pull request Aug 14, 2026
… 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 merged commit 3f5a093 into master Aug 14, 2026
63 of 66 checks passed
@oferchen
oferchen deleted the fix/name-rs-citation-sweep branch August 14, 2026 08:09
oferchen added a commit that referenced this pull request Aug 14, 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 ce8c63d: `tools/ci/citation_drift_audit.py --ratchet`
reports core=0; `cargo xtask citations` passes (7826 citations);
`cargo fmt --all -- --check` clean.
oferchen added a commit that referenced this pull request Aug 24, 2026
…7318)

The citation gate is pinned at 3.5.0 (`xtask/src/commands/citations.rs`
MANIFEST_PATH / PINNED_SOURCE_DIR), and `tools/ci/upstream-3.4.4-lines.tsv`
does not exist. Every `flist.c:` citation in this file still named a 3.4.4
line, so all twelve were stale; the drift gate could only see one of them.

The whole cited region shifts by a constant +83 between the two releases
(731 -> 814, 757 -> 840, 768 -> 851), and the constructs are otherwise
byte-identical, so this is a pure retarget with no semantic change:

  recv_file_entry() name reading   760-800  ->  843-883
  XMIT_LONG_NAME / read_varint30   731-734  ->  814-817
  iconv block                      757-764  ->  840-847
  io_error |= IOERR_GENERAL            758  ->      841
  FERROR_UTF8 message              759-762  ->  842-845
  pathname safety check            768-772  ->  851-855
  !relative_paths absolute reject       769  ->      852

One correction beyond the retarget: three sites cited
`flist.c:768 exit_cleanup(RERR_UNSUPPORTED)`, but 768 (now 851) is the
block-opening `if`, not the `exit_cleanup`. They now name 854, which is the
call itself.

Only the `io_error |= IOERR_GENERA` anchor was visible to the drift gate; the
other eleven have no tracked anchor and would have survived a one-line patch
to the flagged citation. That invisible class is task 652.

MEASURED: tools/ci/citation_drift_audit.py
  before  protocol: string-anchored=56 suspected-drift=1 (2%)
  after   protocol: string-anchored=56 suspected-drift=0 (0%)
Each new target verified against the pinned 3.5.0 source, not inferred from
the offset: 814 `if (xflags & XMIT_LONG_NAME)`, 841 `io_error |= IOERR_GENERAL;`,
842 `rprintf(FERROR_UTF8,`, 852 the clean_fname/relative_paths test,
854 `exit_cleanup(RERR_UNSUPPORTED);`.

Comments only; no code changes.
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

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant