instar 1.3.800 → 1.3.802
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/dashboard/index.html +25 -0
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +63 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/BackupManager.d.ts.map +1 -1
- package/dist/core/BackupManager.js +8 -0
- package/dist/core/BackupManager.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +8 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +45 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/ProactiveSwapMonitor.d.ts +10 -0
- package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
- package/dist/core/ProactiveSwapMonitor.js +39 -0
- package/dist/core/ProactiveSwapMonitor.js.map +1 -1
- package/dist/core/SessionManager.d.ts +26 -4
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +76 -22
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/machineCoherenceManifest.d.ts +10 -0
- package/dist/core/machineCoherenceManifest.d.ts.map +1 -1
- package/dist/core/machineCoherenceManifest.js +58 -0
- package/dist/core/machineCoherenceManifest.js.map +1 -1
- package/dist/core/types.d.ts +53 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/monitoring/ExternalHogScanTick.d.ts +9 -0
- package/dist/monitoring/ExternalHogScanTick.d.ts.map +1 -1
- package/dist/monitoring/ExternalHogScanTick.js +29 -0
- package/dist/monitoring/ExternalHogScanTick.js.map +1 -1
- package/dist/monitoring/PromiseBeacon.d.ts +6 -0
- package/dist/monitoring/PromiseBeacon.d.ts.map +1 -1
- package/dist/monitoring/PromiseBeacon.js +42 -6
- package/dist/monitoring/PromiseBeacon.js.map +1 -1
- package/dist/monitoring/guardManifest.d.ts.map +1 -1
- package/dist/monitoring/guardManifest.js +31 -0
- package/dist/monitoring/guardManifest.js.map +1 -1
- package/dist/monitoring/guardPosture.d.ts.map +1 -1
- package/dist/monitoring/guardPosture.js +22 -0
- package/dist/monitoring/guardPosture.js.map +1 -1
- package/dist/monitoring/selfaction/anchor.d.ts +82 -0
- package/dist/monitoring/selfaction/anchor.d.ts.map +1 -0
- package/dist/monitoring/selfaction/anchor.js +113 -0
- package/dist/monitoring/selfaction/anchor.js.map +1 -0
- package/dist/monitoring/selfaction/governor.d.ts +242 -0
- package/dist/monitoring/selfaction/governor.d.ts.map +1 -0
- package/dist/monitoring/selfaction/governor.js +1475 -0
- package/dist/monitoring/selfaction/governor.js.map +1 -0
- package/dist/monitoring/selfaction/policies.d.ts +86 -0
- package/dist/monitoring/selfaction/policies.d.ts.map +1 -0
- package/dist/monitoring/selfaction/policies.js +339 -0
- package/dist/monitoring/selfaction/policies.js.map +1 -0
- package/dist/monitoring/selfaction/types.d.ts +208 -0
- package/dist/monitoring/selfaction/types.d.ts.map +1 -0
- package/dist/monitoring/selfaction/types.js +11 -0
- package/dist/monitoring/selfaction/types.js.map +1 -0
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +8 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +6 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +9 -0
- package/dist/server/CapabilityIndex.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 +271 -3
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts +16 -0
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +16 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +2 -2
- package/scripts/lint-emit-without-admit.js +303 -0
- package/src/data/builtin-manifest.json +66 -66
- package/src/data/state-coherence-registry.json +1296 -1241
- package/src/scaffold/templates.ts +8 -1
- package/upgrades/1.3.801.md +38 -0
- package/upgrades/1.3.802.md +36 -0
- package/upgrades/session-listing-hygiene.eli16.md +26 -0
- package/upgrades/side-effects/self-action-governor.md +111 -0
- package/upgrades/side-effects/session-listing-hygiene.md +93 -0
package/dashboard/index.html
CHANGED
|
@@ -229,6 +229,18 @@
|
|
|
229
229
|
background: #3a2a1b;
|
|
230
230
|
color: #fbbf24;
|
|
231
231
|
}
|
|
232
|
+
/* Genuine cross-machine duplicate (CMT-1936 part c): the SAME conversation
|
|
233
|
+
has a live session on 2+ machines at once — the real incoherency, loud
|
|
234
|
+
and red. (The same recurring job on each machine is benign and never
|
|
235
|
+
gets this badge.) */
|
|
236
|
+
.duplicate-badge {
|
|
237
|
+
padding: 1px 6px;
|
|
238
|
+
border-radius: 4px;
|
|
239
|
+
font-size: 10px;
|
|
240
|
+
font-weight: 700;
|
|
241
|
+
background: #4e1b1b;
|
|
242
|
+
color: #f87171;
|
|
243
|
+
}
|
|
232
244
|
/* A session running on ANOTHER machine — now clickable; selecting it
|
|
233
245
|
streams its terminal here via the cross-machine relay (§2.2). The badge
|
|
234
246
|
already names the machine, so a slightly dimmed row is enough hint. */
|
|
@@ -4016,6 +4028,11 @@
|
|
|
4016
4028
|
// per-machine empty-state strip. Populated only when the pool is enabled with
|
|
4017
4029
|
// 2+ machines — single-machine agents never see the strip (strict no-op).
|
|
4018
4030
|
let poolMachinesView = [];
|
|
4031
|
+
// Session-listing hygiene (CMT-1936 part c): names of sessions the server
|
|
4032
|
+
// flagged as GENUINE cross-machine duplicates (the SAME conversation live on
|
|
4033
|
+
// >=2 machines at once). Same recurring job on each machine is benign and is
|
|
4034
|
+
// never flagged. Fed by pool.duplicateTopics from /sessions?scope=pool.
|
|
4035
|
+
let poolDuplicateSessionNames = new Set();
|
|
4019
4036
|
let selfMachineNickname = null;
|
|
4020
4037
|
let activeSession = null;
|
|
4021
4038
|
let activeMachineId = null; // non-null when the active session streams from a peer (§2.2)
|
|
@@ -4370,6 +4387,7 @@
|
|
|
4370
4387
|
<span class="model-badge ${model}">${model}</span>
|
|
4371
4388
|
<span class="platform-badge ${platform}" title="${platformLabel}">${platformIcon}</span>
|
|
4372
4389
|
${session.machineNickname ? `<span class="machine-badge" title="Machine this session runs on">${escapeHtml(session.machineNickname)}</span>` : ''}
|
|
4390
|
+
${(session.duplicateTopic === true || poolDuplicateSessionNames.has(session.name)) ? `<span class="duplicate-badge" title="Genuine cross-machine duplicate: this conversation has a live session on more than one machine at once">⚠ duplicate</span>` : ''}
|
|
4373
4391
|
<span>${elapsed}</span>
|
|
4374
4392
|
</div>
|
|
4375
4393
|
${telemetryHtml}
|
|
@@ -4977,6 +4995,13 @@
|
|
|
4977
4995
|
poolMachinesView = (j.pool && j.pool.enabled && Array.isArray(j.pool.machines) && j.pool.machines.length >= 2)
|
|
4978
4996
|
? j.pool.machines
|
|
4979
4997
|
: [];
|
|
4998
|
+
// Genuine cross-machine duplicates (server-computed): collect the flagged
|
|
4999
|
+
// session NAMES so both local (WS-fed) and remote tiles can badge — the
|
|
5000
|
+
// local row never carries the flag itself (it arrives via WebSocket).
|
|
5001
|
+
poolDuplicateSessionNames = new Set(
|
|
5002
|
+
(j.pool && Array.isArray(j.pool.duplicateTopics) ? j.pool.duplicateTopics : [])
|
|
5003
|
+
.flatMap(d => Array.isArray(d.sessions) ? d.sessions : [])
|
|
5004
|
+
);
|
|
4980
5005
|
renderSessionList();
|
|
4981
5006
|
} catch { /* best-effort — peers may be offline; next tick retries */ }
|
|
4982
5007
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwDH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCA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Aa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CAonBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuzmBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -16745,6 +16745,60 @@ export async function startServer(options) {
|
|
|
16745
16745
|
});
|
|
16746
16746
|
}
|
|
16747
16747
|
// ── OrphanedWorkSentinel (the silent-uncommitted-death backstop) ──────────
|
|
16748
|
+
// ── SelfActionGovernor (unified-self-action-backpressure Increment B) ──
|
|
16749
|
+
// ONE in-process admission chokepoint every registered self-triggered
|
|
16750
|
+
// action rides (age-kill, external-hog kill, proactive swap, beacon
|
|
16751
|
+
// notify/liveness). Ships OBSERVE-ONLY on every class, fleet-wide (FD1):
|
|
16752
|
+
// admit() records would-deny verdicts and always allows; the per-class
|
|
16753
|
+
// enforce flip is the operator's later action. INIT-ONCE process-global
|
|
16754
|
+
// anchor; emergencyDisable is read LIVE (PATCH /config applies with no
|
|
16755
|
+
// restart). Construction is guarded — a failure leaves the module-level
|
|
16756
|
+
// governor uninitialized (disabled-passthrough admits), never a dead boot.
|
|
16757
|
+
let _selfActionGovernor;
|
|
16758
|
+
try {
|
|
16759
|
+
const { initSelfActionGovernor } = await import('../monitoring/selfaction/governor.js');
|
|
16760
|
+
_selfActionGovernor = initSelfActionGovernor({
|
|
16761
|
+
stateDir: config.stateDir,
|
|
16762
|
+
readEmergencyDisable: () => liveConfig.get('intelligence.selfActionGovernor.emergencyDisable', config.intelligence?.selfActionGovernor?.emergencyDisable ?? false) === true,
|
|
16763
|
+
readClassesConfig: () => liveConfig.get('intelligence.selfActionGovernor.classes', (config.intelligence?.selfActionGovernor?.classes ?? undefined)),
|
|
16764
|
+
// Census discipline (spec SC6-1): governor-owned, sampled OFF the hot
|
|
16765
|
+
// path (the governor's own slow tick), INDEPENDENT of any governed
|
|
16766
|
+
// controller's candidate enumeration — the STATE-store read, never the
|
|
16767
|
+
// reaper's own listRunningSessions.
|
|
16768
|
+
readCensus: () => ({
|
|
16769
|
+
value: state.listSessions({ status: 'running' }).length,
|
|
16770
|
+
asOf: Date.now(),
|
|
16771
|
+
confidence: 'high',
|
|
16772
|
+
}),
|
|
16773
|
+
configuredSessionCap: () => config.sessions?.maxSessions,
|
|
16774
|
+
// FD9 level gate input: the REGISTERED machine count (not online peers).
|
|
16775
|
+
registeredMachineCount: () => Math.max(1, machinePoolRegistry?.getCapacities().length ?? 1),
|
|
16776
|
+
emitAttention: (item) => {
|
|
16777
|
+
void telegram?.createAttentionItem({
|
|
16778
|
+
id: item.id,
|
|
16779
|
+
title: item.title,
|
|
16780
|
+
summary: item.body.slice(0, 160),
|
|
16781
|
+
description: item.body,
|
|
16782
|
+
category: 'self-action-governor',
|
|
16783
|
+
priority: item.priority,
|
|
16784
|
+
sourceContext: item.sourceContext,
|
|
16785
|
+
});
|
|
16786
|
+
},
|
|
16787
|
+
});
|
|
16788
|
+
guardRegistry.register('intelligence.selfActionGovernor.enabled', () => _selfActionGovernor.guardRuntimeStatus());
|
|
16789
|
+
console.log(pc.dim(' SelfActionGovernor initialized (observe-only — unified self-action backpressure)'));
|
|
16790
|
+
}
|
|
16791
|
+
catch (err) {
|
|
16792
|
+
console.error('[self-action-governor] init failed (admits pass through this boot):', err instanceof Error ? err.message : String(err));
|
|
16793
|
+
_selfActionGovernor = undefined;
|
|
16794
|
+
DegradationReporter.getInstance().report({
|
|
16795
|
+
feature: 'SelfActionGovernor',
|
|
16796
|
+
primary: 'self-action admission chokepoint (observe-only would-deny measurement)',
|
|
16797
|
+
fallback: 'governor uninitialized for this boot — every admit resolves disabled-passthrough (allow)',
|
|
16798
|
+
reason: `init failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
16799
|
+
impact: 'Self-action would-deny telemetry is not collected this boot; the retrofitted emit paths behave exactly as before (observe mode never blocks anyway).',
|
|
16800
|
+
});
|
|
16801
|
+
}
|
|
16748
16802
|
// Detects agent worktrees with uncommitted work whose owning session is dead
|
|
16749
16803
|
// + settled, records them durably, and raises ONE deduped agent-health notice
|
|
16750
16804
|
// — the case the PromiseBeacon escalation ladder can't see (nothing registered
|
|
@@ -17506,7 +17560,15 @@ export async function startServer(options) {
|
|
|
17506
17560
|
...(() => {
|
|
17507
17561
|
try {
|
|
17508
17562
|
return {
|
|
17509
|
-
coherenceAdvert: buildCoherenceAdvert({
|
|
17563
|
+
coherenceAdvert: buildCoherenceAdvert({
|
|
17564
|
+
boot: config,
|
|
17565
|
+
liveGet: (path, fallback) => liveConfig.get(path, fallback),
|
|
17566
|
+
// unified-self-action-backpressure INT7-1: the mode
|
|
17567
|
+
// rows read `demoted` from governor RUNTIME state —
|
|
17568
|
+
// a config-only read would advertise `enforce` on a
|
|
17569
|
+
// runtime-demoted machine and defeat the skew alarm.
|
|
17570
|
+
governorClassMode: (controllerId) => _selfActionGovernor?.getClassMode(controllerId) ?? 'observe',
|
|
17571
|
+
}, { instarVersion: ProcessIntegrity.getInstance()?.runningVersion ?? 'unknown', beatSeq: _coherenceBeatSeq++ }),
|
|
17510
17572
|
};
|
|
17511
17573
|
}
|
|
17512
17574
|
catch {
|