martha init asks which crew to declare, martha config edits it, martha down; F2 (#310, PR 5 of 5 of owner/953-chat) #320

Manually merged
terra merged 18 commits from neptunus/310-init-config into main 2026-11-30 22:13:44 +00:00
Member

Refs #310, and #307 (martha down). This is PR 5 of 5 landing Raf's owner/953-chat branch, per Saturnus's review REVIEW_2026-11-30_owner-953-chat. Based on main 256f3261.

Raf's 15 commits are cherry-picked unchanged (992ab8a0..4dc3d8a8): e7868386, 24248d27, c9de6205, 6297fcbc, 4bb57957, 3cccd9ef, d30d23e9, c37368e7, 4cfbcf0f, 0230e976, 1f727344, 6be69ce5, fd18b66c, bc59cd9d, 02e7e079.

  • Order change: martha down (4bb57957 → 44dde8e1) moved here from PR 1. It builds on init's tmux file (e7868386) and the chat's /quit (9d291fe0, landed in #315).

The review's required fix:

  • cc76cef5 F2, as ruled. DECIDED 2026-11-30 "Wide starter, honest comment". The allow list keeps node, npm, git, cp and mv. The comment in src/declare_a_solo_crew/the_files_a_crew_starts_with.ts and the starter-rules paragraph in docs/getting-started.md now say what that really allows: those five can run anything, reach the network and write any path, so a member can run nearly anything unasked, and the deny list is a convenience. The two ./prove_the_relay_loads/ script rules are removed (no_hard_coding). The test "#310 F2" holds every starter rule to a command, never a path, and was red first.

24248d27 changed the clean-install proof, which runs inside the whole npm test (the installer job). It was re-run there after F2.

PR 318 (lazymartha L1, THE_EDITORS_SECTIONS/FIELDS) was not on main at this base, so the editor keeps its own lists here. Whichever of the two lands second makes the editor import them from the schema.

Proof at the tip: typecheck 0, the whole npm run verify 0, the whole npm test (through run_the_tests_in_a_namespace_of_their_own.sh, installer job included) 5864 tests / 0 fail, and check:private clean. The clean-install proof's own file was also run alone: 45/45 passed, 0 skipped. Its cases run the whole proof (init, approve, start).

Refs #310, and #307 (`martha down`). This is PR 5 of 5 landing Raf's owner/953-chat branch, per Saturnus's review REVIEW_2026-11-30_owner-953-chat. Based on main `256f3261`. Raf's 15 commits are cherry-picked unchanged (`992ab8a0`..`4dc3d8a8`): e7868386, 24248d27, c9de6205, 6297fcbc, 4bb57957, 3cccd9ef, d30d23e9, c37368e7, 4cfbcf0f, 0230e976, 1f727344, 6be69ce5, fd18b66c, bc59cd9d, 02e7e079. - **Order change:** `martha down` (4bb57957 → `44dde8e1`) moved here from PR 1. It builds on init's tmux file (e7868386) and the chat's `/quit` (9d291fe0, landed in #315). The review's required fix: - **`cc76cef5` F2**, as ruled. DECIDED 2026-11-30 "Wide starter, honest comment". The allow list keeps node, npm, git, cp and mv. The comment in `src/declare_a_solo_crew/the_files_a_crew_starts_with.ts` and the starter-rules paragraph in `docs/getting-started.md` now say what that really allows: those five can run anything, reach the network and write any path, so a member can run nearly anything unasked, and the deny list is a convenience. The two `./prove_the_relay_loads/` script rules are removed (no_hard_coding). The test "#310 F2" holds every starter rule to a command, never a path, and was red first. 24248d27 changed the clean-install proof, which runs inside the whole `npm test` (the installer job). It was re-run there after F2. PR 318 (lazymartha L1, THE_EDITORS_SECTIONS/FIELDS) was not on main at this base, so the editor keeps its own lists here. Whichever of the two lands second makes the editor import them from the schema. Proof at the tip: typecheck 0, the whole `npm run verify` 0, the whole `npm test` (through run_the_tests_in_a_namespace_of_their_own.sh, installer job included) 5864 tests / 0 fail, and check:private clean. The clean-install proof's own file was also run alone: 45/45 passed, 0 skipped. Its cases run the whole proof (init, approve, start).
A newly declared crew is written its starter permission policy at
.claude/settings.json and its own tmux file at .martha/tmux.conf, each only
where nothing is there already; a file the owner had is left exactly as it is,
and init says which it wrote or left. The rules are the owner's from then on and
`martha approve` is still what approves them.

`martha up` now sources .martha/tmux.conf after Martha's own settings, so a
binding the owner adds is read when the server starts and can override the
defaults. The file is written by init, never by up.

Tests: a new crew gets both files, an existing one is untouched, the config
sources the owner file last, and the start and wake flows approve the starter
config first.
`martha init` now writes .claude/settings.json, so the proof's `martha
approve` has a config to read and asks for the owner's yes; it now types it on
the same terminal instead of expecting "nothing to approve" and hanging.
`martha init` printed a path into the release tree for the one file that shows
every field a declaration may hold, so the options were only discoverable by
hunting through an installed release. It now copies docs/martha.full-example.json
to .martha/martha.full-example.json, once, only when nothing is there, and names
that copy in its last line. The release's own copy stays where docs point to it.

The example's file name is named once and the docs path is built from it, so the
copy, the test that declares the example and the line init prints cannot drift.
Instead of one copied example file, `martha init` copies the release's whole
docs tree to .martha/docs, only when nothing is there, so the declaration's
page, getting-started and the full example are beside the crew and their
relative links work. The line init prints names .martha/docs/martha.full-example.json,
where the options are, rather than a path into the installed release.
`martha down` stops every member through the same requests `martha stop` sends,
then closes only this crew's own tmux session on Martha's server; a session
another crew opened on that server is untouched, and the server is never killed.
If a member refuses to stop, the session is left open so the failure stays in
view. A crew that opens in kitty just stops its members.

Martha's tmux config now binds `prefix q` to that same `down`, with a
confirmation and the binary that opened the session, so ending the crew is one
key and needs no `tmux -L martha` from the owner. The binding is written before
the owner's `.martha/tmux.conf`, so their file can override it.
On a terminal `martha init` now asks which host runs the crew (martha-engine by
default for this standalone launcher, claude-code as the other), which terminal
opens it (tmux by default), which members with which roles, and which model
(the host's own when empty), then confirms once before writing. A member line
of name:role pairs lets a crew rename its builder or leave the reviewer out; the
solo mode's roles and hold_reviews follow the members.

`--host`, `--terminal`, `--members` and `--model` answer in place of their
question, and `--yes` takes the flags and the defaults with no questions. With
no terminal to ask on, init keeps the historical Claude Code default unless
`--host` names the engine, so a script's crew is unchanged; the engine's model
vocabulary is open and the Claude Code host's is checked against its recorded
names. The declaration writes the terminal, members and model the answers name.
Drops-test: src/declare_crew/the_drafts_declaration.node-test.ts :: #931: the engine is reached through the provider its profiles name, a bare host on https, the key file kept as written

Drops-test: src/declare_crew/the_drafts_declaration.node-test.ts :: #931: an engine endpoint is declared in one place, and the engine reaches one provider
DECIDED 2026-11-30 "Wide starter, honest comment" (Raf). The allow list keeps
node, npm, git, cp and mv. The comment and getting-started said the network
and history-overwriting acts were held back, but each of those five can run
anything, reach the network and write any path, so the deny list holds nothing
a member cannot do another way. Both now say so: a member started with these
rules can run nearly anything unasked, and the deny list is a convenience.

The two ./prove_the_relay_loads/ script rules are removed: they name Martha's
own repository and mean nothing in an owner's project (no_hard_coding). A test
holds every starter rule to a command, never a path (Saturnus's review of
owner/953-chat, F2).

Refs #310
Both sides added a verb: USAGE and ACTS_ALONE keep both `martha schema` and
`martha config`/`martha down`. USAGE is written on one line so the file stays
at the 1105-line cap after both sides' additions.
PR 318 (martha#317 L1) put THE_EDITORS_SECTIONS, THE_EDITORS_FIELDS,
THE_EDITORS_RULE_KEYS and THE_EDITORS_MESH_KEYS in
src/declare_crew/the_declarations_schema.ts, so one list drives both the
schema and the editor. The editor's own copies, identical value for value,
are removed and imported from there, and the editor's test imports them from
there too. No second copy is left.

Refs #310, #317
terra referenced this pull request from a commit 2026-11-30 19:16:05 +00:00
terra manually merged commit 99936b937c into main 2026-11-30 22:13:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha!320
No description provided.