Skip to content

feat: integrate upstream forge support and fleet lifecycle fixes - #20

Merged
ryannmicua merged 19 commits into
mainfrom
fm/firstmate-upstream-sync-2
Oct 14, 2026
Merged

ryannmicua merged 19 commits into
mainfrom
fm/firstmate-upstream-sync-2

Conversation

@ryannmicua

@ryannmicua ryannmicua commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Intent

can we update both instances of firstmate to latest from upstream? Then check treehouse

Context: the fork github.com/ryannmicua/firstmate (main) is 25 commits ahead and 14 behind upstream kunchenguid/firstmate:main. The fork's sync policy is in FORK.md "Syncing from upstream": merge, never rebase, then the captain merges and running homes fast-forward with /updatefirstmate. The two instances are this machine's home and rgm-dev-01:~/firstmate.

What Changed

  • Add Forgejo/Gitea project support through tea, including PR monitoring, guarded merging, and teardown verification.
  • Require an explicit maintainer role or task consent for Firstmate publication, propagate grants and revocations to secondmates, and document fork-specific remote selection.
  • Fix secondmate busy tracking and relaunch races, Codex recovery checkpoints, Pi event handling, and Treehouse scratch cleanup; correct backlog routing, spaced project-name parsing, large fleet snapshots, and passive Herdr probes.

Risk Assessment

🚨 High: The imported Forgejo merge guard can fail open on a later-page HTTP error and merge without verifying all CI statuses.

Testing

Direct CLI scenarios and targeted regressions passed after correcting fixture isolation. Product transcripts were captured; browser evidence was inapplicable. Herdr live proof remains unavailable under the workspace boundary. All disposable fixtures were removed.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Publication is refused without matching authority and permitted with an explicit matching maintainer grant ✅ pass live live-cli.log; role-grant-live.log
A backlog exceeding Linux's per-argument limit emits all 1,200 contribution records ✅ pass live live-cli.log; large-contribution-input.json
Repeated foreground checkpoints preserve an announced recovery without announcing it again ✅ pass live live-cli.log
Cleanup refuses a ship's nested repository and preserves its uncommitted bytes ✅ pass live live-cli.log
Scout cleanup removes nested scratch repositories and returns a real Treehouse slot to available ✅ pass live live-cli.log; cleanup-targeted-tests.log
Seeding a spaced project preserves its complete name and delivery posture without selecting its prefix neighbor ✅ pass live seed-backlog-live.log; seeded-project-registry.md
Backlog handoff and receipt use markdown despite a conflicting caller backend configuration ✅ pass live seed-backlog-live.log; received-backlog.md
Forgejo refuses a failing head status, merges after that head becomes green, and reports the merged result ✅ pass live forgejo-live.log; forgejo-merged-record.json
Installed runtime processes remain running beside generated secondmate busy-state wiring ✅ pass live busy-live-tests.log
Inspecting an inactive Herdr composer does not start its server ⏸️ untested no The focused fake-transport regression passed. Live lab preparation with worktree-local HOME and XDG_CONFIG_HOME failed because the required tripwire needs a running default session. Using the operator…
Evidence: Direct Treehouse, recovery, role and large-backlog checks

Source: Direct Treehouse, recovery, role and large-backlog checks

$ bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/live-home
~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/live-home

exit=0

$ bin/fm-role.sh report
fm-role: user (default)

exit=0

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/ryannmicua/firstmate

exit=1

$ bin/fm-role.sh check ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP
refused: this home runs as firstmate user/operator and holds no publication authority for github.com/ryannmicua/firstmate

exit=1

large contribution input: backlog bytes=213723; emitted 1200 records intact

$ bin/fm-watch-checkpoint.sh --seconds 3
check: rearm-resurface

exit=0

$ bin/fm-watch-checkpoint.sh --seconds 1
checkpoint: no actionable wake within 1s

exit=124

$ treehouse get --lease --no-fetch --json
A new version of treehouse is available: v2.3.0 → v3.1.3
Run "treehouse update" to update

🌳 Setting up worktree...
🌳 Leased worktree at ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project. Run 'treehouse return ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project' to release it.
{"path":"~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project","lease_id":"a178ae84979e9155fc6c7af69a31b39d","lease_holder":"","leased_at":"2026-10-14T14:28:20.624998352+08:00"}

exit=0

$ git init -q ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project/nested

exit=0

$ tmux -L fm-lab-sync new-session -d -s lab -x 120 -y 40 sleep 300

exit=0

$ tmux -L fm-lab-sync display-message -p -t lab #{socket_path}
/tmp/tmux-1000/fm-lab-sync

exit=0

$ bin/fm-teardown.sh slot
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/live-home
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no live watcher process holds this home lock (last beat: 2s ago).
●  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.
●  repair missing watcher supervision with a foreground checkpoint: bin/fm-watch-checkpoint.sh --seconds 180.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REFUSED: local-only worktree ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project has work not yet merged into main and not on any remote.
uncommitted changes present (untracked-only leftovers)
untracked paths (up to 10):
  nested/
  scratch
Merge the branch into local main first (bin/fm-merge-local.sh after the captain approves), or push to a fork/remote, or get the captain's explicit OK to discard, then --force.

exit=1

$ bin/fm-teardown.sh slot
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/live-home
WARNING: watcher still down (same stale episode; last beat: 6s ago, grace 300s) - full banner already printed this episode.
A new version of treehouse is available: v2.3.0 → v3.1.3
Run "treehouse update" to update

🌳 Worktree returned to pool.
teardown slot complete (window lab:fm-slot, worktree ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project)
Backlog: slot just finished (config/backlog-backend selects manual editing). Update ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/live-home/data/backlog.md - move slot to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.

exit=0

$ git -C ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project status --porcelain --untracked-files=all

exit=0

$ treehouse status
A new version of treehouse is available: v2.3.0 → v3.1.3
Run "treehouse update" to update

1     available    ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project/.test-phase/pool/.treehouse/treehouse-project-5d644d/1/treehouse-project

exit=0

