create-principles-disciple 1.156.0 → 1.156.2

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 (166) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/pain-receipt-fallback.js +3 -2
  3. package/codex-adapter/dist/worker/workspace-worker.js +52 -17
  4. package/codex-adapter/package.json +1 -1
  5. package/core/dist/runtime/adversarial-loop.d.ts.map +1 -1
  6. package/core/dist/runtime/adversarial-loop.js +12 -0
  7. package/core/dist/runtime/adversarial-loop.js.map +1 -1
  8. package/core/dist/runtime/diagnostician-candidate.d.ts.map +1 -1
  9. package/core/dist/runtime/diagnostician-candidate.js +6 -4
  10. package/core/dist/runtime/diagnostician-candidate.js.map +1 -1
  11. package/core/dist/runtime/index.d.ts +9 -2
  12. package/core/dist/runtime/index.d.ts.map +1 -1
  13. package/core/dist/runtime/index.js +10 -2
  14. package/core/dist/runtime/index.js.map +1 -1
  15. package/core/dist/runtime/intent/intent-doc.d.ts +30 -0
  16. package/core/dist/runtime/intent/intent-doc.d.ts.map +1 -1
  17. package/core/dist/runtime/intent/intent-doc.js +47 -0
  18. package/core/dist/runtime/intent/intent-doc.js.map +1 -1
  19. package/core/dist/runtime/intent/intent-snapshot.d.ts +12 -0
  20. package/core/dist/runtime/intent/intent-snapshot.d.ts.map +1 -1
  21. package/core/dist/runtime/intent/intent-snapshot.js +20 -0
  22. package/core/dist/runtime/intent/intent-snapshot.js.map +1 -1
  23. package/core/dist/runtime/internalization/correlation-lineage.d.ts +113 -0
  24. package/core/dist/runtime/internalization/correlation-lineage.d.ts.map +1 -0
  25. package/core/dist/runtime/internalization/correlation-lineage.js +431 -0
  26. package/core/dist/runtime/internalization/correlation-lineage.js.map +1 -0
  27. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +18 -0
  28. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  29. package/core/dist/runtime/internalization/diag-rootcause-runner.js +53 -15
  30. package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
  31. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +58 -5
  32. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
  33. package/core/dist/runtime/internalization/internalization-orchestrator.js +370 -100
  34. package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
  35. package/core/dist/runtime/internalization/internalization-state-machine.d.ts +14 -0
  36. package/core/dist/runtime/internalization/internalization-state-machine.d.ts.map +1 -1
  37. package/core/dist/runtime/internalization/internalization-state-machine.js +22 -0
  38. package/core/dist/runtime/internalization/internalization-state-machine.js.map +1 -1
  39. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +2 -0
  40. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
  41. package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
  42. package/core/dist/runtime/internalization/pitask-metadata.d.ts +31 -0
  43. package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
  44. package/core/dist/runtime/internalization/pitask-metadata.js +54 -1
  45. package/core/dist/runtime/internalization/pitask-metadata.js.map +1 -1
  46. package/core/dist/runtime/internalization/repair-task-identity.d.ts +43 -0
  47. package/core/dist/runtime/internalization/repair-task-identity.d.ts.map +1 -0
  48. package/core/dist/runtime/internalization/repair-task-identity.js +102 -0
  49. package/core/dist/runtime/internalization/repair-task-identity.js.map +1 -0
  50. package/core/dist/runtime/internalization/revision-reopen.d.ts +37 -0
  51. package/core/dist/runtime/internalization/revision-reopen.d.ts.map +1 -1
  52. package/core/dist/runtime/internalization/revision-reopen.js +144 -7
  53. package/core/dist/runtime/internalization/revision-reopen.js.map +1 -1
  54. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts +8 -2
  55. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  56. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +2 -2
  57. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  58. package/core/dist/runtime/internalization/rule-binding-revision.js +3 -3
  59. package/core/dist/runtime/internalization/rule-binding-revision.js.map +1 -1
  60. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
  61. package/core/dist/runtime/internalization/split-diagnostician-runner.js +4 -0
  62. package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
  63. package/core/dist/runtime/pain-admission-disposition.d.ts +8 -4
  64. package/core/dist/runtime/pain-admission-disposition.d.ts.map +1 -1
  65. package/core/dist/runtime/pain-admission-disposition.js +8 -4
  66. package/core/dist/runtime/pain-admission-disposition.js.map +1 -1
  67. package/core/dist/runtime/pain-receipt-recovery.d.ts +38 -10
  68. package/core/dist/runtime/pain-receipt-recovery.d.ts.map +1 -1
  69. package/core/dist/runtime/pain-receipt-recovery.js +266 -30
  70. package/core/dist/runtime/pain-receipt-recovery.js.map +1 -1
  71. package/core/dist/runtime/pain-signal-runtime-factory.d.ts +60 -12
  72. package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
  73. package/core/dist/runtime/pain-signal-runtime-factory.js +200 -142
  74. package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
  75. package/core/dist/runtime/pain-submit-capability.d.ts +14 -3
  76. package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
  77. package/core/dist/runtime/pain-submit-capability.js +21 -9
  78. package/core/dist/runtime/pain-submit-capability.js.map +1 -1
  79. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts +48 -13
  80. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts.map +1 -1
  81. package/core/dist/runtime/pain-target-evidence-reconcile.js +267 -81
  82. package/core/dist/runtime/pain-target-evidence-reconcile.js.map +1 -1
  83. package/core/dist/runtime/pain-to-principle-service.d.ts +2 -5
  84. package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
  85. package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
  86. package/core/dist/runtime/store/runtime-state-manager.d.ts +2 -0
  87. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  88. package/core/dist/runtime/store/runtime-state-manager.js +18 -0
  89. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  90. package/core/dist/runtime/store/task/memory-task-store.d.ts.map +1 -1
  91. package/core/dist/runtime/store/task/memory-task-store.js +20 -0
  92. package/core/dist/runtime/store/task/memory-task-store.js.map +1 -1
  93. package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
  94. package/core/dist/runtime/store/task/sqlite-task-store.js +9 -0
  95. package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
  96. package/core/dist/runtime/store/task/task-store.d.ts +10 -0
  97. package/core/dist/runtime/store/task/task-store.d.ts.map +1 -1
  98. package/core/package.json +1 -1
  99. package/host-runtime/dist/diagnostician-auto-run.js +20 -14
  100. package/host-runtime/dist/index.d.ts +3 -1
  101. package/host-runtime/dist/index.js +15 -1
  102. package/host-runtime/dist/intent-doc-reader.js +1 -1
  103. package/host-runtime/dist/internalization-consumer-cycle.d.ts +102 -1
  104. package/host-runtime/dist/internalization-consumer-cycle.js +177 -95
  105. package/host-runtime/dist/internalization-consumer-governance.d.ts +2 -1
  106. package/host-runtime/dist/internalization-consumer-governance.js +57 -2
  107. package/host-runtime/dist/workspace-pipeline-host-deps.d.ts +65 -0
  108. package/host-runtime/dist/workspace-pipeline-host-deps.js +94 -0
  109. package/host-runtime/dist/workspace-telemetry-emitter.js +14 -0
  110. package/host-runtime/package.json +1 -1
  111. package/install-layout/dist/index.d.ts +1 -0
  112. package/install-layout/dist/index.js +1 -0
  113. package/install-layout/dist/openclaw-config-path.d.ts +9 -0
  114. package/install-layout/dist/openclaw-config-path.js +64 -0
  115. package/install-layout/package.json +1 -1
  116. package/package.json +3 -3
  117. package/pd-cli/dist/commands/codex-worker.js +2 -2
  118. package/pd-cli/dist/commands/codex-worker.js.map +1 -1
  119. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  120. package/pd-cli/dist/commands/diagnose.js +49 -75
  121. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  122. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  123. package/pd-cli/dist/commands/pain-record.js +18 -26
  124. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  125. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  126. package/pd-cli/dist/commands/pain-retry.js +50 -66
  127. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  128. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  129. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +184 -17
  130. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  131. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  132. package/pd-cli/dist/commands/runtime-internalization-run-once.js +209 -127
  133. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  134. package/pd-cli/dist/commands/workbuddy-worker.js +2 -2
  135. package/pd-cli/dist/commands/workbuddy-worker.js.map +1 -1
  136. package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
  137. package/pd-cli/dist/services/config-doctor.js +7 -4
  138. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  139. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
  140. package/pd-cli/dist/services/rulehost-pipeline-runner.js +53 -4
  141. package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
  142. package/pd-cli/package.json +1 -1
  143. package/pd-mcp-server/dist/server.d.ts +7 -0
  144. package/pd-mcp-server/dist/server.js +12 -1
  145. package/pd-mcp-server/dist/submit-assembly.js +2 -1
  146. package/pd-mcp-server/dist/version.d.ts +1 -1
  147. package/pd-mcp-server/dist/version.js +1 -1
  148. package/pd-mcp-server/package.json +1 -1
  149. package/plugin/dist/bundle.js +532 -496
  150. package/plugin/dist/core/config-health.d.ts +6 -0
  151. package/plugin/dist/core/openclaw-config-loader.d.ts +14 -0
  152. package/plugin/dist/core/pain-service.d.ts +26 -0
  153. package/plugin/dist/hooks/openclaw-run-turn-correlation.d.ts +30 -0
  154. package/plugin/dist/hooks/openclaw-target-turn-capture.d.ts +13 -0
  155. package/plugin/dist/hooks/pain-receipt-fallback.d.ts +107 -0
  156. package/plugin/dist/openclaw-sdk.d.ts +15 -0
  157. package/plugin/dist/openclaw-worker.d.ts +3 -0
  158. package/plugin/dist/openclaw-worker.js +288 -287
  159. package/plugin/dist/openclaw.plugin.json +1 -1
  160. package/plugin/openclaw.plugin.json +1 -1
  161. package/plugin/package.json +1 -1
  162. package/release-manager/package.json +1 -1
  163. package/workbuddy-adapter/dist/ingestion/pain-receipt-fallback.js +3 -2
  164. package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +3 -0
  165. package/workbuddy-adapter/dist/worker/workspace-worker.js +48 -15
  166. package/workbuddy-adapter/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "4.3.1",
