instar 1.2.59 → 1.2.60

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;AAsQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0zLtE;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"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA60LtE;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"}
@@ -71,6 +71,7 @@ import { AutonomousEvolution } from '../core/AutonomousEvolution.js';
71
71
  import { DispatchScopeEnforcer } from '../core/DispatchScopeEnforcer.js';
72
72
  import { TrustRecovery } from '../core/TrustRecovery.js';
73
73
  import { DegradationReporter } from '../monitoring/DegradationReporter.js';
74
+ import { HumanAsDetectorLog, observeInboundMessage } from '../monitoring/HumanAsDetectorLog.js';
74
75
  import { resolveStableNodeBinary } from '../utils/resolveNodeBinary.js';
75
76
  import { SelfKnowledgeTree } from '../knowledge/SelfKnowledgeTree.js';
76
77
  import { CoverageAuditor } from '../knowledge/CoverageAuditor.js';
@@ -1911,6 +1912,15 @@ export async function startServer(options) {
1911
1912
  agentName: config.projectName,
1912
1913
  instarVersion: startupVersion,
1913
1914
  });
1915
+ // HumanAsDetectorLog — treats a human-caught coherence break (a correction,
1916
+ // a "you already said", a "why didn't you catch this") as evidence that some
1917
+ // automated guardian failed. Configured early; the inbound-message observe()
1918
+ // is chained onto telegram.onMessageLogged once telegram is up (see below).
1919
+ const humanAsDetectorLog = HumanAsDetectorLog.getInstance();
1920
+ humanAsDetectorLog.configure({
1921
+ stateDir: config.stateDir,
1922
+ agentName: config.projectName,
1923
+ });
1914
1924
  // Clean up stale Telegram temp files on startup
1915
1925
  cleanupTelegramTempFiles();
1916
1926
  // Pre-flight: ensure better-sqlite3 bindings are compiled for the current Node.js version.
@@ -5343,6 +5353,15 @@ export async function startServer(options) {
5343
5353
  platformUserId: entry.telegramUserId?.toString(),
5344
5354
  });
5345
5355
  };
5356
+ // Human-as-Detector: observe inbound HUMAN messages for coherence-break
5357
+ // corrections — a correction the user had to make is evidence a guardian
5358
+ // failed. Chains the prior callback; best-effort (observe never throws).
5359
+ const beforeHadCallback = telegram.onMessageLogged;
5360
+ telegram.onMessageLogged = (entry) => {
5361
+ if (beforeHadCallback)
5362
+ beforeHadCallback(entry);
5363
+ observeInboundMessage(humanAsDetectorLog, entry);
5364
+ };
5346
5365
  presenceProxy.start();
5347
5366
  // ── PromiseBeacon ────────────────────────────────────────────────
5348
5367
  // Watches beacon-enabled commitments and emits ⏳ heartbeats so the