instar 1.3.278 → 1.3.280

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.
@@ -0,0 +1,102 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Prompt Gate now recognizes the exact Gemini CLI package-runner install prompt
9
+ that blocked the live mentorship cycle: an `instar` package version followed by
10
+ `Ok to proceed? (y)`. That narrow prompt is answered with the highlighted
11
+ default, so the agent can continue through its own Instar CLI command without a
12
+ manual Enter press. Arbitrary package installs are not auto-answered.
13
+
14
+ Prompt Gate also recognizes Gemini CLI execution-approval modals, but with the
15
+ opposite policy. Execution approvals ask whether model-proposed command text may
16
+ run. This change adds no approval path. When the known modal shape includes the
17
+ reject option, Prompt Gate chooses that reject option and records the rejected
18
+ command text in the server log plus an observable Prompt Gate event.
19
+
20
+ Fixed an invisible-verdict bug in the pre-send message-quality gate. When the gate
21
+ blocked an outbound message, it wrote its reasons to the wrong output channel, so
22
+ the agent saw a generic "hook error" instead of the actual findings — and would
23
+ retry blind. The reasons now land on the channel the runtime actually shows, so a
24
+ blocked message comes back with the specific quality findings to fix.
25
+
26
+ Added a Mandates tab to the dashboard — the operator's surface for the coordination
27
+ permission slips. It lists every issued mandate with live authorship verification and
28
+ state, provides PIN-gated forms to issue a new mandate or revoke an existing one, and
29
+ shows the tamper-evident decision audit with its chain status. The PIN is typed at
30
+ action time, sent once, and cleared immediately — it is never stored anywhere in the
31
+ browser. Also backfilled the agent-awareness sections for the three coordination
32
+ surfaces into existing agents' instruction files on update, so agents updated in
33
+ place learn these capabilities exist (previously only freshly-initialized agents got
34
+ them).
35
+
36
+ Gave the cutover-readiness live-comparison trigger a realistic time budget. A real
37
+ comparison downloads the full live dataset and takes a few minutes; the default
38
+ 30-second request limit cut off every response mid-run, and a late failure then
39
+ crashed the response handling with no record of what happened. The trigger now has
40
+ a six-minute budget, and whatever the outcome — recorded or failed — it is always
41
+ written to the server log, even if the caller's connection already timed out.
42
+
43
+ ## What to Tell Your User
44
+
45
+ Gemini can now get past the specific Instar package install prompt that was
46
+ blocking mentor cycles. If Gemini asks to run an arbitrary command, Instar will
47
+ not approve it automatically. It rejects the known approval prompt and leaves a
48
+ visible record of the command it refused, so the mentor can see why the task
49
+ changed course.
50
+
51
+ Your agent's pre-send quality check now explains itself. If it holds a message
52
+ back, the agent sees exactly why and revises, instead of appearing to hit a
53
+ mysterious error.
54
+
55
+ Your dashboard now has a Mandates tab where you manage the permission slips for
56
+ autonomous agent-to-agent work: see every slip and whether its authorship still
57
+ verifies, issue a new one with your PIN, tear one up with your PIN, and read the
58
+ tamper-evident log of every allowed and denied action under them. Your PIN is asked
59
+ for right when you act and is never remembered by the page.
60
+
61
+ Nothing changes day to day. If your agent runs live data comparisons for a
62
+ migration, those checks now finish reliably instead of getting cut off, and their
63
+ results always show up in the logs.
64
+
65
+ ## Summary of New Capabilities
66
+
67
+ - Auto-answer the narrow Gemini package-runner install confirmation for Instar
68
+ package versions.
69
+ - Auto-reject Gemini execution-approval modals with an explicit reject option.
70
+ - Record execution auto-rejects visibly so mentor diagnosis does not depend on
71
+ guessing from a stalled terminal.
72
+
73
+ - Blocked outbound messages surface their quality findings to the agent instead
74
+ of an opaque hook error.
75
+ - Maturity: stable; the gate's judgments are unchanged — only their visibility.
76
+
77
+ - See all coordination mandates with live authorship-verification badges and
78
+ active/revoked/expired state at a glance.
79
+ - Issue a mandate from a form (pre-filled with the standard two-authority shape) —
80
+ PIN required, typed at issuance, never stored.
81
+ - Revoke any active mandate inline with a reason — PIN required.
82
+ - Read the hash-chained decision audit; a broken chain is flagged loudly as possible
83
+ tampering.
84
+ - Existing agents now learn the mandate, review-exchange, and cutover-readiness
85
+ surfaces via the update path, not just fresh installs.
86
+
87
+ - The live parity-comparison trigger completes within a realistic six-minute
88
+ budget instead of being cut off at thirty seconds.
89
+ - Comparison outcomes are always logged server-side, even when the requester's
90
+ connection timed out first.
91
+ - Maturity: stable; no other route's timing changes.
92
+
93
+ ## Evidence
94
+
95
+ Not reproducible in a live dev shell without driving Gemini into the exact
96
+ interactive modal, but covered by deterministic unit fixtures from the captured
97
+ terminal shapes:
98
+
99
+ - package-runner install prompt for `instar@1.3.270` auto-dismisses with Enter;
100
+ - arbitrary package-runner install prompt does not auto-dismiss;
101
+ - execution-approval modal with highlighted Allow once still auto-rejects;
102
+ - rejected execution command text is carried in the detected prompt metadata.
@@ -0,0 +1,86 @@
1
+ # Side-effects Review: Gemini Modal Safe Rejects
2
+
3
+ ## Change
4
+
5
+ This Tier-1 change extends the existing Prompt Gate deterministic modal path.
6
+ It does not introduce a new policy engine or a new execution surface.
7
+
8
+ Touched surfaces:
9
+
10
+ - `src/monitoring/PromptGate.ts`: adds narrow Gemini CLI matchers for the
11
+ observed `npx instar@... Ok to proceed? (y)` install prompt and for Gemini
12
+ execution-approval modals with an explicit reject option.
13
+ - `src/commands/server.ts`: logs execution auto-rejects before sending the
14
+ reject key, and reports them through `DegradationReporter`.
15
+ - `tests/unit/PromptGate.test.ts`: covers the install-confirm match and
16
+ near-miss, plus the execution-approval reject boundary.
17
+
18
+ ## Overreach / Underreach
19
+
20
+ The install matcher is deliberately under-broad. It accepts only the captured
21
+ package-runner shape for `instar@x.y.z`, because the live miss was `instar`
22
+ itself. It does not auto-answer unrelated package installs such as `left-pad`.
23
+
24
+ The execution matcher is also narrow. It only auto-rejects when the terminal
25
+ shows the known `Allow execution of:` modal and a reject option. If the UI shape
26
+ changes or the reject option is missing, normal relay/classification remains the
27
+ fallback. There is no auto-approve path.
28
+
29
+ ## Safety Boundary
30
+
31
+ Install confirmations and execution approvals are not the same class.
32
+
33
+ An `npx instar@... Ok to proceed? (y)` prompt confirms the package runner's
34
+ default for an Instar command the agent already invoked. Accepting it unblocks
35
+ the intended tool path.
36
+
37
+ An execution-approval prompt asks whether arbitrary command text may run. The
38
+ command can be malformed, unrelated to the task, or unsafe. The live Gemini
39
+ cycle proved this with a shell-comment command. Auto-approving that class would
40
+ turn model output into code execution. This change therefore only supports
41
+ safe-reject for execution approvals.
42
+
43
+ ## Observability
44
+
45
+ Auto-rejects are intentionally visible. Before sending the reject key, the
46
+ server writes a `[PromptGate] Auto-rejected execution approval...` warning with
47
+ the rejected command text and emits a `PromptGate.executionApprovalAutoReject`
48
+ DegradationReporter event.
49
+
50
+ This is not just debugging convenience. It is part of the safety design: when a
51
+ mentee appears to stall or pivot, the mentor can see that the framework rejected
52
+ an execution prompt and why.
53
+
54
+ ## Signal vs Authority
55
+
56
+ The new matchers are deterministic authority only for two tightly-scoped UI
57
+ shapes:
58
+
59
+ - safe-default for `instar@...` package-runner install confirmation;
60
+ - safe-reject for Gemini execution approval with an explicit reject option.
61
+
62
+ Everything else remains signal for the existing Prompt Gate relay/classifier
63
+ flow. The change does not add an LLM prompt filter, does not broaden yes/no
64
+ auto-approval, and does not treat generic `Ok to proceed?` text as authority.
65
+
66
+ ## Adjacent Systems
67
+
68
+ - Telegram/Slack prompt relay: unchanged for prompts that do not match the new
69
+ exact shapes.
70
+ - AutoApprover: unchanged. Execution safe-reject uses the pre-classifier
71
+ auto-dismiss path, not the auto-approve path.
72
+ - DegradationReporter: receives one observable event per execution auto-reject.
73
+ The event is intentional and mentor-facing; it should not be treated as a
74
+ failure of Prompt Gate.
75
+
76
+ ## Rollback
77
+
78
+ Revert the three code/test changes and remove these upgrade artifacts. Runtime
79
+ state does not need migration. Existing agents would return to relaying or
80
+ waiting on these Gemini prompts.
81
+
82
+ ## Verification
83
+
84
+ - `npm test -- --run tests/unit/PromptGate.test.ts` passed, 57 tests.
85
+ - `npx tsc --noEmit` passed.
86
+
@@ -0,0 +1,33 @@
1
+ # Side-effects review — grounding hook block-output → STDERR
2
+
3
+ Live incident (2026-06-05): the message-quality gate (convergence check inside the
4
+ grounding-before-messaging PreToolUse hook) correctly BLOCKED several outbound
5
+ messages — but wrote the findings + block banner to STDOUT. On a PreToolUse exit-2
6
+ block, Claude Code surfaces ONLY STDERR, so every block rendered to the agent as
7
+ "hook error ... No stderr output": a malfunction instead of a verdict. The agent
8
+ (me) retried blind several times before diagnosing via direct hook invocation.
9
+
10
+ ## 1. The change
11
+
12
+ Both copies of the hook source (the `src/templates/hooks/` init-time file AND the
13
+ inline `PostUpdateMigrator.getGroundingBeforeMessaging()` that migrateHooks
14
+ always-overwrites onto every agent) now route the block findings + banner to
15
+ STDERR. The pass path (GROUNDED on stdout, exit 0) is unchanged.
16
+
17
+ ## 2. Migration parity
18
+
19
+ Built-in hooks in `.instar/hooks/instar/` are ALWAYS overwritten on every
20
+ migration run — the fix reaches every deployed agent automatically on the next
21
+ update; no new migration code needed.
22
+
23
+ ## 3. Blast radius
24
+
25
+ Two-line behavioral change inside an existing block branch. The gate's
26
+ DECISIONS are untouched — only where the explanation lands. No config, routes,
27
+ or schema.
28
+
29
+ ## 4. Test coverage
30
+
31
+ 6 tests (3 × both template copies via describe.each): block → exit 2 + findings
32
+ on STDERR with stdout clean; pass → exit 0 + GROUNDED on stdout; non-messaging
33
+ input untouched. Run against the REAL hook sources with a stubbed quality check.
@@ -0,0 +1,30 @@
1
+ # Side-effects review — parity-pass request-timeout fix
2
+
3
+ Live finding (2026-06-05, first real trigger of the just-deployed G2.4 surface): a
4
+ real parity pass fetches the FULL live Portal cluster set and takes ~3.5 minutes
5
+ (measured 204s). The 30s default request timeout 408'd every trigger; the handler
6
+ kept running, and a late failure's 409 crashed into ERR_HTTP_HEADERS_SENT with no
7
+ trace of the outcome anywhere.
8
+
9
+ ## 1. The change
10
+
11
+ - `middleware.ts`: `PARITY_PASS_TIMEOUT_MS = 360_000` + a `buildRequestTimeoutOverrides`
12
+ entry for `/cutover-readiness/parity-pass` — the exact `/spec/conformance-check`
13
+ precedent (single heavy call, per-path budget). Longest-prefix matching means the
14
+ read-only `GET /cutover-readiness` sibling keeps the 30s default (tested).
15
+ - `routes.ts` (trigger route): the outcome is now ALWAYS logged server-side
16
+ (recorded/failed + reason), and the response is skipped when `res.headersSent`
17
+ (a 408 already went out) — never a double-respond crash, never a silent outcome.
18
+
19
+ ## 2. Blast radius
20
+
21
+ Two files, additive. No other route's budget changes. T7 unchanged: the trigger
22
+ still computes server-side; failures still record nothing.
23
+
24
+ ## 3. Test coverage
25
+
26
+ 5 new tests: override resolves for the trigger (≥ the measured real-pass duration)
27
+ and ONLY the trigger; over real HTTP with a tiny budget — a slow SUCCESSFUL pass
28
+ still records after the 408 with the outcome logged and no crash; a slow FAILED
29
+ pass records nothing with the reason logged; the fast path still 200s. Existing
30
+ override wiring suite green (20 total).
@@ -1,36 +0,0 @@
1
- # Upgrade Guide — vNEXT
2
-
3
- <!-- assembled-by: assemble-next-md -->
4
- <!-- bump: patch -->
5
-
6
- ## What Changed
7
-
8
- Added a Mandates tab to the dashboard — the operator's surface for the coordination
9
- permission slips. It lists every issued mandate with live authorship verification and
10
- state, provides PIN-gated forms to issue a new mandate or revoke an existing one, and
11
- shows the tamper-evident decision audit with its chain status. The PIN is typed at
12
- action time, sent once, and cleared immediately — it is never stored anywhere in the
13
- browser. Also backfilled the agent-awareness sections for the three coordination
14
- surfaces into existing agents' instruction files on update, so agents updated in
15
- place learn these capabilities exist (previously only freshly-initialized agents got
16
- them).
17
-
18
- ## What to Tell Your User
19
-
20
- Your dashboard now has a Mandates tab where you manage the permission slips for
21
- autonomous agent-to-agent work: see every slip and whether its authorship still
22
- verifies, issue a new one with your PIN, tear one up with your PIN, and read the
23
- tamper-evident log of every allowed and denied action under them. Your PIN is asked
24
- for right when you act and is never remembered by the page.
25
-
26
- ## Summary of New Capabilities
27
-
28
- - See all coordination mandates with live authorship-verification badges and
29
- active/revoked/expired state at a glance.
30
- - Issue a mandate from a form (pre-filled with the standard two-authority shape) —
31
- PIN required, typed at issuance, never stored.
32
- - Revoke any active mandate inline with a reason — PIN required.
33
- - Read the hash-chained decision audit; a broken chain is flagged loudly as possible
34
- tampering.
35
- - Existing agents now learn the mandate, review-exchange, and cutover-readiness
36
- surfaces via the update path, not just fresh installs.