create-principles-disciple 1.147.19 → 1.148.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.
Files changed (185) hide show
  1. package/_release/product-identity.json +2 -2
  2. package/codex-adapter/package.json +1 -1
  3. package/console/dist/server/config/pd-config-store.js +6 -6
  4. package/console/dist/server/index.d.ts +20 -0
  5. package/console/dist/server/index.js +104 -84
  6. package/console/dist/server/models/ApprovalsConsoleModel.d.ts +1 -1
  7. package/console/dist/server/models/ApprovalsConsoleModel.js +5 -2
  8. package/console/dist/server/models/GovernanceExperienceCollector.js +2 -1
  9. package/console/dist/server/models/GovernanceProjectionCollector.js +11 -10
  10. package/console/dist/server/models/IntentPageModel.js +1 -1
  11. package/console/dist/server/models/OwnerDecisionViewModel.d.ts +3 -2
  12. package/console/dist/server/models/OwnerDecisionViewModel.js +8 -7
  13. package/console/dist/server/routes/activations.js +5 -5
  14. package/console/dist/server/routes/approvals-grouped.js +2 -2
  15. package/console/dist/server/routes/approvals.js +7 -7
  16. package/console/dist/server/routes/config.d.ts +4 -4
  17. package/console/dist/server/routes/config.js +5 -5
  18. package/console/dist/server/routes/evidence-chain.d.ts +1 -1
  19. package/console/dist/server/routes/evidence-outcomes.d.ts +2 -2
  20. package/console/dist/server/routes/examiner.d.ts +12 -12
  21. package/console/dist/server/routes/examiner.js +2 -2
  22. package/console/dist/server/routes/failed-tasks.d.ts +4 -4
  23. package/console/dist/server/routes/failed-tasks.js +10 -10
  24. package/console/dist/server/routes/governance.d.ts +1 -1
  25. package/console/dist/server/routes/governance.js +3 -3
  26. package/console/dist/server/routes/intent-decisions.d.ts +6 -6
  27. package/console/dist/server/routes/intent-decisions.js +13 -13
  28. package/console/dist/server/routes/intent.js +6 -6
  29. package/console/dist/server/routes/lifecycle.js +3 -3
  30. package/console/dist/server/routes/onboarding.d.ts +1 -1
  31. package/console/dist/server/routes/onboarding.js +4 -4
  32. package/console/dist/server/routes/owner-decision.d.ts +5 -5
  33. package/console/dist/server/routes/owner-decision.js +3 -3
  34. package/console/dist/server/routes/owner-decisions.d.ts +3 -3
  35. package/console/dist/server/routes/owner-decisions.js +3 -3
  36. package/console/dist/server/routes/owner-identity.d.ts +1 -1
  37. package/console/dist/server/routes/owner-identity.js +1 -1
  38. package/console/dist/server/routes/principles.d.ts +4 -3
  39. package/console/dist/server/routes/principles.js +5 -4
  40. package/console/dist/server/routes/receipts.d.ts +2 -2
  41. package/console/dist/server/routes/receipts.js +4 -4
  42. package/console/dist/server.d.ts +2 -1
  43. package/console/dist/server.js +9 -1
  44. package/console/dist/shared/prompt-injection-contract.d.ts +1 -1
  45. package/console/dist/web/assets/app.js +23 -23
  46. package/core/dist/index.d.ts +1 -1
  47. package/core/dist/index.d.ts.map +1 -1
  48. package/core/dist/index.js +3 -2
  49. package/core/dist/index.js.map +1 -1
  50. package/core/dist/runtime/activation/approval-review-guard.d.ts +2 -2
  51. package/core/dist/runtime/activation/approval-review-guard.d.ts.map +1 -1
  52. package/core/dist/runtime/activation/approval-review-guard.js +6 -1
  53. package/core/dist/runtime/activation/approval-review-guard.js.map +1 -1
  54. package/core/dist/runtime/activation/prompt-budget-policy.d.ts +9 -1
  55. package/core/dist/runtime/activation/prompt-budget-policy.d.ts.map +1 -1
  56. package/core/dist/runtime/activation/prompt-budget-policy.js +9 -1
  57. package/core/dist/runtime/activation/prompt-budget-policy.js.map +1 -1
  58. package/core/dist/runtime/activation/recovery-control-surfaces.d.ts +1 -1
  59. package/core/dist/runtime/activation/recovery-control-surfaces.js +2 -2
  60. package/core/dist/runtime/activation/recovery-control-surfaces.js.map +1 -1
  61. package/core/dist/runtime/adapter/output-schema-registry.d.ts +1 -1
  62. package/core/dist/runtime/adapter/output-schema-registry.d.ts.map +1 -1
  63. package/core/dist/runtime/adapter/output-schema-registry.js +23 -18
  64. package/core/dist/runtime/adapter/output-schema-registry.js.map +1 -1
  65. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +1 -1
  66. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  67. package/core/dist/runtime/adapter/schema-json-converter.d.ts +1 -1
  68. package/core/dist/runtime/adapter/schema-json-converter.js +1 -1
  69. package/core/dist/runtime/adapter/tools/diagnostician-tool.js +1 -1
  70. package/core/dist/runtime/adapter/tools/diagnostician-tool.js.map +1 -1
  71. package/core/dist/runtime/diagnostician-output.d.ts +2 -2
  72. package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
  73. package/core/dist/runtime/diagnostician-output.js +1 -1
  74. package/core/dist/runtime/diagnostician-output.js.map +1 -1
  75. package/core/dist/runtime/feature-flags/plugin-surface-registry.d.ts.map +1 -1
  76. package/core/dist/runtime/feature-flags/plugin-surface-registry.js +10 -0
  77. package/core/dist/runtime/feature-flags/plugin-surface-registry.js.map +1 -1
  78. package/core/dist/runtime/governance-experience-contract.d.ts +4 -4
  79. package/core/dist/runtime/governance-experience-contract.d.ts.map +1 -1
  80. package/core/dist/runtime/governance-experience-contract.js +3 -2
  81. package/core/dist/runtime/governance-experience-contract.js.map +1 -1
  82. package/core/dist/runtime/governance-experience.d.ts.map +1 -1
  83. package/core/dist/runtime/governance-experience.js +2 -1
  84. package/core/dist/runtime/governance-experience.js.map +1 -1
  85. package/core/dist/runtime/governance-projection-contract.d.ts +14 -14
  86. package/core/dist/runtime/governance-projection-contract.d.ts.map +1 -1
  87. package/core/dist/runtime/governance-projection-contract.js +4 -3
  88. package/core/dist/runtime/governance-projection-contract.js.map +1 -1
  89. package/core/dist/runtime/governance-projection.d.ts.map +1 -1
  90. package/core/dist/runtime/governance-projection.js +2 -1
  91. package/core/dist/runtime/governance-projection.js.map +1 -1
  92. package/core/dist/runtime/index.d.ts +2 -2
  93. package/core/dist/runtime/index.d.ts.map +1 -1
  94. package/core/dist/runtime/index.js +2 -3
  95. package/core/dist/runtime/index.js.map +1 -1
  96. package/core/dist/runtime/internalization/artificer-runner.d.ts +1 -1
  97. package/core/dist/runtime/internalization/artificer-runner.d.ts.map +1 -1
  98. package/core/dist/runtime/internalization/artificer-runner.js +3 -2
  99. package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
  100. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
  101. package/core/dist/runtime/internalization/diag-distiller-runner.js +3 -2
  102. package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
  103. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  104. package/core/dist/runtime/internalization/diag-rootcause-runner.js +3 -2
  105. package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
  106. package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
  107. package/core/dist/runtime/internalization/diag-router-runner.js +4 -3
  108. package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
  109. package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
  110. package/core/dist/runtime/internalization/dreamer-runner.js +3 -2
  111. package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
  112. package/core/dist/runtime/internalization/evaluator-runner.d.ts.map +1 -1
  113. package/core/dist/runtime/internalization/evaluator-runner.js +3 -2
  114. package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
  115. package/core/dist/runtime/internalization/philosopher-runner.d.ts +1 -1
  116. package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
  117. package/core/dist/runtime/internalization/philosopher-runner.js +3 -2
  118. package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
  119. package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts +1 -1
  120. package/core/dist/runtime/internalization/rollout-reviewer-output.js +1 -1
  121. package/core/dist/runtime/internalization/rollout-reviewer-output.js.map +1 -1
  122. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  123. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +3 -2
  124. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  125. package/core/dist/runtime/internalization/router-context-evidence.d.ts +1 -1
  126. package/core/dist/runtime/internalization/router-context-evidence.d.ts.map +1 -1
  127. package/core/dist/runtime/internalization/router-context-evidence.js +4 -1
  128. package/core/dist/runtime/internalization/router-context-evidence.js.map +1 -1
  129. package/core/dist/runtime/internalization/scribe-runner.d.ts +1 -1
  130. package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
  131. package/core/dist/runtime/internalization/scribe-runner.js +3 -2
  132. package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
  133. package/core/dist/runtime/learning-lab/actor-action-output.d.ts +1 -1
  134. package/core/dist/runtime/learning-lab/actor-action-output.d.ts.map +1 -1
  135. package/core/dist/runtime/learning-lab/actor-action-output.js +1 -1
  136. package/core/dist/runtime/learning-lab/actor-action-output.js.map +1 -1
  137. package/core/dist/runtime/observer/correction-observer.d.ts.map +1 -1
  138. package/core/dist/runtime/observer/correction-observer.js +3 -2
  139. package/core/dist/runtime/observer/correction-observer.js.map +1 -1
  140. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts +1 -1
  141. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts.map +1 -1
  142. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js +2 -1
  143. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js.map +1 -1
  144. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts +8 -8
  145. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts.map +1 -1
  146. package/core/dist/runtime/owner-decision/owner-decision-view.js +10 -9
  147. package/core/dist/runtime/owner-decision/owner-decision-view.js.map +1 -1
  148. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts +1 -1
  149. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts.map +1 -1
  150. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js +1 -1
  151. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js.map +1 -1
  152. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.d.ts.map +1 -1
  153. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js +5 -4
  154. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js.map +1 -1
  155. package/core/dist/runtime/schema-version.d.ts +30 -14
  156. package/core/dist/runtime/schema-version.d.ts.map +1 -1
  157. package/core/dist/runtime/schema-version.js +33 -13
  158. package/core/dist/runtime/schema-version.js.map +1 -1
  159. package/core/package.json +1 -1
  160. package/host-runtime/dist/active-principle-prompt.d.ts +38 -0
  161. package/host-runtime/dist/active-principle-prompt.js +49 -3
  162. package/host-runtime/dist/index.d.ts +11 -0
  163. package/host-runtime/dist/index.js +2 -0
  164. package/host-runtime/dist/prompt-injection-budget-observation.js +10 -8
  165. package/host-runtime/dist/signal-classifier.d.ts +3 -1
  166. package/host-runtime/dist/signal-classifier.js +5 -3
  167. package/host-runtime/package.json +1 -1
  168. package/package.json +3 -3
  169. package/pd-cli/package.json +1 -1
  170. package/pd-mcp-server/dist/version.d.ts +1 -1
  171. package/pd-mcp-server/dist/version.js +1 -1
  172. package/pd-mcp-server/package.json +1 -1
  173. package/plugin/dist/bundle.js +439 -439
  174. package/plugin/dist/core/event-log.d.ts +5 -0
  175. package/plugin/dist/governance-audit.js +2 -2
  176. package/plugin/dist/hooks/adaptive-activation-config.d.ts +24 -2
  177. package/plugin/dist/hooks/adaptive-principle-resolution.d.ts +35 -0
  178. package/plugin/dist/host-runtime/openclaw-host-runtime.d.ts +3 -0
  179. package/plugin/dist/index.d.ts +14 -2
  180. package/plugin/dist/openclaw.plugin.json +1 -1
  181. package/plugin/dist/rulehost-evidence.js +9 -9
  182. package/plugin/openclaw.plugin.json +1 -1
  183. package/plugin/package.json +1 -1
  184. package/release-manager/package.json +1 -1
  185. package/workbuddy-adapter/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-evaluation-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-evaluation-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG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,CAAC;CAClC;AAaD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAmB;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,YAAY,IAAI,EAAE,yBAAyB,EAAE,OAAO,GAAE,4BAAiC,EAMtF;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,SAIjB;IAEZ,4DAA4D;IAC5D,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAuCtD;IAED;;;;;OAKG;IACG,SAAS,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAW7E;IAED,kEAAkE;YACpD,iBAAiB;IAmD/B;;;;OAIG;YACW,MAAM;CA+DrB;AAID,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKpE"}
