@principles/core 1.146.2 → 1.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +0 -1
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +0 -2
- package/dist/io.js.map +1 -1
- package/dist/principle-injector.d.ts +1 -1
- package/dist/principle-injector.d.ts.map +1 -1
- package/dist/runtime-v2/__tests__/architecture-regression.test.js +76 -1
- package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +5 -0
- package/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
- package/dist/runtime-v2/config/pd-config-agent-binding.d.ts +1 -0
- package/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
- package/dist/runtime-v2/config/pd-config-agent-binding.js +3 -0
- package/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
- package/dist/runtime-v2/config/pd-config-types.d.ts +2 -0
- package/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
- package/dist/runtime-v2/config/pd-config-types.js.map +1 -1
- package/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
- package/dist/runtime-v2/config/pd-config-validate.js +12 -0
- package/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
- package/dist/runtime-v2/context-payload.d.ts +4 -4
- package/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.d.ts +5 -0
- package/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.d.ts.map +1 -0
- package/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js +91 -0
- package/dist/runtime-v2/core-principles/__tests__/core-axiom-block.test.js.map +1 -0
- package/dist/runtime-v2/core-principles/core-axiom-block.d.ts +67 -0
- package/dist/runtime-v2/core-principles/core-axiom-block.d.ts.map +1 -0
- package/dist/runtime-v2/core-principles/core-axiom-block.js +76 -0
- package/dist/runtime-v2/core-principles/core-axiom-block.js.map +1 -0
- package/dist/runtime-v2/core-principles/index.d.ts +2 -0
- package/dist/runtime-v2/core-principles/index.d.ts.map +1 -1
- package/dist/runtime-v2/core-principles/index.js +1 -0
- package/dist/runtime-v2/core-principles/index.js.map +1 -1
- package/dist/runtime-v2/diagnostician/distiller-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician/distiller-prompt-builder.js +5 -12
- package/dist/runtime-v2/diagnostician/distiller-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +9 -13
- package/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +2 -0
- package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.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 +1 -0
- package/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/dist/runtime-v2/full-trace-contract.d.ts +3 -3
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js +13 -8
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-builder.test.js.map +1 -1
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js +4 -3
- package/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js.map +1 -1
- package/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +1 -1
- package/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/artificer-prompt-builder.js +1 -1
- package/dist/runtime-v2/internalization/artificer-runner.d.ts +3 -0
- package/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/artificer-runner.js +8 -0
- package/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts +19 -1
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.js +48 -8
- package/dist/runtime-v2/internalization/dreamer-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/dreamer-runner.d.ts +6 -0
- package/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/dreamer-runner.js +24 -1
- package/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-prompt-builder.js +2 -2
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts +3 -0
- package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/evaluator-runner.js +8 -0
- package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts +20 -1
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.js +47 -6
- package/dist/runtime-v2/internalization/philosopher-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/philosopher-runner.d.ts +5 -0
- package/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/philosopher-runner.js +14 -1
- package/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/rollout-reviewer-prompt-builder.js +2 -2
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +20 -6
- package/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js +31 -15
- package/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
- package/dist/runtime-v2/internalization/scribe-runner.d.ts +5 -0
- package/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/scribe-runner.js +14 -1
- package/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
- package/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts +1 -1
- package/dist/runtime-v2/internalization/trainer-prompt-builder.d.ts.map +1 -1
- package/dist/runtime-v2/internalization/trainer-prompt-builder.js +2 -2
- package/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/dist/runtime-v2/pain-signal-runtime-factory.js +1 -0
- package/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/dist/runtime-v2/runner/base-peer-runner.d.ts +4 -1
- package/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
- package/dist/runtime-v2/runner/base-peer-runner.js +12 -2
- package/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
- package/dist/runtime-v2/runner/peer-runner-types.d.ts +7 -0
- package/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/evolution-hook.d.ts +0 -70
- package/dist/evolution-hook.d.ts.map +0 -1
- package/dist/evolution-hook.js +0 -10
- package/dist/evolution-hook.js.map +0 -1
- package/dist/pain-flag-resolver.d.ts +0 -18
- package/dist/pain-flag-resolver.d.ts.map +0 -1
- package/dist/pain-flag-resolver.js +0 -21
- package/dist/pain-flag-resolver.js.map +0 -1
- package/dist/pain-recorder.d.ts +0 -38
- package/dist/pain-recorder.d.ts.map +0 -1
- package/dist/pain-recorder.js +0 -62
- package/dist/pain-recorder.js.map +0 -1
- package/dist/storage-adapter.d.ts +0 -59
- package/dist/storage-adapter.d.ts.map +0 -1
- package/dist/storage-adapter.js +0 -2
- package/dist/storage-adapter.js.map +0 -1
- package/dist/types/workspace-resolver.d.ts +0 -25
- package/dist/types/workspace-resolver.d.ts.map +0 -1
- package/dist/types/workspace-resolver.js +0 -10
- package/dist/types/workspace-resolver.js.map +0 -1
- package/dist/types.d.ts +0 -56
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -16
- package/dist/types.js.map +0 -1
|
@@ -17,11 +17,17 @@
|
|
|
17
17
|
* - NO extraSystemPrompt field — system prompt is agent profile's responsibility
|
|
18
18
|
* - buildPrompt() is a pure function — no DB calls, no side effects
|
|
19
19
|
*/
|
|
20
|
+
import type { CoreAxiomBlockOptions } from '../core-principles/core-axiom-block.js';
|
|
21
|
+
import type { OutputLanguage } from '../language-directive.js';
|
|
20
22
|
export interface PhilosopherPromptBuilderInput {
|
|
21
23
|
taskId: string;
|
|
22
24
|
contextHash: string;
|
|
23
25
|
dreamerArtifact: unknown;
|
|
24
26
|
sourceDreamerArtifactId: string;
|
|
27
|
+
/** Inject core axiom grounding section (default: false). */
|
|
28
|
+
coreGrounding?: boolean;
|
|
29
|
+
/** Output language for bilingual principle statements. */
|
|
30
|
+
outputLanguage?: OutputLanguage;
|
|
25
31
|
}
|
|
26
32
|
export interface PhilosopherPromptInput {
|
|
27
33
|
taskId: string;
|
|
@@ -34,8 +40,21 @@ export interface PhilosopherPromptBuildResult {
|
|
|
34
40
|
readonly message: string;
|
|
35
41
|
readonly promptInput: PhilosopherPromptInput;
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Build the Philosopher protocol instruction with optional core axiom grounding.
|
|
45
|
+
*
|
|
46
|
+
* When `coreGrounding` is true, a CORE AXIOMS section is injected so the
|
|
47
|
+
* Philosopher can check whether the new principle candidate duplicates or
|
|
48
|
+
* contradicts an existing core principle.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildPhilosopherProtocolInstruction(opts?: CoreAxiomBlockOptions): string;
|
|
38
51
|
export declare class PhilosopherPromptBuilder {
|
|
52
|
+
private readonly coreGrounding;
|
|
53
|
+
private readonly outputLanguage?;
|
|
54
|
+
constructor(opts?: {
|
|
55
|
+
coreGrounding?: boolean;
|
|
56
|
+
outputLanguage?: OutputLanguage;
|
|
57
|
+
});
|
|
39
58
|
buildPrompt(input: PhilosopherPromptBuilderInput): PhilosopherPromptBuildResult;
|
|
40
59
|
}
|
|
41
60
|
//# sourceMappingURL=philosopher-prompt-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"philosopher-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"philosopher-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;IAChC,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,GAAE,qBAA0B,GAC/B,MAAM,CAsCR;AAED,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAiB;gBAErC,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAO;IAKnF,WAAW,CAAC,KAAK,EAAE,6BAA6B,GAAG,4BAA4B;CAqBhF"}
|
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* PhilosopherPromptBuilder — transforms Philosopher context into a prompt for the LLM.
|
|
3
|
+
*
|
|
4
|
+
* PRI-107: The Philosopher runner previously sent only `{ taskId, contextHash, dreamerArtifact }`
|
|
5
|
+
* as inputPayload, giving the LLM no instructions about what to produce. This builder
|
|
6
|
+
* follows the DiagnosticianPromptBuilder pattern: it packages context data + an
|
|
7
|
+
* explicit instruction telling the LLM to produce PhilosopherOutputV1 JSON.
|
|
8
|
+
*
|
|
9
|
+
* ## Contract
|
|
10
|
+
*
|
|
11
|
+
* buildPrompt() takes PhilosopherPromptBuilderInput and returns a JSON string
|
|
12
|
+
* to be passed as `inputPayload` in StartRunInput.
|
|
13
|
+
*
|
|
14
|
+
* ## Constraints
|
|
15
|
+
*
|
|
16
|
+
* - Output is ONLY JSON — no markdown, no file ops, no tool calls
|
|
17
|
+
* - NO extraSystemPrompt field — system prompt is agent profile's responsibility
|
|
18
|
+
* - buildPrompt() is a pure function — no DB calls, no side effects
|
|
19
|
+
*/
|
|
20
|
+
import { buildCoreAxiomBlock } from '../core-principles/core-axiom-block.js';
|
|
21
|
+
/**
|
|
22
|
+
* Build the Philosopher protocol instruction with optional core axiom grounding.
|
|
23
|
+
*
|
|
24
|
+
* When `coreGrounding` is true, a CORE AXIOMS section is injected so the
|
|
25
|
+
* Philosopher can check whether the new principle candidate duplicates or
|
|
26
|
+
* contradicts an existing core principle.
|
|
27
|
+
*/
|
|
28
|
+
export function buildPhilosopherProtocolInstruction(opts = {}) {
|
|
29
|
+
const coreAxiomsBlock = buildCoreAxiomBlock(opts);
|
|
30
|
+
return `You are a Philosopher agent in a principle internalization pipeline. Your role is to distill a principle candidate from the Dreamer's alternative decision analysis.
|
|
2
31
|
|
|
3
32
|
PROTOCOL:
|
|
4
33
|
1. Review the dreamerArtifact to understand the alternative decisions proposed by the Dreamer
|
|
@@ -6,8 +35,7 @@ PROTOCOL:
|
|
|
6
35
|
3. Extract a principle candidate with title, rationale, scope, and confidence
|
|
7
36
|
4. Identify risks associated with applying this principle
|
|
8
37
|
5. The principle should be abstract and reusable, not tied to a specific instance
|
|
9
|
-
|
|
10
|
-
OUTPUT FORMAT (pure JSON, no markdown):
|
|
38
|
+
${coreAxiomsBlock}OUTPUT FORMAT (pure JSON, no markdown):
|
|
11
39
|
{
|
|
12
40
|
"taskId": "<from input>",
|
|
13
41
|
"sourceDreamerArtifactId": "<copy exactly from input.sourceDreamerArtifactId>",
|
|
@@ -31,17 +59,30 @@ CONSTRAINTS:
|
|
|
31
59
|
- principleCandidate.confidence MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)
|
|
32
60
|
- risks MUST be an array of strings (can be empty if no risks identified)
|
|
33
61
|
- sourceDreamerArtifactId MUST be copied exactly from input.sourceDreamerArtifactId (non-empty string)
|
|
34
|
-
- generatedAt MUST be
|
|
62
|
+
- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)
|
|
63
|
+
- If the CORE AXIOMS section is provided, check whether the new principle candidate duplicates or contradicts any existing core axiom. If it does, note this in the risks array
|
|
35
64
|
`;
|
|
65
|
+
}
|
|
36
66
|
export class PhilosopherPromptBuilder {
|
|
37
|
-
|
|
67
|
+
coreGrounding;
|
|
68
|
+
outputLanguage;
|
|
69
|
+
constructor(opts = {}) {
|
|
70
|
+
this.coreGrounding = opts.coreGrounding ?? false;
|
|
71
|
+
this.outputLanguage = opts.outputLanguage;
|
|
72
|
+
}
|
|
38
73
|
buildPrompt(input) {
|
|
74
|
+
const coreGrounding = input.coreGrounding ?? this.coreGrounding;
|
|
75
|
+
const outputLanguage = input.outputLanguage ?? this.outputLanguage;
|
|
76
|
+
const philosopherInstruction = buildPhilosopherProtocolInstruction({
|
|
77
|
+
coreGrounding,
|
|
78
|
+
outputLanguage,
|
|
79
|
+
});
|
|
39
80
|
const promptInput = {
|
|
40
81
|
taskId: input.taskId,
|
|
41
82
|
contextHash: input.contextHash,
|
|
42
83
|
dreamerArtifact: input.dreamerArtifact,
|
|
43
84
|
sourceDreamerArtifactId: input.sourceDreamerArtifactId,
|
|
44
|
-
philosopherInstruction
|
|
85
|
+
philosopherInstruction,
|
|
45
86
|
};
|
|
46
87
|
const message = JSON.stringify(promptInput);
|
|
47
88
|
return { message, promptInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"philosopher-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-prompt-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"philosopher-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AA4B7E;;;;;;GAMG;AACH,MAAM,UAAU,mCAAmC,CACjD,OAA8B,EAAE;IAEhC,MAAM,eAAe,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAElD,OAAO;;;;;;;;EAQP,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BhB,CAAC;AACF,CAAC;AAED,MAAM,OAAO,wBAAwB;IAClB,aAAa,CAAU;IACvB,cAAc,CAAkB;IAEjD,YAAY,OAAqE,EAAE;QACjF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED,WAAW,CAAC,KAAoC;QAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC;QAChE,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC;QAEnE,MAAM,sBAAsB,GAAG,mCAAmC,CAAC;YACjE,aAAa;YACb,cAAc;SACf,CAAC,CAAC;QAEH,MAAM,WAAW,GAA2B;YAC1C,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;YACtD,sBAAsB;SACvB,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAE5C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -58,6 +58,8 @@ export interface ResolvedPhilosopherRunnerOptions {
|
|
|
58
58
|
readonly owner: string;
|
|
59
59
|
readonly runtimeKind: string;
|
|
60
60
|
readonly agentId: string;
|
|
61
|
+
/** Whether to inject CORE_PRINCIPLES into the philosopher prompt (default: true). */
|
|
62
|
+
readonly coreGrounding: boolean;
|
|
61
63
|
}
|
|
62
64
|
export declare const DEFAULT_PHILOSOPHER_RUNNER_OPTIONS: Readonly<Omit<ResolvedPhilosopherRunnerOptions, 'owner' | 'runtimeKind'>>;
|
|
63
65
|
export declare function resolvePhilosopherRunnerOptions(options: PhilosopherRunnerOptions): ResolvedPhilosopherRunnerOptions;
|
|
@@ -76,6 +78,9 @@ export declare class PhilosopherRunner extends BasePeerRunner<PhilosopherContext
|
|
|
76
78
|
* Re-inject taskId if stripped by stripLineageFields (PRI-272 / ERR-008).
|
|
77
79
|
* Only fill when absent via Object.hasOwn — present-but-falsy values
|
|
78
80
|
* must reach validation and fail loud (Runtime Contract Rule 3).
|
|
81
|
+
*
|
|
82
|
+
* Also overrides generatedAt with the actual current timestamp (LLM may
|
|
83
|
+
* echo the prompt's example date).
|
|
79
84
|
*/
|
|
80
85
|
protected postFetchTransform(taskId: string, untrustedOutput: unknown): void;
|
|
81
86
|
protected emitSuccessTelemetry(taskId: string, output: PhilosopherOutputV1): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"philosopher-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAkB,KAAK,eAAe,EAAqB,MAAM,wBAAwB,CAAC;AAIjG,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AAIxC,yFAAyF;AACzF,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAID,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,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+8,7 @@ export const DEFAULT_PHILOSOPHER_RUNNER_OPTIONS = {
|
|
|
8
8
|
timeoutMs: 300_000,
|
|
9
9
|
defaultMaxAttempts: 3,
|
|
10
10
|
agentId: 'philosopher',
|
|
11
|
+
coreGrounding: true,
|
|
11
12
|
};
|
|
12
13
|
export function resolvePhilosopherRunnerOptions(options) {
|
|
13
14
|
return {
|
|
@@ -17,6 +18,7 @@ export function resolvePhilosopherRunnerOptions(options) {
|
|
|
17
18
|
owner: options.owner,
|
|
18
19
|
runtimeKind: options.runtimeKind,
|
|
19
20
|
agentId: options.agentId ?? DEFAULT_PHILOSOPHER_RUNNER_OPTIONS.agentId,
|
|
21
|
+
coreGrounding: options.coreGrounding ?? DEFAULT_PHILOSOPHER_RUNNER_OPTIONS.coreGrounding,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
// ── PhilosopherRunner ────────────────────────────────────────────────────────
|
|
@@ -74,6 +76,7 @@ export class PhilosopherRunner extends BasePeerRunner {
|
|
|
74
76
|
throw new PDRuntimeError('input_invalid', 'Dreamer dependency artifact not found');
|
|
75
77
|
}
|
|
76
78
|
async invokeRuntime(taskId, context) {
|
|
79
|
+
const { coreGrounding } = this.resolvedOptions;
|
|
77
80
|
let parsedDreamerArtifact;
|
|
78
81
|
try {
|
|
79
82
|
parsedDreamerArtifact = JSON.parse(context.dreamerArtifact);
|
|
@@ -81,12 +84,13 @@ export class PhilosopherRunner extends BasePeerRunner {
|
|
|
81
84
|
catch {
|
|
82
85
|
parsedDreamerArtifact = context.dreamerArtifact;
|
|
83
86
|
}
|
|
84
|
-
const builder = new PhilosopherPromptBuilder();
|
|
87
|
+
const builder = new PhilosopherPromptBuilder({ coreGrounding });
|
|
85
88
|
const { message } = builder.buildPrompt({
|
|
86
89
|
taskId,
|
|
87
90
|
contextHash: context.contextHash,
|
|
88
91
|
dreamerArtifact: parsedDreamerArtifact,
|
|
89
92
|
sourceDreamerArtifactId: context.sourceDreamerArtifactId,
|
|
93
|
+
coreGrounding,
|
|
90
94
|
});
|
|
91
95
|
return this.runtimeAdapter.startRun({
|
|
92
96
|
agentSpec: { agentId: this.resolvedOptions.agentId, schemaVersion: 'v1' },
|
|
@@ -222,10 +226,19 @@ export class PhilosopherRunner extends BasePeerRunner {
|
|
|
222
226
|
* Re-inject taskId if stripped by stripLineageFields (PRI-272 / ERR-008).
|
|
223
227
|
* Only fill when absent via Object.hasOwn — present-but-falsy values
|
|
224
228
|
* must reach validation and fail loud (Runtime Contract Rule 3).
|
|
229
|
+
*
|
|
230
|
+
* Also overrides generatedAt with the actual current timestamp (LLM may
|
|
231
|
+
* echo the prompt's example date).
|
|
225
232
|
*/
|
|
226
233
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
227
234
|
postFetchTransform(taskId, untrustedOutput) {
|
|
228
235
|
injectRunnerLineageIfAbsent(untrustedOutput, 'taskId', taskId);
|
|
236
|
+
if (typeof untrustedOutput === 'object' && untrustedOutput !== null && !Array.isArray(untrustedOutput)) {
|
|
237
|
+
// Override generatedAt with actual timestamp — LLM may echo prompt example date
|
|
238
|
+
if (Object.hasOwn(untrustedOutput, 'generatedAt')) {
|
|
239
|
+
Reflect.set(untrustedOutput, 'generatedAt', new Date().toISOString());
|
|
240
|
+
}
|
|
241
|
+
}
|
|
229
242
|
}
|
|
230
243
|
emitSuccessTelemetry(taskId, output) {
|
|
231
244
|
this.emitEvent('principle_candidate_generated', taskId, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"philosopher-runner.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/philosopher-runner.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,cAAc,EAAwB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,C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,EAAE;YACtD,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,KAAK;YAC/C,UAAU,EAAE,MAAM,CAAC,kBAAkB,CAAC,UAAU;SACjD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -16,7 +16,7 @@ export interface RolloutReviewerPromptBuildResult {
|
|
|
16
16
|
readonly message: string;
|
|
17
17
|
readonly promptInput: RolloutReviewerPromptInput;
|
|
18
18
|
}
|
|
19
|
-
export declare const ROLLOUT_REVIEWER_PROTOCOL_INSTRUCTION = "You are a Rollout Reviewer agent in a principle internalization pipeline. Your role is to review the Evaluator's assessment and produce a rollout review decision with safety checks and risk analysis.\n\nPROTOCOL:\n1. Review the evaluatorArtifact to understand the evaluation decision, score, and feedback\n2. Assess whether the evaluated plan is safe to proceed with rollout\n3. Produce a decision: approve_rollout (safe to proceed), needs_revision (issues found but salvageable), or reject (fundamental safety or quality concerns)\n4. Provide a confidence score from 0.0 to 1.0 reflecting your assessment certainty\n5. List specific required changes if any\n6. Identify rollout-specific risks\n7. List safety checks that should be performed before/during rollout\n8. Preserve the lineage trace from evaluator, artificer, scribe, philosopher, and dreamer artifacts\n9. Identify risks associated with this review\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 (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceEvaluatorArtifactId\":\"pi-art-evaluator-001\",\"review\":{\"decision\":\"approve_rollout\",\"summary\":\"The evaluation is thorough and the plan is safe to proceed with rollout.\",\"confidence\":0.9,\"requiredChanges\":[],\"rolloutRisks\":[\"Feature flag configuration may need adjustment\"],\"safetyChecks\":[\"Verify feature flag is properly configured\",\"Monitor error rates for 24h post-deploy\"]},\"sourceTrace\":{\"evaluatorArtifactId\":\"pi-art-evaluator-001\"},\"risks\":[\"Rollback plan should be tested before deployment\"],\"generatedAt\":\"
|
|
19
|
+
export declare const ROLLOUT_REVIEWER_PROTOCOL_INSTRUCTION = "You are a Rollout Reviewer agent in a principle internalization pipeline. Your role is to review the Evaluator's assessment and produce a rollout review decision with safety checks and risk analysis.\n\nPROTOCOL:\n1. Review the evaluatorArtifact to understand the evaluation decision, score, and feedback\n2. Assess whether the evaluated plan is safe to proceed with rollout\n3. Produce a decision: approve_rollout (safe to proceed), needs_revision (issues found but salvageable), or reject (fundamental safety or quality concerns)\n4. Provide a confidence score from 0.0 to 1.0 reflecting your assessment certainty\n5. List specific required changes if any\n6. Identify rollout-specific risks\n7. List safety checks that should be performed before/during rollout\n8. Preserve the lineage trace from evaluator, artificer, scribe, philosopher, and dreamer artifacts\n9. Identify risks associated with this review\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 (follow this exact structure):\n{\"taskId\":\"task-123\",\"sourceEvaluatorArtifactId\":\"pi-art-evaluator-001\",\"review\":{\"decision\":\"approve_rollout\",\"summary\":\"The evaluation is thorough and the plan is safe to proceed with rollout.\",\"confidence\":0.9,\"requiredChanges\":[],\"rolloutRisks\":[\"Feature flag configuration may need adjustment\"],\"safetyChecks\":[\"Verify feature flag is properly configured\",\"Monitor error rates for 24h post-deploy\"]},\"sourceTrace\":{\"evaluatorArtifactId\":\"pi-art-evaluator-001\"},\"risks\":[\"Rollback plan should be tested before deployment\"],\"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- review.decision MUST be one of: approve_rollout, needs_revision, reject\n- review.summary MUST be a non-empty string\n- review.confidence MUST be a number between 0.0 and 1.0 (NOT a string, NOT a percentage)\n- review.requiredChanges MUST be an array of strings (can be empty)\n- review.rolloutRisks MUST be an array of strings (can be empty)\n- review.safetyChecks MUST be an array of strings (can be empty)\n- sourceEvaluatorArtifactId MUST be copied exactly from input.sourceEvaluatorArtifactId (non-empty string)\n- sourceTrace.evaluatorArtifactId MUST be copied exactly from input.sourceEvaluatorArtifactId\n- sourceTrace.artificerArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.scribeArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from evaluator artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from evaluator 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";
|
|
20
20
|
export declare const ROLLOUT_REVIEWER_PROMPT_CONTRACT_VERSION = "rollout-reviewer-output-v1.prompt.v1";
|
|
21
21
|
export declare class RolloutReviewerPromptBuilder {
|
|
22
22
|
buildPrompt(input: RolloutReviewerPromptBuilderInput): RolloutReviewerPromptBuildResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollout-reviewer-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/rollout-reviewer-prompt-builder.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;CAClD;AAED,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"rollout-reviewer-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/rollout-reviewer-prompt-builder.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;CAClD;AAED,eAAO,MAAM,qCAAqC,+lGAkCjD,CAAC;AAEF,eAAO,MAAM,wCAAwC,yCAAyC,CAAC;AAE/F,qBAAa,4BAA4B;IAEvC,WAAW,CAAC,KAAK,EAAE,iCAAiC,GAAG,gCAAgC;CAcxF"}
|
|
@@ -14,7 +14,7 @@ PROTOCOL:
|
|
|
14
14
|
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.
|
|
15
15
|
|
|
16
16
|
COMPLETE EXAMPLE OUTPUT (follow this exact structure):
|
|
17
|
-
{"taskId":"task-123","sourceEvaluatorArtifactId":"pi-art-evaluator-001","review":{"decision":"approve_rollout","summary":"The evaluation is thorough and the plan is safe to proceed with rollout.","confidence":0.9,"requiredChanges":[],"rolloutRisks":["Feature flag configuration may need adjustment"],"safetyChecks":["Verify feature flag is properly configured","Monitor error rates for 24h post-deploy"]},"sourceTrace":{"evaluatorArtifactId":"pi-art-evaluator-001"},"risks":["Rollback plan should be tested before deployment"],"generatedAt":"
|
|
17
|
+
{"taskId":"task-123","sourceEvaluatorArtifactId":"pi-art-evaluator-001","review":{"decision":"approve_rollout","summary":"The evaluation is thorough and the plan is safe to proceed with rollout.","confidence":0.9,"requiredChanges":[],"rolloutRisks":["Feature flag configuration may need adjustment"],"safetyChecks":["Verify feature flag is properly configured","Monitor error rates for 24h post-deploy"]},"sourceTrace":{"evaluatorArtifactId":"pi-art-evaluator-001"},"risks":["Rollback plan should be tested before deployment"],"generatedAt":"<current ISO-8601 timestamp>"}
|
|
18
18
|
|
|
19
19
|
CONSTRAINTS:
|
|
20
20
|
- Output ONLY valid JSON — no markdown, no explanatory text, no code fences, no prose before or after
|
|
@@ -31,7 +31,7 @@ CONSTRAINTS:
|
|
|
31
31
|
- sourceTrace.philosopherArtifactId is optional — include only if available from evaluator artifact
|
|
32
32
|
- sourceTrace.dreamerArtifactId is optional — include only if available from evaluator artifact
|
|
33
33
|
- risks MUST be an array of strings (can be empty if no risks identified)
|
|
34
|
-
- generatedAt MUST be
|
|
34
|
+
- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)
|
|
35
35
|
`;
|
|
36
36
|
export const ROLLOUT_REVIEWER_PROMPT_CONTRACT_VERSION = 'rollout-reviewer-output-v1.prompt.v1';
|
|
37
37
|
export class RolloutReviewerPromptBuilder {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CoreAxiomBlockOptions } from '../core-principles/core-axiom-block.js';
|
|
1
2
|
import type { OutputLanguage } from '../language-directive.js';
|
|
2
3
|
export interface ScribePromptBuilderInput {
|
|
3
4
|
taskId: string;
|
|
@@ -6,6 +7,8 @@ export interface ScribePromptBuilderInput {
|
|
|
6
7
|
philosopherArtifact: unknown;
|
|
7
8
|
/** Owner's preferred language for principle generation (PRI-336). */
|
|
8
9
|
outputLanguage?: OutputLanguage;
|
|
10
|
+
/** Inject core axiom grounding section (default: false). */
|
|
11
|
+
coreGrounding?: boolean;
|
|
9
12
|
}
|
|
10
13
|
export interface ScribePromptInput {
|
|
11
14
|
taskId: string;
|
|
@@ -19,15 +22,26 @@ export interface ScribePromptBuildResult {
|
|
|
19
22
|
readonly message: string;
|
|
20
23
|
readonly promptInput: ScribePromptInput;
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Build the Scribe protocol instruction with optional core axiom grounding.
|
|
27
|
+
*
|
|
28
|
+
* When `coreGrounding` is true, a CORE AXIOMS section is injected so the
|
|
29
|
+
* Scribe can ensure the formal principle draft is consistent with the
|
|
30
|
+
* existing core principle framework.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildScribeProtocolInstruction(opts?: CoreAxiomBlockOptions & {
|
|
33
|
+
outputLanguage?: OutputLanguage;
|
|
34
|
+
}): string;
|
|
23
35
|
export declare const SCRIBE_PROMPT_CONTRACT_VERSION = "scribe-output-v1.prompt.v1";
|
|
24
36
|
export declare class ScribePromptBuilder {
|
|
37
|
+
private readonly coreGrounding;
|
|
38
|
+
private readonly outputLanguage?;
|
|
39
|
+
constructor(opts?: {
|
|
40
|
+
coreGrounding?: boolean;
|
|
41
|
+
outputLanguage?: OutputLanguage;
|
|
42
|
+
});
|
|
25
43
|
/**
|
|
26
|
-
* Build a scribe prompt with optional language directive (PRI-336).
|
|
27
|
-
*
|
|
28
|
-
* When `input.outputLanguage` is provided, a language directive is appended
|
|
29
|
-
* to the scribe instruction telling the LLM to produce human-readable
|
|
30
|
-
* principle fields in the owner's preferred language.
|
|
44
|
+
* Build a scribe prompt with optional core axiom grounding and language directive (PRI-336).
|
|
31
45
|
*/
|
|
32
46
|
buildPrompt(input: ScribePromptBuilderInput): ScribePromptBuildResult;
|
|
33
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-prompt-builder.ts"],"names":[],"mappings":"
|
|
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;AAG/D,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B,EAAE,MAAM,CAAC;IACpC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,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,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,GAAE,qBAAqB,GAAG;IAAE,cAAc,CAAC,EAAE,cAAc,CAAA;CAAO,GACrE,MAAM,CAgDR;AAED,eAAO,MAAM,8BAA8B,+BAA+B,CAAC;AAE3E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAiB;gBAErC,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAO;IAKnF;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,wBAAwB,GAAG,uBAAuB;CAsBtE"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
import { buildCoreAxiomBlock } from '../core-principles/core-axiom-block.js';
|
|
1
2
|
import { buildLanguageDirective } from '../language-directive.js';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Build the Scribe protocol instruction with optional core axiom grounding.
|
|
5
|
+
*
|
|
6
|
+
* When `coreGrounding` is true, a CORE AXIOMS section is injected so the
|
|
7
|
+
* Scribe can ensure the formal principle draft is consistent with the
|
|
8
|
+
* existing core principle framework.
|
|
9
|
+
*/
|
|
10
|
+
export function buildScribeProtocolInstruction(opts = {}) {
|
|
11
|
+
const { outputLanguage, ...axiomOpts } = opts;
|
|
12
|
+
const coreAxiomsBlock = buildCoreAxiomBlock({ ...axiomOpts, outputLanguage });
|
|
13
|
+
const languageDirective = buildLanguageDirective(outputLanguage);
|
|
14
|
+
return `You are a Scribe agent in a principle internalization pipeline. Your role is to distill the Philosopher's analysis into a formal, implementable principle draft.
|
|
3
15
|
|
|
4
16
|
PROTOCOL:
|
|
5
17
|
1. Review the philosopherArtifact to understand the philosophical thesis and principle candidate
|
|
@@ -7,8 +19,7 @@ PROTOCOL:
|
|
|
7
19
|
3. Preserve the lineage trace from dreamer and philosopher artifacts
|
|
8
20
|
4. Identify risks associated with applying this principle
|
|
9
21
|
5. The principle draft should be concrete enough to guide implementation, not just philosophical
|
|
10
|
-
|
|
11
|
-
OUTPUT FORMAT (pure JSON, no markdown):
|
|
22
|
+
${coreAxiomsBlock}OUTPUT FORMAT (pure JSON, no markdown):
|
|
12
23
|
{
|
|
13
24
|
"taskId": "<from input>",
|
|
14
25
|
"sourcePhilosopherArtifactId": "<copy exactly from input.sourcePhilosopherArtifactId>",
|
|
@@ -40,23 +51,28 @@ CONSTRAINTS:
|
|
|
40
51
|
- sourceTrace.philosopherArtifactId MUST be copied exactly from input.sourcePhilosopherArtifactId
|
|
41
52
|
- sourceTrace.dreamerArtifactId is optional — include only if available from philosopher artifact
|
|
42
53
|
- risks MUST be an array of strings (can be empty if no risks identified)
|
|
43
|
-
- generatedAt MUST be
|
|
44
|
-
|
|
54
|
+
- generatedAt MUST be the current ISO-8601 timestamp (use the actual current time, NOT a placeholder)
|
|
55
|
+
- If the CORE AXIOMS section is provided, ensure the principle draft does not duplicate or contradict any existing core axiom. If overlap exists, note it in risks
|
|
56
|
+
${languageDirective}`;
|
|
57
|
+
}
|
|
45
58
|
export const SCRIBE_PROMPT_CONTRACT_VERSION = 'scribe-output-v1.prompt.v1';
|
|
46
59
|
export class ScribePromptBuilder {
|
|
60
|
+
coreGrounding;
|
|
61
|
+
outputLanguage;
|
|
62
|
+
constructor(opts = {}) {
|
|
63
|
+
this.coreGrounding = opts.coreGrounding ?? false;
|
|
64
|
+
this.outputLanguage = opts.outputLanguage;
|
|
65
|
+
}
|
|
47
66
|
/**
|
|
48
|
-
* Build a scribe prompt with optional language directive (PRI-336).
|
|
49
|
-
*
|
|
50
|
-
* When `input.outputLanguage` is provided, a language directive is appended
|
|
51
|
-
* to the scribe instruction telling the LLM to produce human-readable
|
|
52
|
-
* principle fields in the owner's preferred language.
|
|
67
|
+
* Build a scribe prompt with optional core axiom grounding and language directive (PRI-336).
|
|
53
68
|
*/
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
55
69
|
buildPrompt(input) {
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
const coreGrounding = input.coreGrounding ?? this.coreGrounding;
|
|
71
|
+
const outputLanguage = input.outputLanguage ?? this.outputLanguage;
|
|
72
|
+
const scribeInstruction = buildScribeProtocolInstruction({
|
|
73
|
+
coreGrounding,
|
|
74
|
+
outputLanguage,
|
|
75
|
+
});
|
|
60
76
|
const promptInput = {
|
|
61
77
|
taskId: input.taskId,
|
|
62
78
|
contextHash: input.contextHash,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-prompt-builder.ts"],"names":[],"mappings":"
|
|
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;AA2BlE;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC5C,OAAoE,EAAE;IAEtE,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;IAC9C,MAAM,eAAe,GAAG,mBAAmB,CAAC,EAAE,GAAG,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;IAC9E,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAEjE,OAAO;;;;;;;;EAQP,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCf,iBAAiB,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,4BAA4B,CAAC;AAE3E,MAAM,OAAO,mBAAmB;IACb,aAAa,CAAU;IACvB,cAAc,CAAkB;IAEjD,YAAY,OAAqE,EAAE;QACjF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,KAA+B;QACzC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC;QAChE,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC;QAEnE,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;YACvD,aAAa;YACb,cAAc;SACf,CAAC,CAAC;QAEH,MAAM,WAAW,GAAsB;YACrC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,2BAA2B,EAAE,KAAK,CAAC,2BAA2B;YAC9D,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;YAC9C,iBAAiB;YACjB,qBAAqB,EAAE,8BAA8B;SACtD,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAE5C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -61,6 +61,8 @@ export interface ResolvedScribeRunnerOptions {
|
|
|
61
61
|
readonly agentId: string;
|
|
62
62
|
/** Owner's preferred language for principle generation (PRI-336). Undefined = no directive. */
|
|
63
63
|
readonly outputLanguage?: OutputLanguage;
|
|
64
|
+
/** Whether to inject CORE_PRINCIPLES into the scribe prompt (default: true). */
|
|
65
|
+
readonly coreGrounding: boolean;
|
|
64
66
|
}
|
|
65
67
|
export declare const DEFAULT_SCRIBE_RUNNER_OPTIONS: Readonly<Omit<ResolvedScribeRunnerOptions, 'owner' | 'runtimeKind'>>;
|
|
66
68
|
export declare function resolveScribeRunnerOptions(options: ScribeRunnerOptions): ResolvedScribeRunnerOptions;
|
|
@@ -79,6 +81,9 @@ export declare class ScribeRunner extends BasePeerRunner<ScribeContext, ScribeOu
|
|
|
79
81
|
* Re-inject taskId if stripped by stripLineageFields (PRI-272 / ERR-008).
|
|
80
82
|
* Only fill when absent via Object.hasOwn — present-but-falsy values
|
|
81
83
|
* must reach validation and fail loud (Runtime Contract Rule 3).
|
|
84
|
+
*
|
|
85
|
+
* Also overrides generatedAt with the actual current timestamp (LLM may
|
|
86
|
+
* echo the prompt's example date).
|
|
82
87
|
*/
|
|
83
88
|
protected postFetchTransform(taskId: string, untrustedOutput: unknown): void;
|
|
84
89
|
protected emitSuccessTelemetry(taskId: string, output: ScribeOutputV1): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAkB,KAAK,eAAe,EAAqB,MAAM,wBAAwB,CAAC;AAIjG,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,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,oFAAoF;AACpF,UAAU,aAAa;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;CAC9C;AAID,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,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
10
|
agentId: 'scribe',
|
|
11
|
+
coreGrounding: true,
|
|
11
12
|
};
|
|
12
13
|
export function resolveScribeRunnerOptions(options) {
|
|
13
14
|
return {
|
|
@@ -18,6 +19,7 @@ export function resolveScribeRunnerOptions(options) {
|
|
|
18
19
|
runtimeKind: options.runtimeKind,
|
|
19
20
|
agentId: options.agentId ?? DEFAULT_SCRIBE_RUNNER_OPTIONS.agentId,
|
|
20
21
|
outputLanguage: options.outputLanguage,
|
|
22
|
+
coreGrounding: options.coreGrounding ?? DEFAULT_SCRIBE_RUNNER_OPTIONS.coreGrounding,
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
// ── ScribeRunner ─────────────────────────────────────────────────────────────
|
|
@@ -77,6 +79,7 @@ export class ScribeRunner extends BasePeerRunner {
|
|
|
77
79
|
throw new PDRuntimeError('input_invalid', 'Philosopher dependency artifact not found');
|
|
78
80
|
}
|
|
79
81
|
async invokeRuntime(taskId, context) {
|
|
82
|
+
const { coreGrounding } = this.resolvedOptions;
|
|
80
83
|
let parsedPhilosopherArtifact;
|
|
81
84
|
try {
|
|
82
85
|
parsedPhilosopherArtifact = JSON.parse(context.philosopherArtifact);
|
|
@@ -84,13 +87,14 @@ export class ScribeRunner extends BasePeerRunner {
|
|
|
84
87
|
catch {
|
|
85
88
|
parsedPhilosopherArtifact = context.philosopherArtifact;
|
|
86
89
|
}
|
|
87
|
-
const builder = new ScribePromptBuilder();
|
|
90
|
+
const builder = new ScribePromptBuilder({ coreGrounding, outputLanguage: this.resolvedOptions.outputLanguage });
|
|
88
91
|
const { message } = builder.buildPrompt({
|
|
89
92
|
taskId,
|
|
90
93
|
contextHash: context.contextHash,
|
|
91
94
|
philosopherArtifact: parsedPhilosopherArtifact,
|
|
92
95
|
sourcePhilosopherArtifactId: context.sourcePhilosopherArtifactId,
|
|
93
96
|
outputLanguage: this.resolvedOptions.outputLanguage,
|
|
97
|
+
coreGrounding,
|
|
94
98
|
});
|
|
95
99
|
return this.runtimeAdapter.startRun({
|
|
96
100
|
agentSpec: { agentId: this.resolvedOptions.agentId, schemaVersion: 'v1' },
|
|
@@ -226,10 +230,19 @@ export class ScribeRunner extends BasePeerRunner {
|
|
|
226
230
|
* Re-inject taskId if stripped by stripLineageFields (PRI-272 / ERR-008).
|
|
227
231
|
* Only fill when absent via Object.hasOwn — present-but-falsy values
|
|
228
232
|
* must reach validation and fail loud (Runtime Contract Rule 3).
|
|
233
|
+
*
|
|
234
|
+
* Also overrides generatedAt with the actual current timestamp (LLM may
|
|
235
|
+
* echo the prompt's example date).
|
|
229
236
|
*/
|
|
230
237
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
231
238
|
postFetchTransform(taskId, untrustedOutput) {
|
|
232
239
|
injectRunnerLineageIfAbsent(untrustedOutput, 'taskId', taskId);
|
|
240
|
+
if (typeof untrustedOutput === 'object' && untrustedOutput !== null && !Array.isArray(untrustedOutput)) {
|
|
241
|
+
// Override generatedAt with actual timestamp — LLM may echo prompt example date
|
|
242
|
+
if (Object.hasOwn(untrustedOutput, 'generatedAt')) {
|
|
243
|
+
Reflect.set(untrustedOutput, 'generatedAt', new Date().toISOString());
|
|
244
|
+
}
|
|
245
|
+
}
|
|
233
246
|
}
|
|
234
247
|
emitSuccessTelemetry(taskId, output) {
|
|
235
248
|
this.emitEvent('principle_draft_generated', taskId, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scribe-runner.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/scribe-runner.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,cAAc,EAAwB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
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