instar 1.3.54 → 1.3.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cli.js +21 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/machine.d.ts.map +1 -1
  4. package/dist/commands/machine.js +25 -0
  5. package/dist/commands/machine.js.map +1 -1
  6. package/dist/commands/test-as-self.d.ts +41 -0
  7. package/dist/commands/test-as-self.d.ts.map +1 -0
  8. package/dist/commands/test-as-self.js +259 -0
  9. package/dist/commands/test-as-self.js.map +1 -0
  10. package/dist/commands/testAsSelfValidation.d.ts +43 -0
  11. package/dist/commands/testAsSelfValidation.d.ts.map +1 -0
  12. package/dist/commands/testAsSelfValidation.js +84 -0
  13. package/dist/commands/testAsSelfValidation.js.map +1 -0
  14. package/dist/core/GitSync.d.ts +7 -0
  15. package/dist/core/GitSync.d.ts.map +1 -1
  16. package/dist/core/GitSync.js +36 -0
  17. package/dist/core/GitSync.js.map +1 -1
  18. package/dist/core/mergeRegistry.d.ts +28 -0
  19. package/dist/core/mergeRegistry.d.ts.map +1 -0
  20. package/dist/core/mergeRegistry.js +86 -0
  21. package/dist/core/mergeRegistry.js.map +1 -0
  22. package/dist/scaffold/templates.d.ts.map +1 -1
  23. package/dist/scaffold/templates.js +14 -0
  24. package/dist/scaffold/templates.js.map +1 -1
  25. package/package.json +1 -1
  26. package/scripts/post-publish-smoke.mjs +80 -0
  27. package/src/data/builtin-manifest.json +31 -31
  28. package/src/scaffold/templates.ts +14 -0
  29. package/upgrades/1.3.53.md +20 -28
  30. package/upgrades/1.3.54.md +27 -41
  31. package/upgrades/1.3.55.md +38 -0
  32. package/upgrades/side-effects/init-join-launchagent-handoff.md +62 -0
  33. package/upgrades/side-effects/mesh-git-substrate-auto-reconcile.md +70 -0
  34. package/upgrades/side-effects/publish-completeness-smoke-gate.md +47 -0
  35. package/upgrades/side-effects/test-as-self-orchestrator.md +66 -0
