check:private reads the GitHub stop from the clone's origin, so a forge clone asks GitHub nothing (#39) #40

Closed
saturnus wants to merge 0 commits from saturnus/39-private-origin-stop into main
Member

Refs #39. Stacked on PR 14 (#9) at its passed head 559256b2: the review range is 559256b2..f93719c4 (one commit); PR 14 rides batch 3 and lands first.

What changes: check:private reads the origin of the clone at --root (or the working directory) before anything else. An origin whose host is not github.com, a local path, or no origin asks GitHub nothing, whatever GITHUB_TOKEN and MARTHA_GITHUB_STOPPED say; a scan that needs a lookup exits 2 and names the origin's host (never the URL, martha#670). A github.com origin behaves as before, the switch included. The host is read beside the origin path reader in read_the_origin_a_clone_has, so git's URL forms are read in one place.

Done-when, line by line

  • Non-github.com origin sends no request whatever the switch and token say, exit 2 naming the origin: unit test over 3 forge forms + no origin + local path × 4 env shapes (counting fetch, zero calls), and a spawned run of main.ts in a forge-origin checkout with a token and no switch, whose fetch is replaced by a preload that logs every URL: none logged, exit 2, the host named.
  • github.com origin unchanged, including MARTHA_GITHUB_STOPPED=1: unit test over 3 github.com forms (asks once; switch on stops it; a typo is refused), and the existing spawned tests now run in a github.com-origin checkout.
  • Mutants, each killed by a named test: M1 origin not read (always resolveOnGitHub); M2 any host asks; M3 main.ts back to resolveOnGitHub; M4 origin read from cwd instead of --root.

Hand run in this forge clone (origin git.macula.io), offline under unshare -rn, fetch logged: token set/no switch, no token, switch=1, switch typo: 0 fetches each, exit 2, "this clone's origin is on git.macula.io, not github.com".

