martha report: one diagnostic the user sees whole, filed as an issue only on their yes #237

Closed
opened 2026-11-26 05:42:28 +00:00 by mars · 3 comments
Member

Purpose (product): a Martha user who hits a problem can hand the maintainers one complete, secret-free diagnostic, filed as an issue only when they say yes.

DECIDED 2026-11-26, Raf: "go on the martha report idea" (relayed by the Supervisor).

Placed after the work in flight: the martha landing queue (#224 landed d160bd41; #196, #202, #199, #198, #206, #212, #186 next) and the gate packages #230, #231, #232.

Package 1 (this issue): martha report

  • Builds one diagnostic: Martha and host versions; OS, Node and podman-or-docker facts; the declaration with secrets removed; the failing command; the last N log lines.
  • Redaction reuses what martha#646 already ships. No second redactor.
  • Shows the user the whole text. Only on their yes does it file an issue through the git-host adapter (martha-any-git-host) on the right repo. With no forge account it prints the issue for pasting.
  • Never automatic, no telemetry. Tests and local runs never reach the forge: the real adapter only by environment, a stand-in otherwise.
  • The report format is written as a small spec in this package.
  • Nothing else: no crash catcher, no new guard.

Build: Opus (the redaction is leak-adjacent). Review: fable. Lands on PASS + green.

Later, not in this issue

One small package per mcl-* service (report, same format), placed only after package 1 has landed and a tester has used it.

Done when:

  • martha report prints the full diagnostic, with the declaration's secrets redacted by #646's redactor (a test plants a secret in each redacted place and finds none in the output);
  • it files nothing without an explicit yes, and with a yes files through the git-host adapter on the right repo (tested against the stand-in adapter only);
  • with no forge account, it prints the issue text for pasting;
  • the format spec is in the repo, and the output matches it.
Purpose (product): a Martha user who hits a problem can hand the maintainers one complete, secret-free diagnostic, filed as an issue only when they say yes. DECIDED 2026-11-26, Raf: "go on the martha report idea" (relayed by the Supervisor). Placed after the work in flight: the martha landing queue (#224 landed d160bd41; #196, #202, #199, #198, #206, #212, #186 next) and the gate packages #230, #231, #232. ## Package 1 (this issue): `martha report` - Builds one diagnostic: Martha and host versions; OS, Node and podman-or-docker facts; the declaration with secrets removed; the failing command; the last N log lines. - Redaction reuses what martha#646 already ships. No second redactor. - Shows the user the whole text. Only on their yes does it file an issue through the git-host adapter (martha-any-git-host) on the right repo. With no forge account it prints the issue for pasting. - Never automatic, no telemetry. Tests and local runs never reach the forge: the real adapter only by environment, a stand-in otherwise. - The report format is written as a small spec in this package. - Nothing else: no crash catcher, no new guard. Build: Opus (the redaction is leak-adjacent). Review: fable. Lands on PASS + green. ## Later, not in this issue One small package per mcl-* service (`report`, same format), placed only after package 1 has landed and a tester has used it. Done when: - `martha report` prints the full diagnostic, with the declaration's secrets redacted by #646's redactor (a test plants a secret in each redacted place and finds none in the output); - it files nothing without an explicit yes, and with a yes files through the git-host adapter on the right repo (tested against the stand-in adapter only); - with no forge account, it prints the issue text for pasting; - the format spec is in the repo, and the output matches it.
Member

Rulings (Mars, 2026-11-26, on Uranus's three scope questions)

Main 60646f58 lacks a Martha log, a failing-command record, a forge write, and OS/Node/engine reads. Mars ruled:

  1. Log lines = the project's newest relay journal (keep_the_relays_journal, ≤32 events), run through the redactor. Failing command = the words after martha report --, quoted, never run. No new log file.
  2. Filing = one POST "open an issue" on the forgejo transport. The body comes from a 0600 file, never argv; a 201 is checked. Target: martha-ai/martha on git.macula.io. It files only when the declaration names git.macula.io with a token_file AND the user typed yes. Otherwise it prints the text and the issues/new link. No GitHub path. The real transport is used only by the process's own environment; every test uses the stand-in and never reaches the forge.
  3. Masking the named declaration fields' values (field names imported from their owning modules) and writing the home directory as ~ is a field mask, not a second redactor. After it, every string goes through redactTheTokens (#646). The planted-secret test covers each masked field, plus a token in a free-text field.

OS / Node / podman-or-docker are read fresh. If neither engine is installed, it prints none and does not fail.

Threat model (before code)

Asset. Secrets and private facts on the user's machine: tokens (forge, GitHub, model providers), key file paths and names, mesh keys, account names, the user's home path and username, and the contents of the relay journal.

Where text leaves the machine. Only two ways, and both need the user:

  • (a) a POST to git.macula.io after a typed yes (the issue becomes public, since martha-ai/martha is public);
  • (b) text the user copies by hand.

martha report reaches nothing on its own: no telemetry, no automatic run, and it is never called from another verb.

Threats and answers

# Threat Answer Proof
T1 A token in the declaration, journal or command reaches the public issue every string goes through redactTheTokens (#646 shapes + forge token in context) after the field mask planted-secret test: one token per place (each masked field, a free-text declaration field, a journal event, the command words); output and filed body hold none
T2 A path or name in token_file / key_file / key_from / mesh_key / account / mesh keys shows the user's layout field mask by imported field names; home → ~ same test, one plant per masked field
T3 The body is filed before the user saw it all the whole text is printed first; the question is asked only on a terminal; only the full word yes files (the approve_a_checkouts_config pattern); no terminal → print only test: y, empty, EOF, no-terminal each file nothing (stand-in records zero calls)
T4 What is filed differs from what was shown one string is built once, printed, then sent byte for byte test: the stand-in's received body equals the printed text
T5 The token leaks through argv or the process list the token goes through the existing -K private config; the body through a 0600 file --data @file; nothing secret on argv test asserts argv holds neither the token nor the body
T6 Tests or local runs reach the forge (bombarding a third party) the real transport is wired only in bin/martha's own io; tests inject a stand-in; no env flag turns a test real every test passes a stand-in; the run happens inside the namespace wrapper
T7 Filing to the wrong repo or host target repo and host are one constant, checked against the declared host entry test: the stand-in sees exactly the POST path for martha-ai/martha
T8 A redaction throws and the raw text is shown or filed a throw yields a "could not redact" note in place of that part, never the raw part test with a redactor that throws

Not in scope (per the issue): no crash catcher, no new guard, no GitHub filing, no mcl-* report.

Residual risk. A secret of a shape neither #646's patterns nor the mask know, sitting in free text, is shown to the user. That is why the user sees the whole text before the yes. The text says so above the question.

## Rulings (Mars, 2026-11-26, on Uranus's three scope questions) Main 60646f58 lacks a Martha log, a failing-command record, a forge write, and OS/Node/engine reads. Mars ruled: 1. **Log lines** = the project's newest relay journal (`keep_the_relays_journal`, ≤32 events), run through the redactor. **Failing command** = the words after `martha report --`, quoted, never run. No new log file. 2. **Filing** = one POST "open an issue" on the forgejo transport. The body comes from a 0600 file, never argv; a 201 is checked. Target: martha-ai/martha on git.macula.io. It files only when the declaration names git.macula.io with a `token_file` AND the user typed `yes`. Otherwise it prints the text and the issues/new link. No GitHub path. The real transport is used only by the process's own environment; every test uses the stand-in and never reaches the forge. 3. **Masking** the named declaration fields' values (field names imported from their owning modules) and writing the home directory as `~` is a field mask, not a second redactor. After it, every string goes through `redactTheTokens` (#646). The planted-secret test covers each masked field, plus a token in a free-text field. OS / Node / podman-or-docker are read fresh. If neither engine is installed, it prints `none` and does not fail. ## Threat model (before code) **Asset.** Secrets and private facts on the user's machine: tokens (forge, GitHub, model providers), key file paths and names, mesh keys, account names, the user's home path and username, and the contents of the relay journal. **Where text leaves the machine.** Only two ways, and both need the user: - (a) a POST to git.macula.io after a typed `yes` (the issue becomes **public**, since martha-ai/martha is public); - (b) text the user copies by hand. `martha report` reaches nothing on its own: no telemetry, no automatic run, and it is never called from another verb. **Threats and answers** | # | Threat | Answer | Proof | |---|---|---|---| | T1 | A token in the declaration, journal or command reaches the public issue | every string goes through `redactTheTokens` (#646 shapes + forge token in context) after the field mask | planted-secret test: one token per place (each masked field, a free-text declaration field, a journal event, the command words); output and filed body hold none | | T2 | A path or name in token_file / key_file / key_from / mesh_key / account / mesh keys shows the user's layout | field mask by imported field names; home → `~` | same test, one plant per masked field | | T3 | The body is filed before the user saw it all | the whole text is printed first; the question is asked only on a terminal; only the full word `yes` files (the approve_a_checkouts_config pattern); no terminal → print only | test: `y`, empty, EOF, no-terminal each file nothing (stand-in records zero calls) | | T4 | What is filed differs from what was shown | one string is built once, printed, then sent byte for byte | test: the stand-in's received body equals the printed text | | T5 | The token leaks through argv or the process list | the token goes through the existing `-K` private config; the body through a 0600 file `--data @file`; nothing secret on argv | test asserts argv holds neither the token nor the body | | T6 | Tests or local runs reach the forge (bombarding a third party) | the real transport is wired only in bin/martha's own io; tests inject a stand-in; no env flag turns a test real | every test passes a stand-in; the run happens inside the namespace wrapper | | T7 | Filing to the wrong repo or host | target repo and host are one constant, checked against the declared host entry | test: the stand-in sees exactly the POST path for martha-ai/martha | | T8 | A redaction throws and the raw text is shown or filed | a throw yields a "could not redact" note in place of that part, never the raw part | test with a redactor that throws | **Not in scope** (per the issue): no crash catcher, no new guard, no GitHub filing, no mcl-* report. **Residual risk.** A secret of a shape neither #646's patterns nor the mask know, sitting in free text, is shown to the user. That is why the user sees the whole text before the yes. The text says so above the question.
Member

Parked for martha#134 (Mars, 2026-11-26). Where it stands, so the work resumes from here:

  • Local WIP commit 8de9ee82 on branch uranus/237-martha-report, in worktree martha-237-martha-report. Not pushed. It typechecks and lints.
  • Built:
    • src/report_a_problem/ with the_report.ts (mask → home as ~ → redactTheTokens → escape), offer_the_report.ts (show all, ask, file only on a typed yes, else the text to paste), make_the_report.ts (facts, martha report [-- <cmd>]) and THE_REPORT_FORMAT.md (spec).
    • One POST on the forgejo transport (theForgePostOf): body in a private file, content-type in the config file, refused for a host with no token file.
    • forgePost on the command's io, which only the process's own io carries.
  • Ceiling move: run_the_martha_command.ts was at its 1105-line limit, so martha digest's printer moved unchanged to digest_a_work_directory/print_the_digest.ts.
  • Still to do: the tests from the threat model (T1–T8, the planted-secret test, output against the spec), the restated-values check, the local wrapper run, then the HANDOFF.
Parked for martha#134 (Mars, 2026-11-26). Where it stands, so the work resumes from here: - Local WIP commit 8de9ee82 on branch uranus/237-martha-report, in worktree martha-237-martha-report. Not pushed. It typechecks and lints. - Built: - `src/report_a_problem/` with `the_report.ts` (mask → home as ~ → redactTheTokens → escape), `offer_the_report.ts` (show all, ask, file only on a typed `yes`, else the text to paste), `make_the_report.ts` (facts, `martha report [-- <cmd>]`) and `THE_REPORT_FORMAT.md` (spec). - One POST on the forgejo transport (`theForgePostOf`): body in a private file, content-type in the config file, refused for a host with no token file. - `forgePost` on the command's io, which only the process's own io carries. - Ceiling move: `run_the_martha_command.ts` was at its 1105-line limit, so `martha digest`'s printer moved unchanged to `digest_a_work_directory/print_the_digest.ts`. - Still to do: the tests from the threat model (T1–T8, the planted-secret test, output against the spec), the restated-values check, the local wrapper run, then the HANDOFF.
Member

Landed: main ecb6f372 holds the PR 245 tip f9478334 (r2 PASS). Closing.

Landed: main ecb6f372 holds the PR 245 tip f9478334 (r2 PASS). Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 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#237
No description provided.