Skip to content

feat: add treehouse setup hook and manual PR validation flow - #53

Closed
michael-sb wants to merge 6 commits into
kunchenguid:mainfrom
michael-sb:fm/nomistakes-skip-pr-ci-v5
Closed

michael-sb wants to merge 6 commits into
kunchenguid:mainfrom
michael-sb:fm/nomistakes-skip-pr-ci-v5

Conversation

@michael-sb

Copy link
Copy Markdown

Intent

Captain, the developer wanted AGENTS.md updated so all firstmate instructions to crewmates for running the no-mistakes pipeline use the manual-PR workflow with --skip=pr,ci. They wanted validation to run through push without no-mistakes opening a GitHub PR, leaving the captain to open the PR manually afterward, while preserving the explicit rule that firstmate must not merge without approval. They asked for the change to be tightly scoped to the no-mistakes validation and PR-ready instructions, with a caveat that manual PR bodies may need to preserve the no-mistakes marker required by the current workflow checks. They also required creating branch fm/nomistakes-skip-pr-ci-v5, committing the change, staying inside the worktree, not pushing to origin or GitHub, and using only the local no-mistakes remote/bare gate if needed to start validation with push/pr/ci steps skipped.

What Changed

  • Adds Treehouse post-create setup support in bootstrap/spawn, including hook installation, environment propagation, and a dedicated fm-treehouse-post-create.sh helper.
  • Updates firstmate no-mistakes guidance and generated crewmate briefs so validation runs through branch push with --skip=pr,ci, leaving PR creation/manual merge approval outside the pipeline.
  • Expands shell tests for bootstrap hook handling, generated brief wording, spawn Treehouse environment behavior, and post-create setup execution.

Risk Assessment

⚠️ Medium: Captain, no new material issues were found beyond the previously ignored Treehouse TOML edge case, but the branch changes bootstrap/spawn behavior and global Treehouse hook wiring with nontrivial shell parsing.

Testing

Captain, I inspected the branch diff and no-mistakes instructions, ran the focused changed-area tests, generated an actual crewmate brief as end-user evidence, verified it contains the manual-PR workflow and not the old push-skipping wording, ran the full shell test suite, and confirmed the working tree was left clean.

Evidence: Manual PR generated brief excerpt

Generated brief excerpt shows: --skip=pr,ci, branch push through no-mistakes, no PR/CI monitoring, and manual PR-ready status.

Generated brief: /var/folders/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home/data/ship-evidence-prci/brief.md

# Definition of done
The task is complete only when committed on your branch.
When you believe it is complete, append `done: {summary}` to the status file and stop.
Firstmate will then instruct you to run the no-mistakes validation pipeline with `--skip=pr,ci`.
During validation, fix auto-fix findings yourself; escalate ask-user findings per rule 6.
No-mistakes may push your branch, but does not open a PR or monitor CI in this workflow.
After no-mistakes finishes validation and branch push, append `done: validated with --skip=pr,ci; branch pushed and ready for captain/manual PR` and stop. You are finished.
Evidence: Full generated crewmate brief
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
{TASK}

# Setup
You are in a disposable git worktree of app, at a detached HEAD on a clean default branch.
1. First action: create your branch: `git checkout -b fm/ship-evidence-prci`
2. Run `no-mistakes doctor`; if it reports the repo is not initialized here, run `no-mistakes init`.

# Rules
1. Never push to the default branch. Never open or merge a PR. Push only your `fm/ship-evidence-prci` branch, and only as part of the no-mistakes validation pipeline.
2. Stay inside this worktree; modify nothing outside it.
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/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home/state/ship-evidence-prci.status'`
   States: working, needs-decision, blocked, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on (setup done, bug reproduced, fix implemented, validation passed) and the
   needs-decision/blocked/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
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, ask-user findings),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply with the decision.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `/Users/michael/.no-mistakes/worktrees/458d9fed4d70/01KVTKFHBWBD1CHR7ZPTDJ1T17/bin/fm-ensure-agents-md.sh .` in the worktree.
If this task produced durable project-intrinsic knowledge, record it in `AGENTS.md` as part of your change.
Keep it proportionate: skip `AGENTS.md` edits for trivial tasks that produced no durable project knowledge.

