@principles/workbuddy-adapter 0.10.0 → 0.10.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, loadPdConfigForPlugin, parseOwnerStatementPrefix, assessWorkbuddyCorrectionCandidate, resolveSharedCorrectionKeywordStoreForDetection, admitTrustedWorkbuddyLiveCorrection, ensureGovernanceDiagnosticianTask, resolveHostToolSemanticsForHook } from '@principles/host-runtime';
39
+ import { createAdaptivePriorityProviderForConfig, createProductionHostRuntime, createWorkbuddyRuleContextProvider, environmentFactDigestOrNull, loadPdConfigForPlugin, parseOwnerStatementPrefix, assessWorkbuddyCorrectionCandidate, resolveSharedCorrectionKeywordStoreForDetection, admitTrustedWorkbuddyLiveCorrection, ensureGovernanceDiagnosticianTask, resolveHostToolSemanticsForHook } 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';
@@ -493,11 +493,20 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
493
493
  };
494
494
  evidenceDiagnostics.push(diagnostic('degraded', `adaptive_activation_${adaptive.readiness}:${adaptive.reason}`, adaptive.nextAction));
495
495
  }
496
+ const hostVersionValue = typeof parsed === 'object' && parsed !== null ? Reflect.get(parsed, 'version') : undefined;
497
+ const hostVersion = typeof hostVersionValue === 'string' && hostVersionValue.trim().length > 0 ? hostVersionValue : null;
496
498
  const result = await createProductionHostRuntime({
497
499
  ...(adaptive?.ok ? { adaptiveGapProvider: adaptive.provider } : {}),
498
500
  ...(projectDir !== undefined ? { projectDir } : {}),
499
501
  hostKind: 'workbuddy',
500
502
  toolSemantics,
503
+ afterToolCallEnvironment: {
504
+ hostVersion,
505
+ runtimeVersion: process.version,
506
+ agentConfigDigest: environmentFactDigestOrNull(config.effective),
507
+ modelConfigDigest: environmentFactDigestOrNull(event.context.modelContext),
508
+ featureFlagsDigest: environmentFactDigestOrNull(flags),
509
+ },
501
510
  events: workbuddyEventEmitter(stateDir, evidenceContext, () => adaptiveTurnFact),
502
511
  // SPEC-RULECODE-HOST-PROMOTION-001 C: the V2 rule context provider over
503
512
  // WorkBuddy's own observable trajectory (same-session tool_calls rows
@@ -37,11 +37,7 @@ import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceCo
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';
40
- // PRI-1278 Phase 5 (Companion-runtime removal): the lease/consumer owner
41
- // label for NEW writes is the Service Host worker identity — the PD Service
42
- // Host is the only background runtime and spawns these bounded worker cycles.
43
- // Historical lease records keep the retired 'companion-worker' string; they
44
- // are durable facts and are deliberately NOT migrated.
40
+ // Lease/consumer owner label written by the Service-Host-spawned worker.
45
41
  const WORKER_OWNER = 'service-host-worker';
46
42
  const DEFAULT_DIAG_CANDIDATE_LIMIT = 5;
47
43
  // ── Cycle liveness (Phase 2, SPEC §11 / TD §2.3: WorkBuddy had NO liveness
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/workbuddy-adapter",
3
- "version": "0.10.0",
3
+ "version": "0.10.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,14 +42,14 @@
42
42
  "lint": "eslint \"src/**/*.ts\""
43
43
  },
44
44
  "dependencies": {
45
- "@principles/core": "^8.4.0",
46
- "@principles/host-runtime": "^4.8.0",
45
+ "@principles/core": "^8.7.0",
46
+ "@principles/host-runtime": "^4.10.0",
47
47
  "@principles/install-layout": "^0.12.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "^26.6.6",
51
51
  "typescript": "^7.0.2",
52
- "vite": "^8.3.6",
52
+ "vite": "^8.4.0",
53
53
  "vitest": "^5.1.0"
54
54
  },
55
55
  "license": "Apache-2.0",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "ff62137821c993773cc7df104a01625310776c51"
64
+ "gitHead": "1da1cdfe14b3c0a471e2b990a2aa376bbefe840b"
65
65
  }