@davidorex/pi-jit-agents 0.26.0 → 0.28.1

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/CHANGELOG.md +51 -0
  2. package/README.md +2 -2
  3. package/dist/compile.d.ts.map +1 -1
  4. package/dist/compile.js +9 -3
  5. package/dist/compile.js.map +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/jit-runtime.d.ts +11 -0
  11. package/dist/jit-runtime.d.ts.map +1 -1
  12. package/dist/jit-runtime.js +36 -0
  13. package/dist/jit-runtime.js.map +1 -1
  14. package/dist/renderer-registry.d.ts +23 -7
  15. package/dist/renderer-registry.d.ts.map +1 -1
  16. package/dist/renderer-registry.js +34 -21
  17. package/dist/renderer-registry.js.map +1 -1
  18. package/dist/template.d.ts +15 -0
  19. package/dist/template.d.ts.map +1 -1
  20. package/dist/template.js +19 -0
  21. package/dist/template.js.map +1 -1
  22. package/dist/types.d.ts +4 -0
  23. package/dist/types.d.ts.map +1 -1
  24. package/package.json +7 -3
  25. package/schemas/agent-trace.schema.json +30 -2
  26. package/templates/analyzers/base-analyzer.md +9 -0
  27. package/templates/analyzers/patterns-task.md +11 -0
  28. package/templates/analyzers/patterns.md +15 -0
  29. package/templates/analyzers/quality-task.md +11 -0
  30. package/templates/analyzers/quality.md +15 -0
  31. package/templates/analyzers/structure-task.md +17 -0
  32. package/templates/analyzers/structure.md +15 -0
  33. package/templates/architecture-designer/task.md +117 -0
  34. package/templates/architecture-inferrer/task.md +61 -0
  35. package/templates/audit-finding-verifier/task.md +59 -0
  36. package/templates/audit-fixer/task.md +67 -0
  37. package/templates/audit-results-router/task.md +37 -0
  38. package/templates/decomposer/task.md +56 -0
  39. package/templates/explorer/system.md +3 -0
  40. package/templates/explorer/task.md +9 -0
  41. package/templates/gap-identifier/task.md +103 -0
  42. package/templates/gap-resolution-assessor/task.md +48 -0
  43. package/templates/handoff-writer/task.md +101 -0
  44. package/templates/investigator/task.md +30 -0
  45. package/templates/items/architecture.md +33 -0
  46. package/templates/items/conformance.md +26 -0
  47. package/templates/items/conventions.md +19 -0
  48. package/templates/items/decisions.md +47 -0
  49. package/templates/items/domain.md +21 -0
  50. package/templates/items/features.md +63 -0
  51. package/templates/items/framework-gaps.md +43 -0
  52. package/templates/items/issues.md +21 -0
  53. package/templates/items/layer-plans.md +50 -0
  54. package/templates/items/project.md +48 -0
  55. package/templates/items/requirements.md +20 -0
  56. package/templates/items/research.md +57 -0
  57. package/templates/items/spec-reviews.md +51 -0
  58. package/templates/items/tasks.md +29 -0
  59. package/templates/phase-author/task.md +82 -0
  60. package/templates/plan-creator/task.md +143 -0
  61. package/templates/plan-decomposer/task.md +46 -0
  62. package/templates/project-definer/task.md +67 -0
  63. package/templates/project-inferrer/task.md +56 -0
  64. package/templates/requirements-gatherer/task.md +90 -0
  65. package/templates/researcher/task.md +26 -0
  66. package/templates/shared/macros.md +169 -0
  67. package/templates/shared/render-helpers.md +106 -0
  68. package/templates/spec-implementer/task.md +53 -0
  69. package/templates/synthesizer/system.md +3 -0
  70. package/templates/synthesizer/task.md +38 -0
  71. package/templates/task-verifier/task.md +44 -0
  72. package/templates/task-worker/task.md +52 -0
  73. package/templates/verifier/task.md +57 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MA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qD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,qFAAqF;IACrF,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,GAAG,EAAE,gBAAgB,CAAC;IACtB,0CAA0C;IAC1C,KAAK,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,CAAC,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@davidorex/pi-jit-agents",
