create-principles-disciple 1.153.3 → 1.154.0
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/_release/product-identity.json +1 -1
- package/codex-adapter/dist/ingestion/codex-home.d.ts +1 -0
- package/codex-adapter/dist/ingestion/codex-home.js +19 -7
- package/codex-adapter/dist/ingestion/ingestion.js +34 -7
- package/codex-adapter/dist/pd-hook.js +14 -6
- package/codex-adapter/dist/worker/workspace-worker.js +31 -1
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/index.js +5 -16
- package/console/dist/server/utils/installed-layout.js +6 -4
- package/console/dist/server/utils/pd-backups.d.ts +1 -14
- package/console/dist/server/utils/pd-backups.js +12 -64
- package/console/dist/web/assets/app.css +153 -9
- package/console/dist/web/assets/app.js +41 -37
- package/console/dist/web/assets/intent-reflection.webp +3 -0
- package/console/dist/web/assets/providers/anthropic.png +0 -0
- package/console/dist/web/assets/providers/deepseek.png +0 -0
- package/console/dist/web/assets/providers/google.png +0 -0
- package/console/dist/web/assets/providers/groq.svg +1 -0
- package/console/dist/web/assets/providers/kimi.png +0 -0
- package/console/dist/web/assets/providers/minimax.png +0 -0
- package/console/dist/web/assets/providers/mistral.svg +28 -0
- package/console/dist/web/assets/providers/nvidia.png +0 -0
- package/console/dist/web/assets/providers/openai.svg +1 -0
- package/console/dist/web/assets/providers/openrouter.svg +3 -0
- package/console/dist/web/assets/providers/qwen.png +0 -0
- package/console/dist/web/assets/providers/together.svg +21 -0
- package/console/dist/web/assets/providers/xai.svg +1 -0
- package/console/dist/web/assets/providers/xiaomi.png +0 -0
- package/console/dist/web/assets/providers/zai.svg +219 -0
- package/core/dist/index.d.ts +1 -2
- package/core/dist/index.d.ts.map +1 -1
- package/core/dist/index.js +4 -2
- package/core/dist/index.js.map +1 -1
- package/core/dist/prompt-builder/focus-compression.d.ts +8 -60
- package/core/dist/prompt-builder/focus-compression.d.ts.map +1 -1
- package/core/dist/prompt-builder/focus-compression.js +8 -434
- package/core/dist/prompt-builder/focus-compression.js.map +1 -1
- package/core/dist/prompt-builder/index.d.ts +1 -2
- package/core/dist/prompt-builder/index.d.ts.map +1 -1
- package/core/dist/prompt-builder/index.js +3 -2
- package/core/dist/prompt-builder/index.js.map +1 -1
- package/core/dist/runtime/activation/production-gate-deps.d.ts +7 -3
- package/core/dist/runtime/activation/production-gate-deps.d.ts.map +1 -1
- package/core/dist/runtime/activation/production-gate-deps.js +15 -6
- package/core/dist/runtime/activation/production-gate-deps.js.map +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts +2 -0
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js +9 -1
- package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js.map +1 -1
- package/core/dist/runtime/config/pd-config-types.d.ts +20 -1
- package/core/dist/runtime/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.d.ts.map +1 -1
- package/core/dist/runtime/config/pd-config-validate.js +12 -1
- package/core/dist/runtime/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime/internalization/bash-risk.d.ts.map +1 -1
- package/core/dist/runtime/internalization/bash-risk.js +6 -3
- package/core/dist/runtime/internalization/bash-risk.js.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +28 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.js +109 -13
- package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts +10 -0
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +6 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime/pain-chain-read-model.d.ts +14 -0
- package/core/dist/runtime/pain-chain-read-model.d.ts.map +1 -1
- package/core/dist/runtime/pain-chain-read-model.js +91 -3
- package/core/dist/runtime/pain-chain-read-model.js.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.d.ts +15 -0
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +32 -3
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts +8 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +11 -0
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +3 -0
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.d.ts +54 -0
- package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
- package/core/dist/runtime/pain-submit-capability.js +49 -1
- package/core/dist/runtime/pain-submit-capability.js.map +1 -1
- package/core/dist/runtime/storage-paths.d.ts +9 -10
- package/core/dist/runtime/storage-paths.d.ts.map +1 -1
- package/core/dist/runtime/storage-paths.js +9 -10
- package/core/dist/runtime/storage-paths.js.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.js +10 -2
- package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime/store/storage-paths.d.ts +65 -12
- package/core/dist/runtime/store/storage-paths.d.ts.map +1 -1
- package/core/dist/runtime/store/storage-paths.js +92 -39
- package/core/dist/runtime/store/storage-paths.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +137 -9
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +627 -100
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts +23 -3
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +36 -20
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/installers/index.d.ts.map +1 -1
- package/dist/installers/index.js +24 -3
- package/dist/installers/index.js.map +1 -1
- package/dist/installers/mcp-registration-conflict.d.ts.map +1 -1
- package/dist/installers/mcp-registration-conflict.js +23 -16
- package/dist/installers/mcp-registration-conflict.js.map +1 -1
- package/dist/installers/openclaw-host-installer.d.ts.map +1 -1
- package/dist/installers/openclaw-host-installer.js +1 -8
- package/dist/installers/openclaw-host-installer.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +51 -15
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/mvp-config.d.ts +30 -5
- package/dist/mvp-config.d.ts.map +1 -1
- package/dist/mvp-config.js +49 -16
- package/dist/mvp-config.js.map +1 -1
- package/dist/prompts.js +1 -1
- package/dist/prompts.js.map +1 -1
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +142 -5
- package/dist/uninstaller.js.map +1 -1
- package/dist/update/release-manager.d.ts.map +1 -1
- package/dist/update/release-manager.js +5 -2
- package/dist/update/release-manager.js.map +1 -1
- package/dist/utils/env.d.ts +5 -10
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +91 -34
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/host-workspace-ownership.d.ts +25 -0
- package/dist/utils/host-workspace-ownership.d.ts.map +1 -1
- package/dist/utils/host-workspace-ownership.js +153 -2
- package/dist/utils/host-workspace-ownership.js.map +1 -1
- package/host-runtime/dist/adaptive-background-append.d.ts +6 -0
- package/host-runtime/dist/adaptive-background-append.js +4 -1
- package/host-runtime/dist/adaptive-decision-protocol.d.ts +18 -2
- package/host-runtime/dist/adaptive-decision-protocol.js +39 -9
- package/host-runtime/dist/adaptive-principle-context-reader.d.ts +79 -0
- package/host-runtime/dist/adaptive-principle-context-reader.js +303 -0
- package/host-runtime/dist/adaptive-priority-provider.d.ts +33 -0
- package/host-runtime/dist/adaptive-priority-provider.js +68 -2
- package/host-runtime/dist/adaptive-selection.d.ts +16 -0
- package/host-runtime/dist/adaptive-selection.js +23 -1
- package/host-runtime/dist/codex-legacy-registration.js +10 -2
- package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +8 -0
- package/host-runtime/dist/conversation-ingestion/pipeline.js +179 -7
- package/host-runtime/dist/degraded-enforcement-marker.js +16 -2
- package/host-runtime/dist/diagnostician-auto-run.js +4 -0
- package/host-runtime/dist/governance-observation-store.d.ts +44 -0
- package/host-runtime/dist/governance-observation-store.js +84 -1
- package/host-runtime/dist/governance-trajectory-turn-reader.d.ts +30 -0
- package/host-runtime/dist/governance-trajectory-turn-reader.js +47 -0
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +6 -0
- package/host-runtime/dist/product-telemetry/service.js +86 -20
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +23 -9
- package/install-layout/dist/index.js +49 -24
- package/install-layout/dist/mcp-binding-contract.d.ts +62 -0
- package/install-layout/dist/mcp-binding-contract.js +175 -3
- package/install-layout/dist/pd-home.d.ts +35 -5
- package/install-layout/dist/pd-home.js +138 -23
- package/install-layout/package.json +1 -1
- package/package.json +4 -4
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +134 -8
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-worker.js +36 -2
- package/pd-cli/dist/commands/codex-worker.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +34 -8
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/health-codex-install.d.ts +1 -3
- package/pd-cli/dist/commands/health-codex-install.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex-install.js +19 -6
- package/pd-cli/dist/commands/health-codex-install.js.map +1 -1
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +27 -9
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/commands/health-console.d.ts +2 -1
- package/pd-cli/dist/commands/health-console.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-console.js +12 -3
- package/pd-cli/dist/commands/health-console.js.map +1 -1
- package/pd-cli/dist/commands/health-ingestion.d.ts +10 -2
- package/pd-cli/dist/commands/health-ingestion.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-ingestion.js +56 -14
- package/pd-cli/dist/commands/health-ingestion.js.map +1 -1
- package/pd-cli/dist/commands/health-mcp.d.ts +19 -7
- package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-mcp.js +131 -45
- package/pd-cli/dist/commands/health-mcp.js.map +1 -1
- package/pd-cli/dist/commands/health-workbuddy.d.ts +2 -1
- package/pd-cli/dist/commands/health-workbuddy.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-workbuddy.js +17 -8
- package/pd-cli/dist/commands/health-workbuddy.js.map +1 -1
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +12 -5
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/mcp-probe.d.ts +6 -0
- package/pd-cli/dist/commands/mcp-probe.d.ts.map +1 -1
- package/pd-cli/dist/commands/mcp-probe.js +35 -7
- package/pd-cli/dist/commands/mcp-probe.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +10 -2
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/trace.d.ts.map +1 -1
- package/pd-cli/dist/commands/trace.js +8 -0
- package/pd-cli/dist/commands/trace.js.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.d.ts.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.js +7 -3
- package/pd-cli/dist/commands/workbuddy-setup.js.map +1 -1
- package/pd-cli/dist/commands/workbuddy-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/workbuddy-worker.js +21 -6
- package/pd-cli/dist/commands/workbuddy-worker.js.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts +10 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.js +12 -2
- package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
- package/pd-cli/dist/services/codex-plugin-install.d.ts +1 -3
- package/pd-cli/dist/services/codex-plugin-install.d.ts.map +1 -1
- package/pd-cli/dist/services/codex-plugin-install.js +10 -3
- package/pd-cli/dist/services/codex-plugin-install.js.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.js +2 -0
- package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.d.ts +2 -2
- package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.js +28 -20
- package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
- package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/synthetic-baseline-runner.js +2 -0
- package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/pd-mcp-server/dist/log-file.js +9 -2
- package/pd-mcp-server/dist/server.d.ts +52 -2
- package/pd-mcp-server/dist/server.js +40 -4
- package/pd-mcp-server/dist/submit-assembly.js +85 -12
- package/pd-mcp-server/dist/version.d.ts +1 -1
- package/pd-mcp-server/dist/version.js +1 -1
- package/pd-mcp-server/package.json +1 -1
- package/plugin/dist/bundle.js +761 -722
- package/plugin/dist/commands/focus.d.ts +10 -7
- package/plugin/dist/commands/strategy.d.ts +10 -0
- package/plugin/dist/core/focus-history.d.ts +9 -49
- package/plugin/dist/core/paths.d.ts +6 -53
- package/plugin/dist/governance-audit.js +2 -2
- package/plugin/dist/hooks/prompt-helpers.d.ts +6 -5
- package/plugin/dist/hooks/prompt-types.d.ts +6 -6
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +29 -29
- package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +8 -7
- package/plugin/dist/utils/io.d.ts +1 -1
- package/plugin/dist/utils/workspace-resolver.d.ts +0 -20
- package/plugin/mcp/launcher.cjs +159 -35
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/workspace/okr/RECOVERY_PROTOCOL.md +8 -7
- package/release-manager/dist/installer.js +627 -100
- package/release-manager/dist/installers/codex-host-installer.js +36 -20
- package/release-manager/dist/installers/index.js +24 -3
- package/release-manager/dist/installers/mcp-registration-conflict.js +23 -16
- package/release-manager/dist/installers/openclaw-host-installer.js +1 -8
- package/release-manager/dist/installers/workbuddy-host-installer.js +51 -15
- package/release-manager/dist/mvp-config.js +49 -16
- package/release-manager/dist/update/release-manager.js +5 -2
- package/release-manager/dist/utils/env.js +91 -34
- package/release-manager/dist/utils/host-workspace-ownership.js +153 -2
- package/release-manager/package.json +2 -2
- package/workbuddy-adapter/dist/index.d.ts +1 -1
- package/workbuddy-adapter/dist/index.js +1 -1
- package/workbuddy-adapter/dist/ingestion/catch-up.js +15 -3
- package/workbuddy-adapter/dist/ingestion/index.d.ts +1 -1
- package/workbuddy-adapter/dist/ingestion/index.js +1 -1
- package/workbuddy-adapter/dist/ingestion/ingestion.d.ts +18 -0
- package/workbuddy-adapter/dist/ingestion/ingestion.js +20 -2
- package/workbuddy-adapter/dist/ingestion/transcript-path.d.ts +13 -4
- package/workbuddy-adapter/dist/ingestion/transcript-path.js +102 -4
- package/workbuddy-adapter/dist/ingestion/transcript-source.js +76 -58
- package/workbuddy-adapter/dist/pd-hook.js +10 -3
- package/workbuddy-adapter/dist/worker/workspace-worker.js +4 -1
- package/workbuddy-adapter/dist/workspace-resolution.d.ts +9 -2
- package/workbuddy-adapter/dist/workspace-resolution.js +19 -3
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/mcp/launcher.cjs +159 -35
- package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -56
- package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +0 -6
- package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +0 -6
- package/plugin/templates/workspace/okr/CURRENT_FOCUS.md +0 -56
- package/plugin/templates/workspace/okr/TASK_CHANGES.jsonl +0 -6
- package/plugin/templates/workspace/okr/WEEK_TASKS.json +0 -6
|
@@ -21,7 +21,69 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import fs from 'node:fs';
|
|
23
23
|
import path from 'node:path';
|
|
24
|
+
import { isPathWithinRoot, resolvePdHome } from '@principles/install-layout';
|
|
24
25
|
import { encodeWorkbuddyCwd } from './encode-cwd.js';
|
|
26
|
+
/**
|
|
27
|
+
* Experiment boundary verification for the WorkBuddy projects root.
|
|
28
|
+
*
|
|
29
|
+
* The projects LEAF is not a PdHomePaths field, so resolvePdHome's boundary
|
|
30
|
+
* pass does not see `<workbuddyConfigDir>/projects` — a junction there pointing
|
|
31
|
+
* at the production transcript store would resolvePdHome cleanly and then read
|
|
32
|
+
* production conversations. Resolution walks to the deepest EXISTING ancestor
|
|
33
|
+
* (the dir is created lazily), re-appends the missing tail, and refuses when:
|
|
34
|
+
* - any re-appended segment EXISTS but cannot be resolved (broken /
|
|
35
|
+
* self-looping link → "cannot safely verify" must not pass as
|
|
36
|
+
* "does not exist yet");
|
|
37
|
+
* - or the composed canonical path sits outside the experiment root
|
|
38
|
+
* (an existing link into production is an escape, not a child).
|
|
39
|
+
* Production mode (no PD_EXPERIMENT_ROOT) has no boundary and is unchanged.
|
|
40
|
+
*/
|
|
41
|
+
function verifyProjectsRootBoundary(root, experimentRoot) {
|
|
42
|
+
const missing = [];
|
|
43
|
+
let current = path.resolve(root);
|
|
44
|
+
for (;;) {
|
|
45
|
+
let real;
|
|
46
|
+
try {
|
|
47
|
+
real = fs.realpathSync.native(current);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
const parent = path.dirname(current);
|
|
51
|
+
if (parent === current) {
|
|
52
|
+
return {
|
|
53
|
+
ok: false,
|
|
54
|
+
reason: 'workbuddy_projects_root_unresolvable',
|
|
55
|
+
nextAction: `Cannot canonically resolve any ancestor of ${root}; refusing to derive a transcript root that cannot be verified.`,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
missing.push(path.basename(current));
|
|
59
|
+
current = parent;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
let tail = real;
|
|
63
|
+
for (const segment of missing.reverse()) {
|
|
64
|
+
tail = path.join(tail, segment);
|
|
65
|
+
try {
|
|
66
|
+
fs.lstatSync(tail);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
continue; // genuinely absent — the lazy-creation contract
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
reason: 'workbuddy_projects_root_unverifiable',
|
|
74
|
+
nextAction: `${tail} exists but cannot be resolved (broken/self-looping link). Remove it or point it inside the experiment root ${experimentRoot}.`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (!isPathWithinRoot(experimentRoot, tail)) {
|
|
78
|
+
return {
|
|
79
|
+
ok: false,
|
|
80
|
+
reason: 'workbuddy_projects_root_escapes_experiment',
|
|
81
|
+
nextAction: `Remove the symlink/junction at ${root} (or point it inside the experiment root ${experimentRoot}) and retry.`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return { ok: true };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
25
87
|
const SESSION_FILE_NAME = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.jsonl$/;
|
|
26
88
|
/** Canonicalize to the final long form (native realpath first; 8.3-safe, mirrors the Codex locator). */
|
|
27
89
|
function canonicalizePath(target) {
|
|
@@ -39,6 +101,42 @@ function hasParentTraversal(value) {
|
|
|
39
101
|
export function workbuddyProjectsRoot(home) {
|
|
40
102
|
return path.join(home, '.workbuddy', 'projects');
|
|
41
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Default WorkBuddy transcript projects root for discovery. Follows the shared
|
|
106
|
+
* PD Home authority (WORKBUDDY_CONFIG_DIR override, PD_EXPERIMENT_ROOT
|
|
107
|
+
* isolation) so an experiment reads its own lab transcripts — never the
|
|
108
|
+
* production host's. A refused resolution is a structured degradation for
|
|
109
|
+
* read-only callers (rc-9), never a silent fallback to the OS home.
|
|
110
|
+
*
|
|
111
|
+
* An already-resolved `PdHomePaths` (the caller's single-parse authority, e.g.
|
|
112
|
+
* `pd health`) may be injected; the SAME experiment boundary verification
|
|
113
|
+
* applies — the projects leaf is still not a PdHomePaths field.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Boundary-checked projects-root derivation from ONE already-resolved PD Home.
|
|
117
|
+
* The projects LEAF is not a PdHomePaths field — verify it in experiment mode.
|
|
118
|
+
*/
|
|
119
|
+
function resolveProjectsRootFromPdHome(pdHome) {
|
|
120
|
+
const root = path.join(pdHome.workbuddyConfigDir, 'projects');
|
|
121
|
+
if (pdHome.experimentRoot !== undefined) {
|
|
122
|
+
const boundary = verifyProjectsRootBoundary(root, pdHome.experimentRoot);
|
|
123
|
+
if (!boundary.ok)
|
|
124
|
+
return boundary;
|
|
125
|
+
}
|
|
126
|
+
return { ok: true, root };
|
|
127
|
+
}
|
|
128
|
+
export function resolveWorkbuddyProjectsRoot(homePaths) {
|
|
129
|
+
// An already-resolved PdHomePaths (the caller's single-parse authority, e.g.
|
|
130
|
+
// `pd health`) skips the re-resolution but gets the SAME boundary check.
|
|
131
|
+
if (homePaths !== undefined) {
|
|
132
|
+
return resolveProjectsRootFromPdHome(homePaths);
|
|
133
|
+
}
|
|
134
|
+
const pdHome = resolvePdHome();
|
|
135
|
+
if (!pdHome.ok) {
|
|
136
|
+
return { ok: false, reason: `pd_home_resolution_failed:${pdHome.reason}`, nextAction: pdHome.nextAction };
|
|
137
|
+
}
|
|
138
|
+
return resolveProjectsRootFromPdHome(pdHome);
|
|
139
|
+
}
|
|
42
140
|
/**
|
|
43
141
|
* Authorize one transcript path against the WorkBuddy projects root.
|
|
44
142
|
*
|
|
@@ -101,9 +199,9 @@ function encodeCwdSafe(cwd) {
|
|
|
101
199
|
}
|
|
102
200
|
/**
|
|
103
201
|
* Deterministic derivation (fallback when no hook payload path exists):
|
|
104
|
-
* `<
|
|
105
|
-
*
|
|
106
|
-
*
|
|
202
|
+
* `<projectsRoot>/<encodeCwd(cwd)>/<sessionId>.jsonl`. Returns null when the
|
|
203
|
+
* session identity or cwd cannot produce a contract-shaped path — the caller
|
|
204
|
+
* degrades, it never scans for a "latest" file.
|
|
107
205
|
*/
|
|
108
206
|
export function deriveWorkbuddyTranscriptPath(input) {
|
|
109
207
|
if (input.sessionId.length === 0 || input.cwd.length === 0)
|
|
@@ -113,5 +211,5 @@ export function deriveWorkbuddyTranscriptPath(input) {
|
|
|
113
211
|
const encoded = encodeCwdSafe(input.cwd);
|
|
114
212
|
if (encoded === null)
|
|
115
213
|
return null;
|
|
116
|
-
return path.join(
|
|
214
|
+
return path.join(input.projectsRoot, encoded, `${input.sessionId.toLowerCase()}.jsonl`);
|
|
117
215
|
}
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
* catch-up keeps ingesting, the health surface shows the lag.
|
|
23
23
|
*/
|
|
24
24
|
import fs from 'node:fs';
|
|
25
|
-
import
|
|
26
|
-
import { deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot } from './transcript-path.js';
|
|
25
|
+
import { deriveWorkbuddyTranscriptPath, resolveWorkbuddyProjectsRoot, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot } from './transcript-path.js';
|
|
27
26
|
import { decodeWorkbuddyTranscriptWindow } from './transcript-decoder.js';
|
|
28
27
|
/** Single-session alert threshold (tech design §12). */
|
|
29
28
|
export const WORKBUDDY_SINGLE_SESSION_ALERT_BYTES = 50 * 1024 * 1024;
|
|
@@ -40,6 +39,70 @@ function existsFile(target) {
|
|
|
40
39
|
return false;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the session transcript against one concrete projects root, in
|
|
44
|
+
* priority order: a non-empty hook hint (validated AND identity-bound to this
|
|
45
|
+
* hook's session), then the deterministic
|
|
46
|
+
* `<projectsRoot>/<encodeCwd(cwd)>/<sessionId>.jsonl` path. Never scans
|
|
47
|
+
* directories; every refusal carries a reason + nextAction.
|
|
48
|
+
*/
|
|
49
|
+
function locateTranscript(session, hints, projectsRoot) {
|
|
50
|
+
// 1. Hook-payload paths, empty strings skipped (forensics §6.2).
|
|
51
|
+
const hinted = nonEmptyHint(hints.transcriptPath) ?? nonEmptyHint(hints.agentTranscriptPath);
|
|
52
|
+
if (hinted !== null) {
|
|
53
|
+
const validated = validateWorkbuddyTranscriptPath(hinted, projectsRoot);
|
|
54
|
+
if (!validated.ok)
|
|
55
|
+
return { status: 'degraded', reason: validated.reason, nextAction: validated.nextAction };
|
|
56
|
+
// Session binding (P2 review): a contract-shaped path inside the
|
|
57
|
+
// projects root can still belong to ANOTHER session. Reading it would
|
|
58
|
+
// file that session's evidence under this hook's rollout identity, so
|
|
59
|
+
// the path's identity must equal the host session identity. The check
|
|
60
|
+
// compares the PARSED identity, never just the file name shape.
|
|
61
|
+
const hookSessionId = session.sessionId.trim().toLowerCase();
|
|
62
|
+
if (hookSessionId.length === 0) {
|
|
63
|
+
return {
|
|
64
|
+
status: 'degraded',
|
|
65
|
+
reason: 'transcript_session_unverified',
|
|
66
|
+
nextAction: 'the hook payload has no session_id, so the transcript path cannot be bound to this session; nothing is read.',
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (validated.sessionIdentity !== hookSessionId) {
|
|
70
|
+
return {
|
|
71
|
+
status: 'degraded',
|
|
72
|
+
reason: 'transcript_session_mismatch',
|
|
73
|
+
nextAction: `the hinted transcript belongs to session ${validated.sessionIdentity}, not ${hookSessionId}; PD refuses to read another session's evidence.`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return { status: 'ok', filePath: validated.canonicalPath, expectedIdentity: validated.identity, sessionIdentity: validated.sessionIdentity };
|
|
77
|
+
}
|
|
78
|
+
// 2. Deterministic derivation from the session identity + cwd.
|
|
79
|
+
const derived = deriveWorkbuddyTranscriptPath({ projectsRoot, cwd: session.cwd ?? '', sessionId: session.sessionId });
|
|
80
|
+
if (derived === null) {
|
|
81
|
+
return { status: 'degraded', reason: 'transcript_unavailable', nextAction: 'no hook transcript path and no derivable session transcript; nothing is read or fabricated.' };
|
|
82
|
+
}
|
|
83
|
+
const validated = validateWorkbuddyTranscriptPath(derived, projectsRoot);
|
|
84
|
+
if (!validated.ok && validated.reason === 'transcript_path_invalid' && !existsFile(derived)) {
|
|
85
|
+
// The derived session file simply does not exist yet — neutral
|
|
86
|
+
// unavailability, not an invalid payload.
|
|
87
|
+
return { status: 'degraded', reason: 'transcript_unavailable', nextAction: 'no WorkBuddy transcript exists yet for this session; nothing is read or fabricated.' };
|
|
88
|
+
}
|
|
89
|
+
if (!validated.ok)
|
|
90
|
+
return { status: 'degraded', reason: validated.reason, nextAction: validated.nextAction };
|
|
91
|
+
// Same session binding as the hinted branch (P2 review): the derived
|
|
92
|
+
// file name is shaped from the session id, but a symlinked
|
|
93
|
+
// <sessionId>.jsonl can resolve to ANOTHER session's transcript. Only the
|
|
94
|
+
// canonical identity is authoritative; never file another session's
|
|
95
|
+
// evidence under this session.
|
|
96
|
+
const derivedSessionId = session.sessionId.trim().toLowerCase();
|
|
97
|
+
if (derivedSessionId.length === 0 || validated.sessionIdentity !== derivedSessionId) {
|
|
98
|
+
return {
|
|
99
|
+
status: 'degraded',
|
|
100
|
+
reason: 'transcript_session_mismatch',
|
|
101
|
+
nextAction: `the derived transcript resolves to session ${validated.sessionIdentity}, not ${derivedSessionId}; PD refuses to read another session's evidence.`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return { status: 'ok', filePath: validated.canonicalPath, expectedIdentity: validated.identity, sessionIdentity: validated.sessionIdentity };
|
|
105
|
+
}
|
|
43
106
|
/**
|
|
44
107
|
* Build the WorkBuddy {@link TranscriptSourceAdapter} for the host-neutral
|
|
45
108
|
* conversation-ingestion seam. Locating is deterministic (hint first, then the
|
|
@@ -55,63 +118,18 @@ export function createWorkbuddyTranscriptSource(context) {
|
|
|
55
118
|
* Never scans directories; every refusal carries a reason + nextAction.
|
|
56
119
|
*/
|
|
57
120
|
locate(session, hints, env) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return { status: 'degraded', reason: validated.reason, nextAction: validated.nextAction };
|
|
66
|
-
// Session binding (P2 review): a contract-shaped path inside the
|
|
67
|
-
// projects root can still belong to ANOTHER session. Reading it would
|
|
68
|
-
// file that session's evidence under this hook's rollout identity, so
|
|
69
|
-
// the path's identity must equal the host session identity. The check
|
|
70
|
-
// compares the PARSED identity, never just the file name shape.
|
|
71
|
-
const hookSessionId = session.sessionId.trim().toLowerCase();
|
|
72
|
-
if (hookSessionId.length === 0) {
|
|
73
|
-
return {
|
|
74
|
-
status: 'degraded',
|
|
75
|
-
reason: 'transcript_session_unverified',
|
|
76
|
-
nextAction: 'the hook payload has no session_id, so the transcript path cannot be bound to this session; nothing is read.',
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
if (validated.sessionIdentity !== hookSessionId) {
|
|
80
|
-
return {
|
|
81
|
-
status: 'degraded',
|
|
82
|
-
reason: 'transcript_session_mismatch',
|
|
83
|
-
nextAction: `the hinted transcript belongs to session ${validated.sessionIdentity}, not ${hookSessionId}; PD refuses to read another session's evidence.`,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
return { status: 'ok', filePath: validated.canonicalPath, expectedIdentity: validated.identity, sessionIdentity: validated.sessionIdentity };
|
|
87
|
-
}
|
|
88
|
-
// 2. Deterministic derivation from the session identity + cwd.
|
|
89
|
-
const derived = deriveWorkbuddyTranscriptPath({ home, cwd: session.cwd ?? '', sessionId: session.sessionId });
|
|
90
|
-
if (derived === null) {
|
|
91
|
-
return { status: 'degraded', reason: 'transcript_unavailable', nextAction: 'no hook transcript path and no derivable session transcript; nothing is read or fabricated.' };
|
|
92
|
-
}
|
|
93
|
-
const validated = validateWorkbuddyTranscriptPath(derived, projectsRoot);
|
|
94
|
-
if (!validated.ok && validated.reason === 'transcript_path_invalid' && !existsFile(derived)) {
|
|
95
|
-
// The derived session file simply does not exist yet — neutral
|
|
96
|
-
// unavailability, not an invalid payload.
|
|
97
|
-
return { status: 'degraded', reason: 'transcript_unavailable', nextAction: 'no WorkBuddy transcript exists yet for this session; nothing is read or fabricated.' };
|
|
98
|
-
}
|
|
99
|
-
if (!validated.ok)
|
|
100
|
-
return { status: 'degraded', reason: validated.reason, nextAction: validated.nextAction };
|
|
101
|
-
// Same session binding as the hinted branch (P2 review): the derived
|
|
102
|
-
// file name is shaped from the session id, but a symlinked
|
|
103
|
-
// <sessionId>.jsonl can resolve to ANOTHER session's transcript. Only the
|
|
104
|
-
// canonical identity is authoritative; never file another session's
|
|
105
|
-
// evidence under this session.
|
|
106
|
-
const derivedSessionId = session.sessionId.trim().toLowerCase();
|
|
107
|
-
if (derivedSessionId.length === 0 || validated.sessionIdentity !== derivedSessionId) {
|
|
108
|
-
return {
|
|
109
|
-
status: 'degraded',
|
|
110
|
-
reason: 'transcript_session_mismatch',
|
|
111
|
-
nextAction: `the derived transcript resolves to session ${validated.sessionIdentity}, not ${derivedSessionId}; PD refuses to read another session's evidence.`,
|
|
112
|
-
};
|
|
121
|
+
// An explicit home (hook env / test injection) keeps the historical
|
|
122
|
+
// `<home>/.workbuddy/projects` derivation; the default follows the
|
|
123
|
+
// shared PD Home authority so an experiment never reads the production
|
|
124
|
+
// WorkBuddy transcript tree.
|
|
125
|
+
const home = env.home ?? context.home;
|
|
126
|
+
if (home !== undefined) {
|
|
127
|
+
return locateTranscript(session, hints, workbuddyProjectsRoot(home));
|
|
113
128
|
}
|
|
114
|
-
|
|
129
|
+
const projectsRoot = resolveWorkbuddyProjectsRoot();
|
|
130
|
+
if (!projectsRoot.ok)
|
|
131
|
+
return { status: 'degraded', reason: projectsRoot.reason, nextAction: projectsRoot.nextAction };
|
|
132
|
+
return locateTranscript(session, hints, projectsRoot.root);
|
|
115
133
|
},
|
|
116
134
|
/**
|
|
117
135
|
* Project one byte window into observations. No host contract guard
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
* neutral means EMPTY stdout, never `{}`. Diagnostics go to stderr only.
|
|
33
33
|
*/
|
|
34
34
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
35
|
-
import os from 'node:os';
|
|
36
35
|
import path from 'node:path';
|
|
37
36
|
import process from 'node:process';
|
|
38
37
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
@@ -86,6 +85,10 @@ function workbuddyEventEmitter(stateDir, evidence, readAdaptiveFact) {
|
|
|
86
85
|
: {
|
|
87
86
|
resultCode: `${fact.status}:${fact.reason}`.slice(0, 240),
|
|
88
87
|
scored: fact.sends > 0,
|
|
88
|
+
// Principle Context S-state (bounded enum): the Console/Owner can
|
|
89
|
+
// tell whether the context actually participated — `sent` only
|
|
90
|
+
// when the request really carried it (SPEC v1.1 sect 5.4.1).
|
|
91
|
+
...(fact.principleContext !== undefined ? { principleContext: fact.principleContext } : {}),
|
|
89
92
|
...(fact.targetActivationId !== null && data.activationIds.includes(fact.targetActivationId)
|
|
90
93
|
? { appendedActivationId: fact.targetActivationId }
|
|
91
94
|
: {}),
|
|
@@ -238,7 +241,7 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
|
|
|
238
241
|
if (channelEventName === 'UserPromptSubmit' && typeof parsed === 'object' && parsed !== null
|
|
239
242
|
&& Object.getOwnPropertyDescriptor(parsed, 'hook_event_name')?.value === 'UserPromptSubmit'
|
|
240
243
|
&& parseOwnerStatementPrefix(Object.getOwnPropertyDescriptor(parsed, 'prompt')?.value).matched) {
|
|
241
|
-
const workspace = resolveWorkbuddyWorkspace(
|
|
244
|
+
const workspace = resolveWorkbuddyWorkspace();
|
|
242
245
|
if (workspace.status === 'ok') {
|
|
243
246
|
const config = loadPdConfigForPlugin(workspace.workspaceDir);
|
|
244
247
|
if (config.ok && computeFeatureFlagsFromConfig(config.effective).flags['host.workbuddy']?.enabled === true) {
|
|
@@ -257,7 +260,10 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
|
|
|
257
260
|
const hookEpoch = new Date();
|
|
258
261
|
// OD-07/P06 governance workspace: explicit, user-level, shared across
|
|
259
262
|
// projects; never auto-created here and never falling back to another host.
|
|
260
|
-
|
|
263
|
+
// No os.homedir() injection: the default HOME-first precedence keeps the
|
|
264
|
+
// hook on the SAME host config root the installer used (Devin review
|
|
265
|
+
// #2699-0006 — an explicit OS-home input splits the root when HOME differs).
|
|
266
|
+
const resolution = resolveWorkbuddyWorkspace();
|
|
261
267
|
if (resolution.status === 'uninitialized') {
|
|
262
268
|
return neutralWithDiagnostics([diagnostic('skipped', resolution.reason, resolution.nextAction)]);
|
|
263
269
|
}
|
|
@@ -467,6 +473,7 @@ export async function processWorkbuddyHookInvocation(rawStdin, channelEventName,
|
|
|
467
473
|
reason: line.reason,
|
|
468
474
|
sends: line.sends,
|
|
469
475
|
targetActivationId: line.targetActivationId,
|
|
476
|
+
...(line.principleContext !== undefined ? { principleContext: line.principleContext } : {}),
|
|
470
477
|
};
|
|
471
478
|
if (line.status !== 'selected')
|
|
472
479
|
evidenceDiagnostics.push(diagnostic(line.status === 'unavailable' ? 'degraded' : 'skipped', `adaptive_selection_${line.status}:${line.reason}`, 'Check Adaptive configuration or use Native assembly.'));
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
import fs from 'node:fs';
|
|
33
33
|
import path from 'node:path';
|
|
34
34
|
import { computeFeatureFlagsFromConfig, createRuntimeStateHandle, createPainSignalBridge, isRetryWaitBackoffElapsed, PrincipleTreeLedgerAdapter, resolveDiagnosticianCapability, } from '@principles/core/runtime';
|
|
35
|
-
import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, createHostIntentDocReader, saveHostToolDeclaration, HOST_TOOL_DECLARATION_VERSION, } from '@principles/host-runtime';
|
|
35
|
+
import { loadPdConfigForPlugin, loadFeatureFlagFromConfig, reconcileGovernanceContinuation, runInternalizationConsumerCycle, runStage2CorrectionCycle, createSignalClassifierForWorkspace, createGovernanceTrajectoryTurnReader, createHostIntentDocReader, 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
38
|
const WORKER_OWNER = 'companion-worker';
|
|
@@ -169,6 +169,9 @@ export async function runWorkbuddyWorkspaceWorkerCycle(options) {
|
|
|
169
169
|
// for governance-admitted WorkBuddy pains — the neutral host reader
|
|
170
170
|
// must ride along (flag-off = zero filesystem access inside it).
|
|
171
171
|
intentDocReader: createHostIntentDocReader({ workspaceDir, effectiveConfig: config.effective }),
|
|
172
|
+
// PRI-1265: the worker's Stage A gets the bound session's ORIGINAL
|
|
173
|
+
// turns from the workspace's own consent-tiered governance store.
|
|
174
|
+
trajectoryTurnReader: createGovernanceTrajectoryTurnReader({ workspaceDir }),
|
|
172
175
|
});
|
|
173
176
|
const executed = await bridge.executePendingDiagnosis({ taskId: candidate.taskId });
|
|
174
177
|
diagnostician = {
|
|
@@ -9,7 +9,14 @@ export type WorkbuddyWorkspaceResolution = {
|
|
|
9
9
|
} | {
|
|
10
10
|
status: 'degraded';
|
|
11
11
|
workspaceDir: string;
|
|
12
|
-
reason: 'workbuddy_workspace_config_invalid' | 'workbuddy_workspace_config_unreadable';
|
|
12
|
+
reason: 'pd_home_resolution_failed' | 'workbuddy_workspace_config_invalid' | 'workbuddy_workspace_config_unreadable';
|
|
13
13
|
nextAction: string;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the WorkBuddy governance workspace through the shared PD Home
|
|
17
|
+
* authority. `homeDir` stays OPTIONAL and is a TEST injection only: the
|
|
18
|
+
* default resolution uses the shared HOME-first precedence, so hooks and the
|
|
19
|
+
* installer land on the same host config root even when HOME ≠ os.homedir()
|
|
20
|
+
* (Devin review #2699-0006).
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveWorkbuddyWorkspace(homeDir?: string, env?: Readonly<Record<string, string | undefined>>): WorkbuddyWorkspaceResolution;
|
|
@@ -17,9 +17,25 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { statSync } from 'node:fs';
|
|
19
19
|
import path from 'node:path';
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
import { resolvePdHome } from '@principles/install-layout';
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the WorkBuddy governance workspace through the shared PD Home
|
|
23
|
+
* authority. `homeDir` stays OPTIONAL and is a TEST injection only: the
|
|
24
|
+
* default resolution uses the shared HOME-first precedence, so hooks and the
|
|
25
|
+
* installer land on the same host config root even when HOME ≠ os.homedir()
|
|
26
|
+
* (Devin review #2699-0006).
|
|
27
|
+
*/
|
|
28
|
+
export function resolveWorkbuddyWorkspace(homeDir, env = process.env) {
|
|
29
|
+
const pdHome = resolvePdHome({ env, ...(homeDir !== undefined ? { homeDir } : {}) });
|
|
30
|
+
if (!pdHome.ok) {
|
|
31
|
+
return {
|
|
32
|
+
status: 'degraded',
|
|
33
|
+
workspaceDir: '',
|
|
34
|
+
reason: 'pd_home_resolution_failed',
|
|
35
|
+
nextAction: `PD refused to resolve the WorkBuddy workspace: ${pdHome.message} ${pdHome.nextAction}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const workspaceDir = pdHome.workbuddyWorkspaceDir;
|
|
23
39
|
const configPath = path.join(workspaceDir, '.pd', 'config.yaml');
|
|
24
40
|
let stat;
|
|
25
41
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/workbuddy-adapter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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",
|