instar 1.3.430 → 1.3.431
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/CompletionEvaluator.d.ts +12 -5
- package/dist/core/CompletionEvaluator.d.ts.map +1 -1
- package/dist/core/CompletionEvaluator.js +34 -15
- package/dist/core/CompletionEvaluator.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.431.md +23 -0
- package/upgrades/side-effects/p13-stop-rationale-peer-pursuit.md +69 -0
|
@@ -56,11 +56,18 @@ export declare class CompletionEvaluator {
|
|
|
56
56
|
private parse;
|
|
57
57
|
/**
|
|
58
58
|
* P13 "The Stop Reason Is the Work" guard. Given the recent transcript, decide
|
|
59
|
-
* whether an autonomous stop-attempt is EARNED, or whether it rests on
|
|
60
|
-
* anti-pattern
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
59
|
+
* whether an autonomous stop-attempt is EARNED, or whether it rests on a P13
|
|
60
|
+
* anti-pattern — ending the run citing any of:
|
|
61
|
+
* - "needs a judgment call" / "needs real engineering" (a derivable standard
|
|
62
|
+
* or buildable engineering dressed up as a stop reason);
|
|
63
|
+
* - "blocked on / waiting on another agent (or the operator)" (a peer
|
|
64
|
+
* dependency is NOT terminal — the agent must keep pursuing it: re-ping,
|
|
65
|
+
* periodic re-check, alternate path, or advance other work);
|
|
66
|
+
* - "a waiting / polling loop burns resources / spins the box" (waiting on a
|
|
67
|
+
* peer is not a CPU burn; a cheap periodic check is the right strategy).
|
|
68
|
+
* ...WITHOUT showing a derived standard, a built artifact, or a genuinely
|
|
69
|
+
* operator-only residual it has already pursued. Returns stopAllowed:false +
|
|
70
|
+
* guidance when the anti-pattern is detected; otherwise stopAllowed:true.
|
|
64
71
|
*
|
|
65
72
|
* Fails OPEN (stopAllowed:true) on error or ambiguity: this is a SECONDARY guard
|
|
66
73
|
* on top of the completion check, so an evaluator hiccup must never TRAP a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompletionEvaluator.d.ts","sourceRoot":"","sources":["../../src/core/CompletionEvaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,GAAG,EAAE,OAAO,CAAC;IACb,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,WAAW,EAAE,OAAO,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,oBAAoB,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC7C;AAID,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;gBAEhD,IAAI,EAAE,uBAAuB;IAKzC;;;;;OAKG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBrF,OAAO,CAAC,WAAW;IAiBnB,gFAAgF;IAChF,OAAO,CAAC,KAAK;IAcb
|
|
1
|
+
{"version":3,"file":"CompletionEvaluator.d.ts","sourceRoot":"","sources":["../../src/core/CompletionEvaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,GAAG,EAAE,OAAO,CAAC;IACb,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,WAAW,EAAE,OAAO,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,oBAAoB,CAAC;IACnC,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC7C;AAID,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;gBAEhD,IAAI,EAAE,uBAAuB;IAKzC;;;;;OAKG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBrF,OAAO,CAAC,WAAW;IAiBnB,gFAAgF;IAChF,OAAO,CAAC,KAAK;IAcb;;;;;;;;;;;;;;;;;;OAkBG;IACG,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkBlF,OAAO,CAAC,wBAAwB;IAyChC,2FAA2F;IAC3F,OAAO,CAAC,kBAAkB;IAoB1B,IAAI,aAAa,IAAI,MAAM,CAE1B;CACF"}
|
|
@@ -81,11 +81,18 @@ export class CompletionEvaluator {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* P13 "The Stop Reason Is the Work" guard. Given the recent transcript, decide
|
|
84
|
-
* whether an autonomous stop-attempt is EARNED, or whether it rests on
|
|
85
|
-
* anti-pattern
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
84
|
+
* whether an autonomous stop-attempt is EARNED, or whether it rests on a P13
|
|
85
|
+
* anti-pattern — ending the run citing any of:
|
|
86
|
+
* - "needs a judgment call" / "needs real engineering" (a derivable standard
|
|
87
|
+
* or buildable engineering dressed up as a stop reason);
|
|
88
|
+
* - "blocked on / waiting on another agent (or the operator)" (a peer
|
|
89
|
+
* dependency is NOT terminal — the agent must keep pursuing it: re-ping,
|
|
90
|
+
* periodic re-check, alternate path, or advance other work);
|
|
91
|
+
* - "a waiting / polling loop burns resources / spins the box" (waiting on a
|
|
92
|
+
* peer is not a CPU burn; a cheap periodic check is the right strategy).
|
|
93
|
+
* ...WITHOUT showing a derived standard, a built artifact, or a genuinely
|
|
94
|
+
* operator-only residual it has already pursued. Returns stopAllowed:false +
|
|
95
|
+
* guidance when the anti-pattern is detected; otherwise stopAllowed:true.
|
|
89
96
|
*
|
|
90
97
|
* Fails OPEN (stopAllowed:true) on error or ambiguity: this is a SECONDARY guard
|
|
91
98
|
* on top of the completion check, so an evaluator hiccup must never TRAP a
|
|
@@ -115,11 +122,18 @@ export class CompletionEvaluator {
|
|
|
115
122
|
'standard P13 "The Stop Reason Is the Work." Judge ONLY the transcript below.',
|
|
116
123
|
'',
|
|
117
124
|
'Decide whether the agent is ENDING / STOPPING its autonomous run, and if so,',
|
|
118
|
-
'WHY. The stop is NOT earned (BLOCK it) when the stated reason is
|
|
119
|
-
'"I need a judgment call from the user" or "this needs real engineering / a',
|
|
120
|
-
'careful build / reverse-engineering" —
|
|
121
|
-
'
|
|
122
|
-
'
|
|
125
|
+
'WHY. The stop is NOT earned (BLOCK it) when the stated reason is any of:',
|
|
126
|
+
'- "I need a judgment call from the user" or "this needs real engineering / a',
|
|
127
|
+
' careful build / reverse-engineering" — a judgment gap (a DERIVABLE standard)',
|
|
128
|
+
' or buildable engineering (which the agent can DO) dressed up as a stop reason;',
|
|
129
|
+
'- "I am blocked / waiting on another agent (or on the operator) to respond or',
|
|
130
|
+
' act" — a dependency on a peer is NOT a terminal blocker. It is the agent\'s',
|
|
131
|
+
' job to keep PURSUING it: re-ping the peer, check for a reply on a cadence,',
|
|
132
|
+
' find an alternate path, or advance other open work — NOT to end the run;',
|
|
133
|
+
'- "an idle / waiting / polling loop burns resources / spins the box / wastes',
|
|
134
|
+
' tokens or CPU" — waiting on a peer is NOT a resource burn, and a cheap',
|
|
135
|
+
' periodic check is the correct strategy; resource cost is not a reason to',
|
|
136
|
+
' stop while real work still remains.',
|
|
123
137
|
'',
|
|
124
138
|
'The stop IS earned (ALLOW it) when ANY of these is shown in the transcript:',
|
|
125
139
|
'- a DERIVED STANDARD the agent reasoned out and is proceeding under (even if',
|
|
@@ -127,11 +141,14 @@ export class CompletionEvaluator {
|
|
|
127
141
|
'- a BUILT ARTIFACT produced this run (a PR/commit, a spec/file written, a test',
|
|
128
142
|
' result, a converged artifact handed over for review);',
|
|
129
143
|
"- a genuinely OPERATOR-ONLY residual (a credential/account the user holds, a",
|
|
130
|
-
" real value/priority/risk judgment that is the user's, a required approval,",
|
|
131
|
-
'
|
|
144
|
+
" real value/priority/risk judgment that is the user's, a required approval, a",
|
|
145
|
+
' legal/billing/payment action) that the agent has ALREADY actively pursued',
|
|
146
|
+
' (asked / queued the request) AND with no other open work it could advance',
|
|
147
|
+
' in the meantime;',
|
|
132
148
|
'- a DURATION limit reached or an EMERGENCY stop;',
|
|
133
149
|
'- the agent is NOT actually stopping (it is continuing / re-scoping / moving',
|
|
134
|
-
' to another topic
|
|
150
|
+
' to another topic, or periodically checking for a peer reply while it keeps',
|
|
151
|
+
' advancing other work).',
|
|
135
152
|
'',
|
|
136
153
|
`RECENT TRANSCRIPT (most recent last):\n${transcriptTail}`,
|
|
137
154
|
'',
|
|
@@ -146,12 +163,14 @@ export class CompletionEvaluator {
|
|
|
146
163
|
return { stopAllowed: true, guidance: '' };
|
|
147
164
|
const lines = text.split('\n').map((l) => l.trim()).filter(Boolean);
|
|
148
165
|
const first = (lines[0] || '').toUpperCase();
|
|
149
|
-
|
|
166
|
+
// Reason is the SECOND line only — a bare verdict (just "STOP_BLOCKED") must
|
|
167
|
+
// fall through to the rich default guidance below, never echo the verdict token.
|
|
168
|
+
const reason = (lines[1] || '').slice(0, 300);
|
|
150
169
|
// Check BLOCKED before OK (explicit; they share no substring but keep the order clear).
|
|
151
170
|
if (/\bSTOP[_ ]?BLOCKED\b/.test(first)) {
|
|
152
171
|
return {
|
|
153
172
|
stopAllowed: false,
|
|
154
|
-
guidance: reason || 'P13:
|
|
173
|
+
guidance: reason || 'P13: a stop is not earned by a judgment-call / needs-engineering reason, by "blocked on another agent" (a peer dependency is not terminal — keep pursuing: re-ping + check on a cadence + advance other work), or by "a waiting/polling loop burns resources". Derive+document the standard and proceed, build the artifact and hand it over, or keep actively pursuing the dependency; reserve the stop for a genuinely operator-only residual you have already pursued with no other work to advance.',
|
|
155
174
|
};
|
|
156
175
|
}
|
|
157
176
|
if (/\bSTOP[_ ]?OK\b/.test(first))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompletionEvaluator.js","sourceRoot":"","sources":["../../src/core/CompletionEvaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA+BH,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C,MAAM,OAAO,mBAAmB;IACb,YAAY,CAAuB;IACnC,SAAS,CAAkC;IAE5D,YAAY,IAA6B;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,cAAsB;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,IAAI,GAAW,CAAC;QAChB,IAAI,CAAC;YACH,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAC7C,KAAK,EAAE,IAAI,CAAC,SAAS;gBACrB,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,GAAG;gBACd,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,EAAE,SAAS,EAAE,qBAA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sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO;gBACL,WAAW,EAAE,KAAK;gBAClB,QAAQ,EAAE,MAAM,IAAI,yeAAye;aAC9f,CAAC;QACJ,CAAC;QACD,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;QAC9E,0EAA0E;QAC1E,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,aAAa;QACf,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
|
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-08T08:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-06-08T08:31:50.678Z",
|
|
5
|
+
"instarVersion": "1.3.431",
|
|
6
6
|
"entryCount": 199,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Extended the P13 "Stop Reason Is the Work" guard (`CompletionEvaluator.evaluateStopRationale`, wired at `/autonomous/evaluate-stop`) to BLOCK two more autonomous-stop rationales: "I'm blocked / waiting on another agent (or the operator)" and "an idle/polling/waiting loop burns the box / wastes resources." A peer dependency is not a terminal blocker — the agent must keep pursuing it (re-ping, check for a reply on a cadence, find an alternate path, or advance other open work); waiting on a peer is not a CPU burn. Also tightened the operator-only ALLOW exception to "already pursued AND no other work to advance," and fixed a latent parse bug where a bare `STOP_BLOCKED` verdict echoed the token as guidance instead of the rich default steering.
|
|
9
|
+
|
|
10
|
+
## What to Tell Your User
|
|
11
|
+
|
|
12
|
+
Internal autonomy-robustness change — nothing to configure. If you run autonomous sessions, the agent is now structurally prevented from ending a run by claiming it's "blocked on another agent" or that "an idle loop wastes resources" — it keeps pursuing the dependency (and periodically checking for a reply) instead of stopping. This closes a real failure mode where an autonomous run declared itself complete while work remained — and a peer had in fact already replied.
|
|
13
|
+
|
|
14
|
+
## Summary of New Capabilities
|
|
15
|
+
|
|
16
|
+
| Capability | How to use |
|
|
17
|
+
|-----------|-----------|
|
|
18
|
+
| P13 guard blocks "blocked-on-peer" stops | Automatic in autonomous mode — no config |
|
|
19
|
+
| P13 guard blocks "resource-burn" stops | Automatic in autonomous mode — no config |
|
|
20
|
+
|
|
21
|
+
## Evidence
|
|
22
|
+
|
|
23
|
+
`CompletionEvaluator` unit tests 15/15 green — including 2 new cases: the independent judge's prompt now names both new BLOCK rationales, and a bare-verdict stop falls through to pursuit-steering guidance. `tsc --noEmit` clean. The P13 standard doc (`docs/INSTAR-DESIGN-PRINCIPLES-AND-LESSONS.md`) gains the 2026-06-08 extension + earned-from note. Tier-1 change; side-effects review at `upgrades/side-effects/p13-stop-rationale-peer-pursuit.md`. Earned from topic 12476 (operator correction: a peer dependency is not a blocker; waiting is not a resource burn).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Side-Effects Review — P13 guard blocks "blocked-on-peer" + "resource-burn" stop rationales
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `p13-stop-rationale-peer-pursuit`
|
|
4
|
+
**Date:** `2026-06-08`
|
|
5
|
+
**Author:** `Echo (instar-dev)`
|
|
6
|
+
**Second-pass reviewer:** `not required (Tier 1)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Extends `CompletionEvaluator.evaluateStopRationale` — the P13 "Stop Reason Is the Work" guard already wired into the autonomous stop path at `/autonomous/evaluate-stop` — so the independent judge also BLOCKS two additional stop rationales: (a) "I'm blocked / waiting on another agent (or the operator)" and (b) "an idle/polling/waiting loop burns the box / wastes resources." Both are added to `buildStopRationalePrompt`'s BLOCK list with steering toward active pursuit + periodic re-check; the ALLOW list's operator-only exception is tightened to "already actively pursued AND no other work to advance." Also fixes a latent parse bug in `parseStopRationale`: a bare `STOP_BLOCKED` verdict (no reason line) echoed the verdict token as guidance instead of falling through to the rich default. Files: `src/core/CompletionEvaluator.ts`, `tests/unit/CompletionEvaluator.test.ts`, `docs/INSTAR-DESIGN-PRINCIPLES-AND-LESSONS.md` (P13 section).
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `CompletionEvaluator.evaluateStopRationale` (P13 stop guard, `/autonomous/evaluate-stop`) — **modify** — adds two BLOCK rationales + tightens the operator-only ALLOW; the verdict mechanism (STOP_OK/STOP_BLOCKED, fail-open) is unchanged.
|
|
15
|
+
- `CompletionEvaluator.parseStopRationale` — **modify (bugfix)** — reason now reads the second line only, so a bare verdict reaches the default guidance.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. Over-block
|
|
20
|
+
|
|
21
|
+
**What legitimate inputs does this change reject that it shouldn't?**
|
|
22
|
+
|
|
23
|
+
The guard governs whether an autonomous *stop attempt* is allowed; "over-block" here = blocking a legitimate stop. Risk: a genuinely operator-only residual (a credential/approval only the user can give) where the agent truly has no other work could now be nudged to "keep pursuing." Mitigated three ways: (1) the ALLOW list still explicitly permits an operator-only residual the agent has already pursued with no other work; (2) duration/emergency stops remain allowed; (3) the guard is SECONDARY and fails OPEN — the primary completion authority still governs, and any ambiguity returns `stopAllowed:true`. Net: it can only *delay* a genuine operator-only stop by re-injecting "did you pursue it + is there other work?" guidance, never trap it.
|
|
24
|
+
|
|
25
|
+
## 2. Under-block
|
|
26
|
+
|
|
27
|
+
**What failure modes does this still miss?**
|
|
28
|
+
|
|
29
|
+
It relies on an LLM judge reading the transcript, so a stop whose blocked-on-peer/resource-burn reasoning is implicit (never stated) can still pass as `STOP_OK`. It does not detect a *silent* stop that emits no rationale text (that surface is the completion evaluator + the stop-hook re-injection, not this guard). It cannot force the agent to actually pursue — it only refuses the stop and re-injects guidance; pursuit is the agent's next-turn behavior.
|
|
30
|
+
|
|
31
|
+
## 3. Level-of-abstraction fit
|
|
32
|
+
|
|
33
|
+
This is an **authority** (a context-rich LLM judgment), correctly so — it extends the existing P13 authority rather than adding a parallel brittle detector. It feeds the existing `/autonomous/evaluate-stop` surface (no new route, no new component). It re-uses the established STOP_OK/STOP_BLOCKED contract and fail-open posture. No lower-level primitive is re-implemented.
|
|
34
|
+
|
|
35
|
+
## 4. Signal vs authority compliance
|
|
36
|
+
|
|
37
|
+
**Does this change hold blocking authority with brittle logic?** No. The blocking authority is the LLM judge (full transcript context), not a keyword filter — consistent with `docs/signal-vs-authority.md`. The only string logic is the verdict parse (STOP_OK/STOP_BLOCKED), unchanged in posture, and it fails OPEN. The new content is *prompt guidance* the judge reasons over, not a regex that blocks.
|
|
38
|
+
|
|
39
|
+
## 5. Interactions
|
|
40
|
+
|
|
41
|
+
- **Shadowing:** runs as the SECONDARY guard after the PRIMARY completion evaluator; it does not shadow it — completion authority governs first. No change to ordering.
|
|
42
|
+
- **Double-fire:** none — single call site (`routes.ts` `/autonomous/evaluate-stop`); no new caller.
|
|
43
|
+
- **Races:** none — pure function over an injected transcript string; no shared mutable state.
|
|
44
|
+
- **Feedback loops:** when it blocks, it re-injects guidance as the next-turn prompt — intended P13 behavior; bounded by the loop's existing duration/emergency stops.
|
|
45
|
+
|
|
46
|
+
## 6. External surfaces
|
|
47
|
+
|
|
48
|
+
No new routes, config, or user-visible output. Behavior change is internal to autonomous-loop stopping. The deployed behavior reaches existing agents on package update (CompletionEvaluator ships in `dist` — no migration needed; it is code, not an installed agent file). The P13 standard doc is updated for the `/spec-converge` reviewer.
|
|
49
|
+
|
|
50
|
+
## 7. Rollback cost
|
|
51
|
+
|
|
52
|
+
- **Hot-fix release:** revert the code change; ship as next patch. Fully reversible.
|
|
53
|
+
- **Data migration:** none — no persistent state.
|
|
54
|
+
- **Agent state repair:** none — no agent files touched; behavior updates with the package.
|
|
55
|
+
- **User visibility:** none — internal autonomous-loop behavior; worst case is the guard allows a stop it previously blocked (or vice-versa), both within the existing fail-open envelope.
|
|
56
|
+
|
|
57
|
+
## Conclusion
|
|
58
|
+
|
|
59
|
+
Tier-1, safety-improving extension of an existing ratified standard (P13) via its existing guard. Adds BLOCK cases only (more conservative — the safe direction), fails open, no new surface, no migration. Tests 15/15 green, `tsc` clean.
|
|
60
|
+
|
|
61
|
+
## Second-pass review (if required)
|
|
62
|
+
|
|
63
|
+
Not required (Tier 1).
|
|
64
|
+
|
|
65
|
+
## Evidence pointers
|
|
66
|
+
|
|
67
|
+
- `tests/unit/CompletionEvaluator.test.ts` — 15/15 pass (2 new cases: judge prompt names the new BLOCK rationales; default guidance steers to pursuit).
|
|
68
|
+
- `docs/INSTAR-DESIGN-PRINCIPLES-AND-LESSONS.md` — P13 "Extension (2026-06-08)" + "Extended from" note.
|
|
69
|
+
- Earned from topic 12476, 2026-06-08 (operator correction: a peer dependency is not a blocker; waiting is not a resource burn).
|