@zhixuan92/multi-model-agent-core 4.2.2 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/config/schema.d.ts +1 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +4 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/error-codes.d.ts +1 -0
- package/dist/error-codes.d.ts.map +1 -1
- package/dist/error-codes.js +2 -0
- package/dist/error-codes.js.map +1 -1
- package/dist/events/telemetry-types.d.ts +24 -20
- package/dist/events/telemetry-types.d.ts.map +1 -1
- package/dist/identity/auth-token-store.d.ts +36 -0
- package/dist/identity/auth-token-store.d.ts.map +1 -1
- package/dist/identity/auth-token-store.js +71 -2
- package/dist/identity/auth-token-store.js.map +1 -1
- package/dist/identity/cwd-validator.d.ts.map +1 -1
- package/dist/identity/cwd-validator.js +15 -3
- package/dist/identity/cwd-validator.js.map +1 -1
- package/dist/identity/main-model-resolver.d.ts +14 -0
- package/dist/identity/main-model-resolver.d.ts.map +1 -0
- package/dist/identity/main-model-resolver.js +83 -0
- package/dist/identity/main-model-resolver.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/intake/brief-compiler-slots/delegate.d.ts +10 -11
- package/dist/intake/brief-compiler-slots/delegate.d.ts.map +1 -1
- package/dist/intake/brief-compiler-slots/delegate.js +12 -14
- package/dist/intake/brief-compiler-slots/delegate.js.map +1 -1
- package/dist/intake/brief-compiler-slots/execute-plan.js +3 -1
- package/dist/intake/brief-compiler-slots/execute-plan.js.map +1 -1
- package/dist/intake/context-overflow-estimator.d.ts +33 -0
- package/dist/intake/context-overflow-estimator.d.ts.map +1 -0
- package/dist/intake/context-overflow-estimator.js +36 -0
- package/dist/intake/context-overflow-estimator.js.map +1 -0
- package/dist/intake/pipeline.d.ts.map +1 -1
- package/dist/intake/pipeline.js +46 -0
- package/dist/intake/pipeline.js.map +1 -1
- package/dist/intake/plan-extractor.d.ts.map +1 -1
- package/dist/intake/plan-extractor.js +10 -1
- package/dist/intake/plan-extractor.js.map +1 -1
- package/dist/intake/types.d.ts +1 -0
- package/dist/intake/types.d.ts.map +1 -1
- package/dist/lifecycle/diff-tracker.d.ts +17 -1
- package/dist/lifecycle/diff-tracker.d.ts.map +1 -1
- package/dist/lifecycle/diff-tracker.js +115 -2
- package/dist/lifecycle/diff-tracker.js.map +1 -1
- package/dist/lifecycle/handlers/annotate-completion-handler.d.ts +9 -0
- package/dist/lifecycle/handlers/annotate-completion-handler.d.ts.map +1 -0
- package/dist/lifecycle/handlers/annotate-completion-handler.js +171 -0
- package/dist/lifecycle/handlers/annotate-completion-handler.js.map +1 -0
- package/dist/lifecycle/handlers/annotate-criteria-handler.d.ts +3 -0
- package/dist/lifecycle/handlers/annotate-criteria-handler.d.ts.map +1 -0
- package/dist/lifecycle/handlers/annotate-criteria-handler.js +67 -0
- package/dist/lifecycle/handlers/annotate-criteria-handler.js.map +1 -0
- package/dist/lifecycle/handlers/baseline-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/baseline-handlers.js +106 -71
- package/dist/lifecycle/handlers/baseline-handlers.js.map +1 -1
- package/dist/lifecycle/handlers/review-handler.d.ts +3 -0
- package/dist/lifecycle/handlers/review-handler.d.ts.map +1 -0
- package/dist/lifecycle/handlers/review-handler.js +141 -0
- package/dist/lifecycle/handlers/review-handler.js.map +1 -0
- package/dist/lifecycle/handlers/rework-handler.d.ts +3 -0
- package/dist/lifecycle/handlers/rework-handler.d.ts.map +1 -0
- package/dist/lifecycle/handlers/rework-handler.js +77 -0
- package/dist/lifecycle/handlers/rework-handler.js.map +1 -0
- package/dist/lifecycle/handlers/terminal-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/terminal-handlers.js +16 -3
- package/dist/lifecycle/handlers/terminal-handlers.js.map +1 -1
- package/dist/lifecycle/lifecycle-context.d.ts +4 -0
- package/dist/lifecycle/lifecycle-context.d.ts.map +1 -1
- package/dist/lifecycle/lifecycle-driver.d.ts.map +1 -1
- package/dist/lifecycle/lifecycle-driver.js +12 -7
- package/dist/lifecycle/lifecycle-driver.js.map +1 -1
- package/dist/lifecycle/parallel-criteria-routes.d.ts +1 -1
- package/dist/lifecycle/parallel-criteria-routes.d.ts.map +1 -1
- package/dist/lifecycle/parallel-criteria-routes.js +21 -1
- package/dist/lifecycle/parallel-criteria-routes.js.map +1 -1
- package/dist/lifecycle/shared-compute.d.ts +9 -0
- package/dist/lifecycle/shared-compute.d.ts.map +1 -1
- package/dist/lifecycle/shared-compute.js +35 -3
- package/dist/lifecycle/shared-compute.js.map +1 -1
- package/dist/lifecycle/stage-plan-builder.d.ts.map +1 -1
- package/dist/lifecycle/stage-plan-builder.js +65 -85
- package/dist/lifecycle/stage-plan-builder.js.map +1 -1
- package/dist/lifecycle/stage-plan-types.d.ts +48 -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 +17 -24
- package/dist/lifecycle/stage-progression.js.map +1 -1
- package/dist/lifecycle/task-runner.d.ts.map +1 -1
- package/dist/lifecycle/task-runner.js +12 -1
- package/dist/lifecycle/task-runner.js.map +1 -1
- package/dist/model-profiles.json +192 -53
- package/dist/providers/anthropic-messages-adapter.d.ts +8 -0
- package/dist/providers/anthropic-messages-adapter.d.ts.map +1 -1
- package/dist/providers/anthropic-messages-adapter.js +16 -1
- package/dist/providers/anthropic-messages-adapter.js.map +1 -1
- package/dist/providers/file-tracker.d.ts +12 -0
- package/dist/providers/file-tracker.d.ts.map +1 -1
- package/dist/providers/file-tracker.js +16 -0
- package/dist/providers/file-tracker.js.map +1 -1
- package/dist/providers/provider-factory.d.ts.map +1 -1
- package/dist/providers/provider-factory.js +27 -2
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/providers/runner-shell-types.d.ts +14 -0
- package/dist/providers/runner-shell-types.d.ts.map +1 -1
- package/dist/providers/runner-shell.d.ts.map +1 -1
- package/dist/providers/runner-shell.js +38 -6
- package/dist/providers/runner-shell.js.map +1 -1
- package/dist/providers/tool-implementations.d.ts +12 -0
- package/dist/providers/tool-implementations.d.ts.map +1 -1
- package/dist/providers/tool-implementations.js +33 -0
- package/dist/providers/tool-implementations.js.map +1 -1
- package/dist/reporting/annotate-completion-parser.d.ts +39 -0
- package/dist/reporting/annotate-completion-parser.d.ts.map +1 -0
- package/dist/reporting/annotate-completion-parser.js +43 -0
- package/dist/reporting/annotate-completion-parser.js.map +1 -0
- package/dist/reporting/compose-running-headline.d.ts +15 -1
- package/dist/reporting/compose-running-headline.d.ts.map +1 -1
- package/dist/reporting/compose-running-headline.js +76 -1
- package/dist/reporting/compose-running-headline.js.map +1 -1
- package/dist/reporting/report-parser-slots/research-report.d.ts +1 -1
- package/dist/review/default-engines.d.ts.map +1 -1
- package/dist/review/default-engines.js +8 -4
- package/dist/review/default-engines.js.map +1 -1
- package/dist/review/parse-review-report.d.ts +6 -0
- package/dist/review/parse-review-report.d.ts.map +1 -0
- package/dist/review/parse-review-report.js +40 -0
- package/dist/review/parse-review-report.js.map +1 -0
- package/dist/review/reviewer-engine.d.ts +12 -3
- package/dist/review/reviewer-engine.d.ts.map +1 -1
- package/dist/review/reviewer-engine.js +4 -3
- package/dist/review/reviewer-engine.js.map +1 -1
- package/dist/review/templates/annotate-completion.d.ts +12 -0
- package/dist/review/templates/annotate-completion.d.ts.map +1 -0
- package/dist/review/templates/annotate-completion.js +72 -0
- package/dist/review/templates/annotate-completion.js.map +1 -0
- package/dist/review/templates/quality-review.d.ts +3 -0
- package/dist/review/templates/quality-review.d.ts.map +1 -0
- package/dist/review/templates/quality-review.js +40 -0
- package/dist/review/templates/quality-review.js.map +1 -0
- package/dist/review/templates/rework.d.ts +3 -0
- package/dist/review/templates/rework.d.ts.map +1 -0
- package/dist/review/templates/rework.js +42 -0
- package/dist/review/templates/rework.js.map +1 -0
- package/dist/review/templates/shared.d.ts +32 -0
- package/dist/review/templates/shared.d.ts.map +1 -1
- package/dist/review/templates/spec-review.d.ts +1 -16
- package/dist/review/templates/spec-review.d.ts.map +1 -1
- package/dist/review/templates/spec-review.js +23 -31
- package/dist/review/templates/spec-review.js.map +1 -1
- package/dist/stores/context-block-project-cap.d.ts +14 -0
- package/dist/stores/context-block-project-cap.d.ts.map +1 -0
- package/dist/stores/context-block-project-cap.js +68 -0
- package/dist/stores/context-block-project-cap.js.map +1 -0
- package/dist/stores/context-block-tool.d.ts +2 -0
- package/dist/stores/context-block-tool.d.ts.map +1 -1
- package/dist/stores/context-block-tool.js +3 -2
- package/dist/stores/context-block-tool.js.map +1 -1
- package/dist/stores/file-backed-context-block-store.d.ts +8 -1
- package/dist/stores/file-backed-context-block-store.d.ts.map +1 -1
- package/dist/stores/file-backed-context-block-store.js +116 -4
- package/dist/stores/file-backed-context-block-store.js.map +1 -1
- package/dist/tools/audit/plan-audit-criteria.d.ts +35 -0
- package/dist/tools/audit/plan-audit-criteria.d.ts.map +1 -0
- package/dist/tools/audit/plan-audit-criteria.js +136 -0
- package/dist/tools/audit/plan-audit-criteria.js.map +1 -0
- package/dist/tools/audit/plan-audit-verdict.d.ts +15 -0
- package/dist/tools/audit/plan-audit-verdict.d.ts.map +1 -0
- package/dist/tools/audit/plan-audit-verdict.js +44 -0
- package/dist/tools/audit/plan-audit-verdict.js.map +1 -0
- package/dist/tools/audit/schema.d.ts +1 -0
- package/dist/tools/audit/schema.d.ts.map +1 -1
- package/dist/tools/audit/schema.js +6 -3
- package/dist/tools/audit/schema.js.map +1 -1
- package/dist/tools/audit/tool-config.d.ts +3 -0
- package/dist/tools/audit/tool-config.d.ts.map +1 -1
- package/dist/tools/audit/tool-config.js +8 -0
- package/dist/tools/audit/tool-config.js.map +1 -1
- package/dist/tools/delegate/implementer-criteria.d.ts +31 -47
- package/dist/tools/delegate/implementer-criteria.d.ts.map +1 -1
- package/dist/tools/delegate/implementer-criteria.js +60 -88
- package/dist/tools/delegate/implementer-criteria.js.map +1 -1
- package/dist/tools/delegate/tool-config.js +4 -4
- package/dist/tools/delegate/tool-config.js.map +1 -1
- package/dist/tools/execute-plan/implementer-criteria.d.ts +42 -37
- package/dist/tools/execute-plan/implementer-criteria.d.ts.map +1 -1
- package/dist/tools/execute-plan/implementer-criteria.js +79 -79
- package/dist/tools/execute-plan/implementer-criteria.js.map +1 -1
- package/dist/tools/execute-plan/tool-config.d.ts.map +1 -1
- package/dist/tools/execute-plan/tool-config.js +23 -13
- package/dist/tools/execute-plan/tool-config.js.map +1 -1
- package/dist/types/enums.d.ts +2 -2
- package/dist/types/run-result.d.ts +58 -0
- package/dist/types/run-result.d.ts.map +1 -1
- package/dist/types/task-spec.d.ts +14 -0
- package/dist/types/task-spec.d.ts.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -1
- package/dist/lifecycle/handlers/quality-chain-handlers.d.ts +0 -22
- package/dist/lifecycle/handlers/quality-chain-handlers.d.ts.map +0 -1
- package/dist/lifecycle/handlers/quality-chain-handlers.js +0 -369
- package/dist/lifecycle/handlers/quality-chain-handlers.js.map +0 -1
- package/dist/lifecycle/handlers/review-diff-handler.d.ts +0 -31
- package/dist/lifecycle/handlers/review-diff-handler.d.ts.map +0 -1
- package/dist/lifecycle/handlers/review-diff-handler.js +0 -168
- package/dist/lifecycle/handlers/review-diff-handler.js.map +0 -1
- package/dist/lifecycle/handlers/run-verify-command-handler.d.ts +0 -25
- package/dist/lifecycle/handlers/run-verify-command-handler.d.ts.map +0 -1
- package/dist/lifecycle/handlers/run-verify-command-handler.js +0 -84
- package/dist/lifecycle/handlers/run-verify-command-handler.js.map +0 -1
- package/dist/lifecycle/handlers/spec-chain-handlers.d.ts +0 -21
- package/dist/lifecycle/handlers/spec-chain-handlers.d.ts.map +0 -1
- package/dist/lifecycle/handlers/spec-chain-handlers.js +0 -287
- package/dist/lifecycle/handlers/spec-chain-handlers.js.map +0 -1
- package/dist/review/templates/diff-review.d.ts +0 -11
- package/dist/review/templates/diff-review.d.ts.map +0 -1
- package/dist/review/templates/diff-review.js +0 -39
- package/dist/review/templates/diff-review.js.map +0 -1
- package/dist/review/templates/quality-review-artifact.d.ts +0 -16
- package/dist/review/templates/quality-review-artifact.d.ts.map +0 -1
- package/dist/review/templates/quality-review-artifact.js +0 -46
- package/dist/review/templates/quality-review-artifact.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-audit-verdict.d.ts","sourceRoot":"","sources":["../../../src/tools/audit/plan-audit-verdict.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;CAClD;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,GACxC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAa9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,EACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC7C,gBAAgB,CAsBlB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function derivePlanTaskVerdicts(findings) {
|
|
2
|
+
const out = new Map();
|
|
3
|
+
for (const f of findings) {
|
|
4
|
+
const prior = out.get(f.taskId);
|
|
5
|
+
if (f.severity === 'critical') {
|
|
6
|
+
out.set(f.taskId, 'BLOCKED');
|
|
7
|
+
}
|
|
8
|
+
else if (f.severity === 'high') {
|
|
9
|
+
if (prior !== 'BLOCKED')
|
|
10
|
+
out.set(f.taskId, 'PARTIAL');
|
|
11
|
+
}
|
|
12
|
+
else if (!prior) {
|
|
13
|
+
out.set(f.taskId, 'EXECUTABLE');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
export function composePlanAuditSummary(allTaskIds, verdicts) {
|
|
19
|
+
const executable = [];
|
|
20
|
+
const partial = [];
|
|
21
|
+
const blocked = [];
|
|
22
|
+
for (const id of allTaskIds) {
|
|
23
|
+
const v = verdicts.get(id) ?? 'EXECUTABLE';
|
|
24
|
+
if (v === 'BLOCKED')
|
|
25
|
+
blocked.push(id);
|
|
26
|
+
else if (v === 'PARTIAL')
|
|
27
|
+
partial.push(id);
|
|
28
|
+
else
|
|
29
|
+
executable.push(id);
|
|
30
|
+
}
|
|
31
|
+
const sortedBlocked = [...blocked].sort();
|
|
32
|
+
const nextBlocker = sortedBlocked[0] ?? null;
|
|
33
|
+
const lines = [
|
|
34
|
+
`${allTaskIds.length} tasks audited:`,
|
|
35
|
+
` EXECUTABLE: ${executable.length}${executable.length ? ` (${executable.join(', ')})` : ''}`,
|
|
36
|
+
` PARTIAL: ${partial.length}${partial.length ? ` (${partial.join(', ')})` : ''}`,
|
|
37
|
+
` BLOCKED: ${blocked.length}${blocked.length ? ` (${blocked.join(', ')})` : ''}`,
|
|
38
|
+
];
|
|
39
|
+
if (nextBlocker) {
|
|
40
|
+
lines.push('', `Next blocker: ${nextBlocker}`);
|
|
41
|
+
}
|
|
42
|
+
return { text: lines.join('\n'), executable, partial, blocked, nextBlocker };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=plan-audit-verdict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-audit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C,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,aAAa,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC7C,MAAM,KAAK,GAAG;QACZ,GAAG,UAAU,CAAC,MAAM,iBAAiB;QACrC,iBAAiB,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC7F,iBAAiB,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACpF,iBAAiB,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;KACrF,CAAC;IACF,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,WAAW,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAC/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/audit/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/audit/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;iBAevB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8B,CAAC;AAExD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -6,13 +6,16 @@ import { buildOutputEnvelopeSchema } from '../shared-output.js';
|
|
|
6
6
|
// cross-package coupling.
|
|
7
7
|
export const inputSchema = z.object({
|
|
8
8
|
document: z.string().optional().describe('Inline document content to audit'),
|
|
9
|
-
auditType: z.enum(['default', 'security', 'performance'])
|
|
9
|
+
auditType: z.enum(['default', 'security', 'performance', 'plan'])
|
|
10
10
|
.default('default')
|
|
11
|
-
.describe('Audit focus. `default` is the comprehensive sweep — recommended for specs,
|
|
11
|
+
.describe('Audit focus. `default` is the comprehensive prose-coherence sweep — recommended for specs, designs, recommendation docs, post-mortems (the requirement / what-we-want-to-do prose). `security` / `performance` narrow the lens to that one dimension (threat models, scaling designs). `plan` is for code-execution PLANS being audited against a real codebase: pass the plan file as the single filePaths entry; workers grep the codebase under cwd to verify every named symbol / path / signature / import. Use `default` to check spec quality; use `plan` to check whether a plan can actually dispatch.'),
|
|
12
12
|
filePaths: z.array(z.string()).optional()
|
|
13
|
-
.describe('Files the sub-agent should focus on. Multiple files are processed in parallel.'),
|
|
13
|
+
.describe('Files the sub-agent should focus on. Multiple files are processed in parallel. For auditType=plan, MUST contain exactly one entry — the plan markdown.'),
|
|
14
14
|
contextBlockIds: z.array(z.string()).optional()
|
|
15
15
|
.describe('IDs from register_context_block to prepend to prompt. Use for delta audits, diff-scoped reviews, or shared specs.'),
|
|
16
|
+
}).refine((input) => input.auditType !== 'plan' || (Array.isArray(input.filePaths) && input.filePaths.length === 1), {
|
|
17
|
+
message: "Plan audit takes exactly one filePath (the plan markdown). The worker discovers and verifies source files itself via its tool surface — do not pre-list source files.",
|
|
18
|
+
path: ['filePaths'],
|
|
16
19
|
});
|
|
17
20
|
export const outputSchema = buildOutputEnvelopeSchema();
|
|
18
21
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/audit/schema.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,uFAAuF;AACvF,2EAA2E;AAC3E,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC5E,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/audit/schema.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,uFAAuF;AACvF,2EAA2E;AAC3E,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC5E,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;SAC9D,OAAO,CAAC,SAAS,CAAC;SAClB,QAAQ,CAAC,ilBAAilB,CAAC;IAC9lB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;SACtC,QAAQ,CAAC,wJAAwJ,CAAC;IACrK,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;SAC5C,QAAQ,CAAC,mHAAmH,CAAC;CACjI,CAAC,CAAC,MAAM,CACP,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,EACzG;IACE,OAAO,EAAE,uKAAuK;IAChL,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CACF,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,EAAE,CAAC"}
|
|
@@ -11,6 +11,9 @@ export interface ToolAuditBrief {
|
|
|
11
11
|
hasContextBlocks: boolean;
|
|
12
12
|
contextBlockIds?: string[];
|
|
13
13
|
perFilePath?: string;
|
|
14
|
+
/** A12: pass-through of input.auditType so buildTaskSpec can stamp it
|
|
15
|
+
* onto the TaskSpec for the dispatcher to read. */
|
|
16
|
+
auditType?: 'default' | 'security' | 'performance' | 'plan';
|
|
14
17
|
}
|
|
15
18
|
export declare function auditBriefSlot(input: Input): ToolAuditBrief[];
|
|
16
19
|
export declare const toolConfig: ToolConfig<Input, ToolAuditBrief, AuditReport>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-config.d.ts","sourceRoot":"","sources":["../../../src/tools/audit/tool-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,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CAAC;CAC7D;AA+CD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,EAAE,CA4B7D;AAgFD,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CA0CrE,CAAC"}
|
|
@@ -35,6 +35,7 @@ const AUDIT_DONE_CONDITIONS = {
|
|
|
35
35
|
default: 'Comprehensive audit. Apply the full failure-mode taxonomy through the executability lens (the orientation block above). For prose artifacts (specs, plans, recommendation docs, designs, post-mortems, audits, briefs): emphasize RECOMMENDATION-COHERENCE, INTERNAL CONTRADICTION, ARGUMENT SOUNDNESS, COMPLETENESS AGAINST CONSTRAINTS, FIX ACTIONABILITY, DRIFT, and SCOPE-CREEP — i.e., would a literal-following worker who reads this artifact and follows it without judgment produce the right outcome? Are sections internally consistent? Does each recommendation actually solve its stated problem given the doc\'s own constraints? Sweep style/clarity issues only when they would cause a worker to misinterpret. For source code: logic errors, contract violations, off-by-one bugs, type mismatches, unhandled edge cases. Each finding has severity (critical/high/medium/low), location, and remediation.',
|
|
36
36
|
security: 'Narrow lens: security ONLY. Use this only when the caller specifically wants security findings and not general audit findings. For prose artifacts (threat models, security designs, auth specs): identify missing controls, ambiguous trust boundaries, undeclared attack surfaces, leaked-secret patterns in examples, recommendations that introduce new attack surface without mitigation, and threat-model gaps. For source code: injection, auth bypass, data exposure, OWASP top 10. Apply the full failure-mode taxonomy through the security lens. Skip non-security findings. Each finding has severity, location, and remediation.',
|
|
37
37
|
performance: 'Narrow lens: performance ONLY. Use this only when the caller specifically wants performance findings and not general audit findings. For prose artifacts (designs, scaling plans, latency-sensitive specs): identify unstated complexity, missing hot-path consideration, unbounded loops in proposed designs, omitted scaling story, recommendations that mandate work that does not scale, and missing latency/throughput targets. For source code: O(n²) loops, unnecessary allocations, missing caching, blocking I/O. Apply the full failure-mode taxonomy through the performance lens. Skip non-performance findings. Each finding has impact level, location, and fix recommendation.',
|
|
38
|
+
plan: 'PLAN-VS-CODEBASE EXECUTABILITY AUDIT. The single filePath you receive is a code-execution plan; the source files you verify against live under cwd and you discover them yourself by reading the plan\'s "Files: Modify:" / "Test:" / "Create:" blocks and `import` statements in code blocks. Apply the 8 verification perspectives (PATH EXISTENCE, SYMBOL EXISTENCE, SIGNATURE MATCH, IMPORT GRAPH, TEST HARNESS AVAILABILITY, STEP SEQUENCE WITHIN TASK, CROSS-TASK DEPENDENCIES, VERIFICATION COMMAND VALIDITY). For each task in the plan, the merge annotator computes a verdict: EXECUTABLE / PARTIAL / BLOCKED. Use read_file / grep / glob / list_files to ground every finding in real file:line evidence. Findings without source-side citations are speculation — drop them. Zero findings on a perspective is the EXPECTED outcome on a clean plan; do not invent findings to fill quota.',
|
|
38
39
|
};
|
|
39
40
|
const DELTA_AUDIT_SUFFIX = ' Perform a full audit (do not reduce thoroughness). Verify each prior finding as fixed or unfixed. Omit fixed prior findings from the main report. Include unfixed prior findings and new findings. End with a summary of which prior findings were resolved.';
|
|
40
41
|
function resolveAuditTypeText(auditType) {
|
|
@@ -68,6 +69,7 @@ export function auditBriefSlot(input) {
|
|
|
68
69
|
hasContextBlocks,
|
|
69
70
|
contextBlockIds: input.contextBlockIds,
|
|
70
71
|
perFilePath: fp,
|
|
72
|
+
auditType: input.auditType,
|
|
71
73
|
}));
|
|
72
74
|
}
|
|
73
75
|
return [{
|
|
@@ -77,6 +79,7 @@ export function auditBriefSlot(input) {
|
|
|
77
79
|
filePaths: validPaths,
|
|
78
80
|
hasContextBlocks,
|
|
79
81
|
contextBlockIds: input.contextBlockIds,
|
|
82
|
+
auditType: input.auditType,
|
|
80
83
|
}];
|
|
81
84
|
}
|
|
82
85
|
const FINDING_FORMAT_INSTRUCTIONS = [
|
|
@@ -185,6 +188,11 @@ export const toolConfig = {
|
|
|
185
188
|
contextBlockIds: brief.contextBlockIds,
|
|
186
189
|
filePaths: brief.filePaths.length > 0 ? brief.filePaths : undefined,
|
|
187
190
|
mainModel: ctx.mainModel,
|
|
191
|
+
// A12 (4.2.3+): plumb auditType to the dispatcher. The
|
|
192
|
+
// parallel-criteria router branches on `task.auditType === 'plan'`
|
|
193
|
+
// to use the plan-audit route spec instead of the default audit
|
|
194
|
+
// spec (different criteria, orientation, severity semantics).
|
|
195
|
+
auditType: brief.auditType,
|
|
188
196
|
};
|
|
189
197
|
},
|
|
190
198
|
reportSchema: auditReportSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/audit/tool-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAoB,MAAM,qDAAqD,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAGpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,aAAa,CAAC,QAA6B;IACzD,QAAQ,CAAC,QAAQ,CAAC;QAChB,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,WAAW;QACnB,YAAY,EAAE,WAAW;QACzB,gBAAgB,EAAE,SAAS;QAC3B,oBAAoB,EAAE,KAAK;QAC3B,iBAAiB,EAAE,eAAe;KACnC,CAAC,CAAC;AACL,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/audit/tool-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAc,MAAM,aAAa,C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,62 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delegate
|
|
2
|
+
* Delegate worker criteria — 4.3.0 pipeline-redesign mindset.
|
|
3
3
|
*
|
|
4
|
-
* DELEGATE'S PURPOSE — read this before adding categories.
|
|
5
4
|
* mma-delegate is the generic dispatcher for ad-hoc implementation
|
|
6
|
-
* tasks.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* spec + quality + diff review applies. The spec the spec-reviewer
|
|
23
|
-
* checks against is the BRIEF (prompt + done), not your interpretation
|
|
24
|
-
* of it. The quality-reviewer checks safety / correctness / style.
|
|
5
|
+
* tasks. Caller hands you a `prompt` (and optionally a `done` acceptance
|
|
6
|
+
* criterion, `filePaths`, `verifyCommand`); your output is a diff.
|
|
7
|
+
*
|
|
8
|
+
* Pipeline mindset (different from earlier versions):
|
|
9
|
+
* - This is a SINGLE-PASS pipeline. There are NO rework rounds for you.
|
|
10
|
+
* - After your turn, a SPEC reviewer (complex tier, full editor tools)
|
|
11
|
+
* runs ONCE — it doesn't ask you to fix; it fixes inline itself.
|
|
12
|
+
* - Then a QUALITY reviewer (complex tier, full editor tools) runs ONCE
|
|
13
|
+
* for safety/correctness — same thing: fixes inline, doesn't ask you.
|
|
14
|
+
* - Then an annotator scores overall completion and the commit gate fires
|
|
15
|
+
* if the score is high enough.
|
|
16
|
+
*
|
|
17
|
+
* What this means for you: do your best ONE pass. You don't need to
|
|
18
|
+
* second-guess minor things — the reviewer will catch and fix them.
|
|
19
|
+
* Don't over-think; don't restart-loop; don't bail on uncertainty. The
|
|
20
|
+
* pipeline has a safety net BUT only one round of it.
|
|
25
21
|
*/
|
|
26
22
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Without an explicit orientation, workers default to "implement
|
|
30
|
-
* something good" — which produces over-implementation (SCOPE CREEP)
|
|
31
|
-
* and under-implementation (SILENT PARTIAL FIX). With this orientation,
|
|
32
|
-
* the worker calibrates against the reviewer's standard: minimal +
|
|
33
|
-
* complete, the brief is the contract.
|
|
23
|
+
* Orientation — "smallest complete change" framing.
|
|
34
24
|
*/
|
|
35
25
|
export declare const DELEGATE_PURPOSE_ORIENTATION: string;
|
|
36
|
-
/**
|
|
37
|
-
* The scope rule for delegate.
|
|
38
|
-
*
|
|
39
|
-
* Replaces the prior one-liner with a concrete contract about what
|
|
40
|
-
* is in scope, what is off-limits, and what to do at the boundary.
|
|
41
|
-
*/
|
|
42
26
|
export declare const DELEGATE_SCOPE_RULE: string;
|
|
43
27
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* (
|
|
48
|
-
* below are the specific patterns reviewers raise as merge-blockers.
|
|
28
|
+
* Top-4 failure modes — calibrated from observed reviewer rejections.
|
|
29
|
+
* Dropped from the original 9: WRONG FILE TARGET (subsumed by scope
|
|
30
|
+
* rule), CROSS-CUTTING DAMAGE, CONVENTION DRIFT, SPEC OVERREACH,
|
|
31
|
+
* UNDOCUMENTED ASSUMPTION (low signal, high noise for cheap models).
|
|
49
32
|
*/
|
|
50
33
|
export declare const DELEGATE_FAILURE_MODES: string;
|
|
51
34
|
/**
|
|
52
|
-
* Completeness reminder.
|
|
53
|
-
*
|
|
54
|
-
* The shared SEVERITY_LADDER does not apply to write tools. The
|
|
55
|
-
* counter-balance for delegate is opposite to read-only tools: the
|
|
56
|
-
* typical failure is OVER-IMPLEMENTATION (scope creep) and UNDER-
|
|
57
|
-
* IMPLEMENTATION (silent partial fix), often in the same task. This
|
|
58
|
-
* block tells the worker the load-bearing constraint is "minimal AND
|
|
59
|
-
* complete simultaneously".
|
|
35
|
+
* Completeness reminder — brief-vs-diff walk only. Worked example
|
|
36
|
+
* dropped (cheap models can apply the rule directly without it).
|
|
60
37
|
*/
|
|
61
38
|
export declare const COMPLETENESS_REMINDER_DELEGATE: string;
|
|
39
|
+
/**
|
|
40
|
+
* Turn budget — calibration block. Same rationale as execute-plan's:
|
|
41
|
+
* cheap models default to "be thorough" and treat each turn as
|
|
42
|
+
* "re-verify by re-reading", which becomes a discovery loop. This
|
|
43
|
+
* block tells them to trust prior reads and edit confidently.
|
|
44
|
+
*/
|
|
45
|
+
export declare const TURN_BUDGET_DELEGATE: string;
|
|
62
46
|
//# sourceMappingURL=implementer-criteria.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAW7B,CAAC;AAEb,eAAO,MAAM,mBAAmB,QAMpB,CAAC;AAEb;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAOvB,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,8BAA8B,QAU/B,CAAC;AAEb;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAMrB,CAAC"}
|
|
@@ -1,114 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delegate
|
|
2
|
+
* Delegate worker criteria — 4.3.0 pipeline-redesign mindset.
|
|
3
3
|
*
|
|
4
|
-
* DELEGATE'S PURPOSE — read this before adding categories.
|
|
5
4
|
* mma-delegate is the generic dispatcher for ad-hoc implementation
|
|
6
|
-
* tasks.
|
|
7
|
-
*
|
|
8
|
-
* a diff a REVIEWER will read alongside the brief. The success
|
|
9
|
-
* criterion is:
|
|
5
|
+
* tasks. Caller hands you a `prompt` (and optionally a `done` acceptance
|
|
6
|
+
* criterion, `filePaths`, `verifyCommand`); your output is a diff.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* Pipeline mindset (different from earlier versions):
|
|
9
|
+
* - This is a SINGLE-PASS pipeline. There are NO rework rounds for you.
|
|
10
|
+
* - After your turn, a SPEC reviewer (complex tier, full editor tools)
|
|
11
|
+
* runs ONCE — it doesn't ask you to fix; it fixes inline itself.
|
|
12
|
+
* - Then a QUALITY reviewer (complex tier, full editor tools) runs ONCE
|
|
13
|
+
* for safety/correctness — same thing: fixes inline, doesn't ask you.
|
|
14
|
+
* - Then an annotator scores overall completion and the commit gate fires
|
|
15
|
+
* if the score is high enough.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* that satisfies the brief — minimal AND complete simultaneously.
|
|
20
|
-
*
|
|
21
|
-
* Delegate is artifact-producing — you write files. Cross-agent
|
|
22
|
-
* spec + quality + diff review applies. The spec the spec-reviewer
|
|
23
|
-
* checks against is the BRIEF (prompt + done), not your interpretation
|
|
24
|
-
* of it. The quality-reviewer checks safety / correctness / style.
|
|
17
|
+
* What this means for you: do your best ONE pass. You don't need to
|
|
18
|
+
* second-guess minor things — the reviewer will catch and fix them.
|
|
19
|
+
* Don't over-think; don't restart-loop; don't bail on uncertainty. The
|
|
20
|
+
* pipeline has a safety net BUT only one round of it.
|
|
25
21
|
*/
|
|
26
22
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Without an explicit orientation, workers default to "implement
|
|
30
|
-
* something good" — which produces over-implementation (SCOPE CREEP)
|
|
31
|
-
* and under-implementation (SILENT PARTIAL FIX). With this orientation,
|
|
32
|
-
* the worker calibrates against the reviewer's standard: minimal +
|
|
33
|
-
* complete, the brief is the contract.
|
|
23
|
+
* Orientation — "smallest complete change" framing.
|
|
34
24
|
*/
|
|
35
25
|
export const DELEGATE_PURPOSE_ORIENTATION = [
|
|
36
|
-
'
|
|
37
|
-
'
|
|
26
|
+
'Your job: produce the SMALLEST COMPLETE CHANGE that satisfies the brief — minimal AND complete simultaneously.',
|
|
27
|
+
'A reviewer reads your diff alongside the brief and asks two questions: "did you finish it?" (silent partial fix → blocker) and "why did you also touch X?" (scope creep → blocker). Both must answer cleanly.',
|
|
38
28
|
'',
|
|
39
|
-
'
|
|
40
|
-
'- Implement EXACTLY what the brief asks for. Not less
|
|
41
|
-
'- If the brief lists `filePaths`, those are the authorized targets. Existing
|
|
42
|
-
'- If the brief includes a `done`
|
|
43
|
-
'- If the brief includes a `verifyCommand`, run it after your changes.
|
|
44
|
-
'-
|
|
45
|
-
'-
|
|
46
|
-
'- Do NOT modify tests or fixtures or specs to make a wrong implementation pass. If a test fails, fix the implementation, not the test (unless the brief explicitly says the test is wrong).',
|
|
47
|
-
'',
|
|
48
|
-
'The completion test: would a reviewer who reads ONLY the brief and your diff approve the merge — or would they raise a concern (gap, scope creep, drift, broken caller, undocumented assumption) you should have caught?',
|
|
29
|
+
'Rules:',
|
|
30
|
+
'- Implement EXACTLY what the brief asks for. Not less. Not more.',
|
|
31
|
+
'- If the brief lists `filePaths`, those are the authorized targets. Existing entries = read-and-modify; non-existent entries = create. Files outside the list are off-limits to write unless the brief\'s task genuinely requires it (call out any deviation in your summary).',
|
|
32
|
+
'- If the brief includes a `done` criterion, your diff must satisfy it precisely.',
|
|
33
|
+
'- If the brief includes a `verifyCommand`, run it after your changes. Green = part of complete; red = part of incomplete.',
|
|
34
|
+
'- If you change a public symbol (exported function signature, exported type, public method), update callers in the named files. Stale callers are an INCOMPLETE REFACTOR.',
|
|
35
|
+
'- Do NOT modify tests or fixtures to make a wrong implementation pass. If a test fails, fix the implementation.',
|
|
49
36
|
].join('\n');
|
|
50
|
-
/**
|
|
51
|
-
* The scope rule for delegate.
|
|
52
|
-
*
|
|
53
|
-
* Replaces the prior one-liner with a concrete contract about what
|
|
54
|
-
* is in scope, what is off-limits, and what to do at the boundary.
|
|
55
|
-
*/
|
|
56
37
|
export const DELEGATE_SCOPE_RULE = [
|
|
57
38
|
'Scope:',
|
|
58
39
|
'- Strictly what the brief\'s `prompt` (and `done` if present) requests. The brief is the contract.',
|
|
59
|
-
'- Reading: the named `filePaths` plus what the task obviously implies (caller files when the diff changes a public symbol; sibling test files when the brief changes behavior; types files when the diff changes
|
|
60
|
-
'- Writing:
|
|
61
|
-
'- Out of scope: refactors not in the brief, tangential cleanup
|
|
40
|
+
'- Reading: the named `filePaths` plus what the task obviously implies (caller files when the diff changes a public symbol; sibling test files when the brief changes behavior; types files when the diff changes an interface).',
|
|
41
|
+
'- Writing: only files within `filePaths` unless the brief\'s task genuinely requires touching others (e.g. updating a caller because the task changed a signature — note in summary).',
|
|
42
|
+
'- Out of scope: refactors not in the brief, tangential cleanup, modifying tests to mask wrong code, opportunistic style fixes.',
|
|
62
43
|
].join('\n');
|
|
63
44
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* (
|
|
68
|
-
* below are the specific patterns reviewers raise as merge-blockers.
|
|
45
|
+
* Top-4 failure modes — calibrated from observed reviewer rejections.
|
|
46
|
+
* Dropped from the original 9: WRONG FILE TARGET (subsumed by scope
|
|
47
|
+
* rule), CROSS-CUTTING DAMAGE, CONVENTION DRIFT, SPEC OVERREACH,
|
|
48
|
+
* UNDOCUMENTED ASSUMPTION (low signal, high noise for cheap models).
|
|
69
49
|
*/
|
|
70
50
|
export const DELEGATE_FAILURE_MODES = [
|
|
71
|
-
'
|
|
72
|
-
'',
|
|
73
|
-
'1. SCOPE CREEP — touched files / added features beyond the brief. The reviewer reads the diff and asks "why did you also change Y?" If you cannot answer with "the brief required it", remove the change.',
|
|
74
|
-
'2. SILENT PARTIAL FIX — declared done, work demonstrably incomplete. Naming a step in your summary as "done" when the diff does not contain it is the worst delegate failure mode. Either implement it or report explicitly that you did not.',
|
|
75
|
-
'3. WRONG FILE TARGET — wrote to a path not in `filePaths` (when the caller specified `filePaths`). Existing files outside `filePaths` are off-limits to write. New files outside `filePaths` are scope creep.',
|
|
76
|
-
'4. PHANTOM TEST PASS — claimed "tests pass" without actually running them, OR ran a non-affected suite (e.g. unit tests pass but the change is in a path covered by integration tests). If the brief includes `verifyCommand`, run that exact command and quote the output.',
|
|
77
|
-
'5. CROSS-CUTTING DAMAGE — your fix introduced an unrelated regression in the same edit (e.g. fixing a parser bug but breaking the formatter). Re-read the diff before declaring done; check that nothing OTHER than the brief\'s target changed semantically.',
|
|
78
|
-
'6. CONVENTION DRIFT — invented a naming / import / error-handling / formatting pattern instead of matching the surrounding code. The reviewer will flag this as "matches no neighboring file" — it slows merge.',
|
|
79
|
-
'7. INCOMPLETE REFACTOR — changed a public symbol (exported function signature, exported type, public method) and did not update its callers. Stale callers either crash at runtime or compile but behave wrong. Update callers in the named files; report in your summary if callers exist outside `filePaths`.',
|
|
80
|
-
'8. SPEC OVERREACH — modified tests, fixtures, or interface contracts to make a wrong implementation pass, instead of fixing the implementation. If a test is failing, the FIRST hypothesis is that the implementation is wrong, not the test.',
|
|
81
|
-
'9. UNDOCUMENTED ASSUMPTION — diff relies on the caller doing X (env var set, init function called, dependency installed) without saying so in the brief\'s authoring contract. Either remove the assumption, or document it in your summary so the reviewer can decide if it is acceptable.',
|
|
51
|
+
'The four ways delegation diverges from intent — check yourself against each before declaring done:',
|
|
82
52
|
'',
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
53
|
+
'1. SCOPE CREEP — touched files / added features beyond the brief. For every diff hunk, ask: "is this required by a brief item?" If no, remove it.',
|
|
54
|
+
'2. SILENT PARTIAL FIX — declared done with the work demonstrably incomplete. Naming a step as "done" when the diff doesn\'t contain it is the worst delegate failure. Either implement it or report explicitly that you did not.',
|
|
55
|
+
'3. PHANTOM TEST PASS — claimed "tests pass" without actually running them. If `verifyCommand` is set, run that exact command and quote the output. Otherwise run the focused test for the area you changed.',
|
|
56
|
+
'4. INCOMPLETE REFACTOR — changed a public symbol and did not update callers. Stale callers either crash at runtime or compile-but-misbehave. Update callers in the named files; report any callers outside `filePaths` in your summary.',
|
|
87
57
|
].join('\n');
|
|
88
58
|
/**
|
|
89
|
-
* Completeness reminder.
|
|
90
|
-
*
|
|
91
|
-
* The shared SEVERITY_LADDER does not apply to write tools. The
|
|
92
|
-
* counter-balance for delegate is opposite to read-only tools: the
|
|
93
|
-
* typical failure is OVER-IMPLEMENTATION (scope creep) and UNDER-
|
|
94
|
-
* IMPLEMENTATION (silent partial fix), often in the same task. This
|
|
95
|
-
* block tells the worker the load-bearing constraint is "minimal AND
|
|
96
|
-
* complete simultaneously".
|
|
59
|
+
* Completeness reminder — brief-vs-diff walk only. Worked example
|
|
60
|
+
* dropped (cheap models can apply the rule directly without it).
|
|
97
61
|
*/
|
|
98
62
|
export const COMPLETENESS_REMINDER_DELEGATE = [
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
63
|
+
'Brief-vs-diff walk (REQUIRED before declaring done):',
|
|
64
|
+
'',
|
|
65
|
+
'Walk the brief literally:',
|
|
66
|
+
' 1. List every requirement in `prompt` (and `done` if present).',
|
|
67
|
+
' 2. For each, locate the diff hunk that satisfies it. If you cannot, you are not done.',
|
|
68
|
+
' 3. Walk the diff in reverse: for each changed file/line, name the brief item it satisfies. If you cannot, the hunk is SCOPE CREEP — remove it.',
|
|
69
|
+
' 4. If `verifyCommand` is set, run it. Quote the relevant output line in your summary.',
|
|
70
|
+
'',
|
|
71
|
+
'"Smallest" means no extras. "Complete" means no gaps. Both at once.',
|
|
72
|
+
].join('\n');
|
|
73
|
+
/**
|
|
74
|
+
* Turn budget — calibration block. Same rationale as execute-plan's:
|
|
75
|
+
* cheap models default to "be thorough" and treat each turn as
|
|
76
|
+
* "re-verify by re-reading", which becomes a discovery loop. This
|
|
77
|
+
* block tells them to trust prior reads and edit confidently.
|
|
78
|
+
*/
|
|
79
|
+
export const TURN_BUDGET_DELEGATE = [
|
|
80
|
+
'Turn budget:',
|
|
81
|
+
'',
|
|
82
|
+
'A typical delegate task completes in 5-15 tool calls total: read each file once, edit each file once, run verification once. If you find yourself reading the same file twice, STOP and edit — the content from your first read is in your context window. If you find yourself reading >5 files without writing any, STOP and write — you have enough context to make progress.',
|
|
107
83
|
'',
|
|
108
|
-
'
|
|
109
|
-
'- For each item in the brief\'s `prompt` and `done`, locate the diff hunk that satisfies it. If you cannot, the item is unsatisfied.',
|
|
110
|
-
'- For each diff hunk, name the brief item it satisfies. If you cannot, the hunk is scope creep.',
|
|
111
|
-
'- Worked example. Brief: "fix the off-by-one in `paginate(page, total)` — `total < pageSize` should still produce one page; add a regression test in `tests/pagination.test.ts`." Naive worker rewrites `paginate` as a clean three-liner with new docstrings, skips the test → SILENT PARTIAL FIX (no test) + SCOPE CREEP (rewrote a function that needed a one-line fix). Correct worker: changes one boundary condition in `paginate` (one line of diff in the implementation file), adds one test in `tests/pagination.test.ts` covering the `total < pageSize` case, runs `verifyCommand` if set, quotes the test name and "1 passed" in the summary, stops. Two diff hunks total, both directly tied to the brief.',
|
|
112
|
-
'- Most workers miss findings of this shape on first pass because the rewrite "feels cleaner". The brief-vs-diff walk forces the question "what did the brief ACTUALLY ask for?".',
|
|
84
|
+
'Trust your prior reads. Trust your prior edits. The most common cheap-worker failure is restart-looping instead of editing.',
|
|
113
85
|
].join('\n');
|
|
114
86
|
//# sourceMappingURL=implementer-criteria.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementer-criteria.js","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"implementer-criteria.js","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,gHAAgH;IAChH,+MAA+M;IAC/M,EAAE;IACF,QAAQ;IACR,kEAAkE;IAClE,gRAAgR;IAChR,kFAAkF;IAClF,2HAA2H;IAC3H,2KAA2K;IAC3K,iHAAiH;CAClH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ;IACR,oGAAoG;IACpG,iOAAiO;IACjO,uLAAuL;IACvL,gIAAgI;CACjI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,oGAAoG;IACpG,EAAE;IACF,mJAAmJ;IACnJ,kOAAkO;IAClO,6MAA6M;IAC7M,yOAAyO;CAC1O,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,sDAAsD;IACtD,EAAE;IACF,2BAA2B;IAC3B,kEAAkE;IAClE,yFAAyF;IACzF,kJAAkJ;IAClJ,yFAAyF;IACzF,EAAE;IACF,qEAAqE;CACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,EAAE;IACF,kXAAkX;IAClX,EAAE;IACF,6HAA6H;CAC9H,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { inputSchema } from './schema.js';
|
|
|
2
2
|
import { delegateHeadlineTemplate } from '../../reporting/headline-templates/delegate.js';
|
|
3
3
|
import { delegateReportSchema } from '../../reporting/report-parser-slots/delegate-report.js';
|
|
4
4
|
import { compileDelegatePrompt } from '../../intake/brief-compiler-slots/delegate.js';
|
|
5
|
-
import {
|
|
5
|
+
import { specLintTemplate, qualityLintTemplate } from '../../review/reviewer-engine.js';
|
|
6
6
|
import { DEFAULT_TASK_TIMEOUT_MS } from '../../config/schema.js';
|
|
7
7
|
export function registerDelegate(registry) {
|
|
8
8
|
registry.register({
|
|
@@ -48,9 +48,9 @@ export const toolConfig = {
|
|
|
48
48
|
reportSchema: delegateReportSchema,
|
|
49
49
|
headlineTemplate: delegateHeadlineTemplate,
|
|
50
50
|
reviewTemplates: {
|
|
51
|
-
spec:
|
|
52
|
-
qualityAP:
|
|
53
|
-
diff:
|
|
51
|
+
spec: specLintTemplate,
|
|
52
|
+
qualityAP: qualityLintTemplate,
|
|
53
|
+
diff: specLintTemplate, // pipeline-redesign: diff path unused; field retained for type compat
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=tool-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/delegate/tool-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/delegate/tool-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MA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