# Definition of done
The task is complete only when committed on your branch.
When you believe it is complete, append `done: {summary}` to the status file and stop.
Firstmate will then instruct you to run the no-mistakes validation pipeline with `--skip=pr,ci`.
During validation, fix auto-fix findings yourself; escalate ask-user findings per rule 6.
No-mistakes may push your branch, but does not open a PR or monitor CI in this workflow.
After no-mistakes finishes validation and branch push, append `done: validated with --skip=pr,ci; branch pushed and ready for captain/manual PR` and stop. You are finished.
Evidence: Evidence transcript
Generated by: FM_HOME=/var/folders/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home bin/fm-brief.sh ship-evidence-prci app
Generated brief: /var/folders/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home/data/ship-evidence-prci/brief.md

# Rules
1. Never push to the default branch. Never open or merge a PR. Push only your `fm/ship-evidence-prci` branch, and only as part of the no-mistakes validation pipeline.
2. Stay inside this worktree; modify nothing outside it.
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/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home/state/ship-evidence-prci.status'`
   States: working, needs-decision, blocked, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on (setup done, bug reproduced, fix implemented, validation passed) and the
   needs-decision/blocked/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
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, ask-user findings),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply with the decision.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `/Users/michael/.no-mistakes/worktrees/458d9fed4d70/01KVTKFHBWBD1CHR7ZPTDJ1T17/bin/fm-ensure-agents-md.sh .` in the worktree.
If this task produced durable project-intrinsic knowledge, record it in `AGENTS.md` as part of your change.
Keep it proportionate: skip `AGENTS.md` edits for trivial tasks that produced no durable project knowledge.

