Skip to content

ci: guard portable serial shard budgets and refresh timing hints - #4137

Closed
mremond wants to merge 8 commits into
kunchenguid:mainfrom
mremond:fm/fm-rebase-4006-after-4056-lands
Closed

mremond wants to merge 8 commits into
kunchenguid:mainfrom
mremond:fm/fm-rebase-4006-after-4056-lands

Conversation

@mremond

@mremond mremond commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Follow-up on the SAME already-open request #4137 (shard balance guard + refreshed hints). This adds ONE documentation-only commit, e0fb8c5.

WHY: the margin figures in docs/fm-test-portable-shards.md came from replaying one held-out run's per-script durations into the new bins. The first real CI run on the refreshed table (34460760299) measured higher - worst shard 20.78 min, 68.4% of cap - against the replay's 16.99 min and 56.6%. The document therefore overstated the headroom roughly fourfold, in the direction of reassurance, in the very section a reader consults to judge whether the bound is safe, AND it contradicted the PR description which had already been corrected. This commit corrects it to the measured ~1.1 minutes, names the run, and states plainly that the guard is expected to fire on modest drift because the bound is early warning rather than last resort. It also corrects a claim my own number-search would not have caught: 'a healthy run comes in under them' was false, since that same real run put a shard at 20.78 min against 18.11 min of predicted weight.

STRICT SCOPE: documentation only. No behavior change. The 72% bound, the 30-minute cap, the shard count, the hint table, the guard code and the tests are all UNCHANGED from the already-reviewed state.

CARRIED FORWARD FROM THE EARLIER REVIEW OF THIS BRANCH, please do not re-raise:

  1. Shard count (5) and job cap (30 min) are deliberately unchanged - they are main's decisions, and the ci.yml diff is purely additive.
  2. The 72% threshold was derived from measured variance, not copied, and must NOT be raised. Any bound at or above 78% fires on none of 29 green shard measurements, so it could not warn. A guard that cannot go red is worse than none. The small margin is the design working, not a defect.
  3. The finding 'simplification-foreign-artifact-skip' was already fixed in f29b1b3; the accept-and-skip branch and its no-valid-shards fallback are gone. A malformed or foreign timing artifact now raises an unhandled error rather than a tidy message - that is DELIBERATE and accepted, the path is unreachable through both the CI glob and the documented invocation, and it fails loudly rather than silently. Do NOT propose adding back a tidy-error path, guard clause, or friendlier message.
  4. A richer diagnosis was deliberately not built: no second drift bound, no warning tier, no branch separating wrong estimates from an outgrown shard count.
  5. The guard does not auto-repack or auto-refresh; on failure it names the scripts furthest over their hints so a human can re-measure.
  6. test_portable_serial_job_cap_has_one_owner parses ci.yml as YAML and compares against the cap the guard prints, following the existing test_herdr_ci_family_run_has_a_step_timeout precedent - deliberately not a source-grep.

EXPECTED CI BEHAVIOUR: 'Behavior portable parallel 1' is cancelled at its own 10-minute cap on roughly one main run in three, independently of this change - the hints feed serial packing only. If it cancels again that is the same pre-existing condition and not a regression; if it passes that is one more sample, not a fix.

Repo style applies: one sentence per line in tracked Markdown, plain dash never em dash, no agent co-author. Merge authority belongs to the repository owner: deliver green and stop, do not merge.

What Changed

  • Add a CI shard-balance guard that fails when recorded suite wall time exceeds 72% of the 30-minute job cap, reports missing shard artifacts, and names scripts furthest over their hints.
  • Refresh 157 serial duration hints from CI measurements and add regression coverage for the threshold, wall-time accounting, partial artifacts, and workflow cap consistency.
  • Document the threshold rationale and distinguish replay estimates from CI run 34460760299, correcting measured headroom to about 1.1 minutes and explaining why modest drift should trigger the guard.

Risk Assessment

✅ Low: The full scoped review found no material issues; the documentation correction matches historical CI timing evidence and preserves the accepted behavior.

Testing

The focused runner suite passed, and mutation checks proved both new boundary assertions detect threshold drift. Fresh CLI runs demonstrated shard planning, timing consumption, partial reporting, aggregation, and foreign-artifact rejection. Documentation arithmetic matched; synthetic checks remain distinguished from live evidence. Temporary files were removed. No full suite, lint, or CI phase ran.

  • Live validation: ✅ go - 4 of 8 scenarios driven live against the product
