instar 1.3.442 → 1.3.443

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;AAaH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiG7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA6JtD,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA05BD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,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,GAC/F,IAAI,CAyUN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmrUtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CA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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"}
@@ -4221,7 +4221,7 @@ export async function startServer(options) {
4221
4221
  const slackCfg = slackConfig.config;
4222
4222
  const pgCfg = slackCfg.permissionGate;
4223
4223
  if (pgCfg && (pgCfg.observeOnly || pgCfg.enforce)) {
4224
- const { SlackPermissionObserver, SlackPrincipalResolver, SlackPermissionGate, PermissionDecisionLedger, RolePolicy, HeuristicIntentClassifier, HeuristicAnomalyScorer, MandateBackedGrantStore, } = await import('../permissions/index.js');
4224
+ const { SlackPermissionObserver, SlackPrincipalResolver, SlackPermissionGate, PermissionDecisionLedger, RolePolicy, HeuristicIntentClassifier, LlmIntentClassifier, HeuristicAnomalyScorer, MandateBackedGrantStore, } = await import('../permissions/index.js');
4225
4225
  // Own UserManager instance for verified-principal resolution (the
4226
4226
  // Telegram-block userManager is out of scope here). Reads users.json.
4227
4227
  const slackUserManager = new UserManager(config.stateDir, config.users);
@@ -4259,13 +4259,34 @@ export async function startServer(options) {
4259
4259
  console.warn('[slack] mandate-backed grant store wiring skipped:', ge.message);
4260
4260
  }
4261
4261
  }
4262
+ // ── Judgment-band classifier selection (opt-in, dark by default) ──
4263
+ // Default stays the deterministic HeuristicIntentClassifier. When
4264
+ // `permissionGate.classifier === 'llm'` AND an internal LLM provider is
4265
+ // available, use LlmIntentClassifier for the judgment band ABOVE the
4266
+ // deterministic floor — it fails CLOSED to the heuristic on any LLM
4267
+ // failure (never a silent allow). With 'llm' selected but no provider,
4268
+ // we stay on the heuristic and say so.
4269
+ let intentClassifier;
4270
+ if (pgCfg.classifier === 'llm') {
4271
+ if (sharedIntelligence) {
4272
+ intentClassifier = new LlmIntentClassifier({ intelligence: sharedIntelligence });
4273
+ console.log('[slack] permission gate using LLM judgment-band intent classifier (fail-closed to heuristic)');
4274
+ }
4275
+ else {
4276
+ intentClassifier = new HeuristicIntentClassifier();
4277
+ console.warn('[slack] permissionGate.classifier=llm requested but no intelligence provider available — staying on heuristic classifier');
4278
+ }
4279
+ }
4280
+ else {
4281
+ intentClassifier = new HeuristicIntentClassifier();
4282
+ }
4262
4283
  const observer = new SlackPermissionObserver({
4263
4284
  resolver: new SlackPrincipalResolver({
4264
4285
  resolveFromSlackUserId: (id) => slackUserManager.resolveFromSlackUserId(id),
4265
4286
  }),
4266
4287
  gate: new SlackPermissionGate({
4267
4288
  rolePolicy: new RolePolicy(),
4268
- classifier: new HeuristicIntentClassifier(),
4289
+ classifier: intentClassifier,
4269
4290
  anomalyScorer: new HeuristicAnomalyScorer(),
4270
4291
  grants: grantStore,
4271
4292
  }),