No new check. check:posted-text (#36) is untouched.

Refs #39. Stacked on PR 14 (#9) at its passed head 559256b2: the review range is `559256b2..f93719c4` (one commit); PR 14 rides batch 3 and lands first. **What changes**: check:private reads the origin of the clone at `--root` (or the working directory) before anything else. An origin whose host is not github.com, a local path, or no origin asks GitHub nothing, whatever `GITHUB_TOKEN` and `MARTHA_GITHUB_STOPPED` say; a scan that needs a lookup exits 2 and names the origin's host (never the URL, martha#670). A github.com origin behaves as before, the switch included. The host is read beside the origin path reader in `read_the_origin_a_clone_has`, so git's URL forms are read in one place. **Done-when, line by line** - Non-github.com origin sends no request whatever the switch and token say, exit 2 naming the origin: unit test over 3 forge forms + no origin + local path × 4 env shapes (counting fetch, zero calls), and a spawned run of `main.ts` in a forge-origin checkout with a token and no switch, whose fetch is replaced by a preload that logs every URL: none logged, exit 2, the host named. - github.com origin unchanged, including `MARTHA_GITHUB_STOPPED=1`: unit test over 3 github.com forms (asks once; switch on stops it; a typo is refused), and the existing spawned tests now run in a github.com-origin checkout. - Mutants, each killed by a named test: M1 origin not read (always resolveOnGitHub); M2 any host asks; M3 main.ts back to resolveOnGitHub; M4 origin read from cwd instead of `--root`. **Hand run** in this forge clone (origin git.macula.io), offline under `unshare -rn`, fetch logged: token set/no switch, no token, switch=1, switch typo: 0 fetches each, exit 2, "this clone's origin is on git.macula.io, not github.com". No new check. check:posted-text (#36) is untouched.
A crew's GitHub stop was invisible to check:private: every scan that names another repository, and every
--self-test, looked it up on api.github.com with the shell's token, so a member running it during a stop
spent the shared account (one 403'd GET on 2026-11-21). The stop is now said, never guessed from a 403:
MARTHA_GITHUB_STOPPED=1 turns it on, unset or empty is off, and any other value is refused when the lookup
is built. While it is on, each lookup throws before any request, and main.ts's existing path prints "the
check could not be made: GitHub is stopped ..." and exits 2, so the check never passes because it could not
look. A scan whose sources name no other repository needs no lookup and answers as before. Only
check:private's main.ts hands the switch in: check:posted-text, which shares the lookup, is unchanged.
Design approved by the Supervisor before code.
check:private asks only GitHub whether a repository is public, and every way GitHub fails to answer is exit 2
Some checks failed
advisories.yml / check:private asks only GitHub whether a repository is public, and every way GitHub fails to answer is exit 2 (pull_request) Failing after 0s
c4-model.yml / check:private asks only GitHub whether a repository is public, and every way GitHub fails to answer is exit 2 (pull_request) Failing after 0s
CI / links resolve (pull_request) Has been cancelled
CI / gate coverage (pull_request) Has been cancelled
CI / structural floor (pull_request) Has been cancelled
CI / Martha's names are its own (pull_request) Has been cancelled
CI / no import cycle (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
CI / the host drift check bites (pull_request) Has been cancelled
CI / the engine drift check bites (pull_request) Has been cancelled
CI / the posted text check bites (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the ring reaches the owner on the live run's tmux (pull_request) Has been cancelled
CI / workflows are valid (pull_request) Has been cancelled
CI / installer (pull_request) Has been cancelled
CI / nothing private (pull_request) Has been cancelled
CI / no test the base passed goes missing (pull_request) Has been cancelled
CI / the pictures change only with the version (pull_request) Has been cancelled
CI / no literal restates a defined value (pull_request) Has been cancelled
CI / every check runs in a job (pull_request) Has been cancelled
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Has been cancelled
standalone / the pinned Node is nodejs.org's (pull_request) Has been cancelled
930633b210
forge macula-io/martha#9, under the Supervisor's ruling A (2026-11-22): GitHub stays the one source of "public",
because that is where posted text is read; the forge holds every crew repository private (macula-io/martha 200
private:true) and cannot say what GitHub shows. Before, a missing token asked anonymously and a 200 without the
fields read as not public. Now each case where GitHub gives no answer throws, and main.ts's existing path exits 2
and names the case: no GITHUB_TOKEN (no request goes out), any status but 200 or 404 (401 and 403 included), a
body that is not JSON, or one without boolean private and string visibility. A 404 is still an answer (not public).
MARTHA_GITHUB_STOPPED=1 stays the up-front stop. check:posted-text shares the lookup and gets the same refusals.
Mutants killed: asking anonymously (2 tests), a non-200 read as not public (1), a wrong shape read as not public (1).

Refs macula-io/martha#601
The forge's nothing-private steps say GitHub is stopped, so their red names the stop
Some checks failed
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 11s
dependency advisories / node in installer (pull_request) Successful in 11s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 6s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 29s
CI / gate coverage (pull_request) Failing after 1m20s
CI / no import cycle (pull_request) Successful in 28s
CI / structural floor (pull_request) Successful in 29s
CI / Martha's names are its own (pull_request) Successful in 29s
CI / the relay loads in the recorded host (pull_request) Failing after 3m35s
CI / the engine drift check bites (pull_request) Successful in 37s
CI / the posted text check bites (pull_request) Successful in 17s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 29s
CI / the host drift check bites (pull_request) Successful in 2m31s
CI / workflows are valid (pull_request) Successful in 41s
CI / installer (pull_request) Successful in 4m56s
CI / no test the base passed goes missing (pull_request) Successful in 47s
CI / every check runs in a job (pull_request) Successful in 25s
CI / nothing private (pull_request) Failing after 20s
CI / the pictures change only with the version (pull_request) Successful in 30s
CI / no literal restates a defined value (pull_request) Successful in 1m25s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 15s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 48s
CI / the clean-install proof removes its container (pull_request) Failing after 17m8s
engine drift / the recording says what the engine says (pull_request) Successful in 51s
host drift / the recording is of the host members run (pull_request) Successful in 2m45s
559256b209
Off github.com both check:private steps set MARTHA_GITHUB_STOPPED=1: no
repository lookup goes out and a scan that needs one exits 2 naming the
stop. On github.com the value is empty and nothing changes. The job
comment no longer says an empty token asks anonymously: it exits 2.

Refs macula-io/martha#9 (forge)
check:private reads the GitHub stop from the clone's origin, so a forge clone asks GitHub nothing
Some checks failed
dependency advisories / node in . (pull_request) Successful in 12s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 14s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 25s
CI / Martha's names are its own (pull_request) Has been cancelled
CI / no import cycle (pull_request) Has been cancelled
CI / the relay loads in the recorded host (pull_request) Has been cancelled
CI / the host drift check bites (pull_request) Has been cancelled
CI / the engine drift check bites (pull_request) Has been cancelled
CI / gate coverage (pull_request) Has been cancelled
CI / the posted text check bites (pull_request) Has been cancelled
CI / the clean-install proof removes its container (pull_request) Has been cancelled
CI / the ring reaches the owner on the live run's tmux (pull_request) Has been cancelled
CI / workflows are valid (pull_request) Has been cancelled
CI / installer (pull_request) Has been cancelled
CI / nothing private (pull_request) Has been cancelled
CI / no test the base passed goes missing (pull_request) Has been cancelled
CI / the pictures change only with the version (pull_request) Has been cancelled
CI / no literal restates a defined value (pull_request) Has been cancelled
CI / every check runs in a job (pull_request) Has been cancelled
CI / structural floor (pull_request) Has been cancelled
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Has been cancelled
standalone / the pinned Node is nodejs.org's (pull_request) Has been cancelled
f93719c4b3
A hand run of check:private in a forge clone sent the session's GITHUB_TOKEN to
api.github.com unless MARTHA_GITHUB_STOPPED=1 was set. The origin of the clone at
--root (or the working directory) is now read first: one whose host is not
github.com, a local path, or no origin asks nothing, whatever the token and the
switch say, and a scan that needs a lookup exits 2 naming the origin's host,
never its URL. A github.com origin behaves as before, the switch included.

The host is read beside the origin path reader (read_the_origin_a_clone_has),
so git's URL forms are read in one place.

Refs forge macula-io/martha#39
An origin's host is read only from an authority git connects to, so no trick origin reads as github.com
Some checks failed
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 12s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 10s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model (pull_request) Successful in 0s
CI / no import cycle (pull_request) Successful in 30s
CI / gate coverage (pull_request) Failing after 1m22s
CI / workflows are valid (pull_request) Successful in 27s
CI / installer (pull_request) Successful in 2m8s
CI / nothing private (pull_request) Failing after 18s
CI / the pictures change only with the version (pull_request) Successful in 22s
dependency advisories / node in . (pull_request) Successful in 13s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
c4 model / c4-model-1 (pull_request) Successful in 6s
CI / links resolve (pull_request) Successful in 24s
CI / structural floor (pull_request) Successful in 30s
CI / Martha's names are its own (pull_request) Successful in 37s
CI / the engine drift check bites (pull_request) Successful in 35s
CI / the host drift check bites (pull_request) Successful in 1m14s
CI / the posted text check bites (pull_request) Successful in 16s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 20s
CI / no test the base passed goes missing (pull_request) Successful in 33s
CI / every check runs in a job (pull_request) Successful in 20s
CI / no literal restates a defined value (pull_request) Successful in 55s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 30s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 17s
CI / the relay loads in the recorded host (pull_request) Successful in 16m18s
CI / the clean-install proof removes its container (pull_request) Failing after 16m6s
404cadead2
Review findings on f93719c4, each now a test:
- a file:// URL is a local path to git whatever its authority says, so it names no host
  (file://github.com/<path> was read as github.com and asked GitHub);
- the authority ends at the first /, ? or #, as git and curl read it
  (https://evil.example#@github.com/... was read as github.com);
- an authority that is not userinfo, host and digits names no host, so a raw slash in a
  password is never printed as one (https://user:sec/ret@host/... printed "user:sec").
A host's root dot is dropped, so github.com. is github.com. The tests pin git's global and
system config, and match hosts literally.

Refs forge macula-io/martha#39
An ssh authority is read whole, and a shorthand user with a colon names no host
Some checks failed
dependency advisories / node in . (pull_request) Successful in 12s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 14s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
dependency advisories / node in installer (pull_request) Successful in 13s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 33s
CI / structural floor (pull_request) Successful in 31s
CI / Martha's names are its own (pull_request) Successful in 34s
CI / gate coverage (pull_request) Failing after 2m7s
CI / no import cycle (pull_request) Successful in 32s
CI / the host drift check bites (pull_request) Successful in 1m27s
CI / the engine drift check bites (pull_request) Failing after 33s
CI / the posted text check bites (pull_request) Failing after 33s
CI / workflows are valid (pull_request) Successful in 29s
CI / the ring reaches the owner on the live run's tmux (pull_request) Failing after 33s
CI / the clean-install proof removes its container (pull_request) Failing after 34s
CI / installer (pull_request) Failing after 1s
CI / the pictures change only with the version (pull_request) Failing after 1s
CI / nothing private (pull_request) Failing after 1s
CI / no test the base passed goes missing (pull_request) Failing after 1s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Failing after 1s
standalone / the pinned Node is nodejs.org's (pull_request) Failing after 1s
CI / every check runs in a job (pull_request) Failing after 1s
CI / no literal restates a defined value (pull_request) Successful in 59s
CI / the relay loads in the recorded host (pull_request) Failing after 18m47s
04df1477a2
Review round 2 on 404cadea: cutting every authority at ? and # matched curl but not ssh, which
git hands the whole authority, so ssh://github.com#@evil.example/... read as github.com and
asked GitHub. Only the schemes git hands to curl (http, https, ftp, ftps) are cut at ? and #
now. A shorthand whose user holds a colon (evil.example:x@github.com:o/n, ext::...) is no
user@host git connects to, so it names no host. Each form is a test; each guard has a mutant.

Refs forge macula-io/martha#39
git url-decodes an ssh or git authority before it splits it, and cuts one at a ']',
so ssh://evil.example%2Fx@github.com/o/n and ssh://[evil.example]@github.com/o/n
connect to evil.example while they read as github.com. Such an authority now names
no host, so the stop treats it as not GitHub and sends nothing (fable review, round 3).

Refs #39
Only a scheme git connects with itself names a host
Some checks failed
dependency advisories / node in . (pull_request) Successful in 14s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / node in installer (pull_request) Successful in 14s
dependency advisories / advisories (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 29s
CI / structural floor (pull_request) Successful in 34s
CI / Martha's names are its own (pull_request) Successful in 37s
CI / no import cycle (pull_request) Successful in 33s
CI / gate coverage (pull_request) Failing after 2m16s
CI / the engine drift check bites (pull_request) Successful in 27s
CI / the posted text check bites (pull_request) Successful in 29s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 31s
CI / the host drift check bites (pull_request) Successful in 1m55s
CI / nothing private (pull_request) Failing after 11s
CI / the pictures change only with the version (pull_request) Successful in 14s
CI / workflows are valid (pull_request) Successful in 41s
CI / no test the base passed goes missing (pull_request) Successful in 27s
CI / every check runs in a job (pull_request) Successful in 12s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 10s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 25s
CI / installer (pull_request) Successful in 2m25s
CI / no literal restates a defined value (pull_request) Successful in 2m8s
CI / the clean-install proof removes its container (pull_request) Failing after 17m28s
CI / the relay loads in the recorded host (pull_request) Failing after 18m46s
1512f45332
An origin in any other scheme (foo://evil.example#@github.com/o/n, an upper-case
SSH://, file://) goes to a remote helper, not to the host its authority seems to
name, so it names none. The schemes are matched as written, as git matches them.

Refs #39
Author
Member

superseded by #59 (carries these commits; Supervisor's fold)

superseded by #59 (carries these commits; Supervisor's fold)
saturnus closed this pull request 2026-11-22 21:53:42 +00:00
Some checks failed
dependency advisories / node in . (pull_request) Successful in 14s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (pull_request) Successful in 13s
dependency advisories / node in . (container) (pull_request) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (pull_request) Has been skipped
dependency advisories / node in installer (container) (pull_request) Has been skipped
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
dependency advisories / node in installer (pull_request) Successful in 14s
dependency advisories / advisories (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 29s
CI / structural floor (pull_request) Successful in 34s
CI / Martha's names are its own (pull_request) Successful in 37s
CI / no import cycle (pull_request) Successful in 33s
CI / gate coverage (pull_request) Failing after 2m16s
CI / the engine drift check bites (pull_request) Successful in 27s
CI / the posted text check bites (pull_request) Successful in 29s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 31s
CI / the host drift check bites (pull_request) Successful in 1m55s
CI / nothing private (pull_request) Failing after 11s
CI / the pictures change only with the version (pull_request) Successful in 14s
CI / workflows are valid (pull_request) Successful in 41s
CI / no test the base passed goes missing (pull_request) Successful in 27s
CI / every check runs in a job (pull_request) Successful in 12s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 10s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 25s
CI / installer (pull_request) Successful in 2m25s
CI / no literal restates a defined value (pull_request) Successful in 2m8s
CI / the clean-install proof removes its container (pull_request) Failing after 17m28s
CI / the relay loads in the recorded host (pull_request) Failing after 18m46s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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!40
No description provided.