@principles/core 1.291.2 → 1.291.4
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/artificer-prompt-builder.d.ts +35 -2
- package/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/artificer-prompt-builder.js +38 -2
- package/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/artificer-runner.js +5 -0
- package/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-output.d.ts +18 -0
- package/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-output.js +7 -0
- package/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +36 -2
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js +31 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts +31 -0
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.js +136 -1
- package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/repair-replay-resolver.d.ts +8 -0
- package/dist/runtime-v2/internalization/repair-replay-resolver.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/repair-replay-resolver.js +12 -0
- package/dist/runtime-v2/internalization/repair-replay-resolver.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,13 @@ export interface EvaluatorPromptBuilderInput {
|
|
|
33
33
|
* 不得作为 hard blocker。
|
|
34
34
|
*/
|
|
35
35
|
hostToolCatalog?: HostToolCatalogFacts;
|
|
36
|
+
/**
|
|
37
|
+
* Review round (2026-10-11): runtime kind authority for code review — the
|
|
38
|
+
* host's own tool→kind mapping projected from the runner's existing
|
|
39
|
+
* hostSemanticContext. NOT derivable from hostToolCatalog (its writeTools
|
|
40
|
+
* is a risk grouping that includes exec→execute and sessions_spawn→agent).
|
|
41
|
+
*/
|
|
42
|
+
hostToolKinds?: readonly HostToolKindFact[];
|
|
36
43
|
/**
|
|
37
44
|
* PRI-703 Phase 1 (Owner decision 2026-09-07): the scribe artifact's
|
|
38
45
|
* structured Owner-intent contract (runtime-validated). When present, it is
|
|
@@ -100,6 +107,19 @@ export interface HostToolCatalogFacts {
|
|
|
100
107
|
readonly readOnlyTools: readonly string[];
|
|
101
108
|
readonly writeTools: readonly string[];
|
|
102
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* PD v2 Phase 1 review round (2026-10-11): the runtime kind authority for the
|
|
112
|
+
* judge — the host's OWN tool→kind mapping (same provenance as the Artificer
|
|
113
|
+
* HOST SEMANTIC CONTEXT projection; the runner projects its existing
|
|
114
|
+
* hostSemanticContext). Deliberately NOT derived from HostToolCatalogFacts:
|
|
115
|
+
* the catalog groups tools by risk/legality and its writeTools includes
|
|
116
|
+
* entries that dispatch as 'execute' (exec) or 'agent' (sessions_spawn), so
|
|
117
|
+
* the catalog is not a kind table.
|
|
118
|
+
*/
|
|
119
|
+
export interface HostToolKindFact {
|
|
120
|
+
readonly rawToolName: string;
|
|
121
|
+
readonly canonicalKind: string;
|
|
122
|
+
}
|
|
103
123
|
export interface EvaluatorPromptInput {
|
|
104
124
|
taskId: string;
|
|
105
125
|
contextHash: string;
|
|
@@ -108,6 +128,8 @@ export interface EvaluatorPromptInput {
|
|
|
108
128
|
scribeArtifact?: unknown;
|
|
109
129
|
previousEvaluation?: PreviousEvaluationContext;
|
|
110
130
|
hostToolCatalog?: HostToolCatalogFacts;
|
|
131
|
+
/** Host tool→kind mapping when the runner carries a host semantic context (review round 2026-10-11). */
|
|
132
|
+
hostToolKinds?: readonly HostToolKindFact[];
|
|
111
133
|
/** Present only when the scribe artifact carries a validated intent contract (PRI-703 Phase 1). */
|
|
112
134
|
intentContract?: IntentContractV1;
|
|
113
135
|
/** Present only when the formation evidence resolved (PRI-843). */
|
|
@@ -126,7 +148,7 @@ export interface EvaluatorPromptBuildResult {
|
|
|
126
148
|
*/
|
|
127
149
|
readonly systemPrompt: string;
|
|
128
150
|
}
|
|
129
|
-
export declare const EVALUATOR_PROTOCOL_INSTRUCTION = "You are an Evaluator agent in a principle internalization pipeline. Your role is to critically review the Artificer's implementation plan and produce a structured evaluation with a decision, score, and actionable feedback.\n\nCOMPRESSION FIDELITY COVERAGE CRITERIA (design \u00A76.5.2 \u2014 Stage 1 and Stage 2 use the SAME criteria):\nWhen evaluating whether the dreamer's decision dimensions are covered in the scribe's principle text, apply these rules:\n1. Coverage = a semantically equivalent expression exists. Rewording (using different phrasing to express the same verifiable content) is allowed; the text does NOT need to contain the exact field name or verbatim string. HOWEVER, abstraction is NOT rewording \u2014 rules 1 and 2 MUST be read together.\n2. betterDecision coverage MUST satisfy BOTH existence AND specificity: verifiable, concrete actions must be retained. Replacing concrete, verifiable actions (e.g. \"audit file tree\", \"grep all imports\", \"check export dependency graph\") with unverifiable abstractions (e.g. \"understand architecture\", \"grasp the overall structure\", \"thoroughly assess\") does NOT count as covered \u2014 even if the abstraction points to the same intent. The sole criterion: can an Owner or a piece of rule code determine whether the described action has been performed? If not, specificity is lost.\n3. riskLevel: expressed as a risk-level word (high/medium/low or Chinese equivalents) OR an equivalent risk description (e.g. \"cross-package changes will cause compilation failure if a caller is missed\") \u2014 both count as covered.\n4. badDecision: appearing in antiPatterns counts as covered. NOT appearing is NOT a defect.\n5. strategicPerspective: does NOT participate in fidelity judgement. Do NOT draw conclusions about it, and never include it in missingDimensions.\n6. When a dimension is NOT covered, you MUST name the required dimension (betterDecision / rationale / riskLevel only). Do NOT give only a qualitative description.\n7. If a dimension's value was not injected (not in the available fields), do NOT judge it \u2014 it is outside scope.\n\nThese criteria apply identically to Stage 1 and Stage 2.\n\nCONVERGENCE CONTRACT (PRI-630 \u2014 applies whenever input.previousEvaluation is present):\n1. input.previousEvaluation.requirements lists the PRIOR round's review contract with stable ids (req-1..req-N). You MUST first verify each prior requirement against the CURRENT artifact state (not your memory of it), then emit BOTH evaluation.priorRequirementStatuses ({ id, status } with status \"resolved\" | \"still_open\" | \"regressed\") AND evaluation.requirementLedger ({ id, statement, status } \u2014 an ECHO of every input requirement with its id, its statement AS GIVEN IN THE INPUT, and the status you assigned; never renumber or restate the ids).\n2. requiredChanges in THIS round MUST be built from requirements you marked still_open or regressed, plus \u2014 only if genuinely necessary \u2014 newly discovered blockers. A newly discovered blocker MUST include: the concrete evidence found in the current artifact, the blocking reason, and why it was not detectable in the previous round. If you cannot state that evidence, the item MUST go to concerns instead of requiredChanges.\n3. Do NOT re-introduce a requirement that the artifact already satisfies. Before listing any required change, check the current artifact content (goldenTraceCases, implementationCode, summaries) for an item that already covers it. Demanding something that is already present is a review defect.\n4. If every prior requirement is resolved, no new evidenced blocker exists, and no Part A dimension fails, you MUST set decision to \"approved\" \u2014 do not invent new open-ended polish requirements.\n\nTOOL CATALOG AUTHORITY (PRI-630 \u2014 applies whenever input.hostToolCatalog is present):\nTool legality is judged ONLY against input.hostToolCatalog (readOnlyTools / writeTools). If a tool name appears in the catalog, it is a legitimate host tool \u2014 you MUST NOT flag it as a blocker for being a \"non-standard name\", regardless of your prior knowledge. The catalog is NOT exhaustive: a tool name absent from the catalog is not evidence of illegality either \u2014 tool-name spelling is never a blocker; only the tool BEHAVIOR described in the rule may be. When input.hostToolCatalog is ABSENT, you have NO authoritative tool knowledge: tool-name observations may appear in concerns at most, and MUST NOT become requiredChanges or affect the decision.\n\nPROTOCOL:\n1. Review the artificerArtifact to understand the proposed implementation plan\n2. Evaluate the plan against quality criteria: completeness, feasibility, test coverage, risk mitigation\n3. Produce a decision: approved (plan is sound), needs_revision (plan has issues but is salvageable), or rejected (plan is fundamentally flawed)\n4. Provide a score from 0.0 to 1.0 reflecting overall quality\n5. List specific strengths, concerns, and required changes\n6. Preserve the lineage trace from artificer, scribe, philosopher, and dreamer artifacts\n7. Identify risks associated with this evaluation\n\nCODE REVIEW (Part A \u2014 Passive Review): When the artificerArtifact contains an \"implementationCode\" field (V2 output), you MUST additionally review the generated code across three dimensions and emit a \"codeReview\" object:\n- intentConsistency: { aligned: boolean, explanation: string } \u2014 Does the code logic match the constraint intent described in the scribe principle text? Read the principle text (scribeArtifact.principleDraft or painReasonSummary), then read the code, then judge whether the code precisely implements the described constraint. When intentContract is present, judge primarily against it: the rule is intent-aligned iff it serves ownerIntent/targetBehavior and does not implement forbiddenBehavior.\n\nOWNER INTENT CONTRACT (when `intentContract` is present \u2014 PRI-703):\n- The intentContract is the distilled Owner intent for this principle \u2014 treat it as the DEFINITION of correctness, ahead of your own reading of the principle prose.\n- intentConsistency must cite the specific contract field(s) the rule satisfies or violates.\n- SCOPING RULE: an adversarial case or required change that demands behavior NOT derivable from ownerIntent/targetBehavior/forbiddenBehavior is OUTSIDE this principle's contract. Record it as a concern with the phrase \"test-scope\" and DO NOT count it as a rule defect in requiredChanges \u2014 it indicates the test case introduces a new behavioral requirement, which belongs to a future principle revision or contract extension, not to rewriting this rule.\n- scopePrecision: { verdict: \"precise\" | \"too_broad\" | \"too_narrow\", explanation: string } \u2014 Are the match conditions over-broad (false positive risk, e.g. using includes() substring matching) or over-narrow (false negative risk, e.g. hardcoded paths)?\n- traceCoverage: { sufficient: boolean, gaps: string[], explanation: string } \u2014 Do the goldenTraceCases cover the key scenarios described in the principle (both positive and negative)?\n\nIf ANY of the three dimensions fails (aligned=false, OR verdict!=precise, OR sufficient=false), set evaluation.decision to \"needs_revision\" and describe the gap in concerns/requiredChanges.\n\nADVERSARIAL CASES (Part B \u2014 only when Part A passes): If and only if all three passive-review dimensions pass (aligned=true AND verdict=precise AND sufficient=true), ALSO generate 3-5 \"adversarialCases\" \u2014 test inputs designed to expose gaps between the principle text and the code's actual behavior. Each case: { caseId, attackType: \"boundary\"|\"omission\"|\"inversion\", toolName, params, expectedDecision: \"allow\"|\"block\"|\"propose_correction\", rationale }. If Part A does NOT fully pass, do NOT generate adversarialCases (short-circuit: skip adversarial generation on passive-review failure to save tokens).\n\nCRITICAL: 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.\n\nCOMPLETE EXAMPLE OUTPUT FOR A V2 ARTIFICER INPUT (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceArtificerArtifactId\":\"pi-art-artificer-001\",\"evaluation\":{\"decision\":\"approved\",\"summary\":\"The rule matches the principle and survives adversarial review.\",\"score\":0.85,\"strengths\":[\"Exact path-segment check\"],\"concerns\":[],\"requiredChanges\":[]},\"sourceTrace\":{\"artificerArtifactId\":\"pi-art-artificer-001\"},\"risks\":[],\"codeReview\":{\"intentConsistency\":{\"aligned\":true,\"explanation\":\"The rule enforces the stated confirmation boundary.\"},\"scopePrecision\":{\"verdict\":\"precise\",\"explanation\":\"It avoids substring and sibling-prefix matches.\"},\"traceCoverage\":{\"sufficient\":true,\"gaps\":[],\"explanation\":\"Positive, negative, and boundary cases are covered.\"}},\"adversarialCases\":[{\"caseId\":\"adversarial-1\",\"attackType\":\"boundary\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system-backup/file\"},\"expectedDecision\":\"allow\",\"rationale\":\"A sibling prefix must not be blocked.\"},{\"caseId\":\"adversarial-2\",\"attackType\":\"omission\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"block\",\"rationale\":\"The protected path must be blocked.\"},{\"caseId\":\"adversarial-3\",\"attackType\":\"inversion\",\"toolName\":\"read_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"allow\",\"rationale\":\"A non-writing tool must remain allowed.\"}],\"generatedAt\":\"<current ISO-8601 timestamp>\"}\n\nCONSTRAINTS:\n- Output ONLY valid JSON \u2014 no markdown, no explanatory text, no code fences, no prose before or after\n- evaluation.decision MUST be one of: approved, needs_revision, rejected\n- evaluation.summary MUST be a non-empty string\n- evaluation.score MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)\n- evaluation.strengths MUST be an array of strings (can be empty)\n- evaluation.concerns MUST be an array of strings (can be empty)\n- evaluation.requiredChanges MUST be an array of strings; when decision is \"needs_revision\" it MUST contain at least one item (a revision demand without an actionable change is an invalid verdict)\n- evaluation.priorRequirementStatuses is REQUIRED when input.previousEvaluation is present: an array of { id, status } covering EVERY prior requirement id, where status is one of resolved, still_open, regressed; omit the field entirely on the first round (no prior evaluation)\n- evaluation.requirementLedger is REQUIRED under the same condition: an array of { id, statement, status } echoing EVERY input requirement (same ids and statements as given; status one of resolved, still_open, regressed); omit entirely on the first round\n- sourceArtificerArtifactId MUST be copied exactly from input.sourceArtificerArtifactId (non-empty string)\n- sourceTrace.artificerArtifactId MUST be copied exactly from input.sourceArtificerArtifactId\n- sourceTrace.scribeArtifactId is optional \u2014 include only if available from artificer artifact\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from artificer artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from artificer artifact\n- risks MUST be an array of strings (can be empty if no risks identified)\n- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)\n- codeReview (when present) MUST contain intentConsistency, scopePrecision, and traceCoverage\n- adversarialCases (when present) MUST be an array of 3-5 objects; omit entirely when passive review fails\n";
|
|
151
|
+
export declare const EVALUATOR_PROTOCOL_INSTRUCTION = "You are an Evaluator agent in a principle internalization pipeline. Your role is to critically review the Artificer's implementation plan and produce a structured evaluation with a decision, score, and actionable feedback.\n\nCOMPRESSION FIDELITY COVERAGE CRITERIA (design \u00A76.5.2 \u2014 Stage 1 and Stage 2 use the SAME criteria):\nWhen evaluating whether the dreamer's decision dimensions are covered in the scribe's principle text, apply these rules:\n1. Coverage = a semantically equivalent expression exists. Rewording (using different phrasing to express the same verifiable content) is allowed; the text does NOT need to contain the exact field name or verbatim string. HOWEVER, abstraction is NOT rewording \u2014 rules 1 and 2 MUST be read together.\n2. betterDecision coverage MUST satisfy BOTH existence AND specificity: verifiable, concrete actions must be retained. Replacing concrete, verifiable actions (e.g. \"audit file tree\", \"grep all imports\", \"check export dependency graph\") with unverifiable abstractions (e.g. \"understand architecture\", \"grasp the overall structure\", \"thoroughly assess\") does NOT count as covered \u2014 even if the abstraction points to the same intent. The sole criterion: can an Owner or a piece of rule code determine whether the described action has been performed? If not, specificity is lost.\n3. riskLevel: expressed as a risk-level word (high/medium/low or Chinese equivalents) OR an equivalent risk description (e.g. \"cross-package changes will cause compilation failure if a caller is missed\") \u2014 both count as covered.\n4. badDecision: appearing in antiPatterns counts as covered. NOT appearing is NOT a defect.\n5. strategicPerspective: does NOT participate in fidelity judgement. Do NOT draw conclusions about it, and never include it in missingDimensions.\n6. When a dimension is NOT covered, you MUST name the required dimension (betterDecision / rationale / riskLevel only). Do NOT give only a qualitative description.\n7. If a dimension's value was not injected (not in the available fields), do NOT judge it \u2014 it is outside scope.\n\nThese criteria apply identically to Stage 1 and Stage 2.\n\nCONVERGENCE CONTRACT (PRI-630 \u2014 applies whenever input.previousEvaluation is present):\n1. input.previousEvaluation.requirements lists the PRIOR round's review contract with stable ids (req-1..req-N). You MUST first verify each prior requirement against the CURRENT artifact state (not your memory of it), then emit BOTH evaluation.priorRequirementStatuses ({ id, status } with status \"resolved\" | \"still_open\" | \"regressed\") AND evaluation.requirementLedger ({ id, statement, status } \u2014 an ECHO of every input requirement with its id, its statement AS GIVEN IN THE INPUT, and the status you assigned; never renumber or restate the ids).\n2. requiredChanges in THIS round MUST be built from requirements you marked still_open or regressed, plus \u2014 only if genuinely necessary \u2014 newly discovered blockers. A newly discovered blocker MUST include: the concrete evidence found in the current artifact, the blocking reason, and why it was not detectable in the previous round. If you cannot state that evidence, the item MUST go to concerns instead of requiredChanges.\n3. Do NOT re-introduce a requirement that the artifact already satisfies. Before listing any required change, check the current artifact content (goldenTraceCases, implementationCode, summaries) for an item that already covers it. Demanding something that is already present is a review defect.\n4. If every prior requirement is resolved, no new evidenced blocker exists, and no Part A dimension fails, you MUST set decision to \"approved\" \u2014 do not invent new open-ended polish requirements.\n\nTOOL CATALOG AUTHORITY (PRI-630 \u2014 applies whenever input.hostToolCatalog is present):\nTool legality is judged ONLY against input.hostToolCatalog (readOnlyTools / writeTools). If a tool name appears in the catalog, it is a legitimate host tool \u2014 you MUST NOT flag it as a blocker for being a \"non-standard name\", regardless of your prior knowledge. The catalog is NOT exhaustive: a tool name absent from the catalog is not evidence of illegality either \u2014 tool-name spelling is never a blocker; only the tool BEHAVIOR described in the rule may be. When input.hostToolCatalog is ABSENT, you have NO authoritative tool knowledge: tool-name observations may appear in concerns at most, and MUST NOT become requiredChanges or affect the decision.\n\nRUNTIME KIND SEMANTICS (PD v2 Phase 1 review round 2026-10-11 \u2014 applies whenever you review implementationCode):\nThe RuleHost runtime dispatches every tool call with a closed canonical kind: \"read\" | \"search\" | \"write\" | \"execute\" | \"agent\" | \"other\". The kind authority is input.hostToolKinds \u2014 the host's OWN tool\u2192kind mapping \u2014 when it is present: judge coverage against THAT mapping. Real hosts disagree with name intuition: a shell tool may dispatch as \"execute\", an agent-delegation tool as \"agent\", while the file-mutation family (write, edit, apply_patch) dispatches as \"write\" \u2014 always read the kind from the mapping, never from the name or the grouping. input.hostToolCatalog is a risk/legality grouping, NOT a kind table: its writeTools may contain tools whose dispatch kind is NOT \"write\", and its readOnlyTools are not automatically \"read\" or \"search\" \u2014 never infer a kind from the catalog grouping or from a tool's name. When input.hostToolKinds is ABSENT you have NO authoritative kind knowledge: a coverage claim that depends on which kind a tool dispatches as MUST stay a concern at most, stated as unknown \u2014 never a requiredChange or decision driver. Even with the mapping present, equal canonicalKind does not prove equal parameter shape or equal rule coverage: a rule that branches on canonicalKind covers same-kind DISPATCH, but a judge may still flag a concrete, evidenced parameter-shape gap (name the parameter and the case) \u2014 such a flag must cite the actual input evidence, not the kind equality alone.\n\nPROTOCOL:\n1. Review the artificerArtifact to understand the proposed implementation plan\n2. Evaluate the plan against quality criteria: completeness, feasibility, test coverage, risk mitigation\n3. Produce a decision: approved (plan is sound), needs_revision (plan has issues but is salvageable), or rejected (plan is fundamentally flawed)\n4. Provide a score from 0.0 to 1.0 reflecting overall quality\n5. List specific strengths, concerns, and required changes\n6. Preserve the lineage trace from artificer, scribe, philosopher, and dreamer artifacts\n7. Identify risks associated with this evaluation\n\nCODE REVIEW (Part A \u2014 Passive Review): When the artificerArtifact contains an \"implementationCode\" field (V2 output), you MUST additionally review the generated code across three dimensions and emit a \"codeReview\" object:\n- intentConsistency: { aligned: boolean, explanation: string } \u2014 Does the code logic match the constraint intent described in the scribe principle text? Read the principle text (scribeArtifact.principleDraft or painReasonSummary), then read the code, then judge whether the code precisely implements the described constraint. When intentContract is present, judge primarily against it: the rule is intent-aligned iff it serves ownerIntent/targetBehavior and does not implement forbiddenBehavior.\n\nOWNER INTENT CONTRACT (when `intentContract` is present \u2014 PRI-703):\n- The intentContract is the distilled Owner intent for this principle \u2014 treat it as the DEFINITION of correctness, ahead of your own reading of the principle prose.\n- intentConsistency must cite the specific contract field(s) the rule satisfies or violates.\n- SCOPING RULE: an adversarial case or required change that demands behavior NOT derivable from ownerIntent/targetBehavior/forbiddenBehavior is OUTSIDE this principle's contract. Record it as a concern with the phrase \"test-scope\" and DO NOT count it as a rule defect in requiredChanges \u2014 it indicates the test case introduces a new behavioral requirement, which belongs to a future principle revision or contract extension, not to rewriting this rule.\n- scopePrecision: { verdict: \"precise\" | \"too_broad\" | \"too_narrow\", explanation: string } \u2014 Are the match conditions over-broad (false positive risk, e.g. using includes() substring matching) or over-narrow (false negative risk, e.g. hardcoded paths)?\n- traceCoverage: { sufficient: boolean, gaps: string[], explanation: string } \u2014 Do the goldenTraceCases cover the key scenarios described in the principle (both positive and negative)?\n\nIf ANY of the three dimensions fails (aligned=false, OR verdict!=precise, OR sufficient=false), set evaluation.decision to \"needs_revision\" and describe the gap in concerns/requiredChanges.\n\nADVERSARIAL CASES (Part B \u2014 only when Part A passes): If and only if all three passive-review dimensions pass (aligned=true AND verdict=precise AND sufficient=true), ALSO generate 3-5 \"adversarialCases\" \u2014 test inputs designed to expose gaps between the principle text and the code's actual behavior. Each case: { caseId, attackType: \"boundary\"|\"omission\"|\"inversion\", toolName, params, expectedDecision: \"allow\"|\"block\"|\"propose_correction\", rationale }. If Part A does NOT fully pass, do NOT generate adversarialCases (short-circuit: skip adversarial generation on passive-review failure to save tokens).\n\nCRITICAL: 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.\n\nCOMPLETE EXAMPLE OUTPUT FOR A V2 ARTIFICER INPUT (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceArtificerArtifactId\":\"pi-art-artificer-001\",\"evaluation\":{\"decision\":\"approved\",\"summary\":\"The rule matches the principle and survives adversarial review.\",\"score\":0.85,\"strengths\":[\"Exact path-segment check\"],\"concerns\":[],\"requiredChanges\":[]},\"sourceTrace\":{\"artificerArtifactId\":\"pi-art-artificer-001\"},\"risks\":[],\"codeReview\":{\"intentConsistency\":{\"aligned\":true,\"explanation\":\"The rule enforces the stated confirmation boundary.\"},\"scopePrecision\":{\"verdict\":\"precise\",\"explanation\":\"It avoids substring and sibling-prefix matches.\"},\"traceCoverage\":{\"sufficient\":true,\"gaps\":[],\"explanation\":\"Positive, negative, and boundary cases are covered.\"}},\"adversarialCases\":[{\"caseId\":\"adversarial-1\",\"attackType\":\"boundary\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system-backup/file\"},\"expectedDecision\":\"allow\",\"rationale\":\"A sibling prefix must not be blocked.\"},{\"caseId\":\"adversarial-2\",\"attackType\":\"omission\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"block\",\"rationale\":\"The protected path must be blocked.\"},{\"caseId\":\"adversarial-3\",\"attackType\":\"inversion\",\"toolName\":\"read_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"allow\",\"rationale\":\"A non-writing tool must remain allowed.\"}],\"generatedAt\":\"<current ISO-8601 timestamp>\"}\n\nCONSTRAINTS:\n- Output ONLY valid JSON \u2014 no markdown, no explanatory text, no code fences, no prose before or after\n- evaluation.decision MUST be one of: approved, needs_revision, rejected\n- evaluation.summary MUST be a non-empty string\n- evaluation.score MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)\n- evaluation.strengths MUST be an array of strings (can be empty)\n- evaluation.concerns MUST be an array of strings (can be empty)\n- evaluation.requiredChanges MUST be an array of strings; when decision is \"needs_revision\" it MUST contain at least one item (a revision demand without an actionable change is an invalid verdict)\n- evaluation.priorRequirementStatuses is REQUIRED when input.previousEvaluation is present: an array of { id, status } covering EVERY prior requirement id, where status is one of resolved, still_open, regressed; omit the field entirely on the first round (no prior evaluation)\n- evaluation.requirementLedger is REQUIRED under the same condition: an array of { id, statement, status } echoing EVERY input requirement (same ids and statements as given; status one of resolved, still_open, regressed); omit entirely on the first round\n- sourceArtificerArtifactId MUST be copied exactly from input.sourceArtificerArtifactId (non-empty string)\n- sourceTrace.artificerArtifactId MUST be copied exactly from input.sourceArtificerArtifactId\n- sourceTrace.scribeArtifactId is optional \u2014 include only if available from artificer artifact\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from artificer artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from artificer artifact\n- risks MUST be an array of strings (can be empty if no risks identified)\n- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)\n- codeReview (when present) MUST contain intentConsistency, scopePrecision, and traceCoverage\n- adversarialCases (when present) MUST be an array of 3-5 objects; omit entirely when passive review fails\n";
|
|
130
152
|
/**
|
|
131
153
|
* PRI-843: the machine-readable concern-type token for a Principle↔Pain
|
|
132
154
|
* mismatch finding. The v5 prompt contract requires every such concern to
|
|
@@ -182,7 +204,19 @@ export declare const EVALUATOR_VALIDATOR_FEEDBACK_ADDENDUM = "\n\nPRIOR OUTPUT-C
|
|
|
182
204
|
* same discipline as v5 — a run without validator feedback emits exactly the
|
|
183
205
|
* v5 wire shape plus the new version string.
|
|
184
206
|
*/
|
|
185
|
-
|
|
207
|
+
/**
|
|
208
|
+
* PD v2 Phase 1 closeout (2026-10-11): bumped v6 → v7. Live p1-closeout chain:
|
|
209
|
+
* a rule whose write gate branched on `canonicalKind === 'write'` PASSED the
|
|
210
|
+
* full deterministic replay (edit and apply_patch canonicalize to 'write')
|
|
211
|
+
* yet the LLM judge returned needs_revision claiming "edit/apply_patch 会直
|
|
212
|
+
* 接返回 allow" — the judge knew the tool catalog NAMES but not the kind
|
|
213
|
+
* mapping, so it misread correct code as a coverage hole. The system prompt
|
|
214
|
+
* now carries a RUNTIME KIND SEMANTICS clause (writeTools dispatch as the
|
|
215
|
+
* single kind 'write'; only literal-toolName matching can miss a sibling).
|
|
216
|
+
* Additive: a run without implementationCode review sees only the new clause
|
|
217
|
+
* and version string.
|
|
218
|
+
*/
|
|
219
|
+
export declare const EVALUATOR_PROMPT_CONTRACT_VERSION = "evaluator-output-v1.prompt.v8";
|
|
186
220
|
export declare class EvaluatorPromptBuilder {
|
|
187
221
|
buildPrompt(input: EvaluatorPromptBuilderInput): EvaluatorPromptBuildResult;
|
|
188
222
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/evaluator-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM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AAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"evaluator-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/evaluator-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C;;;;OAIG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,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AwG;IACxG,aAAa,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,mGAAmG;IACnG,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mFAAmF;IACnF,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAC3C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,8BAA8B,gpaAyE1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,8BAA8B,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qCAAqC,gzFAcwL,CAAC;AAE3O;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qCAAqC,8xCAQjD,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH;;;;;;;;;;;GAWG;AAYH,eAAO,MAAM,iCAAiC,kCAAkC,CAAC;AAEjF,qBAAa,sBAAsB;IAEjC,WAAW,CAAC,KAAK,EAAE,2BAA2B,GAAG,0BAA0B,CAgD1E;CACF"}
|
|
@@ -57,6 +57,9 @@ CONVERGENCE CONTRACT (PRI-630 — applies whenever input.previousEvaluation is p
|
|
|
57
57
|
TOOL CATALOG AUTHORITY (PRI-630 — applies whenever input.hostToolCatalog is present):
|
|
58
58
|
Tool legality is judged ONLY against input.hostToolCatalog (readOnlyTools / writeTools). If a tool name appears in the catalog, it is a legitimate host tool — you MUST NOT flag it as a blocker for being a "non-standard name", regardless of your prior knowledge. The catalog is NOT exhaustive: a tool name absent from the catalog is not evidence of illegality either — tool-name spelling is never a blocker; only the tool BEHAVIOR described in the rule may be. When input.hostToolCatalog is ABSENT, you have NO authoritative tool knowledge: tool-name observations may appear in concerns at most, and MUST NOT become requiredChanges or affect the decision.
|
|
59
59
|
|
|
60
|
+
RUNTIME KIND SEMANTICS (PD v2 Phase 1 review round 2026-10-11 — applies whenever you review implementationCode):
|
|
61
|
+
The RuleHost runtime dispatches every tool call with a closed canonical kind: "read" | "search" | "write" | "execute" | "agent" | "other". The kind authority is input.hostToolKinds — the host's OWN tool→kind mapping — when it is present: judge coverage against THAT mapping. Real hosts disagree with name intuition: a shell tool may dispatch as "execute", an agent-delegation tool as "agent", while the file-mutation family (write, edit, apply_patch) dispatches as "write" — always read the kind from the mapping, never from the name or the grouping. input.hostToolCatalog is a risk/legality grouping, NOT a kind table: its writeTools may contain tools whose dispatch kind is NOT "write", and its readOnlyTools are not automatically "read" or "search" — never infer a kind from the catalog grouping or from a tool's name. When input.hostToolKinds is ABSENT you have NO authoritative kind knowledge: a coverage claim that depends on which kind a tool dispatches as MUST stay a concern at most, stated as unknown — never a requiredChange or decision driver. Even with the mapping present, equal canonicalKind does not prove equal parameter shape or equal rule coverage: a rule that branches on canonicalKind covers same-kind DISPATCH, but a judge may still flag a concrete, evidenced parameter-shape gap (name the parameter and the case) — such a flag must cite the actual input evidence, not the kind equality alone.
|
|
62
|
+
|
|
60
63
|
PROTOCOL:
|
|
61
64
|
1. Review the artificerArtifact to understand the proposed implementation plan
|
|
62
65
|
2. Evaluate the plan against quality criteria: completeness, feasibility, test coverage, risk mitigation
|
|
@@ -182,7 +185,30 @@ PRIOR OUTPUT-CONTRACT REJECTIONS (when \`priorValidatorErrors\` is present):
|
|
|
182
185
|
* same discipline as v5 — a run without validator feedback emits exactly the
|
|
183
186
|
* v5 wire shape plus the new version string.
|
|
184
187
|
*/
|
|
185
|
-
|
|
188
|
+
/**
|
|
189
|
+
* PD v2 Phase 1 closeout (2026-10-11): bumped v6 → v7. Live p1-closeout chain:
|
|
190
|
+
* a rule whose write gate branched on `canonicalKind === 'write'` PASSED the
|
|
191
|
+
* full deterministic replay (edit and apply_patch canonicalize to 'write')
|
|
192
|
+
* yet the LLM judge returned needs_revision claiming "edit/apply_patch 会直
|
|
193
|
+
* 接返回 allow" — the judge knew the tool catalog NAMES but not the kind
|
|
194
|
+
* mapping, so it misread correct code as a coverage hole. The system prompt
|
|
195
|
+
* now carries a RUNTIME KIND SEMANTICS clause (writeTools dispatch as the
|
|
196
|
+
* single kind 'write'; only literal-toolName matching can miss a sibling).
|
|
197
|
+
* Additive: a run without implementationCode review sees only the new clause
|
|
198
|
+
* and version string.
|
|
199
|
+
*/
|
|
200
|
+
// Review round (2026-10-11): bumped v7 -> v8. Review showed the v7 clause
|
|
201
|
+
// itself asserted a false mapping: "EVERY writeTools entry dispatches as
|
|
202
|
+
// 'write'" — but the real OpenClaw catalog's writeTools is a RISK grouping
|
|
203
|
+
// that includes a shell tool dispatching 'execute' and an agent-delegation
|
|
204
|
+
// tool dispatching 'agent', and readOnlyTools are not automatically
|
|
205
|
+
// 'read'/'search'. v8 makes the host's OWN tool-to-kind mapping
|
|
206
|
+
// (input.hostToolKinds, projected from the runner's existing
|
|
207
|
+
// hostSemanticContext — no second mapping table) the kind authority, marks
|
|
208
|
+
// the catalog as a risk grouping that must never be read as a kind table,
|
|
209
|
+
// keeps unknown when no mapping is present, and re-allows concrete
|
|
210
|
+
// parameter-shape coverage flags with evidence. Additive input field.
|
|
211
|
+
export const EVALUATOR_PROMPT_CONTRACT_VERSION = 'evaluator-output-v1.prompt.v8';
|
|
186
212
|
export class EvaluatorPromptBuilder {
|
|
187
213
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
188
214
|
buildPrompt(input) {
|
|
@@ -197,6 +223,10 @@ export class EvaluatorPromptBuilder {
|
|
|
197
223
|
scribeArtifact: input.scribeArtifact,
|
|
198
224
|
previousEvaluation: input.previousEvaluation,
|
|
199
225
|
hostToolCatalog: input.hostToolCatalog,
|
|
226
|
+
// Review round (2026-10-11): only include hostToolKinds when the runner
|
|
227
|
+
// carried a host semantic context, so runs without one keep the exact
|
|
228
|
+
// pre-review payload (backward compatible).
|
|
229
|
+
...(input.hostToolKinds !== undefined ? { hostToolKinds: input.hostToolKinds } : {}),
|
|
200
230
|
// PRI-703 Phase 1: only include intentContract when present (pre-contract
|
|
201
231
|
// scribe artifacts), so prompts stay backward-compatible.
|
|
202
232
|
...(input.intentContract !== undefined ? { intentContract: input.intentContract } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/evaluator-prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"evaluator-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/evaluator-prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAsGlE,SAAS,kBAAkB,CAAC,CAAS;IACnC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,cAAwF,EACxF,eAAkC;IAElC,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE;YAClB,SAAS;YACT,MAAM,EAAE,KAAc;SACvB,CAAC,CAAC,CAAC;IACN,CAAC;IACD,MAAM,OAAO,GAAG,cAAc;SAC3B,MAAM,CAAC,CAAC,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;IACJ,CAAC;CACF"}
|
|
@@ -545,6 +545,37 @@ export declare class EvaluatorRunner extends BasePeerRunner<EvaluatorContext, Ev
|
|
|
545
545
|
* (Runtime Contract Rule 9: graceful degradation includes a reason).
|
|
546
546
|
*/
|
|
547
547
|
private mapFailedCases;
|
|
548
|
+
/**
|
|
549
|
+
* PD v2 Phase 1 closeout (2026-10-11), review-round budget rework: the
|
|
550
|
+
* failed case's defining input in three INDEPENDENTLY bounded segments —
|
|
551
|
+
*
|
|
552
|
+
* 1. identity + context facts (history status, truncated,
|
|
553
|
+
* priorReadOfTarget, readCount) — written FIRST so a large params
|
|
554
|
+
* value can never crowd the context evidence out of the summary;
|
|
555
|
+
* 2. a bounded params digest — every key survives, big values collapse
|
|
556
|
+
* to a VISIBLE `value…(+N chars)` marker instead of inlining;
|
|
557
|
+
* 3. the case's authored rationale, bounded.
|
|
558
|
+
*
|
|
559
|
+
* Each segment carries its own visible truncation marker, so a truncated
|
|
560
|
+
* summary never looks complete. Total is capped at the shared
|
|
561
|
+
* MAX_FAILED_CASE_INPUT_LENGTH (rc-8); the resolver uses the SAME bound,
|
|
562
|
+
* eliminating the old second silent 300-char cut that dropped context
|
|
563
|
+
* facts from legal 350-char-param inputs.
|
|
564
|
+
*/
|
|
565
|
+
private static summarizeFailedCaseInput;
|
|
566
|
+
/**
|
|
567
|
+
* Target-first per-key digest (review round 2, 2026-10-11): the case's
|
|
568
|
+
* OWN target (path/file_path via the existing resolveCasePathParam
|
|
569
|
+
* contract) gets an INDEPENDENT budget written FIRST, so legal edit
|
|
570
|
+
* payloads whose long oldText/newText/content fields precede the target
|
|
571
|
+
* can no longer evict `protected/…` from the repair input. A long target
|
|
572
|
+
* truncates visibly inside its own budget; a case with no derivable
|
|
573
|
+
* target says so explicitly (never guessed, never borrowed). Remaining
|
|
574
|
+
* keys keep the per-key digest with visible fold markers. The total
|
|
575
|
+
* params segment stays within the shared MAX_FAILED_CASE_INPUT_LENGTH
|
|
576
|
+
* arithmetic — the target budget is reserved, not added on top.
|
|
577
|
+
*/
|
|
578
|
+
private static digestParams;
|
|
548
579
|
/**
|
|
549
580
|
* Assemble and persist the rule artifact when adversarial replay passed
|
|
550
581
|
* (PRD Decision 5). The rule artifact carries implementationCode + the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/evaluator-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EAEjB,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAkB,KAAK,eAAe,EAAqB,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAgJ,KAAK,aAAa,EAAqE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQrS,OAAO,EAAmF,KAAK,yBAAyB,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3L,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAwB,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5I,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAA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AC,4BAA4B;IAkEpC;;;;;;;;;OASG;IAEH,OAAO,CAAC,cAAc;IAgEtB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IA+BvC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAiE3B;;;;;;;;;;OAUG;YAEW,oBAAoB;IA2RlC;;;;;;;;;;OAUG;YACW,8BAA8B;IAmE5C;;;OAGG;IAEH,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB;;;;;;;;;;;OAWG;YACW,oCAAoC;CA+BnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEvaluatorOutputV2 } from './evaluator-output.js';
|
|
1
|
+
import { isEvaluatorOutputV2, MAX_FAILED_CASE_INPUT_LENGTH } from './evaluator-output.js';
|
|
2
2
|
// PRI-911A: the identity shape gate is the SAME authority the activation
|
|
3
3
|
// boundary uses (PR #1856) — never re-implement a UUID parser here.
|
|
4
4
|
import { canonicalLedgerPrincipleId } from '../activation/low-risk-writers.js';
|
|
@@ -545,6 +545,15 @@ export class EvaluatorRunner extends BasePeerRunner {
|
|
|
545
545
|
sourceArtificerArtifactId: context.sourceArtificerArtifactId ?? '',
|
|
546
546
|
previousEvaluation: context.previousEvaluation,
|
|
547
547
|
hostToolCatalog: this.hostToolCatalog ?? undefined,
|
|
548
|
+
// Review round (2026-10-11): project the runner's existing host
|
|
549
|
+
// semantic context (the same registry provenance the alias generator
|
|
550
|
+
// uses) as the judge's kind authority. NOT derived from the catalog —
|
|
551
|
+
// the catalog's writeTools is a risk grouping that includes
|
|
552
|
+
// execute/agent-kind tools. Undefined when no host context → prompt
|
|
553
|
+
// input stays without the field (backward compatible).
|
|
554
|
+
hostToolKinds: this.hostSemanticContext && this.hostSemanticContext.tools.length > 0
|
|
555
|
+
? this.hostSemanticContext.tools.map((tool) => ({ rawToolName: tool.rawToolName, canonicalKind: tool.canonicalKind }))
|
|
556
|
+
: undefined,
|
|
548
557
|
// PRI-714: language directive for review fields (undefined = none).
|
|
549
558
|
outputLanguage: this.outputLanguage,
|
|
550
559
|
// PRI-703 Phase 1: the scribe artifact's Owner-intent contract is the
|
|
@@ -2614,6 +2623,14 @@ export class EvaluatorRunner extends BasePeerRunner {
|
|
|
2614
2623
|
...(fc.actualDecision !== undefined ? { actualDecision: fc.actualDecision } : {}),
|
|
2615
2624
|
errorType: fc.errorType,
|
|
2616
2625
|
message,
|
|
2626
|
+
// PD v2 Phase 1 closeout (2026-10-11): carry the failed case's
|
|
2627
|
+
// defining input so the repair round receives actionable evidence —
|
|
2628
|
+
// a bare `Expected block but got allow` names neither the action nor
|
|
2629
|
+
// the context shape that produced it ("failure must increase
|
|
2630
|
+
// information", PRI-634 PR-A). Sandbox failedCases can also cover
|
|
2631
|
+
// merged positive/golden-trace cases the adversarial list does not
|
|
2632
|
+
// know; those keep the legacy no-input shape.
|
|
2633
|
+
...(adv !== undefined ? { caseInput: EvaluatorRunner.summarizeFailedCaseInput(adv) } : {}),
|
|
2617
2634
|
rationale: adv
|
|
2618
2635
|
? `${fc.errorType}: ${message}`
|
|
2619
2636
|
: `non-adversarial case ${fc.caseId} failed (${fc.errorType}: ${message}) — likely a code defect, not an adversarial gap`,
|
|
@@ -2633,6 +2650,124 @@ export class EvaluatorRunner extends BasePeerRunner {
|
|
|
2633
2650
|
}));
|
|
2634
2651
|
return [...fromSandbox, ...fromForbidden];
|
|
2635
2652
|
}
|
|
2653
|
+
/**
|
|
2654
|
+
* PD v2 Phase 1 closeout (2026-10-11), review-round budget rework: the
|
|
2655
|
+
* failed case's defining input in three INDEPENDENTLY bounded segments —
|
|
2656
|
+
*
|
|
2657
|
+
* 1. identity + context facts (history status, truncated,
|
|
2658
|
+
* priorReadOfTarget, readCount) — written FIRST so a large params
|
|
2659
|
+
* value can never crowd the context evidence out of the summary;
|
|
2660
|
+
* 2. a bounded params digest — every key survives, big values collapse
|
|
2661
|
+
* to a VISIBLE `value…(+N chars)` marker instead of inlining;
|
|
2662
|
+
* 3. the case's authored rationale, bounded.
|
|
2663
|
+
*
|
|
2664
|
+
* Each segment carries its own visible truncation marker, so a truncated
|
|
2665
|
+
* summary never looks complete. Total is capped at the shared
|
|
2666
|
+
* MAX_FAILED_CASE_INPUT_LENGTH (rc-8); the resolver uses the SAME bound,
|
|
2667
|
+
* eliminating the old second silent 300-char cut that dropped context
|
|
2668
|
+
* facts from legal 350-char-param inputs.
|
|
2669
|
+
*/
|
|
2670
|
+
static summarizeFailedCaseInput(adv) {
|
|
2671
|
+
const history = adv.ruleContext?.history;
|
|
2672
|
+
const facts = adv.ruleContext?.facts;
|
|
2673
|
+
const contextState = adv.ruleContext
|
|
2674
|
+
? `history ${history?.status ?? 'unknown'}${history?.truncated ? ' (truncated)' : ''}`
|
|
2675
|
+
: 'none';
|
|
2676
|
+
const identityAndContext = `tool=${adv.toolName} | context: ${contextState}, priorReadOfTarget=${facts?.priorReadOfTarget ?? 'unknown'}, readCount=${facts?.readCount ?? 'unknown'}`;
|
|
2677
|
+
let paramsDigest;
|
|
2678
|
+
try {
|
|
2679
|
+
paramsDigest = EvaluatorRunner.digestParams(adv.params);
|
|
2680
|
+
}
|
|
2681
|
+
catch {
|
|
2682
|
+
// Whole-params failure other than the contained target-field cases
|
|
2683
|
+
// (e.g. a poisoned getter on a non-target key racing the key sweep):
|
|
2684
|
+
// keep the explicit degradation marker. The context/facts segment is
|
|
2685
|
+
// unaffected either way.
|
|
2686
|
+
paramsDigest = '(unserializable params)';
|
|
2687
|
+
}
|
|
2688
|
+
const rationaleBound = 90;
|
|
2689
|
+
const rationale = adv.rationale.length > rationaleBound ? `${adv.rationale.slice(0, rationaleBound)}…` : adv.rationale;
|
|
2690
|
+
const summary = `${identityAndContext} | params: ${paramsDigest} | case rationale: ${rationale}`;
|
|
2691
|
+
// Defensive only: segment budgets keep the total within the shared bound
|
|
2692
|
+
// for realistic inputs; if it ever exceeds, the cut stays visible.
|
|
2693
|
+
return summary.length > MAX_FAILED_CASE_INPUT_LENGTH
|
|
2694
|
+
? `${summary.slice(0, MAX_FAILED_CASE_INPUT_LENGTH - 1)}…`
|
|
2695
|
+
: summary;
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Target-first per-key digest (review round 2, 2026-10-11): the case's
|
|
2699
|
+
* OWN target (path/file_path via the existing resolveCasePathParam
|
|
2700
|
+
* contract) gets an INDEPENDENT budget written FIRST, so legal edit
|
|
2701
|
+
* payloads whose long oldText/newText/content fields precede the target
|
|
2702
|
+
* can no longer evict `protected/…` from the repair input. A long target
|
|
2703
|
+
* truncates visibly inside its own budget; a case with no derivable
|
|
2704
|
+
* target says so explicitly (never guessed, never borrowed). Remaining
|
|
2705
|
+
* keys keep the per-key digest with visible fold markers. The total
|
|
2706
|
+
* params segment stays within the shared MAX_FAILED_CASE_INPUT_LENGTH
|
|
2707
|
+
* arithmetic — the target budget is reserved, not added on top.
|
|
2708
|
+
*/
|
|
2709
|
+
static digestParams(params) {
|
|
2710
|
+
const targetBound = 100;
|
|
2711
|
+
const restBound = 120;
|
|
2712
|
+
const valueBound = 40;
|
|
2713
|
+
// Target via the existing resolution contract (path, then file_path).
|
|
2714
|
+
// resolveCasePathParam only reads string fields, so it stays safe even
|
|
2715
|
+
// when OTHER params are unserializable. A poisoned getter on a target
|
|
2716
|
+
// field itself is contained here: the target degrades to the explicit
|
|
2717
|
+
// none marker (the summarize-level whole-params catch then never fires
|
|
2718
|
+
// for this shape).
|
|
2719
|
+
let target = null;
|
|
2720
|
+
let targetKey = null;
|
|
2721
|
+
try {
|
|
2722
|
+
target = resolveCasePathParam(params);
|
|
2723
|
+
if (target !== null) {
|
|
2724
|
+
// Re-derive which key won so the LOSING sibling (e.g. file_path next
|
|
2725
|
+
// to a winning path, or a non-string path) stays visible in the rest
|
|
2726
|
+
// digest instead of silently disappearing.
|
|
2727
|
+
for (const key of ['path', 'file_path']) {
|
|
2728
|
+
try {
|
|
2729
|
+
const raw = params[key];
|
|
2730
|
+
if (typeof raw === 'string' && raw.trim() !== '') {
|
|
2731
|
+
targetKey = key;
|
|
2732
|
+
break;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
catch {
|
|
2736
|
+
// Poisoned getter on this key — skip it; the other may still win.
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
catch {
|
|
2742
|
+
// resolveCasePathParam threw on a poisoned target field: treat as no
|
|
2743
|
+
// derivable target (the explicit none marker below).
|
|
2744
|
+
}
|
|
2745
|
+
const targetSegment = target === null
|
|
2746
|
+
? "target=(none - not derivable from this case's params)"
|
|
2747
|
+
: target.length > targetBound
|
|
2748
|
+
? `target="${target.slice(0, targetBound - 1)}…(+${target.length - (targetBound - 1)} chars)"`
|
|
2749
|
+
: `target="${target}"`;
|
|
2750
|
+
const parts = Object.keys(params)
|
|
2751
|
+
.filter((key) => key !== targetKey)
|
|
2752
|
+
.map((key) => {
|
|
2753
|
+
let value;
|
|
2754
|
+
try {
|
|
2755
|
+
value = JSON.stringify(params[key]) ?? 'undefined';
|
|
2756
|
+
}
|
|
2757
|
+
catch {
|
|
2758
|
+
value = '(unserializable)';
|
|
2759
|
+
}
|
|
2760
|
+
if (value.length > valueBound) {
|
|
2761
|
+
value = `${value.slice(0, valueBound)}…(+${value.length - valueBound} chars)`;
|
|
2762
|
+
}
|
|
2763
|
+
return `${key}=${value}`;
|
|
2764
|
+
});
|
|
2765
|
+
const restDigest = `{${parts.join(',')}}`;
|
|
2766
|
+
const rest = restDigest.length > restBound
|
|
2767
|
+
? `${restDigest.slice(0, restBound)}…(+${restDigest.length - restBound} chars total)`
|
|
2768
|
+
: restDigest;
|
|
2769
|
+
return `${targetSegment}; ${rest}`;
|
|
2770
|
+
}
|
|
2636
2771
|
// ── PRI-427: rule artifact assembly ────────────────────────────────────────
|
|
2637
2772
|
/**
|
|
2638
2773
|
* Assemble and persist the rule artifact when adversarial replay passed
|