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
Member

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_crew in macula-io/macula-sponsors (crew-code/join_crew/bin/join.mjs, tests join_crew/test/join.node-test.mjs + enrolment.node-test.mjs). Keep its contract:

  • exit codes 0 admitted / 1 realm refused or stopped watching / 2 invite or config unusable / 3 shared room wrong / 4 realm unreachable, not the named or pinned realm, admitted elsewhere, or cannot prove the invite's key (R9)
  • nothing in Martha holds a key: proofs come from macula-mcp's own CLI
  • a named refusal is explained in words (e.g. invite_used → what it means, what to do)
  • the invite is a secret: a parse error never echoes the argument

Done when:

  1. martha join <invite> exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired in bin/martha.
  2. Each exit code above has a test, red-first on main; the invite never appears in any output (test).
  3. No test reaches an outside service: the realm is a local stand-in whose replies are copied from the real realm.
  4. One live run against a DEV realm, recorded on this issue (command + output), once.

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

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_crew` in macula-io/macula-sponsors (`crew-code/join_crew/bin/join.mjs`, tests `join_crew/test/join.node-test.mjs` + `enrolment.node-test.mjs`). Keep its contract: - exit codes 0 admitted / 1 realm refused or stopped watching / 2 invite or config unusable / 3 shared room wrong / 4 realm unreachable, not the named or pinned realm, admitted elsewhere, or cannot prove the invite's key (R9) - nothing in Martha holds a key: proofs come from macula-mcp's own CLI - a named refusal is explained in words (e.g. `invite_used` → what it means, what to do) - the invite is a secret: a parse error never echoes the argument Done when: 1. `martha join <invite>` exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired in `bin/martha`. 2. Each exit code above has a test, red-first on main; the invite never appears in any output (test). 3. No test reaches an outside service: the realm is a local stand-in whose replies are copied from the real realm. 4. One live run against a DEV realm, recorded on this issue (command + output), once. 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
Member

Threat model: martha join (realm admission), before any code

Port source: macula-io/macula-sponsors crew-code/join_crew at 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

  • A1, the invite's secret: a bearer credential until it is spent.
  • A2, the crew's admission: which realm the crew ends up in, and which nodes are in it.
  • A3, the machine's realm credential: a person's own citizen credential must survive.

Threats and what holds each

T1. The secret leaks through argv, shell history, the process list or output.

  • The invite is read from standard input or --invite-file only.
  • martha join <anything> is refused with exit 2. The refusal says the invite given that way is spent. It never quotes the argument.
  • Parse refusals never quote invite text. crew-code's partsOf can put the secret into the id slice when an invite is mangled.
  • The body reaches macula-mcp on stdin, never on a command line.
  • Test: across every exit path, the full invite and its secret appear in no stdout or stderr.

T2. An altered or phishing invite names the attacker's host.

  • The realm address is pinned before anything is fetched.
    • When mesh.realm is 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.
    • When mesh.realm is a hex id, the pin is --realm-origin. Without it, the address is printed with the crew-code warning.
  • A different address gives exit 4, and nothing is fetched.

T3. A host at the right-looking address serves a copy of the real realm's document.

  • R9 challenge: a fresh nonce from macula-mcp-realm crew-challenge nonce, and the answer is checked by crew-challenge check against the invite's key id.
  • The secret leaves only after macula-mcp says ok with exit 0. Exit code and line must agree.
  • The signed realm id must equal the document's realm id.
  • The document's realm must be the declared mesh.realm (by name, or by id). When martha up already kept realm.json, its key must be the one served.
  • Any failure is exit 4.

T4. Downgrade or redirect.

  • https only, with Node's own certificate check.
  • redirect: 'error' on every request.
  • --origin and --realm-origin are held to the invite's own origin rule.

T5. A relay swaps the secret or the members after signing.

  • The operator's proof covers the whole body.
  • Each member's proof names the invite and the operator.
  • The realm verifies both (R6). This is unchanged from crew-code.

T6. A captured status poll is replayed.

  • Each poll carries a fresh proof from macula-mcp under procedure crew_redeem_status.

T7. A hostile realm answer writes outside its place, or names a wrong room.

  • The credential path is <MACULA_MCP_REALM_DIR or ~/.config/macula-mcp/realm>/<node id hex>/<realm name>.json.
    • The node id is 64 hex, from macula-mcp.
    • The realm name is held to the grammar.
    • The crew name is never a path part.
  • The admitted realm id must be the one shown, else exit 4 and nothing is written.
  • The admitted room topic must be a room topic, else exit 3.

T8. A hostile or slow realm holds the command, or a loop hammers the realm.

  • Each request has a timeout and a size cap (Martha's A_REALMS_ANSWER_* values).
  • There is no retry.
  • Polls are every 3 s, which is the realm's own interval. They stop at --wait-secs (default 900).
  • --no-wait polls once.
  • An interrupted run prints martha join --poll <id> --origin <addr>, so nothing is redeemed twice.

T9. The admission overwrites a person's credential.

  • A held tier: citizen credential, or one with a refresh token, is kept and reported.
  • Otherwise the credential is written atomically at 0600 in a 0700 directory.

T10. A node signs with a key that is not the member's own (macula-mcp falls back to HOME or makes a key).

  • Each member's key path comes from read_a_members_mesh_key's rules: mesh_key, else <mesh.keys>/agent-<name>.key.
  • The key must be a regular file, the user's own, mode 0600, and not shared with another member.
  • The path is passed as MACULA_MCP_IDENTITY. There is never a MACULA_MCP_AGENT fallback.
  • A solo crew carries no mesh identity, so it is refused with exit 2 and told it needs a team crew with mesh.keys.

Mapping crew.json onto the declaration

  • Operator: --operator <member>, defaulting to the one member with role supervisor. None or several gives exit 2.
  • Members: every other declared, unparked member.
  • Realm: mesh.realm.
  • The licence: none. The realm checks seats.

Shared room (exit 3)

crew-code's board read (get_crew into shared_room.json) is crew-code's own file. Martha keeps the admitted answer (realm id, crew name, room topic) in the crew's state as realm_admission.json, so martha where shows 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)

  • One test per exit code, red first on main.
  • The realm is a local https stand-in. Its JSON answers are copied from macula-realm's own controller replies, with the source file and sha named in the fixture.
  • macula-mcp-realm is a stand-in script. Its lines are copied from the real CLI's output.
  • The real fetch and spawn exist only in 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.

## Threat model: `martha join` (realm admission), before any code Port source: macula-io/macula-sponsors `crew-code/join_crew` at 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 - A1, the invite's secret: a bearer credential until it is spent. - A2, the crew's admission: which realm the crew ends up in, and which nodes are in it. - A3, the machine's realm credential: a person's own citizen credential must survive. ### Threats and what holds each **T1. The secret leaks through argv, shell history, the process list or output.** - The invite is read from standard input or `--invite-file` only. - `martha join <anything>` is refused with exit 2. The refusal says the invite given that way is spent. It never quotes the argument. - Parse refusals never quote invite text. crew-code's partsOf can put the secret into the id slice when an invite is mangled. - The body reaches macula-mcp on stdin, never on a command line. - Test: across every exit path, the full invite and its secret appear in no stdout or stderr. **T2. An altered or phishing invite names the attacker's host.** - The realm address is pinned before anything is fetched. - When `mesh.realm` is 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. - When `mesh.realm` is a hex id, the pin is `--realm-origin`. Without it, the address is printed with the crew-code warning. - A different address gives exit 4, and nothing is fetched. **T3. A host at the right-looking address serves a copy of the real realm's document.** - R9 challenge: a fresh nonce from `macula-mcp-realm crew-challenge nonce`, and the answer is checked by `crew-challenge check` against the invite's key id. - The secret leaves only after macula-mcp says ok with exit 0. Exit code and line must agree. - The signed realm id must equal the document's realm id. - The document's realm must be the declared `mesh.realm` (by name, or by id). When `martha up` already kept `realm.json`, its key must be the one served. - Any failure is exit 4. **T4. Downgrade or redirect.** - https only, with Node's own certificate check. - `redirect: 'error'` on every request. - `--origin` and `--realm-origin` are held to the invite's own origin rule. **T5. A relay swaps the secret or the members after signing.** - The operator's proof covers the whole body. - Each member's proof names the invite and the operator. - The realm verifies both (R6). This is unchanged from crew-code. **T6. A captured status poll is replayed.** - Each poll carries a fresh proof from macula-mcp under procedure `crew_redeem_status`. **T7. A hostile realm answer writes outside its place, or names a wrong room.** - The credential path is `<MACULA_MCP_REALM_DIR or ~/.config/macula-mcp/realm>/<node id hex>/<realm name>.json`. - The node id is 64 hex, from macula-mcp. - The realm name is held to the grammar. - The crew name is never a path part. - The admitted realm id must be the one shown, else exit 4 and nothing is written. - The admitted room topic must be a room topic, else exit 3. **T8. A hostile or slow realm holds the command, or a loop hammers the realm.** - Each request has a timeout and a size cap (Martha's A_REALMS_ANSWER_* values). - There is no retry. - Polls are every 3 s, which is the realm's own interval. They stop at `--wait-secs` (default 900). - `--no-wait` polls once. - An interrupted run prints `martha join --poll <id> --origin <addr>`, so nothing is redeemed twice. **T9. The admission overwrites a person's credential.** - A held `tier: citizen` credential, or one with a refresh token, is kept and reported. - Otherwise the credential is written atomically at 0600 in a 0700 directory. **T10. A node signs with a key that is not the member's own** (macula-mcp falls back to HOME or makes a key). - Each member's key path comes from read_a_members_mesh_key's rules: `mesh_key`, else `<mesh.keys>/agent-<name>.key`. - The key must be a regular file, the user's own, mode 0600, and not shared with another member. - The path is passed as `MACULA_MCP_IDENTITY`. There is never a `MACULA_MCP_AGENT` fallback. - A solo crew carries no mesh identity, so it is refused with exit 2 and told it needs a team crew with `mesh.keys`. ### Mapping crew.json onto the declaration - Operator: `--operator <member>`, defaulting to the one member with role `supervisor`. None or several gives exit 2. - Members: every other declared, unparked member. - Realm: `mesh.realm`. - The licence: none. The realm checks seats. ### Shared room (exit 3) crew-code's board read (`get_crew` into `shared_room.json`) is crew-code's own file. Martha keeps the admitted answer (realm id, crew name, room topic) in the crew's state as `realm_admission.json`, so `martha where` shows 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) - One test per exit code, red first on main. - The realm is a local https stand-in. Its JSON answers are copied from macula-realm's own controller replies, with the source file and sha named in the fixture. - macula-mcp-realm is a stand-in script. Its lines are copied from the real CLI's output. - The real fetch and spawn exist only in `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.
Member

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:

