wicked-crew 0.7.28 → 0.7.30

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 (146) hide show
  1. package/README.md +12 -1
  2. package/dist/api/chat-scope.d.ts +210 -0
  3. package/dist/api/chat-scope.d.ts.map +1 -0
  4. package/dist/api/chat-scope.js +728 -0
  5. package/dist/api/chat-scope.js.map +1 -0
  6. package/dist/api/diagnostics.d.ts +30 -2
  7. package/dist/api/diagnostics.d.ts.map +1 -1
  8. package/dist/api/diagnostics.js +73 -5
  9. package/dist/api/diagnostics.js.map +1 -1
  10. package/dist/api/governance-health.d.ts +171 -0
  11. package/dist/api/governance-health.d.ts.map +1 -0
  12. package/dist/api/governance-health.js +379 -0
  13. package/dist/api/governance-health.js.map +1 -0
  14. package/dist/api/open-path.d.ts.map +1 -1
  15. package/dist/api/open-path.js +2 -1
  16. package/dist/api/open-path.js.map +1 -1
  17. package/dist/api/post-hoc-deliver.d.ts +9 -5
  18. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  19. package/dist/api/post-hoc-deliver.js +21 -7
  20. package/dist/api/post-hoc-deliver.js.map +1 -1
  21. package/dist/api/routes.d.ts +70 -12
  22. package/dist/api/routes.d.ts.map +1 -1
  23. package/dist/api/routes.js +375 -60
  24. package/dist/api/routes.js.map +1 -1
  25. package/dist/api/seat-health.d.ts +38 -0
  26. package/dist/api/seat-health.d.ts.map +1 -1
  27. package/dist/api/seat-health.js +88 -5
  28. package/dist/api/seat-health.js.map +1 -1
  29. package/dist/api/seat-signin.d.ts.map +1 -1
  30. package/dist/api/seat-signin.js +49 -23
  31. package/dist/api/seat-signin.js.map +1 -1
  32. package/dist/api/seat-standing.d.ts +101 -0
  33. package/dist/api/seat-standing.d.ts.map +1 -0
  34. package/dist/api/seat-standing.js +138 -0
  35. package/dist/api/seat-standing.js.map +1 -0
  36. package/dist/api/server.d.ts.map +1 -1
  37. package/dist/api/server.js +37 -0
  38. package/dist/api/server.js.map +1 -1
  39. package/dist/campaigns/routes.d.ts +4 -4
  40. package/dist/cli/governance.d.ts +131 -0
  41. package/dist/cli/governance.d.ts.map +1 -0
  42. package/dist/cli/governance.js +354 -0
  43. package/dist/cli/governance.js.map +1 -0
  44. package/dist/cli/index.js +102 -3
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/core/adapter.d.ts +99 -1
  47. package/dist/core/adapter.d.ts.map +1 -1
  48. package/dist/core/adapter.js +149 -8
  49. package/dist/core/adapter.js.map +1 -1
  50. package/dist/core/bridge-path.d.ts +21 -0
  51. package/dist/core/bridge-path.d.ts.map +1 -1
  52. package/dist/core/bridge-path.js +37 -0
  53. package/dist/core/bridge-path.js.map +1 -1
  54. package/dist/core/bridge-reaper.d.ts.map +1 -1
  55. package/dist/core/bridge-reaper.js +11 -4
  56. package/dist/core/bridge-reaper.js.map +1 -1
  57. package/dist/core/deliver-text.d.ts +184 -0
  58. package/dist/core/deliver-text.d.ts.map +1 -0
  59. package/dist/core/deliver-text.js +434 -0
  60. package/dist/core/deliver-text.js.map +1 -0
  61. package/dist/core/deliver-triage.d.ts +90 -0
  62. package/dist/core/deliver-triage.d.ts.map +1 -0
  63. package/dist/core/deliver-triage.js +106 -0
  64. package/dist/core/deliver-triage.js.map +1 -0
  65. package/dist/core/deliver.d.ts +103 -9
  66. package/dist/core/deliver.d.ts.map +1 -1
  67. package/dist/core/deliver.js +244 -46
  68. package/dist/core/deliver.js.map +1 -1
  69. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  70. package/dist/core/estate-mcp-client.js +7 -2
  71. package/dist/core/estate-mcp-client.js.map +1 -1
  72. package/dist/core/exec.d.ts.map +1 -1
  73. package/dist/core/exec.js +11 -1
  74. package/dist/core/exec.js.map +1 -1
  75. package/dist/core/governance-store.d.ts +219 -0
  76. package/dist/core/governance-store.d.ts.map +1 -0
  77. package/dist/core/governance-store.js +290 -0
  78. package/dist/core/governance-store.js.map +1 -0
  79. package/dist/core/repoPaths.d.ts +36 -5
  80. package/dist/core/repoPaths.d.ts.map +1 -1
  81. package/dist/core/repoPaths.js +46 -4
  82. package/dist/core/repoPaths.js.map +1 -1
  83. package/dist/interactive/bridge-pool.d.ts +29 -24
  84. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  85. package/dist/interactive/bridge-pool.js +74 -7
  86. package/dist/interactive/bridge-pool.js.map +1 -1
  87. package/dist/interactive/chat-events.d.ts.map +1 -1
  88. package/dist/interactive/chat-events.js +5 -2
  89. package/dist/interactive/chat-events.js.map +1 -1
  90. package/dist/interactive/council-outcome.d.ts +28 -0
  91. package/dist/interactive/council-outcome.d.ts.map +1 -0
  92. package/dist/interactive/council-outcome.js +57 -0
  93. package/dist/interactive/council-outcome.js.map +1 -0
  94. package/dist/interactive/demo-events.d.ts.map +1 -1
  95. package/dist/interactive/demo-events.js +5 -2
  96. package/dist/interactive/demo-events.js.map +1 -1
  97. package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
  98. package/dist/interactive/doc-delete-routes.js +3 -2
  99. package/dist/interactive/doc-delete-routes.js.map +1 -1
  100. package/dist/interactive/draft-events.d.ts.map +1 -1
  101. package/dist/interactive/draft-events.js +5 -2
  102. package/dist/interactive/draft-events.js.map +1 -1
  103. package/dist/interactive/edit-events.d.ts.map +1 -1
  104. package/dist/interactive/edit-events.js +5 -2
  105. package/dist/interactive/edit-events.js.map +1 -1
  106. package/dist/projects/auto-refresh.d.ts +54 -0
  107. package/dist/projects/auto-refresh.d.ts.map +1 -0
  108. package/dist/projects/auto-refresh.js +76 -0
  109. package/dist/projects/auto-refresh.js.map +1 -0
  110. package/dist/projects/graph-paths.d.ts +4 -2
  111. package/dist/projects/graph-paths.d.ts.map +1 -1
  112. package/dist/projects/graph-paths.js +4 -2
  113. package/dist/projects/graph-paths.js.map +1 -1
  114. package/dist/projects/graph.d.ts +20 -6
  115. package/dist/projects/graph.d.ts.map +1 -1
  116. package/dist/projects/graph.js +40 -13
  117. package/dist/projects/graph.js.map +1 -1
  118. package/dist/projects/routes.d.ts.map +1 -1
  119. package/dist/projects/routes.js +30 -11
  120. package/dist/projects/routes.js.map +1 -1
  121. package/dist/projects/state-home.d.ts +6 -0
  122. package/dist/projects/state-home.d.ts.map +1 -1
  123. package/dist/projects/state-home.js +9 -1
  124. package/dist/projects/state-home.js.map +1 -1
  125. package/dist/skills/guards.d.ts +17 -6
  126. package/dist/skills/guards.d.ts.map +1 -1
  127. package/dist/skills/guards.js +42 -15
  128. package/dist/skills/guards.js.map +1 -1
  129. package/dist/skills/plugin-source.d.ts.map +1 -1
  130. package/dist/skills/plugin-source.js +3 -0
  131. package/dist/skills/plugin-source.js.map +1 -1
  132. package/dist/skills/refs.d.ts +181 -17
  133. package/dist/skills/refs.d.ts.map +1 -1
  134. package/dist/skills/refs.js +345 -26
  135. package/dist/skills/refs.js.map +1 -1
  136. package/dist/skills/store.d.ts +22 -1
  137. package/dist/skills/store.d.ts.map +1 -1
  138. package/dist/skills/store.js +161 -23
  139. package/dist/skills/store.js.map +1 -1
  140. package/dist/studio/assets/index-CWUS9Ump.js +542 -0
  141. package/dist/studio/assets/{index-CK1uJWs2.css → index-_ydd-jKd.css} +1 -1
  142. package/dist/studio/index.html +2 -2
  143. package/dist/studio/testid-inventory.json +567 -6
  144. package/endpoint-manifest.json +67 -14
  145. package/package.json +4 -4
  146. package/dist/studio/assets/index-CdmCMh2f.js +0 -539
