Repository navigation
Conversation
The serial shards are packed by bin-packing over a hand-maintained table of per-script duration hints. The coverage guard bounds how much of the lane runs on the default weight, but it never checks whether a hint that exists is still true, so the table can go stale silently until a shard reaches its 20-minute job cap and is cancelled. That has now happened twice, and the 2026-09-01 remedy of refreshing the hints and adding a shard held for under a day. Three changes, together: - Refresh the hint table from the slowest measured duration per script across four green CI runs on 2026-09-07 and 2026-09-08. The measurements cover the whole 152-script lane, so nothing runs on the default weight any more. - Split the lane across six shards instead of five, in both the runner and the ci.yml matrix. Measured, the worst shard drops from 19.15 min to about 13.4 min, 67% of the cap. - Add bin/fm-test-run.sh --check-shard-balance, run by the tests-timing-aggregate job over the timing artifacts every serial lane already uploads. It fails when a shard's measured duration exceeds its hinted weight, naming the scripts to re-measure, and separately when a shard's measured duration exceeds a share of the job cap, which no hint refresh can fix. The two signals carry different remedies, and only the second survives a lane that has genuinely outgrown its shard count. Against the stale table the new check fires on both signals for the shards that were being cancelled, and it would have fired about sixteen hours before the first cancellation after the previous rebalance while passing on that rebalance's own run.
The guard carried four tolerances for inputs that neither the CI step nor the documented refresh command can produce: a missing-file skip, an empty-artifact skip, a zero-shards success return, and filtering of script entries with no path. The shell dispatch already refuses a path that is not a file, the CI step already warns and exits when its glob matches nothing, and numbered-lane selection already rejects an empty shard. Each was a promise with no reachable code path behind it, which is the defect this change exists to eliminate. Remove them outright rather than hardening them: a malformed artifact now fails loudly instead of being tolerated. Partition parsing and the partial-coverage report stay, because a cancelled shard genuinely uploads no artifact and the guard must still say how much of the lane it could read.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "Revert "fix(ci): Fixed tests/fm-backend...." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: Triage against tip main Contract-class: restore. Rebalances portable serial shard hints from measured durations and guards timeout headroom so the existing CI completeness contract stops cancelling overloaded serial lanes. Product defaults unchanged. VISION.md (each rule)
Blocker: Behavior portable serial 1 FAIL (run Outcome: waiting-author (CI red). No auto-merge. Captain-flag: no. Security FYI: touches |
…_HOME/state fixture. Missing fixture state caused shared Treehouse lock resolution to fail. Reproduced before the fix; the backend suite now passes in 37 seconds. Targeted ShellCheck and git diff --check also pass
…lated FM_HOME/state fixture" This reverts commit d65ceb7. The pipeline's CI step committed and pushed that repair on its own. It is reverted deliberately, for three reasons. It buries a finding. tests/fm-backend.test.sh passes when run alone and fails in a real CI lane, which says something about running conditions rather than about the assertion. That was established by measurement, and the defect is routed for its own investigation, which needs the failure to still exist. It is outside this delivery. This branch rebalances the portable serial shards and touches no other test; an unexplained repair to an unrelated test inside it would leave a reviewer wondering what else drifted in. And nobody decided it. An automatic step reversed an explicit instruction not to fix that failure here. The reverted fixture may well be diagnostically right. If it is, that belongs to the investigation it was routed to, with the evidence, rather than to a three-line drive-by inside a change about shard balance.
|
Closing this, and explaining why rather than letting it lapse.
|
main |
this branch (d0866aa5) |
|
|---|---|---|
| shard count | 5 | 6 |
| job cap | 30 min | 20 min |
| hint table | 146 hints, 11 unhinted | 152 hints, 0 unhinted |
| balance guard | absent | --check-shard-balance |
Why there is no mechanical resolution:
- The hint tables do not merge. They are two independent measurement sets over overlapping scripts, disagreeing on almost every shared entry. There is no textual resolution, only a choice of which measurement to keep — or a fresh one.
- The cap is load-bearing here. This branch pins
PORTABLE_SERIAL_JOB_TIMEOUT_MINUTES=20and deliberately fails whenci.ymldisagrees, so that the cap cannot move in one place only. Againstmain's 30 it refuses; forcing 20 back would revert a landed decision. - This branch's numbers are now stale. Its table was measured against a 152-script lane;
main's lane is 156 scripts. Its headline claim thatserial_unhintedreaches 0 is no longer true.
Rebasing would therefore mean re-deciding what the request delivers and re-deriving all of its evidence. That is a rewrite wearing a rebase's clothes, and nobody reviewing the result could tell which part was which. Closing is the honest outcome.
The part main does not have, and still needs
main raised the cap and refreshed the hints. Neither of those watches whether the hints stay true, and the record since shows why that matters.
The failure has already recurred under the new cap. In run 34439141091, Behavior portable serial 1 was cancelled at 30 min 15 s on 2026-09-10. The log shows no hang: the shard was still passing tests three seconds before ##[error]The operation was canceled. It ran out of a 30-minute budget doing real work. That is the third occurrence of one failure — 2026-09-01, 2026-09-08, 2026-09-10 — and the second cap raise did not end it.
The hint table on main is already wrong. docs/fm-test-portable-shards.md predicts every shard at 15.19 min with 17 ms of imbalance. Measured suite wall time from three green runs:
| Run | shards, fastest → slowest (min) | spread |
|---|---|---|
| 34413640474 | 11.14, 14.45, 15.33, 22.07, 23.09 | 2.07x |
| 34439204619 | 12.18, 14.05, 14.55, 20.32, 21.02 | 1.73x |
| 34447627189 | 13.24, 13.27, 13.57, 16.46, 21.93 | 1.66x |
Across those runs, 37 hints are low by more than 2x and 11 by more than 5x (tests/fm-calm-pi-extension.test.sh is hinted at 0.3 s and measures 58.4 s). The hinted scripts total 71.9 min of assignment weight against 89.4 min measured — the table understates the lane by 24%.
--check-coverage was green through every one of those runs. It reports serial_unhinted=11, 7% against its 15% bound, and passes. It checks whether a hint is missing; it cannot check whether a hint is wrong. docs/fm-test-portable-shards.md on main states the coverage guard exists so no shard carries "more than twice another shard's real work" — the lane is at 2.07x, green.
What happens next
The genuinely additive part of this request is the balance guard, which main has no counterpart to. It reopens as its own request, scoped to that alone: no shard-count change, no cap change, and no hint table carried over from here — main's decisions on all three stand.
Its threshold is being re-derived rather than transcribed. The 90%-of-cap bound in this branch was computed against a 20-minute cap; against main's 30-minute cap the worst green shard measured above sits at 77%, so the bound as written here could never fire before a cancellation. That number is being measured again from main's own variance.
The branch is being left in place rather than deleted, so this history stays reachable.
What this changes
The portable serial lane was being cancelled at its 20-minute cap on roughly one pull-request run in five. The split algorithm was sound; it was fed stale numbers. Three changes, together:
serial_unhintedgoes 10 to 0.ci.ymlmatrix.--check-shard-balance, run bytests-timing-aggregateover the timing artifacts every serial lane already uploads. It fails when a shard's measured wall time exceeds 90% of the job cap, and names the scripts furthest over their hints so the failure says what to re-measure.Without point 3 the table goes stale silently again. That is not hypothetical: the same remedy was applied on 2026-09-01 and the lane was cancelling again 19 hours later.
Evidence
Before, the coverage guard was green while a shard ran 40% over its predicted weight:
The new check fires on the stale table and passes on the refreshed one:
Balance from the real packer at six shards: 13.82 min of assignment weight each, 38 ms imbalance. Regrouping the four source runs' real per-script durations under that partition puts the worst shard at 13.14-13.37 min, 66-67% of the bound.
Threshold, chosen on measurement. 90% of 20 min fires at 18.00 min. At the measured lane growth of +2.1 min/day over six shards (+0.35 min/shard/day) that gives about 5.7 days of warning before a shard would actually be cancelled. The share is the suite's wall clock against the job's, so it understates by the surrounding steps' cost: measured across 30
tests-portable-serialjobs from 6 green runs, that is 15-24 s, worst case 2.0% of the bound against the 10% the threshold reserves.The check on this PR is red, and it is not from this change
14 checks: 13 passed, 1 failed, none cancelled. The failure is
Behavior portable serial 1, ontests/fm-backend.test.sh:It is a genuine assertion failure, not a ceiling cut: the lane ended at 13.25 min against the 20-minute cap, where a cut lands on the bound at ~20.27 min and reports cancelled.
Two measurements establish it is not caused by this change:
fm/fm-captain-hold-recursive-stale-lock(0753b42b), a branch that contains none of this work and runs the old five-way packing - and it failed there in shard 5, not shard 1.A coupling created by this repacking could not fail on a branch without the repacking. This branch also touches neither the failing test nor
bin/fm-spawn.sh, where that error originates. A test that passes alone and fails in a real lane says something about running conditions rather than about the assertion; it is routed for its own investigation.Two moves that would have produced a green badge, both declined
Adjusting the shard packing would have moved that test to different neighbours and very likely turned the check green. It was deliberately not done. If the failure is a latent condition, hiding it behind a packing choice is how it returns on a day nobody is looking, and a test that only passes next to the right neighbours is not a test we actually have.
The pipeline auto-committed a repair for it (
d65ceb7e, a three-lineFM_HOME/statefixture intests/fm-backend.test.sh) and pushed it. It is deliberately reverted ind0866aa5.Had that repair stood, it would have buried a defect already routed for its own investigation. The cost of accepting it was not untidiness in this pull request: it was the finding itself. The investigation depends on the failure still being reproducible, and a fixture that makes the symptom disappear without diagnosing it destroys exactly the evidence that investigation was opened to examine. The repair also touches a file this delivery otherwise does not, and it reversed an explicit decision not to fix that failure here. The fixture may well be diagnostically right - that belongs to the investigation, with evidence, not to a three-line drive-by inside a shard-balance change.
Status of the checks: a red mark accepted by decision, not a clean pass
Behavior portable serial 1is red, and was accepted by explicit decision rather than fixed or hidden. The reason: the failure is pre-existing, established by the two measurements above, reproduced on an unrelated branch running the old five-way packing, and routed as its own separate investigation. Accepting it was a decision taken deliberately; this pull request should not be read as having passed its checks.Every other check passes.
A second observation, recorded because it is a negative result
After the revert, the pipeline was run once more to produce a valid attestation for the current head. That run reached the same step, on the same branch, with the same red check that had earlier produced the unrequested auto-commit - and this time it asked instead of acting: it parked at an approval gate rather than committing a repair. Head unchanged, no commits, and a written 25-check expectation recorded before the run all still passing afterwards.
So the behaviour is situational, not deterministic. That is harder to characterise than a defect that always acts, and that difficulty is itself the finding.
What the six lanes prove
All six serial lanes ran to completion. None was cancelled - 12.31, 13.25, 13.46, 14.03, 14.33 and 15.40 min against the 20-minute cap. On a lane that had been cut at 20 minutes on about one run in five, that is the first direct evidence the split works, and it is the thing this change set out to fix.
Publication steps can remove required content, unpredictably
This description had to be restored after publication. The pipeline's PR step rewrote the body and deleted the whole description - both measurements, both declined green-badge moves, and the revert rationale - replacing it with a generated summary. It was restored by appending the step's own attestation section to the description rather than overwriting either, so both artefacts survive; the attestation's
head_shamatches the validated head.This is the third instance today across two deliveries, which makes it a property of the tooling rather than an accident of one branch. It also corrects an earlier reading: on another delivery the step removed some content and left other content intact, which looked selective. Here it removed everything. So it is not reliably selective, it varies - nobody can predict what survives a publication step.
The only safe assumption is therefore that required content must be verified present after publication, not trusted to persist through it.
Note for a later reader
The guard's final shape is deliberately minimal. A richer two-shape diagnosis was built during validation and then removed on purpose: a second pass/fail bound on hint drift, a non-failing warning share below the failure line, and a branch separating "the estimates are wrong" from "the lane has outgrown its shard count". Several defensive branches were likewise added and then removed. Both properties actually required survive in the single check - it fires before the badge goes red, and it names what to re-measure - and
docs/fm-test-portable-shards.mdrecords the decision so it is not re-derived and added back.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
TMPDIR="$PWD/.test-phase-tmp" bash tests/fm-test-run.test.sh— passed, including fixture-based wall-time measurement checks.bin/fm-test-run.sh --list-lanes,--check-coverage, and--list --lanefor all six numbered shards.bin/fm-test-run.sh --list --lanewithportable-serial-1of5,portable-serial-7of6, andportable-serial-0of6.Parsed.github/workflows/ci.ymlwith Ruby YAML; confirmed the six-member matrix and unchanged 20-minute cap.gh-axi run viewandgh-axi run downloadfor runs 34180535832, 34167501605, 34167485767, and 34156531229.python3 ~/.no-mistakes/evidence/01M20TE28ZPPZJ712ASRP3J3S9/measurements-check.pypython3 ~/.no-mistakes/evidence/01M20TE28ZPPZJ712ASRP3J3S9/live-guard-driver.py— healthy execution and a real 1082-second process pause, without mocked clocks or timing data.Exercised missing-input CLI refusals; removed temporary worktree files and confirmed no remaining test processes, a clean worktree, and unchanged target HEAD.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.