Skip to content

feat(prototype): add enforceable question-first prototype lifecycle - #4

Merged
GoldenSis merged 3 commits into
mainfrom
fm/prototype-lifecycle-p1
Jul 24, 2026
Merged

GoldenSis merged 3 commits into
mainfrom
fm/prototype-lifecycle-p1

Conversation

@GoldenSis

Copy link
Copy Markdown
Owner

Intent

Implement the safe, useful conclusions from data/video-review-n0vh/report.md as the smallest deep design that makes question-first prototypes a distinct, enforceable lifecycle inside Firstmate existing scout, report, decision-hold, promotion, and delivery paths. Require one explicit uncertainty before start and exactly one ui or logic-state class; default to an isolated copy with synthetic or minimized fixtures, no persistence, and no external side effects; fail closed before live NAS data, production accounts or routes, remote-access policy, DNS/MX/email, billing, credentials, or recovery material without any worker convenience bypass. Preserve durable assumptions, alternatives, observed evidence, chosen and rejected decisions, unresolved risks, and expiry or disposal; keep prototype code as evidence rather than implementation authority; require a clean promotion that carries only the validated decision through normal tests and review, rejects stale scratch state, and turns reproduced logic failures into regression tests. Keep AGENTS.md minimal, put conditional policy in one precise agent-only skill owner, exact mechanics and schemas in script help, stay tool-neutral across all supported harnesses and backends, add focused positive and fail-closed coverage, preserve unrelated work, and do not install Wayfinder or add a second tracker or orchestration vocabulary.

What Changed

  • Added bin/fm-prototype.sh and the agent-only prototype-lifecycle skill, making a question-first prototype an ordinary scout subtype recorded in a fm-prototype.v1 manifest at data/<id>/prototype.json: one explicit registered question, exactly one ui or logic-state class, and an immutable safe envelope (synthetic or minimized fixtures, no persistence, no external side effects, sensitive live access forbidden with no bypass flag). The script owns registration, worktree binding, evidence completion, verification, and promotion preparation.
  • Wired the lifecycle into the existing seams: fm-brief.sh --scout --prototype <class> --question <q> registers the manifest and adds the skill trigger plus an evidence-gate definition of done; fm-spawn.sh validates registration before creating an endpoint and binds the baseline HEAD and ignored-file snapshot after every backend converges on the isolated worktree but before harness launch; fm-teardown.sh requires verify for a marked scout; and fm-promote.sh refuses promotion until promotion-verify confirms completed evidence, the chosen decision, its regression-test obligation, and a residue-free worktree at the exact baseline, then emits ship instructions that reimplement the decision afresh.
  • Added tests/fm-prototype-lifecycle.test.sh (positive and fail-closed coverage for evidence, question drift, idempotency, immutable safe defaults, promotion residue, regression obligation, and the tool-neutral spawn/teardown seams), documented the lifecycle in AGENTS.md, docs/architecture.md, docs/configuration.md, and docs/scripts.md, and added a herdr_lab_environment_ready gate so the real-Herdr suites skip with an explicit reason on machines with no running default Herdr session instead of failing.

Risk Assessment

✅ Low: A well-bounded, additive lifecycle feature with strong fail-closed gating and thorough tests; only two minor, non-breaking robustness observations, both in the happy-path-safe range.

Testing

Baseline suite plus targeted suites for every changed script pass, and the full 84-suite run is green with the previously failing Herdr e2e suites now skipping cleanly on a machine with no running default Herdr session. Beyond unit coverage I drove the whole lifecycle end-to-end through the real scripts against a throwaway project, throwaway firstmate home, and an isolated tmux server: intake refuses a missing question, an unsupported class, and a non-investigation task; the safe envelope is persisted; a real tmux-backed dispatch binds the clean baseline of the isolated copy and the worker window visibly shows the prototype contract; cleanup is refused before evidence exists and again after a post-completion report edit; hand-loosening the sensitive-access or persistence values is rejected; promotion is refused while scratch commits or new ignored residue survive and accepted only from a clean copy at the registered baseline, with promotion emitting ship instructions that carry the validated decision and the regression-test obligation. The change is CLI and agent-policy only with no rendered UI surface, so reviewer-visible evidence is the terminal transcript and captured worker window rather than screenshots. All testing artifacts were cleaned up afterwards (worktree pool, tmux socket, task temp) and the working tree is unchanged.

