Skip to content

feat: import upstream operational workflow updates - #6

Merged
SSBrouhard merged 8 commits into
mainfrom
codex/import-upstream-july-1
Jul 1, 2026
Merged

SSBrouhard merged 8 commits into
mainfrom
codex/import-upstream-july-1

Conversation

@SSBrouhard

Copy link
Copy Markdown
Owner

Intent

Import-audit the six new upstream firstmate commits before privatizing the repo. The goal is to bring in the useful upstream operational changes without regressing this fork's deliberate choices: keep the blunt custom AGENTS voice, keep Orca and Codex-App backend support, keep the local teardown behavior that is already more robust than upstream, and filter out upstream's nautical/persona noise. Imported scope includes dynamic crew profiles, hardened profile enforcement, live secondmate config push, X reply image attachments, the PR merge helper and gh-axi PR URL parsing, plus teardown docs/tests. During validation, fix any local shell compatibility regressions caused by the import, especially macOS Bash 3 empty-array behavior.

What Changed

  • Added dynamic crew dispatch profiles with stricter spawn-time enforcement, plus live secondmate config inheritance/push support and matching documentation.
  • Added X-mode reply image attachment handling, a PR merge helper with gh-axi URL parsing, and more robust landed-PR teardown detection.
  • Updated shell compatibility, upstream docs, and regression coverage across dispatch profiles, secondmate harness/config behavior, PR merge parsing, X-mode replies, and teardown.

Risk Assessment

⚠️ Medium: The branch touches core operational shell paths for spawning, merging, config propagation, and X replies, but the reviewed changes are covered by targeted tests and I found no merge-blocking defects by inspection.

Testing

