@principles/host-runtime 0.3.9 → 0.3.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.
|
@@ -281,6 +281,8 @@ export async function runInternalizationConsumerCycle(workspaceDir, ports) {
|
|
|
281
281
|
baseUrl: runtimeConfigResult.baseUrl,
|
|
282
282
|
workspace: workspaceDir,
|
|
283
283
|
totalBudgetMs: runtimeConfigResult.timeoutMs,
|
|
284
|
+
// PRI-633: profile systemPrompt rides as the append layer.
|
|
285
|
+
...(runtimeConfigResult.systemPrompt ? { systemPrompt: runtimeConfigResult.systemPrompt } : {}),
|
|
284
286
|
}, {
|
|
285
287
|
artifactReader: {
|
|
286
288
|
// Explicit adapter: PIArtifactRecord → PdL2ArtifactReader. The store returns
|
|
@@ -307,6 +309,8 @@ export async function runInternalizationConsumerCycle(workspaceDir, ports) {
|
|
|
307
309
|
timeoutMs: runtimeConfigResult.timeoutMs,
|
|
308
310
|
baseUrl: runtimeConfigResult.baseUrl,
|
|
309
311
|
workspace: workspaceDir,
|
|
312
|
+
// PRI-633: profile systemPrompt rides as the append layer.
|
|
313
|
+
...(runtimeConfigResult.systemPrompt ? { systemPrompt: runtimeConfigResult.systemPrompt } : {}),
|
|
310
314
|
});
|
|
311
315
|
}
|
|
312
316
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* dedupes by `${artifactId}::${channel}`; reopen idempotency is owned by
|
|
15
15
|
* orchestrator.reopenTaskForRevision.
|
|
16
16
|
*/
|
|
17
|
-
import { ActivationDispatcher, PromptWriter, DeferArchiveWriter, RuleHostWriter, SqliteConnection, SqliteActivationStateStore, SqliteApprovalQueueStore, SqlitePIArtifactStore, createProductionGateDeps, createPITaskDiagnosticJson, computeFeatureFlagsFromConfig, isFeatureEnabled, } from '@principles/core/runtime-v2';
|
|
17
|
+
import { ActivationDispatcher, PromptWriter, DeferArchiveWriter, RuleHostWriter, SqliteConnection, SqliteActivationStateStore, SqliteApprovalQueueStore, SqlitePIArtifactStore, createProductionGateDeps, createPITaskDiagnosticJson, artificerRepairTaskId, computeFeatureFlagsFromConfig, isFeatureEnabled, } from '@principles/core/runtime-v2';
|
|
18
18
|
import { loadPdConfigForPlugin } from './pd-config.js';
|
|
19
19
|
function normalizeDecision(decision) {
|
|
20
20
|
if (decision.decision === 'activated') {
|
|
@@ -116,10 +116,21 @@ export function createEvaluatorRepairDeps(workspaceDir, stateManager, logger) {
|
|
|
116
116
|
seedArtificerRepairTask: async (params) => {
|
|
117
117
|
// P0-4: 确定性 revision identity — evaluatorTaskId + iteration 唯一定位
|
|
118
118
|
// 一个逻辑 repair 任务; 重放 (consumer 重复周期 / crash 恢复) reuse 而非再建。
|
|
119
|
-
|
|
119
|
+
// PRI-718: id 约定收敛到 pitask-metadata 的单一 owner。
|
|
120
|
+
const repairTaskId = artificerRepairTaskId(params.repairPayload.sourceEvaluatorTaskId, params.repairPayload.repairIteration);
|
|
120
121
|
const existing = await stateManager.getTask(repairTaskId);
|
|
121
122
|
if (existing) {
|
|
122
|
-
|
|
123
|
+
// PRI-718 (revise ≠ resume): a TERMINAL repair round is finished
|
|
124
|
+
// corrective work, not a vehicle for new corrective work. Returning
|
|
125
|
+
// it here made the evaluator re-run against a superseded artifact
|
|
126
|
+
// forever (EP002-R2: same-artifact score oscillation, one LLM call
|
|
127
|
+
// per cycle, no new repair). New work requires a new revision epoch
|
|
128
|
+
// (Owner revise_once) — surface as a seed failure so the evaluator
|
|
129
|
+
// degrades to needs_human_review instead of looping.
|
|
130
|
+
if (existing.status === 'succeeded' || existing.status === 'failed' || existing.status === 'needs_human_review') {
|
|
131
|
+
throw new Error(`repair task ${repairTaskId} already reached terminal status ${existing.status}; refusing to reuse it as new corrective work (PRI-718 revise-ne-resume)`);
|
|
132
|
+
}
|
|
133
|
+
logger?.info?.(`[PD:Consumer] repair task ${repairTaskId} already exists (in-flight ${existing.status}); reusing (idempotent seed)`);
|
|
123
134
|
return repairTaskId;
|
|
124
135
|
}
|
|
125
136
|
await stateManager.createTask({
|