$ tmux -L fm-lab-sync kill-server

exit=0
Evidence: Explicit maintainer authorization

Source: Explicit maintainer authorization

$ bin/fm-role.sh report
fm-role: maintainer github.com/ryannmicua/firstmate (local)
exit=0
$ bin/fm-role.sh check ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP
authorized: maintainer scope github.com/ryannmicua/firstmate
exit=0
Evidence: Real Forgejo refusal, merge and notification

Source: Real Forgejo refusal, merge and notification

$ git clone -q http://fixture:<disposable-password>@localhost:39871/fixture/fixture-repo ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/forge-repo

exit=0

$ git checkout -qb change

exit=0

$ git add feature.txt

exit=0

$ git -c user.name=Fixture -c [email protected] -c commit.gpgsign=false commit -qm feature

exit=0

$ git push -q origin change
remote: 
remote: Create a new pull request for 'change':        
remote:   http://localhost:39871/fixture/fixture-repo/compare/main...change        
remote: 

exit=0

$ bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/forge-home
~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/forge-home

exit=0

$ bin/fm-pr-merge.sh feature https://localhost/fixture/fixture-repo/pulls/1
armed: state/feature.check.sh
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  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.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
error: refusing to merge https://localhost/fixture/fixture-repo/pulls/1
  - the combined commit status is "failure", not success

exit=1

$ bin/fm-pr-merge.sh feature https://localhost/fixture/fixture-repo/pulls/1
armed: state/feature.check.sh
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
verified: https://localhost/fixture/fixture-repo/pulls/1 is open and mergeable, with a successful combined status at head a43a22305bc25fd03827990c3ec11062d31eef8c

exit=0

$ bin/fm-pr-poll.sh --validated forgejo https://localhost/fixture/fixture-repo/pulls/1 localhost fixture/fixture-repo 1
merged

exit=0

$ bin/fm-pr-poll.sh --validated forgejo https://localhost/fixture/fixture-repo/pulls/9991 localhost fixture/fixture-repo 9991

exit=0
Evidence: Spaced project and markdown transfer checks

Source: Spaced project and markdown transfer checks

$ bin/fm-lab-home.sh create ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-parent
~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-parent

exit=0

$ git clone -q ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/treehouse-project ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-parent/projects/space project

exit=0

$ ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/code/bin/fm-home-seed.sh mate ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-child space project
scaffolded: ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-parent/data/mate/brief.md (secondmate charter)
home=~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-child

exit=0

$ ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/code/bin/fm-project-mode.sh space project
direct-PR on

exit=0

$ ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/code/bin/fm-backlog-handoff.sh mate routed
handed off 1 item(s) to mate: routed
  into ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/seed-child/data/backlog.md
error: handed off work to secondmate mate, but no live receiver endpoint is recorded; the destination backlog is durable and the receiver was not woken

exit=1

$ ~/.no-mistakes/worktrees/ff5e17b6f5de/01M4WGXDNGGQ4VYQ87MTYR9JHP/.test-phase/code/bin/fm-backlog-receive.sh state/handoff/mate.outbox.md 97 9ae5188ee3b30d1a627718ef4ec6ddee446266cf54e6863e3031b8ea52bc3613 1
received: mate moved=1 already=0

exit=0
Evidence: Installed-runtime busy-state guard

Source: Installed-runtime busy-state guard

# claude 2.1.299 (Claude Code): real process stayed up; pane tail classify=busy fm-spawn
ok - claude 2.1.299 (Claude Code): a tmux secondmate spawn arms a busy verdict the active-turn gate can see
# opencode 1.18.34: real process stayed up; pane tail classify=busy fm-spawn
ok - opencode 1.18.34: a tmux secondmate spawn arms a busy verdict the active-turn gate can see
# pi 0.87.1: real process stayed up; pane tail classify=unknown launch-prompt
ok - pi 0.87.1: a tmux secondmate spawn arms a busy verdict the active-turn gate can see
# skip: pi-signed is not installed on this machine, so its secondmate busy contract is unverified here
# skip: omp is not installed on this machine, so its secondmate busy contract is unverified here
# skip: grok is not installed on this machine, so its secondmate busy contract is unverified here
ok - codex codex-cli 0.162.1: secondmate spawn stays unarmed and does not emit a parent turn-end
# checked 4 harness(es); absent: pi-signed omp grok
ok - secondmate busy contract live guard checked every installed harness
Evidence: Targeted cleanup regressions

Source: Targeted cleanup regressions

ok - scout copy with a nested clone and a scratch file returns with no untracked entries
ok - ship copy with a nested clone is refused and its bytes stay
ok - a return that leaves residue names the lost slot and the remaining paths
ok - a dirty return is reported even when a later teardown step refuses
ok - a forced secondmate teardown returns a child scout copy with a nested clone clean
ok - a forced secondmate teardown warns about a dirty child return and still completes
ok - a return that leaves no readable copy reports the slot as unverified, not clean
ok - ignored files survive the scratch clean and plain scratch does not
ok - teardown proves a Forgejo task landed from the merged pull request when the content check is inconclusive
Evidence: Herdr isolation limitation

Source: Herdr isolation limitation

fm-herdr-lab: fleet-state tripwire requires exactly one running default session
Evidence: Reproduction instructions and complete test results

Source: Reproduction instructions and complete test results

# Targeted local validation

Validated target 76305f27749b5e41cdcdf670d220cb82f300f5cc against base 1023e6155aa734d86b8733c11eb8e85642104853. Both the fork base and upstream merge parent 8c9c67de40b1ac1d1ab25233e822472b3775e0bc are ancestors of the target. No running Firstmate home was updated by this test phase.

## Reproduction

All fixture source, homes, projects, service data, and downloaded binaries lived in `.test-phase/` in the gate worktree. TMPDIR was `.test-phase/tmp`. `git archive HEAD` supplied a sibling `.test-phase/code` source snapshot for tests which refuse homes nested beneath their code root. Set GIT_CEILING_DIRECTORIES to the fixture TMPDIR for a test which deliberately removes a worktree Git marker; otherwise Git discovers the containing gate repository. The initial nested-home and missing-marker test failures were setup effects; the corresponding checks passed with these isolation controls.