Evidence: End-to-end prototype lifecycle CLI transcript (16 steps, all as required)


========== 1. Intake: a prototype needs one uncertainty and exactly one supported class ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-brief.sh bad1 widget-scheduler --scout --prototype logic-state
  error: --prototype requires --question with one explicit uncertainty
  [exit 1 - refused, as required]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-brief.sh bad2 widget-scheduler --scout --prototype backend-shape --question Does retrying a cancelled reschedule duplicate the completed transition?
  fm-prototype: prototype class must be exactly ui or logic-state
  [exit 1 - refused, as required]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-brief.sh bad3 widget-scheduler --prototype logic-state --question Does retrying a cancelled reschedule duplicate the completed transition?
  error: --prototype requires --scout
  [exit 1 - refused, as required]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-brief.sh widgetsched1 widget-scheduler --scout --prototype logic-state --question Does retrying a cancelled reschedule duplicate the completed transition?
  scaffolded: /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/brief.md (scout; replace {TASK})
  [exit 0 - accepted]


========== 2. The registered safe envelope is written for the task ==========

$ jq . '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json'
  {
    "schema": "fm-prototype.v1",
    "class": "logic-state",
    "question": "Does retrying a cancelled reschedule duplicate the completed transition?",
    "safety": {
      "fixtures": "synthetic-or-minimized",
      "persistence": "none",
      "external_side_effects": "none",
      "sensitive_live_access": "forbidden"
    },
    "binding": null,
    "evidence": null,
    "promotion": null
  }


========== 3. The worker's instructions carry the prototype contract ==========

$ sed -n '/# Question-first prototype/,/^$/p' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/brief.md'
  # Question-first prototype
  This scout is a registered `logic-state` prototype for one uncertainty: Does retrying a cancelled reschedule duplicate the completed transition?
  Before any experiment work, read and follow `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/prototype-lifecycle/SKILL.md`.
  The prototype lifecycle has no sensitive exception flag and must stop before live sensitive systems.
  `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help` owns the exact evidence and lifecycle commands.
  

$ grep -n 'prototype evidence gate' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/brief.md'
  48:Before the shared decision inventory, pass the registered prototype evidence gate described by `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help`.


========== 4. There is no convenience bypass anywhere in the lifecycle tool ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help | sed -n '23,29p'
  The safe values are immutable. There is deliberately no allow-sensitive,
  force, assertion, or environment-variable bypass. Live NAS data, production
  accounts/routes, tailnet or remote-access policy, DNS/MX/email control planes,
  subscriptions/billing, credentials, and recovery material stay outside this
  lifecycle and require an existing higher-authority decision route plus a safe
  rescope before any prototype can continue.
  

$ grep -Eic -- 'allow.sensitive|--force|FM_PROTOTYPE_ALLOW|allow_live|attest' '/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh'
  2


========== 5. A registered prototype cannot be dispatched as an ordinary ship task ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-spawn.sh widgetsched1 /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/projects/widget-scheduler cat __BRIEF__ --backend tmux
  error: registered prototype widgetsched1 must spawn with --scout
  [exit 1 - refused, as required]


========== 6. Real dispatch on the tmux backend binds the clean pre-experiment baseline ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-spawn.sh widgetsched1 /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/projects/widget-scheduler cat __BRIEF__ --scout --backend tmux
  warn: no registry at /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/projects.md; defaulting widget-scheduler to no-mistakes off
  spawned widgetsched1 harness=cat kind=scout mode=no-mistakes yolo=off window=firstmate:fm-widgetsched1 worktree=/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  [exit 0 - accepted]

$ cat '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/state/widgetsched1.meta'
  window=firstmate:fm-widgetsched1
  worktree=/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  project=/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T/proto-e2e.i57itF/projects/widget-scheduler
  harness=cat
  kind=scout
  mode=no-mistakes
  yolo=off
  tasktmp=/tmp/fm-widgetsched1
  model=default
  effort=default