Scenario Result Live Evidence
A maintainer lists the refreshed serial shards and receives a complete, disjoint five-shard partition. ✅ pass live Live shard plans: five disjoint shards containing 30, 31, 32, 31, and 33 scripts cover all 157 serial scripts.
A maintainer checks a freshly generated filtered serial-lane artifact and sees its measured result without implying the missing shards passed. ✅ pass live Fresh timing CLI transcript: unedited artifact accepted with bound=30min and partial 1 of 5; remaining shards explicitly unchecked.
A maintainer aggregates two freshly generated timing artifacts and receives the combined summary. ✅ pass live Fresh timing CLI transcript: FM_TEST_AGGREGATE lanes=2 total=2 failed=0.
A maintainer supplies a foreign timing artifact and receives the deliberately retained unhandled error. ✅ pass live Fresh timing CLI transcript: non-serial runner artifact raises AttributeError and exits 1.
A maintainer checks durations immediately below and above 72% and receives acceptance followed by refusal. ⏸️ untested no Verified with synthetic timing inputs, not freshly measured boundary-duration shards. Full serial CI execution belongs to the outer executor; this round authorized the focused behavioral test.
A maintainer checks an over-budget shard and receives a wall-time refusal naming scripts that exceeded their hints. ⏸️ untested no No freshly measured over-budget serial artifact was produced locally. Synthetic checks passed; live serial CI measurements require the outer executor's CI phase.
A maintainer reads 20.53 minutes of suite time, approximately 1.1 minutes of headroom, and explicitly distinguished whole-job timings. ⏸️ untested no This documentation has no running product surface. The text and arithmetic were checked manually against the user-confirmed duration; no published documentation renderer was exercised.
CI downloads serial timing artifacts and runs the balance guard, or warns when no serial artifacts exist. ⏸️ untested no The phase boundary reserves CI execution to the outer executor. Its CI phase must provide this integration evidence.
Evidence: Threshold mutation proof

Source: Threshold mutation proof

Prior five guard tests with 90% mutant (demonstrates the old hole)
$ /bin/bash ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/run-balance-cases.sh ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/mutant-90/bin/fm-test-run.sh test_shard_balance_passes_and_reports_bound test_shard_balance_goes_red_on_an_imbalanced_shard test_shard_balance_goes_red_on_a_stale_hint_table test_shard_balance_measures_the_recorded_wall_time test_shard_balance_reports_missing_artifacts
ok - shard balance: shards well inside the cap pass and report the bound
ok - shard balance: a shard near its job cap turns the guard red
ok - shard balance: a stale hint table turns the guard red and names what drifted
ok - shard balance: the shard's recorded wall time is what is scored
ok - shard balance: missing shard artifacts are reported, not assumed green
EXIT=0; expected=0

New test with 90% mutant
$ /bin/bash ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/run-balance-cases.sh ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/mutant-90/bin/fm-test-run.sh test_shard_balance_pins_the_72_percent_threshold
not ok - a shard just above 72% of the job cap must fail (exit 0): FM_TEST_SHARD_BALANCE ok shards=1 [email protected]% bound=30min
EXIT=1; expected=1

New test with 73% mutant
$ /bin/bash ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/run-balance-cases.sh ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/mutant-73/bin/fm-test-run.sh test_shard_balance_pins_the_72_percent_threshold
not ok - a shard just above 72% of the job cap must fail (exit 0): FM_TEST_SHARD_BALANCE ok shards=1 [email protected]% bound=30min
EXIT=1; expected=1

New test with 71% mutant
$ /bin/bash ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/run-balance-cases.sh ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/mutant-71/bin/fm-test-run.sh test_shard_balance_pins_the_72_percent_threshold
not ok - a shard just below 72% of the job cap must pass: shard balance guard failed: portable-serial-1of1 ran 21.60 min, 72.0% of the 30 min job cap (max 71%); refresh the duration hints or repack the lane (docs/fm-test-portable-shards.md)
  re-measure the scripts furthest over their hints:
    tests/a.test.sh measured 1296.0s hint 27.0s (+1269.0s) [no hint, default weight]
EXIT=1; expected=1

New test with unchanged 72% runner
$ /bin/bash ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/.test-phase/run-balance-cases.sh ~/.no-mistakes/worktrees/acf4a767348a/01M25C6PVFERGFF8VCGKNJPMP3/bin/fm-test-run.sh test_shard_balance_pins_the_72_percent_threshold
ok - shard balance: the threshold is pinned at 72% of the job cap
EXIT=0; expected=0
Evidence: Fresh timing, partial-shard reporting, aggregation, and foreign-artifact rejection

