create-principles-disciple 1.151.0 → 1.152.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.
Files changed (177) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/tool-semantics.d.ts +11 -1
  3. package/codex-adapter/dist/tool-semantics.js +11 -1
  4. package/codex-adapter/package.json +1 -1
  5. package/console/dist/server/index.js +5 -0
  6. package/console/dist/server/models/EvidenceChainConsoleModel.js +1 -2
  7. package/console/dist/server/models/GovernanceConsoleModel.js +56 -68
  8. package/console/dist/server/models/RuleCandidateBindingConsoleModel.js +31 -31
  9. package/console/dist/server/routes/failed-tasks.js +84 -1
  10. package/console/dist/server/routes/update.js +45 -30
  11. package/console/dist/server/update-timeout.js +15 -1
  12. package/console/dist/shared/rule-candidate-binding-contract.d.ts +4 -1
  13. package/console/dist/web/assets/app.js +26 -26
  14. package/core/dist/runtime/activation/ledger-identity.d.ts.map +1 -1
  15. package/core/dist/runtime/activation/ledger-identity.js +5 -0
  16. package/core/dist/runtime/activation/ledger-identity.js.map +1 -1
  17. package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts +6 -0
  18. package/core/dist/runtime/activation/prompt-activation-reader-contract.d.ts.map +1 -1
  19. package/core/dist/runtime/activation/prompt-activation-reader-contract.js +105 -7
  20. package/core/dist/runtime/activation/prompt-activation-reader-contract.js.map +1 -1
  21. package/core/dist/runtime/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
  22. package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js +10 -1
  23. package/core/dist/runtime/adapter/principle-tree-ledger-adapter.js.map +1 -1
  24. package/core/dist/runtime/candidate-audit.d.ts.map +1 -1
  25. package/core/dist/runtime/candidate-audit.js +6 -3
  26. package/core/dist/runtime/candidate-audit.js.map +1 -1
  27. package/core/dist/runtime/golden-trace.d.ts.map +1 -1
  28. package/core/dist/runtime/golden-trace.js +30 -24
  29. package/core/dist/runtime/golden-trace.js.map +1 -1
  30. package/core/dist/runtime/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  31. package/core/dist/runtime/internalization/refiner-sandbox-wrapper.js +4 -4
  32. package/core/dist/runtime/internalization/refiner-sandbox-wrapper.js.map +1 -1
  33. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts +13 -0
  34. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  35. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +28 -4
  36. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  37. package/core/dist/runtime/internalization/rule-host-input-builder.d.ts +21 -1
  38. package/core/dist/runtime/internalization/rule-host-input-builder.d.ts.map +1 -1
  39. package/core/dist/runtime/internalization/rule-host-input-builder.js +13 -0
  40. package/core/dist/runtime/internalization/rule-host-input-builder.js.map +1 -1
  41. package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
  42. package/core/dist/runtime/internalization/scribe-runner.js +25 -3
  43. package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
  44. package/core/dist/runtime/internalization-chain-integrity-read-model.d.ts +1 -0
  45. package/core/dist/runtime/internalization-chain-integrity-read-model.d.ts.map +1 -1
  46. package/core/dist/runtime/internalization-chain-integrity-read-model.js +8 -5
  47. package/core/dist/runtime/internalization-chain-integrity-read-model.js.map +1 -1
  48. package/core/dist/runtime/pruning-read-model.d.ts.map +1 -1
  49. package/core/dist/runtime/pruning-read-model.js +7 -5
  50. package/core/dist/runtime/pruning-read-model.js.map +1 -1
  51. package/core/dist/runtime/schema-conformance-read-model.d.ts +1 -0
  52. package/core/dist/runtime/schema-conformance-read-model.d.ts.map +1 -1
  53. package/core/dist/runtime/schema-conformance-read-model.js +8 -5
  54. package/core/dist/runtime/schema-conformance-read-model.js.map +1 -1
  55. package/core/dist/runtime/signal-collector/types.d.ts +6 -0
  56. package/core/dist/runtime/signal-collector/types.d.ts.map +1 -1
  57. package/core/dist/runtime/signal-collector/types.js.map +1 -1
  58. package/core/dist/runtime/types/rule-candidate-binding.d.ts +1 -1
  59. package/core/dist/runtime/types/rule-candidate-binding.d.ts.map +1 -1
  60. package/core/dist/trajectory-store.d.ts +17 -1
  61. package/core/dist/trajectory-store.d.ts.map +1 -1
  62. package/core/dist/trajectory-store.js +32 -10
  63. package/core/dist/trajectory-store.js.map +1 -1
  64. package/core/package.json +1 -1
  65. package/dist/index.js +34 -0
  66. package/dist/index.js.map +1 -1
  67. package/dist/installer.d.ts +53 -0
  68. package/dist/installer.d.ts.map +1 -1
  69. package/dist/installer.js +106 -1
  70. package/dist/installer.js.map +1 -1
  71. package/dist/installers/index.d.ts +31 -0
  72. package/dist/installers/index.d.ts.map +1 -1
  73. package/dist/installers/index.js +76 -3
  74. package/dist/installers/index.js.map +1 -1
  75. package/dist/installers/legacy-workbuddy-skill.d.ts +46 -14
  76. package/dist/installers/legacy-workbuddy-skill.d.ts.map +1 -1
  77. package/dist/installers/legacy-workbuddy-skill.js +162 -29
  78. package/dist/installers/legacy-workbuddy-skill.js.map +1 -1
  79. package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  80. package/dist/installers/workbuddy-host-installer.js +7 -6
  81. package/dist/installers/workbuddy-host-installer.js.map +1 -1
  82. package/dist/update/release-manager.d.ts +1 -1
  83. package/dist/update/release-manager.d.ts.map +1 -1
  84. package/dist/update/release-manager.js +45 -2
  85. package/dist/update/release-manager.js.map +1 -1
  86. package/host-runtime/dist/active-principle-prompt.js +3 -2
  87. package/host-runtime/dist/governance-observation-store.js +2 -2
  88. package/host-runtime/dist/governance-signal-admission.js +14 -1
  89. package/host-runtime/dist/host-liveness-contract.js +2 -2
  90. package/host-runtime/dist/product-telemetry/milestone-readers.js +3 -2
  91. package/host-runtime/dist/production-pain-evidence.js +3 -2
  92. package/host-runtime/dist/production-rulehost-gate.d.ts +20 -0
  93. package/host-runtime/dist/production-rulehost-gate.js +110 -35
  94. package/host-runtime/dist/prompt-activation-deliverability.d.ts +2 -0
  95. package/host-runtime/dist/prompt-activation-deliverability.js +5 -3
  96. package/host-runtime/dist/prompt-injection-status.js +3 -2
  97. package/host-runtime/dist/workspace-behavior-evidence.js +4 -3
  98. package/host-runtime/package.json +5 -1
  99. package/install-layout/dist/mcp-binding-contract.js +5 -0
  100. package/install-layout/package.json +1 -1
  101. package/package.json +3 -3
  102. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  103. package/pd-cli/dist/commands/candidate.js +2 -1
  104. package/pd-cli/dist/commands/candidate.js.map +1 -1
  105. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  106. package/pd-cli/dist/commands/console.js +8 -0
  107. package/pd-cli/dist/commands/console.js.map +1 -1
  108. package/pd-cli/dist/commands/demo-story-a.d.ts.map +1 -1
  109. package/pd-cli/dist/commands/demo-story-a.js +2 -1
  110. package/pd-cli/dist/commands/demo-story-a.js.map +1 -1
  111. package/pd-cli/dist/commands/health-mcp.d.ts +21 -0
  112. package/pd-cli/dist/commands/health-mcp.d.ts.map +1 -1
  113. package/pd-cli/dist/commands/health-mcp.js +19 -1
  114. package/pd-cli/dist/commands/health-mcp.js.map +1 -1
  115. package/pd-cli/dist/commands/health.d.ts.map +1 -1
  116. package/pd-cli/dist/commands/health.js +12 -4
  117. package/pd-cli/dist/commands/health.js.map +1 -1
  118. package/pd-cli/dist/commands/legacy-cleanup.d.ts.map +1 -1
  119. package/pd-cli/dist/commands/legacy-cleanup.js +2 -1
  120. package/pd-cli/dist/commands/legacy-cleanup.js.map +1 -1
  121. package/pd-cli/dist/commands/pain-list.d.ts.map +1 -1
  122. package/pd-cli/dist/commands/pain-list.js +2 -1
  123. package/pd-cli/dist/commands/pain-list.js.map +1 -1
  124. package/pd-cli/dist/commands/principles-stats.d.ts.map +1 -1
  125. package/pd-cli/dist/commands/principles-stats.js +2 -1
  126. package/pd-cli/dist/commands/principles-stats.js.map +1 -1
  127. package/pd-cli/dist/commands/quality-scorecard.d.ts.map +1 -1
  128. package/pd-cli/dist/commands/quality-scorecard.js +2 -1
  129. package/pd-cli/dist/commands/quality-scorecard.js.map +1 -1
  130. package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -1
  131. package/pd-cli/dist/commands/runtime-init.js +5 -4
  132. package/pd-cli/dist/commands/runtime-init.js.map +1 -1
  133. package/pd-cli/dist/commands/runtime-internalization-evidence.d.ts.map +1 -1
  134. package/pd-cli/dist/commands/runtime-internalization-evidence.js +2 -1
  135. package/pd-cli/dist/commands/runtime-internalization-evidence.js.map +1 -1
  136. package/pd-cli/dist/commands/runtime-recovery-failed-task.d.ts.map +1 -1
  137. package/pd-cli/dist/commands/runtime-recovery-failed-task.js +2 -1
  138. package/pd-cli/dist/commands/runtime-recovery-failed-task.js.map +1 -1
  139. package/pd-cli/dist/legacy/session-history-import.js +2 -2
  140. package/pd-cli/dist/legacy/session-history-import.js.map +1 -1
  141. package/pd-cli/dist/services/console-launcher.d.ts +15 -0
  142. package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
  143. package/pd-cli/dist/services/console-launcher.js +7 -1
  144. package/pd-cli/dist/services/console-launcher.js.map +1 -1
  145. package/pd-cli/package.json +1 -1
  146. package/pd-mcp-server/dist/index.js +33 -2
  147. package/pd-mcp-server/dist/server.d.ts +7 -3
  148. package/pd-mcp-server/dist/server.js +6 -1
  149. package/pd-mcp-server/dist/submit-assembly.d.ts +24 -0
  150. package/pd-mcp-server/dist/submit-assembly.js +61 -0
  151. package/pd-mcp-server/dist/version.d.ts +1 -1
  152. package/pd-mcp-server/dist/version.js +1 -1
  153. package/pd-mcp-server/package.json +2 -1
  154. package/plugin/dist/bundle.js +451 -473
  155. package/plugin/dist/constants/tool-semantics.d.ts +13 -0
  156. package/plugin/dist/core/correction-anchor.d.ts +40 -0
  157. package/plugin/dist/core/experiment-workspace-guard.d.ts +10 -0
  158. package/plugin/dist/core/mcp-binding.d.ts +3 -1
  159. package/plugin/dist/core/signal-collector-host.d.ts +19 -1
  160. package/plugin/dist/core/workspace-context.d.ts +0 -4
  161. package/plugin/dist/hooks/gate.d.ts +0 -5
  162. package/plugin/dist/openclaw.plugin.json +1 -1
  163. package/plugin/dist/rulehost-evidence.js +4 -4
  164. package/plugin/mcp/launcher.cjs +85 -0
  165. package/plugin/openclaw.plugin.json +1 -1
  166. package/plugin/package.json +1 -1
  167. package/release-manager/dist/installer.js +106 -1
  168. package/release-manager/dist/installers/index.js +76 -3
  169. package/release-manager/dist/installers/legacy-workbuddy-skill.js +162 -29
  170. package/release-manager/dist/installers/workbuddy-host-installer.js +7 -6
  171. package/release-manager/dist/update/release-manager.js +45 -2
  172. package/release-manager/package.json +1 -1
  173. package/workbuddy-adapter/dist/tool-semantics.d.ts +11 -0
  174. package/workbuddy-adapter/dist/tool-semantics.js +11 -0
  175. package/workbuddy-adapter/package.json +1 -1
  176. package/workbuddy-adapter/plugin/mcp/launcher.cjs +85 -0
  177. package/plugin/dist/core/rule-host.d.ts +0 -203