$ jq '.binding' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json'
  {
    "worktree": "/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler",
    "baseline_head": "47fc9e0ee056c15da84c01c03c5a91607d6b6076",
    "ignored_snapshot": []
  }

  (project HEAD the isolated copy started from: 47fc9e0ee056c15da84c01c03c5a91607d6b6076)
  (isolated copy really is a separate worktree of the project: /Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler)


========== 7. The dispatched worker window really shows the prototype contract ==========

$ tmux capture-pane -p -t firstmate:fm-widgetsched1   (worker window scrollback)
  # Question-first prototype
  This scout is a registered `logic-state` prototype for one uncertainty: Does ret
  rying a cancelled reschedule duplicate the completed transition?
  Before any experiment work, read and follow `/Users/arnaudchretien/.no-mistakes/
  worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/prototype-lifec
  ycle/SKILL.md`.
  The prototype lifecycle has no sensitive exception flag and must stop before liv
  e sensitive systems.
  `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G
  4F5S6/bin/fm-prototype.sh --help` owns the exact evidence and lifecycle commands
  ...


========== 8. Cleanup of the investigation is refused before its evidence lands ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-teardown.sh widgetsched1
  ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ●  WATCHER DOWN - SUPERVISION IS OFF
  ●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
  ●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
  ●  This is a supervision warning only; the guarded operation WILL still run.
  ●  resume supervision with bin/fm-watch-arm.sh as its own Claude Code background task, never shell &.
  ●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  REFUSED: scout task widgetsched1 has no report at /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/report.md.
  The report is the work product. Have the crewmate write it, or use --force after explicit discard approval.
  [exit 1 - refused, as required]


========== 9. An incomplete or drifting report is refused ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh complete widgetsched1
  fm-prototype: report must contain exactly one 'Alternatives' prototype evidence section
  [exit 1 - refused, as required]


========== 10. The full durable evidence record is accepted ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh complete widgetsched1
  completed widgetsched1
  [exit 0 - accepted]

$ jq '.evidence' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json'
  {
    "report_sha256": "bd39297087c4f33b78c5069db892b0917716b5c8472b9f0b409c32e024f1b2cc",
    "chosen_decision": "Guard the retry with a completed-transition ledger keyed by job id.",
    "regression_test_required": true,
    "regression_test_reason": "replay of a cancelled reschedule duplicated the completed transition"
  }

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh decision widgetsched1
  Guard the retry with a completed-transition ledger keyed by job id.

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh regression-obligation widgetsched1
  required: replay of a cancelled reschedule duplicated the completed transition


========== 11. A report quietly edited after completion blocks cleanup of the evidence ==========
  complete: widgetsched1 decision inventory reviewed

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-teardown.sh widgetsched1
  WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
  fm-prototype: prototype report changed after evidence completion
  REFUSED: prototype scout widgetsched1 has not passed its durable evidence gate.
  Complete and verify the question-first prototype evidence before teardown.
  [exit 1 - refused, as required]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh verify widgetsched1
  verified widgetsched1
  [exit 0 - accepted]


========== 12. Loosening the sensitive-access envelope by hand is rejected ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh verify widgetsched1
  fm-prototype: invalid or unsafe prototype manifest: /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json
  [exit 1 - refused, as required]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh verify widgetsched1
  fm-prototype: invalid or unsafe prototype manifest: /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json
  [exit 1 - refused, as required]


========== 13. Promotion is refused while experiment scratch survives in the isolated copy ==========

$ git -C '/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler' log --oneline -1
  9b8707d scratch: retry duplication harness

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh prepare-promotion widgetsched1 /Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  fm-prototype: prototype worktree is not at its registered baseline HEAD
  [exit 1 - refused, as required]


========== 14. Dropping the scratch branch is not enough: ignored experiment residue still blocks ==========

$ git -C '/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler' status --porcelain=v1 --untracked-files=all; echo '(no tracked residue)'
  (no tracked residue)

$ git -C '/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler' ls-files --others --ignored --exclude-standard
  node_modules/experiment.log

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh prepare-promotion widgetsched1 /Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  fm-prototype: prototype worktree ignored files differ from the pre-launch snapshot
  [exit 1 - refused, as required]


