instar 1.2.32 → 1.2.34
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +72 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +6 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/MessagingToneGate.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.js +30 -1
- package/dist/core/MessagingToneGate.js.map +1 -1
- package/dist/core/SessionManager.d.ts +7 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +23 -0
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/types.d.ts +30 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/monitoring/CompactionSentinel.d.ts +9 -0
- package/dist/monitoring/CompactionSentinel.d.ts.map +1 -1
- package/dist/monitoring/CompactionSentinel.js +9 -0
- package/dist/monitoring/CompactionSentinel.js.map +1 -1
- package/dist/monitoring/PresenceProxy.d.ts +9 -0
- package/dist/monitoring/PresenceProxy.d.ts.map +1 -1
- package/dist/monitoring/PresenceProxy.js +9 -0
- package/dist/monitoring/PresenceProxy.js.map +1 -1
- package/dist/monitoring/RateLimitSentinel.d.ts +140 -0
- package/dist/monitoring/RateLimitSentinel.d.ts.map +1 -0
- package/dist/monitoring/RateLimitSentinel.js +308 -0
- package/dist/monitoring/RateLimitSentinel.js.map +1 -0
- package/dist/monitoring/SessionWatchdog.d.ts +11 -0
- package/dist/monitoring/SessionWatchdog.d.ts.map +1 -1
- package/dist/monitoring/SessionWatchdog.js +47 -0
- package/dist/monitoring/SessionWatchdog.js.map +1 -1
- package/dist/monitoring/rateLimitDetection.d.ts +45 -0
- package/dist/monitoring/rateLimitDetection.d.ts.map +1 -0
- package/dist/monitoring/rateLimitDetection.js +71 -0
- package/dist/monitoring/rateLimitDetection.js.map +1 -0
- package/dist/server/AgentServer.d.ts +1 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +1 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +1 -0
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts +1 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +24 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +48 -48
- package/upgrades/1.2.33.md +57 -0
- package/upgrades/1.2.34.md +84 -0
- package/upgrades/side-effects/context-death-stop-hook.md +100 -0
- package/upgrades/side-effects/rate-limit-internal-prefix.md +41 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Side-effects review — context-death stop hook (B15 tone-gate rule)
|
|
2
|
+
|
|
3
|
+
**Scope**: Add `B15_CONTEXT_DEATH_STOP` to `MessagingToneGate`. The
|
|
4
|
+
operator explicitly asked for a structural guard against the agent's
|
|
5
|
+
recurring "Context-Death Self-Stop" pattern (CLAUDE.md anti-pattern,
|
|
6
|
+
multiple memory entries) because documentation alone has not eliminated
|
|
7
|
+
the slip.
|
|
8
|
+
|
|
9
|
+
**Files touched**:
|
|
10
|
+
- `src/core/MessagingToneGate.ts` — adds `'B15_CONTEXT_DEATH_STOP'` to
|
|
11
|
+
`VALID_RULES`; adds a new `## SELF-STOP rule` section in `buildPrompt`
|
|
12
|
+
describing literal pattern markers + legitimate-stop carve-outs;
|
|
13
|
+
updates the response-format rule list to include B15.
|
|
14
|
+
- `tests/unit/messaging-tone-gate-b15.test.ts` — 9 new tests covering
|
|
15
|
+
prompt-render assertions, drift-detection acceptance of B15,
|
|
16
|
+
propagation of a valid B15 response, and pass-through of completion /
|
|
17
|
+
blocker / topic-split candidates.
|
|
18
|
+
- `specs/dev-infrastructure/context-death-stop-hook.md` — converged +
|
|
19
|
+
approved (single-iteration; design intent authored by operator).
|
|
20
|
+
- `specs/dev-infrastructure/context-death-stop-hook.eli16.md` — plain-
|
|
21
|
+
English companion.
|
|
22
|
+
- `docs/specs/reports/context-death-stop-hook-convergence.md` — report.
|
|
23
|
+
|
|
24
|
+
**Under-block**: Narrow. The rule keys on the candidate message itself.
|
|
25
|
+
If the agent slips into the pattern in *internal* reasoning (thought
|
|
26
|
+
traces, plan files) but produces an outbound message that doesn't carry
|
|
27
|
+
any of the literal markers, B15 does not fire — exactly the boundary the
|
|
28
|
+
authority is supposed to enforce. That's correct: this is the outbound-
|
|
29
|
+
message authority, not a thought-monitor.
|
|
30
|
+
|
|
31
|
+
**Over-block**: Minimal by design. The rule has explicit
|
|
32
|
+
legitimate-stop carve-outs (real question, real blocker, real error,
|
|
33
|
+
real completion) AND explicit non-applicability boundaries (discussion-
|
|
34
|
+
about-the-pattern, topic-split/move logistics, operator-initiated stop
|
|
35
|
+
messages). The LLM gate is the existing authority that combines literal
|
|
36
|
+
markers with conversational context. Failure-mode: an LLM call timeout
|
|
37
|
+
or parse failure → fail-open (gate's existing semantics), so a network
|
|
38
|
+
hiccup never silences a legitimate message.
|
|
39
|
+
|
|
40
|
+
**Level-of-abstraction fit**: B15 lives where B1–B14 already live. No
|
|
41
|
+
new authority, no new file, no new endpoint. The structural placement
|
|
42
|
+
is sibling to existing rules, and the same drift-detection (rule
|
|
43
|
+
citation must be in `VALID_RULES`) governs it.
|
|
44
|
+
|
|
45
|
+
**Signal vs authority**: Compliant. The literal pattern markers in the
|
|
46
|
+
prompt are the SIGNAL; the LLM gate (the existing authority) decides
|
|
47
|
+
block/pass after combining markers with the legitimate-stop carve-outs
|
|
48
|
+
and conversational context. No new authority is introduced; no signal
|
|
49
|
+
becomes a blocker on its own.
|
|
50
|
+
|
|
51
|
+
**Interactions**:
|
|
52
|
+
- B15 does not change B1–B14 behavior. The drift-detection (any rule
|
|
53
|
+
cited must be in `VALID_RULES`) gains one entry; existing rules
|
|
54
|
+
remain valid.
|
|
55
|
+
- The fail-open paths (`failedOpen: true`, `invalidRule: true`) are
|
|
56
|
+
unchanged.
|
|
57
|
+
- All paths that call `MessagingToneGate.review()` automatically benefit
|
|
58
|
+
from B15 — no caller changes required. Tested implicitly by the
|
|
59
|
+
existing health-alert + attention-route tests passing without
|
|
60
|
+
modification.
|
|
61
|
+
|
|
62
|
+
**External surfaces**: None. No new API endpoint, no new config field,
|
|
63
|
+
no new CLI command, no change to the tone-gate's public type contract
|
|
64
|
+
(`ToneReviewResult` shape unchanged). The new rule id is observable on
|
|
65
|
+
the `result.rule` string, which already carries B1..B14 ids today.
|
|
66
|
+
|
|
67
|
+
**Migration parity**:
|
|
68
|
+
- No agent-installed file change. The tone gate runs on the agent's
|
|
69
|
+
server; existing agents pick up B15 the next time they update + the
|
|
70
|
+
server restarts.
|
|
71
|
+
- CLAUDE.md template (`generateClaudeMd` and `migrateClaudeMd`) — not
|
|
72
|
+
touched in this PR. The rule fires at message-send time regardless of
|
|
73
|
+
what the agent reads at session-start; a future PR can add a one-line
|
|
74
|
+
awareness note to the template, but it isn't load-bearing here (the
|
|
75
|
+
point of the structural guard is that the agent doesn't need to
|
|
76
|
+
remember).
|
|
77
|
+
|
|
78
|
+
**Rollback cost**: Trivial. Revert three files (Source edit + test +
|
|
79
|
+
spec triplet). The tone-gate behavior collapses to its pre-B15 state.
|
|
80
|
+
|
|
81
|
+
**Tests**: 9/9 new unit tests pass; 27/27 existing `MessagingToneGate`
|
|
82
|
+
tests still pass; 8/8 `messaging-tone-gate-health-alerts.test.ts` still
|
|
83
|
+
pass. `tsc --noEmit` clean. `npm run lint` clean.
|
|
84
|
+
|
|
85
|
+
**Decision-point inventory**:
|
|
86
|
+
1. LLM-gate rule (vs. regex hook) — chosen for the same reason the
|
|
87
|
+
existing tone gate uses LLM judgment: literal patterns under-block
|
|
88
|
+
on paraphrase and over-block on context (e.g., "we should pick this
|
|
89
|
+
up later *after lunch*" is fine).
|
|
90
|
+
2. Single-iteration converge (vs. full 4-internal + 3-external) — the
|
|
91
|
+
change is a single-rule extension to a well-defined existing
|
|
92
|
+
authority with the operator-authored design intent in the topic-9984
|
|
93
|
+
conversation; the full converge ceremony is calibrated for new
|
|
94
|
+
subsystems. The rule is unit-testable in isolation and reversible
|
|
95
|
+
trivially; if the operator wants the full ceremony for parity it
|
|
96
|
+
can be a follow-up.
|
|
97
|
+
3. Drop "regex pre-filter" optimization — adding a regex pre-check
|
|
98
|
+
before the LLM call would skip cheap-pass cases but introduces a
|
|
99
|
+
second authority on the same decision, contradicting the gate's
|
|
100
|
+
signal-vs-authority discipline. Rejected.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Side-Effects Review — `/rate-limit` registered in `INTERNAL_PREFIXES`
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `rate-limit-internal-prefix`
|
|
4
|
+
**Date:** 2026-05-22
|
|
5
|
+
**Author:** echo
|
|
6
|
+
**Trigger:** CI shard 1/4 (Node 20 + 22) deterministic failure in `tests/unit/capabilities-discoverability.test.ts:122` — the discoverability lint requires every route prefix in `routes.ts` to be either claimed by `CAPABILITY_INDEX` (agent-discoverable) or allowlisted in `INTERNAL_PREFIXES` (intentionally hidden). My PR added `GET /rate-limit/status` to `routes.ts` but did not classify the new `rate-limit` prefix.
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
One-line addition to `INTERNAL_PREFIXES` in `src/server/CapabilityIndex.ts`:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
{ prefix: 'rate-limit', reason: 'operator-only rate-limit-sentinel observability — agent-facing surface is the sentinel’s own notices' },
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This matches the exact pattern of five sibling sentinel/observability prefixes already in `INTERNAL_PREFIXES`:
|
|
17
|
+
- `quota` — operator-only quota observability
|
|
18
|
+
- `watchdog` — operator-only watchdog state
|
|
19
|
+
- `prompt-gate` — operator-only prompt-gate observability
|
|
20
|
+
- `delivery-queue` — operator-only relay queue observability
|
|
21
|
+
- `scope-coherence` — operator-only scope-coherence observability
|
|
22
|
+
|
|
23
|
+
## Decision-point inventory
|
|
24
|
+
|
|
25
|
+
**Choice:** `INTERNAL_PREFIXES` vs. `CAPABILITY_INDEX`.
|
|
26
|
+
|
|
27
|
+
Picked `INTERNAL_PREFIXES`. Reasoning: `GET /rate-limit/status` is read-only observability with no agent-facing action. The agent-facing surface of the rate-limit feature is the sentinel's **proactive** Telegram notices ("backing off", "still throttled", "back online", "still can't get through"). An agent doesn't poll `/rate-limit/status` — the sentinel pushes information to the user. Every sibling sentinel observability route makes the same choice for the same reason.
|
|
28
|
+
|
|
29
|
+
## 1–7. Analysis
|
|
30
|
+
|
|
31
|
+
1. **Over-block.** Hiding `/rate-limit/status` from `/capabilities` discovery — could that suppress a real agent capability? No. The route returns status data only; there's no agent action to invoke. The capability the agent has is "the sentinel will message me when a throttle hits"; that's surfaced through the sentinel's notifications, not through a route the agent reads.
|
|
32
|
+
2. **Under-block.** Could marking it internal silently swallow a future agent-facing route under the same prefix? `/rate-limit/*` is one operator-only route today. If a future change adds a genuinely agent-facing `/rate-limit/<action>`, that change would need to either split the prefix or move the entry to `CAPABILITY_INDEX` — and the discoverability lint will catch it because every new route is enumerated and re-classified.
|
|
33
|
+
3. **Level-of-abstraction fit.** The deny-allowlist (`INTERNAL_PREFIXES`) is exactly the layer the lint reads. No other layer would fix the lint.
|
|
34
|
+
4. **Signal-vs-authority compliance.** This is a classification (signal), not a behavioral gate (authority). The route still behaves identically. The change shapes what `/capabilities` includes; nothing else.
|
|
35
|
+
5. **Interactions.** Zero coupling to other allowlist entries. The lint operates per-prefix; adding one entry can't affect the classification of another.
|
|
36
|
+
6. **Rollback cost.** Trivial — one-line removal. The route would then surface as unclassified and the lint would block again, signalling the rollback to whoever ran it.
|
|
37
|
+
7. **Test coverage.** Covered by the existing 85-test `capabilities-discoverability.test.ts` suite, which dynamically generates one test per route prefix. The lint that caught this on CI is the same lint that now passes for `rate-limit`.
|
|
38
|
+
|
|
39
|
+
## Rollback
|
|
40
|
+
|
|
41
|
+
Remove the single line from `INTERNAL_PREFIXES` in `src/server/CapabilityIndex.ts`. CI will immediately re-fail with the same error message that triggered this fix.
|