martha join --invite-file <the invite file> --wait-secs 1500

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:

[1] the realm, as it answers for itself
    realm "net.beam-campus" at its own address
      realm id:  71375c4cece3644f708db94bff6e6669b1400c7b87def2548d125c36cd393bde
      key id:    863c 7245 e57a 8746 ad99 6033 1ed5 0fb6 d6d8 65b7 2ff0 d8a1 aea3 3570 5e1e 469e  (pq_hybrid, the realm's own claim)
    address checked against the one pinned by the realm's name, net.beam-campus: https://realm.beam-campus.net
    the realm signs this machine's challenge: it holds the key your invite names
[2] this crew, as it asks to join
    operator "Lead" (00180fdb48e75b608cf1cccb7961a7b9fae67c445051c7d94a2dcb1c6ab01e31)
    member "Builder" (0062a9bec1468dce4a3e987547d11fbcf8c0c76cf9a97df35e0ca0411a6a8428)
[3] the operator signs in, and the realm owner approves
    Open this link and sign in as the address the owner invited:
    https://realm.beam-campus.net/crew_redeems/01a21568-283e-728b-9b43-4c24f675d2dc
    Then ask the realm owner to approve the crew's request on the realm's admin page.
    If this stops before the realm answers, pick it up again with: martha join --poll 01a21568-283e-728b-9b43-4c24f675d2dc --origin https://realm.beam-campus.net
    waiting for the operator to sign in
    waiting for the realm owner to approve
    admitted
[4] the realm admitted this crew as "martha_198_check"
    realm credential: /home/rl/.config/macula-mcp/realm/00180fdb48e75b608cf1cccb7961a7b9fae67c445051c7d94a2dcb1c6ab01e31/net.beam-campus.json
    admission kept: /home/rl/.claude/sessions/saturnus-198/live/state/martha/crews/bf392c10b4106b8243aa1cfc7f675d1372459cd004f31d3006b8652e71cfaa20/realm_admission.json
    room: the realm named no room for this crew

Afterwards, one read:

  • martha where gives MODE=team and REALM_ADMISSION=<crew state>/realm_admission.json (0600), holding {"realm_id":"71375c4c…3bde","crew_name":"martha_198_check","room_topic":null}.
  • The realm credential is 0600 in a 0700 directory under macula-mcp's realm directory, keyed by the operator's node id.
  • The real realm named no room, so this is the exit-0 "no room named" path from the PR.

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.

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: ``` martha join --invite-file <the invite file> --wait-secs 1500 ``` 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: ``` [1] the realm, as it answers for itself realm "net.beam-campus" at its own address realm id: 71375c4cece3644f708db94bff6e6669b1400c7b87def2548d125c36cd393bde key id: 863c 7245 e57a 8746 ad99 6033 1ed5 0fb6 d6d8 65b7 2ff0 d8a1 aea3 3570 5e1e 469e (pq_hybrid, the realm's own claim) address checked against the one pinned by the realm's name, net.beam-campus: https://realm.beam-campus.net the realm signs this machine's challenge: it holds the key your invite names [2] this crew, as it asks to join operator "Lead" (00180fdb48e75b608cf1cccb7961a7b9fae67c445051c7d94a2dcb1c6ab01e31) member "Builder" (0062a9bec1468dce4a3e987547d11fbcf8c0c76cf9a97df35e0ca0411a6a8428) [3] the operator signs in, and the realm owner approves Open this link and sign in as the address the owner invited: https://realm.beam-campus.net/crew_redeems/01a21568-283e-728b-9b43-4c24f675d2dc Then ask the realm owner to approve the crew's request on the realm's admin page. If this stops before the realm answers, pick it up again with: martha join --poll 01a21568-283e-728b-9b43-4c24f675d2dc --origin https://realm.beam-campus.net waiting for the operator to sign in waiting for the realm owner to approve admitted [4] the realm admitted this crew as "martha_198_check" realm credential: /home/rl/.config/macula-mcp/realm/00180fdb48e75b608cf1cccb7961a7b9fae67c445051c7d94a2dcb1c6ab01e31/net.beam-campus.json admission kept: /home/rl/.claude/sessions/saturnus-198/live/state/martha/crews/bf392c10b4106b8243aa1cfc7f675d1372459cd004f31d3006b8652e71cfaa20/realm_admission.json room: the realm named no room for this crew ``` Afterwards, one read: - `martha where` gives `MODE=team` and `REALM_ADMISSION=<crew state>/realm_admission.json` (0600), holding `{"realm_id":"71375c4c…3bde","crew_name":"martha_198_check","room_topic":null}`. - The realm credential is 0600 in a 0700 directory under macula-mcp's realm directory, keyed by the operator's node id. - The real realm named no room, so this is the exit-0 "no room named" path from the PR. 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.
Member

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:

src/end_a_launch/recorded_inside_the_hold.node-test.ts left running after its tests: a child process (ProcessWrap). Stop it in t.after.
✖ src/end_a_launch/recorded_inside_the_hold.node-test.ts (211.553462ms)

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: a649fcb3 never 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.after does 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.

**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: ``` src/end_a_launch/recorded_inside_the_hold.node-test.ts left running after its tests: a child process (ProcessWrap). Stop it in t.after. ✖ src/end_a_launch/recorded_inside_the_hold.node-test.ts (211.553462ms) ``` 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: a649fcb3 never 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.after` does 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.
Member

Done-when check against main 3f092f10 (PR #204 at 08f91000, PASS r=6, landed in batch PR #284 as 7add9fe3 on 2026-11-27):

  • 1 "martha join <invite> exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired in bin/martha": MET.
    • The slice is src/join_a_realm_with_an_invite/.
    • Its own box is architecture/c4_diagrams.ts join_a_realm_with_an_invite, with its row in architecture/README.md.
    • It imports only Martha modules: no crew-code or macula-sponsors import.
    • Its one role name is Martha's own SUPERVISOR constant.
    • Wiring: run_the_martha_command.ts routes join to joinOf and joinARealmHere, bin/martha runs that command, and USAGE names it.
    • Per the threat model (comment 5083), the invite is read from stdin or --invite-file, never from an argument.
  • 2 "each exit code has a test, red-first on main; the invite never appears in any output (test)": MET.
    • src/run_the_martha_command/join_a_realm.node-test.ts has "#198 exit 0", two "exit 1", two "exit 2", "exit 3" and three "exit 4".
    • "#198 the invite and its secret are in no byte said on any exit path" covers the invite; the_invite_and_the_words.node-test.ts also checks every mangled invite and every misuse is never quoted.
    • Red-first: main before the landing (7add9fe3^1 = 7ba0daf9) had no join command 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.
    • On 3f092f10, run in their own namespace: the slice's 28 tests and join_a_realm.node-test.ts's 12 tests, 40 pass and 0 fail.
  • 3 "no test reaches an outside service; the realm is a local stand-in whose replies are copied from the real realm": MET.
    • a_realm_stand_in.ts gives the realm and the realm CLI as functions in the join's io.
    • Each answer comes from the_realms_own_answers.json, which names its source beside each one: macula-realm 973b5b88 files, and macula-mcp v0.51.6 for the CLI lines.
    • No join test calls fetch, https.request or a socket.
  • 4 "one live run against a DEV realm, recorded on this issue (command + output), once": MET. Comment 5297: martha join --invite-file ... --wait-secs 1500 against 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.

**Done-when check against main `3f092f10`** (PR #204 at `08f91000`, PASS r=6, landed in batch PR #284 as `7add9fe3` on 2026-11-27): - 1 "`martha join <invite>` exists as a Martha slice (its own C4 box, no crew-code import, no crew-specific names), wired in `bin/martha`": **MET**. - The slice is `src/join_a_realm_with_an_invite/`. - Its own box is `architecture/c4_diagrams.ts` `join_a_realm_with_an_invite`, with its row in `architecture/README.md`. - It imports only Martha modules: no crew-code or macula-sponsors import. - Its one role name is Martha's own `SUPERVISOR` constant. - Wiring: `run_the_martha_command.ts` routes `join` to `joinOf` and `joinARealmHere`, `bin/martha` runs that command, and `USAGE` names it. - Per the threat model (comment 5083), the invite is read from stdin or `--invite-file`, never from an argument. - 2 "each exit code has a test, red-first on main; the invite never appears in any output (test)": **MET**. - `src/run_the_martha_command/join_a_realm.node-test.ts` has "#198 exit 0", two "exit 1", two "exit 2", "exit 3" and three "exit 4". - "#198 the invite and its secret are in no byte said on any exit path" covers the invite; `the_invite_and_the_words.node-test.ts` also checks every mangled invite and every misuse is never quoted. - Red-first: main before the landing (`7add9fe3^1` = `7ba0daf9`) had no `join` command 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. - On `3f092f10`, run in their own namespace: the slice's 28 tests and `join_a_realm.node-test.ts`'s 12 tests, 40 pass and 0 fail. - 3 "no test reaches an outside service; the realm is a local stand-in whose replies are copied from the real realm": **MET**. - `a_realm_stand_in.ts` gives the realm and the realm CLI as functions in the join's io. - Each answer comes from `the_realms_own_answers.json`, which names its source beside each one: macula-realm `973b5b88` files, and macula-mcp v0.51.6 for the CLI lines. - No join test calls `fetch`, `https.request` or a socket. - 4 "one live run against a DEV realm, recorded on this issue (command + output), once": **MET**. Comment 5297: `martha join --invite-file ... --wait-secs 1500` against 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.
Sign in to join this conversation.
No labels
No milestone
No project
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
No description provided.