========== 15. A genuinely clean isolated copy at the registered baseline is accepted ==========

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh prepare-promotion widgetsched1 /Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  promotion prepared widgetsched1
  [exit 0 - accepted]

$ /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh prepare-promotion widgetsched1 /Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler
  promotion prepared widgetsched1
  [exit 0 - accepted]

$ jq '.promotion' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/prototype.json'
  {
    "prepared_head": "47fc9e0ee056c15da84c01c03c5a91607d6b6076",
    "report_sha256": "bd39297087c4f33b78c5069db892b0917716b5c8472b9f0b409c32e024f1b2cc",
    "decision_sha256": "9aa6345b147e9f004745912a612b0af6a837de1bd8a07000c7ab5a83ab4f9edc",
    "regression_test_required": true
  }


========== 16. Authorized promotion carries the validated decision and the regression obligation ==========

$ env FM_ROOT_OVERRIDE=/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6 /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-promote.sh widgetsched1
  WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
  promoted widgetsched1 to ship (teardown protection restored)
  next: FM_HOME=/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home bin/fm-send.sh fm-widgetsched1 '<ship instructions: the prototype worktree is clean at its registered baseline; create branch fm/widgetsched1; read the validated decision with FM_HOME=/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh decision widgetsched1 and implement it afresh; read FM_HOME=/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home /Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh regression-obligation widgetsched1 and add the required regression test when it says required; do not restore scratch code, fixtures, credentials, debug artifacts, or ignored experiment state; commit; follow the selected delivery path with its normal tests and review>'
  [exit 0 - accepted]

$ grep -c '^kind=ship' '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/state/widgetsched1.meta'
  1


========== RESULT ==========
every step behaved as the lifecycle requires
Evidence: Key lifecycle refusals and acceptances (excerpt)
$ fm-brief.sh bad1 widget-scheduler --scout --prototype logic-state
error: --prototype requires --question with one explicit uncertainty
$ fm-brief.sh bad2 ... --prototype backend-shape --question ...
fm-prototype: prototype class must be exactly ui or logic-state
$ fm-spawn.sh widgetsched1 <project> "cat __BRIEF__" --backend tmux
error: registered prototype widgetsched1 must spawn with --scout
$ fm-spawn.sh widgetsched1 <project> "cat __BRIEF__" --scout --backend tmux
spawned widgetsched1 harness=cat kind=scout window=firstmate:fm-widgetsched1 worktree=<isolated copy>
binding: {"baseline_head":"27a2dc89...","ignored_snapshot":[]}
$ fm-teardown.sh widgetsched1 # report edited after completion
fm-prototype: prototype report changed after evidence completion
REFUSED: prototype scout widgetsched1 has not passed its durable evidence gate.
$ jq '.safety.sensitive_live_access = "allowed"' | fm-prototype.sh verify
fm-prototype: invalid or unsafe prototype manifest
$ fm-prototype.sh prepare-promotion widgetsched1 <copy> # scratch commit present
fm-prototype: prototype worktree is not at its registered baseline HEAD
$ fm-prototype.sh prepare-promotion widgetsched1 <copy> # ignored residue present
fm-prototype: prototype worktree ignored files differ from the pre-launch snapshot
$ fm-prototype.sh prepare-promotion widgetsched1 <copy> # clean at baseline
promotion prepared widgetsched1
$ fm-promote.sh widgetsched1
promoted widgetsched1 to ship (teardown protection restored)
next: ... read the validated decision with fm-prototype.sh decision widgetsched1 and implement it afresh;
read fm-prototype.sh regression-obligation widgetsched1 and add the required regression test ...

