Skip to content

feat(bin): add Wake daily outcome collector - #50

Merged
clarsen merged 6 commits into
mainfrom
fm/wake-collector-tracer
Nov 22, 2026
Merged

clarsen merged 6 commits into
mainfrom
fm/wake-collector-tracer

Conversation

@clarsen

@clarsen clarsen commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

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

  • Adds bin/fm-wake-daily.py. It writes one fm-wake-daily.v1 JSON record for a completed Pacific day to data/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 under none recorded, and rows with no recorded kind go under unclassified. The script refuses today and future dates, replaces the file atomically, and leaves it byte-identical when rerun on unchanged inputs. It writes nothing outside data/wake/.
  • Merge time comes from done-archive and backlog dates (day precision) before 2026-11-21. From then on, the ledger's task.merged time is used, and each task is counted once. Ship and scout rows count only when they meet the Recently Landed delivery rule in fm-landed-lib.sh. A coverage section names each input and whether it was readable, marks counts as not_measurable when a source is missing, and reports how many duplicate ledger records were dropped and how many decisions on still-open tasks were not counted.
  • Adds docs/wake-daily.md with the record contract and registers it in docs/scripts.md and docs/documentation-audiences.json. Adds tests/fm-wake-daily.test.sh and a duration hint for it in bin/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.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Captain runs the collector for completed day 2026-11-20 in a throwaway home: one JSON record in data/wake/daily lists merged ships (PR URLs, titles unchanged, day precision), the scout report path, an… ✅ pass live live-cli-transcript.txt S1