@@ -1,4 +1,5 @@
1
1
  import type { CoreEvent, LaunchRunInput, RepoEntry, RepoOnboardRef, SessionView, RecordedEvent, GovernancePolicy, ConformanceRule, GovernanceScoreboard, GovernanceClaim, SteeringImportEntry, SteeringImportResult, GovernanceEvalReport, GovernanceEvalSample, ImportEvalCorpusResponse, CoverageReport, GraphKind, WorkflowDef, CrewSystemSettings, Project, ProjectMember, InteractionRequest, Campaign, CampaignDef } from './types.js';
2
+ import { type GovernanceStoreLocation } from './governance-store.js';
2
3
  /** Where the daemon persists system settings. Exported so tests write fixtures to the ONE
3
4
  * spelling of this path (the tests/ tree is audited against spelling core paths itself).
4
5
  *
@@ -19,6 +20,21 @@ export declare function settingsFilePath(): string;
19
20
  *
20
21
  * Exported so the FINDING-002 restart-hydration path is unit-testable without spawning a Core. */
21
22
  export declare function readOverlayWorkflows(dir: string, builtinIds: ReadonlySet<string>): WorkflowDef[];
23
+ /** The engine's replay report (`Core.replayEmitOutbox`), parsed. */
24
+ export interface EmitOutboxReplayReport {
25
+ /** Non-empty lines read from the outbox. */
26
+ read: number;
27
+ /** Entries written to the store as EVENT nodes. */
28
+ replayed: number;
29
+ /** Entries that did not land — the ORIGINAL line verbatim (so the caller can keep it dead-lettered) and why. */
30
+ failed: Array<{
31
+ line: string;
32
+ reason: string;
33
+ }>;
34
+ /** Entries already on the store from an earlier replay (deterministic replay ids make a re-replay a
35
+ * no-op); absent on an engine that predates the field. */
36
+ already_present?: number;
37
+ }
22
38
  export declare const BUILTIN_WORKFLOWS: WorkflowDef[];