@@ -129,10 +129,14 @@ export interface PdMcpServerOptions {
129
129
  readonly logSink?: (line: string) => void;
130
130
  /** OG-4 gate (§5.1.1): registers the write tool ONLY when this is
131
131
  * explicitly `true`. Default `false`; no env var or feature flag can change
132
- * it. Production stays recall-only until OG-4 authorization exists. */
132
+ * it. The production entry opts in for all three known hosts under the
133
+ * Owner's 2026-11-13 authorization; a missing host marker and every default
134
+ * construction stay recall-only. */
133
135
  readonly enableSubmitTool?: boolean;
134
- /** Submit capability entry (tests / future wiring). Defaults to the real
135
- * Core capability bound to `<workspaceDir>/.state`. */
136
+ /** Submit capability entry. There is NO default: `main()` binds the real
137
+ * Core capability to `<workspaceDir>/.state` AND an effective
138
+ * `.pd/config.yaml` (see `submit-assembly.ts`). Opting in without this
139
+ * injection fails closed at construction time. */
136
140
  readonly callSubmitCapability?: SubmitCapabilityCall;
137
141
  /** Bounded read-back entry used after a write timeout (§5.7). */
138
142
  readonly recheckSubmitTask?: SubmitRecheckCall;
@@ -12,7 +12,12 @@
12
12
  * The write tool `pd_submit_pain` exists only when the caller explicitly sets
13
13
  * `enableSubmitTool: true` — the OG-4 production governance gate
14
14
  * (SPEC-PD-AGENT-PAIN-INGRESS-001 §5.1.1). No env var or feature flag can turn
15
- * it on: a deployment must opt in in code and carry the OG-4 record.
15
+ * it on: a deployment must opt in in code and carry the OG-4 record. The Owner
16
+ * authorized OG-4 on 2026-11-13 and extended it to all three hosts (decision
17
+ * card r5 + r6); `submit-assembly.ts` and `index.ts` hold the sole production
18
+ * opt-in. Every default construction stays recall-only, as does a launch with
19
+ * no host marker; a host marker that is present but unknown never reaches this
20
+ * module — startup fails first (`workspace.ts` → `host_invalid`).
16
21
  */
17
22
  import { randomBytes } from 'node:crypto';
18
23
  import { McpServer, fromJsonSchema } from '@modelcontextprotocol/server';
@@ -0,0 +1,24 @@
1
+ import type { SubmitCapabilityCall } from './server.js';
2
+ import type { PdMcpHost } from './workspace.js';
3
+ export interface SubmitAssemblyResult {
4
+ readonly ok: boolean;
5
+ readonly call?: SubmitCapabilityCall;
6
+ /**
7
+ * Fixed, closed reason code — the ONLY failure detail safe to log. The
8
+ * loader's raw `reason` strings can embed absolute config paths (fs errors)
9
+ * or config fragments (YAML parser errors), and the MCP log contract
10
+ * forbids both. Never log `errors[].reason` from here.
11
+ */
12
+ readonly reasonCode?: 'pd_config_invalid';
13
+ /** How many config problems were found (a number leaks nothing). */
14
+ readonly errorCount?: number;
15
+ }
16
+ /**
17
+ * Bind the Core submit capability to the workspace-effective PD config.
18
+ * Called once at MCP startup; the returned function is what the tool handler
19
+ * invokes per request.
20
+ *
21
+ * `env` is the same env `main()` resolved the binding from — never
22
+ * `process.env` directly — so a test-injected env stays authoritative.
23
+ */
24
+ export declare function assembleSubmitCapability(workspaceDir: string, host: PdMcpHost, env?: Record<string, unknown>): SubmitAssemblyResult;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `pd_submit_pain` production assembly for all three PD hosts.
3
+ *
4
+ * OG-4 was authorized by the Owner on 2026-11-13; the scope was extended to
5
+ * Codex / OpenClaw / WorkBuddy the same day (decision card r6). The gate
6
+ * itself stays in `server.ts` (default `false`, no env var / feature flag can
7
+ * turn it on); THIS module is the host wrapper that opts in correctly.
8
+ *
9
+ * `server.ts` refuses to register the write tool without an injected
10
+ * capability bound to an EFFECTIVE `.pd/config.yaml`. Without
11
+ * `effectiveConfig`, the Core capability would fall back to the deprecated
12
+ * `.state/workflows.yaml` resolver (PRI-393 forbids that on production paths).
13
+ * Config loading is therefore delegated to `@principles/host-runtime/pd-config`
14
+ * — the same authority the CLI and hooks use — so no second config
15
+ * implementation exists here. A malformed config degrades the host to
16
+ * recall-only instead of writing through an unevaluated configuration.
17
+ *
18
+ * The business write still goes EXCLUSIVELY through the Gate 3 capability
19
+ * public subpath, keeping the G4-2 architecture guard intact. `hostKind` is
20
+ * observability-only in Core (never used for admission or mode), but it is
21
+ * taken from the validated startup binding rather than hard-coded so each
22
+ * host's records remain attributable.
23
+ */
24
+ import * as path from 'node:path';
25
+ import { loadPdConfigForPlugin } from '@principles/host-runtime/pd-config';
26
+ import { submitPainCapability } from '@principles/core/runtime/pain-submit-capability';
27
+ /**
28
+ * Bind the Core submit capability to the workspace-effective PD config.
29
+ * Called once at MCP startup; the returned function is what the tool handler
30
+ * invokes per request.
31
+ *
32
+ * `env` is the same env `main()` resolved the binding from — never
33
+ * `process.env` directly — so a test-injected env stays authoritative.
34
+ */
35
+ export function assembleSubmitCapability(workspaceDir, host, env = process.env) {
36
+ const config = loadPdConfigForPlugin(workspaceDir);
37
+ if (!config.ok) {
38
+ return {
39
+ ok: false,
40
+ reasonCode: 'pd_config_invalid',
41
+ errorCount: config.errors.length,
42
+ };
43
+ }
44
+ const stateDir = path.join(workspaceDir, '.state');
45
+ const effectiveConfig = config.effective;
46
+ return {
47
+ ok: true,
48
+ call: ({ workspaceDir: boundWorkspaceDir, painId, taskId, submission }) => submitPainCapability({
49
+ workspaceDir: boundWorkspaceDir,
50
+ stateDir,
51
+ painId,
52
+ taskId,
53
+ hostKind: host,
54
+ effectiveConfig,
55
+ getEnvVar: (name) => {
56
+ const value = env[name];
57
+ return typeof value === 'string' ? value : undefined;
58
+ },
59
+ }, submission),
60
+ };
61
+ }
@@ -7,7 +7,7 @@
7
7
  * package.json. A unit test pins it to package.json so the two cannot drift.
8
8
  */
9
9
  export declare const SERVER_NAME: 'pd-mcp-server';
10
- export declare const SERVER_VERSION: '0.4.1';
10
+ export declare const SERVER_VERSION: '0.4.3';
11
11
  /** The only MCP SDK family/version this server is released against
12
12
  * (Gate 4-A freeze, PD_MCP_GATE4A_REALITY_CHECK §3). Exact pin — no ranges. */
13
13
  export declare const MCP_SDK_PIN: '@modelcontextprotocol/server@2.4.0';
@@ -7,7 +7,7 @@
7
7
  * package.json. A unit test pins it to package.json so the two cannot drift.
8
8
  */
9
9
  export const SERVER_NAME = 'pd-mcp-server';
10
- export const SERVER_VERSION = '0.4.1';
10
+ export const SERVER_VERSION = '0.4.3';
11
11
  /** The only MCP SDK family/version this server is released against
12
12
  * (Gate 4-A freeze, PD_MCP_GATE4A_REALITY_CHECK §3). Exact pin — no ranges. */
13
13
  export const MCP_SDK_PIN = '@modelcontextprotocol/server@2.4.0';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/pd-mcp-server",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Principles Disciple MCP Server — the single shared MCP server implementation for the three PD hosts (Codex, OpenClaw, WorkBuddy). Read-only pain recall through the Gate 3 Capability (SPEC-PD-MCP-GATE4-001).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,6 +29,7 @@
29
29
  "dependencies": {
30
30
  "@modelcontextprotocol/server": "2.4.0",
31
31
  "@principles/core": "file:../core",
32
+ "@principles/host-runtime": "file:../host-runtime",
32
33
  "zod": "4.6.7"
33
34
  },
34
35
  "devDependencies": {