instar 1.3.479 → 1.3.481

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.
Files changed (49) hide show
  1. package/dashboard/index.html +103 -0
  2. package/dist/commands/server.d.ts.map +1 -1
  3. package/dist/commands/server.js +10 -7
  4. package/dist/commands/server.js.map +1 -1
  5. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  6. package/dist/config/ConfigDefaults.js +20 -8
  7. package/dist/config/ConfigDefaults.js.map +1 -1
  8. package/dist/core/PostUpdateMigrator.d.ts +1 -0
  9. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  10. package/dist/core/PostUpdateMigrator.js +139 -0
  11. package/dist/core/PostUpdateMigrator.js.map +1 -1
  12. package/dist/core/devGatedFeatures.d.ts +31 -0
  13. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  14. package/dist/core/devGatedFeatures.js +121 -0
  15. package/dist/core/devGatedFeatures.js.map +1 -1
  16. package/dist/core/types.d.ts +27 -0
  17. package/dist/core/types.d.ts.map +1 -1
  18. package/dist/core/types.js.map +1 -1
  19. package/dist/monitoring/BlockerLedger.d.ts +294 -0
  20. package/dist/monitoring/BlockerLedger.d.ts.map +1 -0
  21. package/dist/monitoring/BlockerLedger.js +597 -0
  22. package/dist/monitoring/BlockerLedger.js.map +1 -0
  23. package/dist/monitoring/blockerSettleAuthority.d.ts +28 -0
  24. package/dist/monitoring/blockerSettleAuthority.d.ts.map +1 -0
  25. package/dist/monitoring/blockerSettleAuthority.js +0 -0
  26. package/dist/monitoring/blockerSettleAuthority.js.map +1 -0
  27. package/dist/scaffold/templates.d.ts.map +1 -1
  28. package/dist/scaffold/templates.js +9 -0
  29. package/dist/scaffold/templates.js.map +1 -1
  30. package/dist/server/AgentServer.d.ts +1 -0
  31. package/dist/server/AgentServer.d.ts.map +1 -1
  32. package/dist/server/AgentServer.js +32 -0
  33. package/dist/server/AgentServer.js.map +1 -1
  34. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  35. package/dist/server/CapabilityIndex.js +15 -0
  36. package/dist/server/CapabilityIndex.js.map +1 -1
  37. package/dist/server/routes.d.ts +6 -0
  38. package/dist/server/routes.d.ts.map +1 -1
  39. package/dist/server/routes.js +108 -1
  40. package/dist/server/routes.js.map +1 -1
  41. package/package.json +1 -1
  42. package/scripts/lib/dark-gate-attribution.js +148 -0
  43. package/scripts/lint-dev-agent-dark-gate.js +159 -14
  44. package/src/data/builtin-manifest.json +64 -64
  45. package/src/scaffold/templates.ts +9 -0
  46. package/upgrades/1.3.480.md +35 -0
  47. package/upgrades/1.3.481.md +38 -0
  48. package/upgrades/side-effects/blocker-ledger.md +106 -0
  49. package/upgrades/side-effects/dev-agent-dark-gate-enforcement.md +95 -0
@@ -2697,6 +2697,7 @@
2697
2697
  <button class="tab" data-tab="preferences-learning" onclick="switchTab('preferences-learning')">Preferences</button>
2698
2698
  <button class="tab" data-tab="machines" onclick="switchTab('machines')">Machines</button>
2699
2699
  <button class="tab" data-tab="mandates" onclick="switchTab('mandates')">Mandates</button>
2700
+ <button class="tab" data-tab="blockers" onclick="switchTab('blockers')">Blockers</button>
2700
2701
  </nav>
2701
2702
  </div>
2702
2703
  <div class="vital-signs" id="vitalSigns">
@@ -3214,6 +3215,27 @@
3214
3215
  </div>
3215
3216
  </div>
3216
3217
 
3218
+ <!-- Blockers tab — Blocker Ledger read surface (Phase 1).
3219
+ A blocker is a DECAYING HYPOTHESIS, not a settled wall: each entry moves through
3220
+ candidate → authority-checked → access-requested → dry-run → live-run → resolved /
3221
+ true-blocker. A true-blocker is "best current understanding — recheck after <date>",
3222
+ never "stop trying". Read-only here; data from GET /blockers. detectedText and all
3223
+ free-text are UNTRUSTED and HTML-escaped before render. 503 = feature off. -->
3224
+ <div id="blockersPanel" style="display:none;flex-direction:column;padding:20px;gap:16px;overflow-y:auto">
3225
+ <div style="display:flex;justify-content:space-between;align-items:center">
3226
+ <h2 style="margin:0">Blockers</h2>
3227
+ <button onclick="loadBlockers()" style="padding:6px 12px">Refresh</button>
3228
+ </div>
3229
+ <div style="font-size:12px;color:var(--text-dim);line-height:1.4">
3230
+ Things that looked like they stopped progress, tracked as <b>decaying hypotheses</b> rather than settled walls.
3231
+ Each one moves through verification states; a "true blocker" is the best current understanding with a recheck date —
3232
+ never a permanent "give up".
3233
+ </div>
3234
+ <div id="blockersBody" style="border:1px solid var(--border);border-radius:8px;padding:16px;font-size:13px">
3235
+ <div style="color:var(--text-dim)">Loading...</div>
3236
+ </div>
3237
+ </div>
3238
+
3217
3239
  <!-- LLM Activity tab — Observable Intelligence (docs/specs/observable-intelligence.md).
