create-principles-disciple 1.127.1 → 1.128.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.
Files changed (114) hide show
  1. package/console/dist/server/config/pd-config-store.js +7 -2
  2. package/console/dist/server/models/HealthCheckModel.d.ts +4 -1
  3. package/console/dist/server/models/HealthCheckModel.js +6 -5
  4. package/console/dist/server/routes/update.js +8 -83
  5. package/console/dist/server/utils/installed-layout.d.ts +21 -0
  6. package/console/dist/server/utils/installed-layout.js +92 -0
  7. package/console/dist/server/utils/pd-backups.d.ts +9 -0
  8. package/console/dist/server/utils/pd-backups.js +5 -1
  9. package/console/dist/ui/pages/settings/UpdatePage.js +2 -1
  10. package/console/dist/web/assets/app.js +975 -824
  11. package/console/dist/web/index.html +4 -0
  12. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.js +69 -0
  13. package/core/dist/runtime-v2/activation/__tests__/production-gate-deps.test.js.map +1 -1
  14. package/core/dist/runtime-v2/activation/production-gate-deps.d.ts.map +1 -1
  15. package/core/dist/runtime-v2/activation/production-gate-deps.js +13 -46
  16. package/core/dist/runtime-v2/activation/production-gate-deps.js.map +1 -1
  17. package/core/dist/runtime-v2/config/__tests__/pd-config-sparse-bootstrap.test.d.ts +2 -0
  18. package/core/dist/runtime-v2/config/__tests__/pd-config-sparse-bootstrap.test.d.ts.map +1 -0
  19. package/core/dist/runtime-v2/config/__tests__/pd-config-sparse-bootstrap.test.js +143 -0
  20. package/core/dist/runtime-v2/config/__tests__/pd-config-sparse-bootstrap.test.js.map +1 -0
  21. package/core/dist/runtime-v2/feature-flags/__tests__/installer-config-parity.test.js +44 -27
  22. package/core/dist/runtime-v2/feature-flags/__tests__/installer-config-parity.test.js.map +1 -1
  23. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js +9 -0
  24. package/core/dist/runtime-v2/internalization/__tests__/adversarial-feedback.test.js.map +1 -1
  25. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +15 -5
  26. package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
  27. package/core/dist/runtime-v2/internalization/__tests__/context-resolution.test.d.ts +2 -0
  28. package/core/dist/runtime-v2/internalization/__tests__/context-resolution.test.d.ts.map +1 -0
  29. package/core/dist/runtime-v2/internalization/__tests__/context-resolution.test.js +377 -0
  30. package/core/dist/runtime-v2/internalization/__tests__/context-resolution.test.js.map +1 -0
  31. package/core/dist/runtime-v2/internalization/__tests__/evaluator-artificer-repair-replay.test.d.ts +2 -0
  32. package/core/dist/runtime-v2/internalization/__tests__/evaluator-artificer-repair-replay.test.d.ts.map +1 -0
  33. package/core/dist/runtime-v2/internalization/__tests__/evaluator-artificer-repair-replay.test.js +413 -0
  34. package/core/dist/runtime-v2/internalization/__tests__/evaluator-artificer-repair-replay.test.js.map +1 -0
  35. package/core/dist/runtime-v2/internalization/__tests__/evaluator-gate-authority.test.js +136 -0
  36. package/core/dist/runtime-v2/internalization/__tests__/evaluator-gate-authority.test.js.map +1 -1
  37. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js +8 -8
  38. package/core/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js.map +1 -1
  39. package/core/dist/runtime-v2/internalization/__tests__/repair-replay-resolver.test.d.ts +2 -0
  40. package/core/dist/runtime-v2/internalization/__tests__/repair-replay-resolver.test.d.ts.map +1 -0
  41. package/core/dist/runtime-v2/internalization/__tests__/repair-replay-resolver.test.js +340 -0
  42. package/core/dist/runtime-v2/internalization/__tests__/repair-replay-resolver.test.js.map +1 -0
  43. package/core/dist/runtime-v2/internalization/__tests__/shared-information-plane-runner.test.d.ts +2 -0
  44. package/core/dist/runtime-v2/internalization/__tests__/shared-information-plane-runner.test.d.ts.map +1 -0
  45. package/core/dist/runtime-v2/internalization/__tests__/shared-information-plane-runner.test.js +628 -0
  46. package/core/dist/runtime-v2/internalization/__tests__/shared-information-plane-runner.test.js.map +1 -0
  47. package/core/dist/runtime-v2/internalization/adversarial-feedback.d.ts.map +1 -1
  48. package/core/dist/runtime-v2/internalization/adversarial-feedback.js +7 -1
  49. package/core/dist/runtime-v2/internalization/adversarial-feedback.js.map +1 -1
  50. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +9 -2
  51. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
  52. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +19 -1
  53. package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
  54. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts +23 -0
  55. package/core/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
  56. package/core/dist/runtime-v2/internalization/artificer-runner.js +184 -16
  57. package/core/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
  58. package/core/dist/runtime-v2/internalization/context-manifests.d.ts +90 -17
  59. package/core/dist/runtime-v2/internalization/context-manifests.d.ts.map +1 -1
  60. package/core/dist/runtime-v2/internalization/context-manifests.js +124 -27
  61. package/core/dist/runtime-v2/internalization/context-manifests.js.map +1 -1
  62. package/core/dist/runtime-v2/internalization/context-resolution.d.ts +189 -0
  63. package/core/dist/runtime-v2/internalization/context-resolution.d.ts.map +1 -0
  64. package/core/dist/runtime-v2/internalization/context-resolution.js +317 -0
  65. package/core/dist/runtime-v2/internalization/context-resolution.js.map +1 -0
  66. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +18 -1
  67. package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
  68. package/core/dist/runtime-v2/internalization/evaluator-output.js +12 -2
  69. package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
  70. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +32 -0
  71. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  72. package/core/dist/runtime-v2/internalization/evaluator-runner.js +171 -12
  73. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  74. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts +18 -1
  75. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  76. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +20 -0
  77. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
  78. package/core/dist/runtime-v2/internalization/repair-replay-resolver.d.ts +112 -0
  79. package/core/dist/runtime-v2/internalization/repair-replay-resolver.d.ts.map +1 -0
  80. package/core/dist/runtime-v2/internalization/repair-replay-resolver.js +332 -0
  81. package/core/dist/runtime-v2/internalization/repair-replay-resolver.js.map +1 -0
  82. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts +62 -17
  83. package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
  84. package/core/dist/runtime-v2/runner/base-peer-runner.js +116 -10
  85. package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
  86. package/core/dist/telemetry-event.d.ts +2 -2
  87. package/core/dist/telemetry-event.d.ts.map +1 -1
  88. package/core/dist/telemetry-event.js +61 -0
  89. package/core/dist/telemetry-event.js.map +1 -1
  90. package/core/package.json +1 -1
  91. package/dist/installer.d.ts.map +1 -1
  92. package/dist/installer.js +16 -12
  93. package/dist/installer.js.map +1 -1
  94. package/dist/mvp-config.d.ts +22 -15
  95. package/dist/mvp-config.d.ts.map +1 -1
  96. package/dist/mvp-config.js +48 -106
  97. package/dist/mvp-config.js.map +1 -1
  98. package/host-runtime/package.json +1 -1
  99. package/install-layout/package.json +7 -3
  100. package/package.json +1 -1
  101. package/pd-cli/dist/commands/console.d.ts +13 -0
  102. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  103. package/pd-cli/dist/commands/console.js +104 -0
  104. package/pd-cli/dist/commands/console.js.map +1 -1
  105. package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -1
  106. package/pd-cli/dist/commands/runtime-init.js +8 -12
  107. package/pd-cli/dist/commands/runtime-init.js.map +1 -1
  108. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  109. package/pd-cli/dist/commands/runtime-internalization-run-once.js +7 -1
  110. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  111. package/pd-cli/package.json +1 -1
  112. package/plugin/dist/bundle.js +449 -437
  113. package/plugin/dist/governance-audit.js +141 -141
  114. package/plugin/dist/rulehost-evidence.js +153 -153
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-information-plane-runner.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/shared-information-plane-runner.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAkC,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAIpF,IAAI,YAAoB,CAAC;AACzB,IAAI,YA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AC,CAAC;QACH,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,mBAAmB,CACpC,CAAC,eAAe,CACd,QAAQ,EAAE,cAAc,CAAC,UAAU,EAAE,UAAU,EAC/C;gBACE,mEAAmE;gBACnE,+DAA+D;gBAC/D,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;gBACpC,mBAAmB,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE;gBAC9C,sBAAsB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;aACxC,EACD,kBAAkB,CACnB,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,CAC5C,CAAC;QACF,MAAM,CAAC,CAAC,MAAM,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAElE,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAChE,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC;QAC3E,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACtD,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"adversarial-feedback.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/adversarial-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAInE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,SAAS,qBAAqB,EAAE,GAAG,MAAM,CAa/F"}
1
+ {"version":3,"file":"adversarial-feedback.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/adversarial-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAInE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,SAAS,qBAAqB,EAAE,GAAG,MAAM,CAmB/F"}
@@ -13,7 +13,13 @@ export function formatAdversarialFeedback(failedCases) {
13
13
  const rationale = typeof fc.rationale === 'string' && fc.rationale.trim() !== ''
14
14
  ? fc.rationale
15
15
  : '(no rationale provided)';
16
- return `- ${fc.caseId} [${fc.attackType}]: expected ${fc.expectedDecision}, got ${fc.actualDecision} — ${rationale}`;
16
+ // PRI-634 PR-A (SPEC §14): actualDecision is present only when the rule
17
+ // really returned a decision. Absent → the failure is the errorType
18
+ // (throw/timeout), never a fabricated "undefined" decision.
19
+ const actual = fc.actualDecision !== undefined
20
+ ? `got ${fc.actualDecision}`
21
+ : `error ${fc.errorType ?? 'unknown'}`;
22
+ return `- ${fc.caseId} [${fc.attackType}]: expected ${fc.expectedDecision}, ${actual} — ${rationale}`;
17
23
  });