Source: Fresh timing, partial-shard reporting, aggregation, and foreign-artifact rejection

Fresh local timing only; filtered serial lane runs one real script, not the full CI shard. No timing fields or selections are edited.

$ bin/fm-test-run.sh --lane portable-serial-4of5 --exclude-family pure-contract-unit --exclude-family watcher-wake-lock --exclude-family real-herdr-gated --exclude-family secondmate --exclude-family session-bootstrap --exclude-family live-harness-optin --exclude-family backend-dispatch --exclude-family afk --exclude-family snapshot-bearings --exclude-family cmux --exclude-family zellij --exclude-family orca --exclude-family standalone --exclude-family unclassified --json ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-live-serial-4of5.json
FM_TEST_BEGIN 2026-09-10T10:31:50Z tests/fm-check-unregister.test.sh family=pr-forge expected_gate_skip=none
ok - empty id or missing state dir refuses loudly and never rms a stray path
ok - happy path removes only the named check.sh and check-trust
ok - hard-linked or symlinked artifacts are refused and left in place
FM_TEST_END 2026-09-10T10:31:52Z tests/fm-check-unregister.test.sh exit=0 duration_ms=1299 gate_skip=false
FM_TEST_SUMMARY total=1 failed=0 skipped_gate=0 duration_ms=2670
FM_TEST_SUMMARY_FAMILY family=pr-forge count=1 duration_ms=1299 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-check-unregister.test.sh duration_ms=1299
fm-test-run: wrote timing artifact: ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-live-serial-4of5.json
EXIT=0

$ bin/fm-test-run.sh --check-shard-balance ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-live-serial-4of5.json
FM_TEST_SHARD_BALANCE partial 1 of 5 portable serial shards reported a timing artifact; a cancelled shard uploads none, so the rest are unchecked
FM_TEST_SHARD_BALANCE ok shards=1 [email protected]% bound=30min
EXIT=0

$ bin/fm-test-run.sh --aggregate-json ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-live-aggregate.json ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-live-serial-4of5.json ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-focused-runner-timing.json
FM_TEST_AGGREGATE lanes=2 total=2 failed=0 skipped_gate=0 critical_path_duration_ms=127608
EXIT=0

$ bin/fm-test-run.sh --check-shard-balance ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-focused-runner-timing.json
Traceback (most recent call last):
  File "<stdin>", line 45, in <module>
AttributeError: 'NoneType' object has no attribute 'group'
EXIT=1
Evidence: Live shard plans

Source: Live shard plans

