instar 1.3.562 → 1.3.563
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 +30 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/core/inboundQueueConfig.d.ts +17 -0
- package/dist/core/inboundQueueConfig.d.ts.map +1 -1
- package/dist/core/inboundQueueConfig.js +16 -0
- package/dist/core/inboundQueueConfig.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.563.md +32 -0
- package/upgrades/side-effects/inbound-queue-boot-order-fix.md +72 -0
|
@@ -57,6 +57,23 @@ export declare const PROTOCOL_REDISPATCH_HORIZON_MAX_MS: number;
|
|
|
57
57
|
* safe to queue-OFF on violation, so a generous constant only tightens).
|
|
58
58
|
*/
|
|
59
59
|
export declare const BOOT_SWEEP_WINDOW_MS: number;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the Multi-Machine Session Pool rollout STAGE from a config block.
|
|
62
|
+
* Returns the configured `stage` string only when the pool is BOTH enabled AND
|
|
63
|
+
* carries a `stage`; otherwise 'dark' (the inert default). This is the single
|
|
64
|
+
* source of truth for "is the session pool active, and at what stage?" — both
|
|
65
|
+
* the boot-time inbound-queue construction gate AND the live `_sessionPoolStage`
|
|
66
|
+
* getter in server.ts resolve through this one pure function, so the two can
|
|
67
|
+
* never drift (the original divergence is exactly what let the construction gate
|
|
68
|
+
* read a stale stub and keep the inbound queue dark forever — boot-order bug).
|
|
69
|
+
*
|
|
70
|
+
* @param cfg the resolved `multiMachine.sessionPool` block (liveConfig override
|
|
71
|
+
* merged over the static config block, or just the static block at boot).
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveSessionPoolStage(cfg: {
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
stage?: string;
|
|
76
|
+
} | null | undefined): string;
|
|
60
77
|
/** Σbackoff: total worst-case backoff across maxAttempts (capped curve). */
|
|
61
78
|
export declare function sumBackoffMs(cfg: Pick<InboundQueueConfig, 'baseBackoffMs' | 'maxBackoffMs' | 'maxAttempts'>): number;
|
|
62
79
|
/** The full redispatch horizon a receipt must outlive (§3.4 receipt floor). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inboundQueueConfig.d.ts","sourceRoot":"","sources":["../../src/core/inboundQueueConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,0BAA0B,EAAE,MAAM,CAAC;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,E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kB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,CAAC,EAAE,kBAAkB,EACrB,CAAC,EAAE,sBAAsB,GACxB;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAkEnD"}
|
|
@@ -55,6 +55,22 @@ export const PROTOCOL_REDISPATCH_HORIZON_MAX_MS = 12 * 60 * 60 * 1000; // 12h
|
|
|
55
55
|
* safe to queue-OFF on violation, so a generous constant only tightens).
|
|
56
56
|
*/
|
|
57
57
|
export const BOOT_SWEEP_WINDOW_MS = 5 * 60 * 1000; // 5 min
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the Multi-Machine Session Pool rollout STAGE from a config block.
|
|
60
|
+
* Returns the configured `stage` string only when the pool is BOTH enabled AND
|
|
61
|
+
* carries a `stage`; otherwise 'dark' (the inert default). This is the single
|
|
62
|
+
* source of truth for "is the session pool active, and at what stage?" — both
|
|
63
|
+
* the boot-time inbound-queue construction gate AND the live `_sessionPoolStage`
|
|
64
|
+
* getter in server.ts resolve through this one pure function, so the two can
|
|
65
|
+
* never drift (the original divergence is exactly what let the construction gate
|
|
66
|
+
* read a stale stub and keep the inbound queue dark forever — boot-order bug).
|
|
67
|
+
*
|
|
68
|
+
* @param cfg the resolved `multiMachine.sessionPool` block (liveConfig override
|
|
69
|
+
* merged over the static config block, or just the static block at boot).
|
|
70
|
+
*/
|
|
71
|
+
export function resolveSessionPoolStage(cfg) {
|
|
72
|
+
return cfg?.enabled && cfg?.stage ? String(cfg.stage) : 'dark';
|
|
73
|
+
}
|
|
58
74
|
/** Σbackoff: total worst-case backoff across maxAttempts (capped curve). */
|
|
59
75
|
export function sumBackoffMs(cfg) {
|
|
60
76
|
let sum = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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C,IAAI,CAAC;YACL,SAAS,EAAE,CAAC;YACZ,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,yBAAyB,CAAC,CAAC,oBAAoB,gDAAgD,kCAAkC,GAAG;SAC9I,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
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-14T11:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-06-14T11:52:44.425Z",
|
|
5
|
+
"instarVersion": "1.3.563",
|
|
6
6
|
"entryCount": 201,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Fixed a boot-ordering bug that meant the **Durable Inbound Message Queue** (`multiMachine.sessionPool.inboundQueue`) could NEVER construct its engine, regardless of config. In `startServer()`, the queue-engine construction gate read the module-level `_sessionPoolStage()` getter while it was still its initial stub (`() => 'dark'`) — the real liveConfig-reading implementation is only assigned ~350 lines further down the same synchronous boot flow. So the gate's `_sessionPoolStage() !== 'dark'` test was always false at construction time, the engine never built, and `GET /pool/queue` answered 503 forever even with the feature enabled and a non-dark session-pool stage. The feature ships dark/dry-run by default, so the fleet never hit this; it only bites the first agent to enable it for real.
|
|
9
|
+
|
|
10
|
+
The fix resolves the stage INLINE at the construction site, reading the same `multiMachine.sessionPool` config (liveConfig override over the static block) via a new shared pure helper `resolveSessionPoolStage(cfg)` in `src/core/inboundQueueConfig.ts`, instead of consulting the not-yet-wired ref. The live `_sessionPoolStage` getter is refactored to call the same helper, so the two stage readers can never drift apart again (that drift was the root cause). No new capability, config key, HTTP route, or authority — purely a correction to WHEN an existing decision is read.
|
|
11
|
+
|
|
12
|
+
audience: agent-only
|
|
13
|
+
maturity: stable
|
|
14
|
+
|
|
15
|
+
A no-deferrals audit of all five `_sessionPoolStage()` call sites confirmed exactly one genuinely-premature boot-time read (the construction gate). The three runtime-handler reads (`wireTelegramRouting` x2, the `onAccepted` forwarded-message callback) are correct as-is: they execute per-message AFTER boot and close over the ref, so they see the wired implementation when invoked.
|
|
16
|
+
|
|
17
|
+
## What to Tell Your User
|
|
18
|
+
|
|
19
|
+
Nothing to announce proactively — the inbound queue ships disabled by default, so for any agent that hasn't deliberately turned it on, nothing changes. If asked: the crash-proof holding area for messages that arrive while a conversation is mid-move between machines had a startup bug that kept it from ever turning on; it now starts correctly when enabled. For a developer agent running it live, the queue's status page now returns real data instead of "not available." Every error path still fails toward off (no queue), which is identical to the shipped default.
|
|
20
|
+
|
|
21
|
+
## Summary of New Capabilities
|
|
22
|
+
|
|
23
|
+
No new capability — a latent behavior-correctness fix restoring intended behavior.
|
|
24
|
+
|
|
25
|
+
| Change | Effect |
|
|
26
|
+
|--------|--------|
|
|
27
|
+
| Inbound-queue construction gate reads stage inline | The queue engine constructs when `inboundQueue.enabled=true` + a non-dark `sessionPool` stage (was: never) |
|
|
28
|
+
| `resolveSessionPoolStage(cfg)` shared helper | Single source of truth for the pool stage; boot gate + live getter can no longer drift |
|
|
29
|
+
|
|
30
|
+
## Evidence
|
|
31
|
+
|
|
32
|
+
Behavior-correctness fix; reproduced by code-read on `JKHeadley/main` and pinned by a fails-before/passes-after structural regression guard. `tests/unit/inbound-queue-boot-order.test.ts` (5) asserts the construction gate no longer calls the stub getter, resolves inline before gating, routes both readers through the shared helper, and leaves the stub declaration intact (4 of 5 assertions fail against pre-fix `server.ts`; all 5 pass against the fix). `tests/unit/resolve-session-pool-stage.test.ts` (5) covers both sides of the stage-resolution boundary (enabled+stage→stage; disabled/missing→dark). The existing `tests/integration/inbound-queue-route.test.ts` and `tests/e2e/inbound-queue-lifecycle.test.ts` already prove a constructed engine serves a real 200 on `/pool/queue`. `npx tsc --noEmit` clean; full lint + dark-gate (24/24, line-map unchanged) + no-silent-fallbacks (baseline 474 unchanged) + feature-delivery-completeness + route-completeness green.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Side-Effects Review — Inbound-Queue Boot-Order Fix
|
|
2
|
+
|
|
3
|
+
**Tier:** 1 (latent behavior-correctness fix restoring intended behavior — no new capability, no new config key, no new route, no new authority). **Parent principle:** Structure > Willpower / feature-is-alive — a feature that can never construct is a broken feature; this restores the intended construction path and pins it with a regression guard.
|
|
4
|
+
**Files:** src/commands/server.ts, src/core/inboundQueueConfig.ts, tests/unit/resolve-session-pool-stage.test.ts (new), tests/unit/inbound-queue-boot-order.test.ts (new)
|
|
5
|
+
|
|
6
|
+
## The bug
|
|
7
|
+
|
|
8
|
+
The Durable Inbound Message Queue (`multiMachine.sessionPool.inboundQueue`, spec `docs/specs/durable-inbound-message-queue.md`) NEVER constructed its engine, regardless of correct config, because of a boot-ordering bug in `src/commands/server.ts`:
|
|
9
|
+
|
|
10
|
+
- `let _sessionPoolStage: () => string = () => 'dark';` — a module-level stub initialized to always return `'dark'`.
|
|
11
|
+
- The inbound-queue engine construction is gated `if (qcfg.enabled && _sessionPoolStage() !== 'dark') { … _inboundQueue = new QueueDrainLoop(…) … }`, running SYNCHRONOUSLY in the mesh boot block (`if (meshIdMgr && meshSelfId)`) inside `startServer()`.
|
|
12
|
+
- The ONLY reassignment of `_sessionPoolStage` to the real (liveConfig-reading) impl executes ~350 lines BELOW that construction site, also synchronously, in the same block.
|
|
13
|
+
|
|
14
|
+
At construction time the stub is still in force → `_sessionPoolStage()` returns `'dark'` → `'dark' !== 'dark'` is false → the engine never constructs. The same gate guards the `else if (_sweptInboundStore)` cleanup branch. Net: the feature has been inert since it shipped (it ships dark/dry-run by default, so nobody on the fleet hit it). `/pool/queue` returns 503 forever even with `inboundQueue.enabled=true` + a non-dark stage.
|
|
15
|
+
|
|
16
|
+
## The no-deferrals audit — every `_sessionPoolStage()` call site
|
|
17
|
+
|
|
18
|
+
Grepped ALL uses of `_sessionPoolStage` in `src/commands/server.ts`. Verdict for each:
|
|
19
|
+
|
|
20
|
+
| Line (main) | Context | Runs synchronously at boot before the ~16045 reassignment? | Verdict |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| ~443 | `let _sessionPoolStage = () => 'dark'` | n/a (the stub declaration) | the bug SOURCE — left in place by design (runtime handlers legitimately close over it) |
|
|
23
|
+
| ~1992 | inside `wireTelegramRouting` (the per-message inbound dispatch handler) | NO — invoked per-message at runtime, after boot; closes over the ref and sees the wired impl | FINE — not fixed |
|
|
24
|
+
| ~2000 | inside `wireTelegramRouting` (same handler) | NO — same as above | FINE — not fixed |
|
|
25
|
+
| ~14434 | inside the `onAccepted` callback (fires when a forwarded mesh message arrives) | NO — runtime mesh-message handler; closes over the ref | FINE — not fixed |
|
|
26
|
+
| ~15694 | the inbound-queue engine CONSTRUCTION gate | **YES** — synchronous boot read, BEFORE the ~16045 reassignment | **BUGGY — FIXED** |
|
|
27
|
+
| ~16045 | the `_sessionPoolStage = () => {…}` reassignment to the real impl | n/a (the assignment itself; everything after it sees the wired impl) | FINE — refactored to use the shared helper |
|
|
28
|
+
|
|
29
|
+
Exactly ONE genuinely-premature boot-time read (15694). No sibling premature read left unfixed. The three runtime-handler reads (1992/2000/14434) are correct as-is — they execute only after boot, by which time the ref is wired; the `session-pool-activation-wiring.test.ts` structural test continues to assert those handlers use `_sessionPoolStage()`, and it stays green.
|
|
30
|
+
|
|
31
|
+
## What changed
|
|
32
|
+
|
|
33
|
+
1. **`src/core/inboundQueueConfig.ts`** — added a pure helper `resolveSessionPoolStage(cfg)` that returns the configured `stage` only when the pool is BOTH `enabled` AND carries a `stage`, else `'dark'`. This becomes the single source of truth for the stage decision, eliminating the hand-duplicated logic that let the two readers drift. No config types, defaults, or invariants changed.
|
|
34
|
+
2. **`src/commands/server.ts` (construction site, ~15694):** the gate now computes the stage INLINE — `const _sessionPoolStageNow = (() => { try { const live = liveConfig.get('multiMachine.sessionPool', fallback); return iqcMod.resolveSessionPoolStage(live); } catch { return 'dark'; } })();` — mirroring the ~16045 impl exactly (liveConfig override over the static config block), then gates on `qcfg.enabled && _sessionPoolStageNow !== 'dark'`. It no longer consults the not-yet-wired `_sessionPoolStage()` ref.
|
|
35
|
+
3. **`src/commands/server.ts` (the real getter, ~16045):** refactored to call the same `resolveSessionPoolStage` helper (dynamic-imported at that site, matching the file's existing dynamic-import pattern) instead of its own inline copy of the logic. Behavior identical; now DRY with the boot gate.
|
|
36
|
+
4. **Tests (new):** `tests/unit/resolve-session-pool-stage.test.ts` (5) proves the resolution logic on both sides of the decision boundary; `tests/unit/inbound-queue-boot-order.test.ts` (5) is the structural regression guard — it asserts the construction gate no longer reads the stub, resolves inline before gating, routes both readers through the shared helper, and leaves the stub declaration intact.
|
|
37
|
+
|
|
38
|
+
## Blast radius (activation, explicit)
|
|
39
|
+
|
|
40
|
+
- **Fleet = no-op.** The inbound queue ships `enabled: false` (and `dryRun: true` even when enabled) by default. No fleet agent's behavior changes: with the queue disabled, `qcfg.enabled` is false and the gate short-circuits before the stage is even consulted.
|
|
41
|
+
- **Any agent with `inboundQueue.enabled=true` AND `sessionPool` stage `!== 'dark'`** will now CONSTRUCT the queue engine where before it silently did not. `/pool/queue` flips from 503 to 200. For **Echo** this is the intended **no-dark-on-dev activation** — the dev agent enabling the feature live is the first real exercise of the construction path, which is exactly the path this fixes.
|
|
42
|
+
- **Multi-machine posture:** machine-local construction only. This is a behavior-correctness fix — it changes WHEN an existing local decision is read, not any cross-machine protocol, route, or mesh verb. A single-machine agent that hasn't enabled the queue is wholly unaffected.
|
|
43
|
+
- **No new authority surface.** The construction still requires the full existing gate chain (enabled + non-dark stage + the six config-seam invariants validated by `validateInboundQueueInvariants` + dry-run handling). Nothing about WHAT the queue is allowed to do changed.
|
|
44
|
+
|
|
45
|
+
## Risk + mitigation
|
|
46
|
+
|
|
47
|
+
- **Risk:** the inline read disagrees with the live getter (the same drift class that caused the bug). **Mitigation:** both now call the single `resolveSessionPoolStage` helper — there is no second copy of the logic to drift. Pinned by `inbound-queue-boot-order.test.ts` (asserts ≥2 helper callsites) + `resolve-session-pool-stage.test.ts`.
|
|
48
|
+
- **Risk:** a config-read throw at the inline site crashes boot or builds a half-configured queue. **Mitigation:** the inline resolution is try/caught and fails to `'dark'` (the safe, queue-OFF direction = the shipped default), carrying an in-brace `@silent-fallback-ok` justification. Verified against `tests/unit/no-silent-fallbacks.test.ts` (baseline unchanged at 474).
|
|
49
|
+
- **Risk:** the fix accidentally activates the queue on the fleet. **Mitigation:** the `qcfg.enabled` half of the gate is untouched and still defaults false; the fix only corrects the stage half. Fleet default behavior is byte-identical.
|
|
50
|
+
|
|
51
|
+
## Migration parity
|
|
52
|
+
|
|
53
|
+
- No agent-installed files changed: no `.claude/settings.json` hooks, no `.instar/config.json` defaults, no CLAUDE.md template section, no hook scripts, no built-in skills. `resolveSessionPoolStage` is a pure code helper consumed only by `server.ts`. No `PostUpdateMigrator` change is needed — existing agents pick up the corrected construction path the moment their server runs the new code.
|
|
54
|
+
|
|
55
|
+
## Dark-gate line-map
|
|
56
|
+
|
|
57
|
+
- UNCHANGED. The change touches `src/core/inboundQueueConfig.ts` (a new pure function, no `enabled:` literal) and `src/commands/server.ts` (no `ConfigDefaults.ts` edit). The dark-gate attributor reads `src/core/ConfigDefaults.ts` only and matches `enabled:` lines; no such line shifted. Verified: `tests/unit/lint-dev-agent-dark-gate.test.ts` → 24/24 green, unchanged.
|
|
58
|
+
|
|
59
|
+
## Rollback
|
|
60
|
+
|
|
61
|
+
- Revert the two source edits (the inline resolution at the construction site + the helper call at the getter) and delete the helper + the two new test files. The queue reverts to never-constructing (the prior broken-but-inert state). Because the feature ships dark, the revert is a strict no-op on the fleet. No data migration, no durable-state change.
|
|
62
|
+
|
|
63
|
+
## Tests
|
|
64
|
+
|
|
65
|
+
- `tests/unit/resolve-session-pool-stage.test.ts` (5) — the stage-resolution logic: enabled+stage→stage; enabled+missing-stage→dark; disabled→dark; empty/null/undefined→dark; non-string stage coerced.
|
|
66
|
+
- `tests/unit/inbound-queue-boot-order.test.ts` (5) — the structural regression guard: the construction gate does not call the stub getter; resolves inline; resolution precedes the gate; both readers use the shared helper; the stub declaration is intact. Fails-before/passes-after verified (4 of 5 assertions fail against pre-fix `server.ts`; all 5 pass against the fix).
|
|
67
|
+
- Existing coverage already proves feature-alive: `tests/integration/inbound-queue-route.test.ts` (engine present → 200, absent → 503) and `tests/e2e/inbound-queue-lifecycle.test.ts` (boot-sweep → construct → drain → /pool/queue 200).
|
|
68
|
+
- Green locally: `npx tsc --noEmit` clean; the two new suites + `session-pool-activation-wiring` + `inbound-queue-route` + `inbound-queue-config` + `no-silent-fallbacks` + `feature-delivery-completeness` + `route-completeness` + `lint-dev-agent-dark-gate` (159 tests) all pass.
|
|
69
|
+
|
|
70
|
+
## Agent awareness
|
|
71
|
+
|
|
72
|
+
- No CLAUDE.md change. The inbound queue is already documented in the agent template ("Durable Inbound Message Queue + Hold-for-Stability"); this fix restores the documented behavior rather than adding a capability, so no `generateClaudeMd`/`migrateClaudeMd` change is required (feature-delivery-completeness green — no new tracked section). <!-- tracked: inbound-queue-boot-order-fix -->
|