18
24
  return `${HEADER}\n${lines.join('\n')}`;
19
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adversarial-feedback.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/adversarial-feedback.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,GAAG,gFAAgF,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,WAA6C;IACrF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,GAAG,MAAM,wJAAwJ,CAAC;IAC3K,CAAC;IAED,MAAM,K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AAC,SAAS,IAAI,SAAS,EAAE,CAAC;QACzC,OAAO,KAAK,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,UAAU,eAAe,EAAE,CAAC,gBAAgB,KAAK,MAAM,MAAM,SAAS,EAAE,CAAC;IACxG,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1C,CAAC"}
@@ -70,8 +70,15 @@ export interface ArtificerPromptBuildResult {
70
70
  readonly message: string;
71
71
  readonly promptInput: ArtificerPromptInput;
72
72
  }
73
- export declare const ARTIFICER_PROTOCOL_INSTRUCTION = "You are an Artificer agent in a principle internalization pipeline. Your role is to transform the Scribe's formal principle draft into executable RuleHost code with a concise implementation summary, tests, and rollout notes.\n\nPROTOCOL:\n1. Review the scribeArtifact to understand the formal principle draft\n2. Transform the principle draft into executable RuleHost code and a brief implementation summary\n3. Preserve the lineage trace from scribe, philosopher, and dreamer artifacts\n4. Identify risks associated with implementing this principle\n5. The implementation summary should clearly describe what the code does and why\n\nOUTPUT FORMAT (pure JSON, no markdown):\n{\n \"taskId\": \"<from input>\",\n \"sourceScribeArtifactId\": \"<copy exactly from input.sourceScribeArtifactId>\",\n \"implementationSummary\": \"<concise summary of what the code does and the implementation approach>\",\n \"sourceTrace\": {\n \"scribeArtifactId\": \"<copy exactly from input.sourceScribeArtifactId>\",\n \"philosopherArtifactId\": \"<from scribe artifact if available, or omit>\",\n \"dreamerArtifactId\": \"<from scribe artifact if available, or omit>\"\n },\n \"risks\": [\"<risk 1>\", \"<risk 2>\"],\n \"implementationCode\": \"function evaluate(input, helpers) { ... }\",\n \"goldenTraceCases\": [\n {\"caseId\":\"negative-1\",\"kind\":\"negative\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"block\"},\n {\"caseId\":\"positive-1\",\"kind\":\"positive\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/workspace/file\"},\"expectedDecision\":\"allow\"}\n ],\n \"affectedTools\": [\"write_file\"],\n \"generatedAt\": \"<ISO-8601 timestamp>\"\n}\n\nCONSTRAINTS:\n- Output ONLY valid JSON (no markdown, no explanatory text, no code fences)\n- implementationSummary MUST be a non-empty string describing what the code does and the implementation approach\n- sourceScribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId (non-empty string)\n- sourceTrace.scribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from scribe artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from scribe 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- implementationCode MUST define exactly function evaluate(input, helpers) and return { decision, matched, reason }\n- EVERY return statement inside evaluate() MUST include ALL three fields: decision, matched, reason\n- Do NOT return partial objects \u2014 missing fields will fail sandbox validation and block activation\n- GOOD: return { decision: 'allow', matched: false, reason: 'path is within workspace, no risk' }\n- GOOD: return { decision: 'block', matched: true, reason: 'write to system path outside workspace' }\n- BAD: return { matched: false } \u2014 missing decision and reason, will be rejected\n- BAD: return { decision: 'allow', matched: true } \u2014 missing reason, will be rejected\n- input.action contains toolName, normalizedPath, and paramsSummary\n- implementationCode MUST be deterministic and self-contained: no imports, require, eval, Function, I/O, network, timers, Date.now, or randomness\n- goldenTraceCases MUST contain 2-10 cases with at least one positive allow case and one negative block case\n- goldenTraceCases expectedDecision MUST be only \"allow\" or \"block\" \u2014 do NOT emit \"propose_correction\", \"requireApproval\", or \"auto_correct\" (seed-user MVP only supports allow/block; all other action types are rejected by the schema validator)\n- affectedTools MUST contain the non-empty tool names the rule can match\n\nPRIOR ADVERSARIAL FAILURES (when `adversarialFeedback` is present):\n- This is a RETRY. A prior version of your generated code was reviewed and failed adversarial sandbox replay.\n- The `adversarialFeedback` field lists the specific cases that failed, each with the attack type, the expected vs actual decision, and a rationale.\n- You MUST address each listed failure specifically \u2014 do not regenerate blind. Adjust the matcher/logic so the failed cases produce the expected decision while preserving the cases that previously passed.\n\nRULEHOST CAPABILITY BOUNDARY (PRI-508):\n- RuleHost evaluate(input) is a STATELESS single-call gate. It CANNOT track multi-step workflows (e.g., audit\u2192verify\u2192incremental) across invocations.\n- Translate the principle into a STATEFUL-CHECKABLE constraint that evaluate() CAN enforce per tool call: check whether the current tool call carries evidence of prior analysis (context markers, params encoding prior reads, explicit preconditions in the params).\n- Do NOT implement a path whitelist or a \"first call must be X\" ordering rule if the principle is about procedural discipline \u2014 the runtime cannot observe ordering across calls.\n- If the principle cannot be enforced per-call, encode the closest per-call proxy and document the gap in implementationSummary.\n\nREPAIR FEEDBACK (PRI-509, when `repairFeedback` is present):\n- This is a REPAIR RETRY. A prior attempt of your generated code was reviewed by the evaluator and returned needs_revision.\n- The `repairFeedback` field lists the evaluator's concerns and required changes from the prior attempt.\n- You MUST address each required change specifically \u2014 do not regenerate blind. Adjust the matcher/logic so the concerns are resolved while preserving the principle intent.\n- If a required change contradicts the principle intent (from scribeArtifact/dreamerContext), prefer the principle intent and document the conflict in implementationSummary.\n";
74
- export declare const ARTIFICER_PROMPT_CONTRACT_VERSION = "artificer-output-v2.prompt.v2";
73
+ export declare const ARTIFICER_PROTOCOL_INSTRUCTION = "You are an Artificer agent in a principle internalization pipeline. Your role is to transform the Scribe's formal principle draft into executable RuleHost code with a concise implementation summary, tests, and rollout notes.\n\nPROTOCOL:\n1. Review the scribeArtifact to understand the formal principle draft\n2. Transform the principle draft into executable RuleHost code and a brief implementation summary\n3. Preserve the lineage trace from scribe, philosopher, and dreamer artifacts\n4. Identify risks associated with implementing this principle\n5. The implementation summary should clearly describe what the code does and why\n\nOUTPUT FORMAT (pure JSON, no markdown):\n{\n \"taskId\": \"<from input>\",\n \"sourceScribeArtifactId\": \"<copy exactly from input.sourceScribeArtifactId>\",\n \"implementationSummary\": \"<concise summary of what the code does and the implementation approach>\",\n \"sourceTrace\": {\n \"scribeArtifactId\": \"<copy exactly from input.sourceScribeArtifactId>\",\n \"philosopherArtifactId\": \"<from scribe artifact if available, or omit>\",\n \"dreamerArtifactId\": \"<from scribe artifact if available, or omit>\"\n },\n \"risks\": [\"<risk 1>\", \"<risk 2>\"],\n \"implementationCode\": \"function evaluate(input, helpers) { ... }\",\n \"goldenTraceCases\": [\n {\"caseId\":\"negative-1\",\"kind\":\"negative\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/system/file\"},\"expectedDecision\":\"block\"},\n {\"caseId\":\"positive-1\",\"kind\":\"positive\",\"toolName\":\"write_file\",\"params\":{\"path\":\"/workspace/file\"},\"expectedDecision\":\"allow\"}\n ],\n \"affectedTools\": [\"write_file\"],\n \"generatedAt\": \"<ISO-8601 timestamp>\"\n}\n\nCONSTRAINTS:\n- Output ONLY valid JSON (no markdown, no explanatory text, no code fences)\n- implementationSummary MUST be a non-empty string describing what the code does and the implementation approach\n- sourceScribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId (non-empty string)\n- sourceTrace.scribeArtifactId MUST be copied exactly from input.sourceScribeArtifactId\n- sourceTrace.philosopherArtifactId is optional \u2014 include only if available from scribe artifact\n- sourceTrace.dreamerArtifactId is optional \u2014 include only if available from scribe 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- implementationCode MUST define exactly function evaluate(input, helpers) and return { decision, matched, reason }\n- EVERY return statement inside evaluate() MUST include ALL three fields: decision, matched, reason\n- Do NOT return partial objects \u2014 missing fields will fail sandbox validation and block activation\n- GOOD: return { decision: 'allow', matched: false, reason: 'path is within workspace, no risk' }\n- GOOD: return { decision: 'block', matched: true, reason: 'write to system path outside workspace' }\n- BAD: return { matched: false } \u2014 missing decision and reason, will be rejected\n- BAD: return { decision: 'allow', matched: true } \u2014 missing reason, will be rejected\n- input.action contains toolName, normalizedPath, and paramsSummary\n- input.action.paramsSummary is an OBJECT (a map of parameter names to values), NOT a string\n- NEVER call string methods on paramsSummary itself \u2014 paramsSummary.includes(...), paramsSummary.startsWith(...), paramsSummary.match(...) are always bugs and will crash with \"is not a function\"\n- To inspect a parameter, access its specific key (e.g. paramsSummary.path) and guard its type at runtime (typeof paramsSummary.path === 'string') before using it as a string\n- For path logic prefer input.action.normalizedPath (a normalized string) over reading raw params strings\n- implementationCode MUST be deterministic and self-contained: no imports, require, eval, Function, I/O, network, timers, Date.now, or randomness\n- goldenTraceCases MUST contain 2-10 cases with at least one positive allow case and one negative block case\n- goldenTraceCases expectedDecision MUST be only \"allow\" or \"block\" \u2014 do NOT emit \"propose_correction\", \"requireApproval\", or \"auto_correct\" (seed-user MVP only supports allow/block; all other action types are rejected by the schema validator)\n- affectedTools MUST contain the non-empty tool names the rule can match\n\nPRIOR ADVERSARIAL FAILURES (when `adversarialFeedback` is present):\n- This is a RETRY. A prior version of your generated code was reviewed and failed adversarial sandbox replay.\n- The `adversarialFeedback` field lists the specific cases that failed, each with the attack type, the expected vs actual decision, and a rationale.\n- You MUST address each listed failure specifically \u2014 do not regenerate blind. Adjust the matcher/logic so the failed cases produce the expected decision while preserving the cases that previously passed.\n\nRULEHOST CAPABILITY BOUNDARY (PRI-508):\n- RuleHost evaluate(input) is a STATELESS single-call gate. It CANNOT track multi-step workflows (e.g., audit\u2192verify\u2192incremental) across invocations.\n- Translate the principle into a STATEFUL-CHECKABLE constraint that evaluate() CAN enforce per tool call: check whether the current tool call carries evidence of prior analysis (context markers, params encoding prior reads, explicit preconditions in the params).\n- Do NOT implement a path whitelist or a \"first call must be X\" ordering rule if the principle is about procedural discipline \u2014 the runtime cannot observe ordering across calls.\n- If the principle cannot be enforced per-call, encode the closest per-call proxy and document the gap in implementationSummary.\n\nREPAIR FEEDBACK (PRI-509, when `repairFeedback` is present):\n- This is a REPAIR RETRY. A prior attempt of your generated code was reviewed by the evaluator and returned needs_revision.\n- The `repairFeedback` field lists the evaluator's concerns and required changes from the prior attempt.\n- You MUST address each required change specifically \u2014 do not regenerate blind. Adjust the matcher/logic so the concerns are resolved while preserving the principle intent.\n- If a required change contradicts the principle intent (from scribeArtifact/dreamerContext), prefer the principle intent and document the conflict in implementationSummary.\n- When the repair feedback contains a \"Deterministic Replay Evidence\" block (resolved from the source evaluator artifact):\n - Each entry is a machine-verified failure: Case (id), Expected (decision), Actual (decision, only when your code really returned one), Error (sandbox error type), Message (bounded safe failure detail).\n - Fix EVERY listed deterministic failure so the case produces its Expected decision.\n - Preserve the behavior of cases that already passed \u2014 do not trade passing cases for failing ones.\n - Do NOT weaken safety constraints (e.g. drop risk-path blocks) just to make replay pass.\n - Respect the canonical RuleHostInput contract, including that paramsSummary is an object (see CONSTRAINTS).\n - Do NOT invent, guess, or fabricate evidence that is not listed \u2014 the list is the complete deterministic fact set (possibly truncated, as noted).\n";
74
+ /**
75
+ * PRI-634 PR-A: bumped v2 → v3. The prompt contract changed materially:
76
+ * (1) explicit paramsSummary-is-an-object contract with whole-object string
77
+ * method prohibition; (2) deterministic replay evidence block semantics in
78
+ * repair rounds (Case/Expected/Actual/Error/Message entries + fix/preserve/
79
+ * no-weakening/no-fabrication instructions).
80
+ */
81
+ export declare const ARTIFICER_PROMPT_CONTRACT_VERSION = "artificer-output-v2.prompt.v3";
75
82
  export declare class ArtificerPromptBuilder {
76
83
  buildPrompt(input: ArtificerPromptBuilderInput): ArtificerPromptBuildResult;
77
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"artificer-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/artificer-prompt-builder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,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;CACF"}
1
+ {"version":3,"file":"artificer-prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/artificer-prompt-builder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0EAA0E;IAC1E,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;CAC5C;AAED,eAAO,MAAM,8BAA8B,kpOA8E1C,CAAC;AAoBF;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,kCAAkC,CAAC;AAEjF,qBAAa,sBAAsB;IAEjC,WAAW,CAAC,KAAK,EAAE,2BAA2B,GAAG,0BAA0B,CAwC1E;CACF"}
@@ -46,6 +46,10 @@ CONSTRAINTS:
46
46
  - BAD: return { matched: false } — missing decision and reason, will be rejected