# Definition of done
The task is complete only when committed on your branch.
When you believe it is complete, append `done: {summary}` to the status file and stop.
Firstmate will then instruct you to run the no-mistakes validation pipeline with `--skip=pr,ci`.
During validation, fix auto-fix findings yourself; escalate ask-user findings per rule 6.
No-mistakes may push your branch, but does not open a PR or monitor CI in this workflow.
After no-mistakes finishes validation and branch push, append `done: validated with --skip=pr,ci; branch pushed and ready for captain/manual PR` and stop. You are finished.
- Outcome: 🔧 1 issue found → auto-fixed ✅ across 2 runs (13m40s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed ✅
  • 🚨 AGENTS.md:421 - The new rule requires every no-mistakes instruction to include --skip=push,pr,ci, but generated no-mistakes briefs still say firstmate will run /no-mistakes to ship a PR and that the crewmate should report done: PR {url} checks green after CI. New tasks will get conflicting instructions and may still push/open PRs despite this workflow change; update bin/fm-brief.sh's no-mistakes definition of done to match the manual PR flow.
  • ⚠️ bin/fm-bootstrap.sh:386 - Appending to a valid single-line TOML array with a trailing comma, such as post_create = ["existing",], produces post_create = ["existing",, "<hook>"], corrupting the Treehouse config. Strip an existing trailing comma before inserting, or rewrite the array through a safer parser path.

🔧 Fix: Align generated no-mistakes brief contract
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed ✅
  • 🚨 AGENTS.md:421 - Captain, the implemented no-mistakes instructions skip the push step too: AGENTS.md requires --skip=push,pr,ci and says no-mistakes skips branch push. The generated crewmate brief mirrors that by telling the crewmate never to push and to stop before manual push+PR. That does not demonstrate the stated intent of validation running through push while only PR/CI are skipped with --skip=pr,ci.
  • git diff 2a2fe0566e63b883ec53dc3e34dc14306689f989..0b9ac82dd25e61de49e59221918dce3dbab2f965 -- AGENTS.md bin/fm-brief.sh tests/fm-brief.test.sh README.md .github/workflows/no-mistakes-required.yml
  • tests/fm-brief.test.sh
  • FM_HOME=/var/folders/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/home bin/fm-brief.sh ship-test app
  • nl -ba AGENTS.md | sed -n '406,440p' and nl -ba bin/fm-brief.sh | sed -n '184,198p'
  • git status --short

🔧 Fix: Captain, allow no-mistakes push before manual PR
✅ Re-checked - no issues remain.

  • sed -n '1,220p' /Users/michael/.agents/skills/no-mistakes/SKILL.md
  • pwd; git status --short; git rev-parse --show-toplevel; git log --oneline --decorate -5
  • git diff --stat 2a2fe0566e63b883ec53dc3e34dc14306689f989..HEAD; git diff --name-only 2a2fe0566e63b883ec53dc3e34dc14306689f989..HEAD
  • sed -n '380,445p' AGENTS.md; sed -n '170,205p' bin/fm-brief.sh; sed -n '1,260p' tests/fm-brief.test.sh
  • tests/fm-brief.test.sh && tests/fm-bootstrap.test.sh && tests/fm-spawn-treehouse-env.test.sh && tests/fm-treehouse-post-create.test.sh
  • for t in tests/*.test.sh; do echo "== $t =="; "$t" || exit $?; done
  • FM_HOME=/var/folders/t0/dws_m6l52lj97dkt9f4hd_sh0000gn/T/no-mistakes-evidence/01KVTKFHBWBD1CHR7ZPTDJ1T17/manual-pr-home bin/fm-brief.sh ship-evidence-prci app
  • grep checks on the generated brief for --skip=pr,ci, branch-push wording, manual PR-ready status, and absence of --skip=push,pr,ci / old PR+CI status wording
  • git status --short && find . -maxdepth 1 -type d -name '.tmp.*' -print
⏭️ **Document** - skipped
  • ⚠️ .github/workflows/no-mistakes-required.yml:18 - Workflow UI/error text still says PRs must be raised through git push no-mistakes and that the pipeline writes the PR body. I left it unchanged because it is executable workflow configuration, not a documentation file or doc comment.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Treehouse v1.8.0 adds post_create/pre_destroy hooks that fire at worktree
lifecycle points. Use post_create to run per-project setup scripts
(data/<project>-setup.sh) right before treehouse get hands the worktree
over, which is earlier and simpler than waiting inside fm-spawn.

Add bin/fm-treehouse-post-create.sh, a single global hook script wired in
~/.config/treehouse/config.toml. It locates firstmate's data/ from its own
location and runs data/<project>-setup.sh if it exists (project name =
worktree directory basename, matching the data/projects.md convention).
Output is logged to state/treehouse-setup-<project>.log.

A failing setup script is non-fatal: treehouse continues on hook failure
by design, and the hook exits with the setup script's code so the failure
surfaces in treehouse's own logs. The mechanism is general - any project
can get a data/<name>-setup.sh and the hook picks it up automatically, no
per-project hardcoding. Secondmates have no project worktree, so the hook
is irrelevant to them.

fm-spawn passes FM_HOME and FM_* overrides through treehouse get so the
hook resolves the correct firstmate home even for alternate/secondmate
homes. fm-bootstrap detects the hook wiring and offers an install step.

Validated through the no-mistakes pipeline (review, test, lint, CI green).
@michael-sb michael-sb closed this Jun 24, 2026
pranaypratyush pushed a commit to pranaypratyush/firstmate that referenced this pull request Aug 25, 2026
…id#53)

* feat: run Hermes crews in a persistent TUI

Replace the per-turn quiet-chat process with a resumable interactive TUI for Hermes crewmates and scouts on tmux and Herdr. Add structural composer and busy-state classification, guarded lifecycle bridging, fail-closed steering, process liveness, and live regression evidence.

* no-mistakes(review): lifecycle busy record outranks rendered Hermes ready footer

* no-mistakes(review): fix C-locale Hermes ready gates and refresh live evidence

* no-mistakes(review): trusted Hermes record outranks rendered state both directions

* no-mistakes(review): defer Hermes tail capture, drop dead dispatcher, rerun evidence

* no-mistakes(document): docs: correct Hermes TUI precedence, steering, and turn-start budgets
RooseveltAdvisors referenced this pull request in RooseveltAdvisors/firstmate Oct 2, 2026
…tasks-axi that can operate the beads backend. The change is in .github/workflows/ci.yml and is uncommitted, for the executor to commit. The ci-3 hard-failure check in tests/fm-stale-sweep.test.sh is unchanged. **The PR #53 branch itself fails one test, so I pinned a later commit from the same fork.** I built the head of RooseveltAdvisors:fm/tasks-axi-beads-backend (90f8c96, version 0.2.5) and ran tests/fm-stale-sweep.test.sh against it. It failed `not ok - a pinned blocker must not set tasks-axi's blocked bit (missing: 'blocked: no')`, because that branch doesn't yet ignore pinned blockers. The fork's main branch has PR #53's beads backend merged (as fork PR #1), plus later beads fixes, pinned-blocker handling and the upstream 0.2.6 release. That matches the local fork build, which reports 0.2.6 and handles pinned blockers. So I pinned fork main at 8c6f96eb58924fd094053eb1a57dd57c64655bbd. **Change:** in the `tests-portable-serial` job (all 9 shards), the step `npm install -g tasks-axi` is replaced by a step that: - fetches only that commit, with the repo and SHA set in the step's `env`; - checks that HEAD equals the pinned SHA; - runs `npm install --ignore-scripts`, then `npm pack` (its prepack runs `tsc`); - runs `npm install -g` on the tarball, then prints `tasks-axi --version`. **Side effect:** shard 4's tests/fm-beads-actor.test.sh also stops skipping in CI and now runs for real (it passes, as below). Other lanes still install the npm tasks-axi. **Local checks:** - I ran the step's exact commands against a temporary prefix. It built and installed tasks-axi 0.2.6. - With that binary on PATH, tests/fm-stale-sweep.test.sh exited 0 with 15/15 ok, and nothing skipped or failed. - tests/fm-beads-actor.test.sh exited 0 with 3/3 ok, nothing skipped. - actionlint on ci.yml was clean. I could not run the GitHub job itself here, so "Behavior portable serial 2" passing is expected from these local results but not yet confirmed
@dchuyka

dchuyka commented Oct 20, 2026

Copy link
Copy Markdown

Confirmations

  1. Missing client/project folder is created, not an error. Live run (--client xCures --project xCELSIOR --cohort "EHE Foundation" --skip-gdrive, real Redshift UNLOAD): no data_exports/xcures/ existed on the Drive; the run created data_exports/xcures/xcelsior/dictionary/standard_data_dictionary.csv and carried on (exit 0). The delivery folder is created by s3_exporter.sh (mkdir -p) on a real delivery.
  2. Cohort output goes under the lowercase_underscore cohort folder. EHE Foundation → ehe_foundation: scripts + run reports in studies/xcures/xcelsior/ehe_foundation/, all 14 UNLOADs (14/14 FINISHED, 53 subjects) at s3://xcures-prod-data-warehouse-query-export/xcures/xcelsior/ehe_foundation/<dataset>000.csv, Drive landing data_exports/xcures/xcelsior/ehe_foundation/exports/<date>/. Dictionary stays at the project level.
  3. ~/Downloads/20261020 was removed. The --skip-gdrive dry run downloaded the cohort CSVs there; after counting rows the folder was deleted and confirmed absent (ls: No such file or directory).

Note: the --org-id/--project-id passthrough flagged in the Risk Assessment above was removed in review (F1); run_export.sh uses the name lookup only.

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…manifest (kunchenguid#53)

* fix(config): correct worker boundary provenance

* no-mistakes(test): resolve stale squash-merge commit refs in fork-surface manifest

* no-mistakes(document): document squash-merge commit provenance rule in fork-surface doc
@drkarl drkarl mentioned this pull request Nov 2, 2026
@Kofey0K

Kofey0K commented Nov 11, 2026

Copy link
Copy Markdown

Latest round (head 9fd981a): the inventory floats are now single-line read-only text windows instead of two-line wrapped spans.

  • No wrap, no baked-in truncation: each float is one line at the existing 10px (11px at 2xl), inside a readOnly (not disabled) text field shaped like the input rows' float field, with the R:/A: labels kept outside the value so a selection copies only the number.
  • Double-clicking either float selects the whole stored value (real Playwright double-click on 0.12345678901234566 selects 0..19) even though a 118px card cannot show all 19 characters at once; typing into the field changes nothing, and clicking the float no longer toggles the card into the inputs.
  • Card size and float styling unchanged: 118 x 176.3px card at 1440px, float rows 112px wide (88px field after the label), one line each, boxes inside the card at 1280/1440/1920, zero float ink outside any card in the pixel audit.
  • Suites: npm test 135/135, npm run test:e2e 10/10 scenarios.
  • Input rows untouched; the raw input float is still editable.

(PR body could not be updated: this token has no UpdatePullRequest permission.)

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 18, 2026
…and PR text hooks (kunchenguid#53)

* perf(bin): drop per-loop forks on the wake drain and prefilter the continuity and PR text hooks

Replace IFS=$(printf '\t') with IFS=$'\t' at the 26 drain-path sites and
the per-status dirname/basename processes with parameter expansion.
The continuity hook allows a command that cannot name an fm-*.sh script
before sourcing any library, the PR text wrapper allows a payload with no
gh, no-mistakes, or \u escape before starting git or Python, and the
primary scope test asks git for both directories in one call.

* no-mistakes(review): Correct continuity hook comment on when outage marker is written

* no-mistakes(document): Correct wedge-alarm outage marker writer description

---------

Co-authored-by: Starship <[email protected]>
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.

3 participants