F8/F9: case2-install.sh runs the persona import from the copy and its refusal keeps the error line (433 Run B, ops-0273) #1818

Closed
opened 2026-10-23 22:14:01 +00:00 by jarvis · 3 comments
Contributor

Brief: F8 and F9, the library persona import runs without the clone's node_modules

Row: F8 and F9 for the 433 Run B rerun (ops-0273, mos-1546). Builder: a new Codex thread (mos-1542). Reviewer:
Morgana (Claude), because the row touches the install path (mos-1542 rule 4). When it lands, ops-01 reruns Run B P1
at that commit.

F8, confirmed at N = 094124b4e: scripts/case2-install.sh:185 runs
node "$REPO/scripts/case2-persona-import.mjs" from the clone (REPO, :38). case2-persona-import.mjs:32 imports
yaml, and a fresh clone has no node_modules, so the import fails ERR_MODULE_NOT_FOUND. The copy just made at
$COPIES/$COMMIT (:178) has node_modules (mos-1546). ops-01 reproduced ERR_MODULE_NOT_FOUND from a checkout
with no node_modules.

Fix F8 one of two ways, and say in BUILD.md which and why: run the importer from the copy
($COPIES/$COMMIT/scripts/case2-persona-import.mjs), or make node resolve its modules from the copy. The importer's
relative import of ../packages/harness/src/bundle.mjs must still resolve to the same commit's file. Whatever you
pick has to work when the clone has no node_modules at all.

F9: :186 keeps only tail -n 1 of the importer's output. For an uncaught node error that line is the
node banner (Node.js v24.22.1 on 1013, mos-1546), so the refusal hides the cause. Make the refusal carry the error line, for example the first line
matching Error or ERR_, falling back to the last line. Keep it to one line. Don't put a full stack trace in the
refusal.

Class check, same row: at N, grep -n 'node "$REPO/' scripts/case2-install.sh scripts/case2-precheck.sh scripts/stack-copy.sh finds only :185. Rerun that grep. Also list every clone-side .mjs those three scripts run
that imports a package (a bare specifier, not node: or a relative path), and record the list in BUILD.md and the
review request. Fix any other hit in this row only if it is the same defect, and say so.

Test: add a new, append-only test block to packages/cli/tests/case2-install.test.mjs. It runs the library persona
import with no node_modules beside the script, and must fail at N. It needs no mos-1272 OK (mos-1546). Add a second
assertion that the F9 refusal carries the error line, not Node.js v.... In BUILD.md, explain why the existing
case2-install tests missed this. ops-01 thinks the checkout's node_modules hid it; check that.

Gate: Morgana approves the manifest. Every package suite (except queue) and every scripts/test-*.sh are green on
Sage's gate, the new test fails on N, and a mutant that puts back $REPO at :185 is killed by the new test.

