@principles/workbuddy-adapter 0.11.0 → 0.11.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.
package/dist/pd-hook.js CHANGED
@@ -36,7 +36,7 @@ import path from 'node:path';
36
36
  import process from 'node:process';
37
37
  import { pathToFileURL, fileURLToPath } from 'node:url';
38
38
  import { appendEventLogLine, redactTelemetryString, isRuleHostEvaluatedEventData } from '@principles/core/runtime';
39
- import { createAdaptivePriorityProviderForConfig, createProductionHostRuntime, createWorkbuddyRuleContextProvider, environmentFactDigestOrNull, loadPdConfigForPlugin, parseOwnerStatementPrefix, assessWorkbuddyCorrectionCandidate, resolveSharedCorrectionKeywordStoreForDetection, admitTrustedWorkbuddyLiveCorrection, ensureGovernanceDiagnosticianTask, resolveHostToolSemanticsForHook, recordIdleAuditTurnCompleted, } from '@principles/host-runtime';
39
+ import { createAdaptivePriorityProviderForConfig, createProductionHostRuntime, observeForwardTurnClose, createWorkbuddyRuleContextProvider, environmentFactDigestOrNull, loadPdConfigForPlugin, parseOwnerStatementPrefix, assessWorkbuddyCorrectionCandidate, resolveSharedCorrectionKeywordStoreForDetection, admitTrustedWorkbuddyLiveCorrection, ensureGovernanceDiagnosticianTask, resolveHostToolSemanticsForHook, recordIdleAuditTurnCompleted } from '@principles/host-runtime';
40
40
  import { computeFeatureFlagsFromConfig } from '@principles/core/runtime';
41
41
  import { WorkBuddyHooksHostAdapter } from './host-adapter.js';
42
42
  import { WORKBUDDY_TOOL_SEMANTIC_MAPPINGS, WORKBUDDY_TOOL_SEMANTICS } from './tool-semantics.js';
@@ -406,13 +406,19 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
406
406
  return neutralWithDiagnostics([]);
407
407
  }
408
408
  if (event.kind === 'turn_complete') {
409
+ const closeDiagnostics = observeForwardTurnClose({
410
+ workspaceDir: resolution.workspaceDir,
411
+ hostKind: 'workbuddy',
412
+ sessionId: event.context.sessionId,
413
+ ...(event.context.turnId !== undefined ? { turnId: event.context.turnId } : {}),
414
+ }).map((warning) => diagnostic('degraded', warning, 'Inspect trajectory.db forward evidence; Stop ingestion remains non-blocking.'));
409
415
  // PRI-1171 P2 ticket ⑤: the authenticated Stop hook is the ingestion
410
416
  // trigger. Neutral output is MANDATORY — WorkBuddy injects any stdout
411
417
  // into model-visible context (P04). Flag-off stays completely silent so
412
418
  // the pre-wiring behavior is unchanged; the consent gate and the
413
419
  // transcript port are both inside ingestWorkbuddyConversation.
414
420
  if (flags.workbuddy_conversation_ingestion?.enabled !== true) {
415
- return neutralWithDiagnostics([]);
421
+ return neutralWithDiagnostics(closeDiagnostics);
416
422
  }
417
423
  recordIdleAuditTurnCompleted({
418
424
  workspaceDir: resolution.workspaceDir,
@@ -438,7 +444,7 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
438
444
  return neutralWithDiagnostics(ingestion.warnings.slice(0, 2).map((warning) => diagnostic(warning.startsWith('wb_skipped') ? 'skipped' : 'degraded', warning, 'Inspect the WorkBuddy transcript and the governance trajectory checkpoint; ingestion warnings are bounded and non-blocking.')));
439
445
  }
440
446
  if (ingestion.status === 'skipped')
441
- return neutralWithDiagnostics([]);
447
+ return neutralWithDiagnostics(closeDiagnostics);
442
448
  return neutralWithDiagnostics([diagnostic('degraded', ingestion.reason, ingestion.nextAction)]);
443
449
  }
444
450
  const evidenceDiagnostics = [];
@@ -33,7 +33,7 @@
33
33
  import fs from 'node:fs';
34
34
  import path from 'node:path';
35
35
  import { computeFeatureFlagsFromConfig, createRuntimeStateHandle, createPainSignalBridge, isRetryWaitBackoffElapsed, pickDiagnosticianCandidate, reconcileWaitingTargetEvidenceTasks, PrincipleTreeLedgerAdapter, resolveDiagnosticianCapability, } from '@principles/core/runtime';
36
- import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, runIdleTurnAuditCycle, createIdleTurnAuditorForWorkspace, createSignalClassifierForWorkspace, resolveWorkspacePipelineHostDeps, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
36
+ import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, executeQueuedDiagnosisWithInboxRecovery, runInternalizationConsumerCycle, runStage2CorrectionCycle, runIdleTurnAuditCycle, createIdleTurnAuditorForWorkspace, createSignalClassifierForWorkspace, resolveWorkspacePipelineHostDeps, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
37
37
  import { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS } from '../tool-semantics.js';
38
38
  import { catchUpWorkbuddyIngestion } from '../ingestion/catch-up.js';
39
39
  import { readWorkbuddyTargetTurnEvidence } from '../ingestion/pain-receipt-fallback.js';
@@ -367,7 +367,10 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
367
367
  // automatic_hook tasks at the bridge's execution boundary.
368
368
  isAutoPainSubmissionAuthorized: hostDeps.isAutoPainSubmissionAuthorized,
369
369
  }, (release) => { releaseBridge = release; });
370
- const executed = await bridge.executePendingDiagnosis({ taskId: candidate.taskId });
370
+ const executed = await executeQueuedDiagnosisWithInboxRecovery({
371
+ workspaceDir, task: candidate, stateManager: handle.stateManager,
372
+ execute: () => bridge.executePendingDiagnosis({ taskId: candidate.taskId }),
373
+ });
371
374
  diagnostician = {
372
375
  taskId: candidate.taskId,
373
376
  status: executed.status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/workbuddy-adapter",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
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",
@@ -42,8 +42,8 @@
42
42
  "lint": "eslint \"src/**/*.ts\""
43
43
  },
44
44
  "dependencies": {
45
- "@principles/core": "^9.0.0",
46
- "@principles/host-runtime": "^4.11.0",
45
+ "@principles/core": "^10.0.0",
46
+ "@principles/host-runtime": "^5.0.0",
47
47
  "@principles/install-layout": "^0.12.0"
48
48
  },
49
49
  "devDependencies": {
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "1e6fc5c3f3083d24dc50a65c420609e21307d9d5"
64
+ "gitHead": "293825348a6f4a40cc561f6a59fc42c64d532766"
65
65
  }