Repository navigation
Commit 225f3d6
Compare a local corpus against a base you name, not the shared snapshot (#888)
* Compare a local corpus against a base you name, not the shared snapshot
snapshot.py --local SOURCE and local_agreement.py psc-individuals each
compared against one file per corpus in the cache (snapshot.jsonl,
agreement.jsonl), shared by every worktree and decided by whoever
recorded last. On 2026-10-25 parallel sessions of #752's phase 2 read
a sibling's re-record as their own moves; the silent case is a
sibling's record from a branch holding the same change, which reads as
no moves.
--base PATH reads the base checkout's readings from a record kept by
the digest of its nameparser/ files (snapshot.py's baselines/, and a
new agreements/ folder for the score), recording one in a child
process where none is kept, and never reads or writes the shared file.
It prints the base's path, digest prefix and whether it was reused or
recorded, and the head's digest, saying so when the two packages are
byte-identical. It refuses a base that is the tree being read or holds
no nameparser package; the child strips PYTHONPATH and refuses a
package imported from anywhere but the base. --sample composes with
it. Without --base both tools behave as before.
BASELINES_KEPT goes from 4 to 10: four sessions with a base and a head
each, plus one, at FEC's 41.7 MB a baseline about 420 MB for the
largest corpus.
The tests plant a change in a copied BASE tree, so a base read from
the head's tree by mistake would show no move, and check a plain copy
moves nothing, the shared files are left byte- and mtime-identical,
a kept base is reused, and the refusals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Publish a kept base record only once it is whole and its base unchanged
Review of the --base commit. The agreement child wrote straight to the
kept path through corpus_build.write_atomic's one `.part` name, so two
sessions scoring the same base at once could rename each other's half
written file into place, and a record cut on a line boundary passed
read_record and was reused by every later session. It also published
under the digest the parent took before the child started.
The child now scores into a scratch folder of the run's own
(snapshot.scratch, also used for the snapshot side's base), and the
parent renames the record into place only after reading it back and
taking the base's digest again. The record's header counts its entries
and read_record refuses a record holding another number (a record
written before the count passes). _prune sweeps a scratch folder a
killed run left, once stale, and _reused reads a baseline another run
pruned meanwhile as none kept rather than damaged. The PYTHONPATH test
becomes the unit check it was: --tree's sys.path entry already outranks
a decoy in the child, so no end-to-end run can show the strip.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Pin what the second review found the fix tests did not
Second review of d1ee456. Two of its tests passed against the pre-fix
code: the changed-base test now asserts the kept path is empty when
the after-check runs (it held the record before the fix), and the
pruned-baseline test removes the file between the lookup and the open,
where the old unlink raised. A header whose entry count is not the
record's own, `null` included, is refused rather than raising while
its message is formatted. Each of the four rows was run against
47bd62a and fails there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Record in AGENTS.md how a kept reading is published
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent f2e31d4 commit 225f3d6
7 files changed
Lines changed: 620 additions & 39 deletions
File tree
- tests/v2
- tools/differential
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | | - | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | | - | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
0 commit comments