A ship present in both backlog and done-archive appears once; a closed-without-merge ship and a ship from another day are left out; an archive row with no kind or project lands under 'none recorded' ✅ pass live live-cli-transcript.txt S1 (dup-ship listed once, closed-nomerge and other-day absent, mystery under none recorded)
Rerunning on unchanged inputs leaves the record byte-identical (same sha256, inode and mtime) ✅ pass live live-cli-transcript.txt S2
The collector changes no input file and writes only under data/wake ✅ pass live live-cli-transcript.txt S3: sha256 snapshot identical
Adversarial: asking for today (2026-11-21) or a future day is refused with exit 2 and writes no record ✅ pass live live-cli-transcript.txt S4
Adversarial: an absent backlog or a corrupt captain question store makes the affected counts not_measurable, with the source and reason named, instead of zero ✅ pass live live-cli-transcript.txt S5, S6
Post-cutoff day (2026-11-22): ledger task.merged times at second precision, repeated ledger records dropped and counted, a missing or invalid ledger marked not measurable ✅ pass live tests/fm-wake-daily.test.sh exit 0 (test-fm-wake-daily.log)
Evidence: Live CLI transcript (real clock, throwaway home)
== real clock: 2026-11-21T20:16:55-08:00
== S1 completed pre-cutoff day writes record
$ fm-wake-daily.py 2026-11-20
~/tmp/fm-wake-live.F6ddCg/data/wake/daily/2026-11-20.json
exit=0
{
  "contributions": {
    "projects": [
      {
        "decisions": [
          {
            "answer": "Pacific, as the captain lives there.",
            "closed_on": "2026-11-20",
            "date_source": "task close date, not answer time",
            "evidence": "data/backlog.md#ship-pr:decision:1",
            "question": "Pacific or UTC days?",
            "task": "ship-pr",
            "time_precision": "day",
            "title": "Add wake collector"
          }
        ],
        "project": "firstmate",
        "scouts": [
          {
            "evidence": "data/scout-x/report.md",
            "reported_on": "2026-11-20",
            "task": "scout-x",
            "title": "Investigate ledger shape"
          }
        ],
        "ships": [
          {
            "evidence": "https://github.com/o/r/pull/13",
            "merged_at": "2026-11-20",
            "task": "dup-ship",
            "time_precision": "day",
            "title": "Same task in both files"
          },
          {
            "evidence": "https://github.com/o/r/pull/12",
            "merged_at": "2026-11-20",
            "task": "ship-pr",
            "time_precision": "day",
            "title": "Add wake collector"
          }
        ],
        "unclassified": []
      },
      {
        "decisions": [
          {
            "answer": "I approve the wake question.",
            "closed_at": "2026-11-20T19:15:00Z",
            "date_source": "captain close time",
            "evidence": "data/captain-questions.json#q-20261120-00000001",
            "question": "Approve Wake?",
            "task": "q-20261120-00000001",
            "time_precision": "second",
            "title": "Approve Wake?"
          }
        ],
        "project": "none recorded",
        "scouts": [],
        "ships": [],
        "unclassified": [
          {
            "evidence": "data/done-archive.md#mystery",
            "recorded_on": "2026-11-20",
            "task": "mystery",
            "title": "An old row with no kind or project"
          }
        ]
      }
    ]
  },
  "coverage": {
    "inputs": {
      "~/tmp/fm-wake-live.F6ddCg/data/backlog.md": {
        "status": "readable"
      },
      "~/tmp/fm-wake-live.F6ddCg/data/captain-questions.json": {
        "status": "readable"
      },
      "~/tmp/fm-wake-live.F6ddCg/data/done-archive.md": {
        "status": "readable"
      }
    },
    "ledger_duplicates_dropped": 0,
    "limits": [
      "Sessions outside firstmate are invisible.",
      "Backlog-only dates are day-level; backlog decisions are dated by their task's close date.",
      "A merge is a contribution, not proof of production value."
    ],
    "merge_time_source": "done-archive",
    "signals": {
      "decisions": {
        "count": 2,
        "status": "measured"
      },
      "scouts": {
        "count": 1,
        "status": "measured"
      },
      "ships": {
        "count": 2,
        "status": "measured"
      }
    },
    "uncounted_decisions": {
      "count": 1,
      "reason": "answer time unknown (task still open)"
    }
  },
  "day": "2026-11-20",
  "schema": "fm-wake-daily.v1",
  "timezone": "America/Los_Angeles"
}
== S2 rerun is byte-identical (mtime/inode preserved)
IDENTICAL sha=5b4b1dd93609bf497011aa568f8fca31bb32837cf9b3bc3ae2bc183844c31025  - inode/mtime=3682198 1795321015
== S3 inputs untouched and nothing written outside data/wake
inputs unchanged
newer-than-inputs: ./data/done-archive.md
newer-than-inputs: ./data/captain-questions.json
newer-than-inputs: ./data/wake/daily/2026-11-20.json
newer-than-inputs: ./state/fleet-ledger.jsonl
== S4 incomplete day refused (today and future), no record
$ fm-wake-daily.py 2026-11-21
usage: fm-wake-daily.py [-h] [--home HOME] day
fm-wake-daily.py: error: day 2026-11-21 is not complete in America/Los_Angeles
exit=2
$ fm-wake-daily.py 2026-11-22
usage: fm-wake-daily.py [-h] [--home HOME] day
fm-wake-daily.py: error: day 2026-11-22 is not complete in America/Los_Angeles
exit=2
2026-11-20.json
== S5 missing backlog -> not measurable with reason and source, not zero
{
  "decisions": {
    "count": null,
    "inputs": [
      "~/tmp/fm-wake-live.F6ddCg/data/backlog.md"
    ],
    "observed": 1,
    "reason": "missing or unreadable input",
    "status": "not_measurable"
  },
  "scouts": {
    "count": null,
    "inputs": [
      "~/tmp/fm-wake-live.F6ddCg/data/backlog.md"
    ],
    "observed": 1,
    "reason": "missing or unreadable input",
    "status": "not_measurable"
  },
  "ships": {
    "count": null,
    "inputs": [
      "~/tmp/fm-wake-live.F6ddCg/data/backlog.md"
    ],
    "observed": 1,
    "reason": "missing or unreadable input",
    "status": "not_measurable"
  }
}
{
  "HOME/data/backlog.md": {
    "reason": "absent",
    "status": "not_measurable"
  },
  "HOME/data/captain-questions.json": {
    "status": "readable"
  },
  "HOME/data/done-archive.md": {
    "status": "readable"
  }
}
== S6 corrupt captain-question store -> decisions not measurable
{"count":null,"inputs":["~/tmp/fm-wake-live.F6ddCg/data/captain-questions.json"],"observed":1,"reason":"missing or unreadable input","status":"not_measurable"}
Evidence: Live driver script
#!/usr/bin/env bash
# Drive bin/fm-wake-daily.py with the real system clock against a disposable synthetic home.
set -u
WT=$1; H=$(mktemp -d "${TMPDIR:-/tmp}/fm-wake-live.XXXXXX"); trap 'rm -rf "$H"' EXIT
mkdir -p "$H/data" "$H/state"
D=2026-11-20
cat > "$H/data/backlog.md" <<EOF
## In flight
- [ ] open-task - Still working (repo: alpha) (kind: ship) (since $D)
  Resolution mode: answered

  Captain decision:
  Keep going? -> Yes, keep going.

