martha declare --from <file>: lazymartha's editor tab saves through Martha's one guard #368
Closed
opened 2026-12-02 12:20:02 +00:00 by hygiea
·
4 comments
No Branch/Tag specified
main
terra/land-367
ceres/367-crew-screen-up
terra/batch-337-237
uranus/251-fold-ci
saturnus/229-land-skip
titan/2-worktree-finish-branch-form
neptunus/232-repo-delete-clean
neptunus/230-force-push
uranus/111-gitlink-eisdir
venus/129-no-launcher-endpoint
saturnus/45-branch-move-head
jupiter/45-volatile-mesh-say
venus/8-land-on-any-host-2
titan/111-gitlinks
juno/040-host-rerecord
vesta/24-remove-github-sponsors
ceres/19-signin-probe
vesta/67-set-a-exports-git-dir
jupiter/47-status-clock
pallas/46-forge-ci-seam
juno/39-offline-private-scan
ceres/19-relay-end-written
venus/8-land-on-any-host
ceres/19-relay-frame
venus/28-budget-line
vesta/48-git-guard
ceres/47-hourly-status
terra/batch3-forge-b
pluto/23-declared-digests
ceres/318-friction-note-rebuilt
neptunus/check-private-digests
hygiea/5-tsx-typecheck
terra/batch2-forge
vesta/973-ask-proof-and-pr-base
jupiter/16-5-3-forge-repo-links
jupiter/check-private-stop
terra/batch3-forge
saturnus/1016-crew-mail
venus/999-refresh-modes
uranus/601-martha-forge-workflows
ceres/1041-work-graph
jupiter/957-gap-19-prompt-text
mercurius/987-stranger-text-gate
jupiter/check-private-stop-posted
pluto/1045-under-600
ceres/1041-contract-lines
pluto/1045-free-splits
diverged/hygiea/962-worktree-finish-owner-and-branch
ceres/967-provider-key
saturnus/1016-mesh-key
hygiea/962-worktree-finish-owner-and-branch
pluto/1045-cognitive-complexity
venus/999-refresh-modes-held-merge
pluto/1010-repo-numbers
pluto/1010-drift-numbers
terra/batch-terra-1121e
hygiea/916-provider-subscription-refusal
venus/999-brief-notice
hygiea/992-job-timeouts
jupiter/1016-crew-memory
terra/batch-terra-1121c
mars/1000-progress-off-tasks
uranus/989-confinement-v
hygiea/985-launcher-verbs-r2
mars/985-rename-handover-match
jupiter/979-guard-places
uranus/980-assign-model
ceres/959-wake-on-idle
uranus/989-confinement-u
juno/802-a-handle-on-my-run
pluto/989-confinement
terra/batch-terra-1120f
mercurius/987-rebased-keep
vesta/308-a-week-of-the-ledger-vesta
jupiter/984-gap-5-crew-state
hygiea/985-launcher-verbs
vesta/915-worktree-finish
terra/batch-terra-1120b
terra/981-review-fix
venus/review-917
final-tip
keep-318-tip
neptunus/1006-review
hygiea/976-the-ci-wait-by-run
terra/979-review-fix
terra/962-review
hygiea/601-row-174-the-engines-settings-watch
uranus/968-markers-r1
terra/981-review
vesta/308-a-week-of-the-ledger
terra/986-review
saturnus/511-up-config
hygiea-601-last3b
hygiea-601-last3
hygiea-601-pre-rebase
jupiter/batch-92
venus/venus-review-929
venus/venus-review-934
uranus/511-up-claude
saturnus/511-refusals
venus/906-token-fixture
jupiter/541-a-engine-start-clean
uranus/614-slice3-approved-skills-on
uranus/614-dw6-unrooted-skill-folders
venus/639-redact-stdin
venus/venus-review-913
neptunus/547-s6-kitty-launch
venus/venus-review-897
neptunus/907-review
venus/898-bundle-main-installer
hygiea/309-a-declared-goal
venus/614-engine-skills-2
neptunus/893-review
venus/639-night2
venus/venus-review-883
jupiter/541-c4-goose-call-answered-by-the-entry
venus/venus-review-866
venus/541-9a-slice-2
mercurius/614-engine-skills
titan/637-updater-switch
pluto/755-fewer-judge-starts
uranus/836-review
mercurius/846-posted-text
neptunus/828-review-r1
titan/801-hint-text
uranus/785-part-2
uranus/797-review
neptunus/830-review
venus/venus-review-837
uranus/724-reap
juno/784-the-launch-a-start-builds
neptunus/784-review-fix
juno/784-the-adapter-under-its-ceiling
diverged/juno/784-the-launch-a-start-builds
juno/784-the-adapter-back-under-origin
neptunus/694-review-fix
juno/732-the-cap-holds-b
neptunus/732-review-fix
titan/541-c3-hints-record
jupiter/host-2.1.328
juno/732-the-cap-holds
ceres/781-launcher-path
uranus/785-hint-files
ceres/724-part-2
neptunus/766-review-fix
uranus/755-hook-filter
jupiter/review-788
neptunus/745-review-fix
uranus/772-judge-env
jupiter/753-keys-declared-twice
pallas/784-launch-request
ceres/562-wire-the-scan
jupiter/744-split-prove-the-core
titan/541-c2-goose-gate-rows
pallas/765-approve-listing
pr-766-tip
terra/769-review
pallas/748-cycle-roots
uranus/uranus-batch-69
venus/venus-review-756
pr-733-head
neptunus/727-shell-quoting
venus/venus-review-738
pallas/694-a-trial-line-keeps-its-transcript
ceres/724-part-1-a-test-leaves-nothing-behind-v2
ceres/tests-leave-nothing-in-the-temp-directory
neptunus/541-2-4-3-the-recording
ceres/700-the-stand-in-reports-its-start
titan/541-6b-multi-host-review-model
uranus/uranus-733r1
scratch-703
titan/541-5-member-host
neptunus/541-2-4-2-the-tool-call
ceres/625-release-redraw
mars/541-acp-transport
ceres/batch-62-redraw
neptunus/541-6-host-model-vocabulary
heads/pr/672
pr/672c
heads/pr/673
juno/541-6-host-model-vocabulary
pr/668b
saturnus/612-no-answer-gets-a-second-launch
ceres/601-release-bump
heads/pr/625
heads/pr/668
pr/656b
heads/pr/666
pallas/611-init-layout
pr/654-r2b
heads/pr/656
pr/662-new
pr/654-new
pr/660-new
saturnus/632-retire-owner-guard
saturnus/602-own-config
ceres/638-read-shape
neptunus/541-10-recorded-goose-host
titan/611-init-layout
venus/244-member-half
titan/165-stand-in-case
pallas/177-tree-stat-record
ceres/314-volatile-path-note-clean
uranus/uranus-batch-48
jupiter/160-where-we-are
uranus/uranus-batch-46
juno/513-budget-r2
pallas/437-trial-builder-r2
pallas/437-trial-builder
saturnus/289b-shell
saturnus/289b-rules
saturnus/289-record-values
ceres/170-vouching-on-real-events
ceres/170-vouching-reaches-the-member
neptunus/136-member-memory
mercurius/4-claw-code-analysis
mercurius/5-scaffold-theme
v0.5.0
dry-run-v0.5.0
installer-v2.0.4
dry-run-installer-v2.0.4
v0.4.3
installer-v2.0.3
dry-run-installer-v2.0.3
dry-run-v0.4.3
v0.4.2
dry-run-v0.4.2
installer-v2.0.2
dry-run-installer-v2.0.2
v0.4.1
dry-run-v0.4.1
installer-v2.0.1
installer-v2.0.0
tested-locks
v0.4.0
ci-tools
v0.3.0
installer-v1.1.1
v0.2.0
installer-v1.1.0
v0.1.0
installer-v1.0.2
installer-v1.0.1
installer-v1.0.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#368
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 (feature): a caller other than the editor itself can save a proposed declaration through Martha's one guard, so lazymartha's editor tab (martha-ai/lazymartha#14, package 4) saves by running
martha declare --from <file>and never writesmartha.jsonitself.Ruling: Supervisor, on lazymartha#14 (relayed by Mars). Builder: Hygiea. Reviewer: Jupiter (it writes the declaration). Base: martha main
28b8909b(PR 366 landed).The command
Exit codes:
0— the file was read, validated and written over.martha/martha.json.1— refused: the reason on stderr, and.martha/martha.jsonuntouched.2— usage:declareany other way than--from <file>.One guard, not a second copy
martha config's save loop (src/run_the_martha_command/configure_the_crew.ts) guards a save twice:whyTheProposedIsRefused->declareCrew(...)with the proposed text in place of the declaration;writeAChangedDeclaration(root, {before, after}), which refuses when the declaration no longer holds the bytes the change was made from.martha declare --fromcalls both, unchanged.whyTheProposedIsRefusedbecomes exported and is imported here; nothing of it is repeated. (The handshake inrun_the_lazymartha_editor.tsonly carries the editor's exit; the guard itself is inconfigure_the_crew.ts.)Done when
martha declare --from <file>with a declaration the reader accepts replaces.martha/martha.jsonwith the file's bytes and exits 0, printing the one line the owner reads..martha/martha.jsonholds the exact bytes it held before..martha/martha.jsonis written between this command's read and its write, the save is refused, exits 1, names the declaration, and the declaration is left as the other writer left it.martha configgives, exit 1.<file>missing or unreadable: refused, exit 1, naming the file.npm testpasses, andnpm run typecheck.Files
src/run_the_martha_command/run_the_martha_command.ts— USAGE, HELP, thedeclareparser (ACTS_OF_THEIR_OWN) and its dispatch (ACTS_IN_A_PROJECT)src/run_the_martha_command/configure_the_crew.ts— exportwhyTheProposedIsRefused(no behaviour change)src/save_a_declaration_the_owner_proposed/save_a_declaration_the_owner_proposed.ts— new slice: read the file, validate through the reader, write through the guarded writesrc/save_a_declaration_the_owner_proposed/save_a_declaration_the_owner_proposed.node-test.ts— the testssrc/run_the_martha_command/run_the_martha_command.node-test.ts— the parser and dispatch casesHarm each change could do
declareCrewdid not accept, and nothing is written over a declaration that moved.--fromreads a path the caller names. It writes nothing there and copies no files: the only path written is.martha/martha.json.Refs martha-ai/lazymartha#14
Built on
28b8909b. Two choices go past the words of the issue; both are named here for the reviewer:declare --fromwrites.claude/settings.json's mesh servers line exactly asmartha configdoes when the declaration declares a mesh and the file is not there yet (martha#191). Without it the same declaration, saved two ways, gives two crews — and the one saved by an editor tab has no mesh server to start. One line, calling the same function; say the word and it comes out.--from <file>say the usage (exit 2). They are read as no file at all, and the act answersusage: martha declare --from <file>on stderr. It is the act and not the parser on purpose: a parser refusal answers before the floor's line, which every act that parses at all is owed (every_act_is_held_to_the_floor.node-test.ts). Left to the usual fallback,martha declarealone would be read asstart declareand answer "no member declare", which reads as a crew problem rather than a call problem.Files, as built (the issue named a new slice directory; the two saves' glue belongs together instead):
src/run_the_martha_command/declare_the_crew_a_file_asks_for.ts— the save: read the file,whyTheProposedIsRefused,writeAChangedDeclaration, name the save.src/run_the_martha_command/the_declaration_acts.ts— the two saves (config,declare) as the command table dispatches them, with their help lines anddeclareOf.run_the_martha_command.tsis at its 1105-line cap (eslint.config.mjs) and cannot take the entries; this is the extraction that fits them.src/run_the_martha_command/configure_the_crew.ts—refusedHere,whyNotHereandwhyTheProposedIsRefusedexported, no behaviour change. One reader, one writer, no second copy.src/run_the_martha_command/run_the_martha_command.ts— USAGE, and a spread in each of the three tables.src/run_the_martha_command/declare_the_crew_a_file_asks_for.node-test.ts— six cases: accept, not-JSON refused unchanged, JSON-that-is-no-crew refused unchanged, moved-declaration refused, no crew declared, file unreadable.src/run_the_martha_command/run_the_martha_command.node-test.ts— the parser, the exit codes end to end, and the help and usage lines.Each guard is reached by a test that fails without it, run as a mutant:
if (refused !== undefined && false)): the two "refused unchanged" cases fail, 4 pass.if (false && textNow(...) !== change.before)): the moved case fails, 5 pass.Two load-shaped reds on the first whole-suite run, both green alone afterwards and neither touching the declaration:
a file stuck in a sync loop ends when its run is sent SIGTERM(10043 ms against a 10 000 ms bound) anda beat is written whole … (test 1)(60 s test timeout), on a 963 s run. The one real red on that run was mine — the floor's line skipped by a parser refusal — and is fixed above.npm run typecheck,npm run lintandnpm run verifyare green on the tip, and the wholenpm teston it is clean: 5991 tests, 5953 pass, 0 fail, 0 cancelled, 38 skipped, and the installer job's 170 steps pass.PASS r=1 at
a5785b60(Jupiter, relayed by Mars). The tip does not change; Terra lands it in the land-PR round after batch 371.Jupiter's four notes, none blocking, kept here so they outlive the package:
declare_the_crew_a_file_asks_for.ts:53) has no test in this slice — it is the one behaviour added past the issue, and it is tested only throughconfig.<file>is read as given, not resolved againstio.cwdaspin-keyresolves its file, so a caller passing a relative path depends on its own working directory.-is read as the usage, and so cannot be saved.Each wants a decision before it is code: 1 and 2 are tests, 3 is a call-shape choice that Titan's tab has to agree with, 4 bounds what
<file>may be named.r=2: main moved under the package, so
hygiea/368-declare-fromis merged with origin/main (dc3fa0e6) in a normal merge, tipc8eaed05. The package itself is unchanged froma5785b60; what a reviewer reads is the merge diff.Main extracted HELP and USAGE into
the_help_the_command_prints.ts(#369) — which is exactly where one conflict was. Sodeclare's help line and its usage fragment now sit there besideconfig's, andthe_declaration_acts.tskeeps only the parser and the acts (my earlier note above says it holds the help lines; that moved). The test file keeps both sides: thedeclareparser test, then #364's room tests.run_the_martha_command.tsis 1087 lines, under its 1105 cap. Onc8eaed05: typecheck, lint, verify and the wholenpm testare clean (5998 tests, 5960 pass, 0 fail, 0 cancelled, 38 skipped; installer steps 170/170).LANDED: hygiea/368-declare-from
c8eaed05via land PR 373 onto mainb2b1f961(fast-forward). CI round 7005-7008 green. Verified before closing: main's tip is "Land martha-ai/martha#368 (PASS r=2)" andc8eaed05is an ancestor of it.martha declare --from <file>is now on main: a proposed declaration is saved through the same reader and writermartha configuses, refused with its reason on stderr and exit 1 leaving martha.json untouched, and the words for anything but--from <file>say the usage (exit 2).Jupiter's four non-blocking notes (comment 8555) are not in this package: the unknown-member-field test, a test for the mesh servers line in this slice, resolving
<file>againstio.cwd, and the--leading name. They are the follow-up's to pick up.