RESULT: every step behaved as the lifecycle requires
Evidence: Dispatched worker window capture (worker really receives the prototype contract)
treehouse get
widget-scheduler on  master ❯ treehouse get
A new version of treehouse is available: v2.0.0 → v2.1.0
Run "treehouse update" to update
🌳 Setting up worktree...
🌳 Entered worktree at ~/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler.
Type 'exit' to return.
widget-scheduler on  HEAD ❯ export GOTMPDIR=/tmp/fm-widgetsched1/gotmp
widget-scheduler on  HEAD ❯ cat '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/
T//proto-e2e.i57itF/home/data/widgetsched1/brief.md'
You are a crewmate: an autonomous worker agent managed by firstmate. Work on you
r own; do not wait for a human.
# Task
{TASK}
# Question-first prototype
This scout is a registered `logic-state` prototype for one uncertainty: Does ret
rying a cancelled reschedule duplicate the completed transition?
Before any experiment work, read and follow `/Users/arnaudchretien/.no-mistakes/
worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/prototype-lifec
ycle/SKILL.md`.
The prototype lifecycle has no sensitive exception flag and must stop before liv
e sensitive systems.
`/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G
4F5S6/bin/fm-prototype.sh --help` owns the exact evidence and lifecycle commands
.
# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text that replaces `
{TASK}` later.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr
 lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dis
patch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.
# Setup
You are in a disposable git worktree of widget-scheduler, at a detached HEAD on
a clean default branch.
This is a SCOUT task: the deliverable is a written report, not a PR.
The worktree is your laboratory - install, run, edit, and make scratch commits f
reely; all of it is discarded at teardown.
The report is the only thing that survives, so anything worth keeping must be in
 it.
# Rules
1. Never push to any remote and never open a PR.
2. Stay inside this worktree; the only files you may write outside it are the re
port and the status file below.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operatio
ns.
4. Report status by appending one line:
   `echo "{state}: {one short line}" >> '/var/folders/zh/ms9rwtds3095pjqx4j91rmb
m0000gn/T//proto-e2e.i57itF/home/state/widgetsched1.status'`
   States: working, needs-decision, blocked, paused, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a superv
isor
   would act on and the needs-decision/blocked/paused/done/failed states. No ste
p-by-step
   FYI progress lines; firstmate reads your pane for that.
   Use `paused: {why}` - distinct from `blocked:` - ONLY when you are deliberate
ly idling on a
   known external wait you expect to clear on its own (an upstream release, a ra
te-limit reset):
   firstmate then leaves your idle pane alone and rechecks it on a long cadence
instead of
   treating it as a possible wedge. Use `blocked:` when you are stuck and need h
elp.
5. If you hit the same obstacle twice, append `blocked: {why}` and stop; firstma
te will help.
6. If a decision belongs to a human (product choices, destructive actions),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply
with the decision.
   When firstmate replies or a blocker clears and you resume, append `resolved:
{how it was decided or unblocked}` (add the same `[key=<slug>]` if you opened it
 with one) so the decision or blocker is durably closed and does not keep resurf
acing.
7. Never stop, restart, or update the shared `no-mistakes` daemon - it is one in
stance serving
   every lane/home, so restarting it kills other lanes' in-flight pipeline runs.
 On ANY no-mistakes
   daemon error, append `blocked: {the daemon error}` and stop; only firstmate m
anages the daemon.
# Definition of done
Write your findings to `/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-
e2e.i57itF/home/data/widgetsched1/report.md`.
The report must stand alone: what you did, what you found, the evidence (command
s run, output, file:line references), and what you recommend.
Before the shared decision inventory, pass the registered prototype evidence gat
e described by `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85
V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help`.
Before reporting done, read and follow `/Users/arnaudchretien/.no-mistakes/workt
rees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/decision-hold-lifecy
cle/SKILL.md` and pass its shared completion gate for the report and any visual
review.
When the report is complete, append `done: {one-line conclusion}` to the status
file and stop.
If your findings reveal work that should ship (e.g. you reproduced a bug and the
 fix is clear), say so in the report; firstmate may promote this task in place,
