create-principles-disciple 1.126.2 → 1.127.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.
Files changed (67) hide show
  1. package/core/dist/runtime-v2/__tests__/pain-ingress-persistence.test.d.ts +2 -0
  2. package/core/dist/runtime-v2/__tests__/pain-ingress-persistence.test.d.ts.map +1 -0
  3. package/core/dist/runtime-v2/__tests__/pain-ingress-persistence.test.js +276 -0
  4. package/core/dist/runtime-v2/__tests__/pain-ingress-persistence.test.js.map +1 -0
  5. package/core/dist/runtime-v2/__tests__/pain-ingress-shared-semantics.test.d.ts +2 -0
  6. package/core/dist/runtime-v2/__tests__/pain-ingress-shared-semantics.test.d.ts.map +1 -0
  7. package/core/dist/runtime-v2/__tests__/pain-ingress-shared-semantics.test.js +131 -0
  8. package/core/dist/runtime-v2/__tests__/pain-ingress-shared-semantics.test.js.map +1 -0
  9. package/core/dist/runtime-v2/__tests__/pain-outcome-convergence.test.d.ts +2 -0
  10. package/core/dist/runtime-v2/__tests__/pain-outcome-convergence.test.d.ts.map +1 -0
  11. package/core/dist/runtime-v2/__tests__/pain-outcome-convergence.test.js +126 -0
  12. package/core/dist/runtime-v2/__tests__/pain-outcome-convergence.test.js.map +1 -0
  13. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-execute-pending.test.js +95 -0
  14. package/core/dist/runtime-v2/__tests__/pain-signal-bridge-execute-pending.test.js.map +1 -1
  15. package/core/dist/runtime-v2/index.d.ts +9 -1
  16. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  17. package/core/dist/runtime-v2/index.js +6 -0
  18. package/core/dist/runtime-v2/index.js.map +1 -1
  19. package/core/dist/runtime-v2/pain-ingress-payload.d.ts +207 -0
  20. package/core/dist/runtime-v2/pain-ingress-payload.d.ts.map +1 -0
  21. package/core/dist/runtime-v2/pain-ingress-payload.js +340 -0
  22. package/core/dist/runtime-v2/pain-ingress-payload.js.map +1 -0
  23. package/core/dist/runtime-v2/pain-ingress.d.ts +61 -0
  24. package/core/dist/runtime-v2/pain-ingress.d.ts.map +1 -0
  25. package/core/dist/runtime-v2/pain-ingress.js +163 -0
  26. package/core/dist/runtime-v2/pain-ingress.js.map +1 -0
  27. package/core/dist/runtime-v2/pain-signal-bridge.d.ts +39 -1
  28. package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
  29. package/core/dist/runtime-v2/pain-signal-bridge.js +163 -8
  30. package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
  31. package/core/dist/runtime-v2/pain-to-principle-service.d.ts +8 -1
  32. package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
  33. package/core/dist/runtime-v2/pain-to-principle-service.js +3 -0
  34. package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
  35. package/host-runtime/dist/index.d.ts +1 -0
  36. package/host-runtime/dist/index.js +3 -0
  37. package/host-runtime/dist/pain-evidence-ingress.d.ts +16 -0
  38. package/host-runtime/dist/pain-evidence-ingress.js +15 -0
  39. package/package.json +2 -2
  40. package/pd-cli/dist/commands/build-trajectory-evidence.d.ts +25 -6
  41. package/pd-cli/dist/commands/build-trajectory-evidence.d.ts.map +1 -1
  42. package/pd-cli/dist/commands/build-trajectory-evidence.js +174 -114
  43. package/pd-cli/dist/commands/build-trajectory-evidence.js.map +1 -1
  44. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  45. package/pd-cli/dist/commands/pain-record.js +212 -17
  46. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  47. package/pd-cli/dist/index.js +1 -1
  48. package/pd-cli/dist/index.js.map +1 -1
  49. package/plugin/dist/bundle.js +456 -454
  50. package/plugin/dist/governance-audit.js +152 -152
  51. package/plugin/dist/hooks/pain-ingress-adapter.d.ts +19 -0
  52. package/plugin/dist/hooks/trajectory-evidence.d.ts +32 -1
  53. package/plugin/dist/rulehost-evidence.js +155 -155
  54. package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +11 -4
  55. package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +36 -4
  56. package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +4 -1
  57. package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +9 -4
  58. package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +32 -4
  59. package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +3 -1
  60. package/plugin/openclaw.plugin.json +1 -1
  61. package/plugin/package.json +1 -1
  62. package/plugin/templates/langs/en/skills/pd-cli-operator/SKILL.md +11 -4
  63. package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +36 -4
  64. package/plugin/templates/langs/en/skills/pd-runtime-v2/SKILL.md +4 -1
  65. package/plugin/templates/langs/zh/skills/pd-cli-operator/SKILL.md +9 -4
  66. package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +32 -4
  67. package/plugin/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +3 -1
@@ -0,0 +1,19 @@
1
+ import type { PainIngressDecision } from '@principles/host-runtime';
2
+ import type { PainEvidenceEntry } from '@principles/core/runtime-v2';
3
+ import type { WorkspaceContext } from '../core/workspace-context.js';
4
+ export interface PluginIngressInput {
5
+ wctx: WorkspaceContext;
6
+ painId: string;
7
+ painType: 'tool_failure' | 'subagent_error' | 'user_frustration';
8
+ source: string;
9
+ reason: string;
10
+ score?: number;
11
+ sessionId?: string;
12
+ /** Evidence the emitter itself produced (signal-collector excerpt, correction-sample diff, shared-runtime metadata). */
13
+ inlineEvidence?: readonly PainEvidenceEntry[];
14
+ }
15
+ /**
16
+ * Evaluate one plugin pain funnel event through the shared ingress.
17
+ * Pure except for the trajectory read (typed acquisition).
18
+ */
19
+ export declare function ingressDecisionForPluginPain(input: PluginIngressInput): PainIngressDecision;
@@ -1,11 +1,42 @@
1
1
  /**
2
- * Trajectory Evidence Builder — PRI-326
2
+ * Trajectory Evidence Builder — PRI-326, PRI-642
3
3
  *
4
4
  * Extracted from pain.ts to avoid circular imports between
5
5
  * pain.ts and after-tool-call-helpers.ts.
6
6
  *
7
7
  * Pure data extraction — reads from trajectory DB, sanitizes, returns evidence entries.
8
+ *
9
+ * PRI-642 Scope A adds the typed acquisition API `acquireTrajectoryEvidence`
10
+ * (discriminated available/unavailable, SPEC §7.2). The legacy array API
11
+ * `buildTrajectoryEvidence` remains as a compatibility wrapper for automatic
12
+ * emitters and MUST keep its exact sentinel shapes until Scope B migrates
13
+ * those consumers (frozen decision #3).
8
14
  */
9
15
  import type { PainEvidenceEntry } from '@principles/core/runtime-v2';
10
16
  import type { WorkspaceContext } from '../core/workspace-context.js';
17
+ /**
18
+ * PRI-642 (SPEC §7.2): discriminated acquisition result. `unavailable` carries
19
+ * a distinct reasonCode so callers can degrade explicitly instead of counting
20
+ * sentinel placeholder entries as trajectory evidence.
21
+ */
22
+ export type TrajectoryEvidenceAcquisition = {
23
+ status: 'available';
24
+ entries: PainEvidenceEntry[];
25
+ } | {
26
+ status: 'unavailable';
27
+ reasonCode: 'trajectory_unavailable' | 'session_not_found' | 'empty_trajectory' | 'evidence_read_failed';
28
+ detail: string;
29
+ };
30
+ /**
31
+ * PRI-642 Scope A typed acquisition — returns the discriminated
32
+ * available/unavailable result. `available` requires at least one entry that
33
+ * references a real behavior trace; sentinel placeholder entries never count
34
+ * as available evidence.
35
+ */
36
+ export declare function acquireTrajectoryEvidence(wctx: WorkspaceContext, sessionId: string): TrajectoryEvidenceAcquisition;
37
+ /**
38
+ * Legacy array API (compatibility wrapper, PRI-642 frozen decision #3).
39
+ * Automatic emitters still consume this shape; Scope B migrates them to the
40
+ * typed API one family at a time before this wrapper may be removed.
41
+ */
11
42
  export declare function buildTrajectoryEvidence(wctx: WorkspaceContext, sessionId: string): PainEvidenceEntry[];