{
  "head": "8a7259b8fe3a8da37dbb047aaac219a12a277186",
  "shard_count": 5,
  "serial_count": 157,
  "plans": [
    {
      "command": [
        "bin/fm-test-run.sh",
        "--list",
        "--lane",
        "portable-serial-1of5"
      ],
      "scripts": [
        "tests/fm-watch-triage.test.sh",
        "tests/fm-sessionstart-nudge.test.sh",
        "tests/fm-pi-branch-extension.test.sh",
        "tests/fm-watch-recovery-loop.test.sh",
        "tests/fm-trace-context-spawn.test.sh",
        "tests/fm-omp-harness.test.sh",
        "tests/fm-control.test.sh",
        "tests/fm-teardown-endpoint-safety.test.sh",
        "tests/fm-send-remote-delivery.test.sh",
        "tests/fm-rovo-harness.test.sh",
        "tests/fm-secondmate-liveness.test.sh",
        "tests/fm-bearings-board-render.test.sh",
        "tests/fm-mail-check.test.sh",
        "tests/fm-mail.test.sh",
        "tests/fm-spawn-worktree-settle.test.sh",
        "tests/fm-herdr-session-cleanup.test.sh",
        "tests/fm-claude-trust.test.sh",
        "tests/fm-test-isolation-proof.test.sh",
        "tests/fm-session-lock-ancestry.test.sh",
        "tests/fm-harness-liveness-drift-live-e2e.test.sh",
        "tests/fm-lint-workflows.test.sh",
        "tests/fm-operational-input.test.sh",
        "tests/fm-no-mistakes-required.test.sh",
        "tests/fm-test-fixtures.test.sh",
        "tests/fm-pi-windows-shell-invocation.test.sh",
        "tests/fm-muse-signals-live-e2e.test.sh",
        "tests/fm-pi-branch-live-e2e.test.sh",
        "tests/fm-composer-matrix-live-e2e.test.sh",
        "tests/fm-afk-pi-herdr-return-e2e.test.sh",
        "tests/fm-sessionstart-instruction-refresh-live-e2e.test.sh"
      ]
    },
    {
      "command": [
        "bin/fm-test-run.sh",
        "--list",
        "--lane",
        "portable-serial-2of5"
      ],
      "scripts": [
        "tests/fm-remote-secondmate-lifecycle-e2e.test.sh",
        "tests/fm-bearings-snapshot.test.sh",
        "tests/fm-spawn-dispatch-profile.test.sh",
        "tests/fm-watch-arm.test.sh",
        "tests/fm-wake-queue.test.sh",
        "tests/fm-claude-stop-autoarm.test.sh",
        "tests/fm-bearings-board.test.sh",
        "tests/fm-pi-watch-extension.test.sh",
        "tests/fm-vendor-auth-probe.test.sh",
        "tests/fm-send-inbox.test.sh",
        "tests/fm-voice-relay.test.sh",
        "tests/fm-daemon.test.sh",
        "tests/fm-turnend-guard.test.sh",
        "tests/fm-kimi-harness.test.sh",
        "tests/fm-afk-return.test.sh",
        "tests/fm-afk-contract.test.sh",
        "tests/fm-branch-supervision.test.sh",
        "tests/fm-fleet-snapshot-view.test.sh",
        "tests/fm-wake-daemon-lifecycle-e2e.test.sh",
        "tests/fm-gate-refuse.test.sh",
        "tests/fm-remote-job-orphan-reap.test.sh",
        "tests/fm-quota-choose.test.sh",
        "tests/fm-test-fixture-cleanup.test.sh",
        "tests/fm-nm-test-contract.test.sh",
        "tests/fm-backend-tmux-smoke.test.sh",
        "tests/fm-sessionstart-hook-live-e2e.test.sh",
        "tests/fm-herdr-version-floor-live-e2e.test.sh",
        "tests/fm-opencode-primary-live-e2e.test.sh",
        "tests/fm-bearings-board-lavish-live-e2e.test.sh",
        "tests/fm-pi-primary-live-e2e.test.sh",
        "tests/fm-pi-codex-native.test.sh"
      ]
    },
    {
      "command": [
        "bin/fm-test-run.sh",
        "--list",
        "--lane",
        "portable-serial-3of5"
      ],
      "scripts": [
        "tests/fm-procevent.test.sh",
        "tests/fm-secondmate-safety.test.sh",
        "tests/fm-control-relaunch.test.sh",
        "tests/fm-watcher-lock.test.sh",
        "tests/fm-remote-transport-lanes.test.sh",
        "tests/fm-remote-job.test.sh",
        "tests/fm-remote-reply.test.sh",
        "tests/fm-inactive-reconcile.test.sh",
        "tests/fm-remote-backlog-handoff.test.sh",
        "tests/fm-fleet-sync.test.sh",
        "tests/fm-remote-secondmate-parent-binding.test.sh",
        "tests/fm-cursor-harness.test.sh",
        "tests/fm-busy-adapter-wiring.test.sh",
        "tests/fm-wake-drain-unread-status.test.sh",
        "tests/fm-tool-update-check.test.sh",
        "tests/fm-on.test.sh",
        "tests/fm-update.test.sh",
        "tests/fm-secondmate-lifecycle-e2e.test.sh",
        "tests/fm-startup-memory-budget.test.sh",
        "tests/fm-send-secondmate-marker.test.sh",
        "tests/fm-stow-cascade.test.sh",
        "tests/fm-live-gate.test.sh",
        "tests/fm-classify-decision-key.test.sh",
        "tests/fm-documentation-audiences.test.sh",
        "tests/fm-gemini-harness.test.sh",
        "tests/fm-send-secondmate-marker-herdr-e2e.test.sh",
        "tests/fm-gitignore-config.test.sh",
        "tests/fm-stat-shadowing.test.sh",
        "tests/fm-quota-array-dispatch-live-e2e.test.sh",
        "tests/fm-cursor-primary-live-e2e.test.sh",
        "tests/fm-claude-stop-autoarm-live-e2e.test.sh",
        "tests/fm-backend-cmux-smoke.test.sh"
      ]
    },
    {
      "command": [
        "bin/fm-test-run.sh",
        "--list",
        "--lane",
        "portable-serial-4of5"
      ],
      "scripts": [
        "tests/fm-backlog-atomicity.test.sh",
        "tests/fm-secondmate-harness.test.sh",
        "tests/fm-public-followup.test.sh",
        "tests/fm-secondmate-reconcile.test.sh",
        "tests/fm-secondmate-sync.test.sh",
        "tests/fm-startup-network.test.sh",
        "tests/fm-spawn-pool-base-freshen.test.sh",
        "tests/fm-cursor-primary.test.sh",
        "tests/fm-secondmate-restart.test.sh",
        "tests/fm-muse-harness.test.sh",
        "tests/fm-pending-reply.test.sh",
        "tests/fm-send-resolve-key.test.sh",
        "tests/fm-wake-drain-open-decisions-cursor.test.sh",
        "tests/fm-procevent-when.test.sh",
        "tests/fm-task-delivery.test.sh",
        "tests/fm-guard-stale-banner.test.sh",
        "tests/fm-bootstrap-network-parallel.test.sh",
        "tests/fm-backend-zellij.test.sh",
        "tests/fm-watch-checkpoint.test.sh",
        "tests/fm-shared-captain-inheritance.test.sh",
        "tests/fm-busy-state.test.sh",
        "tests/fm-procevent-quota.test.sh",
        "tests/fm-subagent-pretool-check.test.sh",
        "tests/fm-project-origin.test.sh",
        "tests/fm-check-unregister.test.sh",
        "tests/fm-ask-user-authority.test.sh",
        "tests/fm-remote-entrypoint.test.sh",
        "tests/fm-omp-primary-live-e2e.test.sh",
        "tests/fm-send-inbox-doorbell-live-e2e.test.sh",
        "tests/fm-herdr-submit-confirm-live-e2e.test.sh",
        "tests/fm-harness-adapter-instructions-live-e2e.test.sh"
      ]
    },
    {
      "command": [
        "bin/fm-test-run.sh",
        "--list",
        "--lane",
        "portable-serial-5of5"
      ],
      "scripts": [
        "tests/fm-pr-check-security.test.sh",
        "tests/fm-session-start.test.sh",
        "tests/fm-teardown.test.sh",
        "tests/fm-bootstrap.test.sh",
        "tests/fm-classify-corr-token.test.sh",
        "tests/fm-remote-secondmate-trace-context.test.sh",
        "tests/fm-backlog-handoff.test.sh",
        "tests/fm-calm-pi-extension.test.sh",
        "tests/fm-wake-drain-outcome-backstop.test.sh",
        "tests/fm-home-summary-refresh.test.sh",
        "tests/fm-afk-inject-e2e.test.sh",
        "tests/fm-task-inbox.test.sh",
        "tests/fm-backend.test.sh",
        "tests/fm-backend-orca.test.sh",
        "tests/fm-remote-doctor.test.sh",
        "tests/fm-pi-branch-responsiveness-live-e2e.test.sh",
        "tests/fm-extension-binding.test.sh",
        "tests/fm-wake-drain-open-decisions.test.sh",
        "tests/fm-tangle-guard.test.sh",
        "tests/fm-backend-cmux.test.sh",
        "tests/fm-remote-herdr-guard.test.sh",
        "tests/fm-tmux-agent-liveness.test.sh",
        "tests/fm-gotmp.test.sh",
        "tests/fm-peek-remote.test.sh",
        "tests/fm-supervision-events.test.sh",
        "tests/fm-trace-context-lib.test.sh",
        "tests/fm-codex-continuity-live-e2e.test.sh",
        "tests/fm-harness-adapter-references.test.sh",
        "tests/fm-cmux-claude-composer-live-e2e.test.sh",
        "tests/fm-rovo-signals-live-e2e.test.sh",
        "tests/fm-grok-stop-live-e2e.test.sh",
        "tests/fm-grok-continuity-live-e2e.test.sh",
        "tests/fm-backend-zellij-smoke.test.sh"
      ]
    }
  ]
}
Evidence: Fresh filtered serial-lane timing

