instar 1.3.58 → 1.3.59
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 +28 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +8 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/MessagingToneGate.d.ts +20 -0
- package/dist/core/MessagingToneGate.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.js +12 -1
- package/dist/core/MessagingToneGate.js.map +1 -1
- package/dist/core/TopicIntentArcCheck.d.ts +15 -0
- package/dist/core/TopicIntentArcCheck.d.ts.map +1 -1
- package/dist/core/TopicIntentArcCheck.js +41 -0
- package/dist/core/TopicIntentArcCheck.js.map +1 -1
- package/dist/core/types.d.ts +10 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/server/AgentServer.d.ts +3 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +2 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/routes.d.ts +5 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +26 -0
- package/dist/server/routes.js.map +1 -1
- package/dist/server/topicIntentRoutes.d.ts +10 -4
- package/dist/server/topicIntentRoutes.d.ts.map +1 -1
- package/dist/server/topicIntentRoutes.js +3 -1
- package/dist/server/topicIntentRoutes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +47 -47
- package/upgrades/1.3.59.md +71 -0
- package/upgrades/side-effects/topic-intent-arccheck-wiring.md +101 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Side-effects review — topic-intent ArcCheck wiring (Layer 3)
|
|
2
|
+
|
|
3
|
+
Spec: `docs/specs/topic-intent-arccheck-wiring.md` (approved by justin 2026-05-28).
|
|
4
|
+
|
|
5
|
+
## What this change does
|
|
6
|
+
|
|
7
|
+
Wires the topic-intent ArcCheck (Layer 3) classifier, which existed but was
|
|
8
|
+
never connected. Two dead spots are closed:
|
|
9
|
+
|
|
10
|
+
1. `createTopicIntentRoutes` was constructed with no classifier, so the
|
|
11
|
+
`/topic-intent/:topicId/arccheck` route always returned a degrade-open
|
|
12
|
+
`{fire:false}` verdict.
|
|
13
|
+
2. No production caller invoked ArcCheck on the outbound path, so the agent
|
|
14
|
+
never got a signal when a draft contradicted a tracked ref.
|
|
15
|
+
|
|
16
|
+
Live evidence the gap was real: `arccheck_fired = 0` on every topic, including
|
|
17
|
+
topic 13481 (258 turns, 81 refs). The founding drift ("we need a second
|
|
18
|
+
machine" while a SETTLED ref said the mac-mini was already configured) is the
|
|
19
|
+
exact `contradicts-settled` verdict ArcCheck was designed to emit.
|
|
20
|
+
|
|
21
|
+
## Files changed (in-scope) and their blast radius
|
|
22
|
+
|
|
23
|
+
- `src/core/TopicIntentArcCheck.ts` — ADD `createArcCheckClassifyFn(intelligence, onDegrade)`.
|
|
24
|
+
Pure addition mirroring `createLlmExtractFn`. Degrade-safe: returns an empty
|
|
25
|
+
classification (→ `{fire:false}`) on no-intelligence or throw, so it can
|
|
26
|
+
never fire a false signal. Subscription transport (`model: 'fast'`,
|
|
27
|
+
attribution `TopicIntentArcCheck`). No existing export changed.
|
|
28
|
+
|
|
29
|
+
- `src/server/topicIntentRoutes.ts` — route now accepts an `arcCheck` ArcCheck
|
|
30
|
+
instance directly; KEEPS the legacy `arcCheckClassify` param (constructs a
|
|
31
|
+
per-route instance from it) so all pre-existing callers/tests keep working
|
|
32
|
+
unchanged. Backward-compatible; no behaviour change when neither is passed
|
|
33
|
+
(still degrade-open).
|
|
34
|
+
|
|
35
|
+
- `src/server/AgentServer.ts` — ADD optional `topicIntentArcCheck` to
|
|
36
|
+
`AgentServerOptions` + `RouteContext`; forward it into
|
|
37
|
+
`createTopicIntentRoutes`. Additive; null/undefined preserves prior behaviour.
|
|
38
|
+
|
|
39
|
+
- `src/server/routes.ts` — `checkOutboundMessage` now collects an ArcCheck
|
|
40
|
+
signal in-process (when `options.topicId` and `ctx.topicIntentArcCheck` are
|
|
41
|
+
both present) under a 200ms hard timeout via `Promise.race`. On timeout or
|
|
42
|
+
throw the signal is simply omitted — identical fail-skip shape to the
|
|
43
|
+
existing dedup detector. ArcCheck is SIGNAL-ONLY: it populates
|
|
44
|
+
`signals.arcCheck`; the MessagingToneGate retains all block authority. No
|
|
45
|
+
new block path. Delivery is never slowed (concurrent-eligible + bounded).
|
|
46
|
+
|
|
47
|
+
- `src/core/MessagingToneGate.ts` — ADD `arcCheck` field to `ToneReviewSignals`
|
|
48
|
+
+ render it in `renderSignals`. Only renders when `fire === true`. The gate
|
|
49
|
+
may fold the rewrite hint into its review; it does NOT gain a new block rule.
|
|
50
|
+
|
|
51
|
+
- `src/config/ConfigDefaults.ts` + `src/core/types.ts` — ADD
|
|
52
|
+
`topicIntent.arccheck.enabled` (default `true`). Migration parity: existing
|
|
53
|
+
agents pick it up via the canonical `applyDefaults` path in
|
|
54
|
+
`PostUpdateMigrator.migrateConfig` (existence-checked, idempotent). Kill
|
|
55
|
+
switch: `false` leaves the route mounted but the classifier dark and skips
|
|
56
|
+
the in-process call.
|
|
57
|
+
|
|
58
|
+
- `src/commands/server.ts` — construct ONE `ArcCheck` instance (gated on
|
|
59
|
+
`sharedIntelligence && topicIntent.arccheck.enabled`), reusing the same
|
|
60
|
+
queued-intelligence transport as the capture loop, declared at outer scope
|
|
61
|
+
so it reaches the `AgentServer` constructor. Sets
|
|
62
|
+
`globalThis.__instarTopicIntentArcCheckWired` for the wiring-integrity test.
|
|
63
|
+
|
|
64
|
+
## Failure modes considered
|
|
65
|
+
|
|
66
|
+
- **Outbound latency regression** — bounded by the 200ms `Promise.race`
|
|
67
|
+
timeout; ArcCheck runs concurrent-eligible with other signal collection and
|
|
68
|
+
is wrapped in try/catch. Worst case: the signal is absent and the gate
|
|
69
|
+
behaves exactly as today.
|
|
70
|
+
- **False block** — impossible by construction: ArcCheck is signal-only; the
|
|
71
|
+
tone gate has no new block rule keyed on `signals.arcCheck`.
|
|
72
|
+
- **Cost** — second always-on per-turn LLM path (capture being the first).
|
|
73
|
+
Bounded by the shared `LlmQueue` background lane + daily cap; degrades to a
|
|
74
|
+
no-op on cap breach.
|
|
75
|
+
- **Prompt injection** — `buildArcCheckPrompt` renders refs in a structured
|
|
76
|
+
block; the classifier is conservative-by-prompt and parse-tolerant
|
|
77
|
+
(`parseArcCheckResponse` returns empty arrays on malformed output).
|
|
78
|
+
|
|
79
|
+
## Migration parity
|
|
80
|
+
|
|
81
|
+
Server-side only. One new config default via the canonical defaults path. No
|
|
82
|
+
hook/template/skill/settings change. No `PostUpdateMigrator` surgery beyond the
|
|
83
|
+
config default.
|
|
84
|
+
|
|
85
|
+
## Rollback
|
|
86
|
+
|
|
87
|
+
Flip `topicIntent.arccheck.enabled = false` (classifier construction is gated;
|
|
88
|
+
in-process call is skipped). Code rollback: remove the AgentServer wire, the
|
|
89
|
+
classifier creator, and the `signals.arcCheck` channel — everything else
|
|
90
|
+
reverts to inert, as today.
|
|
91
|
+
|
|
92
|
+
## Tests
|
|
93
|
+
|
|
94
|
+
- Unit: `createArcCheckClassifyFn` degrade paths + transport attribution
|
|
95
|
+
(tests/unit/TopicIntent-arccheck.test.ts, +4).
|
|
96
|
+
- Unit: MessagingToneGate renders/omits the ArcCheck signal
|
|
97
|
+
(tests/unit/MessagingToneGate.test.ts, +2).
|
|
98
|
+
- E2E: mac-mini-drift regression pin + wiring-integrity source guards
|
|
99
|
+
(tests/e2e/topic-intent-arccheck-lifecycle.test.ts, new, 5 tests).
|
|
100
|
+
- All 7 pre-existing topic-intent test files remain green after the
|
|
101
|
+
backward-compatible route reshape.
|