The provided baseline had already passed; I reran the focused import regressions plus the full configured tests/*.test.sh suite on macOS Bash 3.2/tmux 3.7, then captured CLI evidence for dispatch enforcement, PR merge parsing, X image payloads, and live secondmate config push; all checks passed and the working tree stayed clean.

Evidence: Bash 3 runtime

GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)

GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)
Evidence: Dispatch profile enforcement and launch transcript
## dispatch profile enforcement
error: config/crew-dispatch.json is active - pass an explicit harness resolved from the dispatch rules (the consultation backstop, so the rules are never silently skipped).
exit=1

## explicit resolved codex profile
warn: no registry at /var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/manual-work/spawn/home/data/projects.md; defaulting project to no-mistakes off
spawned profile-demo harness=codex kind=ship mode=no-mistakes yolo=off backend=tmux window=firstmate:fm-profile-demo worktree=/var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/manual-work/spawn/wt

## recorded meta
harness=codex
kind=ship
mode=no-mistakes
model=gpt-5
effort=high

## launch command sent to tmux
codex --model 'gpt-5' -c 'model_reasoning_effort="high"' --dangerously-bypass-approvals-and-sandbox -c "notify=[\"bash\",\"-c\",\"touch '/private/var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/manual-work/spawn/home/state/profile-demo.turn-ended'\"]" "$(cat '/var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/manual-work/spawn/home/data/profile-demo/brief.md')"
Evidence: PR merge URL parsing transcript
## fm-pr-merge stdout
armed: state/task-pr.check.sh polls https://github.com/example/repo/pull/42
## fm-pr-merge stderr
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust bin/fm-watch-arm.sh for the true state: it confirms a live watcher and a fresh beacon, or fails loudly.
●  Re-arm it NOW: run bin/fm-watch-arm.sh as the harness-tracked background task (never a shell & that gets reaped).
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
## meta after merge helper
pr=https://github.com/example/repo/pull/42
pr_head=abc123abc123abc123abc123abc123abc123abc1
## gh-axi invocation
pr merge 42 --repo example/repo --squash
Evidence: X image reply transcript
## fm-x-reply stdout
req-img
## relay call summary
method=POST
url=https://relay.test/connector/answer
auth=Authorization: Bearer tok-image
## payload summary
{
  "request_id": "req-img",
  "text": "Here is the illustration.",
  "image": {
    "media_type": "image/png",
    "base64_length": 40,
    "base64_prefix": "iVBORw0KGgpmaXJz"
  }
}
Evidence: X image relay payload
{"request_id":"req-img","text":"Here is the illustration.","image":{"media_type":"image/png","data_base64":"iVBORw0KGgpmaXJzdG1hdGUtZXZpZGVuY2UtcG5n"}}
Evidence: Live secondmate config push transcript
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust bin/fm-watch-arm.sh for the true state: it confirms a live watcher and a fresh beacon, or fails loudly.
●  Re-arm it NOW: run bin/fm-watch-arm.sh as the harness-tracked background task (never a shell & that gets reaped).
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
config-push: /var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/config-push-work/primary/config -> live secondmate homes
secondmate domain (/private/var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV/config-push-work/secondmate):
  crew-dispatch.json: pushed
  crew-harness: pushed
  backlog-backend: pushed
## propagated files
backlog-backend
crew-dispatch.json
crew-harness
## crew-harness
codex
## backlog-backend
manual
## secondmate-harness present?
no

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • 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"
  • Baseline supplied by harness: 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"
  • Focused regression run: for t in tests/fm-spawn-dispatch-profile.test.sh tests/fm-bootstrap.test.sh tests/fm-secondmate-harness.test.sh tests/fm-pr-merge.test.sh tests/fm-x-mode.test.sh tests/fm-teardown.test.sh test/fm-teardown-orca.test.sh test/fm-backend-regression.test.sh test/fm-codex-app-teardown.test.sh; do printf '== %s ==\n' "$t"; bash "$t" || exit 1; done
  • Evidence generation: created isolated fake tmux/gh-axi/curl/secondmate-home fixtures under /var/folders/km/p2bzh7ss6lz_376w0_8b89z00000gn/T/no-mistakes-evidence/01KWFDEHF6KDXGXRRD3FHY31FV and exercised bin/fm-spawn.sh, bin/fm-pr-merge.sh, bin/fm-x-reply.sh, and bin/fm-config-push.sh end-to-end.
  • Configured suite rerun on target checkout: 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"
  • Cleanup check: git status --short returned no working-tree changes.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 8 commits July 1, 2026 13:40
* feat(dispatch): add dynamic crew profiles

* no-mistakes(review): Captain, document dispatch profile inheritance

* no-mistakes(review): Captain, guard stale dispatch inheritance

* no-mistakes(document): Sync dispatch profile docs

* no-mistakes: apply CI fixes
* Harden crew dispatch profile enforcement

* no-mistakes(document): Captain, synced crew dispatch docs
* feat(config): add live secondmate config push

* no-mistakes(document): Document config push behavior

* no-mistakes(lint): Clean changed shell lint

* no-mistakes: apply CI fixes
* feat(x): add image attachments to reply helpers

* no-mistakes(review): Stream X image replies safely

* no-mistakes(review): Captain, clean X reply temp tracking

* no-mistakes(document): Document X reply image support
* fix(teardown): make landed-check robust when no pr= was ever recorded

fm-teardown.sh's squash-merge landed-check already falls back to
discovering a merged PR by branch name when state/<id>.meta has no
recorded pr=, but nothing guaranteed pr=/pr_head= actually got
recorded on a yolo-authorized merge - the "checks green" trigger that
normally runs fm-pr-check.sh never fires on repos with no PR CI, so a
merge done via a bare `gh-axi pr merge` silently skips it.

Add bin/fm-pr-merge.sh as the one path for merging a task's PR: it
always runs fm-pr-check.sh first, so pr=/pr_head= land in meta as part
of the merge itself regardless of any CI signal. Document both the
existing branch-name discovery fallback and the new merge path in
AGENTS.md, and add regression coverage for the no-pr=-recorded landed
scenario and for fm-pr-merge.sh's record-then-merge behavior.

* no-mistakes(review): Guard PR merges on task metadata

* no-mistakes(document): Document PR merge wrapper

* no-mistakes: apply CI fixes
* Fix fm-pr-merge.sh to parse PR URLs for gh-axi

gh-axi pr merge expects a PR number and --repo, not a full GitHub URL.
Parse the URL, default to --squash when no merge method is passed, and
fail fast on malformed URLs. Tests cover parsing, defaults, and refusal.

* no-mistakes(review): Harden PR merge validation

* no-mistakes(review): Harden PR merge URL guards

* no-mistakes(document): Document PR merge URL handling

* no-mistakes(lint): Clean shell lint
@SSBrouhard
SSBrouhard merged commit c4cb927 into main Jul 1, 2026
4 checks passed
@SSBrouhard
SSBrouhard deleted the codex/import-upstream-july-1 branch July 1, 2026 18:35
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.

2 participants