instar 1.3.197 → 1.3.198

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.197",
3
+ "version": "1.3.198",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-02T04:46:08.483Z",
5
- "instarVersion": "1.3.197",
4
+ "generatedAt": "2026-06-02T05:25:38.499Z",
5
+ "instarVersion": "1.3.198",
6
6
  "entryCount": 193,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -11,7 +11,7 @@
11
11
  "domain": "identity",
12
12
  "sourcePath": "src/core/PostUpdateMigrator.ts",
13
13
  "installedPath": ".instar/hooks/instar/session-start.sh",
14
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
14
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
15
15
  "since": "2025-01-01"
16
16
  },
17
17
  "hook:dangerous-command-guard": {
@@ -20,7 +20,7 @@
20
20
  "domain": "safety",
21
21
  "sourcePath": "src/core/PostUpdateMigrator.ts",
22
22
  "installedPath": ".instar/hooks/instar/dangerous-command-guard.sh",
23
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
23
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
24
24
  "since": "2025-01-01"
25
25
  },
26
26
  "hook:grounding-before-messaging": {
@@ -29,7 +29,7 @@
29
29
  "domain": "safety",
30
30
  "sourcePath": "src/core/PostUpdateMigrator.ts",
31
31
  "installedPath": ".instar/hooks/instar/grounding-before-messaging.sh",
32
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
32
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
33
33
  "since": "2025-01-01"
34
34
  },
35
35
  "hook:compaction-recovery": {
@@ -38,7 +38,7 @@
38
38
  "domain": "identity",
39
39
  "sourcePath": "src/core/PostUpdateMigrator.ts",
40
40
  "installedPath": ".instar/hooks/instar/compaction-recovery.sh",
41
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
41
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
42
42
  "since": "2025-01-01"
43
43
  },
44
44
  "hook:external-operation-gate": {
@@ -47,7 +47,7 @@
47
47
  "domain": "safety",
48
48
  "sourcePath": "src/core/PostUpdateMigrator.ts",
49
49
  "installedPath": ".instar/hooks/instar/external-operation-gate.js",
50
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
50
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
51
51
  "since": "2025-01-01"
52
52
  },
53
53
  "hook:deferral-detector": {
@@ -56,7 +56,7 @@
56
56
  "domain": "safety",
57
57
  "sourcePath": "src/core/PostUpdateMigrator.ts",
58
58
  "installedPath": ".instar/hooks/instar/deferral-detector.js",
59
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
59
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
60
60
  "since": "2025-01-01"
61
61
  },
62
62
  "hook:post-action-reflection": {
@@ -65,7 +65,7 @@
65
65
  "domain": "evolution",
66
66
  "sourcePath": "src/core/PostUpdateMigrator.ts",
67
67
  "installedPath": ".instar/hooks/instar/post-action-reflection.js",
68
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
68
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
69
69
  "since": "2025-01-01"
70
70
  },
71
71
  "hook:external-communication-guard": {
@@ -74,7 +74,7 @@
74
74
  "domain": "safety",
75
75
  "sourcePath": "src/core/PostUpdateMigrator.ts",
76
76
  "installedPath": ".instar/hooks/instar/external-communication-guard.js",
77
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
77
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
78
78
  "since": "2025-01-01"
79
79
  },
80
80
  "hook:scope-coherence-collector": {
@@ -83,7 +83,7 @@
83
83
  "domain": "coherence",
84
84
  "sourcePath": "src/core/PostUpdateMigrator.ts",
85
85
  "installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
86
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
86
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
87
87
  "since": "2025-01-01"
88
88
  },
89
89
  "hook:scope-coherence-checkpoint": {
@@ -92,7 +92,7 @@
92
92
  "domain": "coherence",
93
93
  "sourcePath": "src/core/PostUpdateMigrator.ts",
94
94
  "installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
95
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
95
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
96
96
  "since": "2025-01-01"
97
97
  },
98
98
  "hook:free-text-guard": {
@@ -101,7 +101,7 @@
101
101
  "domain": "safety",
102
102
  "sourcePath": "src/core/PostUpdateMigrator.ts",
103
103
  "installedPath": ".instar/hooks/instar/free-text-guard.sh",
104
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
104
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
105
105
  "since": "2025-01-01"
106
106
  },
107
107
  "hook:claim-intercept": {
@@ -110,7 +110,7 @@
110
110
  "domain": "coherence",
111
111
  "sourcePath": "src/core/PostUpdateMigrator.ts",
112
112
  "installedPath": ".instar/hooks/instar/claim-intercept.js",
113
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
113
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
114
114
  "since": "2025-01-01"
115
115
  },
116
116
  "hook:claim-intercept-response": {
@@ -119,7 +119,7 @@
119
119
  "domain": "coherence",
120
120
  "sourcePath": "src/core/PostUpdateMigrator.ts",
121
121
  "installedPath": ".instar/hooks/instar/claim-intercept-response.js",
122
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
122
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
123
123
  "since": "2025-01-01"
124
124
  },
125
125
  "hook:stop-gate-router": {
@@ -128,7 +128,7 @@
128
128
  "domain": "safety",
129
129
  "sourcePath": "src/core/PostUpdateMigrator.ts",
130
130
  "installedPath": ".instar/hooks/instar/stop-gate-router.js",
131
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
131
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
132
132
  "since": "2025-01-01"
133
133
  },
134
134
  "hook:auto-approve-permissions": {
@@ -137,7 +137,7 @@
137
137
  "domain": "safety",
138
138
  "sourcePath": "src/core/PostUpdateMigrator.ts",
139
139
  "installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
140
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
140
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
141
141
  "since": "2025-01-01"
142
142
  },
143
143
  "job:health-check": {
@@ -1489,7 +1489,7 @@
1489
1489
  "type": "subsystem",
1490
1490
  "domain": "updates",
1491
1491
  "sourcePath": "src/core/PostUpdateMigrator.ts",
1492
- "contentHash": "1cd3546e774a6045c3b8c1481a1aa2acfbbb330232f7d3f1353d0f92aca6b1bc",
1492
+ "contentHash": "600eb489f11a1b72daa4d5845e2cb0b3d24b08d868c7ebc65e090b028d833b67",
1493
1493
  "since": "2025-01-01"
1494
1494
  },