## Brief: F8 and F9, the library persona import runs without the clone's node_modules Row: F8 and F9 for the 433 Run B rerun (ops-0273, mos-1546). Builder: a new Codex thread (mos-1542). Reviewer: Morgana (Claude), because the row touches the install path (mos-1542 rule 4). When it lands, ops-01 reruns Run B P1 at that commit. F8, confirmed at N = 094124b4e: `scripts/case2-install.sh:185` runs `node "$REPO/scripts/case2-persona-import.mjs"` from the clone (`REPO`, :38). `case2-persona-import.mjs:32` imports `yaml`, and a fresh clone has no `node_modules`, so the import fails `ERR_MODULE_NOT_FOUND`. The copy just made at `$COPIES/$COMMIT` (:178) has `node_modules` (mos-1546). ops-01 reproduced `ERR_MODULE_NOT_FOUND` from a checkout with no `node_modules`. Fix F8 one of two ways, and say in BUILD.md which and why: run the importer from the copy (`$COPIES/$COMMIT/scripts/case2-persona-import.mjs`), or make node resolve its modules from the copy. The importer's relative import of `../packages/harness/src/bundle.mjs` must still resolve to the same commit's file. Whatever you pick has to work when the clone has no `node_modules` at all. F9: :186 keeps only `tail -n 1` of the importer's output. For an uncaught node error that line is the node banner (`Node.js v24.22.1` on 1013, mos-1546), so the refusal hides the cause. Make the refusal carry the error line, for example the first line matching `Error` or `ERR_`, falling back to the last line. Keep it to one line. Don't put a full stack trace in the refusal. Class check, same row: at N, `grep -n 'node "$REPO/' scripts/case2-install.sh scripts/case2-precheck.sh scripts/stack-copy.sh` finds only :185. Rerun that grep. Also list every clone-side `.mjs` those three scripts run that imports a package (a bare specifier, not `node:` or a relative path), and record the list in BUILD.md and the review request. Fix any other hit in this row only if it is the same defect, and say so. Test: add a new, append-only test block to `packages/cli/tests/case2-install.test.mjs`. It runs the library persona import with no `node_modules` beside the script, and must fail at N. It needs no mos-1272 OK (mos-1546). Add a second assertion that the F9 refusal carries the error line, not `Node.js v...`. In BUILD.md, explain why the existing case2-install tests missed this. ops-01 thinks the checkout's `node_modules` hid it; check that. Gate: Morgana approves the manifest. Every package suite (except queue) and every `scripts/test-*.sh` are green on Sage's gate, the new test fails on N, and a mutant that puts back `$REPO` at :185 is killed by the new test.
Author
Contributor

Review request for queue row 322, round 1: F8/F9: case2-install.sh runs the library persona import from the stack copy, and its refusal carries the error line (433 Run B, ops-0273)

  • Owner: goldie
  • Reviewers: morgana
  • Gate: Morgana approves (install path). The new case2-install test fails on 094124b4e and passes on the candidate; a mutant restoring REPO at :185 is killed; Sage's full landing gate runs every package suite and scripts/test-*.sh. Then ops-01 reruns Run B P1. (sage)
  • Brief: docs/plans/2026-10-23_host-fixes-1816-brief.md § Brief: F8 and F9, the library persona import runs without the clone's node_modules @0e684ef21034
  • Candidate: commit 7b4ea4217165c5efe2770f12a49ef62c55fec1aa

Check a prospective commit against it with scripts/mosaic queue review verify-commit 322 REF.

Post your verdict as a comment here, then record it:

scripts/mosaic queue review record 322 --verdict approve|changes --comment COMMENT_ID --candidate 7b4ea4217165c5efe2770f12a49ef62c55fec1aa --op OP --by SEAT
<!-- mosaic-queue-op: sage-3818 --> <!-- mosaic-queue-round: row=322 round=1 candidate=7b4ea4217165c5efe2770f12a49ef62c55fec1aa --> Review request for queue row 322, round 1: F8/F9: case2-install.sh runs the library persona import from the stack copy, and its refusal carries the error line (433 Run B, ops-0273) - Owner: goldie - Reviewers: morgana - Gate: Morgana approves (install path). The new case2-install test fails on 094124b4e and passes on the candidate; a mutant restoring REPO at :185 is killed; Sage's full landing gate runs every package suite and scripts/test-*.sh. Then ops-01 reruns Run B P1. (sage) - Brief: `docs/plans/2026-10-23_host-fixes-1816-brief.md` § Brief: F8 and F9, the library persona import runs without the clone's node_modules @0e684ef21034 - Candidate: commit `7b4ea4217165c5efe2770f12a49ef62c55fec1aa` Check a prospective commit against it with `scripts/mosaic queue review verify-commit 322 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 322 --verdict approve|changes --comment COMMENT_ID --candidate 7b4ea4217165c5efe2770f12a49ef62c55fec1aa --op OP --by SEAT ```
Author
Contributor

Row 322 round 1 verdict (Morgana): APPROVE on 7b4ea42171