and you would then receive mode-specific ship instructions as a follow-up messag
e.
widget-scheduler on  HEAD ❯
Evidence: Persisted prototype record after the full lifecycle (envelope, binding, evidence, promotion)
{
  "schema": "fm-prototype.v1",
  "class": "logic-state",
  "question": "Does retrying a cancelled reschedule duplicate the completed transition?",
  "safety": {
    "fixtures": "synthetic-or-minimized",
    "persistence": "none",
    "external_side_effects": "none",
    "sensitive_live_access": "forbidden"
  },
  "binding": {
    "worktree": "/Users/arnaudchretien/.treehouse/widget-scheduler-53bd1a/1/widget-scheduler",
    "baseline_head": "47fc9e0ee056c15da84c01c03c5a91607d6b6076",
    "ignored_snapshot": []
  },
  "evidence": {
    "report_sha256": "bd39297087c4f33b78c5069db892b0917716b5c8472b9f0b409c32e024f1b2cc",
    "chosen_decision": "Guard the retry with a completed-transition ledger keyed by job id.",
    "regression_test_required": true,
    "regression_test_reason": "replay of a cancelled reschedule duplicated the completed transition"
  },
  "promotion": {
    "prepared_head": "47fc9e0ee056c15da84c01c03c5a91607d6b6076",
    "report_sha256": "bd39297087c4f33b78c5069db892b0917716b5c8472b9f0b409c32e024f1b2cc",
    "decision_sha256": "9aa6345b147e9f004745912a612b0af6a837de1bd8a07000c7ab5a83ab4f9edc",
    "regression_test_required": true
  }
}
Evidence: Generated prototype worker instructions
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
{TASK}

# Question-first prototype
This scout is a registered `logic-state` prototype for one uncertainty: Does retrying a cancelled reschedule duplicate the completed transition?
Before any experiment work, read and follow `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/prototype-lifecycle/SKILL.md`.
The prototype lifecycle has no sensitive exception flag and must stop before live sensitive systems.
`/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help` owns the exact evidence and lifecycle commands.

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text that replaces `{TASK}` later.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of widget-scheduler, at a detached HEAD on a clean default branch.
This is a SCOUT task: the deliverable is a written report, not a PR.
The worktree is your laboratory - install, run, edit, and make scratch commits freely; all of it is discarded at teardown.
The report is the only thing that survives, so anything worth keeping must be in it.

# Rules
1. Never push to any remote and never open a PR.
2. Stay inside this worktree; the only files you may write outside it are the report and the status file below.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state}: {one short line}" >> '/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/state/widgetsched1.status'`
   States: working, needs-decision, blocked, paused, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on and the needs-decision/blocked/paused/done/failed states. No step-by-step
   FYI progress lines; firstmate reads your pane for that.
   Use `paused: {why}` - distinct from `blocked:` - ONLY when you are deliberately idling on a
   known external wait you expect to clear on its own (an upstream release, a rate-limit reset):
   firstmate then leaves your idle pane alone and rechecks it on a long cadence instead of
   treating it as a possible wedge. Use `blocked:` when you are stuck and need help.
5. If you hit the same obstacle twice, append `blocked: {why}` and stop; firstmate will help.
6. If a decision belongs to a human (product choices, destructive actions),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply with the decision.
   When firstmate replies or a blocker clears and you resume, append `resolved: {how it was decided or unblocked}` (add the same `[key=<slug>]` if you opened it with one) so the decision or blocker is durably closed and does not keep resurfacing.
7. Never stop, restart, or update the shared `no-mistakes` daemon - it is one instance serving
   every lane/home, so restarting it kills other lanes' in-flight pipeline runs. On ANY no-mistakes
   daemon error, append `blocked: {the daemon error}` and stop; only firstmate manages the daemon.

# Definition of done
Write your findings to `/var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T//proto-e2e.i57itF/home/data/widgetsched1/report.md`.
The report must stand alone: what you did, what you found, the evidence (commands run, output, file:line references), and what you recommend.
Before the shared decision inventory, pass the registered prototype evidence gate described by `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/bin/fm-prototype.sh --help`.
Before reporting done, read and follow `/Users/arnaudchretien/.no-mistakes/worktrees/89df78ac1b6f/01KY85V1THJ97ZA8HFF8G4F5S6/.agents/skills/decision-hold-lifecycle/SKILL.md` and pass its shared completion gate for the report and any visual review.
When the report is complete, append `done: {one-line conclusion}` to the status file and stop.
If your findings reveal work that should ship (e.g. you reproduced a bug and the fix is clear), say so in the report; firstmate may promote this task in place, and you would then receive mode-specific ship instructions as a follow-up message.
Evidence: Surviving prototype evidence report accepted by the gate
# Retry-duplication prototype

## Prototype evidence

### Question

Does retrying a cancelled reschedule duplicate the completed transition?