23
39
  /**
24
40
  * Chat is not available in this deployment at all — a capability gap, never a bad request.
@@ -96,6 +112,15 @@ export declare class GovernanceEvalsUnsupportedError extends Error {
96
112
  export declare class GovernanceScoreboardUnsupportedError extends Error {
97
113
  constructor(what: string);
98
114
  }
115
+ /**
116
+ * Replaying a dead-letter outbox is not available in this deployment — the installed
117
+ * wicked-core-ts predates the `Core.replayEmitOutbox` static (crew#495's engine companion). Typed
118
+ * for the same reason as `SteeringUnsupportedError`: the CLI says "upgrade the engine" (exit 2) and
119
+ * never pretends the entries landed. Gated on METHOD PRESENCE, the campaigns doctrine.
120
+ */
121
+ export declare class GovernanceReplayUnsupportedError extends Error {
122
+ constructor(what: string);
123
+ }
99
124
  /** One live chat on the enumerate surface — see {@link CoreAdapter.chatList}. */
100
125
  export interface ChatSummary {
101
126
  chatId: string;
@@ -103,6 +128,19 @@ export interface ChatSummary {
103
128
  seats: string[];
104
129
  /** Seconds since the chat's last open/ensure/turn; `null` when it has no activity stamp. */
105
130
  idleSecs: number | null;
131
+ /** The scope the engine recorded at open (wicked-core#410 / crew#502): where the seats run, the
132
+ * graph their read-only estate MCP is bound to, the roots in scope. ABSENT (not null) on an
133
+ * engine predating chat scope — `chatScopeApplied` reads exactly that difference. */
134
+ cwd?: string | null;
135
+ codeGraphDb?: string | null;
136
+ readRoots?: string[];
137
+ }
138
+ /** What the daemon hands the engine as a chat's scope — `chatOpen`'s `scopeJson`, parsed. */
139
+ export interface ChatScopeJson {
140
+ /** The estate graph the seats' READ-ONLY estate MCP is bound to; `null` ⇒ no estate MCP. */
141
+ codeGraphDb: string | null;
142
+ /** The repository roots in scope, absolute. */
143
+ readRoots: string[];
106
144
  }
107
145
  /** A parsed-CoreEvent listener. */
108
146
  export type CoreEventListener = (event: CoreEvent) => void;
@@ -126,6 +164,14 @@ export interface CoreAdapterOptions {
126
164
  engineExec?: boolean;
127
165
  /** The wicked-bus SQLite db the exec seam publishes/consumes over. Required when `engineExec` is on. */
128
166
  busDbPath?: string;
167
+ /**
168
+ * The governance store + dead-letter outbox this daemon hands the engine (crew#495 / F-022) —
169
+ * resolved by the CLI (`core/governance-store.ts`), exported to `process.env` HERE, before the
170
+ * Core exists, as `WICKED_ESTATE_DB` + `WICKED_APPS_EMIT_DEADLETTER` (the emit seam reads both at
171
+ * emit time). Absent — a library boot, a unit test — exports nothing: the engine keeps whatever
172
+ * the process carried (the hermetic test arming included) and `/diagnostics` reports `store: null`.
173
+ */
174
+ governanceStore?: GovernanceStoreLocation;
129
175
  }
130
176
  /** The ids of a workflow's phases that carry a HUMAN gate (`human_confirm` unconditional, or the
131
177
  * conditional `human_confirm_if`) — i.e. the phases that will PAUSE for a person.
@@ -190,7 +236,35 @@ export declare class CoreAdapter {
190
236
  * `api/server.ts`, crew#309).
191
237
  */
192
238
  readonly stub: boolean;
239
+ /** The governance store this adapter exported to the engine (crew#495), or `null` when none was resolved. */
240
+ readonly governanceStore: GovernanceStoreLocation | null;
241
+ /**
242
+ * This daemon's own bound origin, resolved LAZILY (crew#524): the adapter exists before the
243
+ * server listens, so `registerRoutes` hands a getter rather than a value. The deliver phase
244
+ * composed for a run bakes the origin in, so its script can ask `GET /runs/:id/deliver-text`
245
+ * for the run-derived PR text at delivery time and the PR body can link the run. `null` (a
246
+ * CLI-driven adapter with no daemon) ⇒ the script carries only its launch-time text.
247
+ */
248
+ private deliverApiOrigin;
249
+ /** Hand the adapter the way to learn this daemon's own origin (see `deliverApiOrigin`). */
250
+ setDeliverApiOrigin(get: () => string | null): void;
193
251
  constructor(opts: CoreAdapterOptions);
252
+ /**
253
+ * The engine's EVENT-node counter over an estate store (`Core.eventStoreCount`, crew#495's
254
+ * companion binding), or `null` when the installed addon predates it — `/diagnostics.governance`
255
+ * then reports `records: { total: null, sinceBoot: null }`, honestly, never a fabricated 0. A
256
+ * store FILE that does not exist yet counts as 0: nothing has landed, which is a number, not an
257
+ * unknown (the engine's read-only open refuses a missing file, and that refusal is not "unknown").
258
+ */
259
+ static eventStoreCounter(): ((dbPath: string) => Promise<number>) | null;
260
+ /** Whether the installed addon can replay a dead-letter outbox (`Core.replayEmitOutbox`, crew#495). */
261
+ static replayEmitOutboxSupported(): boolean;
262
+ /**
263
+ * Replay the engine's NDJSON spool records at `outboxPath` into the estate store at `dbPath` —
264
+ * the engine writes each as the EVENT node it should have been (its original `ts` restored where
265
+ * the record carries one). Throws {@link GovernanceReplayUnsupportedError} on an older addon.
266
+ */
267
+ static replayEmitOutbox(outboxPath: string, dbPath: string): Promise<EmitOutboxReplayReport>;
194
268
  /** Register a CoreEvent listener. Returns an unsubscribe function. */
195
269
  onEvent(listener: CoreEventListener): () => void;
196
270
  /** Register a launch listener (`LaunchNotice`). Returns an unsubscribe function. */
@@ -339,11 +413,25 @@ export declare class CoreAdapter {
339
413
  score: number;
340
414
  source: string;
341
415
  }[]>;
342
- chatOpen(chatId: string, clis: string[], cwd?: string): Promise<{
416
+ /**
417
+ * Open a chat in a SCOPE (wicked-core#410 / crew#502): `cwd` is the seats' working directory
418
+ * (the chat's scratch root — the route never passes a repo or the daemon's cwd), `scope` the
419
+ * graph and read roots. An addon predating chat scope honours `cwd` and silently drops `scope`;
420
+ * callers that promise grounding confirm it with {@link chatScopeApplied} rather than assume.
421
+ */
422
+ chatOpen(chatId: string, clis: string[], cwd?: string, scope?: ChatScopeJson): Promise<{
343
423
  cliKey: string;
344
424
  ok: boolean;
345
425
  error?: string;
346
426
  }[]>;
427
+ /**
428
+ * Did the engine RECORD a scope for `chatId` (wicked-core#410)? `true` when its `chatList` row
429
+ * carries the scope fields, `false` when the row exists without them (an addon that ignored
430
+ * `scopeJson` — the chat runs in its cwd but with no estate MCP and no advertised roots), `null`
431
+ * when it cannot be told (no enumerate surface, or no row). Read, never inferred from a version
432
+ * pin: the field's presence IS the capability.
433
+ */
434
+ chatScopeApplied(chatId: string): Promise<boolean | null>;
347
435
  chatSend(chatId: string, text: string, targets?: string[], cwd?: string): Promise<string[]>;
348
436
  chatSeats(chatId: string): Promise<string[]>;
349
437
  /**
@@ -401,8 +489,18 @@ export declare class CoreAdapter {
401
489
  */
402
490
  launchOnboardingRun(repoId: string, repoName: string): Promise<string>;
403
491
  private _doOnboardingLaunch;
492
+ /**
493
+ * The roster a run of `workflowId` should carry as its seat pool. A workflow whose every phase
494
+ * runs a TOOL executor convenes no council and dispatches no seat, so its pool is `[]` — the
495
+ * engine routes each unit `tool` without consulting the pool (verified against the engine: an
496
+ * onboarding launch with `clis: []` distributes both units to `wicked-estate`). Any workflow
497
+ * with an agent phase — or one this daemon cannot read — gets the full roster, as before.
498
+ */
499
+ seatsForWorkflow(workflowId: string): unknown[];
404
500
  /** Return the onboarding run id for a repo (undefined if not launched this session). */
405
501
  getOnboardRunId(repoId: string): string | undefined;
502
+ /** The repo an onboarding run launched by THIS daemon process was for (undefined for any other run). */
503
+ onboardedRepoOf(runId: string): string | undefined;
406
504
  /** List every registered repo. */
407
505
  listRepos(): Promise<RepoEntry[]>;
408
506
  /** All registered governance policies. */
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","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c,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvE,0FAA0F;IAC1F,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMpC,WAAW,IAAI,OAAO,CAAC,kBAAkB,CAAC;IA+F1C,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;IASrF;;;OAGG;IACH,KAAK,IAAI,IAAI;CAMd"}
@@ -11,6 +11,7 @@ import { composeDeliverWorkflow, DELIVER_PHASE_ID, EVIDENCE_FLOOR_PIN } from './
11
11
  import { CAMPAIGN_WORKFLOW_PREFIX } from '../campaigns/plan.js';
12
12
  import { composeDeliverableFloor, DELIVERABLE_FLOOR_PHASE_ID } from './deliverable-floor.js';
13
13
  import { resolveProjectGraphBinding } from '../projects/graph.js';
14
+ import { applyGovernanceStoreEnv, isStoreSpec } from './governance-store.js';
14
15
  /** Resolved path under the user's home directory. */
15
16
  function wickedDir(...parts) {
16
17
  const home = process.env.HOME ?? process.env.USERPROFILE ?? '/tmp';
@@ -545,6 +546,20 @@ export class GovernanceScoreboardUnsupportedError extends Error {
545
546
  this.name = 'GovernanceScoreboardUnsupportedError';
546
547
  }
547
548
  }
549
+ /**
550
+ * Replaying a dead-letter outbox is not available in this deployment — the installed
551
+ * wicked-core-ts predates the `Core.replayEmitOutbox` static (crew#495's engine companion). Typed
552
+ * for the same reason as `SteeringUnsupportedError`: the CLI says "upgrade the engine" (exit 2) and
553
+ * never pretends the entries landed. Gated on METHOD PRESENCE, the campaigns doctrine.
554
+ */
555
+ export class GovernanceReplayUnsupportedError extends Error {
556
+ constructor(what) {
557
+ super(`${what} is not supported by this wicked-core build (the installed wicked-core-ts has no ` +
558
+ 'replayEmitOutbox binding — upgrade it to a release carrying the crew#495 governance ' +
559
+ 'store companion)');
560
+ this.name = 'GovernanceReplayUnsupportedError';
561
+ }
562
+ }
548
563
  /** The engine's own way of reporting a build that cannot do chat, raised at call time. */
549
564
  const ENGINE_CHAT_UNSUPPORTED = /chat unsupported/i;
550
565
  /**
@@ -651,6 +666,20 @@ export class CoreAdapter {
651
666
  * `api/server.ts`, crew#309).
652
667
  */
653
668
  stub;
669
+ /** The governance store this adapter exported to the engine (crew#495), or `null` when none was resolved. */
670
+ governanceStore;
671
+ /**
672
+ * This daemon's own bound origin, resolved LAZILY (crew#524): the adapter exists before the
673
+ * server listens, so `registerRoutes` hands a getter rather than a value. The deliver phase
674
+ * composed for a run bakes the origin in, so its script can ask `GET /runs/:id/deliver-text`
675
+ * for the run-derived PR text at delivery time and the PR body can link the run. `null` (a
676
+ * CLI-driven adapter with no daemon) ⇒ the script carries only its launch-time text.
677
+ */
678
+ deliverApiOrigin = null;
679
+ /** Hand the adapter the way to learn this daemon's own origin (see `deliverApiOrigin`). */
680
+ setDeliverApiOrigin(get) {
681
+ this.deliverApiOrigin = get;
682
+ }
654
683
  constructor(opts) {
655
684
  // Arm the EVENT-DRIVEN execution-mediation seam BEFORE spawning the Core: the Rust actor reads
656
685
  // `WICKED_BUS_EXEC` + `WICKED_BUS_DB` from the process env at spawn time (wicked-core actor::run),
@@ -680,6 +709,13 @@ export class CoreAdapter {
680
709
  if (wcExe)
681
710
  process.env['WICKED_CORE_EXE'] = wcExe;
682
711
  }
712
+ // The governance store (crew#495): export the engine's store + outbox variables and create the
713
+ // sidecar BEFORE the engine exists, in the same breath as the other engine env above. Without
714
+ // this, every `wicked.*` governance event the engine emits dead-letters under the operator's
715
+ // HOME — silently, on every default install.
716
+ this.governanceStore = opts.governanceStore ?? null;
717
+ if (this.governanceStore !== null)
718
+ applyGovernanceStoreEnv(this.governanceStore);
683
719
  this.stub = opts.stub === true;
684
720
  this.dbPath = opts.dbPath;
685
721
  this.core = this.stub ? Core.spawnStub(opts.dbPath) : Core.spawn(opts.dbPath);
@@ -706,6 +742,55 @@ export class CoreAdapter {
706
742
  }
707
743
  });
708
744
  }
