A symlink is read as its link text, and a range reads only the files it touches (forge martha#111) #112

Manually merged
terra merged 1 commit from titan/111-symlink-and-range-reads into main 2026-11-24 02:10:47 +00:00
Member

Purpose (bug): the private gate runs on every repository, including one that tracks a symlink to a directory, so a
README-only pull request can land gated (forge martha#111).

A symlink is read as its link text, never followed. treeSources read every tracked path with readFileSync,
which follows a symlink: macula-os tracks three to ../.., so the gate stopped with EISDIR on a README-only
change. Each path is now lstat'd and a symlink is read with readlinkSync, the text git publishes for it — which
also means a link's own text is read, where before the target's content was.

A --range run reads only the files the range touches. It read the whole tree beside the commits it was given,
so a range over a data repository read every file in it: 42 minutes at full CPU on mcl-fovea-records with nothing
landed. The tree read is now narrowed to git diff --name-only <base>..<head>. A branch's first push, whose base is
all zeros, has no base to compare against and still reads the whole tree.

Both came red first, and each carries a mutant that a named test kills:

  • bytesAt without the lstat/readlink branch → the symlink test fails with the issue's own EISDIR;
  • sourcesOf reading the whole tree → "a range run reads only the files the range touches" fails;
  • sourcesOf narrowing to nothing → "a range still reads the files it touches, and a first push…" fails;
  • pathsTouchedBy without the all-zero base line → the same guard test fails.

On this repository (1253 tracked paths): whole tree 3688 ms, a four-path range 275 ms.

Gate on msi00 (node 24.22.3, nice -n 10, four cores): typecheck 0, lint 0, check:private clean whole-tree and
over the range, npm test 5339 of 5386 pass. The five failures are run_an_owner_signed_command's sandbox tests
(/bin/sh: exec: node: not found / npm: not found, msi00's node lives only under mise); the same five fail on main
1f36933e in the same tree.

Refs #111

Purpose (bug): the private gate runs on every repository, including one that tracks a symlink to a directory, so a README-only pull request can land gated (forge martha#111). **A symlink is read as its link text, never followed.** `treeSources` read every tracked path with `readFileSync`, which follows a symlink: macula-os tracks three to `../..`, so the gate stopped with `EISDIR` on a README-only change. Each path is now `lstat`'d and a symlink is read with `readlinkSync`, the text git publishes for it — which also means a link's own text is read, where before the target's content was. **A `--range` run reads only the files the range touches.** It read the whole tree beside the commits it was given, so a range over a data repository read every file in it: 42 minutes at full CPU on mcl-fovea-records with nothing landed. The tree read is now narrowed to `git diff --name-only <base>..<head>`. A branch's first push, whose base is all zeros, has no base to compare against and still reads the whole tree. Both came red first, and each carries a mutant that a named test kills: - `bytesAt` without the lstat/readlink branch → the symlink test fails with the issue's own `EISDIR`; - `sourcesOf` reading the whole tree → "a range run reads only the files the range touches" fails; - `sourcesOf` narrowing to nothing → "a range still reads the files it touches, and a first push…" fails; - `pathsTouchedBy` without the all-zero base line → the same guard test fails. On this repository (1253 tracked paths): whole tree 3688 ms, a four-path range 275 ms. Gate on msi00 (node 24.22.3, nice -n 10, four cores): `typecheck` 0, `lint` 0, `check:private` clean whole-tree and over the range, `npm test` 5339 of 5386 pass. The five failures are `run_an_owner_signed_command`'s sandbox tests (`/bin/sh: exec: node: not found` / `npm: not found`, msi00's node lives only under mise); the same five fail on main `1f36933e` in the same tree. Refs #111
A symlink is read as its link text, and a range reads only the files it touches (forge martha#111)
All checks were successful
CI / gate coverage (pull_request) Has been skipped
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 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 / node in installer (pull_request) Successful in 11s
c4 model / c4-model-1 (pull_request) Successful in 5s
dependency advisories / advisories (pull_request) Successful in 0s
c4 model / c4-model (pull_request) Successful in 0s
CI / links resolve (pull_request) Successful in 5s
CI / structural floor (pull_request) Successful in 24s
CI / Martha's names are its own (pull_request) Successful in 25s
CI / no import cycle (pull_request) Successful in 25s
CI / the host drift check bites (pull_request) Successful in 1m1s
CI / the posted text check bites (pull_request) Successful in 11s
CI / the engine drift check bites (pull_request) Successful in 1m4s
CI / the ring reaches the owner on the live run's tmux (pull_request) Successful in 20s
CI / workflows are valid (pull_request) Successful in 20s
CI / installer (pull_request) Successful in 3m58s
CI / nothing private (pull_request) Has been skipped
CI / no test the base passed goes missing (pull_request) Successful in 40s
CI / the pictures change only with the version (pull_request) Successful in 19s
CI / no literal restates a defined value (pull_request) Successful in 1m15s
CI / every check runs in a job (pull_request) Successful in 14s
CI / every job has a timeout (pull_request) Successful in 15s
standalone / the pinned Node is nodejs.org's (pull_request) Successful in 15s
standalone / standalone Martha runs alone (ubuntu-latest) (pull_request) Successful in 49s
CI / the relay loads in the recorded host (pull_request) Successful in 14m14s
CI / the clean-install proof removes its container (pull_request) Successful in 15m54s
d083303625
treeSources read every tracked path with readFileSync, which follows a
symlink: macula-os tracks three to `../..`, so the gate stopped with
EISDIR on a README-only pull request. Each path is now lstat'd, and a
symlink is read as its target text, the content git publishes for it.

A --range run read the whole tree beside the commits it was given, so a
range over a data repository read every file in it: 42 minutes at full
CPU on mcl-fovea-records with nothing landed. The tree read is now
narrowed to the paths the range touches, and a branch's first push, whose
base is all zeros, still reads the whole tree as it has no base to
compare against.

Both fixes came red first and each carries a mutant a named test kills.
terra manually merged commit f08f5a02af into main 2026-11-24 02:10:47 +00:00
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!112
No description provided.