47
47
  - BAD: return { decision: 'allow', matched: true } — missing reason, will be rejected
48
48
  - input.action contains toolName, normalizedPath, and paramsSummary
49
+ - input.action.paramsSummary is an OBJECT (a map of parameter names to values), NOT a string
50
+ - NEVER call string methods on paramsSummary itself — paramsSummary.includes(...), paramsSummary.startsWith(...), paramsSummary.match(...) are always bugs and will crash with "is not a function"
51
+ - To inspect a parameter, access its specific key (e.g. paramsSummary.path) and guard its type at runtime (typeof paramsSummary.path === 'string') before using it as a string
52
+ - For path logic prefer input.action.normalizedPath (a normalized string) over reading raw params strings
49
53
  - implementationCode MUST be deterministic and self-contained: no imports, require, eval, Function, I/O, network, timers, Date.now, or randomness
50
54
  - goldenTraceCases MUST contain 2-10 cases with at least one positive allow case and one negative block case
51
55
  - goldenTraceCases expectedDecision MUST be only "allow" or "block" — do NOT emit "propose_correction", "requireApproval", or "auto_correct" (seed-user MVP only supports allow/block; all other action types are rejected by the schema validator)
@@ -67,6 +71,13 @@ REPAIR FEEDBACK (PRI-509, when \`repairFeedback\` is present):
67
71
  - The \`repairFeedback\` field lists the evaluator's concerns and required changes from the prior attempt.
68
72
  - You MUST address each required change specifically — do not regenerate blind. Adjust the matcher/logic so the concerns are resolved while preserving the principle intent.
69
73
  - If a required change contradicts the principle intent (from scribeArtifact/dreamerContext), prefer the principle intent and document the conflict in implementationSummary.
74
+ - When the repair feedback contains a "Deterministic Replay Evidence" block (resolved from the source evaluator artifact):
75
+ - Each entry is a machine-verified failure: Case (id), Expected (decision), Actual (decision, only when your code really returned one), Error (sandbox error type), Message (bounded safe failure detail).
76
+ - Fix EVERY listed deterministic failure so the case produces its Expected decision.
77
+ - Preserve the behavior of cases that already passed — do not trade passing cases for failing ones.
78
+ - Do NOT weaken safety constraints (e.g. drop risk-path blocks) just to make replay pass.
79
+ - Respect the canonical RuleHostInput contract, including that paramsSummary is an object (see CONSTRAINTS).
80
+ - Do NOT invent, guess, or fabricate evidence that is not listed — the list is the complete deterministic fact set (possibly truncated, as noted).
70
81
  `;
71
82
  const V1_CONTEXT_INSTRUCTION = `
72
83
  CONTEXT MODE: v1
@@ -84,7 +95,14 @@ CONTEXT MODE: v2 (Owner-labelled evidence is present)
84
95
  - An empty or truncated history is insufficient evidence; do not infer "not done" from it.
85
96
  - You MUST copy evidenceRefs exactly from the behaviorExamplePack into your output. Do not omit, reorder, or rewrite any evidenceRef string.
86
97
  `;
87
- export const ARTIFICER_PROMPT_CONTRACT_VERSION = 'artificer-output-v2.prompt.v2';
98
+ /**
99
+ * PRI-634 PR-A: bumped v2 → v3. The prompt contract changed materially:
100
+ * (1) explicit paramsSummary-is-an-object contract with whole-object string
101
+ * method prohibition; (2) deterministic replay evidence block semantics in
102
+ * repair rounds (Case/Expected/Actual/Error/Message entries + fix/preserve/
103
+ * no-weakening/no-fabrication instructions).
104
+ */
105
+ export const ARTIFICER_PROMPT_CONTRACT_VERSION = 'artificer-output-v2.prompt.v3';
88
106
  export class ArtificerPromptBuilder {
89
107
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
90
108
  buildPrompt(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"artificer-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/artificer-prompt-builder.ts"],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AK,CAAC,cAAc;YACpC,oBAAoB;YACpB,qBAAqB,EAAE,iCAAiC;YACxD,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,IAAI,IAAI,KAAK,CAAC,mBAAmB,KAAK,SAAS;gBACvE,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;YACP,gEAAgE;YAChE,mEAAmE;YACnE,GAAG,CAAC,OAAO,KAAK,CAAC,mBAAmB,KAAK,QAAQ,IAAI,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE;gBAC1F,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;YACP,oEAAoE;YACpE,0EAA0E;YAC1E,GAAG,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,oEAAoE;YACpE,mEAAmE;YACnE,GAAG,CAAC,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE;gBAChF,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE;gBAC1C,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QAEF,MAAM,OAAO,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
1
+ {"version":3,"file":"artificer-prompt-builder.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/artificer-prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AA8EzE,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K,IAAI,IAAI,KAAK,CAAC,mBAAmB,KAAK,SAAS;gBACvE,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;YACP,gEAAgE;YAChE,mEAAmE;YACnE,GAAG,CAAC,OAAO,KAAK,CAAC,mBAAmB,KAAK,QAAQ,IAAI,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE;gBAC1F,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;YACP,oEAAoE;YACpE,0EAA0E;YAC1E,GAAG,CAAC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,oEAAoE;YACpE,mEAAmE;YACnE,GAAG,CAAC,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE;gBAChF,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE;gBAC1C,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QAEF,MAAM,OAAO,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;QAElD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;CACF"}
@@ -37,7 +37,9 @@ import type { ArtificerRuleOutput, ArtificerValidator } from './artificer-output
37
37
  import type { BehaviorExamplePack } from './behavior-example-pack.js';
38
38
  import type { TaskRecord } from '../task-status.js';
39
39
  import { type PDErrorCategory } from '../error-categories.js';
40
+ import { type RepairPayload } from './pitask-metadata.js';
40
41
  import { type ArtificerDreamerContext } from './artificer-prompt-builder.js';
42
+ import { type RepairReplayContext } from './repair-replay-resolver.js';
41
43
  import { BasePeerRunner } from '../runner/base-peer-runner.js';
42
44
  import type { PeerRunnerOptions, PeerRunnerDeps, PeerRunnerResult, PeerRunnerValidationResult } from '../runner/peer-runner-types.js';
43
45
  import type { EffectivePdConfig } from '../config/pd-config-types.js';
@@ -79,8 +81,29 @@ interface ArtificerContext {
79
81
  * Loop state freshness (rc-7, EP-05): repairPayload.repairIteration is
80
82
  * written at task creation time, never inferred at read. Each repair round
81
83
  * reads the current evaluator's feedback — never a cached value.
84
+ *
85
+ * PR B: this is the NO-REPLAY base string (concerns + required changes).
86
+ * The deterministic replay evidence is carried separately by `replayContext`
87
+ * so the Shared Information Plane can choose its channel (design §26/§35):
88
+ * - manifest focused → `replay.*` fields carry it, base string is used;
89
+ * - flag off/fallback → the PR-A evidence block is appended here, because
90
+ * the replay evidence MUST survive the flag-off production path.
82
91
  */
83
92
  readonly repairFeedback: string | null;
93
+ /**
94
+ * The current task's validated RepairPayload (PR B). Ephemeral — it is the
95
+ * already-durable task metadata, re-read here only so invokeRuntime can
96
+ * re-render the feedback string with the channel-appropriate replay block.
97
+ * It is never re-persisted and never gains `failedCases` (design §21).
98
+ */
99
+ readonly repairPayload?: RepairPayload;
100
+ /**
101
+ * PR-A resolved deterministic replay evidence (PR B). Present only when this
102
+ * repair round's source replay ran and FAILED. Ephemeral: exists for this
103
+ * buildContext/invokeRuntime pair, never persisted, never a second fact store
104
+ * — the durable authority remains the source Evaluator artifact.
105
+ */
106
+ readonly replayContext?: RepairReplayContext;
84
107
  }
85
108
  export type ArtificerRunnerResultStatus = 'succeeded' | 'failed' | 'retried';
86
109
  export interface ArtificerRunnerResult {
@@ -1 +1 @@
1
- {"version":3,"file":"artificer-runner.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/artificer-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,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H,IAAI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC,CAY3D;IAED;;;;OAIG;IACH,OAAO,CAAC,6BAA6B;IAO/B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA8I5D;IAEK,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAyFjF;IAEK,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CA8BpH;IAGK,WAAW,CACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAsGhD;IAID;;;;;;;OAOG;IACH,UAAmB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAkBhH;IAED,UAAmB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAMzF;CACF;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -2,8 +2,9 @@ import { PDRuntimeError, isPDErrorCategory } from '../error-categories.js';
2
2
  import { computeFeatureFlagsFromConfig, isFeatureEnabled } from '../config/pd-config-feature-flags.js';
3
3
  import { hydratePITaskRecord } from './pitask-metadata.js';
4
4
  import { ArtificerPromptBuilder } from './artificer-prompt-builder.js';
5
- import { ARTIFICER_MANIFEST } from './context-manifests.js';
5
+ import { ARTIFICER_MANIFEST, ARTIFICER_REPAIR_MANIFEST } from './context-manifests.js';
6
6
  import { reconcileLineageEcho } from './peer-runner-contracts.js';
7
+ import { resolveRepairReplayContext, } from './repair-replay-resolver.js';
7
8
  import { BasePeerRunner } from '../runner/base-peer-runner.js';
8
9
  /**
9
10
  * Layer 0 (design §6.1): artificer's edge predecessor is `scribe`, whose
@@ -166,6 +167,87 @@ async function resolveDreamerContext(params) {
166
167
  return dreamerContext;
167
168
  }
168
169
  // ── PRI-509: Evaluator repair feedback formatting ───────────────────────────
170
+ /**
171
+ * PRI-634 PR-A: render the resolved deterministic replay evidence for the
172
+ * repair prompt. Each entry names the concrete caseId, the expected decision,
173
+ * the actual decision (only when the rule really produced one), the sandbox
174
+ * errorType, and a bounded safe message — never a bare "N failed" label.
175
+ */
176
+ function formatReplayEvidenceBlock(context) {
177
+ const lines = [
178
+ `Deterministic Replay Evidence (resolved by reference from evaluator artifact ${context.sourceEvaluatorArtifactId}; total failed cases: ${context.failedCaseCount}):`,
179
+ ];
180
+ for (const violation of context.globalViolations) {
181
+ lines.push(`- Global violation | ${violation}`);
182
+ }
183
+ if (context.globalViolationCount > context.globalViolations.length) {
184
+ lines.push(`- (global violations truncated: ${context.globalViolationCount} durable, showing ${context.globalViolations.length})`);
185
+ }
186
+ for (const failure of [...context.systemFailures, ...context.traceFailures]) {
187
+ const parts = [`Case: ${failure.caseId}`];
188
+ if (failure.expectedDecision !== undefined)
189
+ parts.push(`Expected: ${failure.expectedDecision}`);
190
+ if (failure.actualDecision !== undefined)
191
+ parts.push(`Actual: ${failure.actualDecision}`);
192
+ parts.push(`Error: ${failure.errorType}`);
193
+ if (failure.message !== undefined)
194
+ parts.push(`Message: ${failure.message}`);
195
+ lines.push(`- ${parts.join(' | ')}`);
196
+ }
197
+ if (context.truncated) {
198
+ const shown = context.systemFailures.length + context.traceFailures.length + context.globalViolations.length;
199
+ // `failedCaseCount` is the pre-selection durable total and ALREADY includes
200
+ // the forbidden-pattern entries that were partitioned into
201
+ // `globalViolations` — adding `globalViolationCount` would double-count
202
+ // them (P2 review finding, carried into PR B).
203
+ lines.push(`- (evidence truncated: ${context.failedCaseCount} durable entries, showing ${shown} stratified representatives)`);
204
+ }
205
+ return lines.join('\n');
206
+ }
207
+ /**
208
+ * PR B: expose the RepairPayload and the PR-A replay evidence as RELATED
209
+ * context sources (design §33). They are causal references — NOT ancestry — so
210
+ * nothing here reaches into `lineageArtifactIds`.
211
+ *
212
+ * The replay values come straight from the already-bounded
213
+ * `RepairReplayContext`: the information plane therefore inherits PR A's ≤16
214
+ * selection (`MAX_REPLAY_FAILURES_IN_REPAIR`) and never re-expands the durable
215
+ * `failedCases` array (design §43).
216
+ */
217
+ function buildRepairRelatedSources(context) {
218
+ const sources = [];
219
+ const { replayContext, repairPayload } = context;
220
+ if (repairPayload !== undefined) {
221
+ sources.push({
222
+ namespace: 'repair',
223
+ summary: {
224
+ requiredChanges: repairPayload.requiredChanges,
225
+ concerns: repairPayload.concerns,
226
+ },
227
+ });
228
+ }
229
+ if (replayContext !== undefined) {
230
+ const failureTypes = new Set();
231
+ for (const failure of [...replayContext.systemFailures, ...replayContext.traceFailures]) {
232
+ failureTypes.add(failure.errorType);
233
+ }
234
+ sources.push({
235
+ namespace: 'replay',
236
+ summary: {
237
+ passed: replayContext.passed,
238
+ failedCaseCount: replayContext.failedCaseCount,
239
+ // Deterministic: sorted, so the same context always renders identically.
240
+ failureTypes: [...failureTypes].sort(),
241
+ },
242
+ raw: {
243
+ traceFailures: replayContext.traceFailures,
244
+ systemFailures: replayContext.systemFailures,
245
+ globalViolations: replayContext.globalViolations,
246
+ },
247
+ });
248
+ }
249
+ return sources;
250
+ }
169
251
  /**
170
252
  * Format a validated RepairPayload into a repairFeedback string for the
171
253
  * artificer prompt. The format is PoC-validated (Campaign 1 R2):
@@ -189,8 +271,12 @@ async function resolveDreamerContext(params) {
189
271
  * Loop state freshness (rc-7, EP-05): the caller passes the CURRENT task's
190
272
  * repairPayload — never a cached or stale value. repairIteration tells the
191
273
  * artificer which round it's in (1 = first repair, 2 = second repair).
274
+ *
275
+ * PRI-634 PR-A: when the caller resolved concrete replay evidence (read-only
276
+ * from the source Evaluator artifact), the evidence block REPLACES the old
277
+ * "(failed cases: N)" summary line — failure must increase information.
192
278
  */
193
- function formatRepairFeedback(payload) {
279
+ function formatRepairFeedback(payload, replayEvidence) {
194
280
  const concernsLines = payload.concerns.length > 0
195
281
  ? payload.concerns.map((c, i) => `${i + 1}. ${c}`).join('\n')
196
282
  : '(none)';
@@ -200,9 +286,11 @@ function formatRepairFeedback(payload) {
200
286
  // verdict stays needs_revision), but tells the Artificer what the
201
287
  // deterministic gate did observe — failed cases are actionable signals.
202
288
  const replayLines = payload.diagnosticReplay
203
- ? [
204
- `Deterministic adversarial replay: ${payload.diagnosticReplay.ran ? (payload.diagnosticReplay.passed ? 'PASSED' : 'FAILED') : 'not run'} (failed cases: ${payload.diagnosticReplay.failedCaseCount}). This is diagnostic evidence only — the evaluator verdict remains needs_revision.`,
205
- ]
289
+ ? replayEvidence !== undefined
290
+ ? [replayEvidence]
291
+ : [
292
+ `Deterministic adversarial replay: ${payload.diagnosticReplay.ran ? (payload.diagnosticReplay.passed ? 'PASSED' : 'FAILED') : 'not run'} (failed cases: ${payload.diagnosticReplay.failedCaseCount}). This is diagnostic evidence only — the evaluator verdict remains needs_revision.`,
293
+ ]
206
294
  : [];
207
295
  return [
208
296
  `Previous attempt scored ${payload.previousScore} (needs_revision).`,
@@ -354,9 +442,59 @@ export class ArtificerRunner extends BasePeerRunner {
354
442
  // rc-7 (loop state freshness): repairPayload comes from the CURRENT task's
355
443
  // diagnosticJson — never a cached or inferred value. repairIteration tells
356
444
  // the artificer which round it's in.
357
- const repairFeedback = piTask?.repairPayload
358
- ? formatRepairFeedback(piTask.repairPayload)
359
- : null;
445
+ //
446
+ // PRI-634 PR-A: when the diagnostic replay ran and FAILED, the concrete
447
+ // evidence is resolved BY REFERENCE from the source Evaluator artifact
448
+ // (read-only; no facts are copied into RepairPayload). If the durable
449
+ // evidence cannot be resolved, the repair round fails loud
450
+ // (repair_replay_evidence_unavailable) instead of consuming a blind LLM
451
+ // retry — failure must increase information (SPEC §27).
452
+ let repairFeedback = null;
453
+ let repairPayload;
454
+ let replayContext;
455
+ if (piTask?.repairPayload) {
456
+ const payload = piTask.repairPayload;
457
+ repairPayload = payload;
458
+ if (payload.diagnosticReplay?.ran === true && payload.diagnosticReplay.passed === false) {
459
+ const resolution = await resolveRepairReplayContext({
460
+ sourceEvaluatorTaskId: payload.sourceEvaluatorTaskId,
461
+ deps: {
462
+ artifactStore: this.artifactStore,
463
+ getTask: (tid) => this.stateManager.getTask(tid),
464
+ },
465
+ });
466
+ if (resolution.ok) {
467
+ // PR B: keep the resolved evidence object ephemeral on the context.
468
+ // The prompt channel is chosen in invokeRuntime (design §26).
469
+ replayContext = resolution.context;
470
+ this.emitEvent('repair_replay_evidence_resolved', taskId, {
471
+ sourceEvaluatorTaskId: payload.sourceEvaluatorTaskId,
472
+ sourceEvaluatorArtifactId: resolution.context.sourceEvaluatorArtifactId,
473
+ failedCaseCount: resolution.context.failedCaseCount,
474
+ truncated: resolution.context.truncated,
475
+ });
476
+ }
477
+ else {
478
+ this.emitEvent('repair_replay_evidence_unavailable', taskId, {
479
+ sourceEvaluatorTaskId: payload.sourceEvaluatorTaskId,
480
+ reason: resolution.reason,
481
+ detail: resolution.detail,
482
+ nextAction: 'verify_source_evaluator_artifact_durability_before_repair_retry',
483
+ });
484
+ throw new PDRuntimeError('input_invalid', `repair_replay_evidence_unavailable: diagnosticReplay reported FAILED (failed cases: ${payload.diagnosticReplay.failedCaseCount}) but the replay evidence could not be resolved from evaluator task ${payload.sourceEvaluatorTaskId} (${resolution.reason}: ${resolution.detail}). Refusing to consume a blind repair LLM round.`);
485
+ }
486
+ }
487
+ // Base string carries concerns + required changes only; the replay
488
+ // evidence is appended in invokeRuntime according to the chosen channel.
489
+ repairFeedback = formatRepairFeedback(payload);
490
+ }
491
+ // PR B: ephemeral repair/replay evidence for the Shared Information Plane.
492
+ // Both are read-only views of already-durable facts; neither is persisted
493
+ // here and neither widens RepairPayload (design §21/§28).
494
+ const repairEvidenceExtras = {
495
+ ...(repairPayload !== undefined ? { repairPayload } : {}),
496
+ ...(replayContext !== undefined ? { replayContext } : {}),
497
+ };
360
498
  // P1-1 (外部复核): rollout needs_revision 路由到 artificer (code 渠道) 时,
361
499
  // revisionFeedback 携带 reviewer requiredChanges — 与 repairPayload 同等
362
500
  // 注入 prompt,避免"路由到 artificer 但反馈丢失"。rc-7: 从当前任务元数据读取。
@@ -365,7 +503,7 @@ export class ArtificerRunner extends BasePeerRunner {
365
503
  : null;
366
504
  if (deps.length === 0) {
367
505
  this.emitEvent('no_dependencies', taskId, {});
368
- return { contextHash: 'empty', scribeArtifact: null, sourceScribeArtifactId: null, adversarialFeedback, repairFeedback, revisionFeedback };
506
+ return { contextHash: 'empty', scribeArtifact: null, sourceScribeArtifactId: null, adversarialFeedback, repairFeedback, revisionFeedback, ...repairEvidenceExtras };
369
507
  }
370
508
  for (const depId of deps) {
371
509
  const depTask = await this.stateManager.getTask(depId);
@@ -407,12 +545,13 @@ export class ArtificerRunner extends BasePeerRunner {
407
545
  adversarialFeedback,
408
546
  repairFeedback,
409
547
  revisionFeedback,
548
+ ...repairEvidenceExtras,
410
549
  ...(dreamerContext !== undefined ? { dreamerContext } : {}),
411
550
  };
412
551
  }
413
552
  }
414
553
  this.emitEvent('no_scribe_artifact', taskId, {});
415
- return { contextHash: 'empty', scribeArtifact: null, sourceScribeArtifactId: null, adversarialFeedback, repairFeedback };
554
+ return { contextHash: 'empty', scribeArtifact: null, sourceScribeArtifactId: null, adversarialFeedback, repairFeedback, ...repairEvidenceExtras };
416
555
  }
417
556
  async invokeRuntime(taskId, context) {
418
557
  if (!context.scribeArtifact || !context.sourceScribeArtifactId) {
@@ -425,17 +564,45 @@ export class ArtificerRunner extends BasePeerRunner {
425
564
  catch {
426
565
  scribeArtifactInput = context.scribeArtifact;
427
566
  }
428
- // Layer 1 (design §6.2/§6.3, task 5.9): resolve the artificer manifest
429
- // against the loaded scribe predecessor. Focused → inject only allocated
430
- // summary fields (dreamer 5-dim still flows via dreamerContext below);
431
- // fallback → legacy full scribeArtifact; disabled → unchanged.
567
+ // Layer 1 (design §6.2/§6.3, task 5.9) + PR B Shared Information Plane:
568
+ // resolve the manifest against the scribe predecessor's summary envelope,
569
+ // the durable CandidateLineage ancestry (tier2 raw), and — for repair
570
+ // rounds — the related replay evidence. Focused → inject only the
571
+ // allocated fields; fallback/disabled → legacy full scribeArtifact (F13).
432
572
  const scribePred = toScribePredecessor(context);
573
+ let replayViaManifest = false;
433
574
  if (scribePred !== null) {
434
- const resolved = this.resolveContextInjection(taskId, ARTIFICER_MANIFEST, scribePred.contentJson);
575
+ const isRepair = context.replayContext !== undefined;
576
+ const manifest = isRepair ? ARTIFICER_REPAIR_MANIFEST : ARTIFICER_MANIFEST;
577
+ const relatedSources = isRepair ? buildRepairRelatedSources(context) : undefined;
578
+ // Required-evidence gate (design §35/§43): on a repair round the replay
579
+ // evidence MUST reach the prompt. If the manifest budget cannot carry it,
580
+ // resolution falls back and the bounded PR-A string channel is used
581
+ // instead of injecting a thinner prompt. Normal artificer tier2 stays
582
+ // optional — `dreamerContext` (PRI-508, F2) is its safety net.
583
+ const resolved = await this.resolveContextInjectionAsync({
584
+ taskId,
585
+ manifest,
586
+ predecessorContentJson: scribePred.contentJson,
587
+ startArtifactId: context.sourceScribeArtifactId ?? undefined,
588
+ ...(relatedSources !== undefined ? { relatedSources } : {}),
589
+ requiredPaths: isRepair ? [...ARTIFICER_REPAIR_MANIFEST.tier2] : [],
590
+ });
435
591
  if (resolved.mode === 'focused') {
436
592
  scribeArtifactInput = resolved.fields;
593
+ replayViaManifest = isRepair;
437
594
  }
438
595
  }
596
+ // PR B (design §26): pick the replay-evidence channel. When the manifest
597
+ // carried it, the base string keeps concerns + required changes only; when
598
+ // the flag is off (or the budget could not carry the evidence) the PR-A
599
+ // bounded evidence block is appended — exactly the pre-PR-B behavior, so
600
+ // the replay evidence never depends on a quiet flag being on.
601
+ let { repairFeedback } = context;
602
+ const { replayContext, repairPayload } = context;
603
+ if (replayContext !== undefined && repairPayload !== undefined && !replayViaManifest) {
604
+ repairFeedback = formatRepairFeedback(repairPayload, formatReplayEvidenceBlock(replayContext));
605
+ }
439
606
  const builder = new ArtificerPromptBuilder();
440
607
  const { message } = builder.buildPrompt({
441
608
  contextMode: this.contextMode,
@@ -451,7 +618,8 @@ export class ArtificerRunner extends BasePeerRunner {
451
618
  // PRI-509: forward evaluator repair feedback so artificer addresses each
452
619
  // requiredChange instead of regenerating blind. Undefined when absent
453
620
  // (prompt builder treats undefined as backward-compatible no-op).
454
- repairFeedback: context.repairFeedback ?? undefined,
621
+ // PR B: channel-resolved — see the block above.
622
+ repairFeedback: repairFeedback ?? undefined,
455
623
  });
456
624
  // P1-1: rollout revision feedback 注入 (与 scribe 同模式; repairFeedback
457
625
  // 走 prompt builder 字段,revisionFeedback 是路由文本,直接附加)