@zhixuan92/multi-model-agent-core 4.7.9 → 4.7.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.
Files changed (231) hide show
  1. package/README.md +1 -72
  2. package/dist/bounded-execution/stall-watchdog.d.ts.map +1 -1
  3. package/dist/bounded-execution/stall-watchdog.js +28 -4
  4. package/dist/bounded-execution/stall-watchdog.js.map +1 -1
  5. package/dist/config/schema.d.ts +0 -2
  6. package/dist/config/schema.d.ts.map +1 -1
  7. package/dist/config/schema.js +0 -2
  8. package/dist/config/schema.js.map +1 -1
  9. package/dist/events/task-envelope.d.ts +11 -1
  10. package/dist/events/task-envelope.d.ts.map +1 -1
  11. package/dist/events/task-envelope.js +35 -4
  12. package/dist/events/task-envelope.js.map +1 -1
  13. package/dist/index.d.ts +0 -9
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +0 -8
  16. package/dist/index.js.map +1 -1
  17. package/dist/{review → lifecycle/handlers}/parse-review-report.d.ts +1 -1
  18. package/dist/lifecycle/handlers/parse-review-report.d.ts.map +1 -0
  19. package/dist/{review → lifecycle/handlers}/parse-review-report.js +2 -2
  20. package/dist/lifecycle/handlers/parse-review-report.js.map +1 -0
  21. package/dist/lifecycle/handlers/quality-review-prompt.d.ts +6 -0
  22. package/dist/lifecycle/handlers/quality-review-prompt.d.ts.map +1 -0
  23. package/dist/lifecycle/handlers/quality-review-prompt.js +42 -0
  24. package/dist/lifecycle/handlers/quality-review-prompt.js.map +1 -0
  25. package/dist/lifecycle/handlers/review-stage.js +4 -4
  26. package/dist/lifecycle/handlers/review-stage.js.map +1 -1
  27. package/dist/lifecycle/handlers/rework-prompt.d.ts +6 -0
  28. package/dist/lifecycle/handlers/rework-prompt.d.ts.map +1 -0
  29. package/dist/lifecycle/handlers/rework-prompt.js +18 -0
  30. package/dist/lifecycle/handlers/rework-prompt.js.map +1 -0
  31. package/dist/lifecycle/handlers/rework-stage.js +2 -2
  32. package/dist/lifecycle/handlers/rework-stage.js.map +1 -1
  33. package/dist/lifecycle/handlers/spec-review-prompt.d.ts +7 -0
  34. package/dist/lifecycle/handlers/spec-review-prompt.d.ts.map +1 -0
  35. package/dist/lifecycle/handlers/spec-review-prompt.js +39 -0
  36. package/dist/lifecycle/handlers/spec-review-prompt.js.map +1 -0
  37. package/dist/{review → lifecycle/handlers}/tier-policy.d.ts +1 -1
  38. package/dist/lifecycle/handlers/tier-policy.d.ts.map +1 -0
  39. package/dist/lifecycle/handlers/tier-policy.js.map +1 -0
  40. package/dist/lifecycle/lifecycle-driver.d.ts.map +1 -1
  41. package/dist/lifecycle/lifecycle-driver.js +14 -4
  42. package/dist/lifecycle/lifecycle-driver.js.map +1 -1
  43. package/dist/lifecycle/review-verdict-mapping.d.ts.map +1 -0
  44. package/dist/lifecycle/review-verdict-mapping.js.map +1 -0
  45. package/dist/lifecycle/task-executor.js +1 -1
  46. package/dist/lifecycle/task-executor.js.map +1 -1
  47. package/dist/lifecycle/tool-config-types.d.ts +0 -6
  48. package/dist/lifecycle/tool-config-types.d.ts.map +1 -1
  49. package/dist/providers/codex-cli-session.d.ts.map +1 -1
  50. package/dist/providers/codex-cli-session.js +39 -22
  51. package/dist/providers/codex-cli-session.js.map +1 -1
  52. package/dist/reporting/report-parser-slots/research-report.d.ts +0 -3
  53. package/dist/reporting/report-parser-slots/research-report.d.ts.map +1 -1
  54. package/dist/reporting/report-parser-slots/research-report.js +0 -5
  55. package/dist/reporting/report-parser-slots/research-report.js.map +1 -1
  56. package/dist/research/web-fetch.d.ts +24 -4
  57. package/dist/research/web-fetch.d.ts.map +1 -1
  58. package/dist/research/web-fetch.js +57 -42
  59. package/dist/research/web-fetch.js.map +1 -1
  60. package/dist/stores/batch-registry.d.ts +0 -15
  61. package/dist/stores/batch-registry.d.ts.map +1 -1
  62. package/dist/stores/batch-registry.js +2 -0
  63. package/dist/stores/batch-registry.js.map +1 -1
  64. package/dist/stores/project-context-registry.d.ts +4 -11
  65. package/dist/stores/project-context-registry.d.ts.map +1 -1
  66. package/dist/stores/project-context-registry.js +4 -6
  67. package/dist/stores/project-context-registry.js.map +1 -1
  68. package/dist/tools/audit/tool-config.d.ts.map +1 -1
  69. package/dist/tools/audit/tool-config.js +1 -5
  70. package/dist/tools/audit/tool-config.js.map +1 -1
  71. package/dist/tools/debug/tool-config.d.ts.map +1 -1
  72. package/dist/tools/debug/tool-config.js +1 -5
  73. package/dist/tools/debug/tool-config.js.map +1 -1
  74. package/dist/tools/delegate/tool-config.d.ts.map +1 -1
  75. package/dist/tools/delegate/tool-config.js +0 -6
  76. package/dist/tools/delegate/tool-config.js.map +1 -1
  77. package/dist/tools/execute-plan/tool-config.d.ts.map +1 -1
  78. package/dist/tools/execute-plan/tool-config.js +0 -6
  79. package/dist/tools/execute-plan/tool-config.js.map +1 -1
  80. package/dist/tools/investigate/tool-config.d.ts.map +1 -1
  81. package/dist/tools/investigate/tool-config.js +0 -4
  82. package/dist/tools/investigate/tool-config.js.map +1 -1
  83. package/dist/tools/review/tool-config.d.ts.map +1 -1
  84. package/dist/tools/review/tool-config.js +1 -5
  85. package/dist/tools/review/tool-config.js.map +1 -1
  86. package/dist/tools/shared/severity-ladder.d.ts +2 -0
  87. package/dist/tools/shared/severity-ladder.d.ts.map +1 -0
  88. package/dist/tools/shared/severity-ladder.js +9 -0
  89. package/dist/tools/shared/severity-ladder.js.map +1 -0
  90. package/dist/types/config.d.ts +0 -1
  91. package/dist/types/config.d.ts.map +1 -1
  92. package/dist/types.d.ts +0 -10
  93. package/dist/types.d.ts.map +1 -1
  94. package/package.json +2 -49
  95. package/dist/review/index.d.ts +0 -5
  96. package/dist/review/index.d.ts.map +0 -1
  97. package/dist/review/index.js +0 -8
  98. package/dist/review/index.js.map +0 -1
  99. package/dist/review/parse-review-report.d.ts.map +0 -1
  100. package/dist/review/parse-review-report.js.map +0 -1
  101. package/dist/review/review-types.d.ts +0 -2
  102. package/dist/review/review-types.d.ts.map +0 -1
  103. package/dist/review/review-types.js +0 -6
  104. package/dist/review/review-types.js.map +0 -1
  105. package/dist/review/review-verdict-mapping.d.ts.map +0 -1
  106. package/dist/review/review-verdict-mapping.js.map +0 -1
  107. package/dist/review/skipped-result.d.ts +0 -8
  108. package/dist/review/skipped-result.d.ts.map +0 -1
  109. package/dist/review/skipped-result.js +0 -4
  110. package/dist/review/skipped-result.js.map +0 -1
  111. package/dist/review/templates/annotator-audit.d.ts +0 -3
  112. package/dist/review/templates/annotator-audit.d.ts.map +0 -1
  113. package/dist/review/templates/annotator-audit.js +0 -20
  114. package/dist/review/templates/annotator-audit.js.map +0 -1
  115. package/dist/review/templates/annotator-debug.d.ts +0 -3
  116. package/dist/review/templates/annotator-debug.d.ts.map +0 -1
  117. package/dist/review/templates/annotator-debug.js +0 -19
  118. package/dist/review/templates/annotator-debug.js.map +0 -1
  119. package/dist/review/templates/annotator-investigate.d.ts +0 -3
  120. package/dist/review/templates/annotator-investigate.d.ts.map +0 -1
  121. package/dist/review/templates/annotator-investigate.js +0 -17
  122. package/dist/review/templates/annotator-investigate.js.map +0 -1
  123. package/dist/review/templates/annotator-review.d.ts +0 -3
  124. package/dist/review/templates/annotator-review.d.ts.map +0 -1
  125. package/dist/review/templates/annotator-review.js +0 -22
  126. package/dist/review/templates/annotator-review.js.map +0 -1
  127. package/dist/review/templates/annotator-shared.d.ts +0 -23
  128. package/dist/review/templates/annotator-shared.d.ts.map +0 -1
  129. package/dist/review/templates/annotator-shared.js +0 -51
  130. package/dist/review/templates/annotator-shared.js.map +0 -1
  131. package/dist/review/templates/finding-criteria.d.ts +0 -15
  132. package/dist/review/templates/finding-criteria.d.ts.map +0 -1
  133. package/dist/review/templates/finding-criteria.js +0 -39
  134. package/dist/review/templates/finding-criteria.js.map +0 -1
  135. package/dist/review/templates/quality-review-audit.d.ts +0 -3
  136. package/dist/review/templates/quality-review-audit.d.ts.map +0 -1
  137. package/dist/review/templates/quality-review-audit.js +0 -10
  138. package/dist/review/templates/quality-review-audit.js.map +0 -1
  139. package/dist/review/templates/quality-review-debug.d.ts +0 -3
  140. package/dist/review/templates/quality-review-debug.d.ts.map +0 -1
  141. package/dist/review/templates/quality-review-debug.js +0 -10
  142. package/dist/review/templates/quality-review-debug.js.map +0 -1
  143. package/dist/review/templates/quality-review-investigate.d.ts +0 -3
  144. package/dist/review/templates/quality-review-investigate.d.ts.map +0 -1
  145. package/dist/review/templates/quality-review-investigate.js +0 -10
  146. package/dist/review/templates/quality-review-investigate.js.map +0 -1
  147. package/dist/review/templates/quality-review-review.d.ts +0 -3
  148. package/dist/review/templates/quality-review-review.d.ts.map +0 -1
  149. package/dist/review/templates/quality-review-review.js +0 -10
  150. package/dist/review/templates/quality-review-review.js.map +0 -1
  151. package/dist/review/templates/quality-review.d.ts +0 -9
  152. package/dist/review/templates/quality-review.d.ts.map +0 -1
  153. package/dist/review/templates/quality-review.js +0 -89
  154. package/dist/review/templates/quality-review.js.map +0 -1
  155. package/dist/review/templates/rework.d.ts +0 -3
  156. package/dist/review/templates/rework.d.ts.map +0 -1
  157. package/dist/review/templates/rework.js +0 -48
  158. package/dist/review/templates/rework.js.map +0 -1
  159. package/dist/review/templates/shared.d.ts +0 -67
  160. package/dist/review/templates/shared.d.ts.map +0 -1
  161. package/dist/review/templates/shared.js +0 -2
  162. package/dist/review/templates/shared.js.map +0 -1
  163. package/dist/review/templates/spec-review.d.ts +0 -10
  164. package/dist/review/templates/spec-review.d.ts.map +0 -1
  165. package/dist/review/templates/spec-review.js +0 -75
  166. package/dist/review/templates/spec-review.js.map +0 -1
  167. package/dist/review/tier-policy.d.ts.map +0 -1
  168. package/dist/review/tier-policy.js.map +0 -1
  169. package/dist/stores/context-block-project-cap.d.ts +0 -14
  170. package/dist/stores/context-block-project-cap.d.ts.map +0 -1
  171. package/dist/stores/context-block-project-cap.js +0 -80
  172. package/dist/stores/context-block-project-cap.js.map +0 -1
  173. package/dist/stores/file-backed-context-block-store.d.ts +0 -81
  174. package/dist/stores/file-backed-context-block-store.d.ts.map +0 -1
  175. package/dist/stores/file-backed-context-block-store.js +0 -410
  176. package/dist/stores/file-backed-context-block-store.js.map +0 -1
  177. package/dist/stores/index.d.ts +0 -4
  178. package/dist/stores/index.d.ts.map +0 -1
  179. package/dist/stores/index.js +0 -5
  180. package/dist/stores/index.js.map +0 -1
  181. package/dist/tool-surface/discover.d.ts +0 -29
  182. package/dist/tool-surface/discover.d.ts.map +0 -1
  183. package/dist/tool-surface/discover.js +0 -102
  184. package/dist/tool-surface/discover.js.map +0 -1
  185. package/dist/tool-surface/include-utils.d.ts +0 -27
  186. package/dist/tool-surface/include-utils.d.ts.map +0 -1
  187. package/dist/tool-surface/include-utils.js +0 -90
  188. package/dist/tool-surface/include-utils.js.map +0 -1
  189. package/dist/tool-surface/index.d.ts +0 -6
  190. package/dist/tool-surface/index.d.ts.map +0 -1
  191. package/dist/tool-surface/index.js +0 -7
  192. package/dist/tool-surface/index.js.map +0 -1
  193. package/dist/tool-surface/manifest.d.ts +0 -94
  194. package/dist/tool-surface/manifest.d.ts.map +0 -1
  195. package/dist/tool-surface/manifest.js +0 -234
  196. package/dist/tool-surface/manifest.js.map +0 -1
  197. package/dist/tool-surface/openapi-generator.d.ts +0 -15
  198. package/dist/tool-surface/openapi-generator.d.ts.map +0 -1
  199. package/dist/tool-surface/openapi-generator.js +0 -259
  200. package/dist/tool-surface/openapi-generator.js.map +0 -1
  201. package/dist/tool-surface/skill-installer-common.d.ts +0 -48
  202. package/dist/tool-surface/skill-installer-common.d.ts.map +0 -1
  203. package/dist/tool-surface/skill-installer-common.js +0 -195
  204. package/dist/tool-surface/skill-installer-common.js.map +0 -1
  205. package/dist/tool-surface/skill-installer.d.ts +0 -10
  206. package/dist/tool-surface/skill-installer.d.ts.map +0 -1
  207. package/dist/tool-surface/skill-installer.js +0 -20
  208. package/dist/tool-surface/skill-installer.js.map +0 -1
  209. package/dist/tool-surface/skill-installers/claude-code.d.ts +0 -43
  210. package/dist/tool-surface/skill-installers/claude-code.d.ts.map +0 -1
  211. package/dist/tool-surface/skill-installers/claude-code.js +0 -65
  212. package/dist/tool-surface/skill-installers/claude-code.js.map +0 -1
  213. package/dist/tool-surface/skill-installers/codex-cli.d.ts +0 -27
  214. package/dist/tool-surface/skill-installers/codex-cli.d.ts.map +0 -1
  215. package/dist/tool-surface/skill-installers/codex-cli.js +0 -84
  216. package/dist/tool-surface/skill-installers/codex-cli.js.map +0 -1
  217. package/dist/tool-surface/skill-installers/cursor.d.ts +0 -72
  218. package/dist/tool-surface/skill-installers/cursor.d.ts.map +0 -1
  219. package/dist/tool-surface/skill-installers/cursor.js +0 -81
  220. package/dist/tool-surface/skill-installers/cursor.js.map +0 -1
  221. package/dist/tool-surface/skill-installers/gemini-cli.d.ts +0 -66
  222. package/dist/tool-surface/skill-installers/gemini-cli.d.ts.map +0 -1
  223. package/dist/tool-surface/skill-installers/gemini-cli.js +0 -111
  224. package/dist/tool-surface/skill-installers/gemini-cli.js.map +0 -1
  225. package/dist/tool-surface/skill-manifest-sync.d.ts +0 -11
  226. package/dist/tool-surface/skill-manifest-sync.d.ts.map +0 -1
  227. package/dist/tool-surface/skill-manifest-sync.js +0 -65
  228. package/dist/tool-surface/skill-manifest-sync.js.map +0 -1
  229. /package/dist/{review → lifecycle/handlers}/tier-policy.js +0 -0
  230. /package/dist/{review → lifecycle}/review-verdict-mapping.d.ts +0 -0
  231. /package/dist/{review → lifecycle}/review-verdict-mapping.js +0 -0