3
- "version": "0.26.0",
3
+ "version": "0.28.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "Agent spec compilation and in-process dispatch runtime — the package that owns everything between 'I have a spec' and 'I have a typed result'",
5
8
  "license": "MIT",
6
9
  "author": "David Ryan",
@@ -49,16 +52,17 @@
49
52
  "files": [
50
53
  "dist/",
51
54
  "schemas/",
55
+ "templates/",
52
56
  "*.md"
53
57
  ],
54
58
  "scripts": {
55
59
  "clean": "rm -rf dist",
56
- "build": "tsc -p tsconfig.build.json",
60
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
57
61
  "prepublishOnly": "npm run clean && npm run build",
58
62
  "test": "tsx --test src/*.test.ts"
59
63
  },
60
64
  "dependencies": {
61
- "@davidorex/pi-context": "^0.26.0",
65
+ "@davidorex/pi-context": "^0.28.1",
62
66
  "@earendil-works/pi-ai": "^0.75.4",
63
67
  "nunjucks": "^3.2.4",
64
68
  "proper-lockfile": "^4.1.2",
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Agent Trace Entry",
4
- "description": "Discriminated union of trace events emitted during pi-jit-agents executeAgent invocations for monitor-classify pipelines. Each entry validates a single JSONL line; the .jsonl file as a whole is not a single JSON document. Per DEC-0004 the structural shape ({ type, id, parentId, timestamp, ...extra }) mirrors pi-coding-agent's SessionEntry but is deliberately a separate schema namespace — there is no literal inheritance. Per DEC-0005 these entries are produced by a push-write trace stream divergent from pi-mono's pull/replay model, so each variant is fired at the moment of occurrence inside executeAgent rather than reconstructed after the fact. The six variants form a parent-chained tree: session_start (root) → classify_call → { classify_response, context_collection } → verdict_decision; trace_end closes the session at the executeAgent exit boundary.",
4
+ "description": "Discriminated union of trace events emitted during pi-jit-agents executeAgent invocations for monitor-classify pipelines. Each entry validates a single JSONL line; the .jsonl file as a whole is not a single JSON document. The structural shape ({ type, id, parentId, timestamp, ...extra }) mirrors pi-coding-agent's SessionEntry but is deliberately a separate schema namespace — there is no literal inheritance. Entries are produced by a push-write trace stream divergent from pi-mono's pull/replay model, so each variant is fired at the moment of occurrence inside executeAgent rather than reconstructed after the fact. The six variants form a parent-chained tree: session_start (root) → classify_call → { classify_response, context_collection } → verdict_decision; trace_end closes the session at the executeAgent exit boundary.",
5
5
  "oneOf": [
6
6
  { "$ref": "#/definitions/session_start" },
7
7
  { "$ref": "#/definitions/classify_call" },
8
8
  { "$ref": "#/definitions/classify_response" },
9
9
  { "$ref": "#/definitions/context_collection" },
10
10
  { "$ref": "#/definitions/verdict_decision" },
11
- { "$ref": "#/definitions/trace_end" }
11
+ { "$ref": "#/definitions/trace_end" },
12
+ { "$ref": "#/definitions/extension_load_warning" }
12
13
  ],
13
14
  "definitions": {
14
15
  "traceId": {
@@ -186,6 +187,33 @@
186
187
  "totalDurationMs": { "type": "number" },
187
188
  "verdict": { "$ref": "#/definitions/verdictResult" }
188
189
  }
190
+ },
191
+ "extension_load_warning": {
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "required": ["type", "id", "parentId", "timestamp", "extension_name", "message", "severity"],
195
+ "properties": {
196
+ "type": { "const": "extension_load_warning" },
197
+ "id": { "$ref": "#/definitions/traceId" },
198
+ "parentId": {
199
+ "type": ["null", "string"],
200
+ "description": "Extension-load events are typically root events (no parent classify session); null when emitted at extension factory boundary. May reference a parent trace when emitted from within a dispatched agent's lifecycle."
201
+ },
202
+ "timestamp": { "$ref": "#/definitions/isoTimestamp" },
203
+ "extension_name": {
204
+ "type": "string",
205
+ "description": "Name of the Pi extension emitting the warning (e.g., pi-agent-dispatch)."
206
+ },
207
+ "message": {
208
+ "type": "string",
209
+ "description": "Human-readable description of the observed condition (e.g., 'substrate config absent — composites empty')."
210
+ },
211
+ "severity": {
212
+ "type": "string",
213
+ "enum": ["info", "warning", "error"],
214
+ "description": "Severity classification per the canonical pi.ui.notify levels."
215
+ }
216
+ }
189
217
  }
190
218
  }