Saved Python drivers exercise the actual Firstmate command interfaces. `live.py` uses a marked disposable home, a private tmux server, and Treehouse v2.3.0. It tests default/mismatched publication refusal, 1,200 backlog rows above Linux MAX_ARG_STRLEN, announced recovery continuity, preservation of a ship's nested repository, and scratch scout cleanup returning a real slot to available. Matching maintainer authorization is separately captured in role-grant-live.log.

`seed-live.py` uses the sibling source snapshot and real Git/tasks-axi: it seeds a spaced project with a prefix-neighbor registry entry, hands work to an offline secondmate with a conflicting beads caller configuration (expected nonzero notification result after durable markdown transfer), and receives a committed remote outbox under that same conflicting configuration.

`forge-live.py` needs the disposable Forgejo HTTP service on localhost:39871. Forgejo 11.0.3 was downloaded locally and configured with SQLite and all paths inside `.test-phase`. A throwaway fixture account and repository were used. tea was built from gitea.dev/tea commit 9c12138d6273ba8feb6e7578833cc330c0cd6461 (Go 1.26.6), matching the API shape used by this integration: released tea 0.11.1 lacks `api`, while the current October CLI has replaced `login` with `auth`. All credentials in the drivers are disposable fixture values. No production credentials were changed. Server and fixture files were removed after validation.

## Live limitation

Herdr lab prepare can inspect the existing default session read-only, but provisioning there creates session state outside the allowed worktree. With HOME and XDG_CONFIG_HOME relocated inside the worktree, prepare reports `fleet-state tripwire requires exactly one running default session`. Creating or modifying a default session is expressly forbidden by the trusted lab contract. No Herdr lab was provisioned. The inactive-session non-autostart regression passed with a fake transport and is supplemental evidence only. Live validation requires permission for the guarded helper's scoped Herdr session files outside the worktree, or a pre-provided isolated session store satisfying its default-session tripwire.

The secondmate busy guard launched real installed Claude, OpenCode, and Pi processes without prompts, beside records generated by real spawn with a sleeper launch; it also verified the Codex unarmed launch. This proves startup wiring and process compatibility, not model-turn semantics or a full real secondmate relaunch race. The separate liveness/relaunch regression uses controlled fixtures.

These are CLI changes, so rendered browser evidence is not applicable. No lint, static analysis, full repository suite, pipeline control, deployment, push, PR, or CI phase was run.

## Final results

The role, checkpoint, review-diff, project-mode, isolated liveness, isolated home-summary, installed-harness busy guard, PR-merge, and PR-check-security suites exited zero. The cleanup suite initially reached the deliberate missing-Git-marker case and discovered the enclosing gate repository; the nine cleanup/Forgejo cases relevant to this sync were then selected and all exited zero with the Git ceiling set. The independent direct CLI drivers for Treehouse, snapshot/recovery, roles, spaced project seeding, markdown transfer/receipt, and real Forgejo all exited zero. The isolated Herdr prepare attempt was refused by the required default-session tripwire, so its runtime scenario remains untested.

All disposable source snapshots, downloaded binaries/toolchains, package caches, homes, projects, database data, and temporary test drivers were removed from the worktree. Evidence remains in this directory. No tracked source file was changed.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 error
  • 🚨 bin/fm-pr-merge.sh:702 - A later status-page HTTP error can incorrectly authorize a Forgejo merge. After page 1 sets ci_state=success, tea can return an error object such as {"message":"Internal Server Error"} with exit status 0. The parser defaults missing statuses to [], and line 720 ends pagination while retaining success, leaving later failing checks unread. Validate every page as a combined-status response before accepting an empty page, including the consumed statuses and state fields. Related sites: bin/fm-pr-merge.sh:703 defaults the count, :704 defaults state, :720 accepts the apparent end, :725 retains success, and :1748 performs the merge after this verification.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Publication is refused without matching authority and permitted with an explicit matching maintainer grant ✅ pass live live-cli.log; role-grant-live.log
A backlog exceeding Linux's per-argument limit emits all 1,200 contribution records ✅ pass live live-cli.log; large-contribution-input.json
Repeated foreground checkpoints preserve an announced recovery without announcing it again ✅ pass live live-cli.log
Cleanup refuses a ship's nested repository and preserves its uncommitted bytes ✅ pass live live-cli.log
Scout cleanup removes nested scratch repositories and returns a real Treehouse slot to available ✅ pass live live-cli.log; cleanup-targeted-tests.log
Seeding a spaced project preserves its complete name and delivery posture without selecting its prefix neighbor ✅ pass live seed-backlog-live.log; seeded-project-registry.md
Backlog handoff and receipt use markdown despite a conflicting caller backend configuration ✅ pass live seed-backlog-live.log; received-backlog.md
Forgejo refuses a failing head status, merges after that head becomes green, and reports the merged result ✅ pass live forgejo-live.log; forgejo-merged-record.json
Installed runtime processes remain running beside generated secondmate busy-state wiring ✅ pass live busy-live-tests.log
Inspecting an inactive Herdr composer does not start its server ⏸️ untested no The focused fake-transport regression passed. Live lab preparation with worktree-local HOME and XDG_CONFIG_HOME failed because the required tripwire needs a running default session. Using the operator…
  • git merge-base --is-ancestor confirmed both the fork base and upstream merge parent remain ancestors of the target.
  • bash tests/fm-self-repo-role.test.sh
  • bash tests/fm-watch-checkpoint.test.sh
  • bash tests/fm-review-diff.test.sh
  • bash tests/fm-project-mode.test.sh
  • Sibling source snapshot: fm-secondmate-liveness.test.sh, fm-home-summary-refresh.test.sh, and fm-secondmate-busy-contract-live-e2e.test.sh.
  • bash tests/fm-pr-merge.test.sh and isolated fm-pr-check-security.test.sh.
  • Cleanup suite diagnosis followed by nine relevant cleanup cases with GIT_CEILING_DIRECTORIES set to the fixture directory.
  • python3 .test-phase/live.py, python3 .test-phase/seed-live.py, and python3 .test-phase/forge-live.py; reproducible drivers saved with evidence.
  • Guarded Herdr lab preparation in an isolated home and the focused inactive-composer regression.
  • Stopped the disposable Forgejo service, removed all temporary fixtures and downloads, and confirmed a clean worktree.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

