Repository navigation
feat(bin): add Wake daily outcome collector - #50
Conversation
…test.sh but gives it no duration hint in bin/fm-test-run.sh. That leaves 44 of 292 portable serial scripts without a hint (15.07%), over the coverage guard's 15% cap. Rule that broke: no more than 15% of portable serial scripts may lack a duration hint. The rule is checked in one place, the hint table in bin/fm-test-run.sh, so that is the one place to fix. Fix: I added `tests/fm-wake-daily-rework.test.sh 1600` to the hint table, just before `tests/fm-wake-daily.test.sh 1600`. The table's comment allows a new test to use a local sample until CI has measured it, and PR #50 added the sibling test's hint the same way. The new test took about 1.6s locally. Verified: - `bin/fm-test-run.sh --check-coverage` passes (`FM_TEST_COVERAGE ok`, serial_unhinted=43). - tests/fm-wake-daily-rework.test.sh and tests/fm-wake-daily.test.sh pass. - tests/fm-test-run.test.sh, the shard 2 test that runs the real coverage check, now passes every coverage subtest. That includes "portable shard union, disjointness, and coverage guard hold" and "coverage guard bounds the unmeasured share and serial packing within twenty minutes", so the shard 2 failure was almost certainly this missing hint. - **Test coverage guard:** fixed directly by this change. - **Full suite:** a summary check that fails when any lane fails, so it should clear once the other two pass. - **Behavior portable parallel 2:** its coverage subtests pass locally, but tests/fm-test-run.test.sh still exits 1 here. Its "--jobs on a proven family" subtest runs tests/fm-session-lock-ancestry.test.sh, which fails with "not ok - the fixture hook never finished". That script also fails when run on its own on this host. This PR does not change it or the session-lock code (its diff against base is empty), so I treat it as a local host problem and made no change for it. I could not finish a full local run of the portable-parallel-2 lane: it was stopped at the 10-minute background limit, and that run had also started before the fix
…test.sh but gives it no duration hint in bin/fm-test-run.sh. That leaves 44 of 292 portable serial scripts without a hint (15.07%), over the coverage guard's 15% cap. Rule that broke: no more than 15% of portable serial scripts may lack a duration hint. The rule is checked in one place, the hint table in bin/fm-test-run.sh, so that is the one place to fix. Fix: I added `tests/fm-wake-daily-rework.test.sh 1600` to the hint table, just before `tests/fm-wake-daily.test.sh 1600`. The table's comment allows a new test to use a local sample until CI has measured it, and PR #50 added the sibling test's hint the same way. The new test took about 1.6s locally. Verified: - `bin/fm-test-run.sh --check-coverage` passes (`FM_TEST_COVERAGE ok`, serial_unhinted=43). - tests/fm-wake-daily-rework.test.sh and tests/fm-wake-daily.test.sh pass. - tests/fm-test-run.test.sh, the shard 2 test that runs the real coverage check, now passes every coverage subtest. That includes "portable shard union, disjointness, and coverage guard hold" and "coverage guard bounds the unmeasured share and serial packing within twenty minutes", so the shard 2 failure was almost certainly this missing hint. - **Test coverage guard:** fixed directly by this change. - **Full suite:** a summary check that fails when any lane fails, so it should clear once the other two pass. - **Behavior portable parallel 2:** its coverage subtests pass locally, but tests/fm-test-run.test.sh still exits 1 here. Its "--jobs on a proven family" subtest runs tests/fm-session-lock-ancestry.test.sh, which fails with "not ok - the fixture hook never finished". That script also fails when run on its own on this host. This PR does not change it or the session-lock code (its diff against base is empty), so I treat it as a local host problem and made no change for it. I could not finish a full local run of the portable-parallel-2 lane: it was stopped at the 10-minute background limit, and that run had also started before the fix
* Add Wake daily rework signals * no-mistakes(review): Bound forge reads to in-flight tasks, normalize PR URLs * no-mistakes(review): Assume 14-day start window for undated forge tasks * no-mistakes(ci): Root cause: this PR adds tests/fm-wake-daily-rework.test.sh but gives it no duration hint in bin/fm-test-run.sh. That leaves 44 of 292 portable serial scripts without a hint (15.07%), over the coverage guard's 15% cap. Rule that broke: no more than 15% of portable serial scripts may lack a duration hint. The rule is checked in one place, the hint table in bin/fm-test-run.sh, so that is the one place to fix. Fix: I added `tests/fm-wake-daily-rework.test.sh 1600` to the hint table, just before `tests/fm-wake-daily.test.sh 1600`. The table's comment allows a new test to use a local sample until CI has measured it, and PR #50 added the sibling test's hint the same way. The new test took about 1.6s locally. Verified: - `bin/fm-test-run.sh --check-coverage` passes (`FM_TEST_COVERAGE ok`, serial_unhinted=43). - tests/fm-wake-daily-rework.test.sh and tests/fm-wake-daily.test.sh pass. - tests/fm-test-run.test.sh, the shard 2 test that runs the real coverage check, now passes every coverage subtest. That includes "portable shard union, disjointness, and coverage guard hold" and "coverage guard bounds the unmeasured share and serial packing within twenty minutes", so the shard 2 failure was almost certainly this missing hint. - **Test coverage guard:** fixed directly by this change. - **Full suite:** a summary check that fails when any lane fails, so it should clear once the other two pass. - **Behavior portable parallel 2:** its coverage subtests pass locally, but tests/fm-test-run.test.sh still exits 1 here. Its "--jobs on a proven family" subtest runs tests/fm-session-lock-ancestry.test.sh, which fails with "not ok - the fixture hook never finished". That script also fails when run on its own on this host. This PR does not change it or the session-lock code (its diff against base is empty), so I treat it as a local host problem and made no change for it. I could not finish a full local run of the portable-parallel-2 lane: it was stopped at the 10-minute background limit, and that run had also started before the fix * no-mistakes(ci): I fixed the test failing in "Behavior portable serial 1". It failed because of today's date, not because of the PR's code. "Full suite" only fails when another lane fails, so it should clear once serial 1 passes. **What failed:** `tests/fm-wake-daily.test.sh` reported `not ok - incomplete day wrote a record`. This test came from the base branch and the PR doesn't change it. **Why:** the test collects records for a fixed day, `POST=2026-11-22`, and writes `data/wake/daily/2026-11-22.json`. At the end it runs the collector for today's date, which it expects to be rejected as not yet complete, and then asserts that no file exists for today. CI ran on 2026-11-22, so today was the same day as `POST`. The collector correctly rejected the run, but the file written earlier by the same test was already there, so the assertion failed. The test would fail on any day that matches one of its fixed fixture days. **Rule broken:** the "incomplete day wrote no record" check must only see what the incomplete-day run itself writes. That check, on that one path, is the only place that depends on it. **Fix:** in `tests/fm-wake-daily.test.sh`, one `rm -f "$CASE_HOME/data/wake/daily/$TODAY.json"` line (plus a comment) right before the incomplete-day call. The check still fails if the collector ever writes a record for an incomplete day. `tests/fm-wake-daily-rework.test.sh` doesn't use the current date, so nothing else needed the same change. No product code changed. **Verified on 2026-11-22, the date that broke CI:** - `tests/fm-wake-daily.test.sh` failed before the change with the same message as CI, and now passes (`ok: Wake daily collector`). - `tests/fm-wake-daily-rework.test.sh` still passes. - shellcheck reports only an info-level SC1091 note about sourcing `tests/lib.sh`, which was already there. I did not run the full serial 1 lane locally
Story 3.7: what novelty changed (top 10 per profile, before and after)Scored with the code on this branch over a fixture pool with fictional venues and acts (the real staging candidates are not published here). Before is story 3.6's scoring (novelty weight 0); after is the shipped config (novelty weight 0.25, performer 2 and event type 1 in the mean; score = fit x logistics x (1 + 0.25 x novelty), so novelty scales what fits and a barely-related new act cannot outrank a well-fitting repeat) over a fictional history in which Fixture Bands C and E and the rock type were billed at past candidates or lookout hits. Ties are broken by date. Out of scope here: the rating penalty, tuning (3.10), digest layout. Case
Christine
joint
Reading it: novelty now scales what fits (score = fit x logistics x (1 + 0.25 x novelty)), so candidates that fit nobody stay at 0 and a never-seen act is lifted in proportion to its fit. In Christine's list the never-seen Garden San Jose act (fit 0.36) takes #1 from the repeat act (0.419 to 0.452 vs. 0.419 unchanged), while the weakly-fitting Lodge Tahoe stays last among the scored. The unit tests pin the fit 0.01 against fit 0.15 case: the weak-fit new act scores below the well-fitting repeat act. Outings: the history is built from past candidates and past lookout hits only, because no outings store exists yet. Past outings (attendance and the backfill) join the history when stories 4.1 and 4.3 land. (Accepted by the captain's supervisor for 3.7.) |
Intent
I approve the wake question.
Approved first story 2 of the Wake initiative, the tracer bullet: a collector writes one day's outcome record. Full acceptance criteria are in ~/src/therealfirstmate/data/wake-value-model-revise/tickets/epic-wake-daily-record/tickets/story-collector-writes-one-day-s-outcome-record.md; follow them as revised in the value design pass (record lists merges with titles and times, delivered scouts, closed captain decisions with question and answer; one section per signal; missing input marked not measurable; incomplete day refused; byte-identical rerun; inputs untouched).
Context: the captain approved Wake on 2026-11-21 ("I approve the wake question"), a firstmate throughput retrospective: a deterministic daily collector plus a thin /wake judgment skill. Approved defaults: daily note written automatically as a file, weekly /wake with chat summary; no cost capture yet; Sunday weekly cutoff; one manual retro first; changes land only in this fork (github.com/clarsen/firstmate), nothing offered to upstream firstmate. The product-owner ticket tree is ~/src/therealfirstmate/data/wake-value-model-revise/tickets (initiative-wake.md, value-model.md, epic-wake-daily-record/).
The referenced story's acceptance criteria specify one record for a completed local day in the home's private data/wake/daily/ directory. It lists that day's merged ship tasks, titles, exact merge times, and PR or MR URLs; delivered scout reports, titles, and report paths; and closed captain decisions with their recorded question and answer. Outcomes are grouped under their project and retain task IDs. An item present in the ledger and backlog appears once. Repeated ledger status or lifecycle records are deduplicated, and coverage reports the number dropped. Missing or unreadable inputs cause affected counts to be marked not measurable with a reason and named source rather than zero; coverage also says sessions outside firstmate are invisible. A requested local day that has not ended is refused without writing a record. Repeating a run on unchanged inputs leaves the file byte-identical. A future story adds its own named section without changing existing sections; sections for stories not yet landed are absent. No input file is changed, and no output is written outside data/wake/. The collector does not change ledger, backlog, done-archive, or branch-outcome formats. It does not label a merge as value, claim a change is active, group merges into deliverables, shorten titles, or reword recorded answers. A done-archive entry with no kind or project is retained under "none recorded". History before 2026-11-21 comes from done-archive dates; from that day onward ledger lifecycle records provide merge time. A backlog-only merge has a day-level merge date, explicitly marked at that precision.
What Changed
bin/fm-wake-daily.py. It writes onefm-wake-daily.v1JSON record for a completed Pacific day todata/wake/daily/. The record lists merged ships (title, evidence, merge time and its precision), delivered scouts (report path), and closed captain decisions (exact question and answer), grouped by recorded project. Rows with no recorded project go undernone recorded, and rows with no recorded kind go underunclassified. The script refuses today and future dates, replaces the file atomically, and leaves it byte-identical when rerun on unchanged inputs. It writes nothing outsidedata/wake/.task.mergedtime is used, and each task is counted once. Ship and scout rows count only when they meet the Recently Landed delivery rule infm-landed-lib.sh. Acoveragesection names each input and whether it was readable, marks counts asnot_measurablewhen a source is missing, and reports how many duplicate ledger records were dropped and how many decisions on still-open tasks were not counted.docs/wake-daily.mdwith the record contract and registers it indocs/scripts.mdanddocs/documentation-audiences.json. Addstests/fm-wake-daily.test.shand a duration hint for it inbin/fm-test-run.sh.Risk Assessment
✅ Low: The last fix round adds a separate PR or MR URL field. The ship delivery check and ship evidence now use it, which matches the landed_record rule in bin/fm-landed-lib.sh (Bearings' pr_url check and its body-line local-note handling). Two new fixtures pin the change: a (done D) row with only an issue link now counts through the no-artifact fallback, and a row whose body records an fm-captain-hold resolution is excluded. The other changed files (test timing hint, docs index entries) are small and correct.
Testing
I ran the branch's own collector test, which passes; it covers the post-cutoff ledger cases with the clock pinned. I then drove the real CLI with the real clock against a throwaway synthetic home. That covered: one completed day's record with its content rules, a byte-identical rerun, unchanged inputs, refusal of today and a future day with no file written, and not-measurable coverage for a missing or corrupt input. Every scenario passed. The record is JSON with no UI, so the evidence is CLI transcripts. Post-cutoff days could not be run with the real clock, because today, 2026-11-21, is the first post-cutoff day and has not ended. The throwaway home was deleted afterwards and the worktree is clean.
Evidence: Live CLI transcript (real clock, throwaway home)
Evidence: Live driver script
Evidence: Targeted collector test log
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
bin/fm-wake-daily.py:233- The collector counts any completed(kind: ship)row dated on the day as a merged ship, whatever its completion verb, artifact, or hold provenance. The repo already defines which Done rows are real deliveries, inbin/fm-landed-lib.sh(landed_delivery/landed_record, used by Bearings and the fleet snapshot). Under that rule, a ship row is a delivery only when it is(merged D)with a PR URL, or(done D)with alocal mainnote, and it is never one when it carrieshold-kind: captain. A(reported D)ship row is also excluded.Concrete case:
- [x] done-pr-nondelivery - Closed without merge https://github.com/o/r/pull/5 (repo: firstmate) (kind: ship) (done 2026-07-12)is a closed-without-merge row (fixture in tests/fm-bearings-snapshot.test.sh:1770). On a pre-cutoff day, or a post-cutoff day with no ledger merge, the collector lists it undershipswithmerged_atset to that day and the unmerged PR as evidence.coverage.signals.ships.countis then inflated without any error. This contradicts the criterion that the record lists "that day's merged ship tasks".The same rule is missing for scouts at line 239-240. A reportless scout (Bearings excludes these; see tests/fm-bearings-snapshot.test.sh:1771) is reported as delivered with a guessed
data/<task>/report.mdpath, and the collector never checks that the file exists. The round-1 test-gap decision pinned that fallback, so for scouts, at least check the file exists.Fix: parse the completion verb (merged/reported/done), the
local mainnote andhold-kindin parse_rows. Apply the landed_delivery predicate before adding a backlog or archive ship (line 233) or a scout (line 239). Add a closed-without-merge fixture row to tests/fm-wake-daily.test.sh.🔧 Fix applied.
3 issues (2 warnings, 1 info) still open:
bin/fm-wake-daily.py:233- The collector counts any completed(kind: ship)row dated on the day as a merged ship, whatever its completion verb, artifact, or hold provenance. The repo already defines which Done rows are real deliveries, inbin/fm-landed-lib.sh(landed_delivery/landed_record, used by Bearings and the fleet snapshot). Under that rule, a ship row is a delivery only when it is(merged D)with a PR URL, or(done D)with alocal mainnote, and it is never one when it carrieshold-kind: captain. A(reported D)ship row is also excluded.Concrete case:
- [x] done-pr-nondelivery - Closed without merge https://github.com/o/r/pull/5 (repo: firstmate) (kind: ship) (done 2026-07-12)is a closed-without-merge row (fixture in tests/fm-bearings-snapshot.test.sh:1770). On a pre-cutoff day, or a post-cutoff day with no ledger merge, the collector lists it undershipswithmerged_atset to that day and the unmerged PR as evidence.coverage.signals.ships.countis then inflated without any error. This contradicts the criterion that the record lists "that day's merged ship tasks".The same rule is missing for scouts at line 239-240. A reportless scout (Bearings excludes these; see tests/fm-bearings-snapshot.test.sh:1771) is reported as delivered with a guessed
data/<task>/report.mdpath, and the collector never checks that the file exists. The round-1 test-gap decision pinned that fallback, so for scouts, at least check the file exists.Fix: parse the completion verb (merged/reported/done), the
local mainnote andhold-kindin parse_rows. Apply the landed_delivery predicate before adding a backlog or archive ship (line 233) or a scout (line 239). Add a closed-without-merge fixture row to tests/fm-wake-daily.test.sh.bin/fm-wake-daily.py:117-ship_deliveredwas added in round 3 (fix for wake-ship-delivery-rule). It says it mirrorslanded_record, but it treats any URL in the row as the PR artifact. Bearings only counts a link matching/pull/Naspr_url(bin/fm-fleet-snapshot.sh:518). So a(done D)ship row whose title carries a non-PR link and no other artifact gives different answers. Example:- [x] fix-9 - Fix https://github.com/o/r/issues/9 (repo: alpha) (kind: ship) (done D), closed by teardown with no PR and not local-only, so backlog_done_args passes nothing. Bearings counts it through the no-artifact fallback (bin/fm-landed-lib.sh:74-78). The collector drops it, because line 118 requiresrow["url"] is None, and nothing errors. This also contradicts docs/wake-daily.md:16 ("or a row with no artifact"). For a(merged D)row whose only link is an issue URL, the row is still counted, but line 260 reports that issue URL as the ship's PR evidence. Fix: parse a separatepr_url(the first URL matching/pull/\d+) in parse_rows. Use it inship_deliveredfor both the merged artifact check and the fallback's null check, so it matches the shared rule. Add a fixture row with an issue link and(done D). No other site is affected: the scout and unclassified paths do not use this predicate.tests/fm-wake-daily.test.sh:79- This is a round-3 test that ships with the code it checks. Thelocal-shipfixture putslocal mainat the end of the title. In production,tasks-axi done --note "local main"(which teardown calls at bin/fm-teardown.sh:1878) writes the note as an indented body line under the row. I confirmed this by running tasks-axi on a temp backlog: the note lands on the line below- [x] id - Title (...) (done D). So the production path, the body-line branch ofhas_local_note(bin/fm-wake-daily.py:103-109), including theResolution recorded by fm-captain-hold.exclusion, is never exercised. If that branch broke, every local-only ship would silently drop out ofships. Fix: add a(done D)ship fixture with alocal mainbody line, plus one whose body also hasResolution recorded by fm-captain-hold.(which must be excluded). The oracle is bin/fm-fleet-snapshot.sh:545-550.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-wake-daily.test.sh(exit 0): runs the real CLImain()with the clock pinned, on fixture days on both sides of the ledger cutoffbash $EVIDENCE/live-drive.sh $PWD: runspython3 bin/fm-wake-daily.py 2026-11-20 --home <throwaway home>with the real clock (2026-11-21T20:16 PST)Ran it again and compared sha256, inode and mtime of the output fileTook a sha256 snapshot of every file outside data/wake/ before and after the runsfm-wake-daily.py 2026-11-21andfm-wake-daily.py 2026-11-22: checked they are refused and write no recordMoved data/backlog.md away and reran: checked coverage.signals and coverage.inputsReplaced data/captain-questions.json with invalid JSON and reran: checked coverage.signals.decisions✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.