instar 1.3.50 → 1.3.52
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 +12 -3
- package/dist/commands/server.js.map +1 -1
- package/dist/server/AgentServer.d.ts +2 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +86 -7
- 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/middleware.d.ts.map +1 -1
- package/dist/server/middleware.js +4 -1
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/routes.d.ts +4 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +74 -0
- package/dist/server/routes.js.map +1 -1
- package/dist/threadline/hubCommands.d.ts +8 -0
- package/dist/threadline/hubCommands.d.ts.map +1 -1
- package/dist/threadline/hubCommands.js +25 -5
- package/dist/threadline/hubCommands.js.map +1 -1
- package/dist/threadline/openConversationBrief.d.ts +100 -0
- package/dist/threadline/openConversationBrief.d.ts.map +1 -0
- package/dist/threadline/openConversationBrief.js +234 -0
- package/dist/threadline/openConversationBrief.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +47 -47
- package/upgrades/1.3.51.md +62 -0
- package/upgrades/1.3.52.md +39 -0
- package/upgrades/side-effects/a2a-inbox-http-transport.md +128 -0
- package/upgrades/side-effects/threadline-open-this-llm-naming.md +72 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Side-Effects Review — Threadline "open this" LLM topic-name + summary (CMT-567)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `threadline-open-this-llm-naming`
|
|
4
|
+
**Date:** `2026-05-27`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Spec:** `docs/specs/THREADLINE-OPEN-THIS-LLM-NAMING-SPEC.md` (converged 2-round / 4-reviewer, approved)
|
|
7
|
+
**Second-pass reviewer:** `not required` (UX continuation of #399, no new external surface; standard 2-round convergence applied)
|
|
8
|
+
|
|
9
|
+
## Summary of the change
|
|
10
|
+
|
|
11
|
+
When the deterministic "open this" intercept (CMT-529 / PR #399) promotes a Threadline
|
|
12
|
+
conversation into its own topic, the new topic is now named by an LLM (from the conversation
|
|
13
|
+
gist) and its first message is an LLM-written orientation summary. A three-tier degrade
|
|
14
|
+
guarantees the bind never fails on LLM trouble:
|
|
15
|
+
|
|
16
|
+
- **Tier A — LLM.** Real conversation (≥2 messages) → Haiku call using the proven PURPOSE-line
|
|
17
|
+
convention (reuses `parsePurposeFromResponse` from `TopicSummarizer`, NOT JSON). PURPOSE →
|
|
18
|
+
topic name; body → summary. Runs on the shared `interactive` LlmQueue lane (operator is
|
|
19
|
+
waiting), `costCents=2`, 3.5s race (timeout + queue-abort, since `intelligence.evaluate`
|
|
20
|
+
honors `timeoutMs` but not an AbortSignal).
|
|
21
|
+
- **Tier B — deterministic template.** LLM skipped/failed → `💬 Conversation with <peer> · N
|
|
22
|
+
messages · last activity <when>. Latest: "<scrubbed inbound>"`. Zero cost/latency.
|
|
23
|
+
- **Tier C — slug + legacy marker.** No backing conversation (hub-notice-only entry) → existing
|
|
24
|
+
slug name + the legacy "tied to this topic" marker. No LLM call attempted.
|
|
25
|
+
|
|
26
|
+
Files touched:
|
|
27
|
+
- `src/threadline/openConversationBrief.ts` (**add**) — the 3-tier generator. Pure compute; never throws; never returns empty.
|
|
28
|
+
- `src/threadline/hubCommands.ts` (modify) — `HubBindDeps.brief?: BriefDeps` (optional); `open` branch calls `generateConversationBrief`, posts `brief.summary` as the first message, adds the `[hub/bind] open …` observability log line. `tie` branch unchanged (still posts the tie-marker; brief NOT invoked).
|
|
29
|
+
- `src/commands/server.ts` (modify) — build ONE `briefDeps` after `collaborationSurfacer`; thread to both `getHubDeps` closures + the `AgentServer` ctor.
|
|
30
|
+
- `src/server/AgentServer.ts` (modify) — `briefDeps?` on options interface; `briefDeps: options.briefDeps ?? null` into routeCtx.
|
|
31
|
+
- `src/server/routes.ts` (modify) — `briefDeps` on `RouteContext`; `POST /threadline/hub/bind` passes `brief: ctx.briefDeps ?? undefined`.
|
|
32
|
+
- `tests/unit/threadline/openConversationBrief.test.ts` (**add**) — 19 cases.
|
|
33
|
+
- `tests/unit/hubCommands.test.ts` (modify) — +4 brief-path cases (LLM / template / Tier-C / tie-not-invoked).
|
|
34
|
+
- `tests/integration/threadline/hub-bind-routes.test.ts` (modify) — +3 cases (LLM happy path; LLM-throws → bind still 200 + template; intelligence:null → bind still 200).
|
|
35
|
+
- `upgrades/NEXT.md` (modify) — release note.
|
|
36
|
+
|
|
37
|
+
## Decision-point inventory
|
|
38
|
+
|
|
39
|
+
- `generateConversationBrief()` — **add** — three tiers; per-FIELD scrub-degrade (a credential in the PURPOSE degrades only the name, a credential in the body degrades only the summary). Never throws.
|
|
40
|
+
- Credential detection — **new, intentionally different from hubCommands.CREDENTIAL_RE.** `SECRET_VALUE_RE` (vendor-prefixed tokens / key blocks / JWT-ish) is applied to LLM output; `SECRET_ASSIGN_RE` (`password|secret|token|api_key… : value`) additionally guards the RAW inbound snippet. The bare-english-word regex used by the existing slug path would false-positive on normal technical prose ("token refresh", "API key rotation") and degrade most real summaries — so it is deliberately NOT reused for the prose summary. The existing slug-path `CREDENTIAL_RE` in `hubCommands.ts` is untouched.
|
|
41
|
+
- LlmQueue lane = `interactive` — operator is actively waiting; `background` would let a PresenceProxy arrival abort the in-flight brief (LlmQueue preempts only background victims).
|
|
42
|
+
- `HubBindDeps.brief` is OPTIONAL — when absent (existing callers / tests that don't wire it), the `open` path degrades to slug + legacy marker (exact pre-CMT-567 behavior). No back-compat break.
|
|
43
|
+
- `BriefDeps.topicNameFallback` is OPTIONAL — server-built `briefDeps` omits it (topicNameFor is private to hubCommands); `bindHubConversation` injects the real `topicNameFor` so the brief's slug matches the legacy path. A built-in `defaultSlug` guards direct callers.
|
|
44
|
+
- Single shared `briefDeps` (built once in server.ts) — closes the round-2 finding that the `POST /threadline/hub/bind` route had no scope path to `sharedLlmQueue`. One construction, three consumers (2 closures + ctx).
|
|
45
|
+
- Observability — one structured `console.log` per open: `nameSource / summarySource / latencyMs / reason`. Makes silent fallback diagnosable from `logs/server.log`.
|
|
46
|
+
|
|
47
|
+
## Blast radius / reversibility
|
|
48
|
+
|
|
49
|
+
- **Additive only.** `tie` path, the deterministic intercept itself, the parent-topic reply surfacing, and all other Threadline routing are untouched.
|
|
50
|
+
- **No state files, no migrations.** Pure compute module; no persisted artifacts; `PostUpdateMigrator` needs no entry (verified — no agent-installed file changes).
|
|
51
|
+
- **No new agent API.** The agent doesn't call this; it fires inside the operator-invoked "open this". No CLAUDE.md template change needed (Agent Awareness Standard N/A).
|
|
52
|
+
- **Rollback:** single revert of the commit restores slug-name + legacy-marker verbatim.
|
|
53
|
+
|
|
54
|
+
## Tests
|
|
55
|
+
|
|
56
|
+
- Unit (new module): 19 cases — all three tiers, every fallback cause, per-field credential scrub, technical-vocab-not-scrubbed, input truncation, never-empty invariant (incl. empty/whitespace threadId).
|
|
57
|
+
- Unit (hubCommands): +4 — LLM summary posted (not marker), LLM-throws → template, Tier-C marker, tie does not invoke brief.
|
|
58
|
+
- Integration (hub/bind route): +3 — LLM happy path names+summarizes; LLM-throws → 200 + template (regression guard: LLM failure NEVER fails the bind); intelligence:null → 200.
|
|
59
|
+
- Full threadline suite: 1580 passing, zero regressions. Production build clean (`tsc --noEmit` + `pnpm build`).
|
|
60
|
+
|
|
61
|
+
## Test-as-self (live, real LLM — completed 2026-05-27)
|
|
62
|
+
|
|
63
|
+
Two-stage, real-dependency validation (no mocks):
|
|
64
|
+
|
|
65
|
+
1. **Real-LLM harness (Echo's Claude provider, real threadline data).** Ran the BUILT `generateConversationBrief` against two real Echo threads with a real `ClaudeCliIntelligenceProvider`, real `LlmQueue`, real `ThreadlineObservability`. Produced clean LLM names + summaries (`reason: ok`). **This caught a production-breaking bug the mocks hid:** a real CLI call took ~8-10s, over the original 3.5s timeout — so the happy path would have silently fallen to the template in production. Fixed: default timeout 3.5s → 15s (+ word-boundary cap on the name so a long title doesn't read "…path resol"). Re-ran with the production default: `nameSource=llm`, ~9.7s, clean name "Arm the full response-review stack".
|
|
66
|
+
|
|
67
|
+
2. **Live deploy on a real peer agent (instar-codey, Codex/gpt-5.2).** Backed up Codey's shadow-install dist + hub state, deployed this build, restarted via launchd, drove a real `POST /threadline/hub/bind action:open` against a 4-message unbound hub conversation. Result: topic 680 created, `topicName="Mentor ledger dedup strategy"` (LLM, not slug), server log `[hub/bind] open threadId=f3d471e9 topic=680 nameSource=llm summarySource=llm` — proving briefDeps booted non-null and the real Codex LLM produced both fields through the live server. Cleaned up: deleted test topic 680 (Bot API), restored dist + hub state, restarted Codey onto the released build, verified f3d471e9 reverted to unbound.
|
|
68
|
+
|
|
69
|
+
## Post-test-as-self deviations (folded into this commit)
|
|
70
|
+
|
|
71
|
+
- Default `timeoutMs` 3.5s → **15s** (spec §3a updated with the measured rationale). The LLM tier is now the common outcome; template covers overruns.
|
|
72
|
+
- `scrubName` caps on a **word boundary** (no mid-word truncation in the chat-list title).
|