745
+ /**
746
+ * The engine's EVENT-node counter over an estate store (`Core.eventStoreCount`, crew#495's
747
+ * companion binding), or `null` when the installed addon predates it — `/diagnostics.governance`
748
+ * then reports `records: { total: null, sinceBoot: null }`, honestly, never a fabricated 0. A
749
+ * store FILE that does not exist yet counts as 0: nothing has landed, which is a number, not an
750
+ * unknown (the engine's read-only open refuses a missing file, and that refusal is not "unknown").
751
+ */
752
+ static eventStoreCounter() {
753
+ const fn = Core.eventStoreCount;
754
+ if (typeof fn !== 'function')
755
+ return null;
756
+ return async (dbPath) => {
757
+ if (!isStoreSpec(dbPath) && !existsSync(dbPath))
758
+ return 0;
759
+ const raw = await fn.call(Core, dbPath);
760
+ const n = Number(JSON.parse(raw));
761
+ if (!Number.isInteger(n) || n < 0)
762
+ throw new Error(`eventStoreCount answered a non-count: ${raw}`);
763
+ return n;
764
+ };
765
+ }
766
+ /** Whether the installed addon can replay a dead-letter outbox (`Core.replayEmitOutbox`, crew#495). */
767
+ static replayEmitOutboxSupported() {
768
+ return typeof Core.replayEmitOutbox === 'function';
769
+ }
770
+ /**
771
+ * Replay the engine's NDJSON spool records at `outboxPath` into the estate store at `dbPath` —
772
+ * the engine writes each as the EVENT node it should have been (its original `ts` restored where
773
+ * the record carries one). Throws {@link GovernanceReplayUnsupportedError} on an older addon.
774
+ */
775
+ static async replayEmitOutbox(outboxPath, dbPath) {
776
+ const fn = Core.replayEmitOutbox;
777
+ if (typeof fn !== 'function') {
778
+ throw new GovernanceReplayUnsupportedError('Replaying a dead-letter outbox');
779
+ }
780
+ const raw = await fn.call(Core, outboxPath, dbPath);
781
+ const parsed = JSON.parse(raw);
782
+ if (typeof parsed.read !== 'number' ||
783
+ typeof parsed.replayed !== 'number' ||
784
+ !Array.isArray(parsed.failed)) {
785
+ throw new Error(`replayEmitOutbox answered an unexpected report: ${raw.slice(0, 200)}`);
786
+ }
787
+ return {
788
+ read: parsed.read,
789
+ replayed: parsed.replayed,
790
+ failed: parsed.failed,
791
+ ...(typeof parsed.already_present === 'number' ? { already_present: parsed.already_present } : {}),
792
+ };
793
+ }
709
794
  /** Register a CoreEvent listener. Returns an unsubscribe function. */
