instar 1.3.91 → 1.3.93
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/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh +17 -0
- package/dashboard/index.html +108 -0
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +337 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +30 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/config/LiveConfig.d.ts +3 -1
- package/dist/config/LiveConfig.d.ts.map +1 -1
- package/dist/config/LiveConfig.js +4 -1
- package/dist/config/LiveConfig.js.map +1 -1
- package/dist/config/stageWriteGuard.d.ts +23 -0
- package/dist/config/stageWriteGuard.d.ts.map +1 -0
- package/dist/config/stageWriteGuard.js +33 -0
- package/dist/config/stageWriteGuard.js.map +1 -0
- package/dist/core/DeliverMessageHandler.d.ts +33 -0
- package/dist/core/DeliverMessageHandler.d.ts.map +1 -0
- package/dist/core/DeliverMessageHandler.js +34 -0
- package/dist/core/DeliverMessageHandler.js.map +1 -0
- package/dist/core/LeaseCoordinator.d.ts +39 -2
- package/dist/core/LeaseCoordinator.d.ts.map +1 -1
- package/dist/core/LeaseCoordinator.js +45 -9
- package/dist/core/LeaseCoordinator.js.map +1 -1
- package/dist/core/MachineIdentity.d.ts +28 -1
- package/dist/core/MachineIdentity.d.ts.map +1 -1
- package/dist/core/MachineIdentity.js +81 -1
- package/dist/core/MachineIdentity.js.map +1 -1
- package/dist/core/MachineLoadBroker.d.ts +94 -0
- package/dist/core/MachineLoadBroker.d.ts.map +1 -0
- package/dist/core/MachineLoadBroker.js +87 -0
- package/dist/core/MachineLoadBroker.js.map +1 -0
- package/dist/core/MachinePoolRegistry.d.ts +94 -0
- package/dist/core/MachinePoolRegistry.d.ts.map +1 -0
- package/dist/core/MachinePoolRegistry.js +150 -0
- package/dist/core/MachinePoolRegistry.js.map +1 -0
- package/dist/core/MeshRpc.d.ts +165 -0
- package/dist/core/MeshRpc.d.ts.map +1 -0
- package/dist/core/MeshRpc.js +156 -0
- package/dist/core/MeshRpc.js.map +1 -0
- package/dist/core/MeshRpcClient.d.ts +59 -0
- package/dist/core/MeshRpcClient.d.ts.map +1 -0
- package/dist/core/MeshRpcClient.js +58 -0
- package/dist/core/MeshRpcClient.js.map +1 -0
- package/dist/core/MultiMachineCoordinator.d.ts +11 -0
- package/dist/core/MultiMachineCoordinator.d.ts.map +1 -1
- package/dist/core/MultiMachineCoordinator.js +13 -0
- package/dist/core/MultiMachineCoordinator.js.map +1 -1
- package/dist/core/NicknameAssigner.d.ts +51 -0
- package/dist/core/NicknameAssigner.d.ts.map +1 -0
- package/dist/core/NicknameAssigner.js +91 -0
- package/dist/core/NicknameAssigner.js.map +1 -0
- package/dist/core/NicknameCommand.d.ts +28 -0
- package/dist/core/NicknameCommand.d.ts.map +1 -0
- package/dist/core/NicknameCommand.js +69 -0
- package/dist/core/NicknameCommand.js.map +1 -0
- package/dist/core/PlacementExecutor.d.ts +71 -0
- package/dist/core/PlacementExecutor.d.ts.map +1 -0
- package/dist/core/PlacementExecutor.js +156 -0
- package/dist/core/PlacementExecutor.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +21 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/RebalancePlanner.d.ts +48 -0
- package/dist/core/RebalancePlanner.d.ts.map +1 -0
- package/dist/core/RebalancePlanner.js +71 -0
- package/dist/core/RebalancePlanner.js.map +1 -0
- package/dist/core/SessionOwnership.d.ts +103 -0
- package/dist/core/SessionOwnership.d.ts.map +1 -0
- package/dist/core/SessionOwnership.js +0 -0
- package/dist/core/SessionOwnership.js.map +1 -0
- package/dist/core/SessionOwnershipRegistry.d.ts +115 -0
- package/dist/core/SessionOwnershipRegistry.d.ts.map +1 -0
- package/dist/core/SessionOwnershipRegistry.js +128 -0
- package/dist/core/SessionOwnershipRegistry.js.map +1 -0
- package/dist/core/SessionPoolE2EResultStore.d.ts +45 -0
- package/dist/core/SessionPoolE2EResultStore.d.ts.map +1 -0
- package/dist/core/SessionPoolE2EResultStore.js +66 -0
- package/dist/core/SessionPoolE2EResultStore.js.map +1 -0
- package/dist/core/SessionRouter.d.ts +95 -0
- package/dist/core/SessionRouter.d.ts.map +1 -0
- package/dist/core/SessionRouter.js +151 -0
- package/dist/core/SessionRouter.js.map +1 -0
- package/dist/core/StageAdvancer.d.ts +47 -0
- package/dist/core/StageAdvancer.d.ts.map +1 -0
- package/dist/core/StageAdvancer.js +70 -0
- package/dist/core/StageAdvancer.js.map +1 -0
- package/dist/core/TransferByNickname.d.ts +51 -0
- package/dist/core/TransferByNickname.d.ts.map +1 -0
- package/dist/core/TransferByNickname.js +50 -0
- package/dist/core/TransferByNickname.js.map +1 -0
- package/dist/core/TransferOrchestrator.d.ts +113 -0
- package/dist/core/TransferOrchestrator.d.ts.map +1 -0
- package/dist/core/TransferOrchestrator.js +79 -0
- package/dist/core/TransferOrchestrator.js.map +1 -0
- package/dist/core/types.d.ts +177 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +5 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts +8 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +4 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +14 -0
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts +12 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +91 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +64 -64
- package/src/scaffold/templates.ts +5 -0
- package/upgrades/1.3.92.md +27 -0
- package/upgrades/1.3.93.md +28 -0
- package/upgrades/side-effects/session-pool-activation-wiring.md +22 -0
- package/upgrades/side-effects/session-pool-capability-classification.md +16 -0
- package/upgrades/side-effects/session-pool-review-fixes.md +23 -0
- package/upgrades/side-effects/session-pool-track-a-router-lease.md +29 -0
- package/upgrades/side-effects/session-pool-track-b-agent-awareness.md +29 -0
- package/upgrades/side-effects/session-pool-track-b-nicknames.md +35 -0
- package/upgrades/side-effects/session-pool-track-b-pool-api.md +36 -0
- package/upgrades/side-effects/session-pool-track-b-registry.md +31 -0
- package/upgrades/side-effects/session-pool-track-b-wiring.md +39 -0
- package/upgrades/side-effects/session-pool-track-c-dispatcher.md +24 -0
- package/upgrades/side-effects/session-pool-track-c-meshrpc.md +35 -0
- package/upgrades/side-effects/session-pool-track-c-route-wiring.md +31 -0
- package/upgrades/side-effects/session-pool-track-d-ownership-fsm.md +31 -0
- package/upgrades/side-effects/session-pool-track-d-registry.md +27 -0
- package/upgrades/side-effects/session-pool-track-d-wiring.md +30 -0
- package/upgrades/side-effects/session-pool-track-e-boot-wiring.md +20 -0
- package/upgrades/side-effects/session-pool-track-e-placement-core.md +17 -0
- package/upgrades/side-effects/session-pool-track-e-router.md +23 -0
- package/upgrades/side-effects/session-pool-track-f-config.md +12 -0
- package/upgrades/side-effects/session-pool-track-f-handoff-core.md +17 -0
- package/upgrades/side-effects/session-pool-track-g-load-broker.md +16 -0
- package/upgrades/side-effects/session-pool-track-h-gate-wiring.md +17 -0
- package/upgrades/side-effects/session-pool-track-h-mesh-client.md +15 -0
- package/upgrades/side-effects/session-pool-track-h-rebalance.md +13 -0
- package/upgrades/side-effects/session-pool-track-h-rollout-gate.md +17 -0
- package/upgrades/side-effects/session-pool-track-h-stage-guard.md +16 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Side effects — Track H part 2b: rollout-gate boot wiring + GET /session-pool/e2e-results (§Rollout)
|
|
2
|
+
|
|
3
|
+
## What this adds
|
|
4
|
+
Wires the rollout gate into the live server (still dark — inert until the pool activates).
|
|
5
|
+
- `src/commands/server.ts` — constructs `SessionPoolE2EResultStore` (HMAC-signed over the agent authToken, file `state/session-pool-e2e-results.json`) + a `StageAdvancer` whose `writeStageConfig` routes through `liveConfig.set(STAGE_CONFIG_PATH, stage, { stageWriteToken })` — the sole stage write path. Passed to AgentServer.
|
|
6
|
+
- `src/server/routes.ts` — `GET /session-pool/e2e-results` (Bearer-auth like all routes): latest result per stage + per-row verify + total history count; 503 when the gate is dark/absent. RouteContext gains `sessionPoolE2EResultStore?`.
|
|
7
|
+
- `src/server/AgentServer.ts` — passthrough option → routeCtx.
|
|
8
|
+
|
|
9
|
+
## Risk / blast radius
|
|
10
|
+
None — the store is read-only over the route; StageAdvancer is constructed but not driven yet (the rollout job that calls advanceTo/reconcile is a later step). The stage-write path is guarded (Track H part 2a). No behavior change while dark.
|
|
11
|
+
|
|
12
|
+
## Tests
|
|
13
|
+
- `tests/integration/session-pool-e2e-results-route.test.ts` — 2: 503 when dark; 200 with latest-per-stage + verification + append-only total over a real store + real route.
|
|
14
|
+
- (units from part 1/2a: StageAdvancer 9, E2EResultStore 5, stageWriteGuard 6 — all green.)
|
|
15
|
+
|
|
16
|
+
## Follow-ups (Track H)
|
|
17
|
+
The rollout job/tick that drives StageAdvancer.advanceTo/reconcile; the CI release-boundary check; rebalance; live-ingress interception + outbound mesh client (D11 activation); real-hardware + test-as-self proof.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Side effects — Track H part 4: outbound MeshRpcClient (§L0 send side, dark)
|
|
2
|
+
|
|
3
|
+
## What this adds
|
|
4
|
+
`src/core/MeshRpcClient.ts` — the SEND side of MeshRpc, the outbound counterpart to MeshRpcDispatcher (receive). Builds a §L0 envelope (recipient-bound, Ed25519-signed, nonce + timestamp), POSTs to a peer's /mesh/rpc, returns the typed result (maps the dispatcher's reason/status on a non-200; throws only on transport error/timeout so the caller's retry loop catches it). Per-attempt timeout via AbortController; fully injected (fetch/sign/nonce/clock).
|
|
5
|
+
|
|
6
|
+
This is the activation transport (D11): it's what makes the SessionRouter's deliverMessage/spawnOnMachine deps and the TransferOrchestrator's sendTransferRpc dep live ACROSS machines.
|
|
7
|
+
|
|
8
|
+
## Risk / blast radius
|
|
9
|
+
None — pure transport class, not wired into the router yet (the activation step wires it as the router's outbound deps). No behavior change.
|
|
10
|
+
|
|
11
|
+
## Tests
|
|
12
|
+
- `tests/integration/mesh-rpc-client-roundtrip.test.ts` — 4 over a real MeshRpcDispatcher + real Ed25519 keys + loopback /mesh/rpc: full router→owner deliverMessage round-trip (200 + result + handler ran); RBAC rejection mapped (non-router → 403 not-router); replayed-nonce → 409 on the second send; transport error throws.
|
|
13
|
+
|
|
14
|
+
## Status — m2m transport COMPLETE
|
|
15
|
+
Send (MeshRpcClient) + receive (MeshRpcDispatcher) are both built + round-trip-proven. The remaining Track-H work is the ACTIVATION (wire MeshRpcClient as the SessionRouter's outbound deps + flip live-ingress to route through the router) + the staged real-hardware (laptop+mini) + test-as-self nickname-swap proof.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Side effects — Track H part 3: load-rebalance planner (§L4 Stage-3, dark)
|
|
2
|
+
|
|
3
|
+
## What this adds
|
|
4
|
+
`src/core/RebalancePlanner.ts` — the pure Stage-3 load-rebalance decision. `planRebalance(input, placementExecutor)` proposes a BOUNDED set of transfers off over-saturated machines (session ratio > rebalanceThresholdPercent), only for non-pinned, low-priority, off-cooldown sessions; at most one move per source per cycle (cascade guard); the target is chosen by the same PlacementExecutor.decide(reason:'rebalance') the router uses; a working copy of capacities is updated as moves are proposed so it never piles onto one target. No qualifying session ⇒ no move.
|
|
5
|
+
|
|
6
|
+
## Risk / blast radius
|
|
7
|
+
None — pure function, not wired into a tick yet. The caller (a heartbeat-interval rebalance tick, post-activation) performs the actual transfers via TransferOrchestrator. Evaluated ONLY on the heartbeat interval by design, never per message.
|
|
8
|
+
|
|
9
|
+
## Tests
|
|
10
|
+
- `tests/unit/RebalancePlanner.test.ts` — 8: moves off-saturated→free; no-move-under-threshold; never moves pinned/hard-pinned; never moves within cooldown; never moves a non-low-priority/critical session; one-move-per-source cascade cap; distinct-sessions across sources; purity.
|
|
11
|
+
|
|
12
|
+
## Follow-ups (Track H — the remaining frontier)
|
|
13
|
+
The heartbeat rebalance tick that drives planRebalance → TransferOrchestrator; the live-ingress interception + outbound mesh client (D11 activation); real-hardware (laptop+mini) + test-as-self nickname-swap proof.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Side effects — Track H part 1: rollout gate (StageAdvancer + E2E result store) (§Rollout)
|
|
2
|
+
|
|
3
|
+
## What this adds
|
|
4
|
+
The mechanical rollout gate for the staged dark→shadow→live-transfer→rebalance ladder. Pure components, shipped DARK (constructed in boot when the pool is enabled; the stage stays 'dark' until a green prior-stage E2E exists).
|
|
5
|
+
|
|
6
|
+
- `src/core/SessionPoolE2EResultStore.ts` — signed, append-only log of each stage's Tier-3 E2E outcome (`StageE2EResult`). recordResult (the E2E harness is the only writer) signs each row; getLatestForStage returns the most recent (a later red supersedes an earlier green); verify() is tamper-evidence; append-only history preserved.
|
|
7
|
+
- `src/core/StageAdvancer.ts` — the SOLE stage-config writer + the gate. advanceTo(stage) REFUSES (e2e-gate-not-passed) unless the prior stage's E2E is green for the CURRENT commit (missing/red/stale-commit/tampered → refused). reconcile() mechanically REVERTS to the prior stage when a live stage records red. 'dark' is the floor.
|
|
8
|
+
|
|
9
|
+
## Risk / blast radius
|
|
10
|
+
None — pure components, not yet wired into boot (the Config.ts stage-write guard + boot construction + GET /session-pool/e2e-results route land in part 2). No runtime behavior change.
|
|
11
|
+
|
|
12
|
+
## Tests
|
|
13
|
+
- `tests/unit/SessionPoolE2EResultStore.test.ts` — 5: signed record/read, latest-per-stage (red supersedes green), stage independence, tamper-evidence, missing-file/torn-line tolerance.
|
|
14
|
+
- `tests/unit/StageAdvancer.test.ts` — 9: refuse-no-result / advance-on-green / refuse stale-commit / refuse red / refuse bad-signature / refuse already-at-or-past; reconcile reverts-on-red / stays-on-green / dark-floor-noop.
|
|
15
|
+
|
|
16
|
+
## Follow-ups (Track H)
|
|
17
|
+
Part 2: Config.ts stage-write guard (stage-write-not-permitted for non-StageAdvancer writes) + boot wiring + GET /session-pool/e2e-results + the CI release-boundary check. The real-hardware + test-as-self proof (nickname-driven mid-conversation swap) is the culmination, which also needs the live-ingress interception + outbound mesh client (D11 activation).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Side effects — Track H part 2a: stage-write guard (§Rollout, Structure > Willpower)
|
|
2
|
+
|
|
3
|
+
## What this adds
|
|
4
|
+
The structural enforcement that `multiMachine.sessionPool.stage` is StageAdvancer-write-only.
|
|
5
|
+
|
|
6
|
+
- `src/config/stageWriteGuard.ts` (NEW) — `STAGE_CONFIG_PATH`, a module-private `STAGE_WRITE_TOKEN` capability symbol, `assertStageWriteAuthorized(dotPath, token)` (throws `StageWriteNotPermittedError` / code `stage-write-not-permitted` on a stage write without the token; no-op for any other path).
|
|
7
|
+
- `src/config/LiveConfig.ts` — `set(dotPath, value, opts?)` now calls the guard first. A direct runtime write to the rollout stage without the token is refused; every other config write is unaffected (opts is optional, backward-compatible). StageAdvancer's boot wiring passes the token.
|
|
8
|
+
|
|
9
|
+
## Risk / blast radius
|
|
10
|
+
None for existing callers — the guard only fires for the exact stage path, and `opts` is optional so all current `set()` callsites are unchanged. The stage field is already only written by StageAdvancer; this makes that structural (a stray ad-hoc write now throws instead of silently flipping the rollout).
|
|
11
|
+
|
|
12
|
+
## Tests
|
|
13
|
+
- `tests/unit/stageWriteGuard.test.ts` — 6: assert throws without/with-forged token, allows with token, no-op for other paths; LiveConfig refuses a direct stage write (unchanged on disk), allows it with the token, and does not gate other writes.
|
|
14
|
+
|
|
15
|
+
## Follow-ups (Track H)
|
|
16
|
+
StageAdvancer + E2EResultStore boot construction + `GET /session-pool/e2e-results` route + the CI release-boundary check; rebalance; live-ingress interception + outbound mesh client (D11); real-hardware + test-as-self proof.
|