@principles/core 1.291.3 → 1.291.5
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/internalization/adversarial-feedback.d.ts +3 -1
- package/dist/runtime-v2/internalization/adversarial-feedback.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/adversarial-feedback.js +10 -1
- package/dist/runtime-v2/internalization/adversarial-feedback.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-output.d.ts +11 -0
- package/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-output.js +10 -0
- package/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +3 -3
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js +49 -5
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.js +13 -16
- package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/owner-decision-review.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/owner-decision-review.js +5 -1
- package/dist/runtime-v2/internalization/owner-decision-review.js.map +1 -1
- package/dist/runtime-v2/internalization/owner-review.d.ts +2 -2
- package/dist/runtime-v2/internalization/owner-review.js +2 -2
- package/dist/runtime-v2/internalization/scribe-output.d.ts +12 -0
- package/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/scribe-output.js +20 -0
- package/dist/runtime-v2/internalization/scribe-output.js.map +1 -1
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +32 -1
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js +38 -1
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,14 @@ export const ScribeOutputV1Schema = Type.Object({
|
|
|
33
33
|
// DefaultScribeValidator via isValidIntentContractV1 — TypeBox Optional
|
|
34
34
|
// keeps the wire shape additive for LLM-facing schema consumers).
|
|
35
35
|
intentContract: Type.Optional(Type.Unknown()),
|
|
36
|
+
// r6 review fix (P1-2): optional structured coverage-gap channel. This
|
|
37
|
+
// schema is a LIVE runtime contract (output-schema-registry → pi-ai
|
|
38
|
+
// adapter → response_format json_schema with additionalProperties:false on
|
|
39
|
+
// strict decoding endpoints) — an absent field would make declared gaps
|
|
40
|
+
// IMPOSSIBLE for the model to emit there, silently disabling the whole
|
|
41
|
+
// disposition path. Element-level validation stays with the hand-rolled
|
|
42
|
+
// DefaultScribeValidator (same discipline as intentContract).
|
|
43
|
+
ownerRequirementGaps: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),
|
|
36
44
|
});
|
|
37
45
|
/** Runtime type guard: true if v is a non-null plain object (not an array). */
|
|
38
46
|
function isRecord(v) {
|
|
@@ -107,6 +115,18 @@ export class DefaultScribeValidator {
|
|
|
107
115
|
else if (!output.risks.every((e) => typeof e === 'string')) {
|
|
108
116
|
errors.push('risks must be an array of strings');
|
|
109
117
|
}
|
|
118
|
+
// ownerRequirementGaps — r6 review fix (P1-2): structured governance
|
|
119
|
+
// channel for uncovered Owner-attributed requirements. Optional on the
|
|
120
|
+
// wire; present-but-malformed is a hard rejection (a corrupted gap
|
|
121
|
+
// disclosure is worse than none — the pipeline surfaces it to the Owner).
|
|
122
|
+
if (Object.hasOwn(output, 'ownerRequirementGaps') && output.ownerRequirementGaps !== undefined) {
|
|
123
|
+
if (!Array.isArray(output.ownerRequirementGaps)) {
|
|
124
|
+
errors.push('ownerRequirementGaps must be an array');
|
|
125
|
+
}
|
|
126
|
+
else if (!output.ownerRequirementGaps.every((e) => typeof e === 'string' && (e).trim() !== '')) {
|
|
127
|
+
errors.push('ownerRequirementGaps must be an array of non-empty strings');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
110
130
|
// intentContract — PRI-703 Phase 1: optional, but present-but-malformed
|
|
111
131
|
// is a hard rejection (the contract is the alignment anchor for rule
|
|
112
132
|
// generation / evaluation / repair; a corrupted anchor is worse than none).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-output.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"scribe-output.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AA6C/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACpC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACxC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACxC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACxC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACvC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CACpD,CAAC,CAA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,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,CAAC,gDAAgD;IAChE,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -116,7 +116,38 @@ export declare function buildScribeProtocolInstruction(opts?: CoreAxiomBlockOpti
|
|
|
116
116
|
* prechecks), and a run on v5 emits exactly the v4 shape plus the new
|
|
117
117
|
* version string.
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Derivation fidelity (2026-10-12 r6): bumped v5 → v6. The INTENT CONTRACT
|
|
121
|
+
* section gains the OWNER-SOURCE GROUNDING block. Live-chain evidence
|
|
122
|
+
* (p1-final r4 chain): the Dreamer proposed a "persisted Owner
|
|
123
|
+
* write-confirmation records" mechanism that appears NOWHERE in the Owner's
|
|
124
|
+
* pain text — the diagnosis carried it only as an implementation
|
|
125
|
+
* RECOMMENDATION — and the scribe wrote it into intentContract.targetBehavior /
|
|
126
|
+
* validationExpectation as if Owner-mandated, while silently narrowing the
|
|
127
|
+
* Owner's protected/ access requirement to write-only gating with no
|
|
128
|
+
* disclosure. The evaluator then enforced the contract as the correctness
|
|
129
|
+
* definition and the chain died demanding a check the RuleHost input contract
|
|
130
|
+
* cannot express. v6 obliges the scribe to (a) ground contract requirements
|
|
131
|
+
* in the diagnosis's Owner-attributed statements — never in implementation
|
|
132
|
+
* recommendations, and (b) declare every Owner-attributed requirement NOT
|
|
133
|
+
* carried into the contract. Additive: the OUTPUT FORMAT, the validator, and
|
|
134
|
+
* `ScribeOutputV1` are unchanged; a run on v6 emits exactly the v5 wire shape
|
|
135
|
+
* plus the new version string.
|
|
136
|
+
*/
|
|
137
|
+
/**
|
|
138
|
+
* r6 review fixes (2026-10-12, Owner review of #2000): bumped v6 → v7.
|
|
139
|
+
* (P1-2) The v6 gap disclosure was a free-text risks prefix
|
|
140
|
+
* ("owner_requirement_gap:") with NO downstream consumer — a declared gap had
|
|
141
|
+
* no deterministic path to Owner disposition, and the r6 chain still narrowed
|
|
142
|
+
* the protected/ read requirement with only partial disclosure. Gaps now go
|
|
143
|
+
* into the STRUCTURED "ownerRequirementGaps" output field: validated
|
|
144
|
+
* (present-but-malformed is a hard rejection), carried on the artifact, read
|
|
145
|
+
* by the pipeline result, and consumed by the evaluator as obligations the
|
|
146
|
+
* contract does NOT cover. The derived_mechanism: risks prefix is unchanged
|
|
147
|
+
* (informational mechanism disclosure). Wire shape is additive; a run on v7
|
|
148
|
+
* emits exactly the v6 shape plus the new optional field and version string.
|
|
149
|
+
*/
|
|
150
|
+
export declare const SCRIBE_PROMPT_CONTRACT_VERSION = "scribe-output-v1.prompt.v7";
|
|
120
151
|
export declare class ScribePromptBuilder {
|
|
121
152
|
private readonly coreGrounding;
|
|
122
153
|
private readonly outputLanguage?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B,EAAE,MAAM,CAAC;IACpC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qEAAqE;IACrE,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B,EAAE,MAAM,CAAC;IACpC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC,yBAAyB,CAAC;AAE1E,eAAO,MAAM,2BAA2B,w1DAgBoC,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,GAAE,qBAAqB,GAAG;IAAE,cAAc,CAAC,EAAE,cAAc,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,GAClG,MAAM,
|
|
1
|
+
{"version":3,"file":"scribe-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,M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;;;;;;;;;;;;;;;;GAiBG;AACH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,8BAA8B,+BAA+B,CAAC;AAE3E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAiB;IAEjD,YAAY,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAO,EAGlF;IAED;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,wBAAwB,GAAG,uBAAuB,CA2BpE;CACF"}
|
|
@@ -85,6 +85,7 @@ ${coreAxiomsBlock}OUTPUT FORMAT (pure JSON, no markdown):
|
|
|
85
85
|
"philosopherArtifactId": "<copy exactly from input.sourcePhilosopherArtifactId>"
|
|
86
86
|
},
|
|
87
87
|
"risks": ["<risk 1>", "<risk 2>"],
|
|
88
|
+
"ownerRequirementGaps": ["<Owner-attributed requirement NOT carried into the contract, with the reason — omit the field entirely when none>"],
|
|
88
89
|
"generatedAt": "<ISO-8601 timestamp>"
|
|
89
90
|
}
|
|
90
91
|
|
|
@@ -96,6 +97,11 @@ INTENT CONTRACT (required — the alignment anchor for every downstream stage):
|
|
|
96
97
|
- evidenceSource: name the actual pain/diagnosis facts this distills from.
|
|
97
98
|
- validationExpectation: what evidence an evaluator should demand before accepting a rule as faithful. A later repair round checks required changes against this field: a change that contradicts it is flagged, not blindly implemented.
|
|
98
99
|
|
|
100
|
+
OWNER-SOURCE GROUNDING (applies when formation evidence is present):
|
|
101
|
+
- The requirements source is the diagnosis's Owner-attributed statements: rootCause, summary, violatedPrinciples, and evidence notes that state what the OWNER requires (e.g. "Owner 明确……必须先确认"). The diagnosis's implementation recommendations (kind=implementation / rule / principle) are the pipeline's own DESIGN PROPOSALS — candidate answers, never Owner requirements.
|
|
102
|
+
- Every requirement you write into intentContract (ownerIntent / targetBehavior / forbiddenBehavior / validationExpectation) MUST be grounded in those Owner-attributed statements. A mechanism that appears only in recommendations or upstream proposals (e.g. a persisted confirmation-record store, an authorization table, a new input field) MUST NOT be presented as Owner-mandated: either omit it, or carry it as an explicitly derived implementation choice and mark it in risks with the prefix "derived_mechanism:".
|
|
103
|
+
- Coverage check (when formation evidence is present): enumerate the Owner-attributed requirements you can see, then check each one against your contract. If any of them is NOT carried into the contract — narrowed (e.g. a requirement covering reads AND writes carried as write-only), partially carried, or dropped — you MUST declare it in the structured "ownerRequirementGaps" output field (one entry per uncovered requirement: the requirement and why it is not carried). The field is machine-consumed: the pipeline surfaces it to the Owner and the evaluator is obliged to treat those requirements as uncovered — an unresolved gap can only be closed by the Owner, never by silence. Silence about a dropped requirement is a fidelity defect, not a simplification.
|
|
104
|
+
|
|
99
105
|
CONSTRAINTS:
|
|
100
106
|
- Output ONLY valid JSON (no markdown, no explanatory text, no code fences)
|
|
101
107
|
- principleDraft.title MUST be a non-empty string (concise, <=100 chars)
|
|
@@ -151,7 +157,38 @@ ${formationEvidenceBlock}${languageDirective}`;
|
|
|
151
157
|
* prechecks), and a run on v5 emits exactly the v4 shape plus the new
|
|
152
158
|
* version string.
|
|
153
159
|
*/
|
|
154
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Derivation fidelity (2026-10-12 r6): bumped v5 → v6. The INTENT CONTRACT
|
|
162
|
+
* section gains the OWNER-SOURCE GROUNDING block. Live-chain evidence
|
|
163
|
+
* (p1-final r4 chain): the Dreamer proposed a "persisted Owner
|
|
164
|
+
* write-confirmation records" mechanism that appears NOWHERE in the Owner's
|
|
165
|
+
* pain text — the diagnosis carried it only as an implementation
|
|
166
|
+
* RECOMMENDATION — and the scribe wrote it into intentContract.targetBehavior /
|
|
167
|
+
* validationExpectation as if Owner-mandated, while silently narrowing the
|
|
168
|
+
* Owner's protected/ access requirement to write-only gating with no
|
|
169
|
+
* disclosure. The evaluator then enforced the contract as the correctness
|
|
170
|
+
* definition and the chain died demanding a check the RuleHost input contract
|
|
171
|
+
* cannot express. v6 obliges the scribe to (a) ground contract requirements
|
|
172
|
+
* in the diagnosis's Owner-attributed statements — never in implementation
|
|
173
|
+
* recommendations, and (b) declare every Owner-attributed requirement NOT
|
|
174
|
+
* carried into the contract. Additive: the OUTPUT FORMAT, the validator, and
|
|
175
|
+
* `ScribeOutputV1` are unchanged; a run on v6 emits exactly the v5 wire shape
|
|
176
|
+
* plus the new version string.
|
|
177
|
+
*/
|
|
178
|
+
/**
|
|
179
|
+
* r6 review fixes (2026-10-12, Owner review of #2000): bumped v6 → v7.
|
|
180
|
+
* (P1-2) The v6 gap disclosure was a free-text risks prefix
|
|
181
|
+
* ("owner_requirement_gap:") with NO downstream consumer — a declared gap had
|
|
182
|
+
* no deterministic path to Owner disposition, and the r6 chain still narrowed
|
|
183
|
+
* the protected/ read requirement with only partial disclosure. Gaps now go
|
|
184
|
+
* into the STRUCTURED "ownerRequirementGaps" output field: validated
|
|
185
|
+
* (present-but-malformed is a hard rejection), carried on the artifact, read
|
|
186
|
+
* by the pipeline result, and consumed by the evaluator as obligations the
|
|
187
|
+
* contract does NOT cover. The derived_mechanism: risks prefix is unchanged
|
|
188
|
+
* (informational mechanism disclosure). Wire shape is additive; a run on v7
|
|
189
|
+
* emits exactly the v6 shape plus the new optional field and version string.
|
|
190
|
+
*/
|
|
191
|
+
export const SCRIBE_PROMPT_CONTRACT_VERSION = 'scribe-output-v1.prompt.v7';
|
|
155
192
|
export class ScribePromptBuilder {
|
|
156
193
|
coreGrounding;
|
|
157
194
|
outputLanguage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAG7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAkDlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,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BAAuB,EAAE;gBAC5D,CAAC,CAAC,EAAE,CAAC;YACP,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;YAC9C,yEAAyE;YACzE,kEAAkE;YAClE,GAAG,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7F,qBAAqB,EAAE,8BAA8B;SACtD,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAE5C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;IACnE,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/core",
|
|
3
|
-
"version": "1.291.
|
|
3
|
+
"version": "1.291.5",
|
|
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",
|