### Classification

logic-state

### Assumptions

- The synthetic scheduler fixture reproduces the real transition table.
- No live scheduler data, account, or route was touched.

### Alternatives

- A: guard the retry with a completed-transition ledger.
- B: make the cancel path idempotent inside the worker.

### Observed evidence

- Replaying a cancelled reschedule against the synthetic fixture emitted the
  completed transition twice (src/scheduler.py:2, run log in the isolated copy).

### Chosen decision

Guard the retry with a completed-transition ledger keyed by job id.

### Rejected options

- B was rejected: idempotency inside the worker still double-emits on restart.

### Unresolved risks

- Ledger growth under sustained retries is unmeasured at production scale.

### Expiry or disposal

All experiment code, fixtures, and logs are discarded at promotion; this
decision expires if the transition table changes.

### Regression-test obligation

required: replay of a cancelled reschedule duplicated the completed transition
- Evidence: Reproducible end-to-end walkthrough driver (local file: /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T/no-mistakes-evidence/01KY85V1THJ97ZA8HFF8G4F5S6/prototype-lifecycle-e2e.sh) - Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (1h40m29s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 2 infos
  • ℹ️ bin/fm-prototype.sh:235 - evidence_section() (bin/fm-prototype.sh:235) terminates a section only at the next '### ' heading, so the last evidence section — 'Regression-test obligation' — greedily runs to EOF and absorbs any level-2 '## …' sections or content a worker appends after the '## Prototype evidence' block. This pollutes the stored regression_test_reason that verify/regression-obligation echo into promotion ship instructions. It does not break the happy path (report digest is over the whole file; 'Chosen decision' is not the last section), but a report with trailing sections stores a bloated reason. Fix: also exit the awk on a '^## ' heading.
  • ℹ️ bin/fm-prototype.sh:438 - complete_command (bin/fm-prototype.sh:438) unconditionally sets '.promotion = null'. Re-running 'complete' after 'prepare-promotion' silently discards the prepared promotion even when the report bytes are identical, a minor deviation from the header's documented 'completion over identical report bytes is idempotent'. Harmless (worker just re-prepares) and likely intentional invalidation, so no action needed.
🔧 **Test** - 1 issue found → auto-fixed ✅
  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"

🔧 Fix: skip Herdr e2e suites without a running default session
✅ Re-checked - no issues remain.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • bash tests/fm-prototype-lifecycle.test.sh (8 positive + fail-closed cases: evidence, question drift, idempotency, immutable sensitive defaults, promotion residue, regression obligation, tool-neutral spawn/teardown seams)
  • bash tests/fm-brief.test.sh, bash tests/fm-promote.test.sh, bash tests/fm-teardown.test.sh (integration points touched by the change)
  • Re-ran the round-1 failing Herdr suites: tests/fm-backend-autodetect-smoke.test.sh, tests/fm-afk-inject-herdr-e2e.test.sh, tests/fm-backend-herdr-{smoke,eventwait-smoke,prune-safety-e2e,respawn-idem-e2e,workspace-per-home-e2e}.test.sh — all skip cleanly (exit 0) with no running default Herdr session
  • Full configured suite: for t in tests/*.test.sh; do bash &#34;$t&#34;; done → all 84 suites pass (rc=0)
  • Manual end-to-end walkthrough driving the real scripts (fm-brief.sh --scout --prototype, fm-spawn.sh --scout --backend tmux with a real treehouse worktree, fm-prototype.sh register/bind/complete/verify/decision/regression-obligation/prepare-promotion, fm-decision-hold.sh complete, fm-teardown.sh, fm-promote.sh) against a throwaway project/home on a private tmux socket: bash /var/folders/zh/ms9rwtds3095pjqx4j91rmbm0000gn/T/no-mistakes-evidence/01KY85V1THJ97ZA8HFF8G4F5S6/prototype-lifecycle-e2e.sh
  • Captured the dispatched worker window with tmux capture-pane -p -S -2000 -t firstmate:fm-widgetsched1 to confirm the worker actually receives the prototype contract
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@GoldenSis
GoldenSis merged commit b3c5003 into main Jul 24, 2026
5 checks passed
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