ironerumi and others added 18 commits October 8, 2026 12:08
* test: order stale watcher-lock fixture races explicitly

* no-mistakes(review): Removed duplicate stale-steal reap call
…ting server (kunchenguid#6920)

* fix(bin): keep herdr composer probes observable-only without autostarting server

- Refuse bare pane identifiers lacking session prefix in fm_backend_herdr_parse_target
- Add fm_backend_herdr_target_observable to passively verify server liveness without autostarting
- Route visible viewport captures through fm_backend_herdr_target_observable
- Detach stdin with </dev/null on background server launch in fm_backend_herdr_server_ensure
- Add unit and regression tests in tests/fm-backend-herdr.test.sh

* fix(bin): drop parse_target colon restriction to preserve existing fixtures

Revert the fm_backend_herdr_parse_target colon check so that single-colon
session targets like sess:p1 in secondmate liveness and other fixtures parse
properly. The probe path remains observable-only via fm_backend_herdr_target_observable.
…kunchenguid#6956)

* test: clear inherited Git repository location in fixture helper

An absolute GIT_DIR inherited from the caller (a linked-worktree hook
exports one) overrides the discovery that git -C implies, so fixture
setup moved the caller's branches and registered fixture worktrees in
it. tests/git-config-helpers.sh now unsets GIT_DIR, GIT_WORK_TREE,
GIT_INDEX_FILE and GIT_COMMON_DIR alongside the config isolation.

Fixes kunchenguid#6953

* no-mistakes(document): Document fixture Git location isolation in CONTRIBUTING
…nchenguid#6830)

* fix(bin): stage contribution-input JSON via temp files

The contribution-input branch passed the whole canonical backlog document to
jq as a single --argjson argv argument. A large fleet's backlog JSON exceeds
Linux MAX_ARG_STRLEN (128 KiB), so jq fails with E2BIG (Argument list too
long) and the contribution-input snapshot emits empty output, breaking the
bearings contribution path.

Write both the backlog and task documents to a temp directory and hand them
to jq with --slurpfile, matching how the full snapshot path already stages
the same pair. Output is unchanged for any backlog that fits in argv.

* no-mistakes(document): Correct contribution cleanup trap comment
)

* fix(bin): arm the busy contract on secondmate launches

A tmux-backed secondmate's active-turn gate can only see a busy verdict from the parent home's record, and those launches never armed it.

* no-mistakes(review): Reopen secondmate busy on blocked Claude Stop; drop muse guard

* no-mistakes(review): Make Claude secondmate Stop guard the sole Stop-state writer

* no-mistakes(review): Record live rewake UserPromptSubmit evidence and add regression

* docs: record Claude secondmate Stop guard as busy writer

* no-mistakes(review): Keep Stop idle hook for older secondmate guards

* no-mistakes(document): Correct stale omp secondmate -e rationale in supervision verification

* no-mistakes(document): Fix skill-relative turnend-guard link in Claude harness reference

* no-mistakes(ci): Root cause: in shard 9, the pure-contract-unit family ran two scripts, tests/fm-rovo-harness.test.sh (14712 ms) and tests/fm-omp-harness.test.sh (10335 ms). Those two durations add up exactly to the failing family's 25047 ms. The failing one was tests/fm-omp-harness.test.sh. Its test_secondmate_launch_relies_on_discovery still asserted the old contract: that an omp secondmate launch names no -e and gets no state/<id>.omp-ext.ts. This PR (issue kunchenguid#4268) deliberately changed that. bin/fm-spawn.sh now arms the busy contract for omp secondmates, so their launch names `-e state/<id>.omp-ext.ts` and writes that extension. The primary extensions are still left to auto-discovery. The harness reference docs were updated to match, but the test was not. The fix is test-only and touches just tests/fm-omp-harness.test.sh. The test now asserts that the secondmate launch names exactly one -e and that it points at the parent-home state/sm.omp-ext.ts. Because only one -e is allowed, the tracked .omp/extensions files are not named a second time, which would load them twice. The test also asserts that the extension file exists, and the header comment for contract 3 was updated. The posture overlay, --cwd, marker, and supervision-model assertions are unchanged. Verification: the host's load average was about 140 on 8 cores, and the full script timed out locally after 590 s having finished only its first 2 tests. So I ran the one affected test function on its own through the real fm-spawn path, and it passed (`ok - fm-spawn: a real omp secondmate launch loads only the busy -e and auto-discovers its primary extensions`). The remaining omp tests were not re-run locally. shellcheck on the file reports only existing info-level notices. The change is left uncommitted for the outer executor

* test: keep the secondmate busy stall gate visible after main's liveness probe

The merged watcher treats a window-name inventory miss as a missing endpoint and exits a later checkpoint on the previous quiet run's recovery wake. The fake pane now answers both list-windows formats, and each observation starts without a leftover downtime marker, so a busy mate still defers the stall and an idle mate still surfaces it.

* no-mistakes(review): Align fm-spawn secondmate comments with omp -e and devin refusal

* no-mistakes(document): Document secondmate busy extensions in configuration reference

* no-mistakes(test): Make live busy-contract guard clean up read-only lab dirs

* fix(bin): pass Claude secondmate busy hooks through --settings

Rewriting a persistent mate home's settings.local.json drops the captain's saved permissions. The hooks now live in a parent-state file Claude Code loads for that session only.

* no-mistakes(review): skip busy arm for raw secondmate launch commands

* no-mistakes(review): retire earlier busy arm on raw secondmate respawn