@@ -1,23 +0,0 @@
1
- export interface AnnotatorPromptContext {
2
- /** N parallel sub-worker narratives, one per criterion the dispatcher
3
- * fanned out. The empty-result narrative ("No findings for this
4
- * criterion.") is filtered out by the engine before this context is
5
- * built — entries here are non-empty narratives that need merging. */
6
- workerOutputs: Array<{
7
- criterion: string;
8
- narrative: string;
9
- }>;
10
- brief: string;
11
- }
12
- export interface AnnotatorTemplate {
13
- role: string;
14
- onBriefCheck: string;
15
- /** Per-tool evidence rule. Tells the annotator what counts as
16
- * grounded evidence for findings from this tool. */
17
- evidenceRule: string;
18
- /** Per-tool scope rule. Tells the annotator what is in/out of scope
19
- * for findings from this tool. */
20
- scopeRule: string;
21
- }
22
- export declare function buildAnnotatorRubric(template: AnnotatorTemplate): string;
23
- //# sourceMappingURL=annotator-shared.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotator-shared.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACrC;;;2EAGuE;IACvE,aAAa,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB;yDACqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB;uCACmC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CA+CxE"}
@@ -1,51 +0,0 @@
1
- // Data shared by all 5 annotator templates. The actual prompt assembly
2
- // happens in review/annotator-prompt-builder.ts.
3
- export function buildAnnotatorRubric(template) {
4
- return String.raw `
5
- ## Output format (REQUIRED)
6
-
7
- Respond with exactly one fenced JSON code block AS THE LAST BLOCK in your
8
- response. The block contains a JSON array of finding objects, in the order
9
- the worker presented them. Example:
10
-
11
- ` + '```json\n' + `[
12
- {
13
- "id": "F1",
14
- "severity": "critical",
15
- "claim": "Remote code execution via unsanitized input in src/handler.ts:42",
16
- "evidence": "user input is passed directly into shellExec() without escaping",
17
- "suggestion": "Use a parameterized API or escape input",
18
- "annotatorConfidence": 90,
19
- "category": "security"
20
- }
21
- ]
22
- ` + '```' + `
23
-
24
- Field rules:
25
- - ` + '`id`' + `: assign sequentially F1, F2, F3, ... (must be unique).
26
- - ` + '`severity`' + `: one of "critical" | "high" | "medium" | "low" — YOUR
27
- final judgment. The worker's value is a hint; calibrate to actual impact.
28
- - ` + '`claim`' + `: one-sentence summary.
29
- - ` + '`evidence`' + `: REQUIRED, ≥20 chars, MUST be a verbatim quote from the
30
- worker's output.
31
- - ` + '`suggestion`' + `: optional; quote or paraphrase the worker's recommended fix.
32
- - ` + '`annotatorConfidence`' + `: integer 0-100. How confident YOU are
33
- that the finding is correct, on-brief, and well-grounded.
34
- - ` + '`category`' + `: optional, one of: "missing_test" | "scope_creep" |
35
- "incomplete_impl" | "style_lint" | "security" | "performance" |
36
- "maintainability" | "doc_gap" | "doc_drift" | "contract_violation" |
37
- "coverage_gap" | "dead_code" | "queue_hygiene" | "other".
38
-
39
- ## Tool-specific evidence rule (apply when judging "well-grounded")
40
-
41
- ` + template.evidenceRule + `
42
-
43
- ## Tool-specific scope rule (apply when judging "on-brief")
44
-
45
- ` + template.scopeRule + `
46
-
47
- If the worker raised NO issues, return ` + '`[]`' + `. Surrounding prose is
48
- allowed but ignored by the parser — only the LAST ` + '```json' + ` block is read.
49
- `.trim();
50
- }
51
- //# sourceMappingURL=annotator-shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotator-shared.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iDAAiD;AAsBjD,MAAM,UAAU,oBAAoB,CAAC,QAA2B;IAC9D,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOlB,GAAG,WAAW,GAAG;;;;;;;;;;;CAWjB,GAAG,KAAK,GAAG;;;GAGT,GAAG,MAAM,GAAG;GACZ,GAAG,YAAY,GAAG;;GAElB,GAAG,SAAS,GAAG;GACf,GAAG,YAAY,GAAG;;GAElB,GAAG,cAAc,GAAG;GACpB,GAAG,uBAAuB,GAAG;;GAE7B,GAAG,YAAY,GAAG;;;;;;;CAOpB,GAAG,QAAQ,CAAC,YAAY,GAAG;;;;CAI3B,GAAG,QAAQ,CAAC,SAAS,GAAG;;wCAEe,GAAG,MAAM,GAAG;mDACD,GAAG,SAAS,GAAG;CACjE,CAAC,IAAI,EAAE,CAAC;AACT,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Truly-shared finding criteria — the constants that apply *identically*
3
- * across every consumer. Per-tool blocks live next to each tool, not here.
4
- *
5
- * - SEVERITY_LADDER: same severity ladder, same anti-inflation hint, same
6
- * impact-anchored definitions for all 5 read-only tools.
7
- * - REVIEWER_AWARENESS_AP: same spec+quality reviewer expectation across
8
- * delegate / execute-plan / retry implementer prompts.
9
- *
10
- * Evidence + scope + annotator-awareness are calibrated per-tool; see
11
- * tools/<tool>/implementer-criteria.ts for each tool's blocks.
12
- */
13
- export declare const SEVERITY_LADDER: string;
14
- export declare const REVIEWER_AWARENESS_AP: string;
15
- //# sourceMappingURL=finding-criteria.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finding-criteria.d.ts","sourceRoot":"","sources":["../../../src/review/templates/finding-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,eAAe,QAOhB,CAAC;AAEb,eAAO,MAAM,qBAAqB,QAiBtB,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Truly-shared finding criteria — the constants that apply *identically*
3
- * across every consumer. Per-tool blocks live next to each tool, not here.
4
- *
5
- * - SEVERITY_LADDER: same severity ladder, same anti-inflation hint, same
6
- * impact-anchored definitions for all 5 read-only tools.
7
- * - REVIEWER_AWARENESS_AP: same spec+quality reviewer expectation across
8
- * delegate / execute-plan / retry implementer prompts.
9
- *
10
- * Evidence + scope + annotator-awareness are calibrated per-tool; see
11
- * tools/<tool>/implementer-criteria.ts for each tool's blocks.
12
- */
13
- export const SEVERITY_LADDER = [
14
- 'Severity (your judgment, calibrated to actual impact):',
15
- '- critical: must fix first — RCE, data loss, auth bypass, build broken, data corruption.',
16
- '- high: real bug or security gap; blocks release.',
17
- '- medium: real issue; fix soon; not blocking.',
18
- '- low: minor or cosmetic issue; nice-to-fix.',
19
- 'Calibrate to actual impact, not how alarming the wording sounds. Workers commonly inflate — resist the urge.',
20
- ].join('\n');
21
- export const REVIEWER_AWARENESS_AP = [
22
- 'After your edit, two reviewers see the cumulative diff (every change since task start):',
23
- '',
24
- '1. SPEC reviewer — "does the diff fulfill the brief?"',
25
- ' - APPROVED requires: every brief item present in the diff, no missing pieces, no out-of-scope edits.',
26
- ' - CHANGES_REQUIRED requires: a concrete concern tied to a specific diff line.',
27
- ' - Empty diff = changes_required UNLESS the brief explicitly requested a no-op.',
28
- '',
29
- '2. QUALITY reviewer — "is the diff sound, safe, maintainable?"',
30
- ' - Flags: correctness bugs, broken tests, races, security gaps, speculative dependencies.',
31
- ' - Does NOT flag: stylistic preferences, comment bikeshedding, unrelated pre-existing code.',
32
- '',
33
- 'Self-check before declaring done:',
34
- '- Implemented EVERY item in the brief? (no gaps)',
35
- '- No edits OUTSIDE the brief? (no scope creep)',
36
- '- If your edit affects callers / tests not in your filePaths, note them in your summary — even if you can\'t update them.',
37
- '- Are the changes minimal and verifiable, or could they be smaller?',
38
- ].join('\n');
39
- //# sourceMappingURL=finding-criteria.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finding-criteria.js","sourceRoot":"","sources":["../../../src/review/templates/finding-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,wDAAwD;IACxD,0FAA0F;IAC1F,uDAAuD;IACvD,iDAAiD;IACjD,mDAAmD;IACnD,8GAA8G;CAC/G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,yFAAyF;IACzF,EAAE;IACF,uDAAuD;IACvD,yGAAyG;IACzG,kFAAkF;IAClF,mFAAmF;IACnF,EAAE;IACF,gEAAgE;IAChE,6FAA6F;IAC7F,+FAA+F;IAC/F,EAAE;IACF,mCAAmC;IACnC,kDAAkD;IAClD,gDAAgD;IAChD,2HAA2H;IAC3H,qEAAqE;CACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const qualityAuditTemplate: ReviewTemplate;
3
- //# sourceMappingURL=quality-review-audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-audit.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,oBAAoB,EAAE,cAMlC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { buildAnnotatorRubric } from './annotator-shared.js';
2
- import { annotatorAuditTemplate } from './annotator-audit.js';
3
- export const qualityAuditTemplate = {
4
- systemPrompt: `You are a quality reviewer checking an audit produced by a worker.
5
- For each finding, ask: is this the kind of issue the audit asked for? A security audit should produce security findings, not style nits.`,
6
- buildUserPrompt(ctx) {
7
- return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorAuditTemplate)}`;
8
- },
9
- };
10
- //# sourceMappingURL=quality-review-audit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-audit.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-audit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAmB;IAClD,YAAY,EAAE;yIACyH;IACvI,eAAe,CAAC,GAAG;QACjB,OAAO,SAAS,GAAG,CAAC,KAAK,uBAAuB,GAAG,CAAC,YAAY,OAAO,oBAAoB,CAAC,sBAAsB,CAAC,EAAE,CAAC;IACxH,CAAC;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const qualityDebugTemplate: ReviewTemplate;
3
- //# sourceMappingURL=quality-review-debug.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-debug.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,oBAAoB,EAAE,cAMlC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { buildAnnotatorRubric } from './annotator-shared.js';
2
- import { annotatorDebugTemplate } from './annotator-debug.js';
3
- export const qualityDebugTemplate = {
4
- systemPrompt: `You are a quality reviewer checking a debugging hypothesis produced by a worker.
5
- Each finding should be a hypothesis, root-cause claim, or evidence (reproducer, error pattern, code path). Flag findings that do not logically follow from cited evidence or that exceed what the trace actually shows.`,
6
- buildUserPrompt(ctx) {
7
- return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorDebugTemplate)}`;
8
- },
9
- };
10
- //# sourceMappingURL=quality-review-debug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-debug.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAmB;IAClD,YAAY,EAAE;wNACwM;IACtN,eAAe,CAAC,GAAG;QACjB,OAAO,SAAS,GAAG,CAAC,KAAK,uBAAuB,GAAG,CAAC,YAAY,OAAO,oBAAoB,CAAC,sBAAsB,CAAC,EAAE,CAAC;IACxH,CAAC;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const qualityInvestigateTemplate: ReviewTemplate;
3
- //# sourceMappingURL=quality-review-investigate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-investigate.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-investigate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,0BAA0B,EAAE,cAMxC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { buildAnnotatorRubric } from './annotator-shared.js';
2
- import { annotatorInvestigateTemplate } from './annotator-investigate.js';
3
- export const qualityInvestigateTemplate = {
4
- systemPrompt: `You are a quality reviewer checking a codebase investigation produced by a worker.
5
- Each finding should be relevant to the question. Findings may be code-level (file:line cited in evidence) or project-level synthesis (what was searched, what was not found). Flag findings whose evidence does not support the claim or whose claim drifts from the question.`,
6
- buildUserPrompt(ctx) {
7
- return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorInvestigateTemplate)}`;
8
- },
9
- };
10
- //# sourceMappingURL=quality-review-investigate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-investigate.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-investigate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,CAAC,MAAM,0BAA0B,GAAmB;IACxD,YAAY,EAAE;+QAC+P;IAC7Q,eAAe,CAAC,GAAG;QACjB,OAAO,SAAS,GAAG,CAAC,KAAK,uBAAuB,GAAG,CAAC,YAAY,OAAO,oBAAoB,CAAC,4BAA4B,CAAC,EAAE,CAAC;IAC9H,CAAC;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const qualityReviewTemplate: ReviewTemplate;
3
- //# sourceMappingURL=quality-review-review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-review.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,qBAAqB,EAAE,cAMnC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { buildAnnotatorRubric } from './annotator-shared.js';
2
- import { annotatorReviewTemplate } from './annotator-review.js';
3
- export const qualityReviewTemplate = {
4
- systemPrompt: `You are a quality reviewer checking a code review produced by a worker.
5
- For each finding, ask: is this within the requested focus area? A security review should produce security findings, not formatting nits.`,
6
- buildUserPrompt(ctx) {
7
- return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorReviewTemplate)}`;
8
- },
9
- };
10
- //# sourceMappingURL=quality-review-review.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review-review.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-review.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAmB;IACnD,YAAY,EAAE;yIACyH;IACvI,eAAe,CAAC,GAAG;QACjB,OAAO,SAAS,GAAG,CAAC,KAAK,uBAAuB,GAAG,CAAC,YAAY,OAAO,oBAAoB,CAAC,uBAAuB,CAAC,EAAE,CAAC;IACzH,CAAC;CACF,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const legalOutcomes: readonly ["found", "clean"];
3
- export declare const qualityLintTemplate: ReviewTemplate;
4
- export declare function qualityReviewPrompt(ctx: {
5
- brief: string;
6
- workerSummary: string;
7
- filesChanged: string[];
8
- }): string;
9
- //# sourceMappingURL=quality-review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAiCzD,eAAO,MAAM,mBAAmB,EAAE,cA8CjC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAUjH"}
@@ -1,89 +0,0 @@
1
- export const legalOutcomes = ['found', 'clean'];
2
- const OUTPUT_FORMAT = `Output format (mandatory):
3
-
4
- ## Verdict
5
- approved | changes_required
6
-
7
- ## Finding N: <one-line claim for this finding>
8
- - Severity: critical | high | medium | low
9
- - Category: <category name>
10
- - Evidence: <one concrete symptom or risk — quote source line or describe observable bad behaviour>
11
- - Suggestion: <specific, actionable fix — not a general nudge>
12
-
13
- ## Finding N+1: ...
14
- (omit section entirely if approved)
15
-
16
- ## Outcome
17
- found | clean
18
-
19
- Rules:
20
- - "approved" when the code is safe and correct enough to ship. Style nits do NOT block.
21
- - "changes_required" only for substantive risks (null-handling gap, missing error path, real edge case, security surface, etc.).
22
- - Each finding must be specific enough that a rework worker can act on it without re-deriving.
23
- - If approved, write "## Verdict\napproved" and omit the ## Finding sections entirely; then "## Outcome\nclean".
24
- - If changes_required, write "## Outcome\nfound".
25
- - Do NOT use editor tools. Read-only investigation only.
26
-
27
- **Severity definitions (per quality-review):**
28
- - **critical:** Will break in production
29
- - **high:** Correctness gap in normal use
30
- - **medium:** Maintainability/fragility
31
- - **low:** Style`;
32
- export const qualityLintTemplate = {
33
- systemPrompt: [
34
- 'You are the QUALITY reviewer for a plan-execution task. You are LINT-ONLY — do NOT edit files.',
35
- 'Your scope: safety, correctness, error handling, edge cases, security, maintainability.',
36
- 'You are NOT checking plan fidelity — that is the spec reviewer\'s job (their report runs in parallel).',
37
- 'Read files as needed to verify. A separate REWORK stage will apply your findings.',
38
- '',
39
- OUTPUT_FORMAT,
40
- '',
41
- 'Rules:',
42
- '- "approved" when the code is safe and correct enough to ship. Style nits do NOT block.',
43
- '- "changes_required" only for substantive risks (null-handling gap, missing error path, real edge case, security surface, etc.).',
44
- '- Each finding must be specific enough that a rework worker can act on it without re-deriving.',
45
- '- If approved, write "## Verdict\napproved" and omit the ## Finding sections entirely.',
46
- '- Do NOT use editor tools. Read-only investigation only.',
47
- ].join('\n'),
48
- buildUserPrompt(ctx) {
49
- const parts = [];
50
- parts.push(`# Task brief\n${ctx.brief}`);
51
- if (ctx.planContext && ctx.planContext.trim().length > 0) {
52
- parts.push(`# Plan section (for context)\n\n\`\`\`markdown\n${ctx.planContext.trim()}\n\`\`\``);
53
- }
54
- if (ctx.diff && ctx.diff.length > 0) {
55
- parts.push(`# Cumulative diff (current on-disk state)\n\n\`\`\`diff\n${ctx.diff}\n\`\`\``);
56
- }
57
- else {
58
- parts.push('# Cumulative diff\n(no file changes detected)');
59
- }
60
- parts.push('# Action\nReview for safety/correctness/edge-cases. Emit the report. Do not edit.');
61
- return parts.join('\n\n');
62
- },
63
- buildWarmFollowup(_ctx) {
64
- // Warm follow-up: spec review already loaded the brief, diff, and
65
- // planContext into this reviewer session's history on turn 1.
66
- // Emit only the NEW instruction — switch lens to safety/correctness
67
- // and emit the verdict + deviations report.
68
- return [
69
- '# Action — second pass: quality lens',
70
- '',
71
- 'Now re-evaluate the SAME work in this thread through the QUALITY lens:',
72
- 'safety, correctness, error handling, edge cases, security, maintainability.',
73
- '',
74
- OUTPUT_FORMAT,
75
- ].join('\n');
76
- },
77
- };
78
- export function qualityReviewPrompt(ctx) {
79
- return `You are the quality reviewer for this task.
80
-
81
- Brief: ${ctx.brief}
82
-
83
- Worker said: ${ctx.workerSummary}
84
-
85
- Files changed: ${ctx.filesChanged.join(', ') || '(none)'}
86
-
87
- ${OUTPUT_FORMAT}`;
88
- }
89
- //# sourceMappingURL=quality-review.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quality-review.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAC;AAEzD,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BL,CAAC;AAElB,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,YAAY,EAAE;QACZ,gGAAgG;QAChG,yFAAyF;QACzF,wGAAwG;QACxG,mFAAmF;QACnF,EAAE;QACF,aAAa;QACb,EAAE;QACF,QAAQ;QACR,yFAAyF;QACzF,kIAAkI;QAClI,gGAAgG;QAChG,wFAAwF;QACxF,0DAA0D;KAC3D,CAAC,IAAI,CAAC,IAAI,CAAC;IAEZ,eAAe,CAAC,GAAG;QACjB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,mDAAmD,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAClG,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,4DAA4D,GAAG,CAAC,IAAI,UAAU,CAAC,CAAC;QAC7F,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAC;QAChG,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,iBAAiB,CAAC,IAAI;QACpB,kEAAkE;QAClE,8DAA8D;QAC9D,oEAAoE;QACpE,4CAA4C;QAC5C,OAAO;YACL,sCAAsC;YACtC,EAAE;YACF,wEAAwE;YACxE,6EAA6E;YAC7E,EAAE;YACF,aAAa;SACd,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,GAAqE;IACvG,OAAO;;SAEA,GAAG,CAAC,KAAK;;eAEH,GAAG,CAAC,aAAa;;iBAEf,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;;EAEtD,aAAa,EAAE,CAAC;AAClB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const reworkTemplate: ReviewTemplate;
3
- //# sourceMappingURL=rework.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rework.d.ts","sourceRoot":"","sources":["../../../src/review/templates/rework.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,cAkD5B,CAAC"}
@@ -1,48 +0,0 @@
1
- export const reworkTemplate = {
2
- systemPrompt: [
3
- 'You are the REWORK worker. The implementer ran, then two reviewers (spec + quality) lint-checked the result and produced deviations.',
4
- 'Your job: fix every deviation. You have FULL editor tools.',
5
- '',
6
- 'CRITICAL: this is a SINGLE-PASS pipeline. There is NO second rework round. After you, the annotator scores completeness and the commit gate fires. If you skip a fix, no commit lands.',
7
- '',
8
- 'Per-deviation procedure:',
9
- ' 1. Read the relevant file ONCE (skip if already read this turn).',
10
- ' 2. Apply the fix with one edit call.',
11
- ' 3. Move on. Do not re-read; do not re-evaluate.',
12
- '',
13
- 'Hard rules:',
14
- '- Trust the reviewers — do not re-investigate whether the deviation is valid.',
15
- '- If a deviation is truly impossible to fix (conflicting constraints, missing source), write "could not fix: <deviation> — reason" in your summary and move on.',
16
- '- Read each file AT MOST ONCE in this stage.',
17
- '',
18
- 'When done: write summary "Fixed: <list of deviations>. Could not fix: <list with reasons>." End your turn.',
19
- '',
20
- 'workerStatus calibration (this is where rework workers commonly under-rate themselves):',
21
- '- "done" — you applied a fix for EVERY listed deviation. This is the correct value even though the reviewer originally flagged concerns. Being asked to rework is not, by itself, a "concern" — addressing the rework IS the success path. Verification of the fix is the reviewer\'s responsibility on the next round — do not mark yourself failed because you couldn\'t independently verify.',
22
- '- "done_with_concerns" — you addressed every listed deviation AND noticed a NEW unrelated issue you couldn\'t fix in this turn. Put the new issue in `unresolved`.',
23
- '- "blocked" / "failed" — you were unable to apply a fix for ONE OR MORE of the listed deviations (conflicting constraints, missing source, ambiguous instruction). Put those entries in the "Could not fix" line AND in `unresolved`.',
24
- 'If your summary line is "Fixed: <every deviation>. Could not fix: (none)." then workerStatus MUST be "done".',
25
- ].join('\n'),
26
- buildUserPrompt(ctx) {
27
- // Warm follow-up: this rework turn always resumes the implementer's
28
- // thread. The brief, prior worker output, and current cumulative diff
29
- // are already in the resumed session's conversation history. Emit
30
- // only the NEW content — the reviewer's deviations to fix.
31
- const parts = [];
32
- if (ctx.priorConcerns && ctx.priorConcerns.length > 0) {
33
- parts.push(`# Reviewer deviations to fix\n${ctx.priorConcerns
34
- .map((c, i) => `${i + 1}. ${c}`)
35
- .join('\n')}`);
36
- }
37
- else {
38
- parts.push('# Reviewer deviations to fix\n(none — should not have reached this stage; end immediately)');
39
- }
40
- parts.push('# Action\n' +
41
- '1. Fix each deviation in order.\n' +
42
- '2. Apply one edit call per file. Do not re-read after editing.\n' +
43
- '3. Write your summary and end your turn.\n' +
44
- '4. In your final WorkerOutput JSON: set workerStatus to "done" if your "Could not fix" line is empty (every listed deviation was addressed). Reserve "failed" / "blocked" for deviations you could not address — having had concerns to begin with is not, in itself, a concern.');
45
- return parts.join('\n\n');
46
- },
47
- };
48
- //# sourceMappingURL=rework.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rework.js","sourceRoot":"","sources":["../../../src/review/templates/rework.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,YAAY,EAAE;QACZ,sIAAsI;QACtI,4DAA4D;QAC5D,EAAE;QACF,wLAAwL;QACxL,EAAE;QACF,0BAA0B;QAC1B,oEAAoE;QACpE,wCAAwC;QACxC,mDAAmD;QACnD,EAAE;QACF,aAAa;QACb,+EAA+E;QAC/E,iKAAiK;QACjK,8CAA8C;QAC9C,EAAE;QACF,4GAA4G;QAC5G,EAAE;QACF,yFAAyF;QACzF,8YAA8Y;QAC9Y,oKAAoK;QACpK,wOAAwO;QACxO,8GAA8G;KAC/G,CAAC,IAAI,CAAC,IAAI,CAAC;IAEZ,eAAe,CAAC,GAAG;QACjB,oEAAoE;QACpE,sEAAsE;QACtE,kEAAkE;QAClE,2DAA2D;QAC3D,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,KAAK,CAAC,IAAI,CACR,iCAAiC,GAAG,CAAC,aAAa;iBAC/C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;iBAC/B,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;QAC3G,CAAC;QACD,KAAK,CAAC,IAAI,CACR,YAAY;YACZ,mCAAmC;YACnC,kEAAkE;YAClE,4CAA4C;YAC5C,kRAAkR,CACnR,CAAC;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF,CAAC"}
@@ -1,67 +0,0 @@
1
- export interface ReviewTemplateContext {
2
- workerOutput: string;
3
- brief: string;
4
- filesChanged?: string[];
5
- /**
6
- * Cumulative unified diff of every change made since task start,
7
- * across all rework rounds. Empty/undefined when no changes were
8
- * detected (or the route is read-only).
9
- *
10
- * Tool sweep #6: reviewer templates were operating blind on the
11
- * worker's text claim alone. Passing the diff lets each reviewer
12
- * be precise — verdicts are grounded in code evidence, not prose.
13
- */
14
- diff?: string;
15
- /**
16
- * Concrete concerns from previous reviewer rounds in this chain.
17
- * Round 1 sees an empty list; round 2+ sees what round 1 flagged
18
- * so it can verify "did the rework address X" rather than re-deriving.
19
- */
20
- priorConcerns?: string[];
21
- /**
22
- * For execute-plan tasks: the verbatim plan section the worker was
23
- * asked to execute, separate from `brief` (which contains the worker's
24
- * full prompt with orientation, fidelity rules, etc.). When set, the
25
- * spec reviewer compares the diff against this section's verbatim code
26
- * blocks character-for-character — semantically-equivalent rewrites
27
- * are CODE SUBSTITUTION, not approval. Unset for non-execute-plan
28
- * routes (delegate, audit, review, verify, debug, investigate).
29
- */
30
- planContext?: string;
31
- /** Spec lint-reviewer raw report. */
32
- specReviewerNotes?: string | null;
33
- /** Quality lint-reviewer raw report. */
34
- qualityReviewerNotes?: string | null;
35
- /** Spec lint-reviewer transport/return error. */
36
- specReviewError?: string | null;
37
- /** Quality lint-reviewer transport/return error. */
38
- qualityReviewError?: string | null;
39
- /** True if rework stage ran and applied edits. */
40
- reworkApplied?: boolean | null;
41
- /** Rework worker's free-text summary. */
42
- reworkOutput?: string | null;
43
- /** Rework transport/return error. */
44
- reworkError?: string | null;
45
- /** Deterministic verify command result (Stage 4 pre-step). */
46
- verifyResult?: {
47
- ran: boolean;
48
- passed: boolean | null;
49
- exitCode: number | null;
50
- command: string[];
51
- tailOutput: string | null;
52
- } | null;
53
- }
54
- export interface ReviewTemplate {
55
- systemPrompt: string;
56
- buildUserPrompt(ctx: ReviewTemplateContext): string;
57
- /**
58
- * Optional warm-followup variant — used by `review-handler.ts` for
59
- * the second iteration of the same reviewer session (turn 2 hits
60
- * cached history; we skip re-inlining `brief`, `workerOutput`, `diff`,
61
- * `planContext`). Templates that never run a second turn don't define
62
- * this method. See
63
- * `docs/superpowers/specs/2026-05-12-warm-followup-context-contract-design.md`.
64
- */
65
- buildWarmFollowup?(ctx: ReviewTemplateContext): string;
66
- }
67
- //# sourceMappingURL=shared.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/review/templates/shared.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE;QACb,GAAG,EAAE,OAAO,CAAC;QACb,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;QACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,GAAG,EAAE,qBAAqB,GAAG,MAAM,CAAC;IACpD;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAAC,GAAG,EAAE,qBAAqB,GAAG,MAAM,CAAC;CACxD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/review/templates/shared.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import type { ReviewTemplate } from './shared.js';
2
- export declare const legalOutcomes: readonly ["found", "clean"];
3
- export declare const OUTPUT_FORMAT: string;
4
- export declare function specReviewPrompt(ctx: {
5
- brief: string;
6
- workerSummary: string;
7
- filesChanged: string[];
8
- }): string;
9
- export declare const specLintTemplate: ReviewTemplate;
10
- //# sourceMappingURL=spec-review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-review.d.ts","sourceRoot":"","sources":["../../../src/review/templates/spec-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAEzD,eAAO,MAAM,aAAa,QA0BlB,CAAC;AAET,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAU9G;AAED,eAAO,MAAM,gBAAgB,EAAE,cAkC9B,CAAC"}
@@ -1,75 +0,0 @@
1
- export const legalOutcomes = ['found', 'clean'];
2
- export const OUTPUT_FORMAT = `
3
- ## Verdict
4
- approved | changes_required
5
-
6
- ## Findings
7
- Emit zero or more findings using EXACTLY this block format. Each finding is its own block.
8
-
9
- ## Finding N: <one-line claim>
10
- - Severity: critical | high | medium | low
11
- - Category: <one word — e.g. missing-step, wrong-file, broken-contract>
12
- - Evidence: <verbatim excerpt from source, ≥20 chars — or (none) if inferable>
13
- - Suggestion: <one sentence — how to fix it>
14
-
15
- ## Finding N+1:
16
- ...
17
-
18
- If no findings, write "## Findings\n(none)".
19
-
20
- ## Outcome
21
- found | clean
22
-
23
- **Severity definitions (per spec-review):**
24
- - **critical:** Plan step missed/wrong such that feature won't work
25
- - **high:** Plan step partially implemented
26
- - **medium:** Diverges in non-essential ways
27
- - **low:** Cosmetic drift
28
- `.trim();
29
- export function specReviewPrompt(ctx) {
30
- return `You are the spec reviewer for this task.
31
-
32
- Brief: ${ctx.brief}
33
-
34
- Worker said: ${ctx.workerSummary}
35
-
36
- Files changed: ${ctx.filesChanged.join(', ') || '(none)'}
37
-
38
- ${OUTPUT_FORMAT}`;
39
- }
40
- export const specLintTemplate = {
41
- systemPrompt: [
42
- 'You are the SPEC reviewer for a plan-execution task. You are LINT-ONLY — do NOT edit files.',
43
- 'Your sole job: compare the on-disk state against the plan and emit a structured report.',
44
- 'Read files as needed to verify. A separate REWORK stage will apply your findings.',
45
- '',
46
- 'Output format (mandatory):',
47
- '',
48
- OUTPUT_FORMAT,
49
- '',
50
- 'Rules:',
51
- '- "approved" means the diff fully implements the plan section. Trivial wording differences are OK.',
52
- '- "changes_required" when any plan step is missing, partial, or wrong on disk.',
53
- '- Each finding must be specific enough that a rework worker can act on it without re-deriving.',
54
- '- If no findings, write "## Findings\\n(none)" followed by "## Outcome\\nclean".',
55
- '- If any findings, write "## Outcome\\nfound".',
56
- '- Do NOT use editor tools. Read-only investigation only. Editing is the rework stage\'s job.',
57
- ].join('\n'),
58
- buildUserPrompt(ctx) {
59
- const parts = [];
60
- parts.push(`# Task brief\n${ctx.brief}`);
61
- if (ctx.planContext && ctx.planContext.trim().length > 0) {
62
- parts.push(`# Plan section (the contract to compare against)\n\n\`\`\`markdown\n${ctx.planContext.trim()}\n\`\`\``);
63
- }
64
- parts.push(`# Worker's summary\n${ctx.workerOutput || '(no summary)'}`);
65
- if (ctx.diff && ctx.diff.length > 0) {
66
- parts.push(`# Cumulative diff (current on-disk state)\n\n\`\`\`diff\n${ctx.diff}\n\`\`\``);
67
- }
68
- else {
69
- parts.push('# Cumulative diff\n(no file changes detected)');
70
- }
71
- parts.push('# Action\nCompare diff vs plan. Emit the report. Do not edit.');
72
- return parts.join('\n\n');
73
- },
74
- };
75
- //# sourceMappingURL=spec-review.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../../src/review/templates/spec-review.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B5B,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,UAAU,gBAAgB,CAAC,GAAqE;IACpG,OAAO;;SAEA,GAAG,CAAC,KAAK;;eAEH,GAAG,CAAC,aAAa;;iBAEf,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ;;EAEtD,aAAa,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C,YAAY,EAAE;QACZ,6FAA6F;QAC7F,yFAAyF;QACzF,mFAAmF;QACnF,EAAE;QACF,4BAA4B;QAC5B,EAAE;QACF,aAAa;QACb,EAAE;QACF,QAAQ;QACR,oGAAoG;QACpG,gFAAgF;QAChF,gGAAgG;QAChG,kFAAkF;QAClF,gDAAgD;QAChD,8FAA8F;KAC/F,CAAC,IAAI,CAAC,IAAI,CAAC;IAEZ,eAAe,CAAC,GAAG;QACjB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,uEAAuE,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACtH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,uBAAuB,GAAG,CAAC,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;QACxE,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,4DAA4D,GAAG,CAAC,IAAI,UAAU,CAAC,CAAC;QAC7F,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;QAC5E,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tier-policy.d.ts","sourceRoot":"","sources":["../../src/review/tier-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,CAE1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tier-policy.js","sourceRoot":"","sources":["../../src/review/tier-policy.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAA0B;IAC7D,OAAO,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Per-project recency signal — the value used to decide LRU ordering.
3
- * For non-empty dirs: max(mtime of any file). For empty dirs: dir mtime.
4
- *
5
- * This helper is exported so the storage migration (A1.7) can use the
6
- * same calculation. Without sharing, the two code paths can drift and
7
- * different "recent" projects survive a sweep vs a migration.
8
- */
9
- export declare function computeProjectRecencyMs(projectDir: string): number;
10
- export declare function sweepProjectCap(contextBlocksRoot: string, maxProjects: number, protectedHashes?: ReadonlySet<string>): {
11
- kept: number;
12
- evicted: number;
13
- };
14
- //# sourceMappingURL=context-block-project-cap.d.ts.map