instar 1.3.1101 → 1.3.1102

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8EH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA0BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA8H7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAuID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+rDD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,oBAAoB,GAAG,IAAI,GACxC;IACD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,Q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,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAQrD,oBAAoB,CAAC,EAAE,MAAM;IAC3B,YAAY,EAAE,OAAO,kBAAkB,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,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,CAwtBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6yqBtE;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"}
@@ -3346,6 +3346,11 @@ function setupServerLog(stateDir) {
3346
3346
  }
3347
3347
  export async function startServer(options) {
3348
3348
  const config = loadConfig(options.dir);
3349
+ // Capture the guard substrate at the boot-config boundary, BEFORE the
3350
+ // PostUpdateMigrator or any later startup path can rewrite config.json.
3351
+ // The tripwire persists what THIS process booted from; later disk changes
3352
+ // must remain visible to GET /guards as diverged-pending-restart.
3353
+ const bootGuardConfigSnapshot = resolveGuardConfigSnapshot(config.projectDir);
3349
3354
  ensureStateDir(config.stateDir);
3350
3355
  // Identity context is additive and survives agent moves. Validate its
3351
3356
  // persisted directory before any subsystem can derive hooks, locks, or
@@ -7140,8 +7145,8 @@ export async function startServer(options) {
7140
7145
  console.log(pc.yellow(` Worktree detector: skipped (${err instanceof Error ? err.message : String(err)})`));
7141
7146
  }
7142
7147
  // GuardPostureTripwire — a disabled guard is itself an incident.
7143
- // Runs once per server boot. Compares the resolved guard posture (every
7144
- // monitoring.* enabled flag + scheduler.enabled) against the persisted
7148
+ // Runs once per server boot. Compares the complete resolved guard posture
7149
+ // (generic config extraction UNION the static guard manifest) against the persisted
7145
7150
  // posture from the previous boot; any enabled→disabled transition gets a
7146
7151
  // loud log line + a logs/guard-posture.jsonl breadcrumb + ONE aggregated
7147
7152
  // HIGH Attention item (the 2026-06-05 meltdown load-shed batch-flipped
@@ -7152,7 +7157,11 @@ export async function startServer(options) {
7152
7157
  try {
7153
7158
  const tripwire = await import('../monitoring/GuardPostureTripwire.js');
7154
7159
  const postureResult = await tripwire.runGuardPostureTripwire({
7155
- config,
7160
+ // Use the defaults/dev-gate-resolved disk substrate captured immediately
7161
+ // after loadConfig. If that read degraded, the already-loaded config is
7162
+ // still safer than dropping the detector entirely.
7163
+ config: bootGuardConfigSnapshot.readError ? config : bootGuardConfigSnapshot.resolved,
7164
+ defaultConfig: bootGuardConfigSnapshot.defaults,
7156
7165
  stateDir: config.stateDir,
7157
7166
  logsDir: path.join(config.stateDir, '..', 'logs'),
7158
7167
  emitAttention: telegram
@@ -7170,15 +7179,26 @@ export async function startServer(options) {
7170
7179
  : undefined,
7171
7180
  });
7172
7181
  if (postureResult.disabled.length > 0) {
7173
- console.log(pc.yellow(` Guard-posture tripwire: ${postureResult.disabled.length} guard(s) DISABLED since last boot ` +
7182
+ const transitioned = postureResult.disabled.length - postureResult.newlyTrackedDisabled.length;
7183
+ console.log(pc.yellow(` Guard-posture tripwire: ${postureResult.disabled.length}/${postureResult.coverage.watched} ` +
7184
+ `watched guard posture incident(s) ` +
7185
+ `(${transitioned} disabled since last boot, ` +
7186
+ `${postureResult.newlyTrackedDisabled.length} newly watched default-ON guard(s) found OFF) ` +
7174
7187
  `(${postureResult.disabled.join(', ')}) — ` +
7175
7188
  `${postureResult.attentionEmitted ? 'Attention item raised' : 'breadcrumb only (no Telegram)'}`));
7176
7189
  }
7177
7190
  else if (postureResult.firstBoot) {
7178
- console.log(pc.green(' Guard-posture tripwire: baseline recorded'));
7191
+ console.log(pc.green(` Guard-posture tripwire: baseline recorded (${postureResult.coverage.watched} watched guards)`));
7192
+ }
7193
+ else if (postureResult.enabled.length > 0) {
7194
+ const transitioned = postureResult.enabled.length - postureResult.newlyTrackedEnabled.length;
7195
+ console.log(pc.green(` Guard-posture tripwire: ${postureResult.enabled.length}/${postureResult.coverage.watched} ` +
7196
+ `watched guard enablement event(s) ` +
7197
+ `(${transitioned} enabled since last boot, ` +
7198
+ `${postureResult.newlyTrackedEnabled.length} newly watched default-OFF guard(s) found ON)`));
7179
7199
  }
7180
7200
  else {
7181
- console.log(pc.green(' Guard-posture tripwire: posture unchanged'));
7201
+ console.log(pc.green(` Guard-posture tripwire: posture unchanged (${postureResult.coverage.watched} watched guards)`));
7182
7202
  }
7183
7203
  }
7184
7204
  catch (err) {