5
+ "version": "4.4.1",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "4.3.1",
5
+ "version": "4.4.1",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "4.3.1",
3
+ "version": "4.4.1",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.156.0",
3
+ "version": "1.156.2",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  * look-alike strings (SPEC TD §1.3).
32
32
  */
33
33
  import * as path from 'node:path';
34
- import { readSourceMaterialAuthorization } from '@principles/host-runtime';
34
+ import { createConsentLedgerSourceMaterialAuthorization, readSourceMaterialAuthorization } from '@principles/host-runtime';
35
35
  import { isSentinelSessionId } from '@principles/core/runtime';
36
36
  import { listGovernanceConversationTextsForHostTurn } from '@principles/host-runtime';
37
37
  import { recoverTaskIdentityFromReceipt, validatePainSubmitReceipt, } from '@principles/core/runtime';
@@ -201,7 +201,8 @@ export async function attemptPainReceiptFallback(input) {
201
201
  // turn pinned to an unproven id would wedge the task's evidence wait.
202
202
  identity: { sessionId, toolCallId },
203
203
  authorization: { minimalMetadataGranted: input.minimalMetadataGranted },
204
- targetTurnTextAvailable: (hostSessionId, targetTurnId) => workbuddyTargetTurnTextAvailable(normalizedWorkspace, hostSessionId, targetTurnId),
204
+ readTargetTurnEvidence: (hostSessionId, targetTurnId) => readWorkbuddyTargetTurnEvidence(normalizedWorkspace, hostSessionId, targetTurnId),
205
+ sourceMaterialAuthorization: createConsentLedgerSourceMaterialAuthorization(normalizedWorkspace),
205
206
  ...(input.now !== undefined ? { now: input.now } : {}),
206
207
  });
