Skip to content

feat(personal): first-mate 1.7.0, status map, quieter loop, gh stack startup install - #15

Merged
mogul merged 4 commits into
mainfrom
feat/first-mate-status-map
Dec 4, 2026
Merged

mogul merged 4 commits into
mainfrom
feat/first-mate-status-map

Conversation

@mogul

@mogul mogul commented Dec 4, 2026

Copy link
Copy Markdown
Owner

AI-assisted (OpenCode, claude-sonnet-5.5); human review required before merge.

Summary

Improvements to the paseo-first-mate skill (1.6.0 to 1.7.0) from one long coordination effort, in four commits:

  1. Quieter wait loop. The detector saves but no longer reports: check counts moving while checks are pending, an agent going idle to running, and a failed query until it has failed three runs in a row. A detector run that hangs is killed after 240 s and logged, and status shows last-kill=. A finish, close, error, or disappearance of an agent, and a failing or settling check, still report.
  2. One status map (tmp/STATUS-MAP.md) replaces the separate handoff and status doc. File-tree "Path to main" with one self-contained row per PR, →you [key] markers with footnoted commands, goal and remaining work only. A merge sweep retires a merged PR's agents, workspaces, worktrees, branches, scratch, and then its row in the same turn.
  3. Process guidance. Prerequisites for gh, gh stack and its skill; security findings held privately only once the code has landed; progress-only finish notices are not final reports; bottom-up stack merging with gh stack merge; cancelled duplicate CI runs.
  4. Startup install of gh stack and its skill (ADR 0006), pinned and digest-checked.

Verification

  • personal/scripts/verify: 36 passed, 0 failed.
  • test-first-mate-detector.py: 55 tests (21 new). Against the previous assets, 6 failed and 1 errored.
  • test-gh-stack-install.py: 16 tests, including digest mismatch, failed removal, tampered binary on a second run, and the version gate.
  • Real commands run once with an isolated HOME: gh extension install --pin, gh skill install --pin, and the install script end to end on Linux arm64 (digest verified, second run idempotent).
  • Two adversarial reviews (read-only subagent). Round 1: 7 blockers, fixed. Round 2: 2 blockers (git branch -d refuses after a squash merge, which was tested; invariant 10 lacked an immediate user step), fixed.
  • Not run: a real acq run on msb or sbx, macOS, a live Paseo daemon.

Review focus

  • first-mate-check.py: agents_wake(), comparable(), and the error counter, which marks an ERROR reported only when its report is committed.
  • SKILL.md invariant 10 (security findings) and section 10 (merge sweep). Both change agent behavior. The invariant relaxes private handling for code that has not landed; the playbook rule it departs from is §9.2.
  • gh-stack-install.sh: the digests and commit were taken from the GitHub API for v0.3.0 (linux-amd64, linux-arm64).
  • caps.network gains api.github.com and release-assets.githubusercontent.com.

Rollback

Revert the merge commit. Nothing is persisted outside the sandbox.

Security impact

Adds one startup process and two egress hosts. The extension binary is checked against a recorded sha256 and removed on a mismatch. Digests share a trust root with the release, so they catch corruption and a changed asset, not a compromised release (ADR 0006).

mogul added 4 commits December 4, 2026 22:38
…or runs

The wait loop returned, and so woke the coordinator, on things nobody can act on. In one
long effort that cost a notification each time and a stuck loop that looked healthy.

The detector now saves but does not report:
- check counts that move while checks are still pending (a failure, or checks settling
  or restarting, still reports)
- delegated agents flipping between idle and running (opening, closing, erroring and
  removal still report)
- a failed query, until the same item has failed three runs in a row
  (FIRST_MATE_ERROR_RUNS); it then reports once, and --show always prints every error

A detector run that exceeds FIRST_MATE_DETECTOR_SECS (default 240) is killed and logged
to .wait.log, and `status` shows the last kill. Before, one hung network call left the
loop alive but silent.

A quiet change is saved at once, so the next real change compares against it.

