@zhixuan92/multi-model-agent-core 4.0.4 → 4.0.6
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 +11 -15
- package/dist/events/cloud-events.d.ts +1 -3
- package/dist/events/cloud-events.d.ts.map +1 -1
- package/dist/events/event-builder.d.ts +1 -1
- package/dist/events/event-builder.d.ts.map +1 -1
- package/dist/events/observability-events.d.ts +3 -111
- package/dist/events/observability-events.d.ts.map +1 -1
- package/dist/events/observability-events.js +0 -58
- package/dist/events/observability-events.js.map +1 -1
- package/dist/events/telemetry-types.d.ts +3 -3
- package/dist/events/telemetry-types.js +1 -1
- package/dist/events/telemetry-types.js.map +1 -1
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/intake/brief-compiler-slots/debug.d.ts +0 -26
- package/dist/intake/brief-compiler-slots/debug.d.ts.map +1 -1
- package/dist/intake/brief-compiler-slots/debug.js +5 -44
- package/dist/intake/brief-compiler-slots/debug.js.map +1 -1
- package/dist/intake/brief-compiler-slots/delegate.d.ts +0 -24
- package/dist/intake/brief-compiler-slots/delegate.d.ts.map +1 -1
- package/dist/intake/brief-compiler-slots/delegate.js +0 -50
- package/dist/intake/brief-compiler-slots/delegate.js.map +1 -1
- package/dist/intake/brief-compiler-slots/research.d.ts +18 -0
- package/dist/intake/brief-compiler-slots/research.d.ts.map +1 -0
- package/dist/intake/brief-compiler-slots/research.js +43 -0
- package/dist/intake/brief-compiler-slots/research.js.map +1 -0
- package/dist/intake/brief-compiler-slots/review.d.ts +0 -23
- package/dist/intake/brief-compiler-slots/review.d.ts.map +1 -1
- package/dist/intake/brief-compiler-slots/review.js +0 -62
- package/dist/intake/brief-compiler-slots/review.js.map +1 -1
- package/dist/lifecycle/handlers/terminal-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/terminal-handlers.js +17 -2
- package/dist/lifecycle/handlers/terminal-handlers.js.map +1 -1
- package/dist/lifecycle/stage-progression.d.ts.map +1 -1
- package/dist/lifecycle/stage-progression.js +1 -0
- package/dist/lifecycle/stage-progression.js.map +1 -1
- package/dist/lifecycle/task-executor.d.ts.map +1 -1
- package/dist/lifecycle/task-executor.js +66 -77
- package/dist/lifecycle/task-executor.js.map +1 -1
- package/dist/lifecycle/task-runner.js +1 -1
- package/dist/lifecycle/task-runner.js.map +1 -1
- package/dist/reporting/headline-templates/research.d.ts +3 -0
- package/dist/reporting/headline-templates/research.d.ts.map +1 -0
- package/dist/reporting/headline-templates/research.js +23 -0
- package/dist/reporting/headline-templates/research.js.map +1 -0
- package/dist/reporting/report-parser-slots/research-report.d.ts +30 -0
- package/dist/reporting/report-parser-slots/research-report.d.ts.map +1 -0
- package/dist/reporting/report-parser-slots/research-report.js +94 -0
- package/dist/reporting/report-parser-slots/research-report.js.map +1 -0
- package/dist/review/annotator-prompt-builder.d.ts +1 -1
- package/dist/review/annotator-prompt-builder.d.ts.map +1 -1
- package/dist/review/annotator-prompt-builder.js +4 -4
- package/dist/review/annotator-prompt-builder.js.map +1 -1
- package/dist/review/reviewer-engine.d.ts +1 -1
- package/dist/review/reviewer-engine.d.ts.map +1 -1
- package/dist/review/reviewer-prompt-builder.d.ts +1 -1
- package/dist/review/reviewer-prompt-builder.d.ts.map +1 -1
- package/dist/review/templates/annotator-audit.d.ts.map +1 -1
- package/dist/review/templates/annotator-audit.js +13 -0
- package/dist/review/templates/annotator-audit.js.map +1 -1
- package/dist/review/templates/annotator-debug.d.ts.map +1 -1
- package/dist/review/templates/annotator-debug.js +11 -1
- package/dist/review/templates/annotator-debug.js.map +1 -1
- package/dist/review/templates/annotator-investigate.d.ts.map +1 -1
- package/dist/review/templates/annotator-investigate.js +10 -1
- package/dist/review/templates/annotator-investigate.js.map +1 -1
- package/dist/review/templates/annotator-review.d.ts.map +1 -1
- package/dist/review/templates/annotator-review.js +10 -0
- package/dist/review/templates/annotator-review.js.map +1 -1
- package/dist/review/templates/annotator-shared.d.ts +7 -1
- package/dist/review/templates/annotator-shared.d.ts.map +1 -1
- package/dist/review/templates/annotator-shared.js +18 -29
- package/dist/review/templates/annotator-shared.js.map +1 -1
- package/dist/review/templates/annotator-verify.d.ts.map +1 -1
- package/dist/review/templates/annotator-verify.js +11 -1
- package/dist/review/templates/annotator-verify.js.map +1 -1
- package/dist/review/templates/finding-criteria.d.ts +8 -32
- package/dist/review/templates/finding-criteria.d.ts.map +1 -1
- package/dist/review/templates/finding-criteria.js +10 -51
- package/dist/review/templates/finding-criteria.js.map +1 -1
- package/dist/review/templates/quality-review-audit.d.ts.map +1 -1
- package/dist/review/templates/quality-review-audit.js +3 -2
- package/dist/review/templates/quality-review-audit.js.map +1 -1
- package/dist/review/templates/quality-review-debug.d.ts.map +1 -1
- package/dist/review/templates/quality-review-debug.js +3 -2
- package/dist/review/templates/quality-review-debug.js.map +1 -1
- package/dist/review/templates/quality-review-investigate.d.ts.map +1 -1
- package/dist/review/templates/quality-review-investigate.js +3 -2
- package/dist/review/templates/quality-review-investigate.js.map +1 -1
- package/dist/review/templates/quality-review-review.d.ts.map +1 -1
- package/dist/review/templates/quality-review-review.js +3 -2
- package/dist/review/templates/quality-review-review.js.map +1 -1
- package/dist/review/templates/quality-review-verify.d.ts.map +1 -1
- package/dist/review/templates/quality-review-verify.js +3 -2
- package/dist/review/templates/quality-review-verify.js.map +1 -1
- package/dist/stores/file-backed-context-block-store.d.ts +5 -1
- package/dist/stores/file-backed-context-block-store.d.ts.map +1 -1
- package/dist/stores/file-backed-context-block-store.js +16 -19
- package/dist/stores/file-backed-context-block-store.js.map +1 -1
- package/dist/stores/project-context-registry.d.ts +5 -3
- package/dist/stores/project-context-registry.d.ts.map +1 -1
- package/dist/stores/project-context-registry.js.map +1 -1
- package/dist/tool-surface/openapi-generator.d.ts.map +1 -1
- package/dist/tool-surface/openapi-generator.js +4 -4
- package/dist/tool-surface/openapi-generator.js.map +1 -1
- package/dist/tool-surface/register-all-tools.js +3 -3
- package/dist/tool-surface/register-all-tools.js.map +1 -1
- package/dist/tools/audit/implementer-criteria.d.ts +17 -0
- package/dist/tools/audit/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/audit/implementer-criteria.js +36 -0
- package/dist/tools/audit/implementer-criteria.js.map +1 -0
- package/dist/tools/audit/tool-config.js +5 -4
- package/dist/tools/audit/tool-config.js.map +1 -1
- package/dist/tools/debug/implementer-criteria.d.ts +12 -0
- package/dist/tools/debug/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/debug/implementer-criteria.js +29 -0
- package/dist/tools/debug/implementer-criteria.js.map +1 -0
- package/dist/tools/debug/tool-config.js +5 -4
- package/dist/tools/debug/tool-config.js.map +1 -1
- package/dist/tools/index.d.ts +0 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +0 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/investigate/implementer-criteria.d.ts +17 -0
- package/dist/tools/investigate/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/investigate/implementer-criteria.js +33 -0
- package/dist/tools/investigate/implementer-criteria.js.map +1 -0
- package/dist/tools/investigate/tool-config.js +2 -2
- package/dist/tools/investigate/tool-config.js.map +1 -1
- package/dist/tools/research/implementer-criteria.d.ts +15 -0
- package/dist/tools/research/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/research/implementer-criteria.js +37 -0
- package/dist/tools/research/implementer-criteria.js.map +1 -0
- package/dist/tools/{explore → research}/schema.d.ts +2 -3
- package/dist/tools/research/schema.d.ts.map +1 -0
- package/dist/tools/{explore → research}/schema.js +10 -16
- package/dist/tools/research/schema.js.map +1 -0
- package/dist/tools/research/tool-config.d.ts +20 -0
- package/dist/tools/research/tool-config.d.ts.map +1 -0
- package/dist/tools/research/tool-config.js +51 -0
- package/dist/tools/research/tool-config.js.map +1 -0
- package/dist/tools/review/implementer-criteria.d.ts +11 -0
- package/dist/tools/review/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/review/implementer-criteria.js +27 -0
- package/dist/tools/review/implementer-criteria.js.map +1 -0
- package/dist/tools/review/tool-config.d.ts.map +1 -1
- package/dist/tools/review/tool-config.js +29 -5
- package/dist/tools/review/tool-config.js.map +1 -1
- package/dist/tools/verify/implementer-criteria.d.ts +12 -0
- package/dist/tools/verify/implementer-criteria.d.ts.map +1 -0
- package/dist/tools/verify/implementer-criteria.js +29 -0
- package/dist/tools/verify/implementer-criteria.js.map +1 -0
- package/dist/tools/verify/tool-config.js +5 -4
- package/dist/tools/verify/tool-config.js.map +1 -1
- package/dist/types/enums.d.ts +1 -11
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +2 -4
- package/dist/types/enums.js.map +1 -1
- package/package.json +12 -40
- package/dist/intake/brief-compiler-slots/audit.d.ts +0 -23
- package/dist/intake/brief-compiler-slots/audit.d.ts.map +0 -1
- package/dist/intake/brief-compiler-slots/audit.js +0 -61
- package/dist/intake/brief-compiler-slots/audit.js.map +0 -1
- package/dist/intake/brief-compiler-slots/explore.d.ts +0 -43
- package/dist/intake/brief-compiler-slots/explore.d.ts.map +0 -1
- package/dist/intake/brief-compiler-slots/explore.js +0 -116
- package/dist/intake/brief-compiler-slots/explore.js.map +0 -1
- package/dist/intake/brief-compiler-slots/verify.d.ts +0 -21
- package/dist/intake/brief-compiler-slots/verify.d.ts.map +0 -1
- package/dist/intake/brief-compiler-slots/verify.js +0 -62
- package/dist/intake/brief-compiler-slots/verify.js.map +0 -1
- package/dist/reporting/compose-explore-headline.d.ts +0 -14
- package/dist/reporting/compose-explore-headline.d.ts.map +0 -1
- package/dist/reporting/compose-explore-headline.js +0 -14
- package/dist/reporting/compose-explore-headline.js.map +0 -1
- package/dist/reporting/derive-explore-status.d.ts +0 -18
- package/dist/reporting/derive-explore-status.d.ts.map +0 -1
- package/dist/reporting/derive-explore-status.js +0 -15
- package/dist/reporting/derive-explore-status.js.map +0 -1
- package/dist/reporting/headline-templates/explore.d.ts +0 -3
- package/dist/reporting/headline-templates/explore.d.ts.map +0 -1
- package/dist/reporting/headline-templates/explore.js +0 -13
- package/dist/reporting/headline-templates/explore.js.map +0 -1
- package/dist/reporting/parse-explore-report.d.ts +0 -38
- package/dist/reporting/parse-explore-report.d.ts.map +0 -1
- package/dist/reporting/parse-explore-report.js +0 -185
- package/dist/reporting/parse-explore-report.js.map +0 -1
- package/dist/reporting/report-parser-slots/explore-report.d.ts +0 -17
- package/dist/reporting/report-parser-slots/explore-report.d.ts.map +0 -1
- package/dist/reporting/report-parser-slots/explore-report.js +0 -9
- package/dist/reporting/report-parser-slots/explore-report.js.map +0 -1
- package/dist/research/explore-orchestrator.d.ts +0 -14
- package/dist/research/explore-orchestrator.d.ts.map +0 -1
- package/dist/research/explore-orchestrator.js +0 -362
- package/dist/research/explore-orchestrator.js.map +0 -1
- package/dist/tools/explore/schema.d.ts.map +0 -1
- package/dist/tools/explore/schema.js.map +0 -1
- package/dist/tools/explore/tool-config.d.ts +0 -7
- package/dist/tools/explore/tool-config.d.ts.map +0 -1
- package/dist/tools/explore/tool-config.js +0 -36
- package/dist/tools/explore/tool-config.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,4GAA4G;IAC1H,YAAY,EAAE;QACZ,wDAAwD;QACxD,0EAA0E;QAC1E,kFAAkF;QAClF,kHAAkH;KACnH,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,2EAA2E;QAC3E,sGAAsG;KACvG,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAY1C,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export const annotatorInvestigateTemplate = {
|
|
2
2
|
role: 'codebase investigation',
|
|
3
|
-
onBriefCheck: 'Each finding should be relevant to the question.
|
|
3
|
+
onBriefCheck: 'Each finding should be relevant to the question.',
|
|
4
|
+
evidenceRule: [
|
|
5
|
+
'- Present-thing citations: real `file:line` from files actually read, with a quote or summary.',
|
|
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.',
|
|
8
|
+
].join('\n'),
|
|
9
|
+
scopeRule: [
|
|
10
|
+
'- Wherever the question leads is in scope; the question may not name files.',
|
|
11
|
+
'- Drift into unrelated code-review remarks is out of scope.',
|
|
12
|
+
].join('\n'),
|
|
4
13
|
};
|
|
5
14
|
//# sourceMappingURL=annotator-investigate.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,kDAAkD;IAChE,YAAY,EAAE;QACZ,gGAAgG;QAChG,+KAA+K;QAC/K,2EAA2E;KAC5E,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,6EAA6E;QAC7E,6DAA6D;KAC9D,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAarC,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export const annotatorReviewTemplate = {
|
|
2
2
|
role: 'code review',
|
|
3
3
|
onBriefCheck: 'For each finding, ask: is this within the requested focus area? A security review should produce security findings, not formatting nits.',
|
|
4
|
+
evidenceRule: [
|
|
5
|
+
'- Code-review findings must cite `file:line` from the named files.',
|
|
6
|
+
'- Evidence must include a verbatim code quote, not paraphrase.',
|
|
7
|
+
'- Findings without a quotable code excerpt are speculation; downgrade or drop.',
|
|
8
|
+
].join('\n'),
|
|
9
|
+
scopeRule: [
|
|
10
|
+
'- Only the named files are in scope. Behavior of direct callers/callees may be referenced when visible in the named files.',
|
|
11
|
+
'- Speculation about untouched files is out of scope.',
|
|
12
|
+
'- Doc/spec issues belong in an audit, not a review — flag as off-brief.',
|
|
13
|
+
].join('\n'),
|
|
4
14
|
};
|
|
5
15
|
//# sourceMappingURL=annotator-review.js.map
|
|
@@ -1 +1 @@
|
|
|
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,0IAA0I;
|
|
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,0IAA0I;IACxJ,YAAY,EAAE;QACZ,oEAAoE;QACpE,gEAAgE;QAChE,gFAAgF;KACjF,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,4HAA4H;QAC5H,sDAAsD;QACtD,yEAAyE;KAC1E,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -5,6 +5,12 @@ export interface AnnotatorPromptContext {
|
|
|
5
5
|
export interface AnnotatorTemplate {
|
|
6
6
|
role: string;
|
|
7
7
|
onBriefCheck: string;
|
|
8
|
+
/** Per-tool evidence rule. Tells the annotator what counts as
|
|
9
|
+
* grounded evidence for findings from this tool. */
|
|
10
|
+
evidenceRule: string;
|
|
11
|
+
/** Per-tool scope rule. Tells the annotator what is in/out of scope
|
|
12
|
+
* for findings from this tool. */
|
|
13
|
+
scopeRule: string;
|
|
8
14
|
}
|
|
9
|
-
export declare
|
|
15
|
+
export declare function buildAnnotatorRubric(template: AnnotatorTemplate): string;
|
|
10
16
|
//# sourceMappingURL=annotator-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-shared.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"annotator-shared.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,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,6 +1,7 @@
|
|
|
1
1
|
// Data shared by all 5 annotator templates. The actual prompt assembly
|
|
2
2
|
// happens in review/annotator-prompt-builder.ts.
|
|
3
|
-
export
|
|
3
|
+
export function buildAnnotatorRubric(template) {
|
|
4
|
+
return String.raw `
|
|
4
5
|
## Output format (REQUIRED)
|
|
5
6
|
|
|
6
7
|
Respond with exactly one fenced JSON code block AS THE LAST BLOCK in your
|
|
@@ -16,47 +17,35 @@ the worker presented them. Example:
|
|
|
16
17
|
"suggestion": "Use a parameterized API or escape input",
|
|
17
18
|
"annotatorConfidence": 90,
|
|
18
19
|
"category": "security"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "F2",
|
|
22
|
-
"severity": "medium",
|
|
23
|
-
"claim": "Auth check missing on /admin endpoint",
|
|
24
|
-
"evidence": "router.get('/admin', adminHandler) — no auth middleware applied",
|
|
25
|
-
"annotatorConfidence": 60,
|
|
26
|
-
"category": "security"
|
|
27
20
|
}
|
|
28
21
|
]
|
|
29
22
|
` + '```' + `
|
|
30
23
|
|
|
31
24
|
Field rules:
|
|
32
|
-
- ` + '`id`' + `: assign sequentially F1, F2, F3, ... (
|
|
25
|
+
- ` + '`id`' + `: assign sequentially F1, F2, F3, ... (must be unique).
|
|
33
26
|
- ` + '`severity`' + `: one of "critical" | "high" | "medium" | "low" — YOUR
|
|
34
|
-
final judgment
|
|
35
|
-
dial it up or down based on actual impact (workers tend to inflate).
|
|
36
|
-
- critical: must fix before any other work (RCE, auth bypass, data loss)
|
|
37
|
-
- high: serious bug / security issue, blocks release
|
|
38
|
-
- medium: real issue, should fix soon
|
|
39
|
-
- low: minor issue, nice to fix
|
|
40
|
-
Map worker-said "mid" -> "medium". When the worker omitted severity, judge.
|
|
27
|
+
final judgment. The worker's value is a hint; calibrate to actual impact.
|
|
41
28
|
- ` + '`claim`' + `: one-sentence summary.
|
|
42
29
|
- ` + '`evidence`' + `: REQUIRED, ≥20 chars, MUST be a verbatim quote from the
|
|
43
|
-
worker's output.
|
|
30
|
+
worker's output.
|
|
44
31
|
- ` + '`suggestion`' + `: optional; quote or paraphrase the worker's recommended fix.
|
|
45
|
-
- ` + '`annotatorConfidence`' + `: integer 0-100. How confident YOU
|
|
46
|
-
that the finding is correct, on-brief, and well-grounded
|
|
47
|
-
80-100: defend without hesitation
|
|
48
|
-
60-79: plausible, minor gaps
|
|
49
|
-
40-59: thin evidence
|
|
50
|
-
20-39: weak / off-brief
|
|
51
|
-
0-19: unsupported / fabricated
|
|
32
|
+
- ` + '`annotatorConfidence`' + `: integer 0-100. How confident YOU are
|
|
33
|
+
that the finding is correct, on-brief, and well-grounded.
|
|
52
34
|
- ` + '`category`' + `: optional, one of: "missing_test" | "scope_creep" |
|
|
53
35
|
"incomplete_impl" | "style_lint" | "security" | "performance" |
|
|
54
36
|
"maintainability" | "doc_gap" | "doc_drift" | "contract_violation" |
|
|
55
37
|
"coverage_gap" | "dead_code" | "queue_hygiene" | "other".
|
|
56
|
-
When omitted, the parser will infer from the claim text. Prefer to emit
|
|
57
|
-
it when the category is unambiguous from your reading.
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
|
|
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.
|
|
61
49
|
`.trim();
|
|
50
|
+
}
|
|
62
51
|
//# sourceMappingURL=annotator-shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-shared.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iDAAiD;
|
|
1
|
+
{"version":3,"file":"annotator-shared.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-shared.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,iDAAiD;AAkBjD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-verify.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"annotator-verify.d.ts","sourceRoot":"","sources":["../../../src/review/templates/annotator-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,uBAAuB,EAAE,iBAarC,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export const annotatorVerifyTemplate = {
|
|
2
2
|
role: 'verification report',
|
|
3
|
-
onBriefCheck: 'Each finding should map to one checklist item with evidence the criterion was met or unmet.
|
|
3
|
+
onBriefCheck: 'Each finding should map to one checklist item with evidence the criterion was met or unmet.',
|
|
4
|
+
evidenceRule: [
|
|
5
|
+
'- Each Finding must map 1:1 to a checklist item.',
|
|
6
|
+
'- Evidence is execution output (test/build/command output) OR a code reference (`file:line`).',
|
|
7
|
+
'- A claimed PASS without evidence is speculation; downgrade or drop.',
|
|
8
|
+
'- Severity binding: PASS = low; FAIL = medium or high based on impact.',
|
|
9
|
+
].join('\n'),
|
|
10
|
+
scopeRule: [
|
|
11
|
+
'- Only checklist items are in scope. Findings not tied to a checklist item are off-brief.',
|
|
12
|
+
'- All checklist items should be covered (one Finding per item, in order).',
|
|
13
|
+
].join('\n'),
|
|
4
14
|
};
|
|
5
15
|
//# sourceMappingURL=annotator-verify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotator-verify.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-verify.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"annotator-verify.js","sourceRoot":"","sources":["../../../src/review/templates/annotator-verify.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,6FAA6F;IAC3G,YAAY,EAAE;QACZ,kDAAkD;QAClD,+FAA+F;QAC/F,sEAAsE;QACtE,wEAAwE;KACzE,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,2FAA2F;QAC3F,2EAA2E;KAC5E,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC"}
|
|
@@ -1,39 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
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
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* implementer prompts the SAME calibration the annotator uses, so the
|
|
10
|
-
* two stages converge:
|
|
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.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - Annotator validates the worker emitted them properly (its rubric
|
|
15
|
-
* in `annotator-shared.ts` references the same definitions).
|
|
16
|
-
*
|
|
17
|
-
* Result: fewer false positives, fewer missed criticals, less rework
|
|
18
|
-
* (the worker self-aligned with what the reviewer will check). No
|
|
19
|
-
* heuristic short-circuits — both stages run, they just spend less
|
|
20
|
-
* time correcting each other.
|
|
10
|
+
* Evidence + scope + annotator-awareness are calibrated per-tool; see
|
|
11
|
+
* tools/<tool>/implementer-criteria.ts for each tool's blocks.
|
|
21
12
|
*/
|
|
22
|
-
/** Severity ladder for read-only finding emission AND annotator
|
|
23
|
-
* validation. Same words, same meaning across stages. */
|
|
24
13
|
export declare const SEVERITY_LADDER: string;
|
|
25
|
-
/** Evidence-grounding rule. Required for every finding the worker
|
|
26
|
-
* emits. The annotator rejects findings without quotable evidence. */
|
|
27
|
-
export declare const EVIDENCE_GROUNDING: string;
|
|
28
|
-
/** Scope discipline. Workers commonly hallucinate citations into files
|
|
29
|
-
* they didn't open; this rule blocks the most common failure mode. */
|
|
30
|
-
export declare const SCOPE_DISCIPLINE: string;
|
|
31
|
-
/** What the annotator (which doubles as the read-only quality reviewer)
|
|
32
|
-
* will check the worker's output against. Pre-fix the worker had no
|
|
33
|
-
* visibility into this; now it can self-align. */
|
|
34
|
-
export declare const ANNOTATOR_CHECK_AWARENESS_RO: string;
|
|
35
|
-
/** Awareness block for delegate / execute-plan / retry implementers.
|
|
36
|
-
* Tells the worker what spec_review and quality_review will judge,
|
|
37
|
-
* so the worker self-aligns. */
|
|
38
14
|
export declare const REVIEWER_AWARENESS_AP: string;
|
|
39
15
|
//# sourceMappingURL=finding-criteria.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding-criteria.d.ts","sourceRoot":"","sources":["../../../src/review/templates/finding-criteria.ts"],"names":[],"mappings":"AAAA
|
|
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,64 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
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
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* implementer prompts the SAME calibration the annotator uses, so the
|
|
10
|
-
* two stages converge:
|
|
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.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - Annotator validates the worker emitted them properly (its rubric
|
|
15
|
-
* in `annotator-shared.ts` references the same definitions).
|
|
16
|
-
*
|
|
17
|
-
* Result: fewer false positives, fewer missed criticals, less rework
|
|
18
|
-
* (the worker self-aligned with what the reviewer will check). No
|
|
19
|
-
* heuristic short-circuits — both stages run, they just spend less
|
|
20
|
-
* time correcting each other.
|
|
10
|
+
* Evidence + scope + annotator-awareness are calibrated per-tool; see
|
|
11
|
+
* tools/<tool>/implementer-criteria.ts for each tool's blocks.
|
|
21
12
|
*/
|
|
22
|
-
/** Severity ladder for read-only finding emission AND annotator
|
|
23
|
-
* validation. Same words, same meaning across stages. */
|
|
24
13
|
export const SEVERITY_LADDER = [
|
|
25
|
-
'Severity (your judgment, calibrated to impact):',
|
|
14
|
+
'Severity (your judgment, calibrated to actual impact):',
|
|
26
15
|
'- critical: must fix first — RCE, data loss, auth bypass, build broken, data corruption.',
|
|
27
16
|
'- high: real bug or security gap; blocks release.',
|
|
28
17
|
'- medium: real issue; fix soon; not blocking.',
|
|
29
|
-
'- low: minor or cosmetic issue; nice-to-fix
|
|
18
|
+
'- low: minor or cosmetic issue; nice-to-fix.',
|
|
30
19
|
'Calibrate to actual impact, not how alarming the wording sounds. Workers commonly inflate — resist the urge.',
|
|
31
20
|
].join('\n');
|
|
32
|
-
/** Evidence-grounding rule. Required for every finding the worker
|
|
33
|
-
* emits. The annotator rejects findings without quotable evidence. */
|
|
34
|
-
export const EVIDENCE_GROUNDING = [
|
|
35
|
-
'Evidence grounding (REQUIRED for every finding):',
|
|
36
|
-
'- Cite `file:line` (or `file:line-line` for a span) where the issue lives.',
|
|
37
|
-
'- Quote the exact code excerpt or command output that demonstrates the issue. Don\'t paraphrase — quote.',
|
|
38
|
-
'- If you cannot quote evidence directly, do NOT raise the finding. Note "investigation needed" in your summary instead.',
|
|
39
|
-
].join('\n');
|
|
40
|
-
/** Scope discipline. Workers commonly hallucinate citations into files
|
|
41
|
-
* they didn't open; this rule blocks the most common failure mode. */
|
|
42
|
-
export const SCOPE_DISCIPLINE = [
|
|
43
|
-
'Scope discipline:',
|
|
44
|
-
'- Only flag issues you verified by reading the file directly.',
|
|
45
|
-
'- If a claim depends on caller behavior or files outside the requested scope, mark "investigation needed" in your summary — do NOT speculate.',
|
|
46
|
-
'- Stay within the requested files. Don\'t audit dependencies you weren\'t asked about.',
|
|
47
|
-
].join('\n');
|
|
48
|
-
/** What the annotator (which doubles as the read-only quality reviewer)
|
|
49
|
-
* will check the worker's output against. Pre-fix the worker had no
|
|
50
|
-
* visibility into this; now it can self-align. */
|
|
51
|
-
export const ANNOTATOR_CHECK_AWARENESS_RO = [
|
|
52
|
-
'After your output, an annotator validates each finding against this rubric:',
|
|
53
|
-
'- Is the severity calibrated to actual impact (or did you inflate)?',
|
|
54
|
-
'- Does the evidence directly support the claim, or is it paraphrased?',
|
|
55
|
-
'- Is the finding within scope, or is it speculation about untouched files?',
|
|
56
|
-
'- Is the finding on-brief (matching the focus / audit type / checklist item)?',
|
|
57
|
-
'Findings that fail any of these are downgraded or dropped. Self-check before emitting.',
|
|
58
|
-
].join('\n');
|
|
59
|
-
/** Awareness block for delegate / execute-plan / retry implementers.
|
|
60
|
-
* Tells the worker what spec_review and quality_review will judge,
|
|
61
|
-
* so the worker self-aligns. */
|
|
62
21
|
export const REVIEWER_AWARENESS_AP = [
|
|
63
22
|
'After your edit, two reviewers see the cumulative diff (every change since task start):',
|
|
64
23
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"finding-criteria.js","sourceRoot":"","sources":["../../../src/review/templates/finding-criteria.ts"],"names":[],"mappings":"AAAA
|
|
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 +1 @@
|
|
|
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;
|
|
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,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildAnnotatorRubric } from './annotator-shared.js';
|
|
2
|
+
import { annotatorAuditTemplate } from './annotator-audit.js';
|
|
2
3
|
export const qualityAuditTemplate = {
|
|
3
4
|
systemPrompt: `You are a quality reviewer checking an audit produced by a worker.
|
|
4
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.`,
|
|
5
6
|
buildUserPrompt(ctx) {
|
|
6
|
-
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${
|
|
7
|
+
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorAuditTemplate)}`;
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=quality-review-audit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-audit.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-audit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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 +1 @@
|
|
|
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;
|
|
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,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildAnnotatorRubric } from './annotator-shared.js';
|
|
2
|
+
import { annotatorDebugTemplate } from './annotator-debug.js';
|
|
2
3
|
export const qualityDebugTemplate = {
|
|
3
4
|
systemPrompt: `You are a quality reviewer checking a debugging hypothesis produced by a worker.
|
|
4
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.`,
|
|
5
6
|
buildUserPrompt(ctx) {
|
|
6
|
-
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${
|
|
7
|
+
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorDebugTemplate)}`;
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=quality-review-debug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-debug.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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 +1 @@
|
|
|
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;
|
|
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,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildAnnotatorRubric } from './annotator-shared.js';
|
|
2
|
+
import { annotatorInvestigateTemplate } from './annotator-investigate.js';
|
|
2
3
|
export const qualityInvestigateTemplate = {
|
|
3
4
|
systemPrompt: `You are a quality reviewer checking a codebase investigation produced by a worker.
|
|
4
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.`,
|
|
5
6
|
buildUserPrompt(ctx) {
|
|
6
|
-
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${
|
|
7
|
+
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorInvestigateTemplate)}`;
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=quality-review-investigate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-investigate.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-investigate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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 +1 @@
|
|
|
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;
|
|
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,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildAnnotatorRubric } from './annotator-shared.js';
|
|
2
|
+
import { annotatorReviewTemplate } from './annotator-review.js';
|
|
2
3
|
export const qualityReviewTemplate = {
|
|
3
4
|
systemPrompt: `You are a quality reviewer checking a code review produced by a worker.
|
|
4
5
|
For each finding, ask: is this within the requested focus area? A security review should produce security findings, not formatting nits.`,
|
|
5
6
|
buildUserPrompt(ctx) {
|
|
6
|
-
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${
|
|
7
|
+
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorReviewTemplate)}`;
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=quality-review-review.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-review.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-review.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-verify.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"quality-review-verify.d.ts","sourceRoot":"","sources":["../../../src/review/templates/quality-review-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,qBAAqB,EAAE,cAMnC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildAnnotatorRubric } from './annotator-shared.js';
|
|
2
|
+
import { annotatorVerifyTemplate } from './annotator-verify.js';
|
|
2
3
|
export const qualityVerifyTemplate = {
|
|
3
4
|
systemPrompt: `You are a quality reviewer checking a verification report produced by a worker.
|
|
4
5
|
Each finding should map to one checklist item with evidence the criterion was met or unmet. Flag findings that do not correspond to any checklist item, or whose evidence does not actually demonstrate the claimed pass/fail status.`,
|
|
5
6
|
buildUserPrompt(ctx) {
|
|
6
|
-
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${
|
|
7
|
+
return `Task: ${ctx.brief}\n\nWorker output:\n${ctx.workerOutput}\n\n${buildAnnotatorRubric(annotatorVerifyTemplate)}`;
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=quality-review-verify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-review-verify.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"quality-review-verify.js","sourceRoot":"","sources":["../../../src/review/templates/quality-review-verify.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;sOACsN;IACpO,eAAe,CAAC,GAAG;QACjB,OAAO,SAAS,GAAG,CAAC,KAAK,uBAAuB,GAAG,CAAC,YAAY,OAAO,oBAAoB,CAAC,uBAAuB,CAAC,EAAE,CAAC;IACzH,CAAC;CACF,CAAC"}
|
|
@@ -8,9 +8,13 @@ export interface FileBackedContextBlockStoreOptions {
|
|
|
8
8
|
maxBlockBytes?: number;
|
|
9
9
|
/** Max total bytes on disk. Defaults to 100 MiB. */
|
|
10
10
|
maxTotalBytes?: number;
|
|
11
|
+
/** Override `os.homedir()` — used by tests for filesystem isolation. */
|
|
12
|
+
homeDir?: string;
|
|
11
13
|
}
|
|
12
14
|
export declare class FileBackedContextBlockStore implements ContextBlockStore {
|
|
13
|
-
|
|
15
|
+
/** Absolute root: `<homeDir>/.multi-model-agent/context-blocks/<sha256(projectCwd)>`.
|
|
16
|
+
* Public so tests can read meta files directly without re-deriving the path. */
|
|
17
|
+
readonly rootDir: string;
|
|
14
18
|
private _ttlMs;
|
|
15
19
|
private gcCheckIntervalMs;
|
|
16
20
|
private maxBlockBytes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-backed-context-block-store.d.ts","sourceRoot":"","sources":["../../src/stores/file-backed-context-block-store.ts"],"names":[],"mappings":"AA0CA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAcjC,MAAM,WAAW,kCAAkC;IACjD,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"file-backed-context-block-store.d.ts","sourceRoot":"","sources":["../../src/stores/file-backed-context-block-store.ts"],"names":[],"mappings":"AA0CA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAcjC,MAAM,WAAW,kCAAkC;IACjD,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,2BAA4B,YAAW,iBAAiB;IACnE;qFACiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAK;IACxB;;kDAE8C;IAC9C,OAAO,CAAC,SAAS,CAA6B;gBAElC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,kCAAuC;IAW7E,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,eAAe;IA+BtE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAoBnC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAO3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIrB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAMvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI5B,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAuBpD,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;qCACiC;IACjC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,qEAAqE;IACrE,KAAK,IAAI,IAAI;IAKb;4CACwC;IACxC,gBAAgB,IAAI,MAAM;IAc1B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,OAAO;IAef,OAAO,CAAC,QAAQ;IAkBhB,OAAO,CAAC,WAAW;IAKnB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAYnB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;CAuBvB"}
|
|
@@ -7,14 +7,17 @@
|
|
|
7
7
|
* everything on `npm run serve` cycles, breaking the recipe. This store
|
|
8
8
|
* persists to disk and reloads lazily on first access.
|
|
9
9
|
*
|
|
10
|
-
* Layout: `<
|
|
11
|
-
* `<id>.meta.json` ({ createdAt, ttlMs, lengthChars, sha256 }).
|
|
10
|
+
* Layout: `<homeDir>/.multi-model-agent/context-blocks/<sha256(projectCwd)>/<id>.txt`
|
|
11
|
+
* (content) + `<id>.meta.json` ({ createdAt, ttlMs, lengthChars, sha256 }).
|
|
12
|
+
* Storing in the user home (not the project tree) keeps repos clean —
|
|
13
|
+
* no `.gitignore` entries needed — while the per-project hash subdir
|
|
14
|
+
* preserves project isolation.
|
|
12
15
|
*
|
|
13
|
-
* Operational properties
|
|
14
|
-
* - **Authoritative cwd**:
|
|
15
|
-
*
|
|
16
|
-
* - **Permissions**:
|
|
17
|
-
* carry sensitive code excerpts; user-only access by default.
|
|
16
|
+
* Operational properties:
|
|
17
|
+
* - **Authoritative cwd**: per-project subdir is `sha256(path.resolve(projectCwd))`.
|
|
18
|
+
* NOT daemon cwd, NOT task cwd.
|
|
19
|
+
* - **Permissions**: directories `0700`, files `0600`. Audit findings
|
|
20
|
+
* can carry sensitive code excerpts; user-only access by default.
|
|
18
21
|
* - **TTL**: 7 days default. Enforced on `get()` (lazy delete on
|
|
19
22
|
* stale read), at the start of `register()` (opportunistic GC if
|
|
20
23
|
* last sweep was over `gcCheckIntervalMs` ago), and via
|
|
@@ -26,10 +29,6 @@
|
|
|
26
29
|
* - **Atomic writes**: temp-file → fsync → rename. GC treats orphaned
|
|
27
30
|
* pairs (content without metadata or vice versa) as corrupt and
|
|
28
31
|
* deletes both — recovers cleanly from daemon SIGKILL mid-write.
|
|
29
|
-
* - **Gitignore awareness**: on first directory creation, log a
|
|
30
|
-
* stderr breadcrumb suggesting `.mma/` be added to the project's
|
|
31
|
-
* `.gitignore` (we do NOT auto-edit the ignore file — surprising
|
|
32
|
-
* and may not be a git repo).
|
|
33
32
|
*
|
|
34
33
|
* Pinning is a no-op on this implementation — disk persistence is
|
|
35
34
|
* stronger than the in-memory pin contract. The `pin`/`unpin` methods
|
|
@@ -39,12 +38,15 @@
|
|
|
39
38
|
*/
|
|
40
39
|
import { createHash, randomUUID } from 'node:crypto';
|
|
41
40
|
import * as fs from 'node:fs';
|
|
41
|
+
import * as os from 'node:os';
|
|
42
42
|
import * as path from 'node:path';
|
|
43
43
|
const DEFAULT_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
44
44
|
const DEFAULT_GC_INTERVAL_MS = 60 * 60 * 1000;
|
|
45
45
|
const DEFAULT_MAX_BLOCK_BYTES = 1 * 1024 * 1024;
|
|
46
46
|
const DEFAULT_MAX_TOTAL_BYTES = 100 * 1024 * 1024;
|
|
47
47
|
export class FileBackedContextBlockStore {
|
|
48
|
+
/** Absolute root: `<homeDir>/.multi-model-agent/context-blocks/<sha256(projectCwd)>`.
|
|
49
|
+
* Public so tests can read meta files directly without re-deriving the path. */
|
|
48
50
|
rootDir;
|
|
49
51
|
_ttlMs;
|
|
50
52
|
gcCheckIntervalMs;
|
|
@@ -56,7 +58,9 @@ export class FileBackedContextBlockStore {
|
|
|
56
58
|
* TTL-based GC handles the recovery side. */
|
|
57
59
|
pinCounts = new Map();
|
|
58
60
|
constructor(projectCwd, opts = {}) {
|
|
59
|
-
|
|
61
|
+
const home = opts.homeDir ?? os.homedir();
|
|
62
|
+
const projectHash = createHash('sha256').update(path.resolve(projectCwd)).digest('hex');
|
|
63
|
+
this.rootDir = path.join(home, '.multi-model-agent', 'context-blocks', projectHash);
|
|
60
64
|
this._ttlMs = opts.ttlMs ?? DEFAULT_TTL_MS;
|
|
61
65
|
this.gcCheckIntervalMs = opts.gcCheckIntervalMs ?? DEFAULT_GC_INTERVAL_MS;
|
|
62
66
|
this.maxBlockBytes = opts.maxBlockBytes ?? DEFAULT_MAX_BLOCK_BYTES;
|
|
@@ -178,14 +182,7 @@ export class FileBackedContextBlockStore {
|
|
|
178
182
|
}
|
|
179
183
|
// ── private helpers ────────────────────────────────────────────────
|
|
180
184
|
ensureRoot() {
|
|
181
|
-
const created = !fs.existsSync(this.rootDir);
|
|
182
185
|
fs.mkdirSync(this.rootDir, { recursive: true, mode: 0o700 });
|
|
183
|
-
if (created) {
|
|
184
|
-
// First-creation breadcrumb: nudge the user about gitignore. We
|
|
185
|
-
// intentionally do NOT modify their .gitignore — that would
|
|
186
|
-
// surprise users + may not be a git repo at all.
|
|
187
|
-
process.stderr.write(`[mmagent] created ${this.rootDir} — add ".mma/" to .gitignore (contains worker-output context blocks)\n`);
|
|
188
|
-
}
|
|
189
186
|
}
|
|
190
187
|
contentPath(id) {
|
|
191
188
|
return path.join(this.rootDir, `${id}.txt`);
|