@@ -1,3 +1,4 @@
1
+ import { RUNTIME_CONTRACT_SCHEMA_VERSION } from '../schema-version.js';
1
2
  import { ReuseEvaluationOutputV1Schema, validateReuseEvaluationOutput, } from './reuse-evaluation-output.js';
2
3
  import { attemptStructuredOutputRepair, } from '../adapter/structured-output-repair.js';
3
4
  /**
@@ -131,7 +132,7 @@ export class ReuseEvaluationRunner {
131
132
  schemaCheck: (value) => validateReuseEvaluationOutput(value).ok,
132
133
  }, {
133
134
  maxRepairAttempts: this.maxRepairAttempts,
134
- schemaRef: 'reuse-evaluation-output-v1',
135
+ schemaRef: 'reuse-evaluation-output',
135
136
  schemaJson: JSON.stringify(ReuseEvaluationOutputV1Schema),
136
137
  requiredKeys: ['recommendation', 'rationale', 'confidence'],
137
138
  });
@@ -159,11 +160,11 @@ export class ReuseEvaluationRunner {
159
160
  */
160
161
  async invoke(prompt, phase) {
161
162
  const runHandle = await this.runtimeAdapter.startRun({
162
- agentSpec: { agentId: this.agentId, schemaVersion: 'v1' },
163
+ agentSpec: { agentId: this.agentId, schemaVersion: RUNTIME_CONTRACT_SCHEMA_VERSION },
163
164
  taskRef: { taskId: `reuse_eval_${phase}_${Date.now()}` },
164
165
  inputPayload: prompt,
165
166
  contextItems: [],
166
- outputSchemaRef: 'reuse-evaluation-output-v1',
167
+ outputSchemaRef: 'reuse-evaluation-output',
167
168
  timeoutMs: this.timeoutMs,
168
169
  systemPrompt: ReuseEvaluationRunner.SYSTEM_PROMPT,
169
170
  });
@@ -207,7 +208,7 @@ export class ReuseEvaluationRunner {
207
208
  throw new ReuseEvaluationError({
208
209
  reason: 'output_invalid',
209
210
  message: `Reuse evaluation ${phase} output could not be parsed or validated by the runtime`,
210
- nextAction: 'Inspect the runtime output format; the adapter rejected it against reuse-evaluation-output-v1',
211
+ nextAction: 'Inspect the runtime output format; the adapter rejected it against reuse-evaluation-output',
211
212
  detail: err instanceof Error ? err.message : String(err),
212
213
  });
213
214
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reuse-evaluation-runner.js","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-evaluation-runner.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,GAE9B,MAAM,wCAAwC,CAAC;AAkChD;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7B,MAAM,CAA+B;IACrC,UAAU,CAAS;IACnB,MAAM,CAAU;IAChB,cAAc,CAAS;IAEvC,YAAY,IAMX;QACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,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C,SAAS,IAAI;gBACrE,UAAU,EAAE,yEAAyE;aACtF,CAAC,CAAC;QACL,CAAC;QAED,IAAI,MAAoC,CAAC;QACzC,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,yEAAyE;YACzE,uEAAuE;YACvE,kEAAkE;YAClE,MAAM,IAAI,oBAAoB,CAAC;gBAC7B,MAAM,EAAE,gBAAgB;gBACxB,OAAO,EAAE,oBAAoB,KAAK,yDAAyD;gBAC3F,UAAU,EAAE,+FAA+F;gBAC3G,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACzD,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACvE,MAAM,IAAI,oBAAoB,CAAC;gBAC7B,MAAM,EAAE,oBAAoB;gBAC5B,OAAO,EAAE,oBAAoB,KAAK,iCAAiC;gBACnE,UAAU,EAAE,0DAA0D;aACvE,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF;AAED,sEAAsE;AACtE,6EAA6E;AAC7E,MAAM,UAAU,4BAA4B,CAAC,KAAc;IACzD,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"reuse-evaluation-runner.js","sourceRoot":"","sources":["../../../src/runtime/principle-reuse/reuse-evaluation-runner.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,O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UAAU,EAAE,0DAA0D;aACvE,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF;AAED,sEAAsE;AACtE,6EAA6E;AAC7E,MAAM,UAAU,4BAA4B,CAAC,KAAc;IACzD,yEAAyE;IACzE,0EAA0E;IAC1E,0EAA0E;IAC1E,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
@@ -1,20 +1,36 @@
1
1
  /**
2
- * Schema versioning mechanism for PD Runtime v2 contracts.
2
+ * Schema versioning mechanism for PD runtime contracts.
3
3
  *
4
- * Each versioned contract carries a `schemaVersion` field so that
5
- * evolution is explicit and detectable at runtime.
4
+ * Each versioned contract carries a `schemaVersion` field so that evolution
5
+ * is explicit and detectable at runtime.
6
6
  *
7
- * Source: PD Runtime Protocol SPEC v1, Section 11.3
7
+ * PRI-1139 (PR-6 write-side cutover): the versioned helpers that used to
8
+ * live here — the `schemaRef(kind, version)` formatter, the '1.0.0' runtime
9
+ * schema-version constant (either spelling of its generational name), and
10
+ * their TypeBox schemas — are retired. They had no production consumers at
11
+ * retirement. The field NAME `schemaVersion` is unchanged; its written VALUE
12
+ * is the version-neutral token below, and historical `'1'` payloads remain
13
+ * valid reads for as long as backward read compatibility is required.
8
14
  */
9
15
  import { type Static } from '@sinclair/typebox';
10
- /** Current schema version for all runtime contracts. */
11
- export declare const RUNTIME_SCHEMA_VERSION = "1.0.0";
12
- /** Version prefix used in schema refs (e.g., "diagnostician-output-v1"). */
13
- export declare function schemaRef(kind: string, version: number): string;
14
- /** TypeBox schema for versioned schema references (format: "kind-vN"). */
15
- export declare const SchemaVersionRefSchema: import("@sinclair/typebox").TString;
16
- export type SchemaVersionRef = Static<typeof SchemaVersionRefSchema>;
17
- /** TypeBox literal schema for the current runtime schema version. */
18
- export declare const RuntimeSchemaVersionSchema: import("@sinclair/typebox").TLiteral<"1.0.0">;
19
- export type RuntimeSchemaVersion = Static<typeof RuntimeSchemaVersionSchema>;
16
+ /**
17
+ * The `schemaVersion` value every current writer stamps. Version-neutral by
18
+ * design: a bare `-vN` suffix would recreate the generational naming PRI-1104
19
+ * removed, while a semver string would imply independent per-contract
20
+ * versioning that does not exist.
21
+ */
22
+ export declare const RUNTIME_CONTRACT_SCHEMA_VERSION = "current";
23
+ /**
24
+ * The value written before the PRI-1139 cutover. Kept as a named constant so
25
+ * read-side dual acceptance is a one-line membership check, not a bare string.
26
+ */
27
+ export declare const LEGACY_RUNTIME_CONTRACT_SCHEMA_VERSION = "1";
28
+ /**
29
+ * Read-side contract: accepts the current token and the legacy pre-cutover
30
+ * value. Anything else fails validation (fail loud, no silent fallback).
31
+ */
32
+ export declare const RuntimeContractSchemaVersionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"current">, import("@sinclair/typebox").TLiteral<"1">]>;
33
+ export type RuntimeContractSchemaVersion = Static<typeof RuntimeContractSchemaVersionSchema>;
34
+ /** Runtime guard for {@link RuntimeContractSchemaVersionSchema}. */
35
+ export declare function isRuntimeContractSchemaVersion(value: unknown): value is RuntimeContractSchemaVersion;
20
36
  //# sourceMappingURL=schema-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/runtime/schema-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEtD,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,qCAAgB,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE,qEAAqE;AACrE,eAAO,MAAM,0BAA0B,+CAAwB,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/runtime/schema-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,YAAY,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,kCAAkC,kIAG7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE7F,oEAAoE;AACpE,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,4BAA4B,CAEpG"}
@@ -1,20 +1,40 @@
1
1
  /**
2
- * Schema versioning mechanism for PD Runtime v2 contracts.
2
+ * Schema versioning mechanism for PD runtime contracts.
3
3
  *
4
- * Each versioned contract carries a `schemaVersion` field so that
5
- * evolution is explicit and detectable at runtime.
4
+ * Each versioned contract carries a `schemaVersion` field so that evolution
5
+ * is explicit and detectable at runtime.
6
6
  *
7
- * Source: PD Runtime Protocol SPEC v1, Section 11.3
7
+ * PRI-1139 (PR-6 write-side cutover): the versioned helpers that used to
8
+ * live here — the `schemaRef(kind, version)` formatter, the '1.0.0' runtime
9
+ * schema-version constant (either spelling of its generational name), and
10
+ * their TypeBox schemas — are retired. They had no production consumers at
11
+ * retirement. The field NAME `schemaVersion` is unchanged; its written VALUE
12
+ * is the version-neutral token below, and historical `'1'` payloads remain
13
+ * valid reads for as long as backward read compatibility is required.
8
14
  */
9
15
  import { Type } from '@sinclair/typebox';
10
- /** Current schema version for all runtime contracts. */
11
- export const RUNTIME_SCHEMA_VERSION = '1.0.0';
12
- /** Version prefix used in schema refs (e.g., "diagnostician-output-v1"). */
13
- export function schemaRef(kind, version) {
14
- return `${kind}-v${version}`;
16
+ /**
17
+ * The `schemaVersion` value every current writer stamps. Version-neutral by
18
+ * design: a bare `-vN` suffix would recreate the generational naming PRI-1104
19
+ * removed, while a semver string would imply independent per-contract
20
+ * versioning that does not exist.
21
+ */
22
+ export const RUNTIME_CONTRACT_SCHEMA_VERSION = 'current';
23
+ /**
24
+ * The value written before the PRI-1139 cutover. Kept as a named constant so
25
+ * read-side dual acceptance is a one-line membership check, not a bare string.
26
+ */
27
+ export const LEGACY_RUNTIME_CONTRACT_SCHEMA_VERSION = '1';
28
+ /**
29
+ * Read-side contract: accepts the current token and the legacy pre-cutover
30
+ * value. Anything else fails validation (fail loud, no silent fallback).
31
+ */
32
+ export const RuntimeContractSchemaVersionSchema = Type.Union([
33
+ Type.Literal(RUNTIME_CONTRACT_SCHEMA_VERSION),
34
+ Type.Literal(LEGACY_RUNTIME_CONTRACT_SCHEMA_VERSION),
35
+ ]);
36
+ /** Runtime guard for {@link RuntimeContractSchemaVersionSchema}. */
37
+ export function isRuntimeContractSchemaVersion(value) {
38
+ return value === RUNTIME_CONTRACT_SCHEMA_VERSION || value === LEGACY_RUNTIME_CONTRACT_SCHEMA_VERSION;
15
39
  }
16
- /** TypeBox schema for versioned schema references (format: "kind-vN"). */
17
- export const SchemaVersionRefSchema = Type.String();
18
- /** TypeBox literal schema for the current runtime schema version. */
19
- export const RuntimeSchemaVersionSchema = Type.Literal('1.0.0');
20
40
  //# sourceMappingURL=schema-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-version.js","sourceRoot":"","sources":["../../src/runtime/schema-version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,wDAAwD;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAE9C,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,OAAe;IACrD,OAAO,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;AAGpD,qEAAqE;AACrE,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"schema-version.js","sourceRoot":"","sources":["../../src/runtime/schema-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,SAAS,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3D,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,sCAAsC,CAAC;CACrD,CAAC,CAAC;AAGH,oEAAoE;AACpE,MAAM,UAAU,8BAA8B,CAAC,KAAc;IAC3D,OAAO,KAAK,KAAK,+BAA+B,IAAI,KAAK,KAAK,sCAAsC,CAAC;AACvG,CAAC"}
package/core/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/core",
3
- "version": "5.2.0",
3
+ "version": "6.0.0",
4
4
  "description": "Pure-logic core of Principles Disciple, an AI Agent Governance System - pain signal capture and principle proposal (no I/O)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -115,6 +115,32 @@ export interface SharedDirectivePacking {
115
115
  dropped: string[];
116
116
  oversized: string[];
117
117
  }
118
+ /**
119
+ * PRI-1140: resolve a configured principle identity to the AT MOST ONE
120
+ * currently-authorized prompt activation of that principle, so a delivery
121
+ * mapping survives Owner revisions (the prompt-replacement flow deactivates
122
+ * the pinned activation) without editing plugin config per revision. Read-only
123
+ * over the SAME candidates reader the shared assembly uses — selection never
124
+ * creates authorization, and the downstream guards in
125
+ * `buildActivePrinciplePromptContext` re-verify authority/content before any
126
+ * injection. Errors fail closed to Native: the caller gets a structured
127
+ * reason, never a guess.
128
+ */
129
+ export type ResolveCurrentAuthorizedActivationResult = {
130
+ ok: true;
131
+ principleId: string;
132
+ artifactId: string;
133
+ activationId: string;
134
+ warnings: string[];
135
+ } | {
136
+ ok: false;
137
+ reason: 'principle_not_currently_authorized' | 'ambiguous_current_activations' | 'candidates_unavailable';
138
+ warnings: string[];
139
+ };
140
+ export declare function resolveCurrentAuthorizedActivationByPrincipleId(input: {
141
+ workspaceDir: string;
142
+ principleId: string;
143
+ }): Promise<ResolveCurrentAuthorizedActivationResult>;
118
144
  /**
119
145
  * PRI-1137 final review P1-5: did the AUTHORIZATION FACTS of the adaptive
120
146
  * priority target change between the native snapshot (first read) and the
@@ -197,6 +223,18 @@ export declare function buildActivePrinciplePromptContext(input: {
197
223
  artifactId: string;
198
224
  activationId: string;
199
225
  };
226
+ /**
227
+ * PRI-1140 (Owner supplementary condition): additive-only adaptive packing.
228
+ * Only meaningful together with `adaptivePriority`. When true, the
229
+ * prioritized repack is accepted ONLY if it keeps every activation the
230
+ * native baseline already assembled (a pure superset — the target may be
231
+ * placed first, but nothing native-included may be squeezed out); otherwise
232
+ * the native baseline is kept and the would-be displacement is recorded via
233
+ * `adaptivePacking.reason='would_displace_native_assembly'` +
234
+ * `displacedActivationIds`. The legacy pinned-identity path is unaffected
235
+ * (its budget-driven displacement semantics are preserved verbatim).
236
+ */
237
+ additiveOnly?: boolean;
200
238
  /** Principles in the native pack that adaptive packing must preserve. */
201
239
  mandatoryPrincipleIds?: string[];
202
240
  /** Request cancellation forwarded to the final read-only target revalidation. */
@@ -95,6 +95,42 @@ export async function readPromptActivationCandidates(input) {
95
95
  }
96
96
  return { principles, warnings, aborted: false, selfReportEnabled };
97
97
  }
98
+ export async function resolveCurrentAuthorizedActivationByPrincipleId(input) {
99
+ const principleId = typeof input.principleId === 'string' ? input.principleId.trim() : '';
100
+ if (!principleId) {
101
+ return { ok: false, reason: 'principle_not_currently_authorized', warnings: [] };
102
+ }
103
+ // Mirrors the adaptive authority re-read (noBusyWait): an optional
104
+ // enhancement must not hold the host behind the synchronous busy wait; a
105
+ // read warning means the candidate set itself is not trustworthy, so the
106
+ // resolution fails closed instead of selecting from a degraded list.
107
+ const candidates = await readPromptActivationCandidates({
108
+ workspaceDir: input.workspaceDir,
109
+ includeAuthority: true,
110
+ noBusyWait: true,
111
+ });
112
+ if (candidates.aborted || candidates.warnings.length > 0) {
113
+ return { ok: false, reason: 'candidates_unavailable', warnings: candidates.warnings };
114
+ }
115
+ const matches = candidates.principles.filter((principle) => principle.principleId === principleId);
116
+ if (matches.length === 0) {
117
+ return { ok: false, reason: 'principle_not_currently_authorized', warnings: candidates.warnings };
118
+ }
119
+ if (matches.length > 1) {
120
+ return { ok: false, reason: 'ambiguous_current_activations', warnings: candidates.warnings };
121
+ }
122
+ const [resolved] = matches;
123
+ if (!resolved) {
124
+ return { ok: false, reason: 'principle_not_currently_authorized', warnings: candidates.warnings };
125
+ }
126
+ return {
127
+ ok: true,
128
+ principleId: resolved.principleId,
129
+ artifactId: resolved.artifactId,
130
+ activationId: resolved.activationId,
131
+ warnings: candidates.warnings,
132
+ };
133
+ }
98
134
  /**
99
135
  * PRI-1137 final review P1-5: did the AUTHORIZATION FACTS of the adaptive
100
136
  * priority target change between the native snapshot (first read) and the
@@ -390,13 +426,23 @@ export async function buildActivePrinciplePromptContext(input) {
390
426
  || mandatoryIds.some((id) => !prioritizedPacking.included.some((principle) => principle.principleId === id))) {
391
427
  return { ...nativeResult, adaptivePacking: report('unavailable', 'mandatory_constraint_displaced') };
392
428
  }
393
- const stillValid = await revalidateAdaptivePrinciple(input.workspaceDir, authorizedTarget, signal);
394
- if (!stillValid)
395
- return { ...nativeResult, adaptivePacking: report('unavailable', 'target_changed') };
396
429
  const prioritizedActivationIds = new Set(prioritizedPacking.included.map((principle) => principle.activationId));
397
430
  const displacedActivationIds = nativePacking.included
398
431
  .filter((principle) => !prioritizedActivationIds.has(principle.activationId))
399
432
  .map((principle) => principle.activationId);
433
+ // PRI-1140: an additive-only target may never squeeze out content the
434
+ // native baseline already assembled. Decided BEFORE the revalidation read so
435
+ // a refused placement costs no further I/O; the would-be displacement is the
436
+ // recorded reason (bounded like the other diagnostic id lists).
437
+ if (input.additiveOnly === true && displacedActivationIds.length > 0) {
438
+ return {
439
+ ...nativeResult,
440
+ adaptivePacking: report('unavailable', 'would_displace_native_assembly', displacedActivationIds.slice(0, MAX_SHARED_DIAGNOSTIC_IDS)),
441
+ };
442
+ }
443
+ const stillValid = await revalidateAdaptivePrinciple(input.workspaceDir, authorizedTarget, signal);
444
+ if (!stillValid)
445
+ return { ...nativeResult, adaptivePacking: report('unavailable', 'target_changed') };
400
446
  const result = makeResult(prioritizedPacking, principles, prepared('prioritized', displacedActivationIds));
401
447
  // Adaptive assembly is deliberately limited to the existing renderer's Native budget cap.
402
448
  return result;
@@ -91,12 +91,23 @@ export declare function createProductionHostRuntime(options?: Partial<Pick<HostR
91
91
  adaptivePriorityProvider?: (event: HostEvent) => {
92
92
  artifactId: string;
93
93
  activationId: string;
94
+ /**
95
+ * PRI-1140: true when the provider resolved the target by CURRENT
96
+ * principle identity (revision-resilient selection). The shared
97
+ * assembly then runs its prioritized repack additively — it may place
98
+ * the target first, but must never squeeze out content the native
99
+ * baseline already assembled (otherwise the native baseline is kept and
100
+ * `would_displace_native_assembly` is recorded). Absent/false keeps the
101
+ * legacy pinned-identity semantics untouched.
102
+ */
103
+ additiveOnly?: boolean;
94
104
  hookInvocationId?: string;
95
105
  signal?: AbortSignal;
96
106
  deadlineAt?: number;
97
107
  } | undefined | Promise<{
98
108
  artifactId: string;
99
109
  activationId: string;
110
+ additiveOnly?: boolean;
100
111
  hookInvocationId?: string;
101
112
  signal?: AbortSignal;
102
113
  deadlineAt?: number;
@@ -249,6 +249,7 @@ export function createProductionHostRuntime(options = {}) {
249
249
  adaptivePriority = await options.adaptivePriorityProvider(event);
250
250
  if (adaptivePriority && (typeof adaptivePriority.artifactId !== 'string' || !adaptivePriority.artifactId.trim()
251
251
  || typeof adaptivePriority.activationId !== 'string' || !adaptivePriority.activationId.trim()
252
+ || (adaptivePriority.additiveOnly !== undefined && typeof adaptivePriority.additiveOnly !== 'boolean')
252
253
  || (adaptivePriority.deadlineAt !== undefined && !Number.isFinite(adaptivePriority.deadlineAt)))) {
253
254
  adaptivePriority = undefined;
254
255
  }
@@ -268,6 +269,7 @@ export function createProductionHostRuntime(options = {}) {
268
269
  ...(roundKey !== undefined ? { roundKey } : {}),
269
270
  ...(adaptivePriority ? {
270
271
  adaptivePriority: { artifactId: adaptivePriority.artifactId, activationId: adaptivePriority.activationId },
272
+ ...(adaptivePriority.additiveOnly === true ? { additiveOnly: true } : {}),
271
273
  ...(adaptivePriority.signal ? { signal: adaptivePriority.signal } : {}),
272
274
  ...(adaptivePriority.deadlineAt !== undefined ? { deadlineAt: adaptivePriority.deadlineAt } : {}),
273
275
  ...(adaptivePriority.hookInvocationId ? { hookInvocationId: adaptivePriority.hookInvocationId } : {}),
@@ -3,10 +3,11 @@ import path from 'node:path';
3
3
  import { PROMPT_BUDGET_POLICY_VERSION, RUNTIME_PRINCIPLE_BUDGET, isValidContextWindowTokens, promptBudgetCharsForContextWindow, resolvePromptBudget, operatorDeclaredContextWindow, } from '@principles/core/runtime';
4
4
  import { isPromptInjectionTargetHost, } from './prompt-injection-projection.js';
5
5
  /**
6
- * PRI-1104 Stage 0 (expand): accepted budget policy provenance versions.
6
+ * PRI-1104 Stage 0 (expand) / PRI-1139 (PR-6 cutover): accepted budget policy
7
+ * provenance versions.
7
8
  *
8
9
  * Injection events written to the JSONL event log carry `budgetPolicyVersion`
9
- * as a durable wire literal. PR-6 renames the CURRENT policy id from
10
+ * as a durable wire literal. PR-6 renamed the CURRENT policy id from
10
11
  * `model_aware_v2` to a version-neutral `model_aware`; without this read-side
11
12
  * allowance, every historical event would suddenly be classified as
12
13
  * "computed under a different policy" and silently skipped (and a revert of
@@ -14,13 +15,14 @@ import { isPromptInjectionTargetHost, } from './prompt-injection-projection.js';
14
15
  *
15
16
  * These are FROZEN WIRE LITERALS, not a second policy definition: they exist
16
17
  * only so events remain readable across the PR-6 rename AND its revert. The
17
- * PR-6 target id `model_aware` is listed up front (PR #2367 CodeRabbit #2):
18
- * if PR-6 is reverted after it wrote `model_aware` events, a reader accepting
19
- * only `model_aware_v2` would silently skip those observations and the console
20
- * would fall back to a stale budget.
18
+ * pre-cutover id `model_aware_v2` is listed explicitly (PR #2367 CodeRabbit
19
+ * #2): if PR-6 is reverted, a reader accepting only the then-current
20
+ * `model_aware` would silently skip every historical observation and the
21
+ * console would fall back to a stale budget.
21
22
  *
22
- * Today the writer emits only `model_aware_v2`, so listing the future and
23
- * historical literals does not change any current read result.
23
+ * Since the PRI-1139 cutover the writer emits `model_aware`; both spellings
24
+ * denote the SAME formula, so an accepted event of either id is valid
25
+ * evidence about the current budget math.
24
26
  */
25
27
  const ACCEPTED_BUDGET_POLICY_VERSIONS = new Set([
26
28
  PROMPT_BUDGET_POLICY_VERSION,
@@ -29,8 +29,10 @@ export interface CreateSignalClassifierOptions {
29
29
  * packages/principles-core/src/runtime/adapter/output-schema-registry.ts:
30
30
  * the adapter fails loud (`output_invalid`) on an unregistered ref, and the
31
31
  * catch below would silently degrade Stage 2 to "no classification".
32
+ * PRI-1139: version-neutral canonical key; the pre-cutover `-v2` spelling
33
+ * still resolves through the registry's PRI-1104 alias table.
32
34
  */
33
- export declare const SIGNAL_CLASSIFICATION_SCHEMA_REF = "signal-classification-output-v2";
35
+ export declare const SIGNAL_CLASSIFICATION_SCHEMA_REF = "signal-classification-output";
34
36
  /** Build the classifier from an already-resolved profile (no config I/O). */
35
37
  export declare function createSignalLlmClassifier(profile: SignalClassifierProfile, workspaceDir: string, options?: CreateSignalClassifierOptions): SignalLlmClassifier;
36
38
  export type SignalClassifierResolution = {
@@ -13,7 +13,7 @@
13
13
  * No second model runtime is introduced (ADR-0029: pi-ai is the only backend).
14
14
  */
15
15
  import path from 'node:path';
16
- import { PiAiRuntimeAdapter, SIGNAL_CLASSIFIER_SYSTEM_PROMPT, buildLlmPrompt, resolveLlmClassificationPayload, safeStringifyPreview, } from '@principles/core/runtime';
16
+ import { PiAiRuntimeAdapter, RUNTIME_CONTRACT_SCHEMA_VERSION, SIGNAL_CLASSIFIER_SYSTEM_PROMPT, buildLlmPrompt, resolveLlmClassificationPayload, safeStringifyPreview, } from '@principles/core/runtime';
17
17
  import { loadPdConfigForPlugin } from './pd-config.js';
18
18
  /**
19
19
  * The Stage-2 structured-output contract this classifier requests. It MUST stay
@@ -21,8 +21,10 @@ import { loadPdConfigForPlugin } from './pd-config.js';
21
21
  * packages/principles-core/src/runtime/adapter/output-schema-registry.ts:
22
22
  * the adapter fails loud (`output_invalid`) on an unregistered ref, and the
23
23
  * catch below would silently degrade Stage 2 to "no classification".
24
+ * PRI-1139: version-neutral canonical key; the pre-cutover `-v2` spelling
25
+ * still resolves through the registry's PRI-1104 alias table.
24
26
  */
25
- export const SIGNAL_CLASSIFICATION_SCHEMA_REF = 'signal-classification-output-v2';
27
+ export const SIGNAL_CLASSIFICATION_SCHEMA_REF = 'signal-classification-output';
26
28
  /** Build the classifier from an already-resolved profile (no config I/O). */
27
29
  export function createSignalLlmClassifier(profile, workspaceDir, options = {}) {
28
30
  const timeoutMs = options.timeoutMs ?? profile.timeoutMs;
@@ -46,7 +48,7 @@ export function createSignalLlmClassifier(profile, workspaceDir, options = {}) {
46
48
  const effectiveTimeoutMs = callOptions?.timeoutMs ?? timeoutMs;
47
49
  try {
48
50
  const handle = await adapter.startRun({
49
- agentSpec: { agentId: 'signal-collector', schemaVersion: '1' },
51
+ agentSpec: { agentId: 'signal-collector', schemaVersion: RUNTIME_CONTRACT_SCHEMA_VERSION },
50
52
  inputPayload: { prompt },
51
53
  contextItems: [],
52
54
  timeoutMs: effectiveTimeoutMs,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/host-runtime",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "description": "Shared host-neutral orchestration for Principles Disciple MVP-Core hook paths.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.147.19",
3
+ "version": "1.148.2",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -99,7 +99,7 @@
99
99
  "directory": "packages/create-principles-disciple"
100
100
  },
101
101
  "pd": {
102
- "bundledPluginVersion": "3.0.2"
102
+ "bundledPluginVersion": "3.1.1"
103
103
  },
104
- "gitHead": "e501b96540b127d14b8f5562c7ba1d3ed8bb9788"
104
+ "gitHead": "8a791cfcfb34ec1a70dcdf392f4afc86c1a278c8"
105
105
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/pd-cli",
3
- "version": "1.168.0",
3
+ "version": "1.168.1",
4
4
  "description": "PD CLI — Pain recording, sample management, and governance tasks for Principles Disciple",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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.3.1';
10
+ export declare const SERVER_VERSION: '0.3.2';
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.3.1';
10
+ export const SERVER_VERSION = '0.3.2';
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.3.1",
3
+ "version": "0.3.2",
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",