martha init names the crew it declares, so a tmux crew opens with no name typed (martha#192) #194
Loading…
Reference in a new issue
No description provided.
Delete branch "pluto/192-init-writes-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (fix): the declaration
martha initwrites is onemartha upcan open in tmux without the owner inventing a name.Refs martha-ai/martha#192.
What was wrong
martha initwrote a declaration with noid, andidis the name of the crew's tmux session. On a host whose terminal is tmux,martha uprefused the crew init had just declared:The refusal is plain and names its fix, so nothing was silent. The gap was that the file init writes could not open in tmux without an edit init could have made: the name is the owner's to invent, and the workspace already is a name.
What changed
declareSoloCrewwrites anidas the first field of the declaration: the workspace folder in the letters a tmux session's name takes, then the first characters of the sha256 of the workspace's real path..,:and#are kept out, since tmux reads them in a name, andwhyNotATargetaccepts every name written.terminalstays the owner's choice: init still writes none, so a crew on a laptop still opens in kitty. Only the name, which no owner knows better than the workspace, is made.martha crewchange rewrites the declaration: the name it was given survives (asserted in the command case).Red first, and the mutant
The three #192 cases fail with the id line taken out of the writing call, which is main's behaviour:
#192: init names the crew in the declaration, ...- the written id isundefined#192: one workspace is always named the same, ...- the name matches no folder word and digest#192: martha init names the crew, and a crew it declared opens in tmux under that name, ...-typeof idis notstringWith the same mutant, run outside the suite through the real command, the refusal above is reproduced (exit 1). With the fix in place the same run writes
"id": "project-c110e846"and ends 0 withthe crew is in tmux session project-c110e846: martha attach shows it, from any terminal.Run here
Typecheck clean; lint clean on the touched files. The files that consume the declaration, all green:
src/declare_a_solo_crew/declare_a_solo_crew.node-test.ts(11)src/declare_a_solo_crew/write_a_changed_declaration.node-test.tssrc/declare_crew/declare_crew.node-test.ts,change_a_member.node-test.ts,the_drafts_declaration.node-test.ts,the_declaration_page.node-test.tssrc/run_the_martha_command/run_the_martha_command.node-test.ts(83),change_the_crew.node-test.tssrc/open_the_crew_in_tmux/open_the_crew_in_tmux.node-test.ts,the_commands_tmux_runs.node-test.tssrc/approve_a_checkouts_config/approve_a_checkouts_config.node-test.ts,src/bring_up_the_declared_crew/bring_up_the_declared_crew.node-test.ts162 tests in the first batch, plus the 83 of the command file.
Checks run here:
check:restated-values,check:no-import-cycle,check:marthas-names, andcheck:private --range origin/main..HEAD(nothing private).Not done here
The Done-when offered a second way:
martha upderiving a name when the declaration has none. This takes the first, so an owner's hand-written declaration with noidstill opens in kitty, and is still refused by name in tmux. Deriving one atupwould makeupwrite the config, which the declaration is; it is a small follow-up if wanted.