* no-mistakes(review): retire Stop pointer on relaunch, load --settings in live guard

* no-mistakes(document): Document secondmate Claude settings file and raw-launch exception

* no-mistakes(ci): The check "Behavior portable serial 9" failed because of this PR, and I fixed it with a test-only change; `tests/fm-spawn-dispatch-profile.test.sh` now passes locally in full. Cause: the one failing test was "claude secondmate launch settings JSON does not disable Claude attribution" in `tests/fm-spawn-dispatch-profile.test.sh`. This PR makes a claude secondmate launch pass `--settings` as a file path (`state/<id>.claude-settings.json`) instead of inline JSON. The test helper `claude_settings_json_arg` handed that path string to jq as if it were JSON, so jq reported a parse error. The product behavior is correct: the file does carry `feedbackDrafts` and the attribution-off policy. Invariant: a test that checks the Claude launch settings must read the settings Claude would load, whichever form `--settings` takes (inline JSON or a file path). The only place this must hold is `claude_settings_json_arg`, the single reader of the `--settings` value in the tests. Its two callers, `assert_attribution_policy` and `assert_attribution_policy_absent`, both go through it. Fix: `claude_settings_json_arg` now prints the value when it starts with `{` and prints the file contents otherwise. No product code changed. Verification: I ran `bash tests/fm-spawn-dispatch-profile.test.sh` in the worktree. It ended with "all fm-spawn-dispatch-profile tests passed", including the previously failing secondmate case and the crewmate and keep-ai-trailers cases that use the inline form. I did not run the other tests of shard 9; they passed in the CI run and this change touches only this test file. The change is uncommitted in the worktree (one file modified)
…ailures (kunchenguid#7036)

The large-backlog regression already proved the json and secondmate
home-summary modes stay within exec limits. It now also runs the
contribution-input mode on the same 1200-record backlog, which is the
path kunchenguid#6830 moved off argv. With that fix reverted the test fails with
the field error jq Argument list too long at the contribution-input call.
…urn (kunchenguid#5843)

* fix(teardown): scrub nested repos before return

Treehouse return uses git clean -fd, which leaves a nested git
repository in the pool slot. Scout and forced teardown run
git clean -ffdq first. A return that stays dirty names the
lost slot instead of reporting a clean return.

* no-mistakes(review): Report lost pool slots early and scrub forced child copies

* no-mistakes(review): Drop misleading no-rerun clause from lost-slot message

* no-mistakes(document): Note failed status read in teardown dirty-return header

* no-mistakes(ci): I fixed ci-1 and ci-2 in bin/fm-teardown.sh, and I added tests in tests/fm-teardown.test.sh. Invariant (ci-1): a lost-slot finding must only warn. It must never change the teardown exit status. Two places must obey this: the final status block, and the remote success path that a forced remote retirement uses. - The final block no longer runs `exit 1`. When a slot is lost, teardown writes a lost-slot line to stderr instead of the clean "teardown X complete" line. Then backlog_refresh_reminder runs and teardown exits with its normal status. - Before this change, remote_secondmate_teardown discarded the remote output when the remote run succeeded. Now it sends that output to stderr. Without this, the remote lost-slot warning would not reach the operator once the remote side exits 0. - I updated the header comment to match. Invariant (ci-2): after a return that succeeds, teardown must verify every returned copy, or it must warn that it could not. This invariant is enforced inside teardown_note_dirty_return, which both return sites call (the main WT return and the forced-secondmate child return). Before, a copy that was missing or not a readable git worktree caused a silent `return 0`. Now it sets the lost flag and gives the same warning, with the text "cannot verify: the copy is missing or not a readable git worktree after return". Both call sites run only for a copy that existed before the return. The exit status does not change. Tests: - The dirty-return test now expects exit 0 and the warning. - New test (z3d): a forced secondmate teardown whose child return leaves residue. This is the same command that `retire --force` runs on the remote host. The test expects exit 0 and the warning, and it checks that the task record and the home are removed. - New test (z3e): a return that removes the copy's .git. The test expects exit 0, the "cannot verify" warning that names the copy, and no clean completion line. Verification: - I ran the new and updated tests against the old script. Three failed as expected (exit 1, or no warning). With the fix, all of them pass. - The full tests/fm-teardown.test.sh suite passes: 117 ok, 0 not ok. - shellcheck shows no new warnings. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh is still running. It covers the remote success path that now relays output. Up to now it has no failures, but it has not finished, so I cannot report a final result for it

* no-mistakes(ci): I fixed ci-1 and ci-2 as one exit contract, as the user asked. The changes are in bin/fm-teardown.sh, tests/fm-teardown.test.sh, and tests/fm-remote-secondmate-lifecycle-e2e.test.sh. Invariant (ci-1): when a returned slot is dirty or cannot be verified, teardown must finish every cleanup step and then exit with exit code 4. Exit 4 is used for nothing else. It must hold in two places: the final status of a local teardown, and the remote secondmate retirement caller. - Local: the existing lost-slot flag now leads to `exit 4` (TEARDOWN_LOST_SLOT_EXIT). This exit comes after the task record is removed, the warning is printed, and backlog_refresh_reminder runs. A clean return still exits 0. Refusals and errors exit 1, and an invalid request exits 2. The header documents all of these codes. Exit 3 is only an internal "not remote" return. The ssh transport uses 255. - Remote caller: remote_secondmate_teardown treats a remote exit 4 as "retired with a lost-slot warning". It does the full local retirement (route, registry line, reply source, records, summary refresh), prints the normal completion line on stdout, and then returns 4. The remote control script runs fm-teardown.sh as its last command, and fm-on.sh execs ssh, so the remote 4 reaches the local side unchanged. Invariant (ci-2): remote output goes to local stderr only when it is a lost-slot warning. - After a clean remote retirement (exit 0), the caller no longer prints the captured remote output. - After exit 4, the caller forwards only the lost-slot warning header and the remaining-path lines. To make those lines easy to find, teardown_note_dirty_return now indents each remaining path by two spaces. Tests: - The dirty-return (z3), forced-secondmate dirty-child (z3d), and copy-removed (z3e) tests now expect exit 4 after cleanup. The clean scout return (z1) still expects 0. - The final remote retirement in the e2e test now uses a fake-ssh mode, retire-lost-slot. In this mode the real remote retire runs, and then the fake reports a lost child slot with exit 4. The test checks the following: exit 4; the remote home, parent metadata, and route are removed; stdout has "teardown ios complete (remote"; stderr has the warning and the remaining path; and stderr does not contain the remote completion text. The remote side producing exit 4 is covered by z3d. Verification: - tests/fm-teardown.test.sh: 117 ok, 0 not ok. - tests/fm-remote-secondmate-lifecycle-e2e.test.sh: ALL TESTS PASSED. - shellcheck shows the same warning count as before on all three files. - Against the previous script, both suites fail as expected. In the local suite, dirty-return expected 4 but got 0. In the e2e test, the stdout local-completion check fails

* no-mistakes(ci): Both CI failures came from the lost-slot check that this PR added. Shard 3: tests/fm-secondmate-safety.test.sh "force teardown failed to discard child work". Shard 7: tests/fm-teardown-endpoint-safety.test.sh exited 4. The check ran after the return of every copy. Treehouse return removes a copy that is not a pool slot, so the check reported "cannot verify" and teardown exited 4. Before the fix, both failures happened on my machine. Invariant: only a Treehouse pool slot can be lost by the pool, so the check runs only for a copy that was a pool slot before the return. Fix in bin/fm-teardown.sh: both return sites (the main WT return and the forced-secondmate child return) now run fm_treehouse_pool_slot before the return. They call teardown_note_dirty_return only when the copy was a pool slot. teardown_note_dirty_return lost its pool-slot branch and its unused proj argument; the slot label still comes from the path of the copy. Test fix: in tests/fm-teardown.test.sh, the z3d child copy was not a pool slot. It is now a real pool slot (pool/6/repo plus treehouse-state.json), and the test still expects exit 4 and the warning. Verification: endpoint-safety 27 ok, exit 0. secondmate-safety 79 ok, exit 0. fm-teardown 117 ok, 0 not ok. remote-secondmate-lifecycle-e2e ALL TESTS PASSED. shellcheck count is unchanged (17)

---------

Co-authored-by: Nova Agent B <[email protected]>
…nguid#7047)

* fix(tests): keep backlog suites hermetic against a local .tasks.toml

Fixture homes now write the tracked markdown defaults through a
fm_test_tasks_toml helper instead of copying the checkout's .tasks.toml,
which an operator may override with a beads backend at a live backlog.

The backlog handoff and receive moves pin --backend markdown, because they
already name their markdown files and otherwise resolve the backend from the
caller's working directory. The atomicity suite runs from its scratch root so
its direct tasks-axi fixture calls cannot read the checkout config.

* no-mistakes(review): Add decoy-cwd .tasks.toml regressions for handoff and receive

* no-mistakes(lint): Reuse sha256_file helper to fix SC2015 in remote handoff test
…nchenguid#7076)

* fix(bin): parse whole project name in home seed registry queries

Parse the full project name after the dash in fm-home-seed.sh registry lookups.

This matches the round-3 bootstrap mirror check parser so spaced names resolve.

Cover both the project-less seed refusal guard and registry line lookups in tests.

* no-mistakes(review): Match registry rows by name prefix plus separator

* no-mistakes(document): Note shared registry row-match rule in fm-home-seed
…d#4490)

* fix(codex): preserve announced recovery across checkpoints

* no-mistakes(review): Make announced-recovery checkpoint test reproduce the regression

* no-mistakes(review): Separate 2026-10-07 checkpoint fixture verification from original run

* no-mistakes(test): Defer TERM exit to clean up quiet checkpoint watcher locks

* no-mistakes(document): Update checkpoint recovery and signal documentation

* no-mistakes(ci): Updated both lock-acquire retry loops to honor the watcher’s TERM stop status, so held-marker cleanup exits while retaining stale lock evidence. Set the --stop test’s watcher poll to 1 second to fit its 5-second stop bound. Syntax checks and the full watch-arm suite passed; the targeted held-marker test passed during the triage suite, which timed out after 600 seconds before completing. Did not change or attempt to fix fm-supervision-host.test.sh

* no-mistakes(ci): Removed the cleanup-bound test that incorrectly expected a TERM-stopped watcher to retry a contended lock acquisition. TERM cleanup intentionally stops after the failed attempt; the remaining held-lock test verifies it exits and retains stale lock evidence. The two relevant TERM tests passed, as did shell syntax and diff checks

* Revert "no-mistakes(ci): Updated both lock-acquire retry loops to honor the watcher’s TERM stop status, so held-marker cleanup exits while retaining stale lock evidence. Set the --stop test’s watcher poll to 1 second to fit its 5-second stop bound. Syntax checks and the full watch-arm suite passed; the targeted held-marker test passed during the triage suite, which timed out after 600 seconds before completing. Did not change or attempt to fix fm-supervision-host.test.sh"

This reverts commit 44ce29bfbfa95149a7785efc200f6a00b5bf3a41.

* Revert "no-mistakes(ci): Removed the cleanup-bound test that incorrectly expected a TERM-stopped watcher to retry a contended lock acquisition. TERM cleanup intentionally stops after the failed attempt; the remaining held-lock test verifies it exits and retains stale lock evidence. The two relevant TERM tests passed, as did shell syntax and diff checks"

This reverts commit e1e37067a9369f0c38d7bd1c7a0913b1c54fc28a.

* Revert "no-mistakes(test): Defer TERM exit to clean up quiet checkpoint watcher locks"

This reverts commit 9877bf92134e77414e25cd8e6f122ff4d089473a.

* fix: let checkpoint watcher clean up before timeout

* no-mistakes(review): Scope checkpoint timeout escalation and restore signal docs

* no-mistakes(review): Fix Perl checkpoint timeout escalation

* no-mistakes(document): Clarify checkpoint recovery documentation

* no-mistakes(document): Document isolated checkpoint regression command

* no-mistakes(ci): Tied direct-checkpoint SIGKILL escalation to the effective cleanup bound, preserving the five-second minimum and leaving the supervision-host path unchanged. The targeted checkpoint suite, shell syntax checks, ShellCheck, and diff checks pass. CI was not manually rerun

---------

Co-authored-by: jopo <[email protected]>
…uid#4395)

* feat(bin): add Forgejo (tea) as a third forge alongside GitHub and GitLab

Extends the existing provider-tagged PR/MR dispatch in fm-pr-lib.sh,
fm-pr-poll.sh, fm-pr-check.sh, and fm-pr-merge.sh with a forgejo arm,
following the same pattern already established for GitLab. tea addresses a
repository by owner/repo slug only and resolves the host through a named
"tea login" rather than a URL, so the login is matched against the PR's host
fresh at arm and merge time. tea's own merge subcommand exposes no
head-binding flag, so the merge itself calls Forgejo/Gitea's REST API
directly via "tea api" with head_commit_id, verified against a real
disposable instance to behave like --match-head-commit/--sha; that same
verification found that "tea api" reports an HTTP-level failure with exit
status 0, so a merge is confirmed only by reading the pull request back
afterward, never by trusting the command's own exit code.

Adds forgejo as a value of the registry's existing forge= binding (the
closed set becomes none|gerrit|forgejo, with its refusals unchanged), so a
generated brief and its direct-PR Definition of done name tea before any PR
exists and bin/fm-spawn.sh's forge agreement and bin/fm-promote.sh carry it
like gerrit. Documents the new value in docs/configuration.md,
docs/architecture.md, and a new maintainer-verification doc mirroring
docs/gitlab-merge-watch.md.

* no-mistakes(review): Redact private Forgejo host/IP from evidence doc

* no-mistakes(review): Fix doc's tea-login JSON shape; dedupe host validators

* no-mistakes(document): Add Forgejo to README doc index and scripts.md forge list

* no-mistakes(lint): {"summary": "fix(bin): drop unused FORGEJO_LOGIN capture in fm-pr-check.sh"}

* fix(bin): refuse --allow-red on Forgejo instead of dropping it silently

The attended --allow-red waiver landed on main while the Forgejo arm was
being written, so its applicability guard only ever classified GitHub and
GitLab. On a Forgejo pull request the flag parsed, and then nothing read
it: forgejo_verify_mergeable requires the head's combined commit status to
be exactly "success", with no per-check name to match a waiver against.

The merge still refused, so no red Forgejo merge was ever possible, but it
refused without saying the waiver had been ignored. Extend the existing
GitLab guard to cover Forgejo for the same reason GitLab has it: both
collapse their checks into a single head verdict, so the green requirement
is absolute and a named waiver cannot apply.

* fix(bin): poll a Forgejo pull request by number through tea api

The merge watch listed the 50 most recent pull requests and filtered to the
watched index, so in a repository with more newer pull requests a merged
watch never fired. Read the one pull request through tea api instead and wake
only on a boolean merged field of true, since tea api exits 0 on HTTP errors.

Share the tea login match as fm_pr_forgejo_login for every sourcing script and
add fm_pr_forgejo_read_record for the state, merged flag, and head. Arming now
also requires jq, which the poll needs to read the record.

* fix(bin): gate a Forgejo merge on every status page and on draft state

The combined-status endpoint computes its state from one page of contexts, so
a failing context past the first page could leave the head reading green. Read
every page until an empty one and require each to be success. Also refuse a
pull request the API reports as a draft.

* fix(bin): prove a Forgejo task landed from its merged pull request at teardown

pr_is_merged read the recorded pr= only through gh, so a Forgejo task always
fell back to the content check and refused landed work whenever that check was
inconclusive, such as when later default-branch commits conflict with the
merged tree. Read a recorded Forgejo URL through fm_pr_forgejo_read_record and
apply the same containment check against its head.

* feat(bin): read Forgejo pull requests in crew-state and review-diff

fm-crew-state reports a terminal passed run's Forgejo pull request as open,
closed, merged, or unknown through fm_pr_forgejo_read_record, and
fm-review-diff resolves a /pulls/<n> URL to the refs/pull/<n>/head ref
Forgejo serves. Document the by-number read, the paged status gate, and the
draft gate, and mark what the evidence instance did not exercise.

* fix(bin): parse tea logins as JSON and close the remaining Forgejo gaps

The tea login match split each line of `tea login list --output json` on
quotes and read field 4, which only works while tea pretty-prints one field
per line. A login printed as one compact object put the login name where the
url belonged, so arming, merging, and polling refused every Forgejo host.
fm_pr_forgejo_login and the static poll's own copy now parse the list with
jq, matching each login's url host with scheme, userinfo, port, and path
stripped, and still refuse zero or several matches.

--allow-missing is now refused on a Forgejo pull request the way --allow-red
already is, instead of being parsed and ignored: the merge already requires
the head's combined commit status to have succeeded.

The forge=forgejo Definition of done read the draft state back with
gh-axi pr view and cleared it with gh-axi pr ready although the PR is opened
with tea; both publishing modes now read the draft state through tea api and
clear Forgejo's work-in-progress title prefix with tea pulls edit.

* no-mistakes(review): Retry Forgejo merge confirmation read before failing

* no-mistakes(document): Document Forgejo draft gate and merge confirmation retry

* fix(bin): merge Forgejo pull requests with the repository's default style

When the caller named no merge method, a Forgejo merge always sent Do=merge,
so a repository that allows only squash or rebase merges refused every
default call. The style now comes from the repository's own
default_merge_style, read live through the same tea login, and a merge is
refused when that value cannot be read or is not a known style rather than
replaced by one chosen here. A method the caller names still wins.

---------

Co-authored-by: dna <dna@local>
* fix: serialize secondmate liveness relaunches across task set

* no-mistakes(review): Remove relaunch wait override and test bounded contention

* no-mistakes(document): Clarify secondmate relaunch locking and timeout documentation

* chore: keep local Stele binding out of shared template

* no-mistakes(document): Correct stale secondmate recovery timing comment

* chore: exclude local Stele binding from relaunch fix

* ci: retrigger CI after a timed-out test shard

* no-mistakes(document): Correct secondmate recovery ordering documentation
…unchenguid#7172)

* feat(bin): gate firstmate-upstream publication behind a declared home role

Users who clone firstmate and run it as-is got a surprise: when their
agent hit a firstmate bug, it could drive a pull request at upstream
because nothing distinguished the maintainer's home from an ordinary
user's. Every home now resolves to user/operator unless the gitignored
config/firstmate-role grants a maintainer scope, or a single task
carries the captain's recorded --upstream-consent on the brief, spawn,
and promotion. fm-brief, fm-spawn, and fm-promote apply one fail-closed
gate in bin/fm-role-lib.sh; the role is never inferred from gh identity,
remotes, permissions, or CI, and secondmates honor only receipt-proven
inherited grants so a child cannot grant itself. Session start reports
the resolved role with no network call. Ordinary project delivery and
the clone-and-run setup flow are unchanged.

* no-mistakes(review): Harden firstmate role parsing, normalization, and inheritance

* no-mistakes(review): Detect firstmate by lineage; drop consent fallback; fix claims

* no-mistakes(document): Correct and consolidate Firstmate role documentation
…henguid#7248)

* fix: narrow Pi before-agent prompt events

* no-mistakes(review): Restore processing-run abort detection and type Pi test events
Sync the fork with upstream main at 8c9c67d (14 upstream commits).

Conflicts were resolved with upstream's version as the base and the
fork's carried changes re-applied on top:

- bin/fm-spawn.sh: upstream's relaunch-preserved meta keys (now with
  upstream_consent) plus the carried Paseo keys paseo_agent_id and
  paseo_workspace_id.
