instar 1.3.340 → 1.3.342
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 +57 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PendingInjectStore.d.ts +54 -0
- package/dist/core/PendingInjectStore.d.ts.map +1 -0
- package/dist/core/PendingInjectStore.js +152 -0
- package/dist/core/PendingInjectStore.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +22 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts +17 -0
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +70 -1
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/core/StateManager.d.ts +4 -0
- package/dist/core/StateManager.d.ts.map +1 -1
- package/dist/core/StateManager.js +6 -0
- package/dist/core/StateManager.js.map +1 -1
- package/dist/monitoring/GuardPostureTripwire.d.ts +90 -0
- package/dist/monitoring/GuardPostureTripwire.d.ts.map +1 -0
- package/dist/monitoring/GuardPostureTripwire.js +182 -0
- package/dist/monitoring/GuardPostureTripwire.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +20 -20
- package/upgrades/1.3.342.md +85 -0
- package/upgrades/guard-posture-tripwire.eli16.md +48 -0
- package/upgrades/side-effects/guard-posture-tripwire.md +76 -0
- package/upgrades/side-effects/pending-inject-durability.md +58 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuxDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAy9RtE;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
|
@@ -3733,6 +3733,51 @@ export async function startServer(options) {
|
|
|
3733
3733
|
catch (err) {
|
|
3734
3734
|
console.log(pc.yellow(` Worktree detector: skipped (${err instanceof Error ? err.message : String(err)})`));
|
|
3735
3735
|
}
|
|
3736
|
+
// GuardPostureTripwire — a disabled guard is itself an incident.
|
|
3737
|
+
// Runs once per server boot. Compares the resolved guard posture (every
|
|
3738
|
+
// monitoring.* enabled flag + scheduler.enabled) against the persisted
|
|
3739
|
+
// posture from the previous boot; any enabled→disabled transition gets a
|
|
3740
|
+
// loud log line + a logs/guard-posture.jsonl breadcrumb + ONE aggregated
|
|
3741
|
+
// HIGH Attention item (the 2026-06-05 meltdown load-shed batch-flipped
|
|
3742
|
+
// five guards off and only the scheduler was noticed — issue #882 / the
|
|
3743
|
+
// EXO AUP-wedge evening). Signal-only: never re-enables, never blocks a
|
|
3744
|
+
// boot. Placement mirrors the worktree detector above: after the
|
|
3745
|
+
// Telegram setup blocks so `telegram.createAttentionItem` is available.
|
|
3746
|
+
try {
|
|
3747
|
+
const tripwire = await import('../monitoring/GuardPostureTripwire.js');
|
|
3748
|
+
const postureResult = await tripwire.runGuardPostureTripwire({
|
|
3749
|
+
config,
|
|
3750
|
+
stateDir: config.stateDir,
|
|
3751
|
+
logsDir: path.join(config.stateDir, '..', 'logs'),
|
|
3752
|
+
emitAttention: telegram
|
|
3753
|
+
? async (item) => {
|
|
3754
|
+
await telegram.createAttentionItem({
|
|
3755
|
+
id: item.id,
|
|
3756
|
+
title: item.title,
|
|
3757
|
+
summary: item.summary,
|
|
3758
|
+
description: item.description,
|
|
3759
|
+
category: item.category,
|
|
3760
|
+
priority: item.priority,
|
|
3761
|
+
sourceContext: item.sourceContext,
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3764
|
+
: undefined,
|
|
3765
|
+
});
|
|
3766
|
+
if (postureResult.disabled.length > 0) {
|
|
3767
|
+
console.log(pc.yellow(` Guard-posture tripwire: ${postureResult.disabled.length} guard(s) DISABLED since last boot ` +
|
|
3768
|
+
`(${postureResult.disabled.join(', ')}) — ` +
|
|
3769
|
+
`${postureResult.attentionEmitted ? 'Attention item raised' : 'breadcrumb only (no Telegram)'}`));
|
|
3770
|
+
}
|
|
3771
|
+
else if (postureResult.firstBoot) {
|
|
3772
|
+
console.log(pc.green(' Guard-posture tripwire: baseline recorded'));
|
|
3773
|
+
}
|
|
3774
|
+
else {
|
|
3775
|
+
console.log(pc.green(' Guard-posture tripwire: posture unchanged'));
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
catch (err) {
|
|
3779
|
+
console.log(pc.yellow(` Guard-posture tripwire: skipped (${err instanceof Error ? err.message : String(err)})`));
|
|
3780
|
+
}
|
|
3736
3781
|
// ArcCheck (Layer 3) — declared at outer scope so the instance built inside
|
|
3737
3782
|
// the telegram block is visible at AgentServer construction below. The same
|
|
3738
3783
|
// instance backs the HTTP route and the in-process checkOutboundMessage caller.
|
|
@@ -4428,6 +4473,18 @@ export async function startServer(options) {
|
|
|
4428
4473
|
// lifeline to restart the server in a tight loop.
|
|
4429
4474
|
await sessionManager.purgeDeadSessions();
|
|
4430
4475
|
sessionManager.startMonitoring();
|
|
4476
|
+
// Pending-inject recovery (finding 8d300555): re-deliver initial messages
|
|
4477
|
+
// orphaned by the previous server process dying in the spawn→ready→inject
|
|
4478
|
+
// window (the auto-updater restart race). Runs AFTER the purge so dead
|
|
4479
|
+
// sessions are already settled, and in the background — the ready-waits
|
|
4480
|
+
// inside can take up to 90s per session and must not block boot.
|
|
4481
|
+
void sessionManager.recoverPendingInjects().catch((err) => {
|
|
4482
|
+
// @silent-fallback-ok boot recovery is a backstop that must NEVER crash
|
|
4483
|
+
// boot — its own internal failures already route to DegradationReporter
|
|
4484
|
+
// (sweepPendingInjects.reportLoss); this outer guard only catches an
|
|
4485
|
+
// unexpected throw from the sweep harness itself.
|
|
4486
|
+
console.error(`[server] Pending-inject recovery failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`);
|
|
4487
|
+
});
|
|
4431
4488
|
// StuckInputSentinel — persistent, restart-safe recovery for tmux prompts
|
|
4432
4489
|
// that hold text but never submitted Enter. Complements the in-process
|
|
4433
4490
|
// verifyInjection timers (PR #159) which die when the server crashes.
|