@zhixuan92/multi-model-agent-core 4.0.3 → 4.0.5
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 +10 -12
- 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 +2 -45
- 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/diff-tracker.d.ts +72 -0
- package/dist/lifecycle/diff-tracker.d.ts.map +1 -0
- package/dist/lifecycle/diff-tracker.js +316 -0
- package/dist/lifecycle/diff-tracker.js.map +1 -0
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts +1 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts.map +1 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js +23 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js.map +1 -1
- package/dist/lifecycle/handlers/quality-chain-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/quality-chain-handlers.js +57 -6
- package/dist/lifecycle/handlers/quality-chain-handlers.js.map +1 -1
- package/dist/lifecycle/handlers/review-diff-handler.d.ts.map +1 -1
- package/dist/lifecycle/handlers/review-diff-handler.js +38 -12
- package/dist/lifecycle/handlers/review-diff-handler.js.map +1 -1
- package/dist/lifecycle/handlers/spec-chain-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/spec-chain-handlers.js +38 -10
- package/dist/lifecycle/handlers/spec-chain-handlers.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/merge-stage-stats.d.ts +27 -0
- package/dist/lifecycle/merge-stage-stats.d.ts.map +1 -1
- package/dist/lifecycle/merge-stage-stats.js +56 -0
- package/dist/lifecycle/merge-stage-stats.js.map +1 -1
- package/dist/lifecycle/stage-plan-types.d.ts +15 -0
- package/dist/lifecycle/stage-plan-types.d.ts.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-runner.js +1 -1
- package/dist/lifecycle/task-runner.js.map +1 -1
- package/dist/providers/provider-factory.d.ts.map +1 -1
- package/dist/providers/provider-factory.js +6 -0
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/reporting/headline-templates/audit.d.ts.map +1 -1
- package/dist/reporting/headline-templates/audit.js +17 -8
- package/dist/reporting/headline-templates/audit.js.map +1 -1
- package/dist/reporting/headline-templates/debug.d.ts +22 -3
- package/dist/reporting/headline-templates/debug.d.ts.map +1 -1
- package/dist/reporting/headline-templates/debug.js +38 -8
- package/dist/reporting/headline-templates/debug.js.map +1 -1
- package/dist/reporting/headline-templates/delegate.d.ts.map +1 -1
- package/dist/reporting/headline-templates/delegate.js +14 -3
- package/dist/reporting/headline-templates/delegate.js.map +1 -1
- package/dist/reporting/headline-templates/execute-plan.d.ts.map +1 -1
- package/dist/reporting/headline-templates/execute-plan.js +17 -8
- package/dist/reporting/headline-templates/execute-plan.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/headline-templates/review.d.ts.map +1 -1
- package/dist/reporting/headline-templates/review.js +23 -6
- package/dist/reporting/headline-templates/review.js.map +1 -1
- package/dist/reporting/headline-templates/verify.d.ts.map +1 -1
- package/dist/reporting/headline-templates/verify.js +23 -6
- package/dist/reporting/headline-templates/verify.js.map +1 -1
- package/dist/reporting/headline-text.d.ts +5 -0
- package/dist/reporting/headline-text.d.ts.map +1 -1
- package/dist/reporting/headline-text.js +36 -5
- package/dist/reporting/headline-text.js.map +1 -1
- 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/reporting/report-parser-slots/verify-report.d.ts +17 -0
- package/dist/reporting/report-parser-slots/verify-report.d.ts.map +1 -1
- package/dist/reporting/report-parser-slots/verify-report.js +45 -3
- package/dist/reporting/report-parser-slots/verify-report.js.map +1 -1
- package/dist/reporting/severity.d.ts +22 -0
- package/dist/reporting/severity.d.ts.map +1 -1
- package/dist/reporting/severity.js +36 -0
- package/dist/reporting/severity.js.map +1 -1
- package/dist/review/annotator-output-parser.d.ts.map +1 -1
- package/dist/review/annotator-output-parser.js +94 -14
- package/dist/review/annotator-output-parser.js.map +1 -1
- package/dist/review/annotator-prompt-builder.d.ts +20 -0
- package/dist/review/annotator-prompt-builder.d.ts.map +1 -1
- package/dist/review/annotator-prompt-builder.js +54 -3
- package/dist/review/annotator-prompt-builder.js.map +1 -1
- package/dist/review/reviewer-engine.d.ts +15 -1
- package/dist/review/reviewer-engine.d.ts.map +1 -1
- package/dist/review/reviewer-engine.js.map +1 -1
- package/dist/review/reviewer-output-parser.d.ts.map +1 -1
- package/dist/review/reviewer-output-parser.js +171 -16
- package/dist/review/reviewer-output-parser.js.map +1 -1
- package/dist/review/reviewer-prompt-builder.d.ts +5 -13
- package/dist/review/reviewer-prompt-builder.d.ts.map +1 -1
- package/dist/review/reviewer-prompt-builder.js.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/diff-review.d.ts +8 -0
- package/dist/review/templates/diff-review.d.ts.map +1 -1
- package/dist/review/templates/diff-review.js +34 -2
- package/dist/review/templates/diff-review.js.map +1 -1
- package/dist/review/templates/finding-criteria.d.ts +15 -0
- package/dist/review/templates/finding-criteria.d.ts.map +1 -0
- package/dist/review/templates/finding-criteria.js +39 -0
- package/dist/review/templates/finding-criteria.js.map +1 -0
- package/dist/review/templates/quality-review-artifact.d.ts +13 -0
- package/dist/review/templates/quality-review-artifact.d.ts.map +1 -1
- package/dist/review/templates/quality-review-artifact.js +41 -3
- package/dist/review/templates/quality-review-artifact.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/review/templates/shared.d.ts +22 -5
- package/dist/review/templates/shared.d.ts.map +1 -1
- package/dist/review/templates/spec-review.d.ts +15 -0
- package/dist/review/templates/spec-review.d.ts.map +1 -1
- package/dist/review/templates/spec-review.js +43 -3
- package/dist/review/templates/spec-review.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.d.ts.map +1 -1
- package/dist/tools/audit/tool-config.js +24 -6
- 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.d.ts.map +1 -1
- package/dist/tools/debug/tool-config.js +18 -4
- package/dist/tools/debug/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 +5 -1
- package/dist/tools/execute-plan/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.d.ts +13 -1
- package/dist/tools/investigate/tool-config.d.ts.map +1 -1
- package/dist/tools/investigate/tool-config.js +34 -4
- 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/retry/tool-config.d.ts.map +1 -1
- package/dist/tools/retry/tool-config.js +27 -4
- package/dist/tools/retry/tool-config.js.map +1 -1
- 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 +43 -4
- 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.d.ts.map +1 -1
- package/dist/tools/verify/tool-config.js +18 -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/investigate.d.ts +0 -26
- package/dist/intake/brief-compiler-slots/investigate.d.ts.map +0 -1
- package/dist/intake/brief-compiler-slots/investigate.js +0 -42
- package/dist/intake/brief-compiler-slots/investigate.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,25 +1,3 @@
|
|
|
1
|
-
import type { DraftTask } from '../types.js';
|
|
2
|
-
export interface DebugTaskInput {
|
|
3
|
-
problem: string;
|
|
4
|
-
context?: string;
|
|
5
|
-
hypothesis?: string;
|
|
6
|
-
filePaths?: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare function compileDebugTask(input: DebugTaskInput, requestId: string): DraftTask[];
|
|
9
|
-
export interface DebugInput {
|
|
10
|
-
problemStatement: string;
|
|
11
|
-
reproSteps?: string;
|
|
12
|
-
cwd?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface DebugBrief {
|
|
15
|
-
taskIndex: number;
|
|
16
|
-
brief: string;
|
|
17
|
-
cwd: string;
|
|
18
|
-
agentType: 'complex';
|
|
19
|
-
reviewPolicy: 'quality_only';
|
|
20
|
-
contextBlockIds: string[];
|
|
21
|
-
}
|
|
22
|
-
export declare function debugSlot(input: DebugInput): DebugBrief[];
|
|
23
1
|
export interface ToolDebugBrief {
|
|
24
2
|
problem: string;
|
|
25
3
|
context?: string;
|
|
@@ -27,10 +5,6 @@ export interface ToolDebugBrief {
|
|
|
27
5
|
filePaths?: string[];
|
|
28
6
|
contextBlockIds?: string[];
|
|
29
7
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Compiles the tool input into a single brief for the generic task executor.
|
|
32
|
-
* Debug always produces exactly 1 task.
|
|
33
|
-
*/
|
|
34
8
|
export declare function debugBriefSlot(input: {
|
|
35
9
|
problem: string;
|
|
36
10
|
context?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/debug.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/debug.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,GAAG,cAAc,EAAE,CAQnB"}
|
|
@@ -1,49 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const SCOPE_CONTRACT = `
|
|
3
|
-
Reproduce the reported failure first. Read code along the failure path. Do NOT speculatively read unrelated subsystems.
|
|
4
|
-
`.trim();
|
|
5
|
-
export function compileDebugTask(input, requestId) {
|
|
6
|
-
const promptParts = [];
|
|
7
|
-
promptParts.push(`Problem to debug: ${input.problem}`);
|
|
8
|
-
if (input.context) {
|
|
9
|
-
promptParts.push(`\nContext:\n${input.context}`);
|
|
10
|
-
}
|
|
11
|
-
if (input.hypothesis) {
|
|
12
|
-
promptParts.push(`\nHypothesis: ${input.hypothesis}`);
|
|
13
|
-
}
|
|
14
|
-
if (input.filePaths?.length) {
|
|
15
|
-
promptParts.push(`\nFiles involved: ${input.filePaths.join(', ')}`);
|
|
16
|
-
}
|
|
17
|
-
promptParts.push(`\n${SCOPE_CONTRACT}`);
|
|
1
|
+
export function debugBriefSlot(input) {
|
|
18
2
|
return [{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
originalInput: input,
|
|
23
|
-
problem: input.problem,
|
|
24
|
-
context: input.context,
|
|
25
|
-
hypothesis: input.hypothesis,
|
|
26
|
-
},
|
|
27
|
-
prompt: promptParts.join(''),
|
|
3
|
+
problem: input.problem,
|
|
4
|
+
context: input.context,
|
|
5
|
+
hypothesis: input.hypothesis,
|
|
28
6
|
filePaths: input.filePaths,
|
|
29
|
-
|
|
30
|
-
}];
|
|
31
|
-
}
|
|
32
|
-
export function debugSlot(input) {
|
|
33
|
-
return [{
|
|
34
|
-
taskIndex: 0,
|
|
35
|
-
brief: `Debug:\n${input.problemStatement}\n\nRepro:\n${input.reproSteps ?? '(none)'}`,
|
|
36
|
-
cwd: input.cwd ?? process.cwd(),
|
|
37
|
-
agentType: 'complex',
|
|
38
|
-
reviewPolicy: 'quality_only',
|
|
39
|
-
contextBlockIds: [],
|
|
7
|
+
contextBlockIds: input.contextBlockIds,
|
|
40
8
|
}];
|
|
41
9
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Compiles the tool input into a single brief for the generic task executor.
|
|
44
|
-
* Debug always produces exactly 1 task.
|
|
45
|
-
*/
|
|
46
|
-
export function debugBriefSlot(input) {
|
|
47
|
-
return [{ problem: input.problem, context: input.context, hypothesis: input.hypothesis, filePaths: input.filePaths, contextBlockIds: input.contextBlockIds }];
|
|
48
|
-
}
|
|
49
10
|
//# sourceMappingURL=debug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/debug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/debug.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,cAAc,CAAC,KAM9B;IACC,OAAO,CAAC;YACN,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,eAAe,EAAE,KAAK,CAAC,eAAe;SACvC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
import type { DraftTask } from '../types.js';
|
|
2
1
|
export type ReviewPolicy = 'full' | 'quality_only' | 'diff_only' | 'none';
|
|
3
|
-
export interface DelegateTaskInput {
|
|
4
|
-
prompt: string;
|
|
5
|
-
done?: string;
|
|
6
|
-
filePaths?: string[];
|
|
7
|
-
agentType?: 'standard' | 'complex';
|
|
8
|
-
contextBlockIds?: string[];
|
|
9
|
-
reviewPolicy?: ReviewPolicy;
|
|
10
|
-
verifyCommand?: string[];
|
|
11
|
-
}
|
|
12
2
|
export declare function compileDelegatePrompt(input: {
|
|
13
3
|
prompt: string;
|
|
14
4
|
filePaths?: string[];
|
|
15
5
|
}): string;
|
|
16
|
-
export declare function compileDelegateTasks(tasks: DelegateTaskInput[] | null | undefined, requestId: string): DraftTask[];
|
|
17
|
-
export interface DelegateInput {
|
|
18
|
-
tasks: DelegateTaskInput[];
|
|
19
|
-
requestId?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface DelegateBrief {
|
|
22
|
-
taskIndex: number;
|
|
23
|
-
brief: string;
|
|
24
|
-
cwd: string;
|
|
25
|
-
agentType: 'standard' | 'complex';
|
|
26
|
-
reviewPolicy: ReviewPolicy;
|
|
27
|
-
contextBlockIds: string[];
|
|
28
|
-
}
|
|
29
|
-
export declare function delegateSlot(input: DelegateInput): DelegateBrief[];
|
|
30
6
|
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/delegate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/delegate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,MAAM,CAAC;AAI1E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAK7F"}
|
|
@@ -1,52 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { REVIEWER_AWARENESS_AP } from '../../review/templates/finding-criteria.js';
|
|
2
2
|
const SCOPE_CONTRACT = `Stay scoped to the explicit task description. Do NOT enlarge the task. If the task references files, read those files first; do not enumerate adjacent ones.`;
|
|
3
3
|
export function compileDelegatePrompt(input) {
|
|
4
|
-
// When the caller pinned filePaths, surface them as a hard constraint
|
|
5
|
-
// in the prompt. v4.0.x dropped this on the floor — the brief carried
|
|
6
|
-
// filePaths as metadata only and the worker freelanced filenames
|
|
7
|
-
// (e.g. wrote `triangleArea.ts` for a `triangle.ts` ask). The worker
|
|
8
|
-
// must write to EXACTLY these files; no synonyms, no rename, no extra.
|
|
9
4
|
const filePathsClause = input.filePaths && input.filePaths.length > 0
|
|
10
5
|
? `\n\nFILE CONSTRAINT: write your code to exactly these file path(s), no others, no renames: ${input.filePaths.map((p) => `\`${p}\``).join(', ')}.`
|
|
11
6
|
: '';
|
|
12
|
-
return `${input.prompt}\n\n${SCOPE_CONTRACT}${filePathsClause}`;
|
|
13
|
-
}
|
|
14
|
-
export function compileDelegateTasks(tasks, requestId) {
|
|
15
|
-
if (tasks == null) {
|
|
16
|
-
console.warn('compileDelegateTasks: tasks is null/undefined; returning no drafts');
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
if (tasks.length === 0) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
return tasks.map((task, index) => {
|
|
23
|
-
const originalInput = structuredClone(task);
|
|
24
|
-
return {
|
|
25
|
-
draftId: createDraftId(requestId, index, 'root'),
|
|
26
|
-
source: {
|
|
27
|
-
route: 'delegate_tasks',
|
|
28
|
-
originalInput,
|
|
29
|
-
},
|
|
30
|
-
prompt: compileDelegatePrompt({ prompt: task.prompt, filePaths: task.filePaths }),
|
|
31
|
-
done: task.done,
|
|
32
|
-
filePaths: task.filePaths,
|
|
33
|
-
agentType: task.agentType,
|
|
34
|
-
contextBlockIds: task.contextBlockIds,
|
|
35
|
-
reviewPolicy: task.reviewPolicy,
|
|
36
|
-
verifyCommand: task.verifyCommand,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export function delegateSlot(input) {
|
|
41
|
-
const requestId = input.requestId ?? 'req-' + Date.now().toString(36);
|
|
42
|
-
const drafts = compileDelegateTasks(input.tasks, requestId);
|
|
43
|
-
return drafts.map((draft, index) => ({
|
|
44
|
-
taskIndex: index,
|
|
45
|
-
brief: draft.prompt,
|
|
46
|
-
cwd: process.cwd(),
|
|
47
|
-
agentType: draft.agentType ?? 'standard',
|
|
48
|
-
reviewPolicy: draft.reviewPolicy ?? 'full',
|
|
49
|
-
contextBlockIds: draft.contextBlockIds ?? [],
|
|
50
|
-
}));
|
|
7
|
+
return `${input.prompt}\n\n${SCOPE_CONTRACT}${filePathsClause}\n\n${REVIEWER_AWARENESS_AP}`;
|
|
51
8
|
}
|
|
52
9
|
//# sourceMappingURL=delegate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/delegate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAInF,MAAM,cAAc,GAAG,8JAA8J,CAAC;AAEtL,MAAM,UAAU,qBAAqB,CAAC,KAA+C;IACnF,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;QACnE,CAAC,CAAC,8FAA8F,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACpJ,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,GAAG,KAAK,CAAC,MAAM,OAAO,cAAc,GAAG,eAAe,OAAO,qBAAqB,EAAE,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TaskSpec } from '../../types.js';
|
|
2
|
+
import type { Input } from '../../tools/research/schema.js';
|
|
3
|
+
export interface ResolvedContextBlock {
|
|
4
|
+
id: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CompileExtras {
|
|
8
|
+
userSources: readonly string[];
|
|
9
|
+
hasBrave: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CompileResearchResult {
|
|
12
|
+
task: Omit<TaskSpec, 'route'> & {
|
|
13
|
+
route: string;
|
|
14
|
+
originalInput: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function compileResearch(input: Input, resolvedContextBlocks: ResolvedContextBlock[], cwd: string, extras: CompileExtras): CompileResearchResult;
|
|
18
|
+
//# sourceMappingURL=research.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/research.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAS5D,MAAM,WAAW,oBAAoB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;CAAE;AAEtE,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IAMpC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxC,CAAC;CACH;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,oBAAoB,EAAE,EAC7C,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,GACpB,qBAAqB,CA2CvB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EVIDENCE_RULE_RESEARCH, TRUST_BOUNDARY_USER_SOURCES_RESEARCH, TRUST_BOUNDARY_EXTERNAL_DATA_RESEARCH, QUERY_PHRASING_RESEARCH, strategyRuleResearch, } from '../../tools/research/implementer-criteria.js';
|
|
2
|
+
export function compileResearch(input, resolvedContextBlocks, cwd, extras) {
|
|
3
|
+
const priorContext = resolvedContextBlocks.length
|
|
4
|
+
? `## Prior context (read-only)\n\n${resolvedContextBlocks.map(b => b.content).join('\n\n---\n\n')}\n\n`
|
|
5
|
+
: '';
|
|
6
|
+
const userSourcesBlock = extras.userSources.length
|
|
7
|
+
? extras.userSources.map((s, i) => `${i}. ${s}`).join('\n')
|
|
8
|
+
: '(none configured)';
|
|
9
|
+
const prompt = `${priorContext}You are an external researcher. The caller wants to discover external ideas, sources, and practices relevant to their question; your job is to bring back substantive external material with citations.
|
|
10
|
+
|
|
11
|
+
**Background:** ${input.background}
|
|
12
|
+
**Research question:** ${input.researchQuestion}
|
|
13
|
+
|
|
14
|
+
**User-described sources (free text — interpret each one):**
|
|
15
|
+
${userSourcesBlock}
|
|
16
|
+
|
|
17
|
+
${TRUST_BOUNDARY_USER_SOURCES_RESEARCH}
|
|
18
|
+
|
|
19
|
+
${strategyRuleResearch(extras.hasBrave)}
|
|
20
|
+
|
|
21
|
+
${TRUST_BOUNDARY_EXTERNAL_DATA_RESEARCH}
|
|
22
|
+
|
|
23
|
+
${QUERY_PHRASING_RESEARCH}
|
|
24
|
+
|
|
25
|
+
${EVIDENCE_RULE_RESEARCH}`;
|
|
26
|
+
return {
|
|
27
|
+
task: {
|
|
28
|
+
route: 'research',
|
|
29
|
+
prompt,
|
|
30
|
+
tools: 'readonly',
|
|
31
|
+
sandboxPolicy: 'cwd-only',
|
|
32
|
+
cwd,
|
|
33
|
+
agentType: 'complex',
|
|
34
|
+
reviewPolicy: 'none',
|
|
35
|
+
originalInput: {
|
|
36
|
+
researchQuestion: input.researchQuestion,
|
|
37
|
+
background: input.background,
|
|
38
|
+
contextBlockIds: input.contextBlockIds,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=research.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/research.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,qCAAqC,EACrC,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,8CAA8C,CAAC;AAqBtD,MAAM,UAAU,eAAe,CAC7B,KAAY,EACZ,qBAA6C,EAC7C,GAAW,EACX,MAAqB;IAErB,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM;QAC/C,CAAC,CAAC,mCAAmC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM;QACxG,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM;QAChD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3D,CAAC,CAAC,mBAAmB,CAAC;IAExB,MAAM,MAAM,GAAG,GAAG,YAAY;;kBAEd,KAAK,CAAC,UAAU;yBACT,KAAK,CAAC,gBAAgB;;;EAG7C,gBAAgB;;EAEhB,oCAAoC;;EAEpC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC;;EAErC,qCAAqC;;EAErC,uBAAuB;;EAEvB,sBAAsB,EAAE,CAAC;IAEzB,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,UAAmB;YAC1B,MAAM;YACN,KAAK,EAAE,UAAmB;YAC1B,aAAa,EAAE,UAAmB;YAClC,GAAG;YACH,SAAS,EAAE,SAAkB;YAC7B,YAAY,EAAE,MAAe;YAC7B,aAAa,EAAE;gBACb,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;aACZ;SAC7B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import type { DraftTask } from '../types.js';
|
|
2
1
|
import type { Input } from '../../tools/review/schema.js';
|
|
3
|
-
export interface ReviewCodeInput {
|
|
4
|
-
code?: string;
|
|
5
|
-
inlineContent?: string;
|
|
6
|
-
filePaths?: string[];
|
|
7
|
-
focus?: string[];
|
|
8
|
-
}
|
|
9
|
-
export declare function compileReviewCode(input: ReviewCodeInput, requestId: string): DraftTask[];
|
|
10
|
-
export interface ReviewInput {
|
|
11
|
-
filePaths: string[];
|
|
12
|
-
checklist?: string;
|
|
13
|
-
cwd?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ReviewBriefV0 {
|
|
16
|
-
taskIndex: number;
|
|
17
|
-
brief: string;
|
|
18
|
-
cwd: string;
|
|
19
|
-
agentType: 'complex';
|
|
20
|
-
reviewPolicy: 'quality_only';
|
|
21
|
-
contextBlockIds: string[];
|
|
22
|
-
filePath: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function reviewSlot(input: ReviewInput): ReviewBriefV0[];
|
|
25
2
|
export interface ReviewBrief {
|
|
26
3
|
filePath?: string;
|
|
27
4
|
code?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,EAAE,CAoB3D"}
|
|
@@ -1,65 +1,3 @@
|
|
|
1
|
-
import { createDraftId, escapeFanoutKey, canonicalizePath } from '../draft-id.js';
|
|
2
|
-
// ── Legacy intake compiler ──
|
|
3
|
-
const SCOPE_CONTRACT = `Review the specified files in scope. Cross-reference call sites and types only when needed to validate a finding. Do NOT review code outside the requested scope.`;
|
|
4
|
-
export function compileReviewCode(input, requestId) {
|
|
5
|
-
const filePaths = input.filePaths ?? [];
|
|
6
|
-
if (filePaths.length <= 1 && !input.code && !input.inlineContent) {
|
|
7
|
-
const nodeId = filePaths.length === 1 ? escapeFanoutKey(canonicalizePath(filePaths[0])) : 'root';
|
|
8
|
-
const promptParts = [];
|
|
9
|
-
if (filePaths.length)
|
|
10
|
-
promptParts.push(`Files to review: ${filePaths.join(', ')}`);
|
|
11
|
-
if (input.focus?.length)
|
|
12
|
-
promptParts.push(`Focus areas: ${input.focus.join(', ')}`);
|
|
13
|
-
promptParts.push('Provide a structured review with findings and recommendations.');
|
|
14
|
-
promptParts.push(SCOPE_CONTRACT);
|
|
15
|
-
return [{
|
|
16
|
-
draftId: createDraftId(requestId, 0, nodeId),
|
|
17
|
-
source: {
|
|
18
|
-
route: 'review_code',
|
|
19
|
-
originalInput: structuredClone(input),
|
|
20
|
-
code: input.code,
|
|
21
|
-
inlineContent: input.inlineContent,
|
|
22
|
-
focus: input.focus,
|
|
23
|
-
},
|
|
24
|
-
prompt: promptParts.join('\n\n'),
|
|
25
|
-
filePaths,
|
|
26
|
-
skipCompletionHeuristic: true,
|
|
27
|
-
}];
|
|
28
|
-
}
|
|
29
|
-
return filePaths.map((filePath, index) => {
|
|
30
|
-
const nodeId = escapeFanoutKey(canonicalizePath(filePath));
|
|
31
|
-
const promptParts = [];
|
|
32
|
-
promptParts.push(`Review this file: ${filePath}`);
|
|
33
|
-
if (input.focus?.length)
|
|
34
|
-
promptParts.push(`Focus areas: ${input.focus.join(', ')}`);
|
|
35
|
-
promptParts.push('Provide a structured review with findings and recommendations.');
|
|
36
|
-
promptParts.push(SCOPE_CONTRACT);
|
|
37
|
-
return {
|
|
38
|
-
draftId: createDraftId(requestId, index, nodeId),
|
|
39
|
-
source: {
|
|
40
|
-
route: 'review_code',
|
|
41
|
-
originalInput: structuredClone(input),
|
|
42
|
-
code: input.code,
|
|
43
|
-
inlineContent: input.inlineContent,
|
|
44
|
-
focus: input.focus,
|
|
45
|
-
},
|
|
46
|
-
prompt: promptParts.join('\n\n'),
|
|
47
|
-
filePaths: [filePath],
|
|
48
|
-
skipCompletionHeuristic: true,
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export function reviewSlot(input) {
|
|
53
|
-
return input.filePaths.map((p, i) => ({
|
|
54
|
-
taskIndex: i,
|
|
55
|
-
brief: `Review ${p} against the project's review checklist:\n${input.checklist ?? '(default)'}`,
|
|
56
|
-
cwd: input.cwd ?? process.cwd(),
|
|
57
|
-
agentType: 'complex',
|
|
58
|
-
reviewPolicy: 'quality_only',
|
|
59
|
-
contextBlockIds: [],
|
|
60
|
-
filePath: p,
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
1
|
function hasContent(value) {
|
|
64
2
|
return value !== undefined && value.trim().length > 0;
|
|
65
3
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/review.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../src/intake/brief-compiler-slots/review.ts"],"names":[],"mappings":"AAWA,SAAS,UAAU,CAAC,KAAyB;IAC3C,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAClG,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE5E,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,CAAC;gBACN,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,gBAAgB;gBAChB,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE;aAC7C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,gBAAgB;QAChB,eAAe,EAAE,KAAK,CAAC,eAAe,IAAI,EAAE;KAC7C,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffTracker — snapshot files at task start, produce a cumulative
|
|
3
|
+
* unified diff at any point during the lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* Tool sweep #6 motivation: every reviewer template (spec / quality /
|
|
6
|
+
* diff) was reviewing the worker's TEXT CLAIM about its work, not the
|
|
7
|
+
* actual change on disk. Result:
|
|
8
|
+
* - Spec reviewers defaulted to "changes_required" because they
|
|
9
|
+
* could not verify a claim they couldn't see → endless rework
|
|
10
|
+
* spirals on already-correct work.
|
|
11
|
+
* - Quality findings were rooted in the worker's prose summary
|
|
12
|
+
* rather than diff lines → false positives, missed regressions.
|
|
13
|
+
* - The "diff reviewer" did not actually receive a diff (a misnomer).
|
|
14
|
+
*
|
|
15
|
+
* Fix: every reviewer prompt now receives `cumulativeDiff` — the
|
|
16
|
+
* unified diff of every change made since task start, regardless of
|
|
17
|
+
* which rework round produced it. With evidence in hand the reviewer
|
|
18
|
+
* can be precise: "diff matches brief? approve" — single round, no
|
|
19
|
+
* spiral, no waste.
|
|
20
|
+
*
|
|
21
|
+
* "Cumulative" matters: across spec_rework rounds 1..N, the reviewer
|
|
22
|
+
* needs to see the totality of edits so it can confirm prior reworks'
|
|
23
|
+
* additions are still present. A latest-round-only diff would make
|
|
24
|
+
* the round-2 reviewer say "you didn't add Y" when round-1 actually
|
|
25
|
+
* did.
|
|
26
|
+
*
|
|
27
|
+
* Implementation choice: snapshot-based, NOT git-based.
|
|
28
|
+
* - Works in non-git directories (test fixtures, sandboxes,
|
|
29
|
+
* fresh-scaffold projects).
|
|
30
|
+
* - No assumption about HEAD state.
|
|
31
|
+
* - No mutation of `.git/` (no `add -N`, no temporary index entries).
|
|
32
|
+
* - Captures new files cleanly (baseline=null → full new-file diff).
|
|
33
|
+
*
|
|
34
|
+
* Diff format: unified diff (`@@ -before,count +after,count @@`)
|
|
35
|
+
* generated via Myers-style line LCS. The LLM is the consumer; the
|
|
36
|
+
* format is what every model has been trained on.
|
|
37
|
+
*
|
|
38
|
+
* Output cap: 50KB total. Excess is truncated with a "[diff truncated
|
|
39
|
+
* at 50KB — N more bytes elided]" marker so the LLM knows the diff is
|
|
40
|
+
* incomplete and can react accordingly (rather than silently judging
|
|
41
|
+
* a partial picture).
|
|
42
|
+
*/
|
|
43
|
+
export declare class DiffTracker {
|
|
44
|
+
private cwd;
|
|
45
|
+
private baselines;
|
|
46
|
+
constructor(cwd: string);
|
|
47
|
+
/**
|
|
48
|
+
* Capture current file content as the baseline. Idempotent: if a
|
|
49
|
+
* path was already snapshotted, the existing baseline wins (the
|
|
50
|
+
* earliest-known content is the canonical pre-task state).
|
|
51
|
+
*
|
|
52
|
+
* Call once at task start with all `task.filePaths`; call again
|
|
53
|
+
* lazily (via `ensureSnapshotted`) if a worker writes a path that
|
|
54
|
+
* wasn't pre-declared.
|
|
55
|
+
*/
|
|
56
|
+
snapshot(relativePaths: ReadonlyArray<string>): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Defensive: if the worker writes a file that wasn't pre-declared
|
|
59
|
+
* in `task.filePaths`, we don't have a baseline for it. Capture
|
|
60
|
+
* one NOW (whatever the file's current state) so subsequent diffs
|
|
61
|
+
* show only what THIS rework round changed for it. This is a
|
|
62
|
+
* best-effort fallback; the operator should declare filePaths.
|
|
63
|
+
*/
|
|
64
|
+
ensureSnapshotted(relativePath: string): Promise<void>;
|
|
65
|
+
/** Return the unified diff of every snapshotted path against its
|
|
66
|
+
* current on-disk content. Empty string when nothing changed.
|
|
67
|
+
* Capped at MAX_DIFF_BYTES with a truncation marker. */
|
|
68
|
+
cumulativeDiff(): Promise<string>;
|
|
69
|
+
/** Test hook: how many baselines have been captured. */
|
|
70
|
+
size(): number;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=diff-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-tracker.d.ts","sourceRoot":"","sources":["../../src/lifecycle/diff-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAYH,qBAAa,WAAW;IAGV,OAAO,CAAC,GAAG;IAFvB,OAAO,CAAC,SAAS,CAA+B;gBAE5B,GAAG,EAAE,MAAM;IAE/B;;;;;;;;OAQG;IACG,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBnE;;;;;;OAMG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;6DAEyD;IACnD,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBvC,wDAAwD;IACxD,IAAI,IAAI,MAAM;CAGf"}
|