instar 1.3.478 → 1.3.479
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/.claude/skills/autonomous/SKILL.md +10 -0
- package/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh +418 -23
- package/.claude/skills/autonomous/scripts/setup-autonomous.sh +29 -0
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +25 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +35 -3
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +20 -20
- package/src/scaffold/templates.ts +1 -0
- package/upgrades/1.3.479.md +53 -0
- package/upgrades/side-effects/autonomous-completion-real-checks.md +88 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA2E/F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,S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|
@@ -444,6 +444,7 @@ This routes feedback to the Instar maintainers automatically. Valid types: \`bug
|
|
|
444
444
|
- Proactive: user asks "what autonomous jobs are running?" → GET /autonomous/sessions. "stop everything" → POST /autonomous/stop-all. "stop the job on topic X" → POST /autonomous/sessions/X/stop.
|
|
445
445
|
|
|
446
446
|
**Autonomous Completion Discipline** — A pre-approved autonomous run is structurally held to its FULL completion bar. The \`/autonomous\` setup defaults to a verifiable \`completion_condition\` (judged each turn by an INDEPENDENT model from what I SURFACE — I cannot self-certify "done"); the self-declared \`<promise>\` is the recorded fallback. The stop hook re-feeds a continue for every NON-stop rationalization ("clean milestone", "needs your steer", "it's late", "good stopping point") — a deterministic milestone-phrase scan flags these to the judge, and the judge is injection-resistant (the transcript is fenced as instruction-inert data; guard-directed phrasing is treated as gaming). The ONLY exits are (a) a genuine HARD external blocker, (b) duration expiry, (c) the condition genuinely met. For (a) I emit a nonce'd \`<hard-blocker>\` terminal marker (what I tried / why I'm stuck / what I'd need); the judge classifies it external-vs-buildable — if what I'd need is something I could build/derive/fetch myself, I'm re-fed to keep working. A clean (a) exit writes \`logs/autonomous-hard-blocker.jsonl\`, raises one /ack-able Attention item, and sends one Telegram. Off-switch + judge budget: \`.instar/config.json\` → \`autonomousSessions.completionDiscipline\` (\`enabled\`, \`judgeTimeoutMs\`); read at the hook chokepoint, so a toggle lands on the next stop with no restart.
|
|
447
|
+
- **Real-check verification (optional, ACT-152):** the completion judge reads the TRANSCRIPT (what I surface) — it does not run tools. When a goal is checkable by a command (a test suite, a build, a grep, a CI status), set a \`verification_command\` in the autonomous state (\`instar\`'s setup takes \`--verification-command "<cmd>"\` and \`--verification-cwd "<dir>"\`, and always records \`work_dir\` so a relative command runs in the right tree). When set, a met:true verdict RUNS the command and the run may stop ONLY if it ALSO passes (exit 0); a fail/timeout/breaker-open keeps me working with the command's output as guidance — it can never CAUSE a premature exit (the safe direction). Bounded timeout, output scrubbed for secrets, destructive commands refused, and a P19 breaker stops a stuck/flaky check from spinning. Audit: \`logs/autonomous-realcheck.jsonl\`. Off-switch: \`autonomousSessions.completionDiscipline.realCheck.enabled\` (read at the chokepoint, no restart). It is a NO-OP unless a job declares a \`verification_command\`.
|
|
447
448
|
|
|
448
449
|
**Cross-Machine Seamlessness (one agent, many machines)** — When I run on more than one machine, I am ONE agent that follows the user across them, not clones. Exactly one machine is "awake" at a time, decided by a **fenced lease** (a clock-proof, numbered "who's in charge" badge); the other is standby and takes over only when the awake machine genuinely goes silent.
|
|
449
450
|
- **I never double-reply** — each inbound message is handled exactly once (durable per-message ledger keyed on the platform event id), so a redelivery or mid-handoff overlap can't make me answer twice.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAuB;IACrD,OAAO,KAAK,QAAQ,CAAC,IAAI;;;;OAIpB,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;;;;EAIpC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;6BAsBO,QAAQ,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+D7C,CAAC;AAEF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,WAAmB,EAAE,QAAgB;IACrF,OAAO;;;;;;;;;;;;;;;;;;EAkBP,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkDH,QAAQ;;;;;CAKjB,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,KAAK,QAAQ;;;;;;;;;;;;;;4CAcsB,QAAQ;CACnD,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CA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;;;;;;;;;;OAoCT,SAAS;;gCAEgB,IAAI,qFAAqF,IAAI;;;;;;CAM5H,CAAC;IAEA,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;IACA,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI;;;;CAId,CAAC;IACA,CAAC;IAED,OAAO,IAAI;;;;;;;8EAOiE,IAAI;;;yFAGO,IAAI;;;;;;;uGAOU,IAAI;yFAClB,IAAI;;;;;;0DAMnC,IAAI;;;;;;;;;;;;;;;;;;;;;;;2FAuB6B,IAAI;8FACD,IAAI;+MAC6G,IAAI;mGAChH,IAAI;;;mMAG4F,IAAI;;;;;0LAKb,IAAI;;;;4EAIlH,IAAI;+LAC+G,IAAI;;;;8DAIrI,IAAI;;;;;;;;;;;0CAWxB,IAAI;oCACV,IAAI;;;;;;;;;;;;;yDAaiB,IAAI;;;;;;;;0DAQH,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+GhD,SAAS;;;;;;;;;;;;sEAY+C,IAAI;;CAEzE,CAAC;IAEA,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-06-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-06-10T20:53:58.644Z",
|
|
5
|
+
"instarVersion": "1.3.479",
|
|
6
6
|
"entryCount": 201,
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
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": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
60
60
|
"since": "2025-01-01"
|
|
61
61
|
},
|
|
62
62
|
"hook:self-stop-guard": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"domain": "coherence",
|
|
66
66
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
67
67
|
"installedPath": ".instar/hooks/instar/self-stop-guard.js",
|
|
68
|
-
"contentHash": "
|
|
68
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
69
69
|
"since": "2025-01-01"
|
|
70
70
|
},
|
|
71
71
|
"hook:post-action-reflection": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"domain": "evolution",
|
|
75
75
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
76
76
|
"installedPath": ".instar/hooks/instar/post-action-reflection.js",
|
|
77
|
-
"contentHash": "
|
|
77
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
78
78
|
"since": "2025-01-01"
|
|
79
79
|
},
|
|
80
80
|
"hook:external-communication-guard": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"domain": "safety",
|
|
84
84
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
85
85
|
"installedPath": ".instar/hooks/instar/external-communication-guard.js",
|
|
86
|
-
"contentHash": "
|
|
86
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
87
87
|
"since": "2025-01-01"
|
|
88
88
|
},
|
|
89
89
|
"hook:scope-coherence-collector": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"domain": "coherence",
|
|
93
93
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
94
94
|
"installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
|
|
95
|
-
"contentHash": "
|
|
95
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
96
96
|
"since": "2025-01-01"
|
|
97
97
|
},
|
|
98
98
|
"hook:scope-coherence-checkpoint": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"domain": "coherence",
|
|
102
102
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
103
103
|
"installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
|
|
104
|
-
"contentHash": "
|
|
104
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
105
105
|
"since": "2025-01-01"
|
|
106
106
|
},
|
|
107
107
|
"hook:free-text-guard": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"domain": "safety",
|
|
111
111
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
112
112
|
"installedPath": ".instar/hooks/instar/free-text-guard.sh",
|
|
113
|
-
"contentHash": "
|
|
113
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
114
114
|
"since": "2025-01-01"
|
|
115
115
|
},
|
|
116
116
|
"hook:claim-intercept": {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"domain": "coherence",
|
|
120
120
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
121
121
|
"installedPath": ".instar/hooks/instar/claim-intercept.js",
|
|
122
|
-
"contentHash": "
|
|
122
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
123
123
|
"since": "2025-01-01"
|
|
124
124
|
},
|
|
125
125
|
"hook:claim-intercept-response": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"domain": "coherence",
|
|
129
129
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
130
130
|
"installedPath": ".instar/hooks/instar/claim-intercept-response.js",
|
|
131
|
-
"contentHash": "
|
|
131
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
132
132
|
"since": "2025-01-01"
|
|
133
133
|
},
|
|
134
134
|
"hook:stop-gate-router": {
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"domain": "safety",
|
|
138
138
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
139
139
|
"installedPath": ".instar/hooks/instar/stop-gate-router.js",
|
|
140
|
-
"contentHash": "
|
|
140
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
141
141
|
"since": "2025-01-01"
|
|
142
142
|
},
|
|
143
143
|
"hook:auto-approve-permissions": {
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"domain": "safety",
|
|
147
147
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
148
148
|
"installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
|
|
149
|
-
"contentHash": "
|
|
149
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
150
150
|
"since": "2025-01-01"
|
|
151
151
|
},
|
|
152
152
|
"job:health-check": {
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"type": "skill",
|
|
371
371
|
"domain": "skills",
|
|
372
372
|
"sourcePath": ".claude/skills/autonomous/SKILL.md",
|
|
373
|
-
"contentHash": "
|
|
373
|
+
"contentHash": "f89882758b3882e2491e60e22c4691a95e1c7ef6a9e65eee8c7a7702dc9d032a",
|
|
374
374
|
"since": "2025-01-01"
|
|
375
375
|
},
|
|
376
376
|
"skill:build": {
|
|
@@ -1554,7 +1554,7 @@
|
|
|
1554
1554
|
"type": "subsystem",
|
|
1555
1555
|
"domain": "updates",
|
|
1556
1556
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
1557
|
-
"contentHash": "
|
|
1557
|
+
"contentHash": "97c02d194801d80eb9a6f23191359a967a64c6dd0e409bacb09fa5bf829dc537",
|
|
1558
1558
|
"since": "2025-01-01"
|
|
1559
1559
|
},
|
|
1560
1560
|
"subsystem:scheduler": {
|
|
@@ -464,6 +464,7 @@ This routes feedback to the Instar maintainers automatically. Valid types: \`bug
|
|
|
464
464
|
- Proactive: user asks "what autonomous jobs are running?" → GET /autonomous/sessions. "stop everything" → POST /autonomous/stop-all. "stop the job on topic X" → POST /autonomous/sessions/X/stop.
|
|
465
465
|
|
|
466
466
|
**Autonomous Completion Discipline** — A pre-approved autonomous run is structurally held to its FULL completion bar. The \`/autonomous\` setup defaults to a verifiable \`completion_condition\` (judged each turn by an INDEPENDENT model from what I SURFACE — I cannot self-certify "done"); the self-declared \`<promise>\` is the recorded fallback. The stop hook re-feeds a continue for every NON-stop rationalization ("clean milestone", "needs your steer", "it's late", "good stopping point") — a deterministic milestone-phrase scan flags these to the judge, and the judge is injection-resistant (the transcript is fenced as instruction-inert data; guard-directed phrasing is treated as gaming). The ONLY exits are (a) a genuine HARD external blocker, (b) duration expiry, (c) the condition genuinely met. For (a) I emit a nonce'd \`<hard-blocker>\` terminal marker (what I tried / why I'm stuck / what I'd need); the judge classifies it external-vs-buildable — if what I'd need is something I could build/derive/fetch myself, I'm re-fed to keep working. A clean (a) exit writes \`logs/autonomous-hard-blocker.jsonl\`, raises one /ack-able Attention item, and sends one Telegram. Off-switch + judge budget: \`.instar/config.json\` → \`autonomousSessions.completionDiscipline\` (\`enabled\`, \`judgeTimeoutMs\`); read at the hook chokepoint, so a toggle lands on the next stop with no restart.
|
|
467
|
+
- **Real-check verification (optional, ACT-152):** the completion judge reads the TRANSCRIPT (what I surface) — it does not run tools. When a goal is checkable by a command (a test suite, a build, a grep, a CI status), set a \`verification_command\` in the autonomous state (\`instar\`'s setup takes \`--verification-command "<cmd>"\` and \`--verification-cwd "<dir>"\`, and always records \`work_dir\` so a relative command runs in the right tree). When set, a met:true verdict RUNS the command and the run may stop ONLY if it ALSO passes (exit 0); a fail/timeout/breaker-open keeps me working with the command's output as guidance — it can never CAUSE a premature exit (the safe direction). Bounded timeout, output scrubbed for secrets, destructive commands refused, and a P19 breaker stops a stuck/flaky check from spinning. Audit: \`logs/autonomous-realcheck.jsonl\`. Off-switch: \`autonomousSessions.completionDiscipline.realCheck.enabled\` (read at the chokepoint, no restart). It is a NO-OP unless a job declares a \`verification_command\`.
|
|
467
468
|
|
|
468
469
|
**Cross-Machine Seamlessness (one agent, many machines)** — When I run on more than one machine, I am ONE agent that follows the user across them, not clones. Exactly one machine is "awake" at a time, decided by a **fenced lease** (a clock-proof, numbered "who's in charge" badge); the other is standby and takes over only when the awake machine genuinely goes silent.
|
|
469
470
|
- **I never double-reply** — each inbound message is handled exactly once (durable per-message ledger keyed on the platform event id), so a redelivery or mid-handoff overlap can't make me answer twice.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Autonomous jobs can now declare an optional `verification_command` (with an optional
|
|
9
|
+
`verification_cwd`; setup also records `work_dir`). When the independent completion judge says a
|
|
10
|
+
goal is met — which it decides by reading what the agent *surfaced in the transcript*, not by
|
|
11
|
+
running anything — the autonomous Stop hook now RUNS that command and only lets the run stop if the
|
|
12
|
+
command ALSO passes (exit 0). Any failure, timeout, missing-timeout-binary, refused-destructive
|
|
13
|
+
command, or a tripped breaker → keep working with the command's output as next-turn guidance. It
|
|
14
|
+
can never CAUSE a premature exit (the safe direction). The command runs under a portable bounded
|
|
15
|
+
timeout (`timeout`/`gtimeout` with `-k`, else a perl process-group-kill, else "unavailable → keep
|
|
16
|
+
working"), in a scrubbed env (fixed PATH, no auth token), with its output scrubbed for secrets and
|
|
17
|
+
DATA-labeled so an echoed "all tests pass" can't launder into a later judge verdict, and a P19
|
|
18
|
+
breaker stops a stuck/flaky check from spinning the judge + command to the duration limit. Every
|
|
19
|
+
run appends one row to `logs/autonomous-realcheck.jsonl`. Off-switch:
|
|
20
|
+
`autonomousSessions.completionDiscipline.realCheck.enabled` (read at the hook chokepoint — no
|
|
21
|
+
restart). It is a NO-OP unless a job declares a `verification_command`.
|
|
22
|
+
|
|
23
|
+
## What to Tell Your User
|
|
24
|
+
|
|
25
|
+
When I'm running on my own toward a goal, a second, independent check decides "is it really done?".
|
|
26
|
+
Until now that check only *read what I wrote* — so if I said the tests passed, it believed me, even
|
|
27
|
+
if I'd misread them or run them in the wrong place. Now, when a goal is checkable by a command (a
|
|
28
|
+
test suite, a build, a quick check), I can actually RUN that command before I'm allowed to stop — so
|
|
29
|
+
"done" means the check really passed, not just that I claimed it. If the check fails, I don't stop;
|
|
30
|
+
I keep working with the failure in front of me. It only ever makes me keep working longer, never
|
|
31
|
+
stop early, and it's off unless a job specifically asks for it. You don't have to set anything up;
|
|
32
|
+
it's there for the kinds of autonomous jobs that have a clear "run this to verify" command.
|
|
33
|
+
|
|
34
|
+
## Summary of New Capabilities
|
|
35
|
+
|
|
36
|
+
- Autonomous jobs gain an opt-in real-check: `instar`'s autonomous setup takes
|
|
37
|
+
`--verification-command "<cmd>"` and `--verification-cwd "<dir>"`; a met verdict runs the command
|
|
38
|
+
and the run stops only if it passes.
|
|
39
|
+
- A new audit trail at `logs/autonomous-realcheck.jsonl` (command, cwd, exit, outcome per run).
|
|
40
|
+
- Config: `autonomousSessions.completionDiscipline.realCheck` (`enabled`, `timeoutMs`, `maxChars`,
|
|
41
|
+
`captureBytes`, `failBreakerThreshold`, `failWindowMs`, `failCooldownMs`) — read live, no restart.
|
|
42
|
+
|
|
43
|
+
## Evidence
|
|
44
|
+
|
|
45
|
+
- Spec (converged, 3 review rounds, approved): `docs/specs/autonomous-completion-real-checks.md`;
|
|
46
|
+
convergence report `docs/specs/reports/autonomous-completion-real-checks-convergence.md`.
|
|
47
|
+
- Tests, all green: 24 unit (`tests/unit/autonomous-stop-hook-realcheck.test.ts`), 4 integration
|
|
48
|
+
(`tests/integration/autonomous-realcheck-setup-roundtrip.test.ts`), 2 e2e
|
|
49
|
+
(`tests/e2e/autonomous-realcheck-verification-lifecycle.test.ts` — the "feature is alive" test
|
|
50
|
+
proving the gate is wired into the real production met-path). The cardinal invariant (no
|
|
51
|
+
verification problem can cause a premature exit) is independently second-pass reviewed and
|
|
52
|
+
traced path-by-path.
|
|
53
|
+
- Side-effects review: `upgrades/side-effects/autonomous-completion-real-checks.md`.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Side-Effects Review — Autonomous completion: real-checks verification
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `autonomous-completion-real-checks`
|
|
4
|
+
**Date:** `2026-06-10`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `echo (Phase 5 — REQUIRED: touches the autonomous Stop-hook continue/stop authority + a new gate)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Autonomous jobs gain an OPT-IN `verification_command` (+ optional `verification_cwd`; setup also records `work_dir`). When the transcript-judge (`CompletionEvaluator`, via `POST /autonomous/evaluate-completion`) returns `met:true`, the autonomous Stop hook (`autonomous-stop-hook.sh`) now RUNS the declared command and only allows the session to exit if the command ALSO passes (exit 0). Any failure mode — non-zero, timeout, missing-timeout-binary, refused-destructive, or breaker-open — routes to KEEP WORKING (the safe direction), surfacing the command's sanitized output as next-turn guidance. The judge stays transcript-only and unchanged; the real check is a second, independent, deterministic gate layered on the (rare) met path. Files: `.claude/skills/autonomous/hooks/autonomous-stop-hook.sh` (the gate `realcheck_gate`, `run_verification`, P19 breaker helpers, audit, config-read), `.claude/skills/autonomous/scripts/setup-autonomous.sh` (new flags + state fields), `src/config/ConfigDefaults.ts` (the `realCheck` config block nested in `completionDiscipline`), `src/core/PostUpdateMigrator.ts` (3 marker bumps to `REALCHECK_VERIFY` + a `migrateClaudeMd` appended subsection), `src/scaffold/templates.ts` (`generateClaudeMd`), `.claude/skills/autonomous/SKILL.md` (Write-template docs), + unit/integration/e2e tests. Spec: `docs/specs/autonomous-completion-real-checks.md` (converged, approved).
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `autonomous Stop-hook EXIT decision (met path)` — **modify** — a met:true verdict no longer auto-exits; it now ALSO requires the declared `verification_command` to pass (exit 0). The modification is purely additive in the SAFE direction: it can only WITHHOLD an exit, never CAUSE one.
|
|
15
|
+
- `realcheck_gate` — **add** — the new gate function; returns 0 (allow exit) ONLY on disabled / no-command / breaker-closed-PASS; returns 1 (keep working) on every failure mode.
|
|
16
|
+
- `realcheck breaker (CD_BACKOFF_STATE)` — **add** — a P19 backoff+breaker+cap sibling counter that short-circuits a stuck/flaky command (no judge re-fire, no command run) and raises ONE Attention item.
|
|
17
|
+
- `destructive-pattern pre-block` — **add** — a coarse literal-shape guard refusing high-signal destructive commands before execution (→ keep working).
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Over-block
|
|
22
|
+
|
|
23
|
+
**What legitimate inputs does this change reject that it shouldn't?**
|
|
24
|
+
|
|
25
|
+
The gate blocks the autonomous EXIT, not a user message. Its only "over-block" is keeping the agent working when the goal is actually done — which happens only if a declared `verification_command` falsely FAILS (a flaky check, a wrong CWD, a stale-artifact premise). Concrete: a job declares `verification_command: "npm test"` but the build lives in a worktree the job forgot to point at via `verification_cwd` → `npm test` from `work_dir` fails → the agent keeps working past a genuine completion. Mitigations: (a) the failure output is fed back as next-turn guidance framed as "the check may be wrong/mis-scoped — say so" (P13 / A-Wall-Is-a-Hypothesis), so the agent can correct the premise rather than grind; (b) the P19 breaker stops a persistently-failing check from spinning to duration and raises an Attention item so the operator sees the bad command; (c) the duration limit is the hard backstop; (d) the whole feature is a NO-OP unless a job declares the command, and is opt-in per job. Critically, over-block here is bounded + surfaced + recoverable — it can never cause the dangerous direction (a premature exit).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Under-block
|
|
30
|
+
|
|
31
|
+
**What failure modes does this still miss?**
|
|
32
|
+
|
|
33
|
+
A `verification_command` the agent constructs to falsely PASS: `verification_command: "true"`, `"npm test || true"`, a `test -f <stale-flag>` the agent `touch`ed earlier, or a PATH-shadowed `npm`. These are honestly named residuals (spec §6.2): the feature strengthens against HONEST failure (misread output, stale tree, premature "done"), not against an adversarial agent — which already holds far larger powers (edit source, push). The floor never drops below today (the independent judge still had to say met). The defeat is made DETECTABLE post-hoc via the audit row (`logs/autonomous-realcheck.jsonl` records the command + cwd + exit), not prevented. The conversational/transcript path is unchanged — this only adds a gate on the autonomous met path.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 3. Level-of-abstraction fit
|
|
38
|
+
|
|
39
|
+
**Is this at the right layer?**
|
|
40
|
+
|
|
41
|
+
Yes. The real check is a deterministic STRUCTURAL VALIDATOR (an exit-code — `signal-vs-authority.md`'s allowed detector class), layered as a corroborator on top of the existing full-context LLM judge (`CompletionEvaluator`) which remains the primary JUDGMENT authority on the met verdict. The check runs in the Stop hook (the correct layer — it owns the continue/stop decision), reuses the existing `CD_BACKOFF_STATE` breaker machinery, the `hb_sanitize`/`hb_leak_hit` output discipline, and the `cd_raise_attention_item` notification primitive rather than re-implementing them. It does NOT add a parallel gate or a new authority — it feeds the existing continue/stop decision.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 4. Signal vs authority compliance
|
|
46
|
+
|
|
47
|
+
**Does this hold blocking authority with brittle logic, or produce a signal that feeds a smart gate?**
|
|
48
|
+
|
|
49
|
+
Compliant. Per `docs/signal-vs-authority.md`: an exit-code is a structural validator (the doc's explicitly-allowed detector class — "this type-checks, this length is bounded"), not a meaning-judgment. The LLM judge remains the sole *judgment* authority that must independently say met; the real check's only autonomous authority is in the SAFE (keep-working) direction — a brittle check that errs toward "keep working" (bounded by duration) is NOT the dangerous "brittle authority that blocks a legitimate action" the principle forbids. It is a corroborator that RAISES the bar for stopping, never one that forces a premature stop. Every error/ambiguity/timeout path resolves to keep-working.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 5. Interactions
|
|
54
|
+
|
|
55
|
+
**Does it shadow another check, get shadowed, double-fire, race?**
|
|
56
|
+
|
|
57
|
+
- **CD_BLOCK_TERMINAL / contradictory hard-blocker:** the gate sits INSIDE the existing `if [[ "$EVAL_MET" == "true" ]]` block, AFTER the `CD_BLOCK_TERMINAL` guard + the P13 check — so a turn emitting BOTH a `<hard-blocker>` and a met-condition short-circuits before the gate (tested). The gate never runs on a hard-blocker/P13-blocked turn.
|
|
58
|
+
- **Native /goal mode:** the `goal_mode:native` branch returns far earlier (line ~452) — the gate is unreachable there; native runs are unaffected.
|
|
59
|
+
- **P19 breaker vs judge breaker:** a SIBLING counter in the same `CD_BACKOFF_STATE` sidecar (atomic `.tmp.$$`+mv writes, fails CLOSED=keep-verifying on a corrupt sidecar) — does not collide with the judge breaker.
|
|
60
|
+
- **Idle-backoff:** a met→fail iteration is by definition not a rapid-idle one, so the backoff self-clamp is unaffected; the verification timeout (≤120s) + judge curl (≤35s) stay far under the ~10000s registered Stop-hook timeout (no host-kill / fail-open-strand risk).
|
|
61
|
+
- **Adjacent (out of scope, captured separately):** the feature's integration test surfaced a PRE-EXISTING latent bug in `setup-autonomous.sh`'s multi-session start-gate — when run with `--report-topic`, no server reachable, AND `.instar/autonomous/` empty, the local-count fallback `ls …/*.local.md | grep -c…` exits non-zero on an empty glob and trips `set -euo pipefail`, aborting before the state write. NOT part of this feature; not fixed here (no-batching rule); recorded for a separate follow-up fix (`grep -c … || true`).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 6. External surfaces
|
|
66
|
+
|
|
67
|
+
**Does it change anything visible to other agents, users, other systems?**
|
|
68
|
+
|
|
69
|
+
- A new audit file `logs/autonomous-realcheck.jsonl` (read-only, size-rotated). No new API route.
|
|
70
|
+
- One new Attention item source (`autonomous-realcheck-stuck`) when the breaker trips — deduped per run (Bounded-Notification-Surface compliant).
|
|
71
|
+
- Next-turn guidance gains the real-check output, sanitized (control-strip → UTF-8 scrub → leak-scrub incl. the agent's own authToken + `Bearer` → clamp) and explicitly DATA-labeled so an echoed "all tests pass" cannot launder into a later judge verdict.
|
|
72
|
+
- Runtime dependency: it RUNS a command unattended in the Stop hook — bounded by a portable timeout ladder (`timeout`/`gtimeout` with `-k`, else a perl `setpgrp` group-kill, else unavailable→keep-working), scrubbed env (fixed PATH, no authToken, no `npm_config_*`/`NODE_OPTIONS`), and a destructive-pattern pre-block. Timing depends on the declared command, bounded by `realCheckTimeoutMs` (default 120s) and only on the rare met path.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 7. Rollback cost
|
|
77
|
+
|
|
78
|
+
**If this turns out wrong in production, what's the back-out?**
|
|
79
|
+
|
|
80
|
+
Cheap and instant. `autonomousSessions.completionDiscipline.realCheck.enabled: false` in `.instar/config.json` is read at the hook chokepoint each fire (no restart) and reverts to transcript-only behavior. A job simply omitting `verification_command` is already unaffected (byte-identical to today — tested). No data migration, no state repair. The migrator marker bump (`REALCHECK_VERIFY`) is idempotent; a customized hook is left untouched. Worst case (the gate misbehaves for a job that opted in) is bounded by the duration limit and surfaced via the audit + Attention item.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Second-pass review (Phase 5)
|
|
85
|
+
|
|
86
|
+
**Reviewer: echo (independent pass) — Concur with the review.**
|
|
87
|
+
|
|
88
|
+
Independently traced every path through `realcheck_gate` (hook ~1095-1121) and `run_verification` (~929-1064): the cardinal invariant holds — `realcheck_gate` returns 0 (allow exit) ONLY on `RC_ENABLED != 1`, empty `VERIFICATION_COMMAND`, or `RC_OUTCOME == "pass"`; every other outcome (fail, 124 timeout, 127 unavailable, 126 refused-destructive, breaker-open, corrupt sidecar) returns 1 (keep working). All three completion-met `exit 0` sites are strictly inside `if realcheck_gate; then`; the non-completion exits (hard-blocker, emergency-stop, corrupt-state fail-safe) are correctly NOT wrapped. Breaker fail-direction verified empirically (corrupt `CD_BACKOFF_STATE` → fails=0 < threshold → echo 0 → CLOSED → check still runs — fail-CLOSED/safe). Perl timeout wrapper semantics verified live (exit-1→FAIL, exit-0→PASS, sleep-3-under-1s→124 in ~1s, no orphan). Signal-vs-authority posture legitimate (structural-validator corroborator, safe-direction-only authority, LLM judge unchanged and still primary). 24 unit + 4 integration + 2 e2e green. One under-stated nuance (a condition-path fail + same-turn legacy-promise match could run the command twice in one fire) is bounded, non-harmful (same breaker, neither can cause a premature exit), and does not affect the invariant.
|