From ae3acc3bda822b7b138938cd2f3d97c2cbdab55a Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 23 Oct 2026 16:02:31 -0500 Subject: [PATCH] docs(installer): add gated wrapper creation and private notify parent (#1816, Vikunja 614). Untested --- .../gladstone/work/hostcheck-item5/BUILD.md | 38 +++++++++++++++++++ docs/guides/host-run-sheet.md | 19 +++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/agents/gladstone/work/hostcheck-item5/BUILD.md b/agents/gladstone/work/hostcheck-item5/BUILD.md index 520542938..c77abffd6 100644 --- a/agents/gladstone/work/hostcheck-item5/BUILD.md +++ b/agents/gladstone/work/hostcheck-item5/BUILD.md @@ -201,3 +201,41 @@ Fixture follow-up numstat: case2-unit.test.mjs +3/-0, case2-install.test.mjs +18/-0. Against the original base: case1-hostcheck.test.mjs +48/-0, case2-unit.test.mjs +68/-0, stack-copy.test.mjs +16/-0, case2-install.test.mjs +18/-0. git diff --check passed. + +## F6 and notify parent correction (mos-1537 / ops-0261) + +Before: install creates a copy but no human CLI wrapper; the sheet's +stack-copy.sh check --units external therefore fails even with correct units. +After: the sheet explicitly places a wrapper step after successful install and +before that check. On Mos's separate live-step go, mosaic changes cwd to /, +creates $HOME/.npm-global/bin if absent, then invokes its clone's stack-copy.sh +wrapper --create. Existing wrappers refuse and require review; install is +unchanged. This is documentation of a gated host action, not execution of it. +There are no tests pinning these sheet steps to adjust. + +Section 9a now explicitly creates/chmods /notify and then its business +leaf, each 0700. This addresses ops-0261's observation that mkdir -p -m only +controls the leaf. The existing umask 077 remains. All exits are inside the +unprivileged shell, so no failure exits the operator's interactive root shell. + +Static receipt: git diff --check passed. No Node, tests or live action. F6 and +this parent-directory documentation correction are a separate commit after the +approved fixture-only 5fd2328b6 follow-up. Reviewer should retain the earlier +F1-F5 source verdicts and inspect this delta. Queue row still pending from Sage. + +## F6 candidate file numstat against 93694c518 (added / deleted) + +| File | Added | Deleted | +|---|---:|---:| +| `BUILD-LOG.md` | 10 | 0 | +| `agents/gladstone/work/hostcheck-item5/BUILD.md` | 241 | 0 | +| `docs/SESSIONS.md` | 1 | 0 | +| `docs/guides/host-run-sheet.md` | 51 | 2 | +| `packages/cli/tests/case1-hostcheck.test.mjs` | 48 | 0 | +| `packages/cli/tests/case2-install.test.mjs` | 18 | 0 | +| `packages/cli/tests/case2-unit.test.mjs` | 68 | 0 | +| `packages/cli/tests/stack-copy.test.mjs` | 16 | 0 | +| `scripts/case1-hostcheck.sh` | 2 | 2 | +| `scripts/case2-precheck.sh` | 19 | 0 | +| `scripts/case2-unit.sh` | 1 | 1 | +| `scripts/stack-copy.sh` | 3 | 0 | diff --git a/docs/guides/host-run-sheet.md b/docs/guides/host-run-sheet.md index dbefb06b7..14fe395f8 100644 --- a/docs/guides/host-run-sheet.md +++ b/docs/guides/host-run-sheet.md @@ -241,6 +241,21 @@ When a run doesn't exit 0, send Mos the exit and the last lines of `/var/log/mos the old copy. The next run refuses `args-differ`, and a render from that file would put the old copy back. Move the file the result line names into place with `mv -f`. The two differ only in the `--copy` value. +After `case2-install.sh` succeeds, create the human CLI wrapper before running +`stack-copy.sh check --units external`. Creating this wrapper is a separate live +step requiring Mos's go; the install does not create it. Run only on that go: + +```sh +sudo -u mosaic -H /bin/sh <<'MOSAIC_WRAPPER' +cd / || exit 1 +mkdir -p -- "$HOME/.npm-global/bin" || exit 1 +"$HOME/src/mosaic-stack/scripts/stack-copy.sh" wrapper --create +MOSAIC_WRAPPER +``` + +`--create` refuses an existing wrapper; stop and review it rather than replacing +it. The wrapper must name the same `` copy as the units. + Precheck lines: none. Root's checkout at `` and the stack's user's clone: precheck line missing. After install, `stack-copy.sh check --units external` reads the copy the units run. @@ -308,7 +323,9 @@ existing decision; this command refuses to overwrite it. sudo -u mosaic -H /bin/sh <<'MOSAIC_NOTIFY' cd / || exit 1 umask 077 -notify_dir='/notify/' +notify_root='/notify' +notify_dir="$notify_root/" +mkdir -p -m 0700 -- "$notify_root" && chmod 0700 -- "$notify_root" || exit 1 mkdir -p -m 0700 -- "$notify_dir" && chmod 0700 -- "$notify_dir" || exit 1 (set -C; printf '%s\n' '{"notifyVersion": 1, "binding": null}' > "$notify_dir/notify.json") || exit 1 chmod 0600 -- "$notify_dir/notify.json"