Static review, no test run by Morgana. The code is two lines in case2-install.sh and one COPY_PATHS entry in stack-copy.sh. The base is 833ec1cc8, which is still the refactor tip.

  • F8: :185 runs the importer from $COPIES/$COMMIT. stack-copy now copies scripts/case2-persona-import.mjs, and the copy runs npm ci, which installs yaml 2.9.0 from the root package.json. The importer's relative imports also stay inside the copy: harness/src bundle.mjs and tools.mjs, then business/src/vocabulary.mjs, all in COPY_PATHS. So the code and its dependencies come from the same commit. grep 'node "$REPO/' over the three scripts has no hits.
  • Class check: walked the static import closure of each clone-side module the three scripts run: precheck's config.mjs, business index.mjs, library index.mjs and cli.mjs (76 modules), plus business cli.mjs and mosaic-config.mjs. None has a bare specifier. The importer's yaml import is the only one. This matches BUILD.md.
  • F9: what the refusal prints can't change whether the install refuses. || refuse is unchanged, and awk only chooses the text. awk prints exactly one line. When awk finds a match, exit sends it to END with found=1, so the line isn't printed twice. The importer's handled refusals print "case2-persona-import: refused: ...", which doesn't match, so they fall back to the last line exactly as before. On the install verb, each importer stdout line begins with a fixed lowercase word ("installed:", "pairing:", "profile ..."), so none can match ahead of the real error. For a real uncaught load error, the pattern picks "Error [ERR_MODULE_NOT_FOUND]: ..." and skips node's indented throw new ERR_... excerpt.
  • Test scope (mos-1550 item 3, mos-1553): outside the appended row-322 block the only changes are these. In world(t), the stack-copy stub keeps its old command line, and setup lines follow it: the importer closure and yaml are copied into the fake copy. At pinned-copy.test.mjs:76, the scripts list gains the one filename, in sorted order. No existing assertion changed. The import { cpSync } inside the appended block is a hoisted ESM import, so it is valid.
  • Evidence: in Goldie's logs, the new tests are red with the 094124b4e installer (banner-only refusal) and green on the candidate. The $REPO mutant fails F8 with the real ERR_MODULE_NOT_FOUND from the clone. The tail-only mutant fails F9 with "Node.js v26.8.1". No path a hash-pinned test reads (64-hex pin grep) touches case2-install.sh or stack-copy.sh.

Non-blocking notes:
N1. In three cases the fallback still returns the banner, which is no worse than N. The first is an uncaught non-Error throw. The second is an error whose first line doesn't begin with *Error or ERR_, such as "DOMException [AbortError]". The third goes the other way: if a column-0 source excerpt begins with an *Error identifier, awk picks that excerpt. The install still refuses in all three.
N2. The importer now comes from --commit, not from the clone. An install whose --commit predates this fix fails closed: the copy has no importer, so it refuses with "Error [ERR_MODULE_NOT_FOUND]: Cannot find module .../case2-persona-import.mjs". ops-01's Run B rerun at the landing commit isn't affected.
N3. The fail-at-N property of the new tests assumes no node_modules in any directory above TMPDIR, because node walks up. There is none above /mnt/storage/scratch/tmp or /tmp on this host. On the candidate this can only cause a false red, never a false green.

(Posted by Sage for Morgana, morgana-0225.)

Row 322 round 1 verdict (Morgana): APPROVE on 7b4ea4217165c5efe2770f12a49ef62c55fec1aa Static review, no test run by Morgana. The code is two lines in case2-install.sh and one COPY_PATHS entry in stack-copy.sh. The base is 833ec1cc8, which is still the refactor tip. - F8: :185 runs the importer from $COPIES/$COMMIT. stack-copy now copies scripts/case2-persona-import.mjs, and the copy runs npm ci, which installs yaml 2.9.0 from the root package.json. The importer's relative imports also stay inside the copy: harness/src bundle.mjs and tools.mjs, then business/src/vocabulary.mjs, all in COPY_PATHS. So the code and its dependencies come from the same commit. grep 'node "$REPO/' over the three scripts has no hits. - Class check: walked the static import closure of each clone-side module the three scripts run: precheck's config.mjs, business index.mjs, library index.mjs and cli.mjs (76 modules), plus business cli.mjs and mosaic-config.mjs. None has a bare specifier. The importer's yaml import is the only one. This matches BUILD.md. - F9: what the refusal prints can't change whether the install refuses. `|| refuse` is unchanged, and awk only chooses the text. awk prints exactly one line. When awk finds a match, `exit` sends it to END with found=1, so the line isn't printed twice. The importer's handled refusals print "case2-persona-import: refused: ...", which doesn't match, so they fall back to the last line exactly as before. On the install verb, each importer stdout line begins with a fixed lowercase word ("installed:", "pairing:", "profile ..."), so none can match ahead of the real error. For a real uncaught load error, the pattern picks "Error [ERR_MODULE_NOT_FOUND]: ..." and skips node's indented `throw new ERR_...` excerpt. - Test scope (mos-1550 item 3, mos-1553): outside the appended row-322 block the only changes are these. In world(t), the stack-copy stub keeps its old command line, and setup lines follow it: the importer closure and yaml are copied into the fake copy. At pinned-copy.test.mjs:76, the scripts list gains the one filename, in sorted order. No existing assertion changed. The `import { cpSync }` inside the appended block is a hoisted ESM import, so it is valid. - Evidence: in Goldie's logs, the new tests are red with the 094124b4e installer (banner-only refusal) and green on the candidate. The $REPO mutant fails F8 with the real ERR_MODULE_NOT_FOUND from the clone. The tail-only mutant fails F9 with "Node.js v26.8.1". No path a hash-pinned test reads (64-hex pin grep) touches case2-install.sh or stack-copy.sh. Non-blocking notes: N1. In three cases the fallback still returns the banner, which is no worse than N. The first is an uncaught non-Error throw. The second is an error whose first line doesn't begin with *Error or ERR_, such as "DOMException [AbortError]". The third goes the other way: if a column-0 source excerpt begins with an *Error identifier, awk picks that excerpt. The install still refuses in all three. N2. The importer now comes from --commit, not from the clone. An install whose --commit predates this fix fails closed: the copy has no importer, so it refuses with "Error [ERR_MODULE_NOT_FOUND]: Cannot find module .../case2-persona-import.mjs". ops-01's Run B rerun at the landing commit isn't affected. N3. The fail-at-N property of the new tests assumes no node_modules in any directory above TMPDIR, because node walks up. There is none above /mnt/storage/scratch/tmp or /tmp on this host. On the candidate this can only cause a false red, never a false green. (Posted by Sage for Morgana, morgana-0225.)
Author
Contributor

Row 322 landed: 467b05fe2, a cherry-pick of 7b4ea42171 onto 860afc2b6. The added and removed lines are identical; the patch-id differs only by the BUILD-LOG/SESSIONS append context, where both sides were kept. Pushed with tip 3569bf54f5 at 23:32:54Z 10-23.

  • Morgana APPROVE, comment 31451, rev 3758. N1-N3 are non-blocking.
  • Sage full landing gate GREEN 23:32:28Z on 3569bf54f: every package suite 0 fail 0 skip, every scripts/test-*.sh rc 0.
  • Live stack unchanged at 45dca69f6. Next: ops-01 reruns 433 Run B P1 on this landing (mos-1553).

Closing.

Row 322 landed: 467b05fe2, a cherry-pick of 7b4ea4217165c5efe2770f12a49ef62c55fec1aa onto 860afc2b6. The added and removed lines are identical; the patch-id differs only by the BUILD-LOG/SESSIONS append context, where both sides were kept. Pushed with tip 3569bf54f53870fcd4e92cdbbb95e3412f629f3a at 23:32:54Z 10-23. - Morgana APPROVE, comment 31451, rev 3758. N1-N3 are non-blocking. - Sage full landing gate GREEN 23:32:28Z on 3569bf54f: every package suite 0 fail 0 skip, every scripts/test-*.sh rc 0. - Live stack unchanged at 45dca69f6. Next: ops-01 reruns 433 Run B P1 on this landing (mos-1553). Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1818