Repository navigation
feat(tri census explain): name the file behind a moved census number - #5826
Merged
Merged
Conversation
`tri census pin --gate` prints the first differing line and stops: it says a census moved, not what moved it. On #5787 the first line was `files read 22 -> 23` and the cause sat further down, and the PR read "open" for six ticks while cli-tri was red on it. `tri census explain` lists every moved line (rows matched by their words, numbers folded), then puts each file changed since the ledger's commit back to that commit ALONE in a scratch copy of the tree and runs the census again. The copy must reproduce today's reading byte for byte or nothing is attributed; all tried files put back together must reproduce the ledger or it says NO. Read-only; the copy is dropped before `process::exit`. On this branch before the bless it named .github/workflows/cli-tri.yml as the only one of 1057 changed files that moves `shell` (101 s for all). Census moved, blessed here: shell `run: steps` 283 -> 284 and `the runner does` 262 -> 263 -- the one new cli-tri step that runs scripts/ci/test_a_moved_census_names_its_file.py (4 mutations seen red). Closes #5825 Refs #5786 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This was referenced Oct 3, 2026
This was referenced Oct 3, 2026
This was referenced Oct 4, 2026
Merged
Merged
This was referenced Oct 4, 2026
Merged
gHashTag
added a commit
that referenced
this pull request
Oct 4, 2026
… it) #5849 (tri harness --save-state / --storage-state) was merged into this branch as 18a7212; this merge brings master in so #5828 can land both. tools/census/shell.txt conflicted (master moved to 284 steps with #5826) and was re-blessed with `tri census pin --bless`: jobs 85 -> 86, run: steps 284 -> 285, the +1/+1 this PR pinned. `tri census pin --gate` PASS; scripts/ci/test_a_page_is_measured_at_both_widths.py 64 passed. Refs #5827 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tri census explain [--max N]is read-only. For each pinned census whose output differs from its ledger, it does four things:run: steps 283->284.pin --gateshows only the first moved line.tools/census/<name>.txt. The candidates are the files changed since then:git diffagainst it, plus untracked files, minustools/census/.Exit codes: 0 when nothing moved, 1 when something moved. The copy is dropped before
process::exit. The first build skipped that and would have left a copy of the tree behind on every run that had something to report.Why
On #5787 the gate's first line was
files read 22 -> 23, and the cause sat further down. The PR read "open" for six cron ticks whilecli-triwas red on it. On master today, the shell ledger's bless commit is 1057 changed files away from the tree.Real output: this branch before its own bless (
stderrincluded)That run used
--max 5000and took 101 s for 1057 files. The default--max 600takes about a minute. After the bless, all three censuses readunchangedand the exit code is 0.Test:
scripts/ci/test_a_moved_census_names_its_file.py, a new step incli-triThe binary under test blesses scratch repositories. 36 checks:
a.ymlgains a step andb.ymlis new; those two moveshell2->4.decoy.txtandnotes.mdalso change. The test checks that:a.ymlandb.yml;quietis moved byb.ymlalone;fetchesis unchanged;--max 1. One file is tried, 3 are reported as NOT tried, and together says NO.Four mutations of
census.rs, each seen red:cargo test -p tri censuspasses 29 tests, 4 of them new for row matching.rustfmt --checkis clean, andtri gates tests --gatepasses.Census
shell
run: steps283 -> 284 andthe runner does262 -> 263. Both moves come from the one new step and are blessed in this commit.Merge order: #5787 and #5824 also bless
tools/census/shell.txt(283 -> 285 -> 286). Whichever of these merges second needs a re-bless.tri census explainnames the file behind it.Not established
--maxare counted, not tried.gates shellreads 0 steps for a step written- run: x. No workflow uses that shape today, but a new one would not move the census, soexplainwould have nothing to explain.Closes #5825
Refs #5786
🤖 Generated with Claude Code