191
219
  }
@@ -0,0 +1,9 @@
1
+ {% block identity %}You are a code analyst.{% endblock %} Given an exploration summary and a code path to analyze:
2
+
3
+ {% block checklist %}
4
+ 1. Analyze the code thoroughly
5
+ {% endblock %}
6
+
7
+ {% block constraints %}
8
+ Be specific — cite files and line ranges where applicable.
9
+ {% endblock %}
@@ -0,0 +1,11 @@
1
+ Analyze design patterns at `{{ path }}`.
2
+
3
+ {% if exploration.files is defined %}
4
+ ## Codebase
5
+ {% for file in exploration.files %}
6
+ - `{{ file.path }}` ({{ file.lines }} lines)
7
+ {% endfor %}
8
+ {% endif %}
9
+
10
+ Identify patterns, conventions, and anti-patterns. Provide recommendations.
11
+ Write your analysis as JSON conforming to the output schema.
@@ -0,0 +1,15 @@
1
+ {% extends "analyzers/base-analyzer.md" %}
2
+
3
+ {% block identity %}You are a design pattern analyst.{% endblock %}
4
+
5
+ {% block checklist %}
6
+ 1. **Design patterns**: What patterns are used? Are they applied correctly?
7
+ 2. **Idioms**: What language/framework idioms are followed or violated?
8
+ 3. **Conventions**: Naming, file organization, import style — are they consistent?
9
+ 4. **Anti-patterns**: Are there patterns that work against the codebase?
10
+ 5. **Recommendations**: What patterns would improve the codebase?
11
+ {% endblock %}
12
+
13
+ {% block constraints %}
14
+ Focus on patterns and conventions, not raw quality or architecture. Be specific — cite examples.
15
+ {% endblock %}
@@ -0,0 +1,11 @@
1
+ Analyze code quality at `{{ path }}`.
2
+
3
+ {% if exploration.files is defined %}
4
+ ## Codebase
5
+ {% for file in exploration.files %}
6
+ - `{{ file.path }}` ({{ file.lines }} lines)
7
+ {% endfor %}
8
+ {% endif %}
9
+
10
+ Assess test coverage, error handling, code smells, and maintainability.
11
+ Write your analysis as JSON conforming to the output schema.
@@ -0,0 +1,15 @@
1
+ {% extends "analyzers/base-analyzer.md" %}
2
+
3
+ {% block identity %}You are a code quality analyst.{% endblock %}
4
+
5
+ {% block checklist %}
6
+ 1. **Test coverage**: What is tested? What isn't? Are tests meaningful?
7
+ 2. **Error handling**: How are errors handled? Are there gaps?
8
+ 3. **Code smells**: Duplicated logic, overly complex functions, magic numbers?
9
+ 4. **Documentation**: Is the code documented? Are the docs accurate?
10
+ 5. **Maintainability**: How easy would it be to modify this code?
11
+ {% endblock %}
12
+
13
+ {% block constraints %}
14
+ Focus on quality concerns, not architecture or design patterns. Be specific — cite files and line ranges.
15
+ {% endblock %}
@@ -0,0 +1,17 @@
1
+ Analyze the code at `{{ path }}`.
2
+
3
+ {% if exploration.files is defined %}
4
+ ## Prior Exploration
5
+ {% for file in exploration.files %}
6
+ - `{{ file.path }}` ({{ file.lines }} lines){% if file.exports %}: {{ file.exports | length }} exports{% endif %}
7
+ {% endfor %}
8
+ {% endif %}
9
+
10
+ {% if exploration.types is defined %}
11
+ ## Known Types
12
+ {% for t in exploration.types %}
13
+ - `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
14
+ {% endfor %}
15
+ {% endif %}
16
+
17
+ Write your analysis as JSON conforming to the output schema.
@@ -0,0 +1,15 @@
1
+ {% extends "analyzers/base-analyzer.md" %}
2
+
3
+ {% block identity %}You are a code structure analyst.{% endblock %}
4
+
5
+ {% block checklist %}
6
+ 1. **Architecture**: How is the code organized? What patterns are used?
7
+ 2. **Module boundaries**: Are responsibilities clearly separated?
8
+ 3. **Dependencies**: What are the key dependency relationships?
9
+ 4. **Entry points**: How does execution flow through the code?
10
+ 5. **Configuration**: How is the system configured?
11
+ {% endblock %}
12
+
13
+ {% block constraints %}
14
+ Focus on structural concerns, not code quality or patterns. Be specific — cite files and directories.
15
+ {% endblock %}
@@ -0,0 +1,117 @@
1
+ ## Project Identity
2
+
3
+ **Name:** {{ project.name }}
4
+ **Description:** {{ project.description }}
5
+ **Core Value:** {{ project.core_value }}
6
+ {% if project.stack %}
7
+
8
+ ### Stack
9
+ {% for item in project.stack %}
10
+ - {{ item }}
11
+ {% endfor %}
12
+ {% endif %}
13
+
14
+ ### Constraints
15
+ {% for constraint in project.constraints %}
16
+ - [{{ constraint.type }}] {{ constraint.description }}
17
+ {% endfor %}
18
+
19
+ ### Scope Boundaries
20
+
21
+ **In scope:**
22
+ {% for item in project.scope_boundaries.in %}
23
+ - {{ item }}
24
+ {% endfor %}
25
+
26
+ **Out of scope:**
27
+ {% for item in project.scope_boundaries.out %}
28
+ - {{ item }}
29
+ {% endfor %}
30
+
31
+ ## Requirements
32
+
33
+ ### Must
34
+ {% for req in requirements.requirements %}
35
+ {% if req.priority == "must" %}
36
+ - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
37
+ {% endif %}
38
+ {% endfor %}
39
+
40
+ ### Should
41
+ {% for req in requirements.requirements %}
42
+ {% if req.priority == "should" %}
43
+ - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
44
+ {% endif %}
45
+ {% endfor %}
46
+
47
+ ### Could
48
+ {% for req in requirements.requirements %}
49
+ {% if req.priority == "could" %}
50
+ - **{{ req.id }}** [{{ req.type }}]: {{ req.description }}
51
+ {% endif %}
52
+ {% endfor %}
53
+
54
+ ## Instructions
55
+
56
+ Design the initial architecture for this project. Produce modules, patterns, and boundaries that satisfy the requirements above — starting with "must" requirements and ensuring "should" requirements have a clear home.
57
+
58
+ ### For each module, provide:
59
+
60
+ 1. **name** — short identifier (e.g., "api", "auth", "storage", "cli")
61
+ 2. **file** — primary file path relative to project root (e.g., "src/api.ts")
62
+ 3. **responsibility** — one sentence: what this module owns and what it does not
63
+ 4. **dependencies** — array of other module names this depends on (empty if none)
64
+ 5. **lines** — estimated lines of code (rough order of magnitude)
65
+
66
+ ### For each pattern, provide:
67
+
68
+ 1. **name** — recognized pattern name (e.g., "Repository Pattern", "Event Sourcing", "Middleware Pipeline")
69
+ 2. **description** — why this pattern is appropriate for this project's specific needs
70
+ 3. **used_in** — array of module names that implement this pattern
71
+
72
+ ### For boundaries, provide:
73
+
74
+ An array of strings — each describing a hard architectural constraint. These should be specific to this project, not generic ("All database access goes through the storage module", not "separate concerns").
75
+
76
+ ### Design principles
77
+
78
+ - Module count should be proportional to requirements — a 5-requirement project needs 3-5 modules, not 15
79
+ - Every "must" functional requirement should map to at least one module's responsibility
80
+ - Every "must" non-functional requirement should be addressed by a pattern or boundary
81
+ - Dependencies should flow in one direction — avoid circular module dependencies
82
+ - If the project has a stated stack, modules should use file extensions and conventions matching that stack
83
+ - Prefer explicit boundaries over implicit conventions
84
+
85
+ ### Overview
86
+
87
+ Write an `overview` paragraph (required) summarizing:
88
+ - The architectural style (layered, modular, pipeline, etc.)
89
+ - The key structural decisions and why they fit this project
90
+ - How the architecture supports the core_value
91
+
92
+ ### Output format
93
+
94
+ Produce a single JSON object:
95
+
96
+ ```json
97
+ {
98
+ "overview": "string (required)",
99
+ "modules": [
100
+ {
101
+ "name": "string (required)",
102
+ "file": "string (required)",
103
+ "responsibility": "string (required)",
104
+ "dependencies": ["string"],
105
+ "lines": 100
106
+ }
107
+ ],
108
+ "patterns": [
109
+ {
110
+ "name": "string (required)",
111
+ "description": "string (required)",
112
+ "used_in": ["module-name"]
113
+ }
114
+ ],
115
+ "boundaries": ["string"]
116
+ }
117
+ ```
@@ -0,0 +1,61 @@
1
+ Infer the architecture of the project at `{{ path }}`.
2
+
3
+ ## Codebase Analysis
4
+
5
+ {% if exploration.files is defined %}
6
+ ### Files
7
+ {% for file in exploration.files %}
8
+ - `{{ file.path }}` ({{ file.language | default("unknown") }}, {{ file.lines | default("?") }} lines){% if file.exports %} — {{ file.exports | length }} exports{% endif %}
9
+ {% endfor %}
10
+ {% endif %}
11
+
12
+ {% if exploration.types is defined %}
13
+ ### Types
14
+ {% for t in exploration.types %}
15
+ - `{{ t.name }}` ({{ t.kind }}) in `{{ t.file }}`
16
+ {% endfor %}
17
+ {% endif %}
18
+
19
+ {% if exploration.dependencies is defined %}
20
+ ### Dependencies
21
+ {% for d in exploration.dependencies %}
22
+ - `{{ d.from }}` → `{{ d.to }}` ({{ d.type | default("import") }})
23
+ {% endfor %}
24
+ {% endif %}
25
+
26
+ {% if exploration.entryPoints is defined %}
27
+ ### Entry Points
28
+ {% for ep in exploration.entryPoints %}
29
+ - `{{ ep }}`
30
+ {% endfor %}
31
+ {% endif %}
32
+
33
+ ## Instructions
34
+
35
+ From the analysis above and targeted code reads, produce an architecture block:
36
+
37
+ 1. **Modules** — each cohesive unit with a clear responsibility. For each:
38
+ - `name`: concise identifier (e.g., "block-api", "expression-engine")
39
+ - `file`: primary file path relative to project root
40
+ - `responsibility`: one-sentence description of what this module does
41
+ - `dependencies`: array of other module names this module depends on
42
+ - `lines`: approximate line count
43
+
44
+ 2. **Patterns** — design patterns evidenced in the code. For each:
45
+ - `name`: pattern name (e.g., "registry", "factory", "middleware")
46
+ - `description`: how this pattern is applied in this codebase
47
+ - `used_in`: array of module names that use this pattern
48
+
49
+ 3. **Boundaries** — architectural seams where modules interact through defined interfaces (e.g., "block-api validates all writes before persistence", "dispatch spawns subprocesses through a single entry point")
50
+
51
+ 4. **Overview** — one paragraph summarizing the architecture: what the system does, how it's organized, and what the key design decisions are
52
+
53
+ Read entry points, config files, and module interfaces to confirm the exploration. Do not read every file.
54
+
55
+ ## Required Output Schema
56
+
57
+ You MUST produce JSON conforming exactly to this schema. Every required field must be present.
58
+
59
+ ```json
60
+ {{ output_schema }}
61
+ ```
@@ -0,0 +1,59 @@
1
+ Verify whether the following audit findings have been resolved.
2
+
3
+ ## Audit Findings
4
+
5
+ {% for finding in audit.findings %}
6
+ ### Finding: {{ finding.id }}
7
+
8
+ **Description**: {{ finding.description }}
9
+ **Severity**: {{ finding.severity | default("unspecified") }}
10
+ **Category**: {{ finding.category | default("unspecified") }}
11
+ **Principle**: {{ finding.principle | default("unspecified") }}
12
+
13
+ **Locations**:
14
+ {% for loc in finding.locations %}
15
+ - `{{ loc.file }}` {% if loc.line %}line {{ loc.line }}{% endif %} {% if loc.description %} — {{ loc.description }}{% endif %}
16
+ {% endfor %}
17
+
18
+ {% if finding.fix %}
19
+ **Fix suggestion**: {{ finding.fix.suggestion | default("none") }}
20
+ {% endif %}
21
+
22
+ {% if finding.resolution and finding.resolution.status == 'passed' %}
23
+ *Previously marked as resolved — re-verify.*
24
+ {% endif %}
25
+ ---
26
+ {% endfor %}
27
+
28
+ ## Implementation Results
29
+
30
+ {% if implementation_results is iterable and implementation_results is not string %}
31
+ {% for result in implementation_results %}
32
+ - {{ result.spec_name | default(result.name | default("task")) }}: {{ result.status | default("unknown") }}
33
+ {% endfor %}
34
+ {% else %}
35
+ ```json
36
+ {{ implementation_results | dump(2) }}
37
+ ```
38
+ {% endif %}
39
+
40
+ {% if conformance_reference %}
41
+ ## Conformance Reference
42
+
43
+ ```json
44
+ {{ conformance_reference | dump(2) }}
45
+ ```
46
+ {% endif %}
47
+
48
+ ## Instructions
49
+
50
+ For EACH finding above:
51
+
52
+ 1. Read the code at the referenced location(s)
53
+ 2. Determine if the finding's described issue is addressed
54
+ 3. Record your verdict: `passed`, `failed`, or `needs_inspect`
55
+ 4. Provide specific evidence (code snippet, file:line reference)
56
+
57
+ Do NOT use grep exit codes as evidence. Read the code and assess whether the issue described in the finding is genuinely resolved.
58
+
59
+ Produce JSON output with a `findings` array containing one entry per finding, plus summary statistics.
@@ -0,0 +1,67 @@
1
+ ## Audit Findings to Fix
2
+
3
+ ### Principle: {{ task.principle }}
4
+ ### Category: {{ task.category }}
5
+ ### Severity: {{ task.severity }}
6
+
7
+ ### Findings
8
+
9
+ {% for finding in task.findings %}
10
+ #### {{ finding.id }}: {{ finding.description }}
11
+
12
+ {% for loc in finding.locations %}
13
+ - `{{ loc.file }}` lines {{ loc.lines | join(', ') }}
14
+ {% endfor %}
15
+
16
+ {% if finding.fix %}
17
+ **Fix**: {{ finding.fix.suggestion }}
18
+ {% if finding.fix.verify_method == "grep" %}
19
+ **Verify**: pattern `{{ finding.fix.verify_pattern }}` should NOT match after fix
20
+ {% endif %}
21
+ {% endif %}
22
+
23
+ {% endfor %}
24
+
25
+ ### Files to Modify
26
+
27
+ {% for file in task.files %}
28
+ - `{{ file }}`
29
+ {% endfor %}
30
+
31
+ ### Acceptance Criteria
32
+
33
+ {% for criterion in task.acceptance_criteria %}
34
+ - {{ criterion }}
35
+ {% endfor %}
36
+
37
+ {% if conformance_reference %}
38
+ ### Conformance Reference
39
+
40
+ {% for principle in conformance_reference.principles %}
41
+ {% if principle.id == task.principle.split(':')[0] %}
42
+ #### {{ principle.name }}
43
+
44
+ {{ principle.description }}
45
+
46
+ {% for rule in principle.rules %}
47
+ - **{{ rule.id }}**: {{ rule.rule }}
48
+ {% if rule.examples %}
49
+ - Correct: `{{ rule.examples[0] }}`
50
+ {% endif %}
51
+ {% if rule.anti_patterns %}
52
+ - Wrong: `{{ rule.anti_patterns[0] }}`
53
+ {% endif %}
54
+ {% endfor %}
55
+ {% endif %}
56
+ {% endfor %}
57
+ {% endif %}
58
+
59
+ ## Instructions
60
+
61
+ 1. Read the files listed above to understand the current code
62
+ 2. Fix each finding according to the fix suggestion
63
+ 3. Ensure fixes follow the conformance reference principles
64
+ 4. Run the test suite: `node --experimental-strip-types --test src/*.test.ts`
65
+ 5. Fix any test failures caused by your changes
66
+
67
+ Produce a JSON result conforming to the execution-results schema.
@@ -0,0 +1,37 @@
1
+ Review the audit fix results and produce a routing manifest.
2
+
3
+ ## Implementation Results
4
+
5
+ {% if implementation_results is iterable and implementation_results is not string %}
6
+ {% for result in implementation_results %}
7
+ ### Task: {{ result.spec_name | default(result.name | default("unnamed")) }}
8
+
9
+ - Status: {{ result.status | default("unknown") }}
10
+ {% if result.decisions %}
11
+ - Decisions: {{ result.decisions | length }}
12
+ {% endif %}
13
+ {% if result.issues %}
14
+ - Issues flagged: {{ result.issues | length }}
15
+ {% endif %}
16
+ {% endfor %}
17
+ {% else %}
18
+ ```json
19
+ {{ implementation_results | dump(2) }}
20
+ ```
21
+ {% endif %}
22
+
23
+ ## Verification Results
24
+
25
+ ```json
26
+ {{ verification | dump(2) }}
27
+ ```
28
+
29
+ ## Instructions
30
+
31
+ Produce a routing manifest with:
32
+
33
+ 1. **decisions** — validated decisions from implementation results (with complete id, description, rationale fields)
34
+ 2. **new_issues** — genuine issues that should be tracked (with stable id, description, status: "open", category, priority)
35
+ 3. **summary** — accurate summary of what was completed, what failed, what needs inspection
36
+
37
+ Only include items that are well-formed and represent genuine project artifacts. Do not route items that are missing required fields or describe hypothetical concerns.
@@ -0,0 +1,56 @@
1
+ ## Decomposition Request
2
+
3
+ **Gap:** {{ gap.id }} — {{ gap.description }}
4
+
5
+ ## Investigation Findings
6
+
7
+ **Complexity:** {{ investigation.complexity }}
8
+ **Summary:** {{ investigation.summary }}
9
+
10
+ ### Affected Files
11
+ {% for f in investigation.affected_files %}
12
+ - `{{ f.path }}` — {{ f.role }}: {{ f.current_behavior }}
13
+ {% endfor %}
14
+
15
+ ### Constraints
16
+ {% for c in investigation.constraints %}
17
+ - {{ c }}
18
+ {% endfor %}
19
+
20
+ ### Risks
21
+ {% for r in investigation.risks %}
22
+ - {{ r }}
23
+ {% endfor %}
24
+
25
+ {% if research %}
26
+ ## Research Findings
27
+
28
+ ### Patterns
29
+ {% for p in research.patterns %}
30
+ - **{{ p.name }}**: {{ p.description }} — {{ p.applicability }}
31
+ {% endfor %}
32
+
33
+ ### Recommendations
34
+ {% for r in research.recommendations %}
35
+ - {{ r }}
36
+ {% endfor %}
37
+ {% endif %}
38
+
39
+ ## Instructions
40
+
41
+ Decompose this gap into implementation specs. Each spec is a unit of work for a single implementing agent.
42
+
43
+ 1. Break the work into the smallest meaningful units
44
+ 2. Declare file targets for each spec
45
+ 3. Set `depends_on` for specs that must be sequential (shared files, interface dependencies)
46
+ 4. Mark `parallel_safe` for specs that can run concurrently
47
+ 5. Write acceptance criteria that are verifiable (grep patterns, test commands, not "it works")
48
+ 6. Estimate complexity per spec
49
+
50
+ ## Required Output Schema
51
+
52
+ You MUST produce JSON conforming exactly to this schema. Every required field must be present.
53
+
54
+ ```json
55
+ {{ output_schema }}
56
+ ```
@@ -0,0 +1,3 @@
1
+ You are a code explorer. Given a path, produce a comprehensive structural overview as JSON.
2
+
3
+ Include files with their sizes, exports, imports, and line counts. Identify types, interfaces, and key functions. Map dependencies between files.
@@ -0,0 +1,9 @@
1
+ Explore the code at `{{ path }}`.
2
+
3
+ Produce a JSON object with:
4
+ - `files`: array of { path, type, language, lines, exports, imports }
5
+ - `types`: array of { name, file, line, kind, definition }
6
+ - `dependencies`: array of { from, to, type }
7
+ - `entryPoints`: array of file paths that serve as entry points
8
+
9
+ Write your findings as valid JSON.