martha join: admit a Martha crew to a realm, ported from crew-code's join_crew #198
Closed
opened 2026-11-25 19:30:11 +00:00 by mars
·
4 comments
No Branch/Tag specified
main
vesta/372-lan-members
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
4 participants
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#198
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 (product): a Martha user admits their crew to a realm with Martha's own
martha join <invite>, so the realm video (artwork#2 segment 4a) shows Martha doing it, not crew-code.DECIDED 2026-11-25 (Raf, via the Supervisor): "i think it should be
martha join"Source to port: crew-code
join_crewin macula-io/macula-sponsors (crew-code/join_crew/bin/join.mjs, testsjoin_crew/test/join.node-test.mjs+enrolment.node-test.mjs). Keep its contract:invite_used→ what it means, what to do)Done when:
martha join <invite>exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired inbin/martha.Threat model first (realm admission). Build: Opus. Review: fable.
Note: the storyboard cites an old GitHub number (#310); this is the forge home for it.
Refs artwork#2
Threat model:
martha join(realm admission), before any codePort source: macula-io/macula-sponsors
crew-code/join_crewat d26135d. The ceremony stays the realm's (macula-realm#107): read invite, the realm answers for itself, the realm proves its key (R9), each node signs its part, the operator signs in, the owner approves, credential written. Nothing in Martha decides admission; the realm does.Attacker considered: someone OUTSIDE the crew. That is someone who sees or alters the invite on its way, runs a host at another address, or sits on the network. The crew and the machine's user are trusted (DECIDED 2026-11-24).
What is protected
Threats and what holds each
T1. The secret leaks through argv, shell history, the process list or output.
--invite-fileonly.martha join <anything>is refused with exit 2. The refusal says the invite given that way is spent. It never quotes the argument.T2. An altered or phishing invite names the attacker's host.
mesh.realmis a NAME, the pin is Martha's own derivation,https://realm.<name reversed>(resolve_the_crews_realm). A crew that writes the name therefore needs no extra flag.mesh.realmis a hex id, the pin is--realm-origin. Without it, the address is printed with the crew-code warning.T3. A host at the right-looking address serves a copy of the real realm's document.
macula-mcp-realm crew-challenge nonce, and the answer is checked bycrew-challenge checkagainst the invite's key id.mesh.realm(by name, or by id). Whenmartha upalready keptrealm.json, its key must be the one served.T4. Downgrade or redirect.
redirect: 'error'on every request.--originand--realm-originare held to the invite's own origin rule.T5. A relay swaps the secret or the members after signing.
T6. A captured status poll is replayed.
crew_redeem_status.T7. A hostile realm answer writes outside its place, or names a wrong room.
<MACULA_MCP_REALM_DIR or ~/.config/macula-mcp/realm>/<node id hex>/<realm name>.json.T8. A hostile or slow realm holds the command, or a loop hammers the realm.
--wait-secs(default 900).--no-waitpolls once.martha join --poll <id> --origin <addr>, so nothing is redeemed twice.T9. The admission overwrites a person's credential.
tier: citizencredential, or one with a refresh token, is kept and reported.T10. A node signs with a key that is not the member's own (macula-mcp falls back to HOME or makes a key).
mesh_key, else<mesh.keys>/agent-<name>.key.MACULA_MCP_IDENTITY. There is never aMACULA_MCP_AGENTfallback.mesh.keys.Mapping crew.json onto the declaration
--operator <member>, defaulting to the one member with rolesupervisor. None or several gives exit 2.mesh.realm.Shared room (exit 3)
crew-code's board read (
get_crewintoshared_room.json) is crew-code's own file. Martha keeps the admitted answer (realm id, crew name, room topic) in the crew's state asrealm_admission.json, somartha whereshows it. Exit 3 stays: an admitted room topic that is not a room topic is refused, after the credential is written. Wiring the room into members' channels is NOT in this package.Tests (Done-when 2 and 3)
ioOfThisProcess, so no test reaches an outside service.Done-when 4
A live DEV run needs an invite issued by the DEV realm's owner. I will ask for it through Mars when the build passes review.
Done-when 4: one live DEV-realm run, from the branch tip
67153d74(CI 4953-4956 green), 2026-11-26.Setup: a throwaway team crew (operator Lead, supervisor; member Builder) declared with
mesh.realm: net.beam-campus. Each member's key was made by the recorded macula-mcp's own node-id bin; Martha made none. The invite came by file only and is never shown.Command, from the crew's project directory:
The operator signed in on the printed link as the invited address and confirmed. The page showed the crew and both node ids. The realm admin approved on /admin/crews at about 01:23Z.
Output (stdout; stderr empty), exit 0:
Afterwards, one read:
martha wheregivesMODE=teamandREALM_ADMISSION=<crew state>/realm_admission.json(0600), holding{"realm_id":"71375c4c…3bde","crew_name":"martha_198_check","room_topic":null}.Along the way: the operator address had no DEV sign-in account, so the first sign-in got Hanko's "address is not recognized" mail. The address signed up once (DEV self-service, per the Supervisor's ruling), and the open redeem was confirmed with no second invite.
Run 5213's red "gate coverage" (task 17268, PR 204 tip
a649fcb3): box or code? (Supervisor's ask)It ran on build00-martha-bwrap, the new Hetzner box's bwrap runner, on its first full run after the DNS fix. Steps 1-14 are green, including the sandbox and the full
npm test. Step 15, the suite under a long TMPDIR reached through a link, has exactly 1 failure in 5575 tests:This is the repo's own leak guard: a child process was still alive when the file ended. There is no ENAMETOOLONG, no socket-path or EADDRINUSE error, no timeout and no DNS error. The same file passed in step 14 on the same box.
Host00 comparison:
a649fcb3never ran on host00-martha-bwrap, so there is no same-tip read. The nearest green host00 gate run is 5209 (d7019e74, task 17243). Its step 15 is green, and the same file passed in both passes. That tip has 25 fewer tests, though, so it's not the same code.Reading: not box-shaped. It looks like a cleanup race in that test (
t.afterdoes not wait for the child to exit), not a path-length difference. That's not proven. The next build00 data point is task 17358 (run 5221,5e38f17f), running now. If step 15 is red there on a tip whose host00 run is green, I'll treat it as the box and take build00's bwrap runner offline. The bwrap runner stays up until then.martha helpstill promises an hourly status that was cut, andmartha statusreads a stream nothing writes #290Done-when check against main
3f092f10(PR #204 at08f91000, PASS r=6, landed in batch PR #284 as7add9fe3on 2026-11-27):martha join <invite>exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired inbin/martha": MET.src/join_a_realm_with_an_invite/.architecture/c4_diagrams.tsjoin_a_realm_with_an_invite, with its row inarchitecture/README.md.SUPERVISORconstant.run_the_martha_command.tsroutesjointojoinOfandjoinARealmHere,bin/martharuns that command, andUSAGEnames it.--invite-file, never from an argument.src/run_the_martha_command/join_a_realm.node-test.tshas "#198 exit 0", two "exit 1", two "exit 2", "exit 3" and three "exit 4".the_invite_and_the_words.node-test.tsalso checks every mangled invite and every misuse is never quoted.7add9fe3^1=7ba0daf9) had nojoincommand and no join slice, so every one of these tests was red there. The tests landed in the same PR as the code; no separate red commit was kept.3f092f10, run in their own namespace: the slice's 28 tests andjoin_a_realm.node-test.ts's 12 tests, 40 pass and 0 fail.a_realm_stand_in.tsgives the realm and the realm CLI as functions in the join's io.the_realms_own_answers.json, which names its source beside each one: macula-realm973b5b88files, and macula-mcp v0.51.6 for the CLI lines.fetch,https.requestor a socket.martha join --invite-file ... --wait-secs 1500against net.beam-campus on 2026-11-26, with its full output, exit 0, and the credential written 0600 in a 0700 directory.Every line is met. Closing.