Tests: 13 new, each failing against the previous assets.

Co-authored-by: OpenCode [claude-sonnet-5.5] <bmogilefsky@gmail.com>
…atus map

The handoff template had 19 sections and the status doc repeated much of it, so every PR
event meant several edits and the two files drifted. Both are replaced by STATUS-MAP.md:

- Needs @Human and Path to main come first. Path to main is a tree with one row per PR,
  grouped by stack with main at the bottom of each group, so a row can be copied, edited,
  or deleted on its own.
- A row holds everything about its PR (status, head, review state on that head, agent,
  next action). No other section repeats it.
- `→you [key]` marks a human action. The key points to a footnote under the tree that
  holds the exact command or the note for a person. Keys are PR number plus a suffix,
  never a counter, so deleting a row never renumbers.
- Goal and remaining work only: no completed-work section and no log.
- Merge sweep: when the detector reports a PR merged or closed, retire its agents,
  workspaces, worktrees, local and stack-sibling branches, remote branch (if not
  auto-deleted), scratch files, and then its row. A row exists exactly while its
  resources exist. A hard stop leaves the row with a visible `cleanup blocked` tag.
  Closed-but-unmerged PRs ask before deleting unique commits.

references/status-doc.md is renamed status-map.md. The successor reference gains a short
procedure for adopting an older handoff.

Co-authored-by: OpenCode [claude-sonnet-5.5] <bmogilefsky@gmail.com>
Guidance the skill was missing, each from a cost seen in a long coordination effort:

- Prerequisites: check and fix `gh` (2.90.0 or later), the pinned `gh stack` extension
  (sha256 checked against the release's published digest), and the `gh-stack` skill
  before any stack work, without stopping to ask each time. Standing permission is
  recorded once. Fail closed with BLOCKED rather than stacking by hand.
- Invariant 10, scoped: hold a security finding privately only when the vulnerable code
  has landed on the default branch, in a release, or is deployed. A finding only in an
  open unmerged PR is fixed and discussed in that PR. Unclear means treat it as landed
  and ask.
- A finish notice that says work is still running is a progress report, not a final one.
- Before a push, restack, or retarget of an approved PR, name which approvals it dismisses.
- stacking.md: merge a stack bottom-up with `gh stack merge <pr> --squash` and no pushes
  between approval and merge; never top-down; per-PR squash costs every layer its
  approvals. Cancelled duplicate runs are checked against the run list before they are
  treated as failures.
- Heartbeat prompt: stay silent unless something meaningful changed.
- Troubleshooting row and detector notes for the noise filters and the hung-run kill.

Co-authored-by: OpenCode [claude-sonnet-5.5] <bmogilefsky@gmail.com>
The first-mate skill depends on `gh stack` and the `gh-stack` agent skill, and every new
sandbox made the coordinator stop to install them. A second background startup step now
does it, beside the Paseo plugin installer:

- `gh extension install github/gh-stack --pin v0.3.0`, then a sha256 check of the binary
  against a digest recorded in the script (from the release's published asset digests);
  a mismatch runs `gh extension remove`. Digests cover Linux amd64 and arm64.
- `gh skill install github/gh-stack gh-stack --pin <full commit of v0.3.0>`.
- Idempotent, three attempts each, run lock, always exits 0, logs to
  ~/.local/state/paseo/gh-stack.log. It does not install or upgrade `gh`; when `gh` is
  older than 2.90.0 it logs that, and the skill's Prerequisites cover the upgrade.
- caps.network adds api.github.com and release-assets.githubusercontent.com (observed with
  GH_DEBUG=api).

ADR 0006 records the decision and its limits. scripts/verify section 3d2 fails on an
unpinned install, a missing digest, or a missing removal path, and runs 13 offline tests
against a fake gh. Bumps the skill to 1.7.0 with a changelog entry.

Co-authored-by: OpenCode [claude-sonnet-5.5] <bmogilefsky@gmail.com>
@mogul
mogul merged commit 0b1aaa2 into main Dec 4, 2026
10 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