@@ -0,0 +1,47 @@
1
+ # Side-Effects Review — Post-publish smoke gate (MM-Bootstrap Track A, re-scoped)
2
+
3
+ **Spec:** MULTI-MACHINE-BOOTSTRAP-ROBUSTNESS §Track A (re-scoped per the
4
+ evidence below).
5
+
6
+ **Scope.** `scripts/post-publish-smoke.mjs` (new), `.github/workflows/publish.yml`
7
+ (one new step after `npm publish`), `tests/unit/post-publish-smoke.test.ts` (new).
8
+
9
+ **Premise correction (evidence-driven).** Track A originally targeted a
10
+ "fleet-wide install blocker — the published tarball ships an empty dist." That
11
+ premise is FALSE: a clean `npm install --prefix /tmp/... instar@latest` yields a
12
+ complete dist (864 dist/core files) and runs. The "empty dist" hit during the
13
+ 2026-05-27 manual bring-up was self-inflicted (an `rsync -a --delete` wiping the
14
+ global install). So there is no active bug to fix. Re-scoped (with Justin's
15
+ default-build nod) to cheap REGRESSION INSURANCE: if the publish pipeline ever
16
+ DOES ship a broken tarball, catch it within minutes of release.
17
+
18
+ **What it does.** A new step after `npm publish` runs
19
+ `post-publish-smoke.mjs <version>`: waits (bounded retry, 3m) for npm to
20
+ propagate the just-published version, clean-installs it into a throwaway prefix,
21
+ asserts `dist/cli.js` exists, runs `--version`, and asserts it reports the
22
+ published version. Fails the release workflow loudly otherwise (before the
23
+ version-bump commit/tag).
24
+
25
+ **Side-effects review.**
26
+ - **No effect on the happy path** — adds a verification step; a healthy publish
27
+ passes it in ~seconds-to-2min (npm propagation).
28
+ - **Fails the workflow on a broken publish** — by design. A broken tarball halts
29
+ the release before tagging, so a bad version isn't blessed. (The tarball is
30
+ already on npm at that point — npm doesn't allow un-publish easily — but the
31
+ loud failure surfaces it immediately for a follow-up patch.)
32
+ - **Throwaway prefix** — installs into `mkdtemp` under the OS tmpdir; no effect
33
+ on the repo or the runner's global state.
34
+ - **Bounded** — 3-minute propagation deadline; never hangs the workflow.
35
+ - **substring-safe version check** — `versionMatches` tokenizes (1.3.5 ≠ 1.3.55),
36
+ unit-tested both ways.
37
+
38
+ **Test coverage.** Unit `tests/unit/post-publish-smoke.test.ts` (4) covers the
39
+ pure `versionMatches` (bare output / token-among-others / mismatch / no
40
+ substring false-match). The install+run path is exercised by the workflow itself
41
+ on the next real publish (CI-only; not unit-mockable meaningfully).
42
+
43
+ **Migration parity.** None — publish-pipeline + dev script; no agent-installed
44
+ file.
45
+
46
+ **Rollback.** Revert the PR. The smoke step disappears; publishes proceed
47
+ unverified (the prior state). No data change.
@@ -0,0 +1,66 @@
1
+ # Side-Effects Review — `instar test-as-self` orchestrator (MM-Bootstrap Track F)
2
+
3
+ **Spec:** MULTI-MACHINE-BOOTSTRAP-ROBUSTNESS §Track F (folds the approved Part 2.1).
4
+
5
+ **Scope.** `src/commands/testAsSelfValidation.ts` (new, pure guards),
6
+ `src/commands/test-as-self.ts` (new, the 7-step orchestrator), `src/cli.ts`
7
+ (register `test-as-self`), `src/scaffold/templates.ts` (Agent Awareness entry),
8
+ `tests/unit/test-as-self-validation.test.ts`,
9
+ `tests/integration/test-as-self-guards.test.ts`.
10
+
11
+ **What it does.** `instar test-as-self` automates the recipe the test-as-self
12
+ SKILL documented as manual steps: deploy the current dist into a throwaway agent
13
+ home, start it, optionally run a real Telegram round-trip (Bot HTTP API), run the
14
+ deterministic `verify.mjs`, and tear down. Seven gated steps; a single JSON
15
+ report; exit 0 = all PASS.
16
+
17
+ **Variance from approved Part 2.1 (documented):** the round-trip uses the
18
+ Telegram Bot HTTP API (sendMessage + poll getUpdates) instead of Playwright —
19
+ strictly more reliable, no browser/profile/flake, equally faithful.
20
+
21
+ **Structural guards (pure, unit-tested, fail-fast).**
22
+ - `--target` can never be the canonical (running) agent home or a protected
23
+ agent name (Bob) or an explicitly protected home → exit 11.
24
+ - `--bot-token` refuses a raw token (Telegram/GitHub/Slack/OpenAI shapes) on
25
+ argv → exit 12. Tokens flow only through Secret Drop, retrieved in-memory via
26
+ the hardened `secret-drop-retrieve.mjs` (never argv/env/transcript).
27
+
28
+ **Side-effects review.**
29
+ - **Throwaway-only by construction** — the target guards make it structurally
30
+ impossible to deploy over a real/protected home; Bob + the canonical home are
31
+ hard-blocked.
32
+ - **Secret hygiene** — the bot token never touches argv/env/logs; retrieved to
33
+ memory via Secret Drop. The raw-token-on-argv guard is the enforcement.
34
+ - **No-I/O on guard failure** — pre-flight guards reject BEFORE any dir is
35
+ created or process spawned (verified by the integration test), so a bad
36
+ invocation has zero side-effects.
37
+ - **Teardown is signal-safe** — runs in a `finally`; SIGTERMs the spawned
38
+ server + lifeline and calls `server stop`. The throwaway home is left in a
39
+ dated `~/.instar/test-deploys/` dir for inspection rather than auto-deleted
40
+ (deletion stays operator/--keep-driven; no rm in the harness — SafeFsExecutor
41
+ is the only sanctioned deletion path).
42
+ - **Reuses the shipped deterministic verifier** (`verify.mjs`) for step 6 — no
43
+ duplication of the lease/crash-signature logic.
44
+
45
+ **Test coverage (3-tier).**
46
+ - Unit (`test-as-self-validation.test.ts`, 12): isRawToken across token shapes;
47
+ validateTarget (empty / canonical / protected-name case-insensitive /
48
+ protected-home / clean-accept); validateBotTokenArg (absent / Secret-Drop-ID /
49
+ raw-token-refused).
50
+ - Integration (`test-as-self-guards.test.ts`, 3): runTestAsSelf exits 12 on raw
51
+ token, 11 on protected-name target, 11 on canonical-home target — all
52
+ no-I/O early-exit paths, safe in CI.
53
+ - E2E / live: the full deploy+verify run is the real-machine backstop (the live
54
+ two-machine proof is Track E); not run in CI (needs a real deploy + bot).
55
+
56
+ **Migration parity.** The command + validation are server source (dist) →
57
+ existing agents get `instar test-as-self` on auto-update; no agent-installed-file
58
+ change. The CLAUDE.md template gains an Agent-Awareness entry so new agents know
59
+ about it. **Deferred (tracked, not dropped):** demoting the v1 manual recipe in
60
+ `.claude/skills/test-as-self/SKILL.md` to "fallback" + a
61
+ `PostUpdateMigrator.migrateTestAsSelfSkill()` to patch the on-disk SKILL for
62
+ existing agents — the v1 SKILL still works as-is (runbook), so this is polish,
63
+ filed as a follow-up.
64
+
65
+ **Rollback.** Revert the PR. The command disappears; the v1 SKILL runbook
66
+ remains. No data change, no migration to reverse.