3218
3240
  Every LLM call the system makes on its own behalf: which component, which
3219
3241
  provider/model, whether it acted or no-op'd, was skipped, cost + latency.
@@ -4767,6 +4789,12 @@
4767
4789
  onActivate: () => { if (typeof startMandates === 'function') startMandates(); },
4768
4790
  onDeactivate: () => { if (typeof stopMandates === 'function') stopMandates(); },
4769
4791
  },
4792
+ {
4793
+ id: 'blockers',
4794
+ panels: ['blockersPanel'],
4795
+ display: ['flex'],
4796
+ onActivate: () => { if (typeof loadBlockers === 'function') loadBlockers(); },
4797
+ },
4770
4798
  {
4771
4799
  id: 'secrets',
4772
4800
  panels: ['secretsPanel'],
@@ -5428,6 +5456,81 @@
5428
5456
  }
5429
5457
  }
5430
5458
 
5459
+ // ── Blockers Tab (Blocker Ledger Phase 1 read surface) ──────────
5460
+ // A blocker is a decaying hypothesis, not a settled wall. Read-only.
5461
+ // detectedText + all free-text are UNTRUSTED → escapeHtml before render.
5462
+ function blockerStateBadge(state) {
5463
+ const colors = {
5464
+ 'candidate': 'var(--text-dim)',
5465
+ 'authority-checked': '#6ea8fe',
5466
+ 'access-requested': '#6ea8fe',
5467
+ 'dry-run': '#d6a700',
5468
+ 'live-run': '#d6a700',
5469
+ 'resolved': 'var(--accent)',
5470
+ 'true-blocker': 'var(--red)',
5471
+ };
5472
+ const bg = colors[state] || 'var(--text-dim)';
5473
+ return '<span style="display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;' +
5474
+ 'font-weight:600;color:#fff;white-space:nowrap;background:' + bg + '">' +
5475
+ escapeHtml(String(state || 'unknown')) + '</span>';
5476
+ }
5477
+ function blockerTerminalLine(entry) {
5478
+ const t = entry && entry.terminal;
5479
+ if (!t) return '';
5480
+ if (t.kind === 'resolved') {
5481
+ const path = t.playbookPath ? ' · playbook: ' + escapeHtml(String(t.playbookPath)) : '';
5482
+ return '<div style="font-size:12px;color:var(--accent);margin-top:4px">Resolved' + path + '</div>';
5483
+ }
5484
+ if (t.kind === 'true-blocker') {
5485
+ // NEVER frame a true-blocker as settled / "stop trying" — it's a decaying hypothesis.
5486
+ const reason = t.reasonKind ? escapeHtml(String(t.reasonKind)) : 'unknown reason';
5487
+ const recheck = t.recheckAfter ? fmtRelTime(t.recheckAfter) : 'unscheduled';
5488
+ return '<div style="font-size:12px;color:var(--red);margin-top:4px">Current hypothesis (' + reason +
5489
+ ') — recheck after ' + escapeHtml(recheck) + '</div>';
5490
+ }
5491
+ return '';
5492
+ }
5493
+ async function loadBlockers() {
5494
+ const bodyEl = document.getElementById('blockersBody');
5495
+ try {
5496
+ const resp = await apiFetch('/blockers');
5497
+ const entries = (resp && resp.entries) || [];
5498
+ if (entries.length === 0) {
5499
+ bodyEl.innerHTML = '<div style="color:var(--text-dim)">No blockers recorded' +
5500
+ ((resp && resp.total != null) ? ' (total ' + escapeHtml(String(resp.total)) + ')' : '') + '.</div>';
5501
+ return;
5502
+ }
5503
+ bodyEl.innerHTML =
5504
+ '<table style="width:100%;border-collapse:collapse;font-size:13px">' +
5505
+ '<thead><tr style="text-align:left;color:var(--text-dim)">' +
5506
+ '<th style="padding:6px 8px">State</th>' +
5507
+ '<th style="padding:6px 8px">ID</th>' +
5508
+ '<th style="padding:6px 8px">Detected</th>' +
5509
+ '<th style="padding:6px 8px">Origin</th>' +
5510
+ '<th style="padding:6px 8px;text-align:right">Updated</th>' +
5511
+ '</tr></thead><tbody>' +
5512
+ entries.map(e =>
5513
+ '<tr style="border-top:1px solid var(--border);vertical-align:top">' +
5514
+ '<td style="padding:6px 8px">' + blockerStateBadge(e.state) + '</td>' +
5515
+ '<td style="padding:6px 8px;font-family:monospace;color:var(--text-dim)">' + escapeHtml(String(e.id || '—')) + '</td>' +
5516
+ '<td style="padding:6px 8px">' + escapeHtml(String(e.detectedText || '')) + blockerTerminalLine(e) + '</td>' +
5517
+ '<td style="padding:6px 8px">' + escapeHtml(String(e.origin || '—')) + '</td>' +
5518
+ '<td style="padding:6px 8px;text-align:right;white-space:nowrap">' + escapeHtml(fmtRelTime(e.updatedAt || e.createdAt)) + '</td>' +
5519
+ '</tr>'
5520
+ ).join('') +
5521
+ '</tbody></table>';
5522
+ } catch (err) {
5523
+ const m = err && err.message ? String(err.message) : String(err);
5524
+ // 503 → the Blocker Ledger feature is off (monitoring.blockerLedger.enabled false, the default).
5525
+ if (/503|unavailable|disabled|not initialized/i.test(m)) {
5526
+ bodyEl.innerHTML = '<div style="color:var(--text-dim)">Blocker Ledger isn\'t turned on yet ' +
5527
+ '(enable <code>monitoring.blockerLedger.enabled</code>).</div>';
5528
+ } else {
5529
+ bodyEl.innerHTML = '<div style="color:var(--red)">Error: ' + escapeHtml(m) + '</div>';
5530
+ }
5531
+ }
5532
+ }
5533
+
5431
5534
  // ── Threadline → Telegram bridge settings ──────────────────