710
795
  onEvent(listener) {
711
796
  this.listeners.add(listener);
@@ -908,11 +993,16 @@ export class CoreAdapter {
908
993
  // ("this run opens its PR") is already satisfied.
909
994
  }
910
995
  else {
911
- // The run's intent rides along so the commit the deliver phase makes NAMES what it
912
- // delivered (`wicked-crew run <id>: <intent>`, #318) instead of being an anonymous
913
- // blob. Composition stays DEFERRED (#319): deliver and the deliverable floor fold
914
- // into one def and one registration below, never two armed ids.
915
- composed = composeDeliverWorkflow(composed, input.sessionId, input.problem);
996
+ // The run's intent rides along so the PR title and the commit subject NAME what was
997
+ // delivered (#318 — composed from the intent, never `--fill`, crew#524) instead of an
998
+ // anonymous blob; the repo and this daemon's origin ride too, so the phase's fallback
999
+ // text names the run and its script knows which daemon to ask for the run record.
1000
+ // Composition stays DEFERRED (#319): deliver and the deliverable floor fold into one
1001
+ // def and one registration below, never two armed ids.
1002
+ composed = composeDeliverWorkflow(composed, input.sessionId, input.problem, {
1003
+ repoRef: input.repoRef ?? null,
1004
+ apiOrigin: this.deliverApiOrigin?.() ?? null,
1005
+ });
916
1006
  }
917
1007
  }