1495
1495
  "subsystem:scheduler": {
@@ -0,0 +1,24 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ An agent that loses its private code copy can now actually reinstall itself at boot.
9
+
10
+ When the boot wrapper detects a missing "shadow install" it runs `npm install` to self-heal. Some packages run native setup scripts that shell out to `node`/`npm` by name — and under macOS launchd the boot process often has a stripped `PATH` without them, so the reinstall died with "command not found" and the agent stayed stuck (looping on "Shadow install missing"). The reinstall now puts the resolved node directory on PATH and sets npm's scripts-prepend-node-path, so those setup scripts resolve node/npm and the self-heal completes. Existing agents get the fixed wrapper regenerated automatically on update.
11
+
12
+ ## What to Tell Your User
13
+
14
+ Nothing to do. This makes an agent's automatic self-repair actually work when its private code copy goes missing — the case where it most needs to recover on its own, unattended. A healthy agent is completely unaffected; this only changes the recovery path.
15
+
16
+ ## Summary of New Capabilities
17
+
18
+ - The boot-wrapper reinstall (`instar-boot.cjs` and `instar-boot.sh`) prepends the resolved node directory to PATH and sets `npm_config_scripts_prepend_node_path` so native postinstall scripts (e.g. sharp) resolve node/npm under a launchd-spawned boot child instead of failing with "command not found".
19
+ - The post-update migration regenerates older boot wrappers that predate this fix (it now requires the install-path marker to consider a wrapper current), so deployed agents receive the fix on their next update — not just new installs.
20
+
21
+ ## Evidence
22
+
23
+ - Root cause of a real 2026-06-02 failure: a paired test agent could not start; `instar-boot` looped on "Shadow install missing" and a manual reinstall failed on sharp's postinstall with `sh: node: command not found`; re-running with node on PATH fixed it immediately.
24
+ - `tsc --noEmit` clean. `PostUpdateMigrator-bootWrapperAbiCheck` extended to 8 green tests (3-marker idempotency, regen-when-install-path-marker-absent, generated `.cjs` passes `node --check` + carries the env, `.sh` carries the PATH export); 30 sibling boot-wrapper tests still green. Side-effects review: upgrades/side-effects/fix-bootwrapper-install-path.md.
@@ -0,0 +1,83 @@
1
+ # Side-Effects Review — Boot-wrapper reinstall: put node on PATH for native postinstalls
2
+
3
+ **Version / slug:** `fix-bootwrapper-install-path`
4
+ **Date:** `2026-06-02`
5
+ **Author:** `echo`
6
+ **Tier:** 1 (small, well-understood bugfix; ELI16 + side-effects, no converged spec) — but HIGH blast radius (boot shim), reviewed accordingly
7
+ **Parent principle:** Cross-Machine Coherence / Bootstrap Robustness — an agent must be able to self-heal its own install
8
+
9
+ ## Summary of the change
10
+
11
+ The boot wrapper (`instar-boot.cjs` / `instar-boot.sh`, generated by `installBootWrapper`
12
+ in `src/commands/setup.ts`) self-heals a missing shadow install by running `npm install`.
13
+ That `npm install` was spawned with **no `env` / no PATH augmentation**, so native
14
+ postinstall scripts (e.g. `sharp`: `sh -c "node install/check.js || npm run build"`) ran in
15
+ a subshell whose PATH — under a launchd-spawned boot child — has no `node`/`npm`, dying with
16
+ `command not found`. The reinstall then aborts and the shadow install never heals.
17
+
18
+ **Observed live (2026-06-02):** a throwaway mini agent could not start — `instar-boot`
19
+ looped on "Shadow install missing", and a manual reinstall reproduced it: it failed on
20
+ `sharp`'s postinstall (`sh: node: command not found`). Re-running with `node` on PATH
21
+ succeeded immediately.
22
+
23
+ ### What changed
24
+ - `src/commands/setup.ts` — `installBootWrapper`:
25
+ - **`.cjs` (jsWrapper):** the reinstall `execFileSync(nodeBin, [npmCli, 'install', …])` now
26
+ passes `env: installEnv` where `installEnv` prepends `path.dirname(nodeBin)` to `PATH` and
27
+ sets `npm_config_scripts_prepend_node_path: 'true'`.
28
+ - **`.sh` (bashWrapper):** the reinstall now runs with
29
+ `PATH="$(dirname "$NODE_BIN"):$PATH" npm_config_scripts_prepend_node_path=true` prefixed.
30
+ - `src/core/PostUpdateMigrator.ts` — `migrateBootWrapperAbiCheck`: the "already current" guard
31
+ now ALSO requires the `npm_config_scripts_prepend_node_path` marker, so existing agents whose
32
+ wrapper predates this fix are regenerated on update (Migration Parity).
33
+
34
+ ## Decision-point inventory
35
+ - reinstall env: augment vs inherit → augment (prepend node dir + npm flag). Inheriting the
36
+ launchd PATH is the bug.
37
+ - migration: add a 3rd required marker vs leave 2 → add the marker (otherwise deployed agents
38
+ with the 2 prior markers never regenerate and never get the fix).
39
+ - auto-re-port / auto-anything else: none — purely the reinstall env.
40
+
41
+ ## 1. Over-correction risk
42
+ The env only AUGMENTS PATH (prepends node dir; keeps the rest) and sets one npm flag. A healthy
43
+ agent never enters the reinstall branch at all (`if (!fs.existsSync(SHADOW))`), so the change is
44
+ inert unless the shadow install is actually missing. `npm_config_scripts_prepend_node_path` is
45
+ npm's own documented option for exactly this case.
46
+
47
+ ## 2. Under-correction risk
48
+ The migration regenerates only wrappers missing the new marker; agents already regenerated stay
49
+ put (idempotent). The `.sh` variant is for manual/Linux use; the launchd-critical path is `.cjs`.
50
+
51
+ ## 3. Level-of-abstraction fit
52
+ The fix lives in the single boot-wrapper generator (`installBootWrapper`) that both `init` and the
53
+ migration call — one source, both consumers. No scattering.
54
+
55
+ ## 4. Signal vs Authority
56
+ Pure deterministic env construction (no LLM/heuristic). Appropriate.
57
+
58
+ ## 5. External surfaces
59
+ None. No route/config-schema change. The generated wrapper gains an env on one spawn.
60
+
61
+ ## 6. Interactions with existing primitives
62
+ The reinstall's debounce marker, the ABI-aware node self-heal, and the version-managed-node
63
+ candidate discovery are all unchanged; this only adds an env to the npm spawn and a 3rd marker
64
+ to the migration's idempotency sniff (composes with the existing two).
65
+
66
+ ## 7. Rollback cost
67
+ Trivial: drop the `env`/PATH additions and the 3rd marker clause. No persistent state.
68
+
69
+ ## Migration parity
70
+ - New agents: `installBootWrapper` (via `init`) writes the fixed wrapper.
71
+ - Existing agents: `migrateBootWrapperAbiCheck` regenerates `instar-boot.cjs` because the new
72
+ `npm_config_scripts_prepend_node_path` marker is absent. Idempotent — re-running skips once the
73
+ marker is present.
74
+
75
+ ## Tests
76
+ `tsc --noEmit` clean. `PostUpdateMigrator-bootWrapperAbiCheck` extended to 8 tests (all green):
77
+ the "skip" idempotency case now requires all THREE markers; a new regen case for a wrapper with
78
+ the two prior markers but missing the install-path marker; a generated-content test asserting the
79
+ `.cjs` reinstall passes `env: installEnv` with `npm_config_scripts_prepend_node_path` + the PATH
80
+ prepend AND that the generated `.cjs` passes `node --check` (guards against template-escaping
81
+ bricking the boot shim); a `.sh` generated-content test. 30 sibling boot-wrapper tests
82
+ (`bootWrapperCjs`, `plist-coherence`, `lifeline-shadow-install-self-heal`, `init-join-launchd-handoff`)
83
+ all still green — no regressions.