5432
5535
  let tlBridgeSettings = null;
5433
5536
  let tlBridgeWiring = false;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,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;AAmG7D,OAAO,EAAE,WAAW,EA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AC,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"}
@@ -7757,7 +7757,7 @@ export async function startServer(options) {
7757
7757
  // Cartographer doc-tree — hierarchical semantic map with git-hash staleness
7758
7758
  // (cartographer-doc-tree-schema spec #1). Ships dark behind cartographer.enabled;
7759
7759
  // null → /cartographer/* routes return 503.
7760
- const cartographerEnabled = config.cartographer?.enabled ?? false;
7760
+ const cartographerEnabled = resolveDevAgentGate(config.cartographer?.enabled, config);
7761
7761
  const cartographer = cartographerEnabled
7762
7762
  ? new CartographerTree({ projectDir: config.projectDir, stateDir: config.stateDir })
7763
7763
  : null;
@@ -7765,16 +7765,19 @@ export async function startServer(options) {
7765
7765
  console.log(pc.green(' Cartographer doc-tree enabled'));
7766
7766
  // Cartographer doc-freshness sweep (spec #2). In-process poller that authors
7767
7767
  // stale/never-authored node summaries on a LIGHT model routed OFF Claude.
7768
- // Ships dark behind freshnessSweep.enabled AND egressAcknowledged (off-Claude
7769
- // authoring transmits source content to a third-party framework a separate
7770
- // consent gate). The off-Claude guarantee needs the IntelligenceRouter
7771
- // (router.for + defaultFramework); if routing is an unrouted provider the
7772
- // sweep refuses to start (it could not enforce off-Claude).
7768
+ // Ships dark behind freshnessSweep.enabled ONLY — the redundant egressAcknowledged
7769
+ // second gate was removed (DEV-AGENT-DARK-GATE-ENFORCEMENT Slice A3): one honest
7770
+ // opt-in flag, not two. This is the one cost-bearing cartographer surface and stays
7771
+ // an explicit opt-in EVEN on a dev agent (it bills a third-party account every pass),
7772
+ // so it is in DARK_GATE_EXCLUSIONS (cost-bearing), NOT dev-gated. The off-Claude
7773
+ // guarantee still needs the IntelligenceRouter (router.for + defaultFramework); if
7774
+ // routing is an unrouted provider the sweep refuses to start (it could not enforce
7775
+ // off-Claude) — that cost-protecting probe is UNCHANGED.
7773
7776
  let cartographerSweepPoller = null;
7774
7777
  if (cartographer) {
7775
7778
  const fsCfg = config.cartographer?.freshnessSweep;
7776
7779
  const num = (v, d) => (typeof v === 'number' && Number.isFinite(v) ? v : d);
7777
- if (fsCfg?.enabled && fsCfg?.egressAcknowledged && sharedLlmQueue) {
7780
+ if (fsCfg?.enabled && sharedLlmQueue) {
7778
7781
  const routerLike = sharedIntelligence &&
7779
7782
  typeof sharedIntelligence.for === 'function' &&
7780
7783
  typeof sharedIntelligence.defaultFramework === 'string'