Skip to content

the redlog provenance guard fails a CI shard whenever it runs before any test creates .measurements/, and never reads the evidence branch when it runs after #771

Done

Description

@XBeg9

test_every_law_stamped_redlog_entry_cites_a_live_capture picks which sinks to read by checking whether a .measurements/ directory exists (test_fv_redlog_guard.py:113-120). If it does, the guard reads the local sinks and anchors at the checkout's head. If it doesn't, it stages .measurements from origin/evidence/taskqflow (_evidence.py:117-139) and anchors at that branch's tip (_evidence.py:19-39). .measurements/* is gitignored (.gitignore:76), so a fresh CI checkout has no such directory. It only appears as a side effect of some other test in the same job. RedLog.flush creates it (_wf_fixtures.py:505-506), and so do three tests in the guard's own module: they build .measurements/forge-caps with parents=True (test_fv_redlog_guard.py:469) and afterwards remove only forge-caps (536-548, 558-570, 598-611), which leaves an empty .measurements/ behind. The suite runs under pytest-randomly, so the seed decides whether any of those runs before the guard, and with it which path the guard takes.

Neither path works in CI. The local path never reads the evidence branch, so on a fresh checkout it sees only what the same job wrote before the guard ran. If a forge-caps test made the directory, that is nothing: live and history counts both stay at zero, and the scoping assert lets it pass (test_fv_redlog_guard.py:279-284). If RedLog.flush made it, the guard checks only the receipts that job just wrote. The fallback path fails every time. evidence/taskqflow is at 0256af0d7, and its last change to src or tests was efd97b433, the 11-09 re-stamp at 4441dd6, the merge head of PR 727. With the off-by-one exclusions, git diff --name-only 4441dd642..0256af0d7 prints nothing, so source_changes_since (_wf_fixtures.py:158-177) reports no source change and every record stamped at 4441dd6 counts as live. That is 169 records with 175 entries across all six sinks, from runs 20261109T14.... All of them have captures_root: /tmp/taskq-redlog-captures-1000, the default temp root (_wf_fixtures.py:236-239), and the captures never reached the branch. Its redlog-captures holds only runs from 20261008 to 20261013, and 0256af0 force-added the 11-23 re-stamp's captures but none from 11-09. So the receipt check returns "does not EXIST" for all 175 (test_fv_redlog_guard.py:177-189). The later re-stamps at 7f2bd32ca and ffcb61fb3 count as history, because their trees differ from the branch tip's by 6 and 231 files. 4441dd6 is also not an ancestor of 0256af0. The docstring says a claimed head that is not an ancestor is stale by definition (_wf_fixtures.py:131-132), but the two-dot tree diff never looks at ancestry.

Reproduced on main at ffcb61f, with origin/evidence/taskqflow at 0256af0. Nothing under src, the guard, its helpers or ci.yaml changed between that and the current main, 9b9fa72. With no .measurements/ the guard fails with 175 "does not EXIST" lines (pin-reds 82, t06 40, t10 23, t21 18, t19 8, ledger 4). The first one, as job 138621418948 printed it:

pin-reds.json: pin='pin12-canonical-hash': the cited capture redlog-captures/20261109T141411-2400817-b822f33b/pin12-canonical-hash.json does not EXIST (searched: /tmp/taskq-redlog-captures-1000; /tmp/evidence-estate-nv45tomd/.measurements; /tmp/taskq-redlog-captures-1001) — the receipt chain's link (c) is broken (a red that never ran, or a capture deleted since)

With an empty .measurements/ it passes in 0.35s with zero records read. Running the guard's module alone and serially from a fresh tree, seeds 2067497276 and 1611546166 (both from failing CI jobs) give "1 failed, 17 passed", and seeds 3145494842 and 2791959516 (from passing jobs) give "18 passed". Under 2067497276 the guard is the first test in its module. Under 3145494842 two of the forge-caps tests run 2nd and 3rd and the guard runs 14th.