- bin/fm-teardown.sh: upstream's claude-settings.json cleanup plus the
  carried paseo-env cleanup and the fork's captain-repeat record from the
  redundant supervision wake suppression (#18).
- .agents/skills/project-management/SKILL.md: upstream's forge CLI
  authentication line plus the carried automatic Paseo registration step.
- docs/watcher-continuity.md: upstream's Codex checkpoint sentences plus
  the fork's wake-noise suppression pointer.

No carried change is dropped: upstream carries no Paseo backend, Paseo
project registration, gate decision helper, gate decision A/B
experiment, explicit-home retry hints, cd-guard next-step hints,
absolute wake-drain recipes, wake-noise suppression, or removal of the
one-task recovery handoff, so every carry-ledger row stays.
… the publication role

Upstream's publication gate takes a task's target from the first remote named upstream, github, or origin, so a remote named upstream pointed every fork task at the original project. The sync and proposal steps now use a kunchenguid remote, homes that ship fork changes declare maintainer github.com/ryannmicua/firstmate in config/firstmate-role, and upstream contributions take per-task --upstream-consent.
…g automatic listening before every manual handler call. The full remote-reply test, pinned lint, Bash syntax check, and diff check passed. Only tests/fm-remote-reply.test.sh changed
@ryannmicua

Copy link
Copy Markdown
Owner Author

Fork sync notes

This PR merges upstream kunchenguid/firstmate main at 8c9c67de (14 commits) into the fork by a real merge commit, per FORK.md "Syncing from upstream".

Preserved fork features

Conflict resolutions (all kept both sides)

  • bin/fm-spawn.sh: upstream's relaunch-preserved meta keys (now including upstream_consent) plus the carried paseo_agent_id and paseo_workspace_id.
  • bin/fm-teardown.sh: upstream's claude-settings.json cleanup plus the carried paseo-env cleanup and fix(bin): suppress redundant supervision wakes #18's captain-repeat record.
  • .agents/skills/project-management/SKILL.md: upstream's forge CLI authentication line plus the carried automatic Paseo registration step.
  • docs/watcher-continuity.md: upstream's Codex checkpoint sentences plus fix(bin): suppress redundant supervision wakes #18's wake-noise suppression pointer.

Drops

None. Upstream carries no equivalent of any ledger row or of fork commits #13-#19, so the carry ledger is unchanged.

Judgment call: upstream's publication role gate (approved option A)

Upstream kunchenguid#7172 gates publishing work on firstmate's own repository behind config/firstmate-role or per-task --upstream-consent, and takes the publication target from the first remote named upstream, github, or origin.
With FORK.md's old upstream remote, every fork task resolved to kunchenguid/firstmate and was refused even with fork consent.
FORK.md now names the original-project remote kunchenguid, documents maintainer github.com/ryannmicua/firstmate in each home's config/firstmate-role, and requires per-task --upstream-consent github.com/kunchenguid/firstmate for upstream contributions.
Each home must rename its upstream remote and write its role file before dispatching fork work after this merges.

Treehouse

Upstream changed no Treehouse version requirement: the CI pin in bin/fm-install-treehouse.sh stays v2.0.1.
Upstream kunchenguid#5843 adds a teardown scrub of nested repositories before treehouse return, assuming return runs git clean -fd and a pool layout of <pool>/<slot>/<repo> with treehouse-state.json at the pool root; re-check both under Treehouse v3.1.3 before upgrading from v2.3.0.

Upstream issue noted, not fixed here

The review flagged that in upstream's new Forgejo merge path (bin/fm-pr-merge.sh, from upstream kunchenguid#4395), a later commit-status page that returns an HTTP error object with exit 0 can end pagination while retaining an earlier success, so later failing checks go unread.
The file is identical to upstream's, so fixing it here would add an unledgered fork carry; it belongs in an upstream report. No Forgejo project is registered in these homes today.

Other commits on this branch

@ryannmicua
ryannmicua merged commit 28e3710 into main Oct 14, 2026
19 checks passed
@ryannmicua
ryannmicua deleted the fm/firstmate-upstream-sync-2 branch October 14, 2026 21:11
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.