@principles/workbuddy-adapter 0.9.1 → 0.10.1

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.
@@ -47,8 +47,16 @@ export interface WorkbuddyWorkerCycleOptions {
47
47
  /**
48
48
  * WHO drove this cycle — same attribution contract as the Codex worker
49
49
  * (PRI-1264 + Phase 2 `service_host` driver identity, TD §5.2).
50
+ *
51
+ * PRI-1278 Phase 5 (Companion-runtime removal): the companion worker driver
52
+ * is retired — there is no Companion runtime left that could legitimately
53
+ * produce it. A process still self-declaring `PD_INVOCATION_SOURCE=companion`
54
+ * (a legacy env leftover) is not authoritative: no resident supervisor backs
55
+ * it, so it is attributed as what it factually is — manual. Historical
56
+ * liveness records already persisted with `lastCycleDriver: 'companion'`
57
+ * stay readable as-is; they are durable facts and are never rewritten.
50
58
  */
51
- export declare function workbuddyWorkerCycleDriver(): 'companion' | 'service_host' | 'manual';
59
+ export declare function workbuddyWorkerCycleDriver(): 'service_host' | 'manual';
52
60
  /** Read the persisted liveness record, or null when absent/unreadable. */
53
61
  export declare function readWorkbuddyWorkerLiveness(workspaceDir: string): Record<string, unknown> | null;
54
62
  /**
@@ -22,9 +22,10 @@
22
22
  * scheduler state — and no Codex flag, path or transcript semantics are
23
23
  * borrowed (SPEC §5: 不借用 Codex flag/日志伪装归因).
24
24
  *
25
- * Correctness under concurrent consumers (Companion-spawned `pd workbuddy
26
- * worker` + manual `pd runtime internalization run-once`) is owned by the
27
- * durable Runtime task lease — never by process-local state. The
25
+ * Correctness under concurrent consumers (Service-Host-spawned bounded
26
+ * `pd workbuddy worker --once` + manual `pd runtime internalization
27
+ * run-once`) is owned by the durable Runtime task lease — never by
28
+ * process-local state. The
28
29
  * governance workspace is the single canonical directory
29
30
  * (`~/.workbuddy/pd-workspace`), so two projects never double-schedule:
30
31
  * they share one workspace and the lease serialises consumption.
@@ -36,7 +37,8 @@ import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceCo
36
37
  import { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS } from '../tool-semantics.js';
37
38
  import { catchUpWorkbuddyIngestion } from '../ingestion/catch-up.js';
38
39
  import { readWorkbuddyTargetTurnEvidence } from '../ingestion/pain-receipt-fallback.js';
39
- const WORKER_OWNER = 'companion-worker';
40
+ // Lease/consumer owner label written by the Service-Host-spawned worker.
41
+ const WORKER_OWNER = 'service-host-worker';
40
42
  const DEFAULT_DIAG_CANDIDATE_LIMIT = 5;
41
43
  // ── Cycle liveness (Phase 2, SPEC §11 / TD §2.3: WorkBuddy had NO liveness
42
44
  // record — FR-10 health was undecidable). Same shape and atomic-write
@@ -56,11 +58,17 @@ function isPlainRecord(value) {
56
58
  /**
57
59
  * WHO drove this cycle — same attribution contract as the Codex worker
58
60
  * (PRI-1264 + Phase 2 `service_host` driver identity, TD §5.2).
61
+ *
62
+ * PRI-1278 Phase 5 (Companion-runtime removal): the companion worker driver
63
+ * is retired — there is no Companion runtime left that could legitimately
64
+ * produce it. A process still self-declaring `PD_INVOCATION_SOURCE=companion`
65
+ * (a legacy env leftover) is not authoritative: no resident supervisor backs
66
+ * it, so it is attributed as what it factually is — manual. Historical
67
+ * liveness records already persisted with `lastCycleDriver: 'companion'`
68
+ * stay readable as-is; they are durable facts and are never rewritten.
59
69
  */
60
70
  export function workbuddyWorkerCycleDriver() {
61
71
  const source = process.env.PD_INVOCATION_SOURCE;
62
- if (source === 'companion')
63
- return 'companion';
64
72
  if (source === 'service_host')
65
73
  return 'service_host';
66
74
  return 'manual';
@@ -69,9 +77,9 @@ export function workbuddyWorkerCycleDriver() {
69
77
  * F13 (TD §5.2): the coordinator passes a unique invocation id; when
70
78
  * present it lands in the liveness record so the shared per-workspace file
71
79
  * can be correlated back to the exact Service Host invocation.
72
- * R5 review fix: a manual/companion cycle carries NO invocation id, so the
73
- * patch must CLEAR the field — otherwise a completed manual run would keep
74
- * masquerading under the previous shadow run's id.
80
+ * R5 review fix: a manual (non-Service-Host) cycle carries NO invocation
81
+ * id, so the patch must CLEAR the field — otherwise a completed manual run
82
+ * would keep masquerading under the previous shadow run's id.
75
83
  */
76
84
  function invocationIdLivenessPatch() {
77
85
  const invocationId = process.env.PD_INVOCATION_ID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/workbuddy-adapter",
3
- "version": "0.9.1",
3
+ "version": "0.10.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",
@@ -42,14 +42,14 @@
42
42
  "lint": "eslint \"src/**/*.ts\""
43
43
  },
44
44
  "dependencies": {
45
- "@principles/core": "^8.3.0",
46
- "@principles/host-runtime": "^4.7.1",
47
- "@principles/install-layout": "^0.11.1"
45
+ "@principles/core": "^8.6.0",
46
+ "@principles/host-runtime": "^4.9.4",
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": "16f7e15c5832284db3836b8babed2b7980bca8c9"
64
+ "gitHead": "2d34c8c2614e1b84e4ea2b4c0bb56bab173da97c"
65
65
  }