In CI it failed on PR 752 (3.14 2/4, job 138550638807, seed 2067497276), PR 750 (3.13 2/4, job 138601756940, seed 990341510) and PR 755 (3.14 3/4, job 138621418948, seed 1611546166). Each printed the same 175 entries, and each shard passed on rerun. It also failed twice on the PR 741 branch, in the 3.12 4/4 and 2/4 shards (seeds 707257071 and 3696072710). Before PR 741 every leg ran the full suite, integration tier included, where more tests can create .measurements/ first, and no failure of this test shows up in those runs after the 11-09 push. PR 741 also gives it more chances to fail than intended. The smoke branch of the run step passes "${files[@]}", but only the full branch fills files (ci.yaml:254-261). So each of the eight 3.12/3.14 smoke shards runs the whole non-integration tier (job 138621418948 reports 1 failed, 10128 passed, 11 skipped), and each one is a separate seed draw.

So unrelated PRs go red at random and need a rerun, and in CI the guard never gives a usable verdict on the estate: the fallback fails on the same 175 dead entries every time, and the local path never reads them. A fix to the ordering alone would leave it always red (fallback) or blind to the estate (local).

Probably wants: the path choice based on something test order can't change, the forge-caps tests cleaning up the .measurements/ they create, and a fallback that can pass, either by carrying the 20261109 captures onto evidence/taskqflow if they still exist or by a fresh re-stamp whose captures are force-added the way 0256af0 did for the 11-23 one. Separately, the smoke step should pass its shard's file list.

Activity

  1. added
    bug
    testing
    medium
    on Nov 24, 2026
  2. XBeg9 commented on Nov 24, 2026

    @XBeg9
    ContributorAuthor

    The red verdict comes from efd97b433 on the evidence branch, the 11-09 re-stamp at PR 727's merge head 4441dd642. With evidence/taskqflow held at its parent 423262d29, or at 6aceda1c2 where it stood when PR 707 merged, the fallback reads 540 live records with 552 entries and every receipt resolves, so the guard passes on both the PR 707 merge commit and current main. From efd97b4 on, it fails on both with the same 175 entries. That commit moved the branch's src and tests to 4441dd6, so the 540 older records became history and the 169 new ones became the only live claims. None of their captures was committed. They stayed in /tmp/taskq-redlog-captures-1000 because PR 713 made the system temp dir the default capture root unless TASKQ_REDLG_CAPTURES_DIR is set (_wf_fixtures.py:241-244), and the 11-09 re-stamp ran without it.

    The 11-14 and 11-23 re-stamps did the same. Each appended another 169 records with captures_root: /tmp/taskq-redlog-captures-1000, and redlog-captures on the branch still holds only runs from 20261008 to 20261013. 0256af0d7 force-added the 11-23 files under .measurements/runs/, not the redlog captures. Those later records count as history only because the branch's src and tests are still at 4441dd6, so a re-stamp that moves them forward without the env pin just trades one set of 169 dead records for another.

    The order dependence is older. Blame on the MEASUREMENTS.is_dir() switch lands on d31f0b258 in PR 707 (test_fv_redlog_guard.py:95-102), which took .measurements/ out of the product repo. Its parent still tracked 33,265 files there, so every checkout read local sinks. The switch did no harm while both paths were green.

    I found no CI failure of this guard between PR 707's merge and the PR 741 branch, whose 3.12 shards 2/4 and 4/4 were the first to print the 175 entries once it narrowed those legs to the non-integration tier. Besides PRs 750, 752 and 755, it has also failed on PR 737 (coverage-shard 1/4, job 138149356652) and PR 753 (coverage-shard 4/4, job 138729386354), which aren't in the list above. Issue 763 is the other evidence-estate failure on the same PRs, and its verifier's off-by-one check requires the claimed head to be an ancestor, which source_changes_since here never checks.

  3. added
    regression
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmediumregressiontesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions