instar 1.3.148 → 1.3.150

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.148",
3
+ "version": "1.3.150",
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-05-31T07:09:17.964Z",
5
- "instarVersion": "1.3.148",
4
+ "generatedAt": "2026-05-31T08:02:41.896Z",
5
+ "instarVersion": "1.3.150",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
14
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
23
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
32
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
41
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
50
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
59
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
68
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
77
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
86
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
95
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
104
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
113
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
122
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
131
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
140
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
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": "5efb86088319998cc5bdb201ef7f49e293b911508941a1bbbeff866b8872eec8",
1492
+ "contentHash": "3418f7109a38172a28a3a202c8a878c1064f55911a82155c53a0b1ccde44e804",
1493
1493
  "since": "2025-01-01"
1494
1494
  },
1495
1495
  "subsystem:scheduler": {
@@ -0,0 +1,64 @@
1
+ ---
2
+ review-convergence: complete
3
+ approved: true
4
+ approved-by: echo (standing 12h deploy mandate, topic 13435; instar-codey node-ABI outage — deeper root)
5
+ ---
6
+
7
+ # Upgrade Guide — vNEXT
8
+
9
+ <!-- bump: patch -->
10
+
11
+ ## What Changed — the boot wrapper can now heal back to an asdf/nvm node
12
+
13
+ This is the deeper root of the node-ABI outage that the previous release addressed
14
+ at the heal layer. When an agent's Node pointer drifts to a newer Node (e.g. after
15
+ a Homebrew upgrade installs Node 25) but its compiled database driver was built for
16
+ the older Node it had been using via a version manager (asdf / nvm), the boot
17
+ wrapper tries to "heal" by switching to a Node whose ABI matches the driver. But
18
+ its candidate list only looked at the standard system Node locations
19
+ (`/opt/homebrew/bin`, `/usr/local/bin`, `/usr/bin`) — it never looked at
20
+ asdf/nvm-managed Nodes. So the one Node that could load the driver was invisible to
21
+ it, and it self-healed FORWARD to the wrong ABI and got stuck. This took
22
+ instar-codey offline for hours.
23
+
24
+ The fix adds the system-resolved Node (`which node`, which resolves through
25
+ asdf/nvm shims) to the heal candidate list. It is purely additive — it only expands
26
+ a candidate pool that is already filtered to ABI-compatible nodes before selection,
27
+ so it cannot make a heal worse. A migration-parity marker bump regenerates the boot
28
+ wrapper on existing agents (including ones already stuck with the old script).
29
+
30
+ ## Summary of New Capabilities
31
+
32
+ - The generated `instar-boot.cjs` node-heal now adds the PATH-resolved node
33
+ (`which node`) to its candidate list before the ABI-compatibility selection,
34
+ mirroring the already-correct `resolveNodeCandidates()` symlink-creation path.
35
+ - `PostUpdateMigrator.migrateBootWrapperAbiCheck` now requires both the ABI-check
36
+ marker AND the new version-managed-node marker; agents missing the new marker are
37
+ regenerated on update.
38
+
39
+ ## What to Tell Your User
40
+
41
+ If you ever upgrade Node on the machine running your agent, the agent can now
42
+ recover its database engine on its own even when the Node it needs is one managed
43
+ by a version manager like asdf or nvm. Previously it only knew to look in the
44
+ standard system spots, so an agent could get stuck pointing at the wrong Node after
45
+ an upgrade. Nothing to configure — it applies on the next update, and agents that
46
+ were already stuck get the repair automatically.
47
+
48
+ ## Evidence
49
+
50
+ - Root cause traced live in instar-codey logs: the boot wrapper self-healed the
51
+ node link forward to Homebrew Node 25 (ABI 141) while the better-sqlite3 binary
52
+ was ABI 127, with the matching asdf Node 22 absent from the candidate list.
53
+ - The already-correct `resolveNodeCandidates()` in the same file (setup.ts) was
54
+ confirmed to include `which node`; only the generated boot-wrapper template
55
+ lacked it.
56
+ - Unit: `tests/unit/PostUpdateMigrator-bootWrapperAbiCheck.test.ts` — new cases:
57
+ generated wrapper contains the `which node` discovery before the ABI loop
58
+ (cross-platform), regenerates when the new marker is absent (the codey case),
59
+ idempotent when both markers present.
60
+ - Regression: boot-wrapper cjs/plist + durable-node-selection + shadow-install
61
+ self-heal + launchd-handoff suites — 46 tests pass.
62
+ - `tsc --noEmit` clean; `npm run lint` clean.
63
+ - Spec: `docs/specs/boot-wrapper-version-managed-node-candidates.md` (+ `.eli16.md`).
64
+ - Side-effects: `upgrades/side-effects/boot-wrapper-version-managed-node-candidates.md`.
@@ -0,0 +1,54 @@
1
+ ---
2
+ review-convergence: complete
3
+ approved: true
4
+ approved-by: echo (standing 12h deploy mandate, topic 13435; live-found driving Codey)
5
+ ---
6
+
7
+ # Upgrade Guide — vNEXT
8
+
9
+ <!-- bump: patch -->
10
+
11
+ ## What Changed — the scope-check Stop hook no longer confuses Codex
12
+
13
+ When an agent finishes a turn, a "scope-coherence checkpoint" Stop hook runs and, on
14
+ the normal allow path, used to print a tiny `{decision:approve}` message. Claude
15
+ treats that as allow, but Codex's Stop-hook contract is stricter: print
16
+ `{decision:block,...}` to interrupt, print **nothing** to allow — an explicit
17
+ approve message is rejected as "invalid stop hook JSON output". So on every Codex
18
+ session completion that hook reported an error (the reply was already sent, so
19
+ nothing actually broke, but the error was noisy and wrong). Found live while
20
+ test-driving the Codex agent.
21
+
22
+ The fix changes every allow path to emit nothing (empty stdout = allow), which is
23
+ byte-equivalent for Claude and removes the error for Codex. The interrupt (block)
24
+ path is unchanged. The hook is regenerated from source on every update, so all
25
+ agents get the fix automatically.
26
+
27
+ ## Summary of New Capabilities
28
+
29
+ - `scope-coherence-checkpoint` Stop hook is now Codex-stdout-safe: allow paths emit
30
+ empty stdout (instead of `{decision:approve}`); the block/checkpoint path is
31
+ unchanged. Sibling of the earlier autonomous-stop-hook Codex fix.
32
+
33
+ ## What to Tell Your User
34
+
35
+ If you run a Codex-based agent, it will stop logging a spurious "invalid stop hook"
36
+ error every time it finishes a turn. Nothing actually broke before (replies still
37
+ went out), and Claude agents are unaffected — this just makes the scope-check hook
38
+ speak Codex's dialect correctly. It applies automatically on the next update.
39
+
40
+ ## Evidence
41
+
42
+ - Live: driving the Codex agent over Telegram, it completed a task + sent its reply,
43
+ then its session reported "Stop hook (failed) — invalid stop hook JSON output".
44
+ - Audited the 5-hook Stop chain: only scope-coherence-checkpoint writes on the allow
45
+ path; the others write only on block (codex-safe), and the autonomous hook was
46
+ fixed earlier.
47
+ - Unit: `tests/unit/scope-coherence-reentry.test.ts` — allow paths now exit 0 with
48
+ empty stdout; the generated hook contains no `{decision:approve}` and keeps
49
+ `{decision:block}`.
50
+ - Regression: PostUpdateMigrator-buildStopHook + migration-parity-hooks +
51
+ installCodexHooks — 28 tests pass.
52
+ - `tsc --noEmit` + `npm run lint` clean.
53
+ - Spec: `docs/specs/codex-scope-coherence-stdout-safe.md` (+ `.eli16.md`).
54
+ - Side-effects: `upgrades/side-effects/codex-scope-coherence-stdout-safe.md`.
@@ -0,0 +1,51 @@
1
+ # Side-effects — Boot-wrapper version-managed node candidates
2
+
3
+ ## 1. What files/state does this touch at runtime?
4
+ The generated `<stateDir>/instar-boot.cjs` (regenerated by `installBootWrapper`
5
+ when the PostUpdateMigrator detects the new marker is missing). At boot, the
6
+ wrapper's self-heal may additionally run `which node` and, if it resolves an
7
+ ABI-compatible node, repoint the `.instar/bin/node` symlink to it. No config,
8
+ schema, or other files.
9
+
10
+ ## 2. Does it change any functional behavior?
11
+ Yes, narrowly + additively: the node-heal candidate pool now also includes the
12
+ PATH-resolved node (`which node` → asdf/nvm/volta). Selection is unchanged — the
13
+ existing ABI-compatibility loop still picks the candidate that can load the
14
+ existing better-sqlite3 binary. The only new outcome is: a heal that previously
15
+ had NO compatible candidate (and stayed on the wrong-ABI node) can now find the
16
+ version-managed node and heal correctly.
17
+
18
+ ## 3. What happens on failure / non-darwin / no `which`?
19
+ - `which` missing or no node on PATH: the probe is wrapped in try/catch and
20
+ swallowed — the heal proceeds exactly as before with the well-known candidates.
21
+ - Non-darwin: the boot wrapper + its migration are darwin/launchd-specific; the
22
+ migration short-circuits with a `non-darwin` skip.
23
+ - A resolved node that can't load the module: skipped by the existing
24
+ ABI-compatibility loop, identical to any other incompatible candidate.
25
+
26
+ ## 4. Migration parity — do existing agents get it?
27
+ Yes. `migrateBootWrapperAbiCheck` now requires BOTH the ABI-drift marker AND the
28
+ `version-managed node candidates` marker to consider a wrapper current; an install
29
+ missing the new marker (e.g. instar-codey) is regenerated via `installBootWrapper`
30
+ on its next update. Idempotent (both markers → skip). New agents get it at setup.
31
+
32
+ ## 5. Could it spam / flood / burn resources?
33
+ No. The heal path runs only at boot and only when the current node fails the
34
+ better-sqlite3 load check (ABI drift) — the rare case. It adds at most one
35
+ `which node` exec (5s timeout) to that already-rare path. No loop, no network.
36
+
37
+ ## 6. Rollback / off-switch?
38
+ Revert the PR. The marker bump means a reverted version would (correctly) see the
39
+ new marker as "extra" — the old sniff only required the ABI marker, so reverting
40
+ leaves existing regenerated wrappers working (they still contain the ABI marker).
41
+ No residual state, no flag.
42
+
43
+ ## 7. Concurrency / ordering?
44
+ None new. The `which node` probe is a single synchronous exec inside the existing
45
+ single-threaded `selfHealNodeSymlink()`, before the ABI-compatibility loop.
46
+
47
+ ## Blast radius
48
+ Small + additive on a critical path. Two source edits (`setup.ts` template +
49
+ `PostUpdateMigrator.ts` sniff) + test coverage. It only EXPANDS an already
50
+ ABI-filtered candidate pool, mirrors the already-correct `resolveNodeCandidates()`
51
+ in the same file, and cannot make a heal worse. Darwin/launchd-scoped.
@@ -0,0 +1,42 @@
1
+ # Side-effects — scope-coherence-checkpoint codex stdout-safe
2
+
3
+ ## 1. What files/state does this touch at runtime?
4
+ Only the generated `.instar/hooks/instar/scope-coherence-checkpoint.js` (rewritten
5
+ by the always-overwrite built-in-hook migration). At Stop time the hook reads its
6
+ state file + (when deep) fetches active-job context — unchanged. The only change is
7
+ what it writes to stdout on the allow paths (now nothing).
8
+
9
+ ## 2. Does it change any functional behavior?
10
+ - **Claude:** none. Empty stdout == approve in Claude Code, identical to the prior
11
+ explicit `{decision:'approve'}`. The scope-checkpoint still blocks (prompts) when
12
+ deep-implementation + cooldown + min-age conditions are met.
13
+ - **codex:** the allow paths no longer emit `{decision:'approve'}`, so codex stops
14
+ reporting "invalid stop hook JSON output" on session completion. The block path is
15
+ unchanged (codex accepts `{decision:'block',...}`).
16
+
17
+ ## 3. What happens on failure / weird input?
18
+ The catch-all error path now allows (empty stdout) instead of emitting approve-JSON
19
+ — same allow outcome, codex-safe. Malformed stdin still falls through to allow.
20
+
21
+ ## 4. Migration parity — do existing agents get it?
22
+ Yes, automatically. The hook is in the always-overwrite built-in-hook set, so every
23
+ agent regenerates it from the fixed `getScopeCoherenceCheckpointHook()` on its next
24
+ update (incl. instar-codey). No marker/sniff needed.
25
+
26
+ ## 5. Could it spam / flood / burn resources?
27
+ No — it REDUCES output (writes less). The hook runs only at Stop, same as before.
28
+
29
+ ## 6. Rollback / off-switch?
30
+ Revert the PR; the next update regenerates the prior hook. No residual state, no
31
+ flag. Reverting restores `{decision:'approve'}` (Claude unaffected; codex error
32
+ returns).
33
+
34
+ ## 7. Concurrency / ordering?
35
+ None new. Single short-lived hook process per Stop event, unchanged.
36
+
37
+ ## Blast radius
38
+ Small + behavior-preserving on Claude, error-fixing on codex. One generator method
39
+ in PostUpdateMigrator (six allow-path stdout writes removed; block path kept) + test
40
+ updates. Mirrors the #604 codex-stdout convention. The broader approve-JSON class
41
+ (other hooks + additionalContext signal hooks) is explicitly out of scope, tracked
42
+ under #32 / ledger issue codex-stop-chain-multi-json-invalid.