@principles/core 1.284.9 → 1.284.11
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 +5 -3
- package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js +18 -1
- package/dist/runtime-v2/__tests__/intake-to-internalization-bridge.test.js.map +1 -1
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.js +4 -0
- package/dist/runtime-v2/__tests__/internalization-state-machine.test.js.map +1 -1
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js +3 -3
- package/dist/runtime-v2/__tests__/rollout-reviewer-runner-vslice.test.js.map +1 -1
- package/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js +221 -0
- package/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js.map +1 -1
- package/dist/runtime-v2/adapter/__tests__/l2-resolve-model-compat.test.js +66 -0
- package/dist/runtime-v2/adapter/__tests__/l2-resolve-model-compat.test.js.map +1 -1
- package/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts +17 -0
- package/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -1
- package/dist/runtime-v2/adapter/artificer-l2-adapter.js +217 -28
- package/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -1
- package/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts +21 -5
- package/dist/runtime-v2/adapter/l2-agent-loop-adapter.d.ts.map +1 -1
- package/dist/runtime-v2/adapter/l2-agent-loop-adapter.js +60 -9
- package/dist/runtime-v2/adapter/l2-agent-loop-adapter.js.map +1 -1
- package/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/dist/runtime-v2/feature-flags/feature-flag-contract.js +10 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/dist/runtime-v2/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +8 -0
- package/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/dist/runtime-v2/index.d.ts +1 -3
- 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/internalization/__tests__/a-liveness-reconciliation.test.js +2 -1
- package/dist/runtime-v2/internalization/__tests__/a-liveness-reconciliation.test.js.map +1 -1
- package/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js +109 -20
- package/dist/runtime-v2/internalization/__tests__/c2-live-runner-chain.test.js.map +1 -1
- package/dist/runtime-v2/internalization/__tests__/intake-bridge-channel-admission.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/intake-bridge-channel-admission.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/intake-bridge-channel-admission.test.js +128 -0
- package/dist/runtime-v2/internalization/__tests__/intake-bridge-channel-admission.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.js +2 -0
- package/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.js.map +1 -1
- package/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js +6 -0
- package/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js.map +1 -1
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-principle-semantic.test.d.ts +2 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-principle-semantic.test.d.ts.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-principle-semantic.test.js +328 -0
- package/dist/runtime-v2/internalization/__tests__/rollout-reviewer-principle-semantic.test.js.map +1 -0
- package/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.js +2 -1
- package/dist/runtime-v2/internalization/__tests__/verdict-drift-regressions.test.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts +3 -1
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.js +3 -0
- package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/index.d.ts +1 -1
- package/dist/runtime-v2/internalization/index.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/index.js +1 -1
- package/dist/runtime-v2/internalization/index.js.map +1 -1
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts +44 -1
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.js +104 -9
- package/dist/runtime-v2/internalization/intake-to-internalization-bridge.js.map +1 -1
- package/dist/runtime-v2/internalization/internalization-job-graph.d.ts +49 -10
- package/dist/runtime-v2/internalization/internalization-job-graph.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/internalization-job-graph.js +71 -13
- package/dist/runtime-v2/internalization/internalization-job-graph.js.map +1 -1
- package/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/internalization-orchestrator.js +1 -0
- package/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
- package/dist/runtime-v2/internalization/internalization-state-machine.d.ts +13 -10
- package/dist/runtime-v2/internalization/internalization-state-machine.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/internalization-state-machine.js +20 -15
- package/dist/runtime-v2/internalization/internalization-state-machine.js.map +1 -1
- package/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +24 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/peer-runner-contracts.js +17 -0
- package/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
- package/dist/runtime-v2/internalization/pitask-metadata.d.ts +8 -1
- package/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/pitask-metadata.js +10 -1
- package/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
- package/dist/runtime-v2/internalization/revision-reopen.d.ts +2 -1
- package/dist/runtime-v2/internalization/revision-reopen.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/revision-reopen.js +14 -2
- package/dist/runtime-v2/internalization/revision-reopen.js.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts +32 -7
- package/dist/runtime-v2/internalization/rollout-reviewer-output.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-output.js +58 -16
- package/dist/runtime-v2/internalization/rollout-reviewer-output.js.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts +29 -4
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js +80 -0
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts +43 -9
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.js +213 -51
- package/dist/runtime-v2/internalization/rollout-reviewer-runner.js.map +1 -1
- package/dist/runtime-v2/pain-signal-bridge.d.ts +9 -0
- package/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
- package/dist/runtime-v2/pain-signal-bridge.js +23 -4
- package/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.js +15 -3
- package/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js +8 -0
- package/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
- package/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.js +15 -1
- package/dist/runtime-v2/tools/__tests__/artificer-output-typebox.test.js.map +1 -1
- package/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
- package/dist/runtime-v2/tools/artificer-l2-tool-contract.js +24 -4
- package/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
- package/dist/runtime-v2/tools/artificer-output-typebox.d.ts +1 -0
- package/dist/runtime-v2/tools/artificer-output-typebox.d.ts.map +1 -1
- package/dist/runtime-v2/tools/artificer-output-typebox.js +6 -0
- package/dist/runtime-v2/tools/artificer-output-typebox.js.map +1 -1
- package/dist/telemetry-event.d.ts +2 -2
- package/dist/telemetry-event.d.ts.map +1 -1
- package/dist/telemetry-event.js +7 -1
- package/dist/telemetry-event.js.map +1 -1
- package/package.json +1 -1
- package/dist/runtime-v2/__tests__/workspace-guidance-migration.test.d.ts +0 -2
- package/dist/runtime-v2/__tests__/workspace-guidance-migration.test.d.ts.map +0 -1
- package/dist/runtime-v2/__tests__/workspace-guidance-migration.test.js +0 -328
- package/dist/runtime-v2/__tests__/workspace-guidance-migration.test.js.map +0 -1
- package/dist/runtime-v2/workspace-guidance-migration.d.ts +0 -12
- package/dist/runtime-v2/workspace-guidance-migration.d.ts.map +0 -1
- package/dist/runtime-v2/workspace-guidance-migration.js +0 -193
- package/dist/runtime-v2/workspace-guidance-migration.js.map +0 -1
|
@@ -35,6 +35,66 @@ CONSTRAINTS:
|
|
|
35
35
|
- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)
|
|
36
36
|
`;
|
|
37
37
|
export const ROLLOUT_REVIEWER_PROMPT_CONTRACT_VERSION = 'rollout-reviewer-output-v1.prompt.v1';
|
|
38
|
+
/**
|
|
39
|
+
* PRI-720 principle semantic mode (prompt/defer_archive standard topology):
|
|
40
|
+
* the review source is the SCRIBE principle artifact (principleDraft +
|
|
41
|
+
* intentContract + diagnosis evidence), NOT an evaluator/code contract.
|
|
42
|
+
* Governance exam split per PRI-720 SPEC:
|
|
43
|
+
* 审: causal fidelity to the pain/diagnosis, Owner-intent anchoring
|
|
44
|
+
* (intentContract), executability, scope honesty, over-generalization /
|
|
45
|
+
* negative-control risk.
|
|
46
|
+
* 不审: implementationCode, goldenTraceCases, affectedTools, sandbox
|
|
47
|
+
* bypass, RuleContext code behavior — the RuleCode contract does not
|
|
48
|
+
* exist on this channel.
|
|
49
|
+
* The reviewer ONLY judges; it never authors a second principle text.
|
|
50
|
+
*/
|
|
51
|
+
export const ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_INSTRUCTION = `You are a Rollout Reviewer agent running in PRINCIPLE SEMANTIC mode of a principle internalization pipeline (PRI-720). The candidate under review is a cognitive behavioral PRINCIPLE authored by the Scribe — not code, not a rule. No evaluator ran on this channel by design.
|
|
52
|
+
|
|
53
|
+
REVIEW SCOPE (what you judge):
|
|
54
|
+
1. Causal fidelity: does the principle faithfully reflect the pain/diagnosis evidence provided? Does it address the actual root cause?
|
|
55
|
+
2. Owner intent consistency: does the principle honor the intentContract (targetBehavior / forbiddenBehavior) and the Owner's expressed intent?
|
|
56
|
+
3. Executability: can an agent realistically follow this principle in future sessions? Is it observable in behavior?
|
|
57
|
+
4. Scope honesty: are the applicability conditions and antiPatterns explicit and honest about boundaries?
|
|
58
|
+
5. Over-generalization / negative-control risk: could this principle over-constrain legitimate behavior? Would it misfire on cases outside its evidence?
|
|
59
|
+
|
|
60
|
+
DO NOT REVIEW (out of scope for this mode — these fields do not exist on this channel):
|
|
61
|
+
- implementationCode, evaluate() functions, goldenTraceCases
|
|
62
|
+
- affectedTools catalogs, sandbox behavior, RuleContext code semantics
|
|
63
|
+
- evaluator scoring (no evaluator ran)
|
|
64
|
+
|
|
65
|
+
HARD RULES:
|
|
66
|
+
- You ONLY judge. NEVER author, rewrite, or append a second version of the principle text.
|
|
67
|
+
- The reviewed source is the exact Scribe principle artifact — echo its id verbatim.
|
|
68
|
+
|
|
69
|
+
PROTOCOL:
|
|
70
|
+
1. Read the scribeArtifact (principleDraft: title/statement/rationale/applicability/antiPatterns, optional intentContract) and the diagnosis evidence summary.
|
|
71
|
+
2. Judge it against the REVIEW SCOPE above.
|
|
72
|
+
3. Produce a decision: approve_rollout (safe to activate as agent context), needs_revision (semantic issues the Scribe must fix), or reject (fundamental misalignment with evidence/Owner intent).
|
|
73
|
+
4. Provide a confidence score from 0.0 to 1.0.
|
|
74
|
+
5. needs_revision: requiredChanges MUST name concrete semantic fixes for the Scribe (never code changes).
|
|
75
|
+
6. List rollout-specific risks and pre/during-rollout safety checks.
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
COMPLETE EXAMPLE OUTPUT (follow this exact structure):
|
|
80
|
+
{"taskId":"task-123","sourceScribeArtifactId":"pi-art-scribe-001","review":{"decision":"approve_rollout","summary":"The principle faithfully captures the diagnosed failure and is safely scoped.","confidence":0.88,"requiredChanges":[],"rolloutRisks":["May trigger on adjacent shell tooling beyond the original evidence"],"safetyChecks":["Observe first activations for over-blocking","Owner can deactivate via Console if over-constraining"]},"sourceTrace":{"scribeArtifactId":"pi-art-scribe-001"},"risks":["Principle is derived from a single evidence session"],"generatedAt":"<current ISO-8601 timestamp>"}
|
|
81
|
+
|
|
82
|
+
CONSTRAINTS:
|
|
83
|
+
- Output ONLY valid JSON — no markdown, no explanatory text, no code fences, no prose before or after
|
|
84
|
+
- review.decision MUST be one of: approve_rollout, needs_revision, reject
|
|
85
|
+
- review.summary MUST be a non-empty string
|
|
86
|
+
- review.confidence MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)
|
|
87
|
+
- review.requiredChanges MUST be an array of strings (can be empty)
|
|
88
|
+
- review.rolloutRisks MUST be an array of strings (can be empty)
|
|
89
|
+
- review.safetyChecks MUST be an array of strings (can be empty)
|
|
90
|
+
- sourceScribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId (non-empty string)
|
|
91
|
+
- sourceTrace.scribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId
|
|
92
|
+
- sourceTrace.evaluatorArtifactId / sourceTrace.artificerArtifactId MUST be OMITTED — no evaluator or artificer exists on this channel
|
|
93
|
+
- sourceTrace.philosopherArtifactId / sourceTrace.dreamerArtifactId are optional — include only if available from the scribe artifact lineage
|
|
94
|
+
- risks MUST be an array of strings (can be empty if no risks identified)
|
|
95
|
+
- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)
|
|
96
|
+
`;
|
|
97
|
+
export const ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_CONTRACT_VERSION = 'rollout-reviewer-output-v1.prompt.v1.principle-semantic';
|
|
38
98
|
export class RolloutReviewerPromptBuilder {
|
|
39
99
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
40
100
|
buildPrompt(input) {
|
|
@@ -43,6 +103,26 @@ export class RolloutReviewerPromptBuilder {
|
|
|
43
103
|
// 'rollout-review' names the rollout reviewer's own schema (review.*),
|
|
44
104
|
// not the evaluator's evaluation.*/codeReview.* fields.
|
|
45
105
|
const languageDirective = buildLanguageDirective(input.outputLanguage, 'rollout-review');
|
|
106
|
+
// PRI-720 principle semantic mode: the reviewed source is the scribe
|
|
107
|
+
// principle artifact and the exam is the semantic governance split.
|
|
108
|
+
if (input.reviewMode === 'principle_semantic') {
|
|
109
|
+
if (input.sourceScribeArtifactId === undefined) {
|
|
110
|
+
throw new Error('principle_semantic review requires sourceScribeArtifactId');
|
|
111
|
+
}
|
|
112
|
+
const promptInput = {
|
|
113
|
+
taskId: input.taskId,
|
|
114
|
+
contextHash: input.contextHash,
|
|
115
|
+
reviewMode: 'principle_semantic',
|
|
116
|
+
sourceScribeArtifactId: input.sourceScribeArtifactId,
|
|
117
|
+
scribeArtifact: input.scribeArtifact,
|
|
118
|
+
promptContractVersion: ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_CONTRACT_VERSION,
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
message: JSON.stringify(promptInput),
|
|
122
|
+
promptInput,
|
|
123
|
+
systemPrompt: ROLLOUT_REVIEWER_PRINCIPLE_SEMANTIC_INSTRUCTION + languageDirective,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
46
126
|
const promptInput = {
|
|
47
127
|
taskId: input.taskId,
|
|
48
128
|
contextHash: input.contextHash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollout-reviewer-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/rollout-reviewer-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rollout-reviewer-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/rollout-reviewer-prompt-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AA6ClE,MAAM,CAAC,MAAM,qCAAqC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCpD,CAAC;AAEF,MAAM,CAAC,MAAM,wCAAwC,GAAG,sCAAsC,CAAC;AAE/F;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C9D,CAAC;AAEF,MAAM,CAAC,MAAM,oDAAoD,GAAG,yDAAyD,CAAC;AAE9H,MAAM,OAAO,4BAA4B;IACvC,qEAAqE;IACrE,WAAW,CAAC,KAAwC;QAClD,mEAAmE;QACnE,mEAAmE;QACnE,uEAAuE;QACvE,wDAAwD;QACxD,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;QAEzF,qEAAqE;QACrE,oEAAoE;QACpE,IAAI,KAAK,CAAC,UAAU,KAAK,oBAAoB,EAAE,CAAC;YAC9C,IAAI,KAAK,CAAC,sBAAsB,KAAK,SAAS,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,WAAW,GAA+B;gBAC9C,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,UAAU,EAAE,oBAAoB;gBAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;gBACpD,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,qBAAqB,EAAE,oDAAoD;aAC5E,CAAC;YACF,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;gBACpC,WAAW;gBACX,YAAY,EAAE,+CAA+C,GAAG,iBAAiB;aAClF,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAA+B;YAC9C,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,yBAAyB,EAAE,KAAK,CAAC,yBAAyB;YAC1D,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,qBAAqB,EAAE,wCAAwC;SAChE,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAE5C,sEAAsE;QACtE,iDAAiD;QACjD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,qCAAqC,GAAG,iBAAiB,EAAE,CAAC;IAC3G,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RuntimeStateManager } from '../store/runtime-state-manager.js';
|
|
2
2
|
import type { PDRuntimeAdapter } from '../runtime-protocol.js';
|
|
3
3
|
import type { StoreEventEmitter } from '../store/event-emitter.js';
|
|
4
|
-
import type { RolloutReviewerOutputV1, RolloutReviewerValidator } from './rollout-reviewer-output.js';
|
|
4
|
+
import type { RolloutReviewerOutputV1, RolloutReviewerValidator, RolloutReviewMode } from './rollout-reviewer-output.js';
|
|
5
5
|
import type { PIArtifactStore } from './pi-artifact.js';
|
|
6
6
|
import { type PDErrorCategory } from '../error-categories.js';
|
|
7
7
|
import { RunnerPhase } from '../runner/runner-phase.js';
|
|
@@ -91,6 +91,18 @@ export interface RolloutRevisionRoutingInput {
|
|
|
91
91
|
readonly sourceRolloutTaskId: string;
|
|
92
92
|
readonly sourceArtifactId: string;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* PRI-720: resolves the review contract mode for a rollout task.
|
|
96
|
+
*
|
|
97
|
+
* - code_tool_hook/skill channels and any explicit `full_chain` override run
|
|
98
|
+
* the legacy code-chain review (byte-compatible).
|
|
99
|
+
* - prompt/defer_archive chains in the STANDARD topology run the principle
|
|
100
|
+
* semantic review — recognized structurally by a scribe dependency and the
|
|
101
|
+
* ABSENCE of an evaluator dependency (the graph never creates one there).
|
|
102
|
+
* - A legacy (pre-PRI-720) prompt chain carries an evaluator dep; AC12 forbids
|
|
103
|
+
* reinterpreting in-flight chains, so it keeps the code-chain contract.
|
|
104
|
+
*/
|
|
105
|
+
export declare function resolveRolloutReviewMode(channel?: string, pipelineMode?: string, dependencyTaskKinds?: readonly string[]): RolloutReviewMode;
|
|
94
106
|
export declare class RolloutReviewerRunner {
|
|
95
107
|
private phase;
|
|
96
108
|
private readonly resolvedOptions;
|
|
@@ -112,13 +124,16 @@ export declare class RolloutReviewerRunner {
|
|
|
112
124
|
* BasePeerRunner, so it calls the shared helper directly and emits its own
|
|
113
125
|
* telemetry (no automatic runnerName prefix).
|
|
114
126
|
*
|
|
115
|
-
* The prompt asks the model to copy taskId /
|
|
116
|
-
* sourceTrace
|
|
117
|
-
* routinely truncated or altered on echo. Because a mismatch is
|
|
118
|
-
* output_invalid (a permanent error — no retry), a bad echo
|
|
119
|
-
* blocks the candidate from reaching the approval queue.
|
|
120
|
-
* runner-owned metadata (rc-6): the authoritative values come
|
|
121
|
-
* task record and the artifact store read in buildContext().
|
|
127
|
+
* The prompt asks the model to copy taskId / the mode-specific source
|
|
128
|
+
* artifact id / its sourceTrace counterpart verbatim, but long artifact IDs
|
|
129
|
+
* are routinely truncated or altered on echo. Because a mismatch is
|
|
130
|
+
* classified output_invalid (a permanent error — no retry), a bad echo
|
|
131
|
+
* permanently blocks the candidate from reaching the approval queue.
|
|
132
|
+
* Lineage is runner-owned metadata (rc-6): the authoritative values come
|
|
133
|
+
* from the task record and the artifact store read in buildContext().
|
|
134
|
+
* PRI-720: in principle semantic mode the reviewed source is the scribe
|
|
135
|
+
* artifact, so the reconciled fields are sourceScribeArtifactId /
|
|
136
|
+
* sourceTrace.scribeArtifactId.
|
|
122
137
|
*
|
|
123
138
|
* Whenever an echo differed (or sourceTrace was missing), a
|
|
124
139
|
* rollout_reviewer_lineage_echo_corrected telemetry event is emitted so
|
|
@@ -163,6 +178,17 @@ export declare class RolloutReviewerRunner {
|
|
|
163
178
|
/** 收集 lineage 上所有 source task id (BFS 沿 dependencyTaskIds, 有界深度)。 */
|
|
164
179
|
private static readonly LINEAGE_MAX_DEPTH;
|
|
165
180
|
private collectLineageSourceTaskIds;
|
|
181
|
+
/**
|
|
182
|
+
* PRI-720 C3: flip the exact reviewed scribe principle artifact to
|
|
183
|
+
* `validated` on semantic approve. Mirrors the evaluator's approved-path
|
|
184
|
+
* behavior (evaluator-runner.ts): idempotent updateValidationStatus;
|
|
185
|
+
* a `false` return is a deterministic store inconsistency surfaced via
|
|
186
|
+
* structured telemetry (the activation resolver then fails closed to
|
|
187
|
+
* needs_human_review); a store throw retries (the write is a required
|
|
188
|
+
* effect of the approve verdict — resume replays it, never a second LLM
|
|
189
|
+
* verdict).
|
|
190
|
+
*/
|
|
191
|
+
private validateReviewedScribeArtifactOrThrow;
|
|
166
192
|
/**
|
|
167
193
|
* P0-2 (外部复核): dispatch + 结果分类。
|
|
168
194
|
* 返回 true = governance transition 完成 (activated / already_activated /
|
|
@@ -186,7 +212,8 @@ export declare class RolloutReviewerRunner {
|
|
|
186
212
|
private handleRevisionRouting;
|
|
187
213
|
/**
|
|
188
214
|
* 解析修订目标任务 (只读遍历 dep 链):
|
|
189
|
-
* rollout → evaluator → artificer → scribe
|
|
215
|
+
* rollout → evaluator → artificer → scribe (code 链);
|
|
216
|
+
* rollout → scribe (PRI-720 principle 语义链: scribe 是直接依赖)。
|
|
190
217
|
* code_tool_hook → artificer; 其他 → scribe (走到底)。
|
|
191
218
|
*/
|
|
192
219
|
private resolveRevisionTarget;
|
|
@@ -224,6 +251,13 @@ export declare class RolloutReviewerRunner {
|
|
|
224
251
|
private applyDecisionEffects;
|
|
225
252
|
/** intent APPLIED 后才允许 terminal (P0 invariant 5)。写失败 fail loud。 */
|
|
226
253
|
private markCompletionIntentAppliedOrThrow;
|
|
254
|
+
/**
|
|
255
|
+
* PRI-720: dep-aware review mode for a hydrated task (resume/owner-override
|
|
256
|
+
* paths, where buildContext did not run). Structural rule — see
|
|
257
|
+
* resolveRolloutReviewMode: a scribe dep without an evaluator dep is a
|
|
258
|
+
* principle semantic chain; anything else keeps the code-chain contract.
|
|
259
|
+
*/
|
|
260
|
+
private resolveReviewModeForTask;
|
|
227
261
|
/**
|
|
228
262
|
* 入口恢复门: pending completion intent (同 epoch) 是 recovery authority。
|
|
229
263
|
* 返回非 null = 本次 run 以 resume 完成 (LLM 未被调用);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollout-reviewer-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/rollout-reviewer-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,8BAA8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