The martha.json editor
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
beamologist 876f0fb9a1
All checks were successful
test / test (pull_request) Successful in 52s
test / test (push) Successful in 45s
release / release (push) Successful in 2m18s
lazymartha#14 r3: the first turn waits for the CLI to stop writing, not for its screen to hold still
Run 6964 on d9a9f69 answered the diagnostic: "its screen never held still (after 2
screens)" — the CLI wrote once and then blocked, yet the rendered screen changed at
every check, so the settle rule compared renders that can change with no output at all
and never saw a still one.

The terminal now records when the CLI last wrote (LastDraw, atomic, set by its own
reader), and the wait reads that: quiet starts at the first write, a write resets it,
and patience with writes that never stop says "its CLI was still drawing". The screen is
still the pane's; it is no longer the signal.
2026-12-02 15:46:15 +01:00
.forgejo/workflows lazymartha L3: a tag builds, signs and publishes the binary to macula-pub (martha#317) 2026-11-30 19:22:19 +01:00
cmd/lazymartha lazymartha#14 r3: the first turn waits for the CLI to stop writing, not for its screen to hold still 2026-12-02 15:46:15 +01:00
internal lazymartha#14 r3: the first turn waits for the CLI to stop writing, not for its screen to hold still 2026-12-02 15:46:15 +01:00
testdata lazymartha#3: an unchanged save keeps the file; the header names the owner 2026-12-01 04:31:01 +01:00
.gitignore lazymartha#9: ignore the built binary at the repo root 2026-12-02 11:08:22 +01:00
.tool-versions lazymartha L2: the Go + bubbletea editor (martha#317) 2026-11-30 19:18:54 +01:00
go.mod lazymartha#11: Claude Code members in a real CLI pane (pty + emulator) 2026-12-02 11:43:36 +01:00
go.sum lazymartha#11: Claude Code members in a real CLI pane (pty + emulator) 2026-12-02 11:43:36 +01:00
LICENSE Initial commit 2026-11-30 17:59:19 +00:00
README.md lazymartha#14 r2: Mercurius's four findings 2026-12-02 15:00:17 +01:00

lazymartha

The martha.json editor: one Go + bubbletea TUI that martha init and martha config start, reading its fields, defaults and hints from one schema file Martha publishes. It hard-codes no field, and it never validates — Martha's reader does that.

The crew screen (lazymartha crew) is the one-stop TUI in progress (martha-ai/lazymartha#6): the members of a declared crew, each in its own pane — the martha-engine members as child processes speaking ACP on their stdio, the Claude Code members as the real CLI in a terminal — with one permission queue for the engine members. See "The crew screen" below.

The handshake

Martha starts lazymartha as a child process with files, and reads back an exit code:

lazymartha --schema <schema.json> --in <declaration.json> --out <proposed.json> [--new] [--message "<line>"]
  • exit 0 — saved: --out holds the proposed declaration.
  • exit 3 — quit, nothing saved.
  • anything else — refused or crashed; Martha prints its stderr.

--new marks a fresh crew (a no-op for the editor today); --message is a line Martha handed over — a reader's refusal — shown to the owner so they keep their edits and see why.

The schema

--schema is a JSON Schema 2020-12 document with three extensions:

  • x-martha-schema (a number) — the schema major. lazymartha refuses a major it does not know, in one line naming both. A new field or enum value keeps the major; a renamed or removed field bumps it.
  • x-martha-tabs (a list) — the editor's tabs in order. Each tab is a form (named fields), a table (fields, repeatable), or a list (rows).
  • $id — a name, never fetched: lazymartha reads only the file it is handed.

The tabs, their field labels, types and choices come from this file alone.

The crew screen

martha up hands the workspace to the screen, and the screen draws the crew:

lazymartha crew --root <root> [--martha martha] [--agent "martha start {member} --acp"]
                                  [--terminal-agent "martha start {member}"]
                                  [--room "martha room --follow"] [--prompt <text>]
  • The places come from martha where run in --root, and the members from the declaration it names. A member runs here when the declaration gives it a host this screen starts and the owner has not parked it: one on the engine speaks ACP, one on Claude Code runs as the real CLI. Every other member is named on screen with why it is not drawn.
  • The crew strip above the panes reads every drawn member's dashboard row (<CREW>/row/) and draws the words martha crew draws: how many are online, waiting and need the owner, then a line per member with its state — and the flag a loss of the crew's tools raises, since when, in the crew's clock_zone — its task (the member's own word, or the task its session's list has open), how far it is, what it holds, what holds it up, what it needs, and the spend the row carries. A row quiet past the crew's offline time reads offline.
  • One --agent child per engine member speaks ACP on its stdio. The default is Martha serving an engine member upward; until that lands, --agent can name the engine itself. The child's standard error is read into its own pane, so Martha's own refusal is read where the member is.
  • An engine member's pane shows its stream, its tool calls (title and status) and its own prompt line; Enter sends the typed turn to the member on screen.
  • One permission queue holds every ask the crew raises, oldest first, with the member and the call's kind. ctrl+a allows once and ctrl+r rejects once the oldest ask — never an "always" — and the ask leaves the queue the moment it is answered.
  • A Claude Code member is --terminal-agent, martha start <member> unchanged, run in a pty and drawn through a VT emulator: its pane is the CLI's own screen. While that pane is on screen every key but f12 is the CLI's — ctrl+c interrupts its turn there, not the screen — and f12 hands the keyboard back to the crew and takes it again. Resizing the terminal resizes the CLI with it. The CLI's own asks stay in its own dialog. Its keys reach the CLI through a writer of the terminal's own, so a CLI that stops reading them is named on screen and never holds the crew.
  • The room pane (f10) runs one --room child, martha room --follow: the crew room's messages, as the follow prints them, oldest first and each new one as it lands. A line typed there is sent to the whole crew through that same child, and the follow's answer comes back into the pane. A room that cannot start says why where the room would be drawn.
  • The martha.json editor is a tab (f11): its schema is martha schema's answer, so it hard-codes no field, and it edits the declaration the crew was read from. A save writes the proposal beside the crew's own state and asks martha declare --from <file> to check and write it; a refusal is shown in the tab and the owner's edits stay where they are.
  • --prompt <text> is the first turn for every member the screen starts, with the meaning martha up --prompt gives it (martha-ai/martha#134): an engine member is sent it once its session opens, and for a Claude Code member — whose martha start refuses --prompt outside Martha's own tmux window — it is typed into the member's terminal once its composer has settled, as tmux send-keys does.
  • A restart asks each engine member's agent for the session it had (session/load) and starts a new one (session/new) when there is none or the agent no longer holds it. The ids are kept in the crew's own state directory, under lazymartha/sessions.json.

Layout

  • cmd/lazymartha — the handshake, and the crew screen's wiring.
  • internal/schema — read the schema and check its major.
  • internal/editor — the pure model: a key in, a screen out, a declaration out.
  • internal/acp — the ACP client: one agent child, its requests, its updates.
  • internal/terminal — one Claude Code member's CLI in a pty, and the emulator that draws it.
  • internal/room — the crew room's one child (martha room --follow): its lines, and the owner's.
  • internal/crew — the crew screen: its places, its members and their rows, its strip, its live members, its pure model.
  • internal/files — read the declaration, write the proposal through a temp file.

go test ./... and go vet ./... are the gate; no test reaches an outside service.