207
208
  return { status: 'attempted', outcome };
@@ -1,3 +1,4 @@
1
+ import { type TargetEvidenceReconcileReport } from '@principles/core/runtime';
1
2
  import { type InternalizationConsumerCycleOutcome, type ConsumerCycleLogger, type ReconcileGovernanceContinuationResult, type SignalLlmClassifier, type Stage2CorrectionCycleReport } from '@principles/host-runtime';
2
3
  import { type WorkbuddyCatchUpResult } from '../ingestion/catch-up.js';
3
4
  export type WorkbuddyWorkerMode = 'ready' | 'manual_action_required' | 'paused' | 'degraded';
@@ -14,6 +15,8 @@ export interface WorkbuddyWorkerCycleStepReport {
14
15
  readonly nextAction?: string;
15
16
  } | null;
16
17
  readonly downstream: InternalizationConsumerCycleOutcome | null;
18
+ /** PRI-1296: bounded exact-target evidence reconcile, before candidate picking. */
19
+ readonly targetEvidenceReconcile?: TargetEvidenceReconcileReport;
17
20
  /** Phase B Stage-2 review step (always last, ≤2 candidates / ≤60s aggregate). */
18
21
  readonly stage2?: Stage2CorrectionCycleReport;
19
22
  }
@@ -31,10 +31,11 @@
31
31
  */
32
32
  import fs from 'node:fs';
33
33
  import path from 'node:path';
