@zhixuan92/multi-model-agent-core 4.7.8 → 4.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -72
- package/dist/config/schema.d.ts +6 -4
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +6 -4
- package/dist/config/schema.js.map +1 -1
- package/dist/events/task-envelope.d.ts +11 -1
- package/dist/events/task-envelope.d.ts.map +1 -1
- package/dist/events/task-envelope.js +35 -4
- package/dist/events/task-envelope.js.map +1 -1
- package/dist/events/to-wire-record.d.ts.map +1 -1
- package/dist/events/to-wire-record.js +24 -2
- package/dist/events/to-wire-record.js.map +1 -1
- package/dist/events/wire-schema.d.ts +10 -10
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/lifecycle/handlers/annotate-stage.d.ts.map +1 -1
- package/dist/lifecycle/handlers/annotate-stage.js +9 -1
- package/dist/lifecycle/handlers/annotate-stage.js.map +1 -1
- package/dist/{review → lifecycle/handlers}/parse-review-report.d.ts +1 -1
- package/dist/lifecycle/handlers/parse-review-report.d.ts.map +1 -0
- package/dist/{review → lifecycle/handlers}/parse-review-report.js +10 -3
- package/dist/lifecycle/handlers/parse-review-report.js.map +1 -0
- package/dist/lifecycle/handlers/quality-review-prompt.d.ts +6 -0
- package/dist/lifecycle/handlers/quality-review-prompt.d.ts.map +1 -0
- package/dist/lifecycle/handlers/quality-review-prompt.js +42 -0
- package/dist/lifecycle/handlers/quality-review-prompt.js.map +1 -0
- package/dist/lifecycle/handlers/review-stage.js +11 -6
- package/dist/lifecycle/handlers/review-stage.js.map +1 -1
- package/dist/lifecycle/handlers/rework-prompt.d.ts +6 -0
- package/dist/lifecycle/handlers/rework-prompt.d.ts.map +1 -0
- package/dist/lifecycle/handlers/rework-prompt.js +18 -0
- package/dist/lifecycle/handlers/rework-prompt.js.map +1 -0
- package/dist/lifecycle/handlers/rework-stage.js +2 -2
- package/dist/lifecycle/handlers/rework-stage.js.map +1 -1
- package/dist/lifecycle/handlers/spec-review-prompt.d.ts +7 -0
- package/dist/lifecycle/handlers/spec-review-prompt.d.ts.map +1 -0
- package/dist/lifecycle/handlers/spec-review-prompt.js +39 -0
- package/dist/lifecycle/handlers/spec-review-prompt.js.map +1 -0
- package/dist/{review → lifecycle/handlers}/tier-policy.d.ts +1 -1
- package/dist/lifecycle/handlers/tier-policy.d.ts.map +1 -0
- package/dist/lifecycle/handlers/tier-policy.js.map +1 -0
- package/dist/lifecycle/lifecycle-driver.d.ts.map +1 -1
- package/dist/lifecycle/lifecycle-driver.js +14 -4
- package/dist/lifecycle/lifecycle-driver.js.map +1 -1
- package/dist/lifecycle/perform-implementation.d.ts.map +1 -1
- package/dist/lifecycle/perform-implementation.js +38 -5
- package/dist/lifecycle/perform-implementation.js.map +1 -1
- package/dist/lifecycle/research-pre-loop.d.ts +21 -0
- package/dist/lifecycle/research-pre-loop.d.ts.map +1 -0
- package/dist/lifecycle/research-pre-loop.js +54 -0
- package/dist/lifecycle/research-pre-loop.js.map +1 -0
- package/dist/lifecycle/review-verdict-mapping.d.ts.map +1 -0
- package/dist/lifecycle/review-verdict-mapping.js.map +1 -0
- package/dist/lifecycle/task-executor.js +2 -2
- package/dist/lifecycle/task-executor.js.map +1 -1
- package/dist/lifecycle/tool-config-types.d.ts +1 -7
- package/dist/lifecycle/tool-config-types.d.ts.map +1 -1
- package/dist/providers/runner-types.d.ts +0 -6
- package/dist/providers/runner-types.d.ts.map +1 -1
- package/dist/reporting/report-parser-slots/research-report.d.ts +0 -3
- package/dist/reporting/report-parser-slots/research-report.d.ts.map +1 -1
- package/dist/reporting/report-parser-slots/research-report.js +0 -5
- package/dist/reporting/report-parser-slots/research-report.js.map +1 -1
- package/dist/research/adapters/arxiv.d.ts.map +1 -1
- package/dist/research/adapters/arxiv.js +5 -1
- package/dist/research/adapters/arxiv.js.map +1 -1
- package/dist/research/adapters/github-search.d.ts +1 -0
- package/dist/research/adapters/github-search.d.ts.map +1 -1
- package/dist/research/adapters/github-search.js +15 -12
- package/dist/research/adapters/github-search.js.map +1 -1
- package/dist/research/adapters/index.d.ts +5 -1
- package/dist/research/adapters/index.d.ts.map +1 -1
- package/dist/research/adapters/index.js +7 -3
- package/dist/research/adapters/index.js.map +1 -1
- package/dist/research/adapters/semantic-scholar.d.ts +1 -0
- package/dist/research/adapters/semantic-scholar.d.ts.map +1 -1
- package/dist/research/adapters/semantic-scholar.js +11 -1
- package/dist/research/adapters/semantic-scholar.js.map +1 -1
- package/dist/research/evidence-pack.d.ts +33 -0
- package/dist/research/evidence-pack.d.ts.map +1 -0
- package/dist/research/evidence-pack.js +132 -0
- package/dist/research/evidence-pack.js.map +1 -0
- package/dist/research/index.d.ts +1 -2
- package/dist/research/index.d.ts.map +1 -1
- package/dist/research/index.js +1 -3
- package/dist/research/index.js.map +1 -1
- package/dist/research/orchestrator.d.ts +24 -0
- package/dist/research/orchestrator.d.ts.map +1 -0
- package/dist/research/orchestrator.js +162 -0
- package/dist/research/orchestrator.js.map +1 -0
- package/dist/research/query-plan.d.ts +18 -0
- package/dist/research/query-plan.d.ts.map +1 -0
- package/dist/research/query-plan.js +36 -0
- package/dist/research/query-plan.js.map +1 -0
- package/dist/research/user-agent.d.ts +5 -0
- package/dist/research/user-agent.d.ts.map +1 -0
- package/dist/research/user-agent.js +17 -0
- package/dist/research/user-agent.js.map +1 -0
- package/dist/research/web-fetch.d.ts +27 -22
- package/dist/research/web-fetch.d.ts.map +1 -1
- package/dist/research/web-fetch.js +115 -61
- package/dist/research/web-fetch.js.map +1 -1
- package/dist/research/web-search.d.ts.map +1 -1
- package/dist/research/web-search.js +2 -0
- package/dist/research/web-search.js.map +1 -1
- package/dist/stores/batch-registry.d.ts +0 -15
- package/dist/stores/batch-registry.d.ts.map +1 -1
- package/dist/stores/batch-registry.js +2 -0
- package/dist/stores/batch-registry.js.map +1 -1
- package/dist/stores/project-context-registry.d.ts +4 -11
- package/dist/stores/project-context-registry.d.ts.map +1 -1
- package/dist/stores/project-context-registry.js +4 -6
- package/dist/stores/project-context-registry.js.map +1 -1
- package/dist/tools/audit/tool-config.d.ts.map +1 -1
- package/dist/tools/audit/tool-config.js +1 -5
- package/dist/tools/audit/tool-config.js.map +1 -1
- package/dist/tools/debug/tool-config.d.ts.map +1 -1
- package/dist/tools/debug/tool-config.js +1 -5
- package/dist/tools/debug/tool-config.js.map +1 -1
- package/dist/tools/delegate/tool-config.d.ts.map +1 -1
- package/dist/tools/delegate/tool-config.js +0 -6
- package/dist/tools/delegate/tool-config.js.map +1 -1
- package/dist/tools/execute-plan/tool-config.d.ts.map +1 -1
- package/dist/tools/execute-plan/tool-config.js +0 -6
- package/dist/tools/execute-plan/tool-config.js.map +1 -1
- package/dist/tools/investigate/tool-config.d.ts.map +1 -1
- package/dist/tools/investigate/tool-config.js +0 -4
- package/dist/tools/investigate/tool-config.js.map +1 -1
- package/dist/tools/research/brief-slot.d.ts +17 -0
- package/dist/tools/research/brief-slot.d.ts.map +1 -1
- package/dist/tools/research/brief-slot.js +61 -0
- package/dist/tools/research/brief-slot.js.map +1 -1
- package/dist/tools/research/implementer-criteria.d.ts +4 -11
- package/dist/tools/research/implementer-criteria.d.ts.map +1 -1
- package/dist/tools/research/implementer-criteria.js +77 -14
- package/dist/tools/research/implementer-criteria.js.map +1 -1
- package/dist/tools/research/tool-config.d.ts.map +1 -1
- package/dist/tools/research/tool-config.js +10 -2
- package/dist/tools/research/tool-config.js.map +1 -1
- package/dist/tools/research/two-turn-driver.d.ts +20 -0
- package/dist/tools/research/two-turn-driver.d.ts.map +1 -0
- package/dist/tools/research/two-turn-driver.js +41 -0
- package/dist/tools/research/two-turn-driver.js.map +1 -0
- package/dist/tools/review/tool-config.d.ts.map +1 -1
- package/dist/tools/review/tool-config.js +1 -5
- package/dist/tools/review/tool-config.js.map +1 -1
- package/dist/tools/shared/severity-ladder.d.ts +2 -0
- package/dist/tools/shared/severity-ladder.d.ts.map +1 -0
- package/dist/tools/shared/severity-ladder.js +9 -0
- package/dist/tools/shared/severity-ladder.js.map +1 -0
- package/dist/types/config.d.ts +2 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/enums.d.ts +3 -3
- package/dist/types/task-spec.d.ts +14 -10
- package/dist/types/task-spec.d.ts.map +1 -1
- package/dist/types.d.ts +0 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -5
- package/dist/research/types.d.ts +0 -14
- package/dist/research/types.d.ts.map +0 -1
- package/dist/research/types.js +0 -2
- package/dist/research/types.js.map +0 -1
- package/dist/review/index.d.ts +0 -5
- package/dist/review/index.d.ts.map +0 -1
- package/dist/review/index.js +0 -8
- package/dist/review/index.js.map +0 -1
- package/dist/review/parse-review-report.d.ts.map +0 -1
- package/dist/review/parse-review-report.js.map +0 -1
- package/dist/review/review-types.d.ts +0 -2
- package/dist/review/review-types.d.ts.map +0 -1
- package/dist/review/review-types.js +0 -6
- package/dist/review/review-types.js.map +0 -1
- package/dist/review/review-verdict-mapping.d.ts.map +0 -1
- package/dist/review/review-verdict-mapping.js.map +0 -1
- package/dist/review/skipped-result.d.ts +0 -8
- package/dist/review/skipped-result.d.ts.map +0 -1
- package/dist/review/skipped-result.js +0 -4
- package/dist/review/skipped-result.js.map +0 -1
- package/dist/review/templates/annotator-audit.d.ts +0 -3
- package/dist/review/templates/annotator-audit.d.ts.map +0 -1
- package/dist/review/templates/annotator-audit.js +0 -20
- package/dist/review/templates/annotator-audit.js.map +0 -1
- package/dist/review/templates/annotator-debug.d.ts +0 -3
- package/dist/review/templates/annotator-debug.d.ts.map +0 -1
- package/dist/review/templates/annotator-debug.js +0 -19
- package/dist/review/templates/annotator-debug.js.map +0 -1
- package/dist/review/templates/annotator-investigate.d.ts +0 -3
- package/dist/review/templates/annotator-investigate.d.ts.map +0 -1
- package/dist/review/templates/annotator-investigate.js +0 -17
- package/dist/review/templates/annotator-investigate.js.map +0 -1
- package/dist/review/templates/annotator-review.d.ts +0 -3
- package/dist/review/templates/annotator-review.d.ts.map +0 -1
- package/dist/review/templates/annotator-review.js +0 -22
- package/dist/review/templates/annotator-review.js.map +0 -1
- package/dist/review/templates/annotator-shared.d.ts +0 -23
- package/dist/review/templates/annotator-shared.d.ts.map +0 -1
- package/dist/review/templates/annotator-shared.js +0 -51
- package/dist/review/templates/annotator-shared.js.map +0 -1
- package/dist/review/templates/finding-criteria.d.ts +0 -15
- package/dist/review/templates/finding-criteria.d.ts.map +0 -1
- package/dist/review/templates/finding-criteria.js +0 -39
- package/dist/review/templates/finding-criteria.js.map +0 -1
- package/dist/review/templates/quality-review-audit.d.ts +0 -3
- package/dist/review/templates/quality-review-audit.d.ts.map +0 -1
- package/dist/review/templates/quality-review-audit.js +0 -10
- package/dist/review/templates/quality-review-audit.js.map +0 -1
- package/dist/review/templates/quality-review-debug.d.ts +0 -3
- package/dist/review/templates/quality-review-debug.d.ts.map +0 -1
- package/dist/review/templates/quality-review-debug.js +0 -10
- package/dist/review/templates/quality-review-debug.js.map +0 -1
- package/dist/review/templates/quality-review-investigate.d.ts +0 -3
- package/dist/review/templates/quality-review-investigate.d.ts.map +0 -1
- package/dist/review/templates/quality-review-investigate.js +0 -10
- package/dist/review/templates/quality-review-investigate.js.map +0 -1
- package/dist/review/templates/quality-review-review.d.ts +0 -3
- package/dist/review/templates/quality-review-review.d.ts.map +0 -1
- package/dist/review/templates/quality-review-review.js +0 -10
- package/dist/review/templates/quality-review-review.js.map +0 -1
- package/dist/review/templates/quality-review.d.ts +0 -9
- package/dist/review/templates/quality-review.d.ts.map +0 -1
- package/dist/review/templates/quality-review.js +0 -89
- package/dist/review/templates/quality-review.js.map +0 -1
- package/dist/review/templates/rework.d.ts +0 -3
- package/dist/review/templates/rework.d.ts.map +0 -1
- package/dist/review/templates/rework.js +0 -48
- package/dist/review/templates/rework.js.map +0 -1
- package/dist/review/templates/shared.d.ts +0 -67
- package/dist/review/templates/shared.d.ts.map +0 -1
- package/dist/review/templates/shared.js +0 -2
- package/dist/review/templates/shared.js.map +0 -1
- package/dist/review/templates/spec-review.d.ts +0 -10
- package/dist/review/templates/spec-review.d.ts.map +0 -1
- package/dist/review/templates/spec-review.js +0 -75
- package/dist/review/templates/spec-review.js.map +0 -1
- package/dist/review/tier-policy.d.ts.map +0 -1
- package/dist/review/tier-policy.js.map +0 -1
- package/dist/stores/context-block-project-cap.d.ts +0 -14
- package/dist/stores/context-block-project-cap.d.ts.map +0 -1
- package/dist/stores/context-block-project-cap.js +0 -80
- package/dist/stores/context-block-project-cap.js.map +0 -1
- package/dist/stores/file-backed-context-block-store.d.ts +0 -81
- package/dist/stores/file-backed-context-block-store.d.ts.map +0 -1
- package/dist/stores/file-backed-context-block-store.js +0 -410
- package/dist/stores/file-backed-context-block-store.js.map +0 -1
- package/dist/stores/index.d.ts +0 -4
- package/dist/stores/index.d.ts.map +0 -1
- package/dist/stores/index.js +0 -5
- package/dist/stores/index.js.map +0 -1
- /package/dist/{review → lifecycle/handlers}/tier-policy.js +0 -0
- /package/dist/{review → lifecycle}/review-verdict-mapping.d.ts +0 -0
- /package/dist/{review → lifecycle}/review-verdict-mapping.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-audit.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,EAAE,iBAkBpC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const annotatorAuditTemplate = {
|
|
2
|
-
role: 'audit',
|
|
3
|
-
onBriefCheck: 'For each finding, ask: is this the kind of issue the audit asked for? A security audit should produce security findings, not style nits. AND: is this finding consistent with the doc-audit failure-mode taxonomy (recommendation-coherence, internal contradiction, cross-item duplication, independence-claimed-without-evidence, argument soundness, completeness against constraints, fix actionability, drift, scope-creep)? Findings that match the taxonomy and are backed by section references are valid even when they are reasoning-based rather than direct quotes — do NOT downgrade them as "speculation".',
|
|
4
|
-
evidenceRule: [
|
|
5
|
-
'- Audit findings come in FOUR valid shapes:',
|
|
6
|
-
' 1. Doc quote: a verbatim passage from the document showing the issue.',
|
|
7
|
-
' 2. Absence-reference: a precise pointer to where the doc *should* address something but doesn\'t (e.g. "Section 3.2 lists failure modes but is silent on queue overflow").',
|
|
8
|
-
' 3. Claim + contradiction: the doc\'s claim plus a quote from the source it contradicts.',
|
|
9
|
-
' 4. Internal-coherence: a precise reference to two sections of the document that conflict — quote both, OR quote one and name the section ID of the other (e.g. "A8 fix says \'optionally auto-cancel\' but the next sentence says \'do NOT auto-escalate — that crosses into replacing caller judgment\'"). This shape is fully valid for recommendation-coherence, internal-contradiction, argument-soundness, and completeness-against-constraints findings.',
|
|
10
|
-
'- A finding without one of these four forms is speculation; downgrade to low or drop.',
|
|
11
|
-
'- Reasoning-based findings (e.g. "this fix relies on persistence which the doc forbids in Principle #6") are VALID when they cite both the recommendation and the constraint. Do NOT downgrade these as speculation — they are the highest-value kind of audit finding.',
|
|
12
|
-
].join('\n'),
|
|
13
|
-
scopeRule: [
|
|
14
|
-
'- The document and what it directly references are in scope.',
|
|
15
|
-
'- Cross-section / cross-doc reasoning IS the value of an audit — do not penalize as speculation.',
|
|
16
|
-
'- Repository-wide enumeration / globbing is out of scope; flag findings whose evidence depends on broad enumeration.',
|
|
17
|
-
'- Coding-style nits on inline examples belong in a code review, not an audit; flag as off-brief.',
|
|
18
|
-
].join('\n'),
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=annotator-audit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-audit.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-audit.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,0lBAA0lB;IACxmB,YAAY,EAAE;QACZ,6CAA6C;QAC7C,yEAAyE;QACzE,8KAA8K;QAC9K,2FAA2F;QAC3F,kcAAkc;QAClc,uFAAuF;QACvF,yQAAyQ;KAC1Q,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,8DAA8D;QAC9D,kGAAkG;QAClG,sHAAsH;QACtH,kGAAkG;KACnG,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-debug.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,EAAE,iBAiBpC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const annotatorDebugTemplate = {
|
|
2
|
-
role: 'debugging hypothesis',
|
|
3
|
-
onBriefCheck: 'Each finding should be a hypothesis with a complete trace from symptom to cause, not a point observation at the symptom. AND: the cited cause must come UPSTREAM of the cited symptom in the call/data flow — a finding that names a symptom location as the cause is misdirection (SYMPTOM-NOT-CAUSE failure mode). Findings consistent with the debug failure-mode taxonomy (symptom-not-cause, scapegoat file, incomplete trace, untested hypothesis, parallel causes, pre-existing-vs-new entanglement, wrong fix scope, missing reproduction, confidence overstatement) and backed by file:line citations at each step are valid even when the chain has marked gaps — partial-evidence hypotheses with explicit "the gap is here, verify by X" notes are FULLY VALID, do NOT downgrade them as "speculation".',
|
|
4
|
-
evidenceRule: [
|
|
5
|
-
'- Debug findings are hypotheses with REASONING CHAINS, not point observations.',
|
|
6
|
-
'- Each finding must have at least three citations: SYMPTOM (where the failure surfaces) → INTERMEDIATE STATE (the wrong value, the unexpected branch) → CAUSE (the file:line that, if changed, would prevent the failure).',
|
|
7
|
-
'- Evidence forms accepted: reproducer commands, captured logs / stack traces, observed values, code-path traces with file:line per step.',
|
|
8
|
-
'- A finding with NO falsifier (no way to verify the proposed fix worked) is a guess, not a finding.',
|
|
9
|
-
'- Cross-file tracing (symptom in one file, cause in another reachable via call/data flow) is REQUIRED and FULLY VALID — not "speculation about untouched files".',
|
|
10
|
-
'- Severity reflects evidence strength AND impact: confirmed root cause that ships a wrong fix = critical; confirmed root cause with full chain = high; plausible candidate with most of the chain = medium; partial trace / multiple plausible explanations = low.',
|
|
11
|
-
].join('\n'),
|
|
12
|
-
scopeRule: [
|
|
13
|
-
'- Cross-file tracing is in scope and REQUIRED to follow the failure path. Cross-file findings are not out-of-scope just because the named files do not include the cause file.',
|
|
14
|
-
'- Reproduction discovery is in scope: if no reproduction was provided, the worker should infer one and state it explicitly.',
|
|
15
|
-
'- Pre-existing-vs-new separation is in scope: multiple bugs in one failure should be separated, with the answered one as the primary finding and others noted separately.',
|
|
16
|
-
'- Out of scope: applied fixes (the worker should propose, not apply); unrelated code-review remarks; broadening into general code review of files not on the failure path.',
|
|
17
|
-
].join('\n'),
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=annotator-debug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-debug.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-debug.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,IAAI,EAAE,sBAAsB;IAC5B,YAAY,EAAE,qxBAAqxB;IACnyB,YAAY,EAAE;QACZ,gFAAgF;QAChF,4NAA4N;QAC5N,0IAA0I;QAC1I,qGAAqG;QACrG,kKAAkK;QAClK,oQAAoQ;KACrQ,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,gLAAgL;QAChL,6HAA6H;QAC7H,2KAA2K;QAC3K,4KAA4K;KAC7K,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-investigate.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-investigate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,4BAA4B,EAAE,iBAe1C,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const annotatorInvestigateTemplate = {
|
|
2
|
-
role: 'codebase investigation',
|
|
3
|
-
onBriefCheck: 'Each finding should be relevant to the question (not an adjacent question — QUESTION SHIFT failure mode). AND: each load-bearing claim must have a file:line citation OR an explicit "searched X in Y, not found" negative. Findings consistent with the investigate failure-mode taxonomy (wrong file, stale quote, hallucinated citation, confidence overstatement, citation gap, question shift, synthesis without grounding, assumed-current-state) should be filed as the appropriate verdict — do NOT downgrade negative findings for lacking a code quote, and do NOT downgrade inference-with-citations as "speculation" if the cited links are real.',
|
|
4
|
-
evidenceRule: [
|
|
5
|
-
'- Present-thing citations: real `file:line` from files actually read THIS SESSION, with a quote or summary. Citations from training-data memory are hallucinations — flag any cited line that does not currently contain the cited content.',
|
|
6
|
-
'- Absent-thing citations: explicit "searched <pattern> in <path>, no matches" — negative findings are legitimate answers and must NOT be downgraded for lacking a code quote.',
|
|
7
|
-
'- Synthesis findings: cite each link in the reasoning chain by file:line. A synthesis with even one un-cited link is a hand-wave; downgrade confidence or drop the un-cited link.',
|
|
8
|
-
'- Inference-with-citations ("I infer X from Y:42, Z:18") is FULLY VALID and should not be downgraded as "speculation" when the cited links are real. The distinction: inference-with-citations names what is inferred and what is cited; speculation makes a claim without naming the gap.',
|
|
9
|
-
].join('\n'),
|
|
10
|
-
scopeRule: [
|
|
11
|
-
'- Wherever the question leads is in scope; the question may not name files.',
|
|
12
|
-
'- Negative answers ("X is not used", "Y does not exist") ARE in scope when backed by an explicit search; they are not "unable to find" excuses.',
|
|
13
|
-
'- Drift into unrelated code-review remarks is out of scope.',
|
|
14
|
-
'- Fix proposals / suggestions / improvements are out of scope (this is a read-only Q&A).',
|
|
15
|
-
].join('\n'),
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=annotator-investigate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-investigate.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-investigate.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,IAAI,EAAE,wBAAwB;IAC9B,YAAY,EAAE,+nBAA+nB;IAC7oB,YAAY,EAAE;QACZ,6OAA6O;QAC7O,+KAA+K;QAC/K,mLAAmL;QACnL,4RAA4R;KAC7R,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,6EAA6E;QAC7E,iJAAiJ;QACjJ,6DAA6D;QAC7D,0FAA0F;KAC3F,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-review.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,uBAAuB,EAAE,iBAoBrC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const annotatorReviewTemplate = {
|
|
2
|
-
role: 'code review',
|
|
3
|
-
onBriefCheck: 'For each finding, ask: is this within the requested focus area (or universally applicable: security, correctness, performance apply to every code change)? AND: is this finding consistent with the code-review failure-mode taxonomy (test gap, cross-file ripple, pre-existing-bug-vs-new-regression, missing edge case, race, resource leak, backward-compat break, security regression, performance regression, implicit-contract assumption)? Findings that match the taxonomy and are backed by call-site references or sibling-test-file references are valid even when the cited code is not in the named files — do NOT downgrade them as "speculation about untouched files".',
|
|
4
|
-
evidenceRule: [
|
|
5
|
-
'- Code-review findings come in three valid shapes:',
|
|
6
|
-
' 1. In-file quote: a verbatim code excerpt from the named files at `file:line`.',
|
|
7
|
-
' 2. Cross-file ripple: a quote in the named file at `fileA:lineA` PLUS a call-site reference at `fileB:lineB` reachable via grep on the changed symbol. Both lines must be cited.',
|
|
8
|
-
' 3. Test-gap reference: a quote of the changed line in the named file PLUS the natural-sibling test file path (e.g. `tests/foo.test.ts` for `src/foo.ts`). If no test file exists, that itself is the finding.',
|
|
9
|
-
'- Implicit-contract findings are valid when they cite the changed line AND name the contract source (docstring, type, README) that does not state the assumption.',
|
|
10
|
-
'- Findings without one of these forms are speculation; downgrade or drop.',
|
|
11
|
-
'- Reasoning-based findings backed by call-site references (e.g. "this signature change breaks src/handlers/auth.ts:42") are FULLY VALID and the highest-value kind of code-review finding. Do NOT downgrade them as "speculation about untouched files."',
|
|
12
|
-
].join('\n'),
|
|
13
|
-
scopeRule: [
|
|
14
|
-
'- Named files are in scope. Behavior of direct callers/callees may be referenced when visible in the named files.',
|
|
15
|
-
'- Cross-file ripples on changed public symbols ARE in scope when backed by a grep-able symbol reference. Do not penalize as out-of-scope.',
|
|
16
|
-
'- Test-gap findings citing a sibling test file ARE in scope. Do not penalize as out-of-scope.',
|
|
17
|
-
'- Speculation about unrelated untouched files is out of scope.',
|
|
18
|
-
'- Doc/spec issues belong in an audit, not a review — flag as off-brief.',
|
|
19
|
-
'- Pre-existing bugs (the diff did not introduce them) belong in a separate "Pre-existing — out of scope" section, not in the merge-blocking findings.',
|
|
20
|
-
].join('\n'),
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=annotator-review.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-review.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-review.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,ypBAAypB;IACvqB,YAAY,EAAE;QACZ,oDAAoD;QACpD,kFAAkF;QAClF,oLAAoL;QACpL,iNAAiN;QACjN,mKAAmK;QACnK,2EAA2E;QAC3E,0PAA0P;KAC3P,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,mHAAmH;QACnH,2IAA2I;QAC3I,+FAA+F;QAC/F,gEAAgE;QAChE,yEAAyE;QACzE,uJAAuJ;KACxJ,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -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 +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 +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 +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 +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 +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"}
|