@zhixuan92/multi-model-agent-core 4.0.6 → 4.1.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.
Files changed (73) hide show
  1. package/dist/intake/brief-compiler-slots/delegate.d.ts +18 -0
  2. package/dist/intake/brief-compiler-slots/delegate.d.ts.map +1 -1
  3. package/dist/intake/brief-compiler-slots/delegate.js +36 -3
  4. package/dist/intake/brief-compiler-slots/delegate.js.map +1 -1
  5. package/dist/reporting/report-parser-slots/investigate-report.d.ts.map +1 -1
  6. package/dist/reporting/report-parser-slots/investigate-report.js +41 -2
  7. package/dist/reporting/report-parser-slots/investigate-report.js.map +1 -1
  8. package/dist/review/templates/annotator-audit.d.ts.map +1 -1
  9. package/dist/review/templates/annotator-audit.js +5 -3
  10. package/dist/review/templates/annotator-audit.js.map +1 -1
  11. package/dist/review/templates/annotator-debug.d.ts.map +1 -1
  12. package/dist/review/templates/annotator-debug.js +11 -7
  13. package/dist/review/templates/annotator-debug.js.map +1 -1
  14. package/dist/review/templates/annotator-investigate.d.ts.map +1 -1
  15. package/dist/review/templates/annotator-investigate.js +6 -3
  16. package/dist/review/templates/annotator-investigate.js.map +1 -1
  17. package/dist/review/templates/annotator-review.d.ts.map +1 -1
  18. package/dist/review/templates/annotator-review.js +13 -6
  19. package/dist/review/templates/annotator-review.js.map +1 -1
  20. package/dist/review/templates/annotator-verify.d.ts.map +1 -1
  21. package/dist/review/templates/annotator-verify.js +11 -5
  22. package/dist/review/templates/annotator-verify.js.map +1 -1
  23. package/dist/tools/audit/implementer-criteria.d.ts +55 -4
  24. package/dist/tools/audit/implementer-criteria.d.ts.map +1 -1
  25. package/dist/tools/audit/implementer-criteria.js +113 -11
  26. package/dist/tools/audit/implementer-criteria.js.map +1 -1
  27. package/dist/tools/audit/schema.d.ts +3 -10
  28. package/dist/tools/audit/schema.d.ts.map +1 -1
  29. package/dist/tools/audit/schema.js +3 -4
  30. package/dist/tools/audit/schema.js.map +1 -1
  31. package/dist/tools/audit/tool-config.d.ts.map +1 -1
  32. package/dist/tools/audit/tool-config.js +42 -21
  33. package/dist/tools/audit/tool-config.js.map +1 -1
  34. package/dist/tools/debug/implementer-criteria.d.ts +44 -4
  35. package/dist/tools/debug/implementer-criteria.d.ts.map +1 -1
  36. package/dist/tools/debug/implementer-criteria.js +105 -13
  37. package/dist/tools/debug/implementer-criteria.js.map +1 -1
  38. package/dist/tools/debug/tool-config.d.ts.map +1 -1
  39. package/dist/tools/debug/tool-config.js +22 -4
  40. package/dist/tools/debug/tool-config.js.map +1 -1
  41. package/dist/tools/delegate/implementer-criteria.d.ts +62 -0
  42. package/dist/tools/delegate/implementer-criteria.d.ts.map +1 -0
  43. package/dist/tools/delegate/implementer-criteria.js +114 -0
  44. package/dist/tools/delegate/implementer-criteria.js.map +1 -0
  45. package/dist/tools/execute-plan/implementer-criteria.d.ts +52 -0
  46. package/dist/tools/execute-plan/implementer-criteria.d.ts.map +1 -0
  47. package/dist/tools/execute-plan/implementer-criteria.js +104 -0
  48. package/dist/tools/execute-plan/implementer-criteria.js.map +1 -0
  49. package/dist/tools/execute-plan/tool-config.d.ts.map +1 -1
  50. package/dist/tools/execute-plan/tool-config.js +17 -3
  51. package/dist/tools/execute-plan/tool-config.js.map +1 -1
  52. package/dist/tools/investigate/implementer-criteria.d.ts +48 -5
  53. package/dist/tools/investigate/implementer-criteria.d.ts.map +1 -1
  54. package/dist/tools/investigate/implementer-criteria.js +103 -13
  55. package/dist/tools/investigate/implementer-criteria.js.map +1 -1
  56. package/dist/tools/investigate/tool-config.d.ts.map +1 -1
  57. package/dist/tools/investigate/tool-config.js +15 -8
  58. package/dist/tools/investigate/tool-config.js.map +1 -1
  59. package/dist/tools/review/implementer-criteria.d.ts +47 -1
  60. package/dist/tools/review/implementer-criteria.d.ts.map +1 -1
  61. package/dist/tools/review/implementer-criteria.js +110 -9
  62. package/dist/tools/review/implementer-criteria.js.map +1 -1
  63. package/dist/tools/review/tool-config.d.ts.map +1 -1
  64. package/dist/tools/review/tool-config.js +39 -7
  65. package/dist/tools/review/tool-config.js.map +1 -1
  66. package/dist/tools/verify/implementer-criteria.d.ts +46 -0
  67. package/dist/tools/verify/implementer-criteria.d.ts.map +1 -1
  68. package/dist/tools/verify/implementer-criteria.js +103 -8
  69. package/dist/tools/verify/implementer-criteria.js.map +1 -1
  70. package/dist/tools/verify/tool-config.d.ts.map +1 -1
  71. package/dist/tools/verify/tool-config.js +18 -2
  72. package/dist/tools/verify/tool-config.js.map +1 -1
  73. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { debugBriefSlot } from '../../intake/brief-compiler-slots/debug.js';
