@principles/core 1.186.0 → 1.187.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/dist/runtime-v2/__tests__/architecture-regression.test.js +7 -1
- package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js +134 -15
- package/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js.map +1 -1
- package/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts +18 -0
- package/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js +251 -0
- package/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js.map +1 -0
- package/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js +73 -0
- package/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js.map +1 -1
- package/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts +90 -0
- package/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician/diag-rootcause-output.js +108 -0
- package/dist/runtime-v2/diagnostician/diag-rootcause-output.js.map +1 -1
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts +8 -0
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +66 -3
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/diagnostician-output.d.ts +23 -0
- package/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician-output.js +16 -0
- package/dist/runtime-v2/diagnostician-output.js.map +1 -1
- package/dist/runtime-v2/diagnostician-prompt-builder.d.ts +32 -0
- package/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/index.d.ts +4 -2
- package/dist/runtime-v2/index.d.ts.map +1 -1
- package/dist/runtime-v2/index.js +5 -3
- package/dist/runtime-v2/index.js.map +1 -1
- package/dist/runtime-v2/intent/index.d.ts +1 -0
- package/dist/runtime-v2/intent/index.d.ts.map +1 -1
- package/dist/runtime-v2/intent/index.js +1 -0
- package/dist/runtime-v2/intent/index.js.map +1 -1
- package/dist/runtime-v2/intent/intent-doc-reader-port.d.ts +95 -0
- package/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -0
- package/dist/runtime-v2/intent/intent-doc-reader-port.js +43 -0
- package/dist/runtime-v2/intent/intent-doc-reader-port.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts +54 -0
- package/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js +219 -0
- package/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js +360 -0
- package/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js +333 -0
- package/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js +113 -0
- package/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js.map +1 -0
- package/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts +13 -0
- package/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/diag-rootcause-runner.js +42 -0
- package/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/diag-router-runner.js +27 -0
- package/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts +12 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.js +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/dist/runtime-v2/pain-to-principle-service.d.ts +6 -0
- package/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
- package/dist/runtime-v2/pain-to-principle-service.js +2 -0
- package/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,78 @@ export declare const DiagRootCauseEvidenceSchema: import("@sinclair/typebox").TO
|
|
|
43
43
|
}>;
|
|
44
44
|
/** Evidence entry linking a source reference to an explanatory note. */
|
|
45
45
|
export type DiagRootCauseEvidence = Static<typeof DiagRootCauseEvidenceSchema>;
|
|
46
|
+
/**
|
|
47
|
+
* Intent tension source enum (SPEC §16.5).
|
|
48
|
+
*
|
|
49
|
+
* - `none` — no tension detected
|
|
50
|
+
* - `action_drift` — Agent's action appears to drift from INTENT
|
|
51
|
+
* - `intent_suspect` — INTENT itself may be stale, ambiguous, or contradictory
|
|
52
|
+
* - `healthy_tension` — genuine strategic trade-off, no drift
|
|
53
|
+
*/
|
|
54
|
+
export declare const IntentTensionSourceSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>;
|
|
55
|
+
/** Intent tension source: none | action_drift | intent_suspect | healthy_tension */
|
|
56
|
+
export type IntentTensionSource = Static<typeof IntentTensionSourceSchema>;
|
|
57
|
+
/**
|
|
58
|
+
* Evidence strength enum (SPEC §16.6).
|
|
59
|
+
*
|
|
60
|
+
* Coarse three-level scale; intentionally NOT a numeric confidence
|
|
61
|
+
* (SPEC §16.3 forbids `intentTension.confidence`).
|
|
62
|
+
*/
|
|
63
|
+
export declare const EvidenceStrengthSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>;
|
|
64
|
+
/** Evidence strength: weak | moderate | strong */
|
|
65
|
+
export type EvidenceStrength = Static<typeof EvidenceStrengthSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* Related INTENT.md field enum (SPEC §16.7).
|
|
68
|
+
*
|
|
69
|
+
* Snake_case keys mirror the INTENT.md section identifiers used in the
|
|
70
|
+
* prompt block. The LLM picks one or more fields that the tension
|
|
71
|
+
* relates to.
|
|
72
|
+
*/
|
|
73
|
+
export declare const IntentRelatedFieldSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"why">, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>;
|
|
74
|
+
/** Related INTENT field: why | desired_outcome | non_negotiables | stop_escalation | current_strategic_focus */
|
|
75
|
+
export type IntentRelatedField = Static<typeof IntentRelatedFieldSchema>;
|
|
76
|
+
/**
|
|
77
|
+
* Suggested Owner action enum (SPEC §21).
|
|
78
|
+
*
|
|
79
|
+
* PD surfaces tension; the Owner decides value. This field is a
|
|
80
|
+
* SUGGESTION — never auto-applied. The Owner must record a
|
|
81
|
+
* IntentDecisionRecord (PRI-470) before any follow-up action executes.
|
|
82
|
+
*/
|
|
83
|
+
export declare const SuggestedOwnerActionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>;
|
|
84
|
+
/** Suggested Owner action: confirm_drift | revise_intent | observe | dismiss | promote_to_principle | promote_to_rulehost */
|
|
85
|
+
export type SuggestedOwnerAction = Static<typeof SuggestedOwnerActionSchema>;
|
|
86
|
+
/**
|
|
87
|
+
* IntentTension schema (SPEC §16.2).
|
|
88
|
+
*
|
|
89
|
+
* Optional object produced by Stage A when the Agent detects a tension
|
|
90
|
+
* between its action and the Owner-authored INTENT.md.
|
|
91
|
+
*
|
|
92
|
+
* CRITICAL (SPEC §16.3): this object MUST NOT carry a `confidence`
|
|
93
|
+
* field. The Stage A `confidence` (rootCause-level) is the only
|
|
94
|
+
* diagnostician confidence. To enforce this, `additionalProperties: false`
|
|
95
|
+
* is set so any extra property (including `confidence`) is rejected by
|
|
96
|
+
* `Value.Check`.
|
|
97
|
+
*
|
|
98
|
+
* Lineage (SPEC §16.2): `intentDocHash` is optional but, when present,
|
|
99
|
+
* MUST match the hash of the INTENT.md that was injected into the
|
|
100
|
+
* prompt. The Stage A runner enforces this invariant (PRI-468).
|
|
101
|
+
*/
|
|
102
|
+
export declare const IntentTensionSchema: import("@sinclair/typebox").TObject<{
|
|
103
|
+
source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>;
|
|
104
|
+
evidenceStrength: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>;
|
|
105
|
+
relatedIntentFields: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"why">, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>>;
|
|
106
|
+
evidence: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
107
|
+
explanation: import("@sinclair/typebox").TString;
|
|
108
|
+
suggestedOwnerAction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>;
|
|
109
|
+
intentDocHash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* IntentTension — optional Stage A output describing a tension between
|
|
113
|
+
* the Agent's action and the Owner-authored INTENT.md.
|
|
114
|
+
*
|
|
115
|
+
* `confidence` is forbidden on this object (SPEC §16.3).
|
|
116
|
+
*/
|
|
117
|
+
export type IntentTension = Static<typeof IntentTensionSchema>;
|
|
46
118
|
/**
|
|
47
119
|
* TypeBox schema for the Root Cause stage (Stage A) output.
|
|
48
120
|
*
|
|
@@ -70,6 +142,24 @@ export declare const DiagRootCauseOutputV1Schema: import("@sinclair/typebox").TO
|
|
|
70
142
|
}>>;
|
|
71
143
|
confidence: import("@sinclair/typebox").TNumber;
|
|
72
144
|
ambiguityNotes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
145
|
+
/**
|
|
146
|
+
* Optional intent tension (PRI-468, SPEC §16). Present only when:
|
|
147
|
+
* 1. The `intent_engineering` flag is on, AND
|
|
148
|
+
* 2. The Stage A prompt was built with the INTENT context injected, AND
|
|
149
|
+
* 3. The LLM chose to emit a tension.
|
|
150
|
+
*
|
|
151
|
+
* When absent (flag off or LLM omitted), Stage C passthrough must NOT
|
|
152
|
+
* synthesize one (SPEC §18 — additive only, never generates).
|
|
153
|
+
*/
|
|
154
|
+
intentTension: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
155
|
+
source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>;
|
|
156
|
+
evidenceStrength: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>;
|
|
157
|
+
relatedIntentFields: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"why">, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>>;
|
|
158
|
+
evidence: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
159
|
+
explanation: import("@sinclair/typebox").TString;
|
|
160
|
+
suggestedOwnerAction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>;
|
|
161
|
+
intentDocHash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
162
|
+
}>>;
|
|
73
163
|
}>;
|
|
74
164
|
/** Typed output of the Root Cause stage (Stage A). */
|
|
75
165
|
export type DiagRootCauseOutputV1 = Static<typeof DiagRootCauseOutputV1Schema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diag-rootcause-output.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/diag-rootcause-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,2OAKlC,CAAC;AAEH,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;EAIjC,CAAC;AAEH,iDAAiD;AACjD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;EAGtC,CAAC;AAEH,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAI/E;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"diag-rootcause-output.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/diag-rootcause-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,2OAKlC,CAAC;AAEH,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,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AC,OAAO,2BAA2B,CAAC,CAAC;AAM/E;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACvI;AAED;;;;;;;;;;GAUG;AACH,qBAAa,6BAA8B,YAAW,sBAAsB;IAEpE,QAAQ,CACZ,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CA6H9F"}
|
|
@@ -44,6 +44,86 @@ export const DiagRootCauseEvidenceSchema = Type.Object({
|
|
|
44
44
|
sourceRef: Type.String({ minLength: 1 }),
|
|
45
45
|
note: Type.String({ minLength: 1 }),
|
|
46
46
|
});
|
|
47
|
+
// ── Intent Tension sub-schemas (PRI-468, SPEC §16) ──────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Intent tension source enum (SPEC §16.5).
|
|
50
|
+
*
|
|
51
|
+
* - `none` — no tension detected
|
|
52
|
+
* - `action_drift` — Agent's action appears to drift from INTENT
|
|
53
|
+
* - `intent_suspect` — INTENT itself may be stale, ambiguous, or contradictory
|
|
54
|
+
* - `healthy_tension` — genuine strategic trade-off, no drift
|
|
55
|
+
*/
|
|
56
|
+
export const IntentTensionSourceSchema = Type.Union([
|
|
57
|
+
Type.Literal('none'),
|
|
58
|
+
Type.Literal('action_drift'),
|
|
59
|
+
Type.Literal('intent_suspect'),
|
|
60
|
+
Type.Literal('healthy_tension'),
|
|
61
|
+
]);
|
|
62
|
+
/**
|
|
63
|
+
* Evidence strength enum (SPEC §16.6).
|
|
64
|
+
*
|
|
65
|
+
* Coarse three-level scale; intentionally NOT a numeric confidence
|
|
66
|
+
* (SPEC §16.3 forbids `intentTension.confidence`).
|
|
67
|
+
*/
|
|
68
|
+
export const EvidenceStrengthSchema = Type.Union([
|
|
69
|
+
Type.Literal('weak'),
|
|
70
|
+
Type.Literal('moderate'),
|
|
71
|
+
Type.Literal('strong'),
|
|
72
|
+
]);
|
|
73
|
+
/**
|
|
74
|
+
* Related INTENT.md field enum (SPEC §16.7).
|
|
75
|
+
*
|
|
76
|
+
* Snake_case keys mirror the INTENT.md section identifiers used in the
|
|
77
|
+
* prompt block. The LLM picks one or more fields that the tension
|
|
78
|
+
* relates to.
|
|
79
|
+
*/
|
|
80
|
+
export const IntentRelatedFieldSchema = Type.Union([
|
|
81
|
+
Type.Literal('why'),
|
|
82
|
+
Type.Literal('desired_outcome'),
|
|
83
|
+
Type.Literal('non_negotiables'),
|
|
84
|
+
Type.Literal('stop_escalation'),
|
|
85
|
+
Type.Literal('current_strategic_focus'),
|
|
86
|
+
]);
|
|
87
|
+
/**
|
|
88
|
+
* Suggested Owner action enum (SPEC §21).
|
|
89
|
+
*
|
|
90
|
+
* PD surfaces tension; the Owner decides value. This field is a
|
|
91
|
+
* SUGGESTION — never auto-applied. The Owner must record a
|
|
92
|
+
* IntentDecisionRecord (PRI-470) before any follow-up action executes.
|
|
93
|
+
*/
|
|
94
|
+
export const SuggestedOwnerActionSchema = Type.Union([
|
|
95
|
+
Type.Literal('confirm_drift'),
|
|
96
|
+
Type.Literal('revise_intent'),
|
|
97
|
+
Type.Literal('observe'),
|
|
98
|
+
Type.Literal('dismiss'),
|
|
99
|
+
Type.Literal('promote_to_principle'),
|
|
100
|
+
Type.Literal('promote_to_rulehost'),
|
|
101
|
+
]);
|
|
102
|
+
/**
|
|
103
|
+
* IntentTension schema (SPEC §16.2).
|
|
104
|
+
*
|
|
105
|
+
* Optional object produced by Stage A when the Agent detects a tension
|
|
106
|
+
* between its action and the Owner-authored INTENT.md.
|
|
107
|
+
*
|
|
108
|
+
* CRITICAL (SPEC §16.3): this object MUST NOT carry a `confidence`
|
|
109
|
+
* field. The Stage A `confidence` (rootCause-level) is the only
|
|
110
|
+
* diagnostician confidence. To enforce this, `additionalProperties: false`
|
|
111
|
+
* is set so any extra property (including `confidence`) is rejected by
|
|
112
|
+
* `Value.Check`.
|
|
113
|
+
*
|
|
114
|
+
* Lineage (SPEC §16.2): `intentDocHash` is optional but, when present,
|
|
115
|
+
* MUST match the hash of the INTENT.md that was injected into the
|
|
116
|
+
* prompt. The Stage A runner enforces this invariant (PRI-468).
|
|
117
|
+
*/
|
|
118
|
+
export const IntentTensionSchema = Type.Object({
|
|
119
|
+
source: IntentTensionSourceSchema,
|
|
120
|
+
evidenceStrength: EvidenceStrengthSchema,
|
|
121
|
+
relatedIntentFields: Type.Array(IntentRelatedFieldSchema),
|
|
122
|
+
evidence: Type.Array(Type.String(), { maxItems: 3 }),
|
|
123
|
+
explanation: Type.String({ minLength: 1 }),
|
|
124
|
+
suggestedOwnerAction: SuggestedOwnerActionSchema,
|
|
125
|
+
intentDocHash: Type.Optional(Type.String()),
|
|
126
|
+
}, { additionalProperties: false });
|
|
47
127
|
// ── Main output schema ───────────────────────────────────────────────────────
|
|
48
128
|
/**
|
|
49
129
|
* TypeBox schema for the Root Cause stage (Stage A) output.
|
|
@@ -68,6 +148,16 @@ export const DiagRootCauseOutputV1Schema = Type.Object({
|
|
|
68
148
|
evidence: Type.Array(DiagRootCauseEvidenceSchema),
|
|
69
149
|
confidence: Type.Number({ minimum: 0, maximum: 1 }),
|
|
70
150
|
ambiguityNotes: Type.Optional(Type.Array(Type.String())),
|
|
151
|
+
/**
|
|
152
|
+
* Optional intent tension (PRI-468, SPEC §16). Present only when:
|
|
153
|
+
* 1. The `intent_engineering` flag is on, AND
|
|
154
|
+
* 2. The Stage A prompt was built with the INTENT context injected, AND
|
|
155
|
+
* 3. The LLM chose to emit a tension.
|
|
156
|
+
*
|
|
157
|
+
* When absent (flag off or LLM omitted), Stage C passthrough must NOT
|
|
158
|
+
* synthesize one (SPEC §18 — additive only, never generates).
|
|
159
|
+
*/
|
|
160
|
+
intentTension: Type.Optional(IntentTensionSchema),
|
|
71
161
|
});
|
|
72
162
|
// ── Validator ────────────────────────────────────────────────────────────────
|
|
73
163
|
const VALID_ROOT_CAUSE_CATEGORIES = new Set(['People', 'Design', 'Assumption', 'Tooling']);
|
|
@@ -167,6 +257,24 @@ export class DefaultDiagRootCauseValidator {
|
|
|
167
257
|
}
|
|
168
258
|
}
|
|
169
259
|
}
|
|
260
|
+
// ── Step 6b: intentTension element-level checks (PRI-468, SPEC §16) ─────
|
|
261
|
+
// Provide clearer error messages than the TypeBox fallback for the most
|
|
262
|
+
// critical SPEC §16.3 violation (forbidden `confidence` field) and for
|
|
263
|
+
// non-object intentTension. The TypeBox schema (with additionalProperties:
|
|
264
|
+
// false) catches these as well, but the explicit check produces a
|
|
265
|
+
// human-readable message that references the SPEC clause.
|
|
266
|
+
if (Object.hasOwn(record, 'intentTension')) {
|
|
267
|
+
const tension = record.intentTension;
|
|
268
|
+
if (tension === null || typeof tension !== 'object') {
|
|
269
|
+
errors.push('intentTension must be an object when present');
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
const tensionRecord = tension;
|
|
273
|
+
if (Object.hasOwn(tensionRecord, 'confidence')) {
|
|
274
|
+
errors.push('intentTension.confidence is forbidden (SPEC §16.3); use rootCause-level confidence instead');
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
170
278
|
// ── Step 7: TypeBox schema validation as fallback ───────────────────────
|
|
171
279
|
if (!Value.Check(DiagRootCauseOutputV1Schema, output)) {
|
|
172
280
|
const schemaErrors = [...Value.Errors(DiagRootCauseOutputV1Schema, output)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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AAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACpE,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC;QAC7E,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -39,6 +39,14 @@ export interface RootCausePromptBuilderOptions {
|
|
|
39
39
|
outputLanguage?: OutputLanguage;
|
|
40
40
|
/** T-E (PRI-371): Inject core axiom grounding as PHASE 3.5 (default: false) */
|
|
41
41
|
coreGrounding?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* PRI-468: Inject intent tension check as PHASE 3.6 (default: false).
|
|
44
|
+
*
|
|
45
|
+
* When true, inserts the SPEC §17 text instructing the LLM to optionally
|
|
46
|
+
* produce an `intentTension` field. When false/undefined, the prompt is
|
|
47
|
+
* byte-identical to the pre-PRI-468 prompt (EP-03: no silent fallback).
|
|
48
|
+
*/
|
|
49
|
+
intentGrounding?: boolean;
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* Build the Stage A diagnostic protocol instruction (PHASE 1–3 + optional PHASE 3.5).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootcause-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/rootcause-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"rootcause-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/rootcause-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AA6D5C;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C,kEAAkE;IAClE,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,iCAAiC,CAC/C,IAAI,GAAE,6BAAkC,GACvC,MAAM,CA0ER;AAID;;;;;;;;;;GAUG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;gBAErB,IAAI,GAAE,6BAAkC;IAKpD;;;;;;;;OAQG;IACH,yBAAyB,CAAC,IAAI,GAAE,6BAAkC,GAAG,MAAM;IAU3E;;;;;;;;;;;OAWG;IACH,WAAW,CACT,OAAO,EAAE,2BAA2B,EACpC,IAAI,GAAE,kBAAuB,GAC5B,iBAAiB;CA6ErB"}
|
|
@@ -23,6 +23,57 @@ import { DiagRootCauseOutputV1Schema } from './diag-rootcause-output.js';
|
|
|
23
23
|
import { buildLanguageDirective } from '../language-directive.js';
|
|
24
24
|
import { buildCoreAxiomBlock } from '../core-principles/core-axiom-block.js';
|
|
25
25
|
import { DEFAULT_PROMPT_BUILDER_LIMITS, summarizeConversationWindow, } from '../diagnostician-prompt-builder.js';
|
|
26
|
+
// ── Options ──────────────────────────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Build the PHASE 3.6 — Intent Tension Check block (PRI-468, SPEC §17).
|
|
29
|
+
*
|
|
30
|
+
* When `intentGrounding` is true, returns the SPEC §17 verbatim text that
|
|
31
|
+
* instructs the LLM to optionally produce an `intentTension` field.
|
|
32
|
+
*
|
|
33
|
+
* When false/undefined, returns `''` (empty string) so that
|
|
34
|
+
* `${phase35Block}${phase36Block}CRITICAL:` is byte-identical to
|
|
35
|
+
* `${phase35Block}CRITICAL:` — preserving the pre-PRI-468 prompt output
|
|
36
|
+
* (EP-03: no silent fallback).
|
|
37
|
+
*
|
|
38
|
+
* This is a pure function — no I/O, no side effects, never throws.
|
|
39
|
+
*/
|
|
40
|
+
function buildIntentTensionBlock(intentGrounding) {
|
|
41
|
+
if (!intentGrounding) {
|
|
42
|
+
return '';
|
|
43
|
+
}
|
|
44
|
+
// SPEC §17 — verbatim text. The LLM is told:
|
|
45
|
+
// - INTENT.md is optional reference, not a hard rule system
|
|
46
|
+
// - source='none' / evidenceStrength='weak' when evidence is insufficient
|
|
47
|
+
// - intent_suspect only for contradiction, vagueness, outdatedness, or
|
|
48
|
+
// repeated challenge — not for strategic preference
|
|
49
|
+
// - intentTension is an optional additive field
|
|
50
|
+
// - PD surfaces tension; Owner decides value
|
|
51
|
+
return `
|
|
52
|
+
PHASE 3.6 — Intent Tension Check:
|
|
53
|
+
You may be given an optional Owner-owned INTENT.md.
|
|
54
|
+
|
|
55
|
+
Use it only as a stable reference for judging whether the pain indicates tension between:
|
|
56
|
+
- the Owner's stated long-term intent
|
|
57
|
+
- the current focus
|
|
58
|
+
- the Agent's actions
|
|
59
|
+
- the Owner's correction
|
|
60
|
+
|
|
61
|
+
Do not assume every failure is intent drift.
|
|
62
|
+
|
|
63
|
+
Do not treat INTENT.md as a hard rule system.
|
|
64
|
+
Hard runtime boundaries belong to RuleHost.
|
|
65
|
+
|
|
66
|
+
If evidence is insufficient, use source='none' or evidenceStrength='weak'.
|
|
67
|
+
|
|
68
|
+
Only mark intent_suspect when INTENT.md is contradictory, vague, outdated, or repeatedly challenged by confirmed Pain evidence.
|
|
69
|
+
Do not mark intent_suspect merely because you prefer another strategy.
|
|
70
|
+
|
|
71
|
+
Return intentTension as an optional additive field.
|
|
72
|
+
|
|
73
|
+
PD surfaces tension.
|
|
74
|
+
Owner decides value.
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
26
77
|
// ── Instruction builder ──────────────────────────────────────────────────────
|
|
27
78
|
/**
|
|
28
79
|
* Build the Stage A diagnostic protocol instruction (PHASE 1–3 + optional PHASE 3.5).
|
|
@@ -40,7 +91,7 @@ import { DEFAULT_PROMPT_BUILDER_LIMITS, summarizeConversationWindow, } from '../
|
|
|
40
91
|
export function buildRootCauseProtocolInstruction(opts = {}) {
|
|
41
92
|
const adapter = opts.adapter ?? new DefaultSchemaPromptAdapter();
|
|
42
93
|
const schema = opts.schema ?? DiagRootCauseOutputV1Schema;
|
|
43
|
-
const { outputLanguage, coreGrounding } = opts;
|
|
94
|
+
const { outputLanguage, coreGrounding, intentGrounding } = opts;
|
|
44
95
|
const example = adapter.generateExample(schema);
|
|
45
96
|
const constraints = adapter.generateConstraints(schema);
|
|
46
97
|
const languageDirective = buildLanguageDirective(outputLanguage);
|
|
@@ -55,6 +106,12 @@ export function buildRootCauseProtocolInstruction(opts = {}) {
|
|
|
55
106
|
outputLanguage,
|
|
56
107
|
fallback: '\n',
|
|
57
108
|
});
|
|
109
|
+
// PRI-468: When intentGrounding is true, insert PHASE 3.6.
|
|
110
|
+
// When false or undefined, output is byte-identical to the pre-PRI-468
|
|
111
|
+
// prompt (EP-03: no silent fallback). The fallback is '' (empty string)
|
|
112
|
+
// so that `${phase35Block}${phase36Block}CRITICAL:` produces the same
|
|
113
|
+
// string as `${phase35Block}CRITICAL:` when intentGrounding is off.
|
|
114
|
+
const phase36Block = buildIntentTensionBlock(intentGrounding);
|
|
58
115
|
return `You are a root cause analysis expert. Follow this protocol:
|
|
59
116
|
|
|
60
117
|
PHASE 1 — Evidence Review:
|
|
@@ -82,7 +139,7 @@ Classify into ONE: People | Design | Assumption | Tooling
|
|
|
82
139
|
- Design: architecture defects, missing gates, process gaps
|
|
83
140
|
- Assumption: wrong assumptions about env/versions/deps
|
|
84
141
|
- Tooling: tool misconfiguration, API changes
|
|
85
|
-
${phase35Block}CRITICAL: Your ENTIRE response must be ONLY the JSON object below. Do NOT include any text before or after the JSON. Do NOT wrap the JSON in markdown code fences. Do NOT add explanatory prose. Output the raw JSON object and nothing else.
|
|
142
|
+
${phase35Block}${phase36Block}CRITICAL: Your ENTIRE response must be ONLY the JSON object below. Do NOT include any text before or after the JSON. Do NOT wrap the JSON in markdown code fences. Do NOT add explanatory prose. Output the raw JSON object and nothing else.
|
|
86
143
|
|
|
87
144
|
COMPLETE EXAMPLE OUTPUT (follow this exact structure):
|
|
88
145
|
${example}
|
|
@@ -135,6 +192,7 @@ export class RootCausePromptBuilder {
|
|
|
135
192
|
schema: opts.schema ?? this.schema,
|
|
136
193
|
outputLanguage: opts.outputLanguage,
|
|
137
194
|
coreGrounding: opts.coreGrounding,
|
|
195
|
+
intentGrounding: opts.intentGrounding,
|
|
138
196
|
});
|
|
139
197
|
}
|
|
140
198
|
/**
|
|
@@ -151,7 +209,7 @@ export class RootCausePromptBuilder {
|
|
|
151
209
|
*/
|
|
152
210
|
buildPrompt(payload, opts = {}) {
|
|
153
211
|
const limits = opts.limits ?? DEFAULT_PROMPT_BUILDER_LIMITS;
|
|
154
|
-
const { outputLanguage, coreGrounding } = opts;
|
|
212
|
+
const { outputLanguage, coreGrounding, intentGrounding, intentDoc } = opts;
|
|
155
213
|
const truncationWarnings = [];
|
|
156
214
|
// DPB-04: Apply truncation to conversationWindow to prevent token overflow
|
|
157
215
|
const rawWindow = summarizeConversationWindow(payload.conversationWindow);
|
|
@@ -177,8 +235,12 @@ export class RootCausePromptBuilder {
|
|
|
177
235
|
const diagnosticInstruction = this.buildRootCauseInstruction({
|
|
178
236
|
outputLanguage,
|
|
179
237
|
coreGrounding,
|
|
238
|
+
intentGrounding,
|
|
180
239
|
});
|
|
181
240
|
// DPB-04: Explicit top-level fields at the prompt level
|
|
241
|
+
// PRI-468: Only include `intentDoc` when intentGrounding is on AND a doc
|
|
242
|
+
// was successfully read. When absent, the prompt is byte-identical to
|
|
243
|
+
// the pre-PRI-468 prompt (EP-03: no silent fallback).
|
|
182
244
|
const promptInput = {
|
|
183
245
|
taskId: payload.taskId,
|
|
184
246
|
contextHash: payload.contextHash,
|
|
@@ -188,6 +250,7 @@ export class RootCausePromptBuilder {
|
|
|
188
250
|
context: compactContext,
|
|
189
251
|
diagnosticInstruction,
|
|
190
252
|
...(truncationWarnings.length > 0 ? { truncationWarnings } : {}),
|
|
253
|
+
...(intentGrounding && intentDoc ? { intentDoc } : {}),
|
|
191
254
|
};
|
|
192
255
|
// DPB-02: Output is ONLY JSON — no markdown, no file ops, no tool calls
|
|
193
256
|
let message = JSON.stringify(promptInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootcause-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/rootcause-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAK7E,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"rootcause-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/diagnostician/rootcause-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAK7E,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAG5C,gFAAgF;AAEhF;;;;;;;;;;;;GAYG;AACH,SAAS,uBAAuB,CAAC,eAAyB;IACxD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,6CAA6C;IAC7C,4DAA4D;IAC5D,0EAA0E;IAC1E,uEAAuE;IACvE,sDAAsD;IACtD,gDAAgD;IAChD,6CAA6C;IAC7C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC;AA4BD,gFAAgF;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAAsC,EAAE;IAExC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,0BAA0B,EAAE,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,2BAA2B,CAAC;IAC1D,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,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,OAAO,CAAC,MAAM,MAAM,MAAM,CAAC,eAAe,GAAG;aAC9F,CAAC;YACF,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -53,6 +53,29 @@ export declare const DiagnosticianOutputV1Schema: import("@sinclair/typebox").TO
|
|
|
53
53
|
}>>;
|
|
54
54
|
confidence: import("@sinclair/typebox").TNumber;
|
|
55
55
|
ambiguityNotes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
56
|
+
/**
|
|
57
|
+
* PRI-468: Optional intent tension passed through from Stage A.
|
|
58
|
+
*
|
|
59
|
+
* Present only when:
|
|
60
|
+
* 1. The `intent_engineering` flag is on, AND
|
|
61
|
+
* 2. Stage A emitted an intentTension, AND
|
|
62
|
+
* 3. Stage C additive passthrough copied it here.
|
|
63
|
+
*
|
|
64
|
+
* Stage C MUST NOT generate intentTension when Stage A omitted it
|
|
65
|
+
* (SPEC §18.2 — additive only, never generates).
|
|
66
|
+
*
|
|
67
|
+
* This field is additive — existing consumers that don't know about
|
|
68
|
+
* intentTension will ignore it (SPEC §18.3 — don't break downstream).
|
|
69
|
+
*/
|
|
70
|
+
intentTension: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
71
|
+
source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"action_drift">, import("@sinclair/typebox").TLiteral<"intent_suspect">, import("@sinclair/typebox").TLiteral<"healthy_tension">]>;
|
|
72
|
+
evidenceStrength: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"weak">, import("@sinclair/typebox").TLiteral<"moderate">, import("@sinclair/typebox").TLiteral<"strong">]>;
|
|
73
|
+
relatedIntentFields: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"why">, import("@sinclair/typebox").TLiteral<"desired_outcome">, import("@sinclair/typebox").TLiteral<"non_negotiables">, import("@sinclair/typebox").TLiteral<"stop_escalation">, import("@sinclair/typebox").TLiteral<"current_strategic_focus">]>>;
|
|
74
|
+
evidence: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
75
|
+
explanation: import("@sinclair/typebox").TString;
|
|
76
|
+
suggestedOwnerAction: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"confirm_drift">, import("@sinclair/typebox").TLiteral<"revise_intent">, import("@sinclair/typebox").TLiteral<"observe">, import("@sinclair/typebox").TLiteral<"dismiss">, import("@sinclair/typebox").TLiteral<"promote_to_principle">, import("@sinclair/typebox").TLiteral<"promote_to_rulehost">]>;
|
|
77
|
+
intentDocHash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
78
|
+
}>>;
|
|
56
79
|
}>;
|
|
57
80
|
export type DiagnosticianOutputV1 = Static<typeof DiagnosticianOutputV1Schema>;
|
|
58
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostician-output.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnostician-output.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAKxE,eAAO,MAAM,oCAAoC;;;;EAI/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAEjG,eAAO,MAAM,2BAA2B;;;EAGtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE/E,eAAO,MAAM,wBAAwB,8RAMnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEzE,eAAO,MAAM,iCAAiC;;;;;;EAM5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE3F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;IAUtC;;;;;;;;;;;;;OAaG;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAI/E;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;;;EAM7C,CAAC;AAEH,gHAAgH;AAChH,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,OAAO,EAAE,2BAA2B,CAAC;IACrC,8CAA8C;IAC9C,eAAe,EAAE,yBAAyB,CAAC;IAC3C,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* All runtime adapters producing diagnostician output must conform to this schema.
|
|
9
9
|
*/
|
|
10
10
|
import { Type } from '@sinclair/typebox';
|
|
11
|
+
import { IntentTensionSchema } from './diagnostician/diag-rootcause-output.js';
|
|
11
12
|
// ── Diagnostician Output V1 ──
|
|
12
13
|
export const DiagnosticianViolatedPrincipleSchema = Type.Object({
|
|
13
14
|
principleId: Type.Optional(Type.String({ minLength: 1 })),
|
|
@@ -42,6 +43,21 @@ export const DiagnosticianOutputV1Schema = Type.Object({
|
|
|
42
43
|
recommendations: Type.Array(DiagnosticianRecommendationSchema),
|
|
43
44
|
confidence: Type.Number({ minimum: 0, maximum: 1, description: 'A number between 0.0 and 1.0 (NOT a string, NOT a percentage)' }),
|
|
44
45
|
ambiguityNotes: Type.Optional(Type.Array(Type.String())),
|
|
46
|
+
/**
|
|
47
|
+
* PRI-468: Optional intent tension passed through from Stage A.
|
|
48
|
+
*
|
|
49
|
+
* Present only when:
|
|
50
|
+
* 1. The `intent_engineering` flag is on, AND
|
|
51
|
+
* 2. Stage A emitted an intentTension, AND
|
|
52
|
+
* 3. Stage C additive passthrough copied it here.
|
|
53
|
+
*
|
|
54
|
+
* Stage C MUST NOT generate intentTension when Stage A omitted it
|
|
55
|
+
* (SPEC §18.2 — additive only, never generates).
|
|
56
|
+
*
|
|
57
|
+
* This field is additive — existing consumers that don't know about
|
|
58
|
+
* intentTension will ignore it (SPEC §18.3 — don't break downstream).
|
|
59
|
+
*/
|
|
60
|
+
intentTension: Type.Optional(IntentTensionSchema),
|
|
45
61
|
});
|
|
46
62
|
// ── Diagnostician Invocation Input ──
|
|
47
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostician-output.js","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnostician-output.js","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,gCAAgC;AAEhC,MAAM,CAAC,MAAM,oCAAoC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9D,WAAW,EAAE,IAAI,CAAC,QAA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OAAO,EAAE,EAAE,qDAAqD;IAC9E,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC;IACxD,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CACvC,CAAC,CAAC"}
|
|
@@ -21,6 +21,22 @@ export interface BuildPromptOptions {
|
|
|
21
21
|
outputLanguage?: OutputLanguage;
|
|
22
22
|
/** T-E (PRI-371): Inject core axiom grounding as PHASE 3.5 (default: false) */
|
|
23
23
|
coreGrounding?: boolean;
|
|
24
|
+
/** PRI-468: Inject intent tension check as PHASE 3.6 (default: false) */
|
|
25
|
+
intentGrounding?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* PRI-468: INTENT.md reference to include in the prompt payload.
|
|
28
|
+
*
|
|
29
|
+
* When provided (along with `intentGrounding: true`), the `raw` content
|
|
30
|
+
* is included in the prompt as `intentDoc.raw` so the LLM can reference
|
|
31
|
+
* it. The `contentHash` is the lineage link for `intentTension.intentDocHash`.
|
|
32
|
+
*
|
|
33
|
+
* When absent, the prompt is byte-identical to the pre-PRI-468 prompt.
|
|
34
|
+
*/
|
|
35
|
+
intentDoc?: {
|
|
36
|
+
readonly raw: string;
|
|
37
|
+
readonly contentHash: string;
|
|
38
|
+
readonly path: string;
|
|
39
|
+
};
|
|
24
40
|
}
|
|
25
41
|
/**
|
|
26
42
|
* PromptInput — the JSON message sent to openclaw agent via --message flag.
|
|
@@ -57,6 +73,22 @@ export interface PromptInput {
|
|
|
57
73
|
diagnosticInstruction: string;
|
|
58
74
|
/** Warnings added during truncation (e.g., conversationWindow entries removed) */
|
|
59
75
|
truncationWarnings?: string[];
|
|
76
|
+
/**
|
|
77
|
+
* PRI-468: Optional INTENT.md reference for Stage A intent tension check.
|
|
78
|
+
*
|
|
79
|
+
* Present only when `intent_engineering` flag is on AND INTENT.md was
|
|
80
|
+
* successfully read. The `raw` content is included verbatim (unescaped)
|
|
81
|
+
* so the LLM can use it as a stable reference for judging intent tension.
|
|
82
|
+
* The `contentHash` is the lineage link for `intentTension.intentDocHash`.
|
|
83
|
+
*
|
|
84
|
+
* When absent (flag off or read failed), the prompt is byte-identical to
|
|
85
|
+
* the pre-PRI-468 prompt (EP-03: no silent fallback).
|
|
86
|
+
*/
|
|
87
|
+
intentDoc?: {
|
|
88
|
+
readonly raw: string;
|
|
89
|
+
readonly contentHash: string;
|
|
90
|
+
readonly path: string;
|
|
91
|
+
};
|
|
60
92
|
}
|
|
61
93
|
/** Size limits for buildPrompt() to prevent token overflow. */
|
|
62
94
|
export interface PromptBuilderLimits {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostician-prompt-builder.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,gDAAgD;IAChD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnostician-prompt-builder.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,MAAM,CAAC,EAAE,mBAAm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GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAAE,GAC3B,iBAAiB,EAAE,CAErB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostician-prompt-builder.js","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-prompt-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnostician-prompt-builder.js","sourceRoot":"","sources":["../../src/runtime-v2/diagnostician-prompt-builder.ts"],"names":[],"mappings":"AA6GA,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,sBAAsB,EAAE,EAAE;IAC1B,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,MAAM;CACf,CAAC;AAeX;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAA4B;IAE5B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -90,6 +90,8 @@ export { DiagRootCauseRunner } from './internalization/diag-rootcause-runner.js'
|
|
|
90
90
|
export { DiagDistillerRunner } from './internalization/diag-distiller-runner.js';
|
|
91
91
|
export { DiagRouterRunner } from './internalization/diag-router-runner.js';
|
|
92
92
|
export { DefaultDiagRootCauseValidator } from './diagnostician/diag-rootcause-output.js';
|
|
93
|
+
export { IntentTensionSchema, IntentTensionSourceSchema, EvidenceStrengthSchema, IntentRelatedFieldSchema, SuggestedOwnerActionSchema, } from './diagnostician/diag-rootcause-output.js';
|
|
94
|
+
export type { IntentTension, IntentTensionSource, EvidenceStrength, IntentRelatedField, SuggestedOwnerAction, } from './diagnostician/diag-rootcause-output.js';
|
|
93
95
|
export { DefaultDiagDistillerValidator } from './diagnostician/diag-distiller-output.js';
|
|
94
96
|
export { DisabledDiagnosticianRunner } from './pain-signal-runtime-factory.js';
|
|
95
97
|
export { TestDoubleRuntimeAdapter } from './adapter/index.js';
|
|
@@ -324,6 +326,6 @@ export type { PainDiagnosticSource, PainDiagnosticGateReason, PainDiagnosticGate
|
|
|
324
326
|
export { DEFAULT_COOLDOWN_MS, DEFAULT_PAIN_TRIGGER, DEFAULT_HIGH_SEVERITY, DEFAULT_REPEATED_FAILURE, DEFAULT_SEMANTIC_PAIN_FLOOR, normalizedSource, buildEpisodeKey, evaluatePainDiagnosticGateDecision, isCooldownActive, } from './pain-gate/index.js';
|
|
325
327
|
export type { DetectionResult, PainMatchResult, PainMatcher, TextHasher, ProtocolTokenGate, DetectionFunnelConfig, } from './detection/index.js';
|
|
326
328
|
export { SimpleLRU, DetectionFunnelCore } from './detection/index.js';
|
|
327
|
-
export { INTENT_MAX_BYTES, INTENT_DOC_TEMPLATE, INTENT_INJECT_MAX_CHARS, INTENT_TRUNCATION_MARKER, parseIntentDocSections, computeIntentContentHash, validateIntentDocSections, buildIntentFrictionBlock, } from './intent/index.js';
|
|
328
|
-
export type { IntentDocSections, IntentDocWarning, IntentDocWarningCode, IntentFrictionBlockInput, } from './intent/index.js';
|
|
329
|
+
export { INTENT_MAX_BYTES, INTENT_DOC_TEMPLATE, INTENT_INJECT_MAX_CHARS, INTENT_TRUNCATION_MARKER, parseIntentDocSections, computeIntentContentHash, validateIntentDocSections, buildIntentFrictionBlock, NullIntentDocReader, } from './intent/index.js';
|
|
330
|
+
export type { IntentDocSections, IntentDocWarning, IntentDocWarningCode, IntentFrictionBlockInput, IntentDocReader, IntentDocReadResult, IntentDocReference, IntentDocReadReason, } from './intent/index.js';
|
|
329
331
|
//# sourceMappingURL=index.d.ts.map
|