fix(firstmate): route documentation to Beam Free and guard the OpenCode 2 launcher
Add a documentation dispatch rule that uses opencode-go/beam-free while the default workers stay on opencode-go/deepseek-v4.1-flash. Preserve the existing UI rule and the Pi/GPT design exception. Add live checks for the two operator-facing contracts: - tests/fm-launcher.sh sources the zshrc that home-manager generates, runs fm with harmless pi and oc2 spies, and requires OpenCode 2 through oc2. - tests/crew-dispatch.sh reads the dispatch config through firstmate's own bootstrap validator and asserts the default, documentation, UI, and design profiles. Document the permanent fm decision, the no-mistakes model split, and the minimal install procedure after merge.
This commit is contained in:
1 parent
5566b982c2
commit
0aa25b27f0
7 files changed
+295
-4
No files matched your search
@@ -13,7 +13,65 @@ The firstmate crew dispatch + Gitea PR helper are wired by `darwin-rebuild`, but
|
||||
cd ~/Documents/investor-flow
|
||||
git remote set-url origin http://unraid.local:3003/transnet/investor-flow
|
||||
|
||||
Verify: `fm` launches OpenCode 2 as the first mate and `fm-pi` is the Pi fallback until that launcher is confirmed; `oc2 --version` prints the Homebrew opencode version; `pi --list-models mimo` shows `opencode-go/mimo-v2.5-pro`; `tea pulls list --repo transnet/investor-flow` works.
|
||||
Verify: `fm` launches OpenCode 2 as the first mate and `fm-pi` is the explicit Pi fallback; `oc2 --version` prints the Homebrew opencode version; `pi --list-models mimo` shows `opencode-go/mimo-v2.5-pro`; `tea pulls list --repo transnet/investor-flow` works.
|
||||
|
||||
## firstmate launcher and crew model routing
|
||||
|
||||
`fm` is the permanent firstmate launcher. It changes to `~/Documents/firstmate` and executes `~/.local/bin/oc2`, which runs the Homebrew OpenCode build with the isolated `~/.config/opencode2/opencode.json` config. `fm-pi` remains only as an explicit Pi fallback. Never make Pi the default launcher.
|
||||
|
||||
`home.nix` owns both aliases, so a rebuild regenerates them. The installed `~/.zshrc` changes only at the next activation.
|
||||
|
||||
Worker routing lives in `home/.config/firstmate/crew-dispatch.json`, which is symlinked to `~/Documents/firstmate/config/crew-dispatch.json`:
|
||||
|
||||
| Task | Harness | Model |
|
||||
| --- | --- | --- |
|
||||
| Default crewmates and scouts | opencode | opencode-go/deepseek-v4.1-flash |
|
||||
| Documentation writing, updating, or review | opencode | opencode-go/beam-free |
|
||||
| UI work with image context | opencode | opencode-go/deepseek-v4.1-flash |
|
||||
| Design, architecture, and design review (preserved exception) | pi | openai-codex/gpt-6.1-sol at xhigh |
|
||||
|
||||
Firstmate matches the `when` text with judgment. It then passes concrete `--harness` and `--model` flags to `fm-spawn.sh`. The file has no Pi default.
|
||||
|
||||
`~/Documents/firstmate/config/crew-harness` stays `opencode`. `home.activation.firstmate` seeds it only when the file is absent, so a captain edit survives a rebuild.
|
||||
|
||||
The model IDs above were listed from a neutral directory with `OPENCODE_CONFIG=~/.config/opencode2/opencode.json opencode models`. Both `opencode-go/deepseek-v4.1-flash` and `opencode-go/beam-free` are exact IDs.
|
||||
|
||||
### no-mistakes pipeline models
|
||||
|
||||
The captain confirmed the split on 2026-11-15. Leave it unchanged:
|
||||
|
||||
- execution tool: Pi (`agent: [pi]`)
|
||||
- general steps and fixers: `opencode-go/deepseek-v4.1-flash`
|
||||
- reviewer: `opencode-go/glm-5.3-flash`
|
||||
|
||||
`home.activation.noMistakes` adds `agent_config` and `review_agents` only when those keys are absent. The live `~/.no-mistakes/config.yaml` also sets `agent_path_override.opencode`, which stays inactive while the execution tool is Pi. This repository has no `.no-mistakes.yaml`, so no repo-level override applies. Firstmate's own `.no-mistakes.yaml` applies only to the firstmate repository. Do not edit the live no-mistakes config by hand.
|
||||
|
||||
### Checks
|
||||
|
||||
```bash
|
||||
./tests/fm-launcher.sh --live # installed zshrc; fails while it still launches Pi
|
||||
./tests/fm-launcher.sh # generated zshrc; must pass
|
||||
./tests/crew-dispatch.sh # firstmate bootstrap view of the routing
|
||||
./tests/run.sh # all checks
|
||||
```
|
||||
|
||||
The launcher check sources the real generated zshrc in an interactive zsh. A `pi` spy on PATH and an `OPENCODE2_BIN` spy capture the launch, so no firstmate session starts.
|
||||
|
||||
### Install after merge
|
||||
|
||||
The Nix sources in this repository are the durable record. The live files are generated, so do not edit them.
|
||||
|
||||
1. Merge the reviewed branch into the default branch.
|
||||
2. Confirm `readlink ~/.dotfiles` names the checkout that holds the merged commit.
|
||||
3. Run `./rebuild.sh` from that checkout.
|
||||
4. Run `./tests/fm-launcher.sh --live` and `./tests/crew-dispatch.sh`.
|
||||
5. Open a fresh shell and run `alias fm`. It must show `exec /Users/laptran/.local/bin/oc2`.
|
||||
|
||||
### Checkout topology and safe installation
|
||||
|
||||
`rebuild.sh` points `~/.dotfiles` at its own directory and then builds `~/.dotfiles#lt-mbp`. On 2026-11-15, `~/.dotfiles` resolved to `/Users/laptran/Documents/firstmate/projects/dotfiles`. A second checkout at `/Users/laptran/Documents/dotfiles` carried an uncommitted `home.nix` that changed `fm` back to `pi` and seeded `crew-harness` as `pi`. A rebuild from that checkout would restore the Pi default. Do not run `rebuild.sh` from a checkout with that edit, and do not repoint `~/.dotfiles` by hand.
|
||||
|
||||
This follows the NIST SP 800-128 Rev. 1 (2019) Section 3.3 "Controlling Configuration Change" (CM-3) practice: route every change through review and approval, test it, record it in version control, and restrict who can change the operational configuration. The 2011 edition is withdrawn and superseded by Revision 1.
|
||||
|
||||
## security-audit skill (agent security reviews)
|
||||
|
||||
|
||||
Reference in new issue
Block a user