Source: Fresh filtered serial-lane timing

{
  "families": [
    {
      "count": 1,
      "duration_ms": 1299,
      "failed": 0,
      "name": "pr-forge"
    }
  ],
  "finished_at": "2026-09-10T10:31:52Z",
  "run_id": "fm-test-run-1789036309571-57763",
  "scripts": [
    {
      "duration_ms": 1299,
      "exit": 0,
      "expected_gate_skip": "none",
      "family": "pr-forge",
      "gate_skip": false,
      "gate_skip_reason": "",
      "path": "tests/fm-check-unregister.test.sh"
    }
  ],
  "selection": "lane=portable-serial-4of5;exclude-family=pure-contract-unit,watcher-wake-lock,real-herdr-gated,secondmate,session-bootstrap,live-harness-optin,backend-dispatch,afk,snapshot-bearings,cmux,zellij,orca,standalone,unclassified",
  "started_at": "2026-09-10T10:31:49Z",
  "summary": {
    "duration_ms": 2670,
    "failed": 0,
    "skipped_gate": 0,
    "total": 1
  }
}
Evidence: Documented margin calculation

Source: Documented margin calculation

{
  "source": "User-confirmed summary.duration_ms for run 34460760299, shard 4",
  "suite_duration_ms": 1231845,
  "suite_minutes": 20.53075,
  "share_percent": 68.43583333333333,
  "margin_minutes": 1.06925,
  "document_contract": "docs/fm-test-portable-shards.md uses 20.53 min for suite-versus-weight and margin comparisons; 20.78 min is explicitly whole-job time. This is a manual document and arithmetic check, not live CI evidence."
}
- Outcome: 🔧 2 issues found → auto-fixed ✅ across 2 runs (20m32s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ docs/fm-test-portable-shards.md:156 - The table mixes job time with the suite time the guard scores. Run 34460760299's artifact records 1,231,845 ms for shard 4: 20.53075 minutes, 68.4358% of cap, and 1.06925 minutes of headroom. The displayed 20.78 minutes instead implies 69.27% and 0.82 minutes. Use 20.53 minutes in this row and distinguish whole-job timings in the nearby comparisons, preserving the correct approximately 1.1-minute margin.

🔧 Fix applied.
✅ Re-checked - no issues remain.

🔧 **Test** - 2 issues found → auto-fixed ✅
  • ⚠️ The supplied commit range includes the earlier runtime guard changes. Focused tests and synthetic timing checks passed, but live evidence covers only shard planning and foreign-artifact rejection. The outer executor must obtain serial-shard and aggregate-job CI evidence before treating the full range as live-validated; this phase cannot launch CI.
  • ⚠️ live validation verdict: inconclusive (2 of 7 scenarios were driven live against the product); untested: A maintainer reads 20.53 minutes of suite time, approximately 1.1 minutes of headroom, and explicitly distinguished whole-job timings., A maintainer checks shard timing: 72% passes, while one millisecond above the threshold fails., A maintainer checks an over-budget shard and receives a wall-time refusal identifying scripts that exceeded their hints., A maintainer supplies one of five shard artifacts and sees the other four explicitly reported as unchecked., CI aggregates serial timing artifacts and runs the balance guard, or warns when no serial artifacts exist.
  • Live validation: ⚠️ inconclusive - 2 of 7 scenarios driven live against the product
Scenario Result Live Evidence
A maintainer reads 20.53 minutes of suite time, approximately 1.1 minutes of headroom, and explicitly distinguished whole-job timings. ⏸️ untested no This documentation correction has no executable surface. Manual inspection and arithmetic confirmed the figures and documentation-only follow-up; runtime files remain unchanged.
A maintainer lists the five refreshed serial shards and receives a complete, disjoint partition of the serial lane. ✅ pass live Live shard plans
A maintainer checks shard timing: 72% passes, while one millisecond above the threshold fails. ⏸️ untested no Synthetic-input checks passed. Fresh serial CI timing at this boundary was not produced; the outer executor owns the required CI execution.
A maintainer checks an over-budget shard and receives a wall-time refusal identifying scripts that exceeded their hints. ⏸️ untested no Synthetic-input checks passed, including low script sums with excessive shard wall time. Live slow-shard evidence requires a production CI run controlled by the outer executor.
A maintainer supplies one of five shard artifacts and sees the other four explicitly reported as unchecked. ⏸️ untested no The partial-artifact check passed with synthetic input. No fresh partial serial CI run was available; the outer executor must provide its artifacts.
A maintainer supplies a freshly generated non-serial timing artifact and receives the deliberately accepted unhandled error with a nonzero exit. ✅ pass live Fresh non-serial artifact rejection; Fresh runner timing artifact
CI aggregates serial timing artifacts and runs the balance guard, or warns when no serial artifacts exist. ⏸️ untested no This phase lacks authority to execute GitHub CI. The outer executor must run the serial and timing-aggregate jobs to establish this integration live.
  • git diff b1ad702fafdd03d94e5ce47cd4ba86e589ad33d6 14dc4a60cfcc7a996f07dde5570e37a3b117c5f2 and commit-history inspection.
  • git diff --quiet be2ec4dd 14dc4a60cfcc7a996f07dde5570e37a3b117c5f2 -- bin/fm-test-run.sh tests/fm-test-run.test.sh .github/workflows/ci.yml confirmed unchanged runtime, workflow, and tests in the documentation follow-up.
  • bin/fm-test-run.sh --jobs 1 --json &lt;evidence&gt;/runner-contract-timing.json tests/fm-test-run.test.sh passed.
  • bin/fm-test-run.sh --list --lane portable-serial and all five numbered shard listings; compared outputs for completeness and disjointness.
  • bin/fm-test-run.sh --check-shard-balance &lt;artifact&gt; exercised seven synthetic timing cases; exact commands and responses are retained in the evidence transcript.
  • bin/fm-test-run.sh --check-shard-balance &lt;evidence&gt;/runner-contract-timing.json rejected the freshly generated non-serial artifact as intended.
  • Python Decimal arithmetic using the user-confirmed 1231845 ms verified 20.53075 minutes, 68.4358% of cap, and 1.06925 minutes of headroom.
  • Final git status --short confirmed no working-tree changes or transient artifacts.

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 4 of 8 scenarios driven live against the product
Scenario Result Live Evidence
A maintainer lists the refreshed serial shards and receives a complete, disjoint five-shard partition. ✅ pass live Live shard plans: five disjoint shards containing 30, 31, 32, 31, and 33 scripts cover all 157 serial scripts.
A maintainer checks a freshly generated filtered serial-lane artifact and sees its measured result without implying the missing shards passed. ✅ pass live Fresh timing CLI transcript: unedited artifact accepted with bound=30min and partial 1 of 5; remaining shards explicitly unchecked.
A maintainer aggregates two freshly generated timing artifacts and receives the combined summary. ✅ pass live Fresh timing CLI transcript: FM_TEST_AGGREGATE lanes=2 total=2 failed=0.
A maintainer supplies a foreign timing artifact and receives the deliberately retained unhandled error. ✅ pass live Fresh timing CLI transcript: non-serial runner artifact raises AttributeError and exits 1.
A maintainer checks durations immediately below and above 72% and receives acceptance followed by refusal. ⏸️ untested no Verified with synthetic timing inputs, not freshly measured boundary-duration shards. Full serial CI execution belongs to the outer executor; this round authorized the focused behavioral test.
A maintainer checks an over-budget shard and receives a wall-time refusal naming scripts that exceeded their hints. ⏸️ untested no No freshly measured over-budget serial artifact was produced locally. Synthetic checks passed; live serial CI measurements require the outer executor's CI phase.
A maintainer reads 20.53 minutes of suite time, approximately 1.1 minutes of headroom, and explicitly distinguished whole-job timings. ⏸️ untested no This documentation has no running product surface. The text and arithmetic were checked manually against the user-confirmed duration; no published documentation renderer was exercised.
CI downloads serial timing artifacts and runs the balance guard, or warns when no serial artifacts exist. ⏸️ untested no The phase boundary reserves CI execution to the outer executor. Its CI phase must provide this integration evidence.
  • bin/fm-test-run.sh tests/fm-test-run.test.sh --json ~/.no-mistakes/evidence/01M25C6PVFERGFF8VCGKNJPMP3/round2-focused-runner-timing.json
  • Executed the five existing balance tests against an isolated 90% runner mutation; all remained green, reproducing the reported hole.
  • Executed test_shard_balance_pins_the_72_percent_threshold against isolated 71%, 73%, and 90% mutations and the unchanged 72% runner; each mutation failed at the intended assertion and 72% passed.
  • bin/fm-test-run.sh --list --lane portable-serial-{1,2,3,4,5}of5, compared with --list --lane portable-serial for complete, disjoint coverage.
  • bin/fm-test-run.sh --lane portable-serial-4of5 with every family except pr-forge excluded and --json; exact command recorded in round2-live-cli.txt.
  • bin/fm-test-run.sh --check-shard-balance against the fresh filtered serial artifact and fresh non-serial artifact.
  • bin/fm-test-run.sh --aggregate-json against both fresh timing artifacts.
  • Manually checked corrected suite/job wording and independently calculated the documented margin from 1231845 ms.
  • Removed temporary test and mutation files; confirmed clean worktree at 8a7259b8fe3a8da37dbb047aaac219a12a277186.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The portable serial lane has been cancelled at its job cap three times in
nine days: 2026-09-01 and 2026-09-08 against a 20-minute cap, and again on
2026-09-10 against the 30-minute cap that replaced it. Each remedy so far
refreshed the hints or raised the cap; neither keeps the balance repaired,
and the coverage guard stayed green throughout because it checks whether a
hint is missing, not whether a hint is wrong.

Add `--check-shard-balance`, which scores each shard's own recorded wall
time against the job cap using the timing artifacts the serial lanes
already upload, and names the scripts furthest over their hints so the
failure says what to re-measure. The bound is 72% of the 30-minute cap,
21.6 minutes, derived from this lane's measured variance: shard 1 averaged
21.75 min and reached 29.95 min on the run that was cancelled, so a shard
at or above 72.6% of the cap reaches it on an excursion that size. A bound
of 78% or more fires on none of the 29 green shard measurements taken, so
it could not warn about anything.

Refresh the duration hints from four green runs on 2026-09-10, covering all
157 lane scripts so none falls back to the default weight. Validated
against a held-out run that contributed nothing to the table: its worst
shard falls from 21.93 to 16.99 minutes and the spread from 1.66x to 1.17x.

The shard count and the job cap are unchanged; both stay trunk's decisions.
…guard

The guard skipped timing artifacts whose lane is not a numbered portable
serial shard, then needed a no-valid-shards fallback for the case where
every input was skipped. Nothing supplies such an input: the CI step globs
fm-test-timing-portable-serial-*.json and the documented invocation does
the same, so both paths were unreachable compatibility surface.

A malformed input now fails normally instead of being tolerated. That
failure is loud rather than silent, and it cannot be reached through any
supported path.

Re-proved after the change that the guard can still go red: a shard at
73.3% of the cap fails and names tests/fm-watch-triage.test.sh as 607.3s
over its hint, a shard at 93.3% fails the same way, and a balanced lane
passes at 46.7%.
The margin figures in this section came from replaying one held-out run's
per-script durations into the new bins. The first real CI run on the
refreshed table, 34460760299, measured higher: worst shard 20.78 min and
68.4% of the cap, against the replay's 16.99 min and 56.6%.

That overstated the headroom roughly fourfold, in the direction of
reassurance, in the document a reader consults to judge whether the bound
is safe. Correct the margin to about 1.1 minutes, name the run it came
from, and say plainly that the guard is expected to fire on modest drift
because the bound is an early warning rather than a last resort.

Also correct the claim that a healthy run comes in under the assignment
weights. Per-script maxima are conservative only relative to the runs they
were measured from; the same real run put a shard at 20.78 min against
18.11 min of predicted weight.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

Tip be2ec4ddc5ce792a59fed4bd5f9cfd1be19ad4ef vs main ~b1ad702fafdd. MERGEABLE/BLOCKED. Attestation MATCH. Require no-mistakes SUCCESS. Portable serial 1–5 + Herdr + Lint + Repo invariants + coverage + timing aggregate SUCCESS; Behavior portable parallel 1 CANCELLED (~10m17s, no shard verdict) — overall CI suite conclusion cancelled, so this is not green for merge.

Contract-class: new-default. Additive always-on CI step Check portable serial shard balance (bin/fm-test-run.sh --check-shard-balance after aggregate) can fail runs that previously passed once hints drift past 72% of the 30m serial cap. Hint-table refresh alone would be restorative measurement; the new fail-closed guard is a new unconfigured CI path. Cap/shard count deliberately unchanged (main's decisions). Not auto-merge eligible even when CI clears — Firstmate flag when otherwise ready.

VISION.md (each rule)

  1. One captain, one interface — CI/scripts own the balance mechanic; no second merge authority.
  2. Authority explicit — guard fails loudly and names drifted scripts; no silent repack.
  3. Scripts own mechanics, agents own judgment — re-measure/repack stays human.
  4. Restart is a non-event — N/A (CI timing only).
  5. Delegation with a spine — single owner of timeout-minutes vs printed cap (test refuses drift).
  6. Fleet outlives vendor — portable lane, no vendor lock-in.
  7. Scope — additive guard + refreshed hints; no 6-shard / cap-change scope creep.

Outcome: waiting-ci. Blocker: parallel 1 cancelled (required suite not green). No first-time fork approval needed (contributor already trusted). Do not merge. When CI is fully green, re-triage as waiting-captain (new-default).

…e five specified runs and updated the documentation. All 157 scripts remain covered. The excluded held-out run scores a 16.95-minute worst shard and 3.37-minute spread. All 42 runner checks, coverage, targeted lint, and documentation checks passed. Threshold, cap, shard count, guard, and tests are unchanged. Fresh CI remains for the outer executor; the original recorded artifact correctly still fails
@mremond

mremond commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: the measured hint refresh this carried already ships in #4144, and the shard-balance guard it adds cannot be green at the current five-shard count - the window between a bound low enough to warn and one high enough not to fire on ordinary variance measures empty. Closing rather than leaving it open; the branch is preserved and this can be reopened if the shard count changes.

@mremond mremond closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants