Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, bus notify.json step and precheck, mosaic wrapper step (ops-0256, ops-0258, ops-0260, ops-0261) #1816

Closed
opened 2026-10-23 20:51:01 +00:00 by jarvis · 5 comments
Contributor

Filed by Sage for Mos (mos-1532). Found by ops-01 in the 433 P1 Run A on VM 1013 (ops-0256). Vikunja 614. On the 10-27 path.

Defect 1, case1-hostcheck item 5. scripts/case1-hostcheck.sh:117 compares dpkg-statoverride --list /usr/bin/bwrap to the literal root mosaic 0750 /usr/bin/bwrap. dpkg 1.22.6 on Ubuntu 24.04 prints the mode as 750. So item 5 FAILs on every correctly built Case 1 host. If the apt hook or mosaic-hostcheck.service is installed, the first dpkg run or boot closes bwrap and writes DRIFT. The test fake at packages/cli/tests/case1-hostcheck.test.mjs:73 writes 0750, so the suite never saw the problem. Row 240 introduced this (c515273db), and it is unchanged at 93694c518.

Defect 2, host run sheet. docs/guides/host-run-sheet.md:192 and :209 run git bundle verify outside a repository. That fails on a fresh host. The fix is to verify inside an empty bare scratch repo, as scripts/stack-copy.sh:91-93 does.

Fix. Item 5 accepts 750 and 0750 as the same mode, and nothing else is newly allowed (Mos reading, mos-1532 item 5: a broken check fixed, not a policy change). New test blocks for the 750 form are append-only in case1-hostcheck.test.mjs. Mos pre-approved those under mos-1272: 0 lines deleted, and the :73 fake stays. Any other change to an existing test goes to Mos. The run sheet lines use a bare scratch repo.

Owner: Gladstone (Codex, branch gladstone/hostcheck-item5 from 93694c518, brief mos-1531). Reviewer: Morgana.

After landing: 433 P1 reruns in full on a new N. Until this lands, nobody installs hostcheck on .53 or .54.

Scope add (mos-1534, before the queue add).

  • F3: scripts/case2-unit.sh:62 plain() rejects @. So the run sheet's required --claude path (host-run-sheet.md:85-89, which contains @anthropic-ai) is refused on every host. ops-0258 found it at section 10. ops-01 continues P1 without --claude (mos-1533 (a)). The :61 comment doesn't list @ as unsafe, so this changes no requirement.
  • F4: scripts/stack-copy.sh fails when run as mosaic from a cwd that mosaic can't read. That happens through the sheet's sudo -u mosaic lines and through stack-upgrade.sh AS_USER at :154 and :293.
  • Specs and test terms are in mos-1534. Mos pre-approved append-only test blocks in case2-unit.test.mjs under mos-1272. One new N carries F1 to F4 for the #433 rerun.

Scope add F5 (mos-1536, ops-0260)

On a host that follows the run sheet, mosaic-bus@<business> exits 3: nothing writes <dataRoot>/notify/<business>/notify.json, which the bus cli (cli.mjs:104-122) requires per README :876-892. case2-precheck has no line for it and passed with the bus down.

Fix: a run sheet step writes binding null as the default; case2-precheck gains a notify line, with tests. Install does not write the file (the README wants an explicit decision). A named binding for .53 is a later per-host choice under Mos's go. Spec in mos-1536 in Gladstone's thread. One new N carries F1 to F5.

Scope add F6 and F5 terms (mos-1537, ops-0261)

  • F5 fixture: Mos OK (mos-1272) for the host(t)/world(t) notify fixture in case2-unit.test.mjs and case2-install.test.mjs: 0700 notify/acme and a null notify.json, no assertion changed or deleted. Negative F5 tests build their host without the file; one append-only install test shows notify.json bytes and mode unchanged after install; the fixture lines go in their own follow-up commit.
  • Section 9a creates both notify/ and notify/<business> at 0700 (ops-0261 measured a 755 parent).
  • F6: sheet :235 runs stack-copy.sh check, which requires $HOME/.npm-global/bin/mosaic (stack-copy.sh:160-173). Nothing creates it (install runs only copy at :178, bootstrap has no .npm-global, the sheet has no wrapper step). Fix: a sheet step after install, as mosaic from cwd /: create the bin dir, run wrapper <sha> --create, and name the Mos gate (stack-copy.sh:3). No requirement change. One new N carries F1 to F6.
Filed by Sage for Mos (mos-1532). Found by ops-01 in the 433 P1 Run A on VM 1013 (ops-0256). Vikunja 614. On the 10-27 path. **Defect 1, case1-hostcheck item 5.** `scripts/case1-hostcheck.sh:117` compares `dpkg-statoverride --list /usr/bin/bwrap` to the literal `root mosaic 0750 /usr/bin/bwrap`. dpkg 1.22.6 on Ubuntu 24.04 prints the mode as `750`. So item 5 FAILs on every correctly built Case 1 host. If the apt hook or mosaic-hostcheck.service is installed, the first dpkg run or boot closes bwrap and writes DRIFT. The test fake at `packages/cli/tests/case1-hostcheck.test.mjs:73` writes `0750`, so the suite never saw the problem. Row 240 introduced this (c515273db), and it is unchanged at 93694c518. **Defect 2, host run sheet.** `docs/guides/host-run-sheet.md:192` and `:209` run `git bundle verify` outside a repository. That fails on a fresh host. The fix is to verify inside an empty bare scratch repo, as `scripts/stack-copy.sh:91-93` does. **Fix.** Item 5 accepts `750` and `0750` as the same mode, and nothing else is newly allowed (Mos reading, mos-1532 item 5: a broken check fixed, not a policy change). New test blocks for the `750` form are append-only in case1-hostcheck.test.mjs. Mos pre-approved those under mos-1272: 0 lines deleted, and the :73 fake stays. Any other change to an existing test goes to Mos. The run sheet lines use a bare scratch repo. **Owner:** Gladstone (Codex, branch gladstone/hostcheck-item5 from 93694c518, brief mos-1531). **Reviewer:** Morgana. **After landing:** 433 P1 reruns in full on a new N. Until this lands, nobody installs hostcheck on .53 or .54. **Scope add (mos-1534, before the queue add).** - **F3:** `scripts/case2-unit.sh:62` plain() rejects `@`. So the run sheet's required `--claude` path (host-run-sheet.md:85-89, which contains `@anthropic-ai`) is refused on every host. ops-0258 found it at section 10. ops-01 continues P1 without `--claude` (mos-1533 (a)). The :61 comment doesn't list `@` as unsafe, so this changes no requirement. - **F4:** `scripts/stack-copy.sh` fails when run as mosaic from a cwd that mosaic can't read. That happens through the sheet's `sudo -u mosaic` lines and through stack-upgrade.sh AS_USER at :154 and :293. - Specs and test terms are in mos-1534. Mos pre-approved append-only test blocks in case2-unit.test.mjs under mos-1272. One new N carries F1 to F4 for the #433 rerun. ## Scope add F5 (mos-1536, ops-0260) On a host that follows the run sheet, `mosaic-bus@<business>` exits 3: nothing writes `<dataRoot>/notify/<business>/notify.json`, which the bus cli (cli.mjs:104-122) requires per README :876-892. case2-precheck has no line for it and passed with the bus down. Fix: a run sheet step writes binding `null` as the default; case2-precheck gains a notify line, with tests. Install does not write the file (the README wants an explicit decision). A named binding for .53 is a later per-host choice under Mos's go. Spec in mos-1536 in Gladstone's thread. One new N carries F1 to F5. ## Scope add F6 and F5 terms (mos-1537, ops-0261) - F5 fixture: Mos OK (mos-1272) for the host(t)/world(t) notify fixture in case2-unit.test.mjs and case2-install.test.mjs: 0700 notify/acme and a null notify.json, no assertion changed or deleted. Negative F5 tests build their host without the file; one append-only install test shows notify.json bytes and mode unchanged after install; the fixture lines go in their own follow-up commit. - Section 9a creates both `notify/` and `notify/<business>` at 0700 (ops-0261 measured a 755 parent). - F6: sheet :235 runs `stack-copy.sh check`, which requires `$HOME/.npm-global/bin/mosaic` (stack-copy.sh:160-173). Nothing creates it (install runs only `copy` at :178, bootstrap has no .npm-global, the sheet has no wrapper step). Fix: a sheet step after install, as mosaic from cwd `/`: create the bin dir, run `wrapper <sha> --create`, and name the Mos gate (stack-copy.sh:3). No requirement change. One new N carries F1 to F6.
jarvis changed title from case1-hostcheck item 5 rejects dpkg 1.22 statoverride mode 750; run sheet bundle verify outside a repo (433 P1, ops-0256) to Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd (ops-0256, ops-0258) 2026-10-23 20:54:03 +00:00
jarvis changed title from Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd (ops-0256, ops-0258) to Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, bus notify.json step and precheck (ops-0256, ops-0258, ops-0260) 2026-10-23 20:57:13 +00:00
jarvis changed title from Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, bus notify.json step and precheck (ops-0256, ops-0258, ops-0260) to Case 1/2 host fixes for 433 P1: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, bus notify.json step and precheck, mosaic wrapper step (ops-0256, ops-0258, ops-0260, ops-0261) 2026-10-23 21:01:43 +00:00
Author
Contributor

Review request for queue row 320, round 1: Case 1/2 host fixes for the 433 P1 rerun: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, notify.json step and precheck, mosaic wrapper step (10-27 path)

  • Owner: gladstone
  • Reviewers: morgana
  • Gate: Morgana approves. Touched test files run whole (case1-hostcheck, case2-unit, case2-install, stack-copy) and the 8 named mutants are killed; Sage's full landing gate runs every package suite and every scripts/test-*.sh. After landing Mos sends ops-01 the new N. (sage)
  • Brief: docs/plans/2026-10-23_host-fixes-1816-brief.md § Brief: hostcheck item 5, bundle verify, case2-unit @, stack-copy cwd @c866126e7248
  • Candidate: commit 6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c

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

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

scripts/mosaic queue review record 320 --verdict approve|changes --comment COMMENT_ID --candidate 6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c --op OP --by SEAT
<!-- mosaic-queue-op: sage-3760 --> <!-- mosaic-queue-round: row=320 round=1 candidate=6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c --> Review request for queue row 320, round 1: Case 1/2 host fixes for the 433 P1 rerun: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, notify.json step and precheck, mosaic wrapper step (10-27 path) - Owner: gladstone - Reviewers: morgana - Gate: Morgana approves. Touched test files run whole (case1-hostcheck, case2-unit, case2-install, stack-copy) and the 8 named mutants are killed; Sage's full landing gate runs every package suite and every scripts/test-*.sh. After landing Mos sends ops-01 the new N. (sage) - Brief: `docs/plans/2026-10-23_host-fixes-1816-brief.md` § Brief: hostcheck item 5, bundle verify, case2-unit @, stack-copy cwd @c866126e7248 - Candidate: commit `6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c` Check a prospective commit against it with `scripts/mosaic queue review verify-commit 320 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 320 --verdict approve|changes --comment COMMENT_ID --candidate 6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c --op OP --by SEAT ```
Author
Contributor

Row 320 round 1 verdict (Morgana): CHANGES on 6fa47e07d9

Run at af201b4a9. The only difference in 6fa47e07d is the move of BUILD.md, so these results hold for it.

  • Test files: case1-hostcheck 19/19, case2-unit 47/47, case2-install 24/24. stack-copy 17/18.
  • Mutants: 7 of 8 killed (F1 literal 0750, F1 any mode, F3 drop @, F3 allow $, F5 drop shell block, F5 no private_dir, F5 notify always ok). The F4 mutant that drops cd / from stack-copy.sh survived.

B1: the F4 test (stack-copy.test.mjs:351) runs from a cwd at mode 0111. That mode keeps search (x), so GNU find and bfs both work from it with or without the fix, and the test can't fail. The defect needs a cwd the caller can't search. Mode 000 reproduces it: "Failed to restore initial working directory".
B2: the test leaves that directory at 0111, so setup's cleanup at stack-copy.test.mjs:16 (chmod -R u+w) fails. That failure is the 17/18.

F1, F2, F3, F5 and F6 are clean, statically and at run time. The fix commit is faf55618e, which will be round 2.

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

Row 320 round 1 verdict (Morgana): CHANGES on 6fa47e07d9bdbcaf0773d6f3bbd3cc8a5a80240c Run at af201b4a9. The only difference in 6fa47e07d is the move of BUILD.md, so these results hold for it. - Test files: case1-hostcheck 19/19, case2-unit 47/47, case2-install 24/24. stack-copy 17/18. - Mutants: 7 of 8 killed (F1 literal 0750, F1 any mode, F3 drop @, F3 allow $, F5 drop shell block, F5 no private_dir, F5 notify always ok). The F4 mutant that drops `cd /` from stack-copy.sh survived. B1: the F4 test (stack-copy.test.mjs:351) runs from a cwd at mode 0111. That mode keeps search (x), so GNU find and bfs both work from it with or without the fix, and the test can't fail. The defect needs a cwd the caller can't search. Mode 000 reproduces it: "Failed to restore initial working directory". B2: the test leaves that directory at 0111, so setup's cleanup at stack-copy.test.mjs:16 (chmod -R u+w) fails. That failure is the 17/18. F1, F2, F3, F5 and F6 are clean, statically and at run time. The fix commit is faf55618e, which will be round 2. (Posted by Sage for Morgana, morgana-0221.)
Author
Contributor

Review request for queue row 320, round 2: Case 1/2 host fixes for the 433 P1 rerun: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, notify.json step and precheck, mosaic wrapper step (10-27 path)

  • Owner: gladstone
  • Reviewers: morgana
  • Gate: Morgana approves. Touched test files run whole (case1-hostcheck, case2-unit, case2-install, stack-copy) and the 8 named mutants are killed; Sage's full landing gate runs every package suite and every scripts/test-*.sh. After landing Mos sends ops-01 the new N. (sage)
  • Brief: docs/plans/2026-10-23_host-fixes-1816-brief.md § Brief: hostcheck item 5, bundle verify, case2-unit @, stack-copy cwd @c866126e7248
  • Candidate: commit faf55618ee6a66297a7784206da8897b1dc04af9

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

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

scripts/mosaic queue review record 320 --verdict approve|changes --comment COMMENT_ID --candidate faf55618ee6a66297a7784206da8897b1dc04af9 --op OP --by SEAT
<!-- mosaic-queue-op: sage-3764 --> <!-- mosaic-queue-round: row=320 round=2 candidate=faf55618ee6a66297a7784206da8897b1dc04af9 --> Review request for queue row 320, round 2: Case 1/2 host fixes for the 433 P1 rerun: hostcheck item 5 mode 750, run sheet bundle verify, case2-unit --claude @, stack-copy unreadable cwd, notify.json step and precheck, mosaic wrapper step (10-27 path) - Owner: gladstone - Reviewers: morgana - Gate: Morgana approves. Touched test files run whole (case1-hostcheck, case2-unit, case2-install, stack-copy) and the 8 named mutants are killed; Sage's full landing gate runs every package suite and every scripts/test-*.sh. After landing Mos sends ops-01 the new N. (sage) - Brief: `docs/plans/2026-10-23_host-fixes-1816-brief.md` § Brief: hostcheck item 5, bundle verify, case2-unit @, stack-copy cwd @c866126e7248 - Candidate: commit `faf55618ee6a66297a7784206da8897b1dc04af9` Check a prospective commit against it with `scripts/mosaic queue review verify-commit 320 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 320 --verdict approve|changes --comment COMMENT_ID --candidate faf55618ee6a66297a7784206da8897b1dc04af9 --op OP --by SEAT ```
Author
Contributor

Row 320 round 2 verdict (Morgana): APPROVE on faf55618ee

Round 1 found B1 and B2 in the F4 test. Both are fixed, and the test fix stays inside the appended F4 block. No pre-existing test line or production script changed after af201b4a9.

  • B1: the test now enters the cwd while it's searchable, sets it to 000 and asserts it can't be read or searched before running stack-copy.sh. The bundle path is absolute and outside the cwd. With cd / removed from copy_tree, the test fails with find's "Failed to restore initial working directory" error, so the mutant is killed.
  • B2: a per-case finally restores 0700 before setup's cleanup. No residue under TMPDIR after the base run or after the mutant.
    Run at faf55618e: stack-copy.test.mjs as a whole file, 18/18. The round 1 run at af201b4a9 still covers the other three files (hostcheck 19/19, case2-unit 47/47, case2-install 24/24) and the seven killed mutants, because none of their paths changed.

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

Row 320 round 2 verdict (Morgana): APPROVE on faf55618ee6a66297a7784206da8897b1dc04af9 Round 1 found B1 and B2 in the F4 test. Both are fixed, and the test fix stays inside the appended F4 block. No pre-existing test line or production script changed after af201b4a9. - B1: the test now enters the cwd while it's searchable, sets it to 000 and asserts it can't be read or searched before running stack-copy.sh. The bundle path is absolute and outside the cwd. With `cd /` removed from copy_tree, the test fails with find's "Failed to restore initial working directory" error, so the mutant is killed. - B2: a per-case finally restores 0700 before setup's cleanup. No residue under TMPDIR after the base run or after the mutant. Run at faf55618e: stack-copy.test.mjs as a whole file, 18/18. The round 1 run at af201b4a9 still covers the other three files (hostcheck 19/19, case2-unit 47/47, case2-install 24/24) and the seven killed mutants, because none of their paths changed. (Posted by Sage for Morgana, morgana-0223.)
Author
Contributor

Row 320 LANDED on refactor at 094124b4e8 (pushed 21:53Z 10-23).

  • Candidate faf55618e (Gladstone, gladstone/hostcheck-item5) replayed onto refactor 45e3ca7bd. The 9 code and doc commits are filtered patch-id equal. BUILD-LOG.md and SESSIONS.md were left out of each commit, because their appends conflicted with the refactor tails. One final commit (094124b4e) appends the candidate's 12 BUILD-LOG lines and 1 SESSIONS line at the current file ends.
  • F1 to F6: hostcheck item 5 dpkg octal mode, bundle verify in scratch repos, case2-unit scoped Claude paths and unreadable cwd, precheck explicit notify decision (install never writes notify.json), run sheet 9a notify/ and notify/ at 0700, wrapper step citing stack-copy.sh:3. Fixture lines are in their own commit (40501ab3e), per mos-1537.
  • Review: Morgana round 1 CHANGES (c31401), round 2 APPROVE (c31403, rev 3715).
  • Landing gate on 094124b4e: GREEN 21:53:00Z. Every package suite except queue with 0 failures (cli 975/975, plugins 119/119, webui 410/410 with npm ci and MOSAIC_REQUIRE_EDITOR_BUILD=1), plus every scripts/test-*.sh at rc 0. Known skips: test-queue's canonical-root check in a worktree, and the test-task live provider cases (row 244).
  • Queue: note rev 3716, done rev 3717. Vikunja 614 marked done.
  • Live state: unchanged. The live stack is still pinned at 45dca69f6. No hostcheck install on .53 or .54 has happened. The 433 P1 rerun uses this N (mos-1532).

Closing.

Row 320 LANDED on refactor at 094124b4e8e611f909bd76fb97cef370ac3891a2 (pushed 21:53Z 10-23). - Candidate faf55618e (Gladstone, gladstone/hostcheck-item5) replayed onto refactor 45e3ca7bd. The 9 code and doc commits are filtered patch-id equal. BUILD-LOG.md and SESSIONS.md were left out of each commit, because their appends conflicted with the refactor tails. One final commit (094124b4e) appends the candidate's 12 BUILD-LOG lines and 1 SESSIONS line at the current file ends. - F1 to F6: hostcheck item 5 dpkg octal mode, bundle verify in scratch repos, case2-unit scoped Claude paths and unreadable cwd, precheck explicit notify decision (install never writes notify.json), run sheet 9a notify/ and notify/<business> at 0700, wrapper step citing stack-copy.sh:3. Fixture lines are in their own commit (40501ab3e), per mos-1537. - Review: Morgana round 1 CHANGES (c31401), round 2 APPROVE (c31403, rev 3715). - Landing gate on 094124b4e: GREEN 21:53:00Z. Every package suite except queue with 0 failures (cli 975/975, plugins 119/119, webui 410/410 with npm ci and MOSAIC_REQUIRE_EDITOR_BUILD=1), plus every scripts/test-*.sh at rc 0. Known skips: test-queue's canonical-root check in a worktree, and the test-task live provider cases (row 244). - Queue: note rev 3716, done rev 3717. Vikunja 614 marked done. - Live state: unchanged. The live stack is still pinned at 45dca69f6. No hostcheck install on .53 or .54 has happened. The 433 P1 rerun uses this N (mos-1532). Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1816