## Done
- [x] ship-pr - Add wake collector https://github.com/o/r/pull/12 (repo: firstmate) (kind: ship) (merged $D)
  Resolution mode: answered

  Captain decision:
  Pacific or UTC days? -> Pacific, as the captain lives there.
- [x] dup-ship - Same task in both files https://github.com/o/r/pull/13 (repo: firstmate) (kind: ship) (merged $D)
EOF
cat > "$H/data/done-archive.md" <<EOF
## Archived $D
- [x] dup-ship - Same task in both files https://github.com/o/r/pull/13 (repo: firstmate) (kind: ship) (merged $D)
- [x] scout-x - Investigate ledger shape data/scout-x/report.md (repo: firstmate) (kind: scout) (reported $D)
- [x] mystery - An old row with no kind or project (done $D)
- [x] closed-nomerge - Closed without merge https://github.com/o/r/pull/14 (repo: firstmate) (kind: ship) (done $D)
- [x] other-day - Different day ship https://github.com/o/r/pull/15 (repo: firstmate) (kind: ship) (merged 2026-11-19)
EOF
echo '{"v":1,"ts":1,"event":"task.merged","task":"x"}' > "$H/state/fleet-ledger.jsonl"
cat > "$H/data/captain-questions.json" <<'EOF'
{"schema":"fm-captain-questions.v1","questions":[{"id":"q-20261120-00000001","question":"Approve Wake?","opened":"2026-11-20T17:00:00Z","status":"x","last_updated":"2026-11-20T17:00:00Z","links":[],"state":"closed","closed_by_captain":{"at":"2026-11-20T19:15:00Z","source":"captain-chat","words":"I approve the wake question.","evidence":"tmp/w.txt"}}]}
EOF
run() { echo "\$ fm-wake-daily.py $*"; python3 "$WT/bin/fm-wake-daily.py" "$@" --home "$H"; echo "exit=$?"; }
snap() { (cd "$H" && find . -type f ! -path './data/wake/*' -print0 | sort -z | xargs -0 sha256sum); }
echo "== real clock: $(TZ=America/Los_Angeles date -Iseconds)"
snap > "$H/../wake-before.$$"
echo "== S1 completed pre-cutoff day writes record"
run $D
cat "$H/data/wake/daily/$D.json"
echo "== S2 rerun is byte-identical (mtime/inode preserved)"
s1=$(sha256sum < "$H/data/wake/daily/$D.json"); st1=$(stat -c '%i %Y' "$H/data/wake/daily/$D.json"); sleep 1
run $D >/dev/null
s2=$(sha256sum < "$H/data/wake/daily/$D.json"); st2=$(stat -c '%i %Y' "$H/data/wake/daily/$D.json")
[ "$s1" = "$s2" ] && [ "$st1" = "$st2" ] && echo "IDENTICAL sha=$s1 inode/mtime=$st1" || echo "DIFFERENT"
echo "== S3 inputs untouched and nothing written outside data/wake"
snap > "$H/../wake-after.$$"; diff "$H/../wake-before.$$" "$H/../wake-after.$$" && echo "inputs unchanged"; rm -f "$H/../wake-before.$$" "$H/../wake-after.$$"
(cd "$H" && find . -newer data/backlog.md -type f) | sed 's/^/newer-than-inputs: /'
echo "== S4 incomplete day refused (today and future), no record"
run 2026-11-21; run 2026-11-22
ls "$H/data/wake/daily/"
echo "== S5 missing backlog -> not measurable with reason and source, not zero"
mv "$H/data/backlog.md" "$H/backlog.bak"; run $D >/dev/null
jq '.coverage.signals, (.coverage.inputs | with_entries(.key |= sub(".*/fm-wake-live\\.[^/]+/"; "HOME/")))' "$H/data/wake/daily/$D.json"
mv "$H/backlog.bak" "$H/data/backlog.md"
echo "== S6 corrupt captain-question store -> decisions not measurable"
cp "$H/data/captain-questions.json" "$H/q.bak"; echo '{bad' > "$H/data/captain-questions.json"; run $D >/dev/null
jq -c '.coverage.signals.decisions' "$H/data/wake/daily/$D.json"
cp "$H/q.bak" "$H/data/captain-questions.json"
Evidence: Targeted collector test log
ok: Wake daily collector

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, in bin/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 a local main note, and it is never one when it carries hold-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 under ships with merged_at set to that day and the unmerged PR as evidence. coverage.signals.ships.count is 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/&lt;task&gt;/report.md path, 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 main note and hold-kind in 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, in bin/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 a local main note, and it is never one when it carries hold-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 under ships with merged_at set to that day and the unmerged PR as evidence. coverage.signals.ships.count is 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/&lt;task&gt;/report.md path, 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 main note and hold-kind in 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_delivered was added in round 3 (fix for wake-ship-delivery-rule). It says it mirrors landed_record, but it treats any URL in the row as the PR artifact. Bearings only counts a link matching /pull/N as pr_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 requires row[&#34;url&#34;] 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 separate pr_url (the first URL matching /pull/\d+) in parse_rows. Use it in ship_delivered for 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. The local-ship fixture puts local main at the end of the title. In production, tasks-axi done --note &#34;local main&#34; (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 of has_local_note (bin/fm-wake-daily.py:103-109), including the Resolution recorded by fm-captain-hold. exclusion, is never exercised. If that branch broke, every local-only ship would silently drop out of ships. Fix: add a (done D) ship fixture with a local main body line, plus one whose body also has Resolution 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.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Captain runs the collector for completed day 2026-11-20 in a throwaway home: one JSON record in data/wake/daily lists merged ships (PR URLs, titles unchanged, day precision), the scout report path, an… ✅ pass live live-cli-transcript.txt S1
A ship present in both backlog and done-archive appears once; a closed-without-merge ship and a ship from another day are left out; an archive row with no kind or project lands under 'none recorded' ✅ pass live live-cli-transcript.txt S1 (dup-ship listed once, closed-nomerge and other-day absent, mystery under none recorded)
Rerunning on unchanged inputs leaves the record byte-identical (same sha256, inode and mtime) ✅ pass live live-cli-transcript.txt S2
The collector changes no input file and writes only under data/wake ✅ pass live live-cli-transcript.txt S3: sha256 snapshot identical
Adversarial: asking for today (2026-11-21) or a future day is refused with exit 2 and writes no record ✅ pass live live-cli-transcript.txt S4
Adversarial: an absent backlog or a corrupt captain question store makes the affected counts not_measurable, with the source and reason named, instead of zero ✅ pass live live-cli-transcript.txt S5, S6
Post-cutoff day (2026-11-22): ledger task.merged times at second precision, repeated ledger records dropped and counted, a missing or invalid ledger marked not measurable ✅ pass live tests/fm-wake-daily.test.sh exit 0 (test-fm-wake-daily.log)
  • bash tests/fm-wake-daily.test.sh (exit 0): runs the real CLI main() with the clock pinned, on fixture days on both sides of the ledger cutoff
  • bash $EVIDENCE/live-drive.sh $PWD: runs python3 bin/fm-wake-daily.py 2026-11-20 --home &lt;throwaway home&gt; with the real clock (2026-11-21T20:16 PST)
  • Ran it again and compared sha256, inode and mtime of the output file
  • Took a sha256 snapshot of every file outside data/wake/ before and after the runs
  • fm-wake-daily.py 2026-11-21 and fm-wake-daily.py 2026-11-22: checked they are refused and write no record
  • Moved data/backlog.md away and reran: checked coverage.signals and coverage.inputs
  • Replaced 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.

@clarsen
clarsen merged commit 2dce9d8 into main Nov 22, 2026
25 checks passed
clarsen added a commit that referenced this pull request Nov 22, 2026
…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
clarsen added a commit that referenced this pull request Nov 22, 2026
…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
clarsen added a commit that referenced this pull request Nov 22, 2026
* 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
@clarsen

clarsen commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

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

# Before (novelty off) score After (story 3.7) score novelty
1 Fixture Hall Oakland / Fri / $45 0.419 Fixture Hall Oakland / Fri / $45 0.489 0.667
2 Fixture Pier Santa Cruz / Sat / $60 0.293 Fixture Pier Santa Cruz / Sat / $60 0.367 1.000
3 Fixture Fields Oakland festival / Sat / $150 0.282 Fixture Dome Las Vegas (destination) / Sat / $180 0.314 1.000
4 Fixture Dome Las Vegas (destination) / Sat / $180 0.251 Fixture Fields Oakland festival / Sat / $150 0.298 0.222
5 Fixture Barn Napa / Tue / $35 0.230 Fixture Barn Napa / Tue / $35 0.249 0.333
6 Fixture Arena Sacramento / Sat / $120 0.103 Fixture Arena Sacramento / Sat / $120 0.120 0.667
7 Fixture Garden San Jose / Thu / $55 0.000 Fixture Garden San Jose / Thu / $55 0.000 0.000
8 Fixture Hall Oakland / Fri / $40 (repeat act) 0.000 Fixture Hall Oakland / Fri / $40 (repeat act) 0.000 0.000
9 Fixture Lodge Tahoe / Fri / $250 0.000 Fixture Lodge Tahoe / Fri / $250 0.000 0.000
10 Fixture Barn Santa Rosa / Sun / no price 0.000 Fixture Barn Santa Rosa / Sun / no price 0.000 0.000

Christine

# Before (novelty off) score After (story 3.7) score novelty
1 Fixture Hall Oakland / Fri / $40 (repeat act) 0.419 Fixture Garden San Jose / Thu / $55 0.452 1.000
2 Fixture Fields Oakland festival / Sat / $150 0.363 Fixture Hall Oakland / Fri / $40 (repeat act) 0.419 0.000
3 Fixture Garden San Jose / Thu / $55 0.361 Fixture Fields Oakland festival / Sat / $150 0.383 0.222
4 Fixture Dome Las Vegas (destination) / Sat / $180 0.251 Fixture Dome Las Vegas (destination) / Sat / $180 0.314 1.000
5 Fixture Barn Napa / Tue / $35 0.230 Fixture Barn Napa / Tue / $35 0.249 0.333
6 Fixture Barn Santa Rosa / Sun / no price 0.186 Fixture Barn Santa Rosa / Sun / no price 0.233 1.000
7 Fixture Lodge Tahoe / Fri / $250 0.062 Fixture Lodge Tahoe / Fri / $250 0.073 0.667
8 Fixture Hall Oakland / Fri / $45 0.000 Fixture Hall Oakland / Fri / $45 0.000 0.000
9 Fixture Arena Sacramento / Sat / $120 0.000 Fixture Arena Sacramento / Sat / $120 0.000 0.000
10 Fixture Pier Santa Cruz / Sat / $60 0.000 Fixture Pier Santa Cruz / Sat / $60 0.000 0.000

joint

# Before (novelty off) score After (story 3.7) score novelty
1 Fixture Fields Oakland festival / Sat / $150 0.320 Fixture Fields Oakland festival / Sat / $150 0.338 0.222
2 Fixture Dome Las Vegas (destination) / Sat / $180 0.251 Fixture Dome Las Vegas (destination) / Sat / $180 0.314 1.000
3 Fixture Barn Napa / Tue / $35 0.230 Fixture Barn Napa / Tue / $35 0.249 0.333
4 Fixture Garden San Jose / Thu / $55 0.000 Fixture Garden San Jose / Thu / $55 0.000 0.000
5 Fixture Hall Oakland / Fri / $40 (repeat act) 0.000 Fixture Hall Oakland / Fri / $40 (repeat act) 0.000 0.000
6 Fixture Hall Oakland / Fri / $45 0.000 Fixture Hall Oakland / Fri / $45 0.000 0.000
7 Fixture Lodge Tahoe / Fri / $250 0.000 Fixture Lodge Tahoe / Fri / $250 0.000 0.000
8 Fixture Arena Sacramento / Sat / $120 0.000 Fixture Arena Sacramento / Sat / $120 0.000 0.000
9 Fixture Pier Santa Cruz / Sat / $60 0.000 Fixture Pier Santa Cruz / Sat / $60 0.000 0.000
10 Fixture Barn Santa Rosa / Sun / no price 0.000 Fixture Barn Santa Rosa / Sun / no price 0.000 0.000

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.)

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.

1 participant