4
4
  import { debugHeadlineTemplate } from '../../reporting/headline-templates/debug.js';
5
5
  import { DEFAULT_TASK_TIMEOUT_MS } from '../../config/schema.js';
6
6
  import { SEVERITY_LADDER } from '../../review/templates/finding-criteria.js';
7
- import { EVIDENCE_RULE_DEBUG, SCOPE_RULE_DEBUG, ANNOTATOR_AWARENESS_DEBUG, } from './implementer-criteria.js';
7
+ import { DEBUG_PURPOSE_ORIENTATION, EVIDENCE_RULE_DEBUG, SCOPE_RULE_DEBUG, ANNOTATOR_AWARENESS_DEBUG, DEBUG_FAILURE_MODES, THOROUGHNESS_REMINDER_DEBUG, } from './implementer-criteria.js';
8
8
  export function registerDebug(registry) {
9
9
  registry.register({
10
10
  routeName: 'debug',
@@ -19,13 +19,22 @@ export function registerDebug(registry) {
19
19
  });
20
20
  }
21
21
  const FINDING_FORMAT_INSTRUCTIONS = [
22
+ // Orientation goes FIRST — the worker needs to know why this debug
23
+ // exists (fix specification, not a hint; symptom-vs-cause matters)
24
+ // before reading the format spec / taxonomy / evidence rules.
25
+ // Without it, workers point at the failing line and call it the cause.
26
+ DEBUG_PURPOSE_ORIENTATION,
27
+ '',
22
28
  'Use hypothesis-driven debugging. Use this EXACT per-finding format — both the structured reviewer and the deterministic fallback extract from this same format:',
23
29
  '',
24
30
  '## Finding 1: <one-line title>',
25
31
  '- Severity: critical | high | medium | low',
26
- '- Hypothesis: the candidate cause',
27
- '- Evidence: trace, log, or code path with file:line',
32
+ '- Reproduction: command/input/state to trigger the failure',
33
+ '- Symptom: file:line where the failure surfaces',
34
+ '- Trace: each step file:line + observed value, ending at the cause',
35
+ '- Cause: file:line that, if changed, would prevent the failure',
28
36
  '- Fix: proposed change (PROPOSE only — do NOT apply the fix)',
37
+ '- Falsifier: how the maintainer verifies the fix works',
29
38
  '',
30
39
  '## Finding 2: <one-line title>',
31
40
  '- Severity: ...',
@@ -33,13 +42,22 @@ const FINDING_FORMAT_INSTRUCTIONS = [
33
42
  '',
34
43
  'Rules:',
35
44
  '- Each finding heading MUST start with "## Finding N: " (h2, "Finding ", number, colon, title) — number sequentially from 1.',
36
- '- Severity / Hypothesis / Evidence / Fix bullets are on their own lines with the labels exactly as shown.',
45
+ '- Reproduction / Symptom / Trace / Cause / Fix / Falsifier bullets are on their own lines with the labels exactly as shown.',
37
46
  '- This is a read-only diagnostic — do NOT edit any file. Propose fixes; the caller applies them.',
38
47
  '- Limit yourself to 3-5 most-likely hypotheses. Do not enumerate implausible ones to pad the list.',
39
48
  '',
40
49
  // Tool sweep #12: shared rubric so worker self-aligns with the annotator.
41
50
  SEVERITY_LADDER,
42
51
  '',
52
+ // Debug failure-mode taxonomy. Without this block, workers stop at
53
+ // the first plausible explanation (often the symptom) instead of
54
+ // tracing upstream to the actual cause.
55
+ DEBUG_FAILURE_MODES,
56
+ '',
57
+ // Counter-balances the SEVERITY_LADDER's anti-inflation hint and
58
+ // includes the symptom→cause walk with worked example.
59
+ THOROUGHNESS_REMINDER_DEBUG,
60
+ '',
43
61
  EVIDENCE_RULE_DEBUG,
44
62
  '',
45
63
  SCOPE_RULE_DEBUG,
@@ -1 +1 @@
1
- {"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/debug/tool-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,oB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CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACtF,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,SAAS;SACtC,CAAC;IACJ,CAAC;IACD,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC,CAAC,EAAE;IACzG,gBAAgB,EAAE,qBAAqB;IACvC,eAAe,EAAE;QACf,SAAS,EAAE,oBAAoB;KAChC;CACF,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Delegate-specific implementer criteria.
3
+ *
4
+ * DELEGATE'S PURPOSE — read this before adding categories.
5
+ * mma-delegate is the generic dispatcher for ad-hoc implementation
6
+ * tasks. The caller hands you a `prompt` (and optionally a `done`
7
+ * acceptance criterion, `filePaths`, `verifyCommand`); your output is
8
+ * a diff a REVIEWER will read alongside the brief. The success
9
+ * criterion is:
10
+ *
11
+ * "Could a reviewer who reads only the brief and your diff approve
12
+ * the merge without flagging gaps the worker should have caught
13
+ * or extras the brief did not authorize?"
14
+ *
15
+ * That criterion is what makes a write load-bearing. The reviewer is
16
+ * NOT a rubber stamp — they will ask "did you finish that?" if the
17
+ * fix is partial, and "why did you also touch X?" if the diff has
18
+ * scope creep. Your job is to produce the SMALLEST COMPLETE CHANGE
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.
25
+ */
26
+ /**
27
+ * The orientation block. Goes at the TOP of every delegate prompt.
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.
34
+ */
35
+ 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
+ export declare const DELEGATE_SCOPE_RULE: string;
43
+ /**
44
+ * The failure-mode taxonomy for delegate.
45
+ *
46
+ * Workers calibrated on "implement something good" tend to over-deliver
47
+ * (scope creep) or under-deliver (silent partial fix). The 9 categories
48
+ * below are the specific patterns reviewers raise as merge-blockers.
49
+ */
50
+ export declare const DELEGATE_FAILURE_MODES: string;
51
+ /**
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".
60
+ */
61
+ export declare const COMPLETENESS_REMINDER_DELEGATE: string;
62
+ //# sourceMappingURL=implementer-criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,QAc7B,CAAC;AAEb;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAMpB,CAAC;AAEb;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,QAiBvB,CAAC;AAEb;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,QAe/B,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Delegate-specific implementer criteria.
3
+ *
4
+ * DELEGATE'S PURPOSE — read this before adding categories.
5
+ * mma-delegate is the generic dispatcher for ad-hoc implementation
6
+ * tasks. The caller hands you a `prompt` (and optionally a `done`
7
+ * acceptance criterion, `filePaths`, `verifyCommand`); your output is
8
+ * a diff a REVIEWER will read alongside the brief. The success
9
+ * criterion is:
10
+ *
11
+ * "Could a reviewer who reads only the brief and your diff approve
12
+ * the merge without flagging gaps the worker should have caught
13
+ * or extras the brief did not authorize?"
14
+ *
15
+ * That criterion is what makes a write load-bearing. The reviewer is
16
+ * NOT a rubber stamp — they will ask "did you finish that?" if the
17
+ * fix is partial, and "why did you also touch X?" if the diff has
18
+ * scope creep. Your job is to produce the SMALLEST COMPLETE CHANGE
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.
25
+ */
26
+ /**
27
+ * The orientation block. Goes at the TOP of every delegate prompt.
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.
34
+ */
35
+ export const DELEGATE_PURPOSE_ORIENTATION = [
36
+ 'Why this delegation exists:',
37
+ 'mma-delegate produces a diff a reviewer will read alongside the brief. Success = the diff is the SMALLEST COMPLETE CHANGE that satisfies the brief — minimal AND complete simultaneously. A reviewer should not need to ask "did you finish that?" or "why did you also touch X?".',
38
+ '',
39
+ 'For your output to clear that bar:',
40
+ '- Implement EXACTLY what the brief asks for. Not less (SILENT PARTIAL FIX). Not more (SCOPE CREEP).',
41
+ '- If the brief lists `filePaths`, those are the authorized targets. Existing files in the list = pre-verified to read; non-existent paths in the list = explicit output targets you must create. Files NOT in the list are off-limits to write (touch only when the brief\'s task genuinely requires it, and call out the deviation in your summary).',
42
+ '- If the brief includes a `done` acceptance criterion, the reviewer will check your diff against that criterion. Match it precisely.',
43
+ '- If the brief includes a `verifyCommand`, run it after your changes. A green verify is part of "complete"; a red verify is part of "incomplete".',
44
+ '- Match the surrounding code\'s conventions (naming, import style, error handling, formatting). Inventing patterns instead of matching is convention drift — the reviewer will flag it.',
45
+ '- If you change a public symbol (exported function signature, exported type, public method), update the callers in the named files. Leaving callers stale is an INCOMPLETE REFACTOR.',
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?',
49
+ ].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
+ export const DELEGATE_SCOPE_RULE = [
57
+ 'Scope:',
58
+ '- 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 a typed interface).',
60
+ '- Writing: existing files in `filePaths` (modify) and non-existent paths in `filePaths` (create). Files outside `filePaths` are off-limits to write unless the brief\'s task genuinely requires it (e.g. updating a caller because the task changed a signature — call this out in your summary).',
61
+ '- Out of scope: refactors not in the brief, tangential cleanup ("while I\'m here…"), modifying tests/fixtures/specs to mask a wrong implementation, opportunistic style fixes, dependency upgrades the brief did not request.',
62
+ ].join('\n');
63
+ /**
64
+ * The failure-mode taxonomy for delegate.
65
+ *
66
+ * Workers calibrated on "implement something good" tend to over-deliver
67
+ * (scope creep) or under-deliver (silent partial fix). The 9 categories
68
+ * below are the specific patterns reviewers raise as merge-blockers.
69
+ */
70
+ export const DELEGATE_FAILURE_MODES = [
71
+ 'Patterns to consciously check for. Apply on EVERY delegated task:',
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.',
82
+ '',
83
+ 'Severity calibration for delegate (in your summary, not via SEVERITY_LADDER which is for read-only tools):',
84
+ '- Issues you notice but do NOT fix: report in summary so the reviewer can decide.',
85
+ '- Issues you encounter that block the brief: report and stop. Do not pick a workaround unilaterally.',
86
+ '- Issues clearly implied by the brief but not literally stated (e.g. "fix bug" implies "regression test added"): implement and name them as "implicit per the brief" in summary.',
87
+ ].join('\n');
88
+ /**
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".
97
+ */
98
+ export const COMPLETENESS_REMINDER_DELEGATE = [
99
+ 'Completeness reminder:',
100
+ '- "Smallest complete change" is the bar. Smallest = no extras. Complete = no gaps.',
101
+ '- Most workers on first pass either bloat (extra refactor / extra cleanup / extra abstraction) or skim (declared done with the regression test missing). Both are merge-blockers; aim for the intersection.',
102
+ '- Before declaring done, walk the brief literally:',
103
+ ' 1. List every requirement in the prompt (and `done` if present).',
104
+ ' 2. For each, ask: "is this in my diff?" If no, you are not done.',
105
+ ' 3. Walk the diff in reverse: for each changed file/line, ask: "is this required by a brief item?" If no, remove it.',
106
+ ' 4. If `verifyCommand` is set, run it. Quote the relevant output line in your summary.',
107
+ '',
108
+ 'Brief-vs-diff walk (REQUIRED on every task):',
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?".',
113
+ ].join('\n');
114
+ //# sourceMappingURL=implementer-criteria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementer-criteria.js","sourceRoot":"","sources":["../../../src/tools/delegate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,6BAA6B;IAC7B,oRAAoR;IACpR,EAAE;IACF,oCAAoC;IACpC,qGAAqG;IACrG,uVAAuV;IACvV,sIAAsI;IACtI,mJAAmJ;IACnJ,yLAAyL;IACzL,sLAAsL;IACtL,6LAA6L;IAC7L,EAAE;IACF,0NAA0N;CAC3N,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ;IACR,oGAAoG;IACpG,sOAAsO;IACtO,mSAAmS;IACnS,+NAA+N;CAChO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,mEAAmE;IACnE,EAAE;IACF,2MAA2M;IAC3M,+OAA+O;IAC/O,+MAA+M;IAC/M,6QAA6Q;IAC7Q,+PAA+P;IAC/P,iNAAiN;IACjN,iTAAiT;IACjT,+OAA+O;IAC/O,6RAA6R;IAC7R,EAAE;IACF,4GAA4G;IAC5G,mFAAmF;IACnF,sGAAsG;IACtG,kLAAkL;CACnL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,wBAAwB;IACxB,oFAAoF;IACpF,6MAA6M;IAC7M,oDAAoD;IACpD,sEAAsE;IACtE,sEAAsE;IACtE,yHAAyH;IACzH,2FAA2F;IAC3F,EAAE;IACF,8CAA8C;IAC9C,sIAAsI;IACtI,iGAAiG;IACjG,0rBAA0rB;IAC1rB,kLAAkL;CACnL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Execute-plan-specific implementer criteria.
3
+ *
4
+ * EXECUTE-PLAN'S PURPOSE — read this before adding categories.
5
+ * mma-execute-plan implements one task from a plan that was written by a
6
+ * higher-capability model. Your output is a diff the PLAN AUTHOR will
7
+ * read. They wrote the plan precisely; your job is execution, not
8
+ * improvement. The success criterion is:
9
+ *
10
+ * "Could the plan author read your diff and say 'yes, that's exactly
11
+ * what I wrote' — not 'close, but you took liberties' or 'wrong, you
12
+ * missed step 3'?"
13
+ *
14
+ * That criterion is what makes a write load-bearing. The fidelity bar
15
+ * is sharper than mma-delegate's: even a "better" implementation that
16
+ * deviates from the plan is wrong here. If you think the plan is wrong:
17
+ * REPORT IT and stop. Do NOT silently improve.
18
+ *
19
+ * Plan execution is artifact-producing — you write files. Cross-agent
20
+ * spec + quality review still applies. But the spec the spec-reviewer
21
+ * checks against is the PLAN, not your interpretation of it.
22
+ */
23
+ /**
24
+ * The orientation block. Goes at the TOP of every execute-plan prompt.
25
+ *
26
+ * Without an explicit fidelity statement, workers default to "implement
27
+ * the goal" — which produces "improvements" that diverge from the plan
28
+ * (CODE SUBSTITUTION, ACCEPTANCE-CRITERIA OVERRUN). With this
29
+ * orientation, the worker treats the plan as authoritative and reports
30
+ * defects rather than silently working around them.
31
+ */
32
+ export declare const EXECUTE_PLAN_PURPOSE_ORIENTATION: string;
33
+ export declare const EXECUTE_PLAN_SCOPE_RULE: string;
34
+ /**
35
+ * The failure-mode taxonomy for execute-plan.
36
+ *
37
+ * Workers calibrated on "implement the goal" tend to make "small
38
+ * improvements" to plans they think are imperfect. The 9 categories
39
+ * below are the specific ways execution diverges from intent.
40
+ */
41
+ export declare const EXECUTE_PLAN_FAILURE_MODES: string;
42
+ /**
43
+ * Plan-fidelity reminder.
44
+ *
45
+ * The shared SEVERITY_LADDER does not apply to write tools. The
46
+ * counter-balance for execute-plan is opposite to read-only tools:
47
+ * the typical failure is OVER-IMPLEMENTATION (improving the plan), not
48
+ * under-finding. This block tells the worker the load-bearing
49
+ * constraint is fidelity, not "good code".
50
+ */
51
+ export declare const PLAN_FIDELITY_REMINDER: string;
52
+ //# sourceMappingURL=implementer-criteria.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/execute-plan/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,QAiBjC,CAAC;AAEb,eAAO,MAAM,uBAAuB,QAMxB,CAAC;AAEb;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAiB3B,CAAC;AAEb;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAYvB,CAAC"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Execute-plan-specific implementer criteria.
3
+ *
4
+ * EXECUTE-PLAN'S PURPOSE — read this before adding categories.
5
+ * mma-execute-plan implements one task from a plan that was written by a
6
+ * higher-capability model. Your output is a diff the PLAN AUTHOR will
7
+ * read. They wrote the plan precisely; your job is execution, not
8
+ * improvement. The success criterion is:
9
+ *
10
+ * "Could the plan author read your diff and say 'yes, that's exactly
11
+ * what I wrote' — not 'close, but you took liberties' or 'wrong, you
12
+ * missed step 3'?"
13
+ *
14
+ * That criterion is what makes a write load-bearing. The fidelity bar
15
+ * is sharper than mma-delegate's: even a "better" implementation that
16
+ * deviates from the plan is wrong here. If you think the plan is wrong:
17
+ * REPORT IT and stop. Do NOT silently improve.
18
+ *
19
+ * Plan execution is artifact-producing — you write files. Cross-agent
20
+ * spec + quality review still applies. But the spec the spec-reviewer
21
+ * checks against is the PLAN, not your interpretation of it.
22
+ */
23
+ /**
24
+ * The orientation block. Goes at the TOP of every execute-plan prompt.
25
+ *
26
+ * Without an explicit fidelity statement, workers default to "implement
27
+ * the goal" — which produces "improvements" that diverge from the plan
28
+ * (CODE SUBSTITUTION, ACCEPTANCE-CRITERIA OVERRUN). With this
29
+ * orientation, the worker treats the plan as authoritative and reports
30
+ * defects rather than silently working around them.
31
+ */
32
+ export const EXECUTE_PLAN_PURPOSE_ORIENTATION = [
33
+ 'Why this execution exists:',
34
+ 'mma-execute-plan executes ONE task from a plan written by a higher-capability model. Your output is a diff the PLAN AUTHOR will read. They wrote the plan precisely. Your job is execution, not improvement.',
35
+ '',
36
+ 'The completion test: would the plan author, reading your diff, say "yes, that\'s exactly what I wrote" — or would they say "close, but you took liberties" / "wrong, you missed step 3"?',
37
+ '',
38
+ 'Fidelity rules — these override your usual instincts:',
39
+ '- Follow the plan EXACTLY as written. If the plan provides code blocks, use them VERBATIM (same names, same signatures, same comments, same imports).',
40
+ '- Do NOT redesign. Do NOT substitute your own approach. Do NOT improve names you find unidiomatic.',
41
+ '- Do NOT add steps the plan does not list. Do NOT skip steps the plan does list.',
42
+ '- Do NOT widen scope ("while I\'m here…"). Touch only what this task heading authorizes; another task probably owns the rest.',
43
+ '- If the plan looks wrong (typo, contradiction, undefined symbol, missing dependency): REPORT IT in your summary and stop. Do NOT silently work around it. Do NOT silently fix it.',
44
+ '- The plan was written by a higher-capability model than you. Your judgment about "what would be cleaner" is not load-bearing here; the plan is.',
45
+ '',
46
+ 'Reviewer awareness for plan execution:',
47
+ '- The spec-reviewer compares your diff against the PLAN section, not against general "good code" heuristics. A diff that improves on the plan will fail spec review.',
48
+ '- The quality-reviewer checks safety/correctness without overriding the plan. If the plan is genuinely unsafe, that surfaces as a quality concern that the caller resolves — not as your unilateral fix.',
49
+ ].join('\n');
50
+ export const EXECUTE_PLAN_SCOPE_RULE = [
51
+ 'Scope:',
52
+ '- Strictly the task the descriptor names. Other tasks in the plan have other workers; do not implement them on the side.',
53
+ '- Touch only the files the named task authorizes (explicit file paths in the plan section, or files clearly implied by the named task).',
54
+ '- Out of scope: other plan tasks; refactors not in the plan; "while I\'m here" cleanup; renaming code blocks the plan provided verbatim.',
55
+ '- Genuinely necessary cross-cutting work (e.g. updating a caller because the plan changed a signature): allowed when the plan implies it. When in doubt, REPORT it as part of your summary and let the caller decide.',
56
+ ].join('\n');
57
+ /**
58
+ * The failure-mode taxonomy for execute-plan.
59
+ *
60
+ * Workers calibrated on "implement the goal" tend to make "small
61
+ * improvements" to plans they think are imperfect. The 9 categories
62
+ * below are the specific ways execution diverges from intent.
63
+ */
64
+ export const EXECUTE_PLAN_FAILURE_MODES = [
65
+ 'Patterns to consciously check for. Apply on EVERY plan execution:',
66
+ '',
67
+ '1. PLAN REWRITE — you decided the plan was suboptimal and "improved" it. This is the worst execute-plan failure mode. The plan author treats the plan as the contract; your improvements are a contract violation.',
68
+ '2. STEP SKIP — the plan section lists multiple steps; you implemented some and silently omitted others. Every step listed in the plan is a required deliverable unless the plan explicitly marks it optional.',
69
+ '3. STEP REORDER — you executed plan steps in a different order than the plan specifies. Order may be load-bearing (later steps may depend on earlier ones); preserve it.',
70
+ '4. CODE SUBSTITUTION — the plan provided a code block (function body, import line, type definition) and you wrote DIFFERENT code that "does the same thing". The plan\'s code is verbatim; copy it. Renaming, reformatting, or replacing with idiomatic equivalents is substitution.',
71
+ '5. ACCEPTANCE-CRITERIA OVERRUN — the plan listed criteria A and B; you also delivered C ("seemed natural"). Adding extras the plan did not list is scope creep — even if C is technically good code.',
72
+ '6. ACCEPTANCE-CRITERIA UNDERRUN — the plan implies sub-criteria (e.g. "add the function" implies "add the export to the index file"; "fix the bug" implies "add a regression test"). Missing implicit sub-criteria is the most common silent-partial-fix in plan execution.',
73
+ '7. WRONG-TASK MATCH — you matched a different plan section than the descriptor names (e.g. matched "Step 4: foo" when descriptor said "Step 4: bar"). The descriptor must match the plan heading verbatim; if no unique match exists, report that and stop.',
74
+ '8. CROSS-TASK CONTAMINATION — you touched files the named task does not authorize, on the assumption that another task in the plan will eventually need them. Other tasks have other workers; touching their files creates merge conflicts and ownership ambiguity.',
75
+ '9. PROBLEM-NOT-FLAGGED — you noticed a defect in the plan (typo, contradiction, undefined symbol, broken example) and silently worked around it. The defect must be reported in your summary so the caller can correct the plan; silent workarounds make the next plan execution harder.',
76
+ '',
77
+ 'Severity calibration for plan execution (in your summary, not via SEVERITY_LADDER which is for read-only tools):',
78
+ '- Plan defects you notice: ALWAYS report. The caller may have a fix or may want to update the plan first.',
79
+ '- Sub-criteria you cannot satisfy without deviating from the plan: report and stop. Do not pick a workaround unilaterally.',
80
+ '- Sub-criteria that are clearly implied but not literally stated: implement them, name them in your summary as "implicit per the task heading".',
81
+ ].join('\n');
82
+ /**
83
+ * Plan-fidelity reminder.
84
+ *
85
+ * The shared SEVERITY_LADDER does not apply to write tools. The
86
+ * counter-balance for execute-plan is opposite to read-only tools:
87
+ * the typical failure is OVER-IMPLEMENTATION (improving the plan), not
88
+ * under-finding. This block tells the worker the load-bearing
89
+ * constraint is fidelity, not "good code".
90
+ */
91
+ export const PLAN_FIDELITY_REMINDER = [
92
+ 'Plan-fidelity reminder:',
93
+ '- Your judgment about "what would be cleaner" is NOT load-bearing here. The plan is.',
94
+ '- Every deviation from the plan needs a reason and a report. Silent deviations are the most common defect.',
95
+ '- "Smallest faithful change" — touch the minimum the task authorizes, in the order the plan specifies, with the code the plan provides verbatim where provided.',
96
+ '- If the plan is wrong: report and stop. Do NOT silently fix the plan.',
97
+ '',
98
+ 'Code-block faithfulness walk (REQUIRED on every task that includes plan-provided code):',
99
+ '- For each code block in the matched plan section, ask: did I copy this verbatim? Same names, same signatures, same comments, same imports?',
100
+ '- If no — what did I change? Why? Is the change required by the task or am I improving?',
101
+ '- Worked example. A plan section says: "Step 2: create `src/parser.ts` with content (verbatim): `export function parse(input: string): Token[] { ... }`". Naive worker writes `src/parser.ts` exporting `parseTokens` (renamed for clarity) with JSDoc added. Result: CODE SUBSTITUTION + ACCEPTANCE-CRITERIA OVERRUN. The downstream code that imports `parse` now breaks; the plan author reads the diff and says "I wrote `parse`, why is this `parseTokens`?". Correct worker creates `src/parser.ts` with exactly the named export `parse`, no JSDoc additions, no rename. If JSDoc would be valuable, mention it in the summary as a follow-up rather than adding it here.',
102
+ '- Most workers miss findings of this shape on first pass because the renamed/reformatted version "feels right" and they trust their instincts. The faithfulness walk forces the verbatim check.',
103
+ ].join('\n');
104
+ //# sourceMappingURL=implementer-criteria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementer-criteria.js","sourceRoot":"","sources":["../../../src/tools/execute-plan/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,4BAA4B;IAC5B,8MAA8M;IAC9M,EAAE;IACF,0LAA0L;IAC1L,EAAE;IACF,uDAAuD;IACvD,uJAAuJ;IACvJ,oGAAoG;IACpG,kFAAkF;IAClF,+HAA+H;IAC/H,oLAAoL;IACpL,kJAAkJ;IAClJ,EAAE;IACF,wCAAwC;IACxC,sKAAsK;IACtK,0MAA0M;CAC3M,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,0HAA0H;IAC1H,yIAAyI;IACzI,0IAA0I;IAC1I,uNAAuN;CACxN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,mEAAmE;IACnE,EAAE;IACF,oNAAoN;IACpN,+MAA+M;IAC/M,0KAA0K;IAC1K,sRAAsR;IACtR,sMAAsM;IACtM,6QAA6Q;IAC7Q,6PAA6P;IAC7P,qQAAqQ;IACrQ,0RAA0R;IAC1R,EAAE;IACF,kHAAkH;IAClH,2GAA2G;IAC3G,4HAA4H;IAC5H,iJAAiJ;CAClJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,yBAAyB;IACzB,sFAAsF;IACtF,4GAA4G;IAC5G,iKAAiK;IACjK,wEAAwE;IACxE,EAAE;IACF,yFAAyF;IACzF,6IAA6I;IAC7I,yFAAyF;IACzF,kpBAAkpB;IAClpB,iMAAiM;CAClM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tool-config.d.ts","sourceRoot":"","sources":["../../../src/tools/execute-plan/tool-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMlF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAMxH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;kBAOxB,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAYvE;AA0CD,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,oBAAoB,EAAE,oBAAoB,CA4B7E,CAAC"}
1
+ {"version":3,"file":"tool-config.d.ts","sourceRoot":"","sources":["../../../src/tools/execute-plan/tool-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMlF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAYxH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;kBAOxB,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAYvE;AA6DD,eAAO,MAAM,UAAU,EAAE,UAAU,CAAC,oBAAoB,EAAE,oBAAoB,CA4B7E,CAAC"}
@@ -5,6 +5,7 @@ import { executePlanHeadlineTemplate } from '../../reporting/headline-templates/
5
5
  import { executePlanReportSchema } from '../../reporting/report-parser-slots/execute-plan-report.js';
6
6
  import { DEFAULT_TASK_TIMEOUT_MS } from '../../config/schema.js';
7
7
  import { REVIEWER_AWARENESS_AP } from '../../review/templates/finding-criteria.js';
8
+ import { EXECUTE_PLAN_PURPOSE_ORIENTATION, EXECUTE_PLAN_SCOPE_RULE, EXECUTE_PLAN_FAILURE_MODES, PLAN_FIDELITY_REMINDER, } from './implementer-criteria.js';
8
9
  export const executePlanInputSchema = z.object({
9
10
  filePaths: z.array(z.string()).length(1, { message: "execute_plan requires exactly one plan filePath" }),
10
11
  taskDescriptors: z.array(z.string()).min(1),
@@ -29,9 +30,22 @@ export function registerExecutePlan(registry) {
29
30
  /**
30
31
  * Build a compact worker prompt for one plan task. Extracted from the legacy
31
32
  * executor — just the section matched by the slot, not the full plan file.
33
+ *
34
+ * The prompt is structured top-down: orientation (why this exists) →
35
+ * task descriptor → matched plan section → file paths → fidelity rules
36
+ * (RESTORED in 4.1.0; the older `compileExecutePlan` had them, the
37
+ * slot-style refactor that became the canonical path dropped them) →
38
+ * failure-mode taxonomy → reviewer awareness. Without the orientation
39
+ * + fidelity blocks, workers default to "implement the goal" and treat
40
+ * the plan as a starting suggestion rather than the contract.
32
41
  */
33
42
  function buildExecutePlanPrompt(filePaths, task, taskSection) {
34
43
  const parts = [
44
+ // Orientation goes FIRST — fidelity-first framing before the
45
+ // task descriptor, so the worker reads the section through the
46
+ // execution lens instead of the "improve it" lens.
47
+ EXECUTE_PLAN_PURPOSE_ORIENTATION,
48
+ '',
35
49
  `Execute this task from the plan: "${task}"`,
36
50
  '',
37
51
  ];
@@ -39,10 +53,10 @@ function buildExecutePlanPrompt(filePaths, task, taskSection) {
39
53
  parts.push('Relevant plan section:', '', '---', taskSection.trim(), '---', '');
40
54
  }
41
55
  else {
42
- parts.push('No unique plan section matched that task heading. The full plan file is at:', ...filePaths.map((p) => ` - ${p}`), 'Read the plan file(s) yourself to find the task.', '');
56
+ parts.push('No unique plan section matched that task heading. The full plan file is at:', ...filePaths.map((p) => ` - ${p}`), 'Read the plan file(s) yourself to find the task. If still no unique match, report that and stop — do not implement anything.', '');
43
57
  }
44
- parts.push('Plan files for reference (read on demand if you need adjacent context):', ...filePaths.map((p) => ` - ${p}`), '');
45
- parts.push('Implement the task fully. Follow any acceptance criteria, file paths, and', 'constraints in the plan section above. If you cannot find or understand', 'the task, report that explicitly and do not implement anything.', '',
58
+ parts.push('Plan files for reference (read on demand if you need adjacent context — but do not enlarge scope into other tasks):', ...filePaths.map((p) => ` - ${p}`), '');
59
+ parts.push('Implement the task fully. Follow any acceptance criteria, file paths, and', 'constraints in the plan section above. If you cannot find or understand', 'the task, report that explicitly and do not implement anything.', '', EXECUTE_PLAN_SCOPE_RULE, '', EXECUTE_PLAN_FAILURE_MODES, '', PLAN_FIDELITY_REMINDER, '',
46
60
  // Tool sweep #12: share spec + quality reviewer rubric so the
47
61
  // worker self-aligns on what each reviewer will judge against.
48
62
  REVIEWER_AWARENESS_AP);
@@ -1 +1 @@
1
- {"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../../src/tools/execute-plan/tool-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,wBAAwB,EAA6B,MAAM,mDAAmD,CAAC;AACxH,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,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AAsB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC;QACxF,SAAS,EAAE,UAAU;QACrB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,IAAI,EAAE,gOAAgO;QACtO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,IAAI,MAAM;QAC3C,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,uBAAuB;QACpE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,IAAI,EAAE;QACjD,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,IAAI,UAAU;QAC/D,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;IACF,YAAY,EAAE,uBAAuB;IACrC,gBAAgB,EAAE,2BAA2B;IAC7C,eAAe,EAAE;QACf,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,iBAAiB;QAC5B,IAAI,EAAE,YAAY;KACnB;CACF,CAAC"}
@@ -1,17 +1,60 @@
1
1
  /**
2
2
  * Investigate-specific implementer criteria.
3
3
  *
4
+ * INVESTIGATE'S PURPOSE — read this before adding categories.
5
+ * mma-investigate answers a question about the codebase. The caller is
6
+ * about to ACT on your answer — write code, edit a file, choose between
7
+ * approaches. The success criterion is:
8
+ *
9
+ * "If the caller acts on this answer literally — opens the cited
10
+ * files, follows the cited chain, takes the synthesis at face value
11
+ * — will they end up with correct code?"
12
+ *
13
+ * That criterion is what makes a finding load-bearing. A wrong file
14
+ * path, a stale quote, a hand-waved synthesis, an overstated confidence
15
+ * — all become bugs the caller writes. The investigate-equivalent of
16
+ * "fix is unimplementable" is "the answer points at a file that does
17
+ * not contain what you said it contained."
18
+ *
4
19
  * Investigate answers a question about the codebase. Findings can be
5
20
  * code-level citations, project-level synthesis, or NEGATIVE results
6
- * ("searched X, not found"). The shared evidence rule that demands a
7
- * code quote for every finding wrongly suppresses negative results,
8
- * which are often the most useful answer to "is X still used?" or
9
- * "where does Y live?".
21
+ * ("searched X, not found"). Negative findings are legitimate answers
22
+ * to "is X still used?" or "where does Y live?" and must not be
23
+ * suppressed.
10
24
  *
11
25
  * Note: investigate does NOT use SEVERITY_LADDER — its findings are
12
- * citations and synthesis, not severity-rated issues.
26
+ * citations and synthesis, not severity-rated issues. Confidence is the
27
+ * calibration dial, not severity.
28
+ */
29
+ /**
30
+ * The orientation block. Goes at the TOP of every investigate prompt.
31
+ *
32
+ * Without an explicit purpose statement, workers default to "give a
33
+ * plausible-sounding answer" — which produces hallucinated citations
34
+ * and overstated confidence. With this orientation, every claim is
35
+ * ground-truthed against the file system.
13
36
  */
37
+ export declare const INVESTIGATE_PURPOSE_ORIENTATION: string;
14
38
  export declare const EVIDENCE_RULE_INVESTIGATE: string;
15
39
  export declare const SCOPE_RULE_INVESTIGATE: string;
40
+ /**
41
+ * The failure-mode taxonomy for investigations.
42
+ *
43
+ * Without this block, workers tend to give plausible-sounding answers
44
+ * with shaky citations. The 8 categories below are the specific ways
45
+ * an investigation answer becomes a bug when the caller acts on it.
46
+ */
47
+ export declare const INVESTIGATE_FAILURE_MODES: string;
48
+ /**
49
+ * Confidence-discipline reminder.
50
+ *
51
+ * The shared SEVERITY_LADDER does not apply to investigate (findings
52
+ * are citations, not severity-rated). Instead, confidence is the
53
+ * calibration dial. The common failure mode is over-confidence —
54
+ * stating "high confidence" because the worker sounds certain,
55
+ * not because the evidence is strong. This block tells the worker
56
+ * confidence reflects evidence strength only.
57
+ */
58
+ export declare const CONFIDENCE_REMINDER_INVESTIGATE: string;
16
59
  export declare const ANNOTATOR_AWARENESS_INVESTIGATE: string;
17
60
  //# sourceMappingURL=implementer-criteria.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/investigate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,yBAAyB,QAK1B,CAAC;AAEb,eAAO,MAAM,sBAAsB,QAIvB,CAAC;AAEb,eAAO,MAAM,+BAA+B,QAOhC,CAAC"}
1
+ {"version":3,"file":"implementer-criteria.d.ts","sourceRoot":"","sources":["../../../src/tools/investigate/implementer-criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,QAahC,CAAC;AAEb,eAAO,MAAM,yBAAyB,QAO1B,CAAC;AAEb,eAAO,MAAM,sBAAsB,QAKvB,CAAC;AAEb;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,QAiB1B,CAAC;AAEb;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,QAYhC,CAAC;AAEb,eAAO,MAAM,+BAA+B,QAShC,CAAC"}