918
1008
  if (composed !== null && composed.id !== input.workflow) {
@@ -1236,10 +1326,36 @@ export class CoreAdapter {
1236
1326
  return JSON.parse(await fn.call(this.core, query, k));
1237
1327
  }
1238
1328
  // ── Chat sessions (core#134 / crew#165) ────────────────────────────────────
1239
- async chatOpen(chatId, clis, cwd) {
1240
- const raw = await this.core.chatOpen(chatId, JSON.stringify(clis), cwd ?? null);
1329
+ /**
1330
+ * Open a chat in a SCOPE (wicked-core#410 / crew#502): `cwd` is the seats' working directory
1331
+ * (the chat's scratch root — the route never passes a repo or the daemon's cwd), `scope` the
1332
+ * graph and read roots. An addon predating chat scope honours `cwd` and silently drops `scope`;
1333
+ * callers that promise grounding confirm it with {@link chatScopeApplied} rather than assume.
1334
+ */
1335
+ async chatOpen(chatId, clis, cwd, scope) {
1336
+ const raw = await this.core.chatOpen(chatId, JSON.stringify(clis), cwd ?? null, scope === undefined ? null : JSON.stringify(scope));
1241
1337
  return JSON.parse(raw);
1242
1338
  }
1339
+ /**
1340
+ * Did the engine RECORD a scope for `chatId` (wicked-core#410)? `true` when its `chatList` row
1341
+ * carries the scope fields, `false` when the row exists without them (an addon that ignored
1342
+ * `scopeJson` — the chat runs in its cwd but with no estate MCP and no advertised roots), `null`
1343
+ * when it cannot be told (no enumerate surface, or no row). Read, never inferred from a version
1344
+ * pin: the field's presence IS the capability.
1345
+ */
1346
+ async chatScopeApplied(chatId) {
1347
+ let chats;
1348
+ try {
1349
+ chats = await this.chatList();
1350
+ }
1351
+ catch {
1352
+ return null;
1353
+ }
1354
+ const row = chats.find((c) => c.chatId === chatId);
1355
+ if (row === undefined)
1356
+ return null;
1357
+ return 'readRoots' in row;
1358
+ }
1243
1359
  async chatSend(chatId, text, targets, cwd) {
1244
1360
  const raw = await this.core.chatSend(chatId, text, targets === undefined ? null : JSON.stringify(targets), cwd ?? null);
1245
1361
  return JSON.parse(raw);
@@ -1442,16 +1558,41 @@ export class CoreAdapter {
1442
1558
  await this.launchRun({
1443
1559
  problem: `Onboard repository: ${repoName}`,
1444
1560
  sessionId: runId,
1445
- clisJson: JSON.stringify(CoreAdapter.roster()),
1561
+ // The run's seat pool is the seats the WORKFLOW can use (F-2R2-010): onboarding is two tool
1562
+ // phases routed to the `wicked-estate` executor, so its pool is empty — not the whole roster
1563
+ // dressed up as a 5-seat run with four signed-out seats.
1564
+ clisJson: JSON.stringify(this.seatsForWorkflow('onboarding')),
1446
1565
  workflow: 'onboarding',
1447
1566
  repoRef: repoId,
1448
1567
  });
1449
1568
  this.repoOnboardRunIds.set(repoId, runId);
1450
1569
  }
1570
+ /**
1571
+ * The roster a run of `workflowId` should carry as its seat pool. A workflow whose every phase
1572
+ * runs a TOOL executor convenes no council and dispatches no seat, so its pool is `[]` — the
1573
+ * engine routes each unit `tool` without consulting the pool (verified against the engine: an
1574
+ * onboarding launch with `clis: []` distributes both units to `wicked-estate`). Any workflow
1575
+ * with an agent phase — or one this daemon cannot read — gets the full roster, as before.
1576
+ */
1577
+ seatsForWorkflow(workflowId) {
1578
+ const def = this.getWorkflow(workflowId);
1579
+ if (def === null || def.phases.length === 0)
1580
+ return CoreAdapter.roster();
1581
+ const toolOnly = def.phases.every((p) => p.executor?.type === 'tool');
1582
+ return toolOnly ? [] : CoreAdapter.roster();
1583
+ }
1451
1584
  /** Return the onboarding run id for a repo (undefined if not launched this session). */
1452
1585
  getOnboardRunId(repoId) {
1453
1586
  return this.repoOnboardRunIds.get(repoId);
1454
1587
  }
1588
+ /** The repo an onboarding run launched by THIS daemon process was for (undefined for any other run). */
1589
+ onboardedRepoOf(runId) {
1590
+ for (const [repoId, id] of this.repoOnboardRunIds) {
1591
+ if (id === runId)
1592
+ return repoId;
1593
+ }
1594
+ return undefined;
1595
+ }
1455
1596
  /** List every registered repo. */
1456
1597
  async listRepos() {
1457
1598
  return JSON.parse(await this.core.listRepos());