34
- import { computeFeatureFlagsFromConfig, createRuntimeStateHandle, createPainSignalBridge, isRetryWaitBackoffElapsed, pickDiagnosticianCandidate, PrincipleTreeLedgerAdapter, resolveDiagnosticianCapability, } from '@principles/core/runtime';
35
- import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, createGovernanceTrajectoryTurnReader, createConsentLedgerSourceMaterialAuthorization, createHostIntentDocReader, isAutomaticPainSubmissionAuthorized, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
34
+ import { computeFeatureFlagsFromConfig, createRuntimeStateHandle, createPainSignalBridge, isRetryWaitBackoffElapsed, pickDiagnosticianCandidate, reconcileWaitingTargetEvidenceTasks, PrincipleTreeLedgerAdapter, resolveDiagnosticianCapability, } from '@principles/core/runtime';
35
+ import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, resolveWorkspacePipelineHostDeps, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
36
36
  import { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS } from '../tool-semantics.js';
37
37
  import { catchUpWorkbuddyIngestion } from '../ingestion/catch-up.js';
38
+ import { readWorkbuddyTargetTurnEvidence } from '../ingestion/pain-receipt-fallback.js';
38
39
  const WORKER_OWNER = 'companion-worker';
39
40
  const DEFAULT_DIAG_CANDIDATE_LIMIT = 5;
40
41
  // ── Cycle liveness (Phase 2, SPEC §11 / TD §2.3: WorkBuddy had NO liveness
@@ -241,6 +242,8 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
241
242
  });
242
243
  // Steps 3–5 — execution authority: internalization_auto_consumer.
243
244
  let diagnostician = null;
