Macula · Martha · docs from Martha v0.4.1
Nothing private gets in
This exists so that code moved into this public repository from a private one carries nothing that belongs to the private side: no link to a private issue, no internal host name, no private remote. A check in CI fails, by name, the moment one gets in.
Martha's first code is written fresh here, but most of what it becomes is moved in from a private repository where those things were normal to write. A comment that cites a private issue is a dead link once public, and it says where the private work lives. A fallback remote that names a private repository tells every reader where to look. A lab host name is a map of the network.
What could leak, and through which path
| What | Example of the shape | How it arrives |
|---|---|---|
| A private issue or PR link | synthetic-owner/private-repo#123, https://github.com/synthetic-owner/private-repo/issues/123 |
a comment or doc moved as written |
| A shorthand link to another repository | synthetic-repo#123 |
the same; the owner is implied, so nothing outside the author's head says whether it is public |
| A private remote or repository name | git@github.com:synthetic-owner/private-repo.git, a constant holding synthetic-owner/private-repo |
a fallback, a default, an install script |
| An internal host name | a *.lab name |
a log line, a comment, a test fixture |
| A home directory, a private address, a private email, a real node id or key | a path under a real user's home, RFC 1918 addresses, a 64-hex id | the same classes the crew's note check and release scan already refuse |
| A GitHub token | a classic ghp_, gho_, ghu_, ghs_ or ghr_ token, a fine-grained github_pat_ one |
a transcript, log or finding a member's gh auth token reached, posted from the live run's kept record (martha#904) |
| A fact recorded from another checkout | a private remote, a *.lab name, a path under a home, held by the engine's own source |
recorded rather than typed: npm run record:goose-engine reads an engine checkout and writes its facts to src/know_the_goose_engines_facts/recorded_goose_engine.json, so a value can arrive from a tree this repository does not review |
Each of those can enter through four paths:
- The tree at the head of a pull request — a file as it will be merged,
and its path: a file named after a host publishes the name with no text
at all. Every tracked path, and every path a commit adds, is read as a line.
A symlink is read as its link text, never followed, so a tree that tracks one
to a directory is still read. Under
--rangethe tree read is the files the range touches: a range over a data repository does not read every file in it (forge martha#111). - A commit inside the pull request that a later commit removes. GitHub keeps every pushed commit of a pull request reachable, so a leak that the final tree no longer shows is still public. The check reads every commit's added lines. A merge's added lines are the ones the merge wrote itself, read against git's own merge of its parents: a resolved conflict, or a change made in the merge. A line a parent brought is that parent's commit's to answer for, so a merge of main never reads main's lines as the branch's, even one main has since removed (martha#933). Git will not remerge an octopus merge (more than two parents), so one is read against its first parent: it may name a line a parent brought, and it never hides one the merge wrote.
- A commit message. It is published with the commit. The check reads it.
- The check's own output. A CI log of a public repository is public. No
value a hit found is therefore ever printed, whatever its class: a lab
hostname, a home directory, a private address, an email address, a 64-hex
id, a GitHub token, and the name a repository hit or a shorthand hit read (martha#846,
martha#855). A hit names the file, the line and the class, and withholds the
value: the log keeps it after the text it came from is edited. The path a
hit is found at is printed, with each lab hostname in it replaced by
<lab host>. A repository lookup GitHub cannot answer (a rate limit, a 5xx) stops the check, and its error names the line that named the repository, not the repository.
Out of reach of this check, and said here so nobody assumes otherwise:
- A push is public before CI runs. The check makes a leak fail the pull
request so it never merges, but it cannot unpublish a pushed commit. Run it
before you push (
npm run check:private, below). A leak that was pushed is handled as an incident, not by a later commit: the range keeps failing on that commit, so the work lands from a fresh branch of clean commits and the old branch is deleted. - The pull request's title, body and comments are not code, so this check
does not read them. A second check,
check_posted_text_carries_nothing_private, does: every surface this repository posts on GitHub is read for the same classes, and a daily run fails by name when one is in it (see below). - A GitHub token broken across lines. The check reads one line at a time.
A token whose prefix sits on one line and its body on the next, or one cut
before
TOKEN_BODYbody characters, matches no line and passes. Joining lines would change every class, so it stays a residual. It is bounded only by the owner revoking the token and by the throwaway repository's deletion each run (#888). The kept record's redactor takes line breaks out of a text before it looks, so it catches a token wrapped in the text as written; #888 names where it still does not. - A private fact said in plain words ("the box in the cupboard") matches no shape. The check guards shapes; the rewrite rule below guards the rest.
How each class is decided
- Repository references are resolved, not listed. Every
owner/repothe check finds — in a GitHub URL, an ssh or https remote, a link or remote on a forge this repository declares (forgeHosts, martha#16 row 5.3), anowner/repo#nreference, or a bare slug under an owner this repository declares — is looked up on the GitHub API. A forge's own pages (explore, user, org, api) name no repository. Only a repository the API reports as public passes. An unknown repository, a renamed-away one, and a private one all fail. A list of private repositories would have to name them in this public repository, and would quietly pass every one it was not taught. The lookup reads the repository's visibility, not whether the caller can see it, so running it with a token that can read private repositories still refuses them. - A shorthand reference to another repository is refused (
synthetic-repo#123). Only this repository's ownmartha#npasses. Writeowner/repo#nso the check, and a reader, can tell what it points at. - Lab machine names are not a class (martha#773). The owner decided on
2026-11-18 that the lab's machine names may be public: the machines sit
behind a NAT. The check needs no list and no secret, so a member's machine
runs every class CI runs, before a push. A
*.labhostname is still refused. - A public digest passes only where it is written as one. A sha256 digest
of a public file has the shape of a node id or a key, so a bare 64-hex string
is refused whatever it is. A digest passes when the text around it says it is
a digest: labelled as a sha256 (an image's
@sha256:<digest>, an OCIsha256:<digest>, asha256field in YAML, JSON or TOML), with the label standing alone, sonode-sha256:or?sha256=is not one; or a sha256sum line checked where it is written, a quoted<digest> <file>piped on the same line tosha256sum -c(orshasum -a 256 -c). A table of ids beside host names, addresses or versions has the sha256sum shape and no check, so it is refused. Each form vouches for the digest it holds and nothing else: an id beside it on the same line is still refused. The forms guard against an id pasted by accident; an id disguised on purpose assha256:<id>is out of reach of any text rule. The forms, with how each is written, are one definition insrc/check_nothing_private_gets_in/public_digest.ts, and the tests plant every written form with a real-shaped digest drawn at run time. - An id is seen wherever it is written, not only standing alone. The hex
class is 64 lowercase hex digits in a row, with no word boundary. So an id
glued to a letter, a digit or
_(x<id>,id_<id>,<id>_key) is refused, and so is any hex run longer than 64: two ids back to back, an id with more hex after it, a 128-hex Ed25519 secret key or signature. The hit names the whole hex run the id sits in. A run longer than 64 is refused even where a digest form holds it, because a digest form vouches only for a run of exactly 64. A sha512 written in hex is therefore refused, labelled or not; a crew that must publish one declares a form for it first. A run shorter than 64, such as a 40-hex git commit sha or a range of them, is outside this class. The length and the digit set are defined once (HEX_DIGIT,ID_HEX_DIGITSinpublic_text.ts), and the shared pattern stays POSIX ERE, so agrep -Ereader refuses any line that holds such a run. - A GitHub token is one of its prefixes and a body long enough to be one (martha#904).
The prefixes and the shortest body are defined once, by the owner's to-do list,
which refuses a token in a command (
GITHUB_TOKEN_PREFIXES,TOKEN_BODYinkeep_the_owners_todo_list.ts), and the scan reads the same two. A word that only starts the same way, a variable namedghs_say, is shorter and passes. The class has no word boundary, as the hex class has none, so a token glued to the text before it is still refused. It is the scan's own line behind the live run's kept-record redactor, so a token that redactor misses is not posted. - The text classes are one definition. The patterns are the crew's own public-text classes, the same ones its note check and release scan hold to.
The check cannot be made when the API cannot answer, the list is missing outside a fork, or git cannot read the range. It then exits 2 and CI fails: it never passes because it could not look.
Synthetic values
A test of a refusal has to state the value it refuses, and that test lives in
this public tree, where the check reads it too. Each class therefore has one
synthetic form that the tree scan accepts: a lab name ending -synthetic (ci-synthetic.lab), a machine
number in the 90s, /home/synthetic, the 192.168.255.0/24 block, the
synthetic.invalid email domain, the listed all-one-digit ids, a GitHub token whose body starts
synthetic (ghp_synthetic...), and repository owners starting synthetic-. The unit tests prove each class refuses its own
synthetic form when the allowance is off, and a structural test holds every form
to a whole-value match, so an allowance cannot swallow a real value that merely
contains one.
What this repository declares public
Besides the synthetic forms, four lists in src/check_nothing_private_gets_in/declared.ts
say what this repository's own text may carry, each matched exactly and never as a
prefix or a suffix:
knownPublic: a repository the offline scan reads as public without asking GitHub (B19 of macula-io/martha#55). A crew repository goes on it only once someone has seen it public on GitHub.publicReservedNames: a name the RFC keeps for documentation (RFC 2606) —example.com,example.net,example.organd every name under one, and any name ending.example— so a test'sgit@git.example.orgis a placeholder, not an address this text discloses (martha#60).publicPlaceholders: an owner and repository a document writes to stand for any pair, such as the origin reader's example URL (martha#60). It is a placeholder, not a claim that any repository is public: with--ask-githubit is asked like any other.publicHomeDirs: a home a public image's own user has (/home/node), declared here so the crew's sharedhome_dirclass inpublic_text.tsstays verbatim.
publicAddresses is the same kind of declaration for an identifier shaped like an
address that is not one: a key type OpenSSH names, and a documentation URL's user
(token@github.com). Only that exact string passes; any other address at its
domain is refused.
The text posted on GitHub
The text a member posts is public the moment it is posted, and it has an edit
box. check_posted_text_carries_nothing_private reads all of it: issue titles
and bodies, issue comments (a pull request's conversation too), pull-request
titles and bodies, review bodies, inline review comments and commit comments,
closed issues and merged pull requests included. It builds the same sources and
holds the same classes as the tree scan, and the same repository lookup refuses a
private repository a comment names.
It reads; it never refuses. GitHub has no hook in its posting forms, so a check
before posting could only be a script each member remembered to run, which is
what the two 2026-11-11 instances were. The read runs daily
(.github/workflows/posted-text.yml) with a read-only token, writes nothing,
opens no issue and posts no comment: a red run is the signal, and its author
edits the text through the Supervisor. What proves it bites on every pull
request is its --self-test, which plants a cited path on each surface in
memory and needs no token.
Legitimate text passes by its form, exactly as in the tree, and the forms are the
ones the check accepts: a home path as /home/synthetic or as one of the
allow_home names, a repository under a synthetic- owner, or a public
repository. An invented name is not a form. A home path under a made-up user, or
a repository nobody declared, is refused exactly as a real one is, because nothing
tells the two apart: angle brackets keep a path out of the class, but the invented
name behind them is still not a form the check accepts, and the same name without
them is refused. There is no exemption for a document, a fenced block or a table —
an evidence citation and a code sample are the same bytes, and both instances
leaked inside inline code.
A run that could not look — a surface refused, a page unreadable — exits 2. It never passes because it could not look.
The rewrite rule for moved code
Keep the reasoning, drop the link.
- A private issue reference: say what was decided and why, in the comment
itself. If a public issue carries the same decision, link that, as
owner/repo#n. - An internal host name: name the role ("the CI runner", "a lab box"), not the machine.
- A private remote or repository: take it from configuration, or name the public repository it should be.
- A home directory, address or id: use the synthetic form —
/home/synthetic, an address in the192.168.255.0/24block, an id of one repeated hex digit. An invented name is refused as a real one is, and brackets keep a path out of the class without making that name a form. - A GitHub token: never paste one. Revoke it first, then say a token was there; a test that needs one writes the synthetic form, or draws one at run time.
Running it
# The tree as it is:
npm run check:private
# What CI runs on a pull request, and a member runs before a push: the tree,
# then every commit in the range.
npm run check:private -- --range <base>..<head>
# The same, asking GitHub about every repository a line names (CI on github.com):
GITHUB_TOKEN=... npm run check:private -- --range <base>..<head> --ask-github
Exit 0 is clean, 1 lists one hit per line as where: what, and 2 means the check
could not be made.
Offline by default (B19 of macula-io/martha#55): no request goes anywhere, and a repository a line names is public only when it is on DECLARED.knownPublic (src/check_nothing_private_gets_in/declared.ts); any other is a hit, so a scan that cannot know fails closed. A crew repository goes on that list only once someone has seen it public on GitHub. With --ask-github, the list is not read and GitHub is asked about every repository instead, so a wrong entry turns that run red. Asked, GitHub is the one source of "public": with no GITHUB_TOKEN, a 401 or 403, any other status but 200 or 404, or an answer without private and visibility, a scan that needs a lookup exits 2 and names why; it never passes on a lookup it could not make. While GitHub is stopped, set MARTHA_GITHUB_STOPPED=1: no repository lookup goes out, and a scan that needs one exits 2. In a clone whose origin is not on github.com (a forge clone, a local path, or no origin), nothing is asked whatever the token and the switch say: a scan that needs a lookup exits 2 and names the origin's host (forge martha#39).
The text posted on GitHub, read whole, and one draft before it is posted:
# Every surface of this repository's posted text (read-only token; the run
# writes nothing):
GITHUB_REPOSITORY=<owner>/<repo> GITHUB_TOKEN=... npm run check:posted-text -- --ask-github
# One draft, before it is posted (offline, like check:private):
npm run check:posted-text -- --text <file>
Its where names the object a person acts on: issue #170 comment 6765201999:12,
pull 263 body:4, pull 263 review 4810:2, commit 8ca6eb3 comment 12:1, and a
draft <file> for a draft.
Martha's docs, from release v0.4.1: Getting started: a crew of two on your own project · @macula-io/martha · Martha · The agent control loop · claw-code: what it is, where it comes from, what Martha can learn · The host contract and the ledger · How a release is made · Nothing private gets in · The port map, in summary · The publish gate · The crew's declaration