instar 1.3.27 → 1.3.28
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/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +268 -196
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +18 -18
- package/upgrades/1.3.28.md +30 -0
- package/upgrades/side-effects/esm-safe-instar-hooks.md +33 -0
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-05-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-05-27T21:23:16.473Z",
|
|
5
|
+
"instarVersion": "1.3.28",
|
|
6
6
|
"entryCount": 192,
|
|
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": "
|
|
14
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
23
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
32
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
41
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
50
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
59
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
68
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
77
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
86
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
95
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
104
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
113
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
122
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
131
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
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": "
|
|
140
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
141
141
|
"since": "2025-01-01"
|
|
142
142
|
},
|
|
143
143
|
"job:health-check": {
|
|
@@ -1481,7 +1481,7 @@
|
|
|
1481
1481
|
"type": "subsystem",
|
|
1482
1482
|
"domain": "updates",
|
|
1483
1483
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
1484
|
-
"contentHash": "
|
|
1484
|
+
"contentHash": "e51fcc55877de0644608728645efc33b586179ac568b85ce190e5b74b1eb4a6d",
|
|
1485
1485
|
"since": "2025-01-01"
|
|
1486
1486
|
},
|
|
1487
1487
|
"subsystem:scheduler": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- bump: patch -->
|
|
4
|
+
|
|
5
|
+
## What Changed
|
|
6
|
+
|
|
7
|
+
Fleet-wide guardrail outage fix: 8 of `PostUpdateMigrator`'s `get*Hook()` methods were emitting `.js` content with bare top-level `require(...)`, which throws `ReferenceError: require is not defined in ES module scope` in every `"type":"module"` agent home (most agents). The crashes exited non-blocking, so the failures were invisible — guardrails looked installed but did nothing. One of the affected was the UnjustifiedStopGate router itself — the very mechanism designed to prevent silent stalls was silently broken.
|
|
8
|
+
|
|
9
|
+
This release rewrites all 8 affected generators to emit ESM-safe content (async IIFE + dynamic `await import('node:...')`, mirroring the documented pattern in `getHookEventReporterScript`), and adds a one-shot regression test that bans bare top-level `require(...)` from any future generated hook — CI will fail before the bug class can re-ship.
|
|
10
|
+
|
|
11
|
+
`migrateHooks` always-overwrites `instar/` hooks, so the fix ships to every agent automatically on next update — no separate migration step needed.
|
|
12
|
+
|
|
13
|
+
## What to Tell Your User
|
|
14
|
+
|
|
15
|
+
- Eight quiet guardrails (the silent-stall preventer, the slop-package nudger, the post-commit reflection capture, the response-review pipeline, and four others) come back to life on this update — they were silently crashing on every fire and we just learned about it.
|
|
16
|
+
|
|
17
|
+
## Summary of New Capabilities
|
|
18
|
+
|
|
19
|
+
| Capability | How to Use |
|
|
20
|
+
|-----------|-----------|
|
|
21
|
+
| ESM-safe instar hooks (8 generators rewritten) | Automatic on update; no action needed |
|
|
22
|
+
| Regression test banning bare top-level `require(...)` in any generated hook | Runs in CI; new hook PRs fail if they reintroduce the pattern |
|
|
23
|
+
|
|
24
|
+
## Evidence
|
|
25
|
+
|
|
26
|
+
- Source rewrites in `src/core/PostUpdateMigrator.ts`; regression test in `tests/unit/no-bare-require-in-generated-hooks.test.ts` (18 cases, all green; initially 8 failed, one per broken generator).
|
|
27
|
+
- Side-effects review: `upgrades/side-effects/esm-safe-instar-hooks.md`
|
|
28
|
+
- Spec: `docs/specs/ESM-SAFE-INSTAR-HOOKS-SPEC.md` (approved, converged)
|
|
29
|
+
- ELI16: `docs/specs/ESM-SAFE-INSTAR-HOOKS-SPEC.eli16.md`
|
|
30
|
+
- Postmortem context: surfaced by the 2026-05-27 silent-stall incident.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Side-Effects Review — ESM-Safe Instar Hook Generators + Structural Prevention
|
|
2
|
+
|
|
3
|
+
**Spec:** docs/specs/ESM-SAFE-INSTAR-HOOKS-SPEC.md (pending Justin's approval)
|
|
4
|
+
|
|
5
|
+
Fixes the fleet-wide silent-guardrail outage discovered 2026-05-27: 8 of `PostUpdateMigrator`'s `get*Hook()` methods emit `.js` content with bare top-level `require(...)`, which crashes on every fire in `"type":"module"` agent homes (most agents). The crashes are invisible (non-blocking exit), so the guardrails *look* installed but do nothing. One of the affected guardrails is the UnjustifiedStopGate router itself — the very mechanism meant to prevent silent stalls was itself silently broken.
|
|
6
|
+
|
|
7
|
+
## What changed
|
|
8
|
+
- `src/core/PostUpdateMigrator.ts` — rewrote 8 `get*Hook()` generators to emit ESM-safe content (async IIFE + dynamic `await import('node:...')`, mirroring the documented pattern in `getHookEventReporterScript`): `getStopGateRouterHook`, `getSlopcheckGuardHook`, `getPostActionReflectionHook`, `getScopeCoherenceCollectorHook`, `getScopeCoherenceCheckpointHook`, `getClaimInterceptHook`, `getResponseReviewHook`, `getClaimInterceptResponseHook`.
|
|
9
|
+
- `tests/unit/no-bare-require-in-generated-hooks.test.ts` — NEW. Source-scans `PostUpdateMigrator.ts`, extracts each `get*Hook()` body's backtick-template, and asserts no forbidden top-level `require(...)` pattern. One test per generator (18 cases total). Structurally bans the bug class from re-shipping.
|
|
10
|
+
|
|
11
|
+
## Over-block / under-block
|
|
12
|
+
- UNDER (a real `.js` script needing legitimate top-level `require`): the test scans only inside `get*Hook` method bodies in `PostUpdateMigrator.ts`. Non-hook code elsewhere is untouched. Standalone hook .js files in `src/templates/hooks/` are also untouched.
|
|
13
|
+
- OVER (a legitimate use of `require` inside a hook): there isn't one — every instar hook ships into `.instar/hooks/instar/` in agent homes that are ESM by default. Bare top-level `require` is broken there. Dynamic `await import(...)` works in both CJS and ESM hosts; there is no scenario where the new pattern is wrong.
|
|
14
|
+
|
|
15
|
+
## Signal vs authority
|
|
16
|
+
- The regression test is the AUTHORITY (CI fails on a violation). The generator rewrites are the SUBSTANTIVE FIX (run in production). Together they form a complete loop: the rewrites unblock the fleet; the test makes the unblock permanent.
|
|
17
|
+
|
|
18
|
+
## Interactions
|
|
19
|
+
- `migrateHooks` always-overwrites instar/ hooks (existing standard) → the fixed generators automatically ship on every agent's next update. No new migration code required.
|
|
20
|
+
- No change to hook contracts (stdin JSON in, exit code semantics, stdout JSON out).
|
|
21
|
+
- No config or settings changes.
|
|
22
|
+
|
|
23
|
+
## Rollback cost
|
|
24
|
+
- Trivial: revert both files. Worst case: agents return to the silently-broken state they had before.
|
|
25
|
+
|
|
26
|
+
## Tests
|
|
27
|
+
- `tests/unit/no-bare-require-in-generated-hooks.test.ts` (18) — one test per generator (15+ healthy generators plus three sanity-check tests). Initially failed 8/18 (one per broken generator), all green after the source fix.
|
|
28
|
+
- Runtime smoke (manual, performed during diagnosis): the fixed hook content for `stop-gate-router`, `slopcheck-guard`, and `post-action-reflection` was piped a representative JSON payload on real ESM-mode hardware and exited cleanly (no `ReferenceError`). The same rewrite pattern applied to the other 5 generators.
|
|
29
|
+
|
|
30
|
+
## NOT in this commit (tracked, follow-up specs)
|
|
31
|
+
- Postmortem Finding #3 — notify-on-stop wiring (Task 2 of the autonomous run).
|
|
32
|
+
- Postmortem Finding #2 — false-blocker behavioral interceptor (Task 3).
|
|
33
|
+
- Postmortem Finding #4 — Agent Self-Propagation harness, CMT-560 (Task 4).
|