245
+ // PRI-1296: filled by the exact-target evidence reconcile below.
246
+ let targetEvidenceReconcile = null;
244
247
  if (diagnosticianDisabled) {
245
248
  diagnostician = {
246
249
  taskId: '',
@@ -297,15 +300,48 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
297
300
  try {
298
301
  const handle = await createRuntimeStateHandle({ workspaceDir, readonly: false });
299
302
  try {
303
+ // SPEC-PD-PIPELINE-SPINE-001 §4.2 (PRI-1292 Phase 2A): ONE assembly
304
+ // point for the five host collaborators. The target-evidence reconcile
305
+ // and any diagnostician bridge in this cycle share the SAME consent
306
+ // authorization instance.
307
+ const hostDeps = resolveWorkspacePipelineHostDeps({
308
+ workspaceDir,
309
+ effectiveConfig: config.effective,
310
+ telemetryPersistenceFailureHandler: (detail) => {
311
+ try {
312
+ emitEvent('WORKBUDDY_WORKER_CRITICAL_TELEMETRY_PERSIST_FAILED', detail);
313
+ }
314
+ catch {
315
+ // Telemetry persistence warnings must never fail the worker cycle.
316
+ }
317
+ },
318
+ });
300
319
  const sweep = await handle.stateManager.runRecoverySweep();
301
320
  if (sweep.recovered > 0 || sweep.errors.length > 0) {
302
321
  emitEvent('WORKBUDDY_WORKER_RECOVERY_SWEEP', JSON.stringify({ recovered: sweep.recovered, failed: sweep.errors.length }));
303
322
  }
323
+ // PRI-1296: reconcile waiting target evidence BEFORE the candidate
324
+ // picker. Catch-up may have just delivered the exact target turn, and
325
+ // the picker SQL excludes waiting tasks; doing this after picking
326
+ // would let diagnosis consume a task before its evidence exists.
327
+ targetEvidenceReconcile = await reconcileWaitingTargetEvidenceTasks({
328
+ stateManager: handle.stateManager,
329
+ readTargetTurnEvidence: (sessionId, turnId) => readWorkbuddyTargetTurnEvidence(workspaceDir, sessionId, turnId),
330
+ sourceMaterialAuthorization: hostDeps.sourceMaterialAuthorization,
331
+ hostKind: 'workbuddy',
332
+ nowIso: new Date().toISOString(),
333
+ });
334
+ if (targetEvidenceReconcile.flipped > 0 || targetEvidenceReconcile.blocked > 0 || targetEvidenceReconcile.errors.length > 0) {
335
+ emitEvent('WORKBUDDY_WORKER_TARGET_EVIDENCE_RECONCILE', JSON.stringify(targetEvidenceReconcile));
336
+ }
304
337
  const candidate = await pickNextDiagnosticianCandidate(handle.stateManager, options.diagnosticianCandidateLimit ?? DEFAULT_DIAG_CANDIDATE_LIMIT);
305
338
  if (candidate !== null) {
306
339
  const stateDir = path.join(workspaceDir, '.state');
307
340
  let releaseBridge;
308
341
  try {
342
+ // PRI-1233 / SPEC §9.2: this worker is where Stage A actually runs
343
+ // for governance-admitted WorkBuddy pains; PRI-1265: the Stage A gets
344
+ // the bound session's ORIGINAL turns through the shared host deps.
309
345
  const bridge = await createPainSignalBridge({
310
346
  workspaceDir,
311
347
  stateDir,
@@ -313,18 +349,15 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
313
349
  owner: WORKER_OWNER,
314
350
  effectiveConfig: config.effective,
315
351
  getEnvVar: (name) => process.env[name],
316
- // PRI-1233 / SPEC §9.2: this worker is where Stage A actually runs
317
- // for governance-admitted WorkBuddy pains — the neutral host reader
318
- // must ride along (flag-off = zero filesystem access inside it).
319
- intentDocReader: createHostIntentDocReader({ workspaceDir, effectiveConfig: config.effective }),
320
- // PRI-1265: the worker's Stage A gets the bound session's ORIGINAL
321
- // turns from the workspace's own consent-tiered governance store.
322
- trajectoryTurnReader: createGovernanceTrajectoryTurnReader({ workspaceDir, sourceMaterialAuthorization: createConsentLedgerSourceMaterialAuthorization(workspaceDir) }),
323
- // PRI-1283 R2: latest-consent gate consulted per assembly / model call.
324
- sourceMaterialAuthorization: createConsentLedgerSourceMaterialAuthorization(workspaceDir),
352
+ intentDocReader: hostDeps.intentDocReader,
353
+ trajectoryTurnReader: hostDeps.trajectoryTurnReader,
354
+ sourceMaterialAuthorization: hostDeps.sourceMaterialAuthorization,
355
+ // PRI-939 Option A: allowlisted runner/bridge events persist to
356
+ // the workspace sink instead of the unsubscribed singleton.
357
+ telemetrySink: hostDeps.telemetrySink,
325
358
  // SPEC §9.6: lazy probe — a revoked flag stops persisted
326
359
  // automatic_hook tasks at the bridge's execution boundary.
327
- isAutoPainSubmissionAuthorized: () => isAutomaticPainSubmissionAuthorized(workspaceDir),
360
+ isAutoPainSubmissionAuthorized: hostDeps.isAutoPainSubmissionAuthorized,
328
361
  }, (release) => { releaseBridge = release; });
329
362
  const executed = await bridge.executePendingDiagnosis({ taskId: candidate.taskId });
330
363
  diagnostician = {
@@ -360,7 +393,7 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
360
393
  mode: 'degraded',
361
394
  reason,
362
395
  nextAction: 'Inspect the governance workspace runtime profile and provider configuration; the task keeps its pending/retry state and no evidence was mutated.',
363
- report: { catchUp, reconcile, diagnostician: null, downstream: null },
396
+ report: { catchUp, reconcile, diagnostician: null, downstream: null, ...(targetEvidenceReconcile !== null ? { targetEvidenceReconcile } : {}) },
364
397
  };
365
398
  }
366
399
  }
@@ -383,7 +416,7 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
383
416
  mode: 'degraded',
384
417
  reason,
385
418
  nextAction: 'Repair WorkBuddy host declaration persistence (.pd/host-tool-semantics/workbuddy.json) before running the downstream internalization cycle; the worker retries automatically on the next cycle.',
386
- report: { catchUp, reconcile, diagnostician, downstream: null },
419
+ report: { catchUp, reconcile, diagnostician, downstream: null, ...(targetEvidenceReconcile !== null ? { targetEvidenceReconcile } : {}) },
387
420
  };
388
421
  }
389
422
  writeLiveness(workspaceDir, { runningStage: 'downstream_cycle', stageDeadline: new Date(Date.now() + LIVENESS_STAGE_DEADLINE_MS.downstream_cycle).toISOString() });
@@ -436,6 +469,6 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
436
469
  ...base,
437
470
  mode: degradedReason !== undefined ? 'degraded' : 'ready',
438
471
  ...(degradedReason !== undefined ? { reason: degradedReason, nextAction: 'Inspect the governance workspace .pd/config.yaml runtime profile and the per-step report above; the worker retries automatically on the next cycle.' } : {}),
439
- report: { catchUp, reconcile, diagnostician, downstream, stage2 },
472
+ report: { catchUp, reconcile, diagnostician, downstream, ...(targetEvidenceReconcile !== null ? { targetEvidenceReconcile } : {}), stage2 },
440
473
  };
441
474
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/workbuddy-adapter",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "WorkBuddy host adapter for Principles Disciple — implements the HostAdapter interface for WorkBuddy's Git Bash command-hook model (ADR-0020 third host, SPEC workbuddy-host-adapter v0.3.0).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",