@harness-engineering/cli 1.10.0 → 1.12.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/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +4 -0
- package/dist/agents/skills/claude-code/harness-parallel-agents/SKILL.md +105 -20
- package/dist/agents/skills/claude-code/harness-pre-commit-review/SKILL.md +37 -0
- package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +4 -0
- package/dist/agents/skills/gemini-cli/harness-parallel-agents/SKILL.md +105 -20
- package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +37 -0
- package/dist/{agents-md-EMRFLNBC.js → agents-md-KIS2RSMG.js} +1 -1
- package/dist/{architecture-5JNN5L3M.js → architecture-AJAUDRQQ.js} +2 -2
- package/dist/bin/harness-mcp.js +14 -14
- package/dist/bin/harness.js +20 -20
- package/dist/{check-phase-gate-WOKIYGAM.js → check-phase-gate-K7QCSYRJ.js} +4 -4
- package/dist/{chunk-FPIPT36X.js → chunk-2SWJ4VO7.js} +6 -6
- package/dist/{chunk-OPXH4CQN.js → chunk-2YPZKGAG.js} +1 -1
- package/dist/{chunk-B7HFEHWP.js → chunk-3WGJMBKH.js} +10 -0
- package/dist/{chunk-ECUJQS3B.js → chunk-6N4R6FVX.js} +3 -3
- package/dist/{chunk-LXU5M77O.js → chunk-747VBPA4.js} +390 -57
- package/dist/{chunk-NX6DSZSM.js → chunk-AE2OWWDH.js} +4497 -2640
- package/dist/{chunk-PAHHT2IK.js → chunk-B5SBNH4S.js} +2833 -918
- package/dist/{chunk-F4PTVZWA.js → chunk-CTTFXXKJ.js} +7 -7
- package/dist/{chunk-PSXF277V.js → chunk-EAURF4LH.js} +1 -1
- package/dist/chunk-EBJQ6N4M.js +39 -0
- package/dist/{chunk-4PFMY3H7.js → chunk-FLOEMHDF.js} +9 -9
- package/dist/{chunk-46YA6FI3.js → chunk-GNGELAXY.js} +2 -2
- package/dist/{chunk-EOLRW32Q.js → chunk-HD4IBGLA.js} +9 -1
- package/dist/{chunk-CWZ4Y2PO.js → chunk-JLXOEO5C.js} +4 -4
- package/dist/{chunk-F3YDAJFQ.js → chunk-L2KLU56K.js} +2 -2
- package/dist/{chunk-MO4YQOMB.js → chunk-OIGVQF5V.js} +3 -3
- package/dist/{chunk-PMTFPOCT.js → chunk-TJVVU3HB.js} +1 -1
- package/dist/{chunk-MDUK2J2O.js → chunk-VRFZWGMS.js} +2 -1
- package/dist/{chunk-FX7SQHGD.js → chunk-YXOG2277.js} +2 -2
- package/dist/{chunk-7X7ZAYMY.js → chunk-ZU2UBYBY.js} +102 -5
- package/dist/{ci-workflow-ZBBUNTHQ.js → ci-workflow-NBL4OT4A.js} +1 -1
- package/dist/create-skill-WPXHSLX2.js +11 -0
- package/dist/{dist-PBTNVK6K.js → dist-IJ4J4C5G.js} +103 -1
- package/dist/{dist-I7DB5VKB.js → dist-M6BQODWC.js} +1145 -0
- package/dist/{docs-PTJGD6XI.js → docs-CPTMH3VY.js} +2 -2
- package/dist/{engine-SCMZ3G3E.js → engine-BUWPAAGD.js} +1 -1
- package/dist/{entropy-YIUBGKY7.js → entropy-Z4FYVQ7L.js} +2 -2
- package/dist/{feedback-WEVQSLAA.js → feedback-TT6WF5YX.js} +1 -1
- package/dist/{generate-agent-definitions-BU5LOJTI.js → generate-agent-definitions-J5HANRNR.js} +4 -4
- package/dist/{graph-loader-RLO3KRIX.js → graph-loader-KO4GJ5N2.js} +1 -1
- package/dist/index.d.ts +355 -12
- package/dist/index.js +33 -21
- package/dist/{loader-6S6PVGSF.js → loader-PCU5YWRH.js} +1 -1
- package/dist/mcp-YM6QLHLZ.js +34 -0
- package/dist/{performance-5TVW6SA6.js → performance-YJVXOKIB.js} +2 -2
- package/dist/{review-pipeline-4JTQAWKW.js → review-pipeline-KGMIMLIE.js} +1 -1
- package/dist/{runtime-PXIM7UV6.js → runtime-F6R27LD6.js} +1 -1
- package/dist/{security-URYTKLGK.js → security-MX5VVXBC.js} +1 -1
- package/dist/skill-executor-RG45LUO5.js +8 -0
- package/dist/templates/orchestrator/WORKFLOW.md +48 -0
- package/dist/templates/orchestrator/template.json +6 -0
- package/dist/{validate-KSDUUK2M.js → validate-EFNMSFKD.js} +2 -2
- package/dist/{validate-cross-check-WZAX357V.js → validate-cross-check-LJX65SBS.js} +1 -1
- package/package.json +10 -6
- package/dist/chunk-HIOXKZYF.js +0 -15
- package/dist/create-skill-LUWO46WF.js +0 -11
- package/dist/mcp-BNLBTCXZ.js +0 -34
- package/dist/skill-executor-KVS47DAU.js +0 -8
|
@@ -47,6 +47,8 @@ Graph queries show the complete violation scope (not just the first occurrence p
|
|
|
47
47
|
|
|
48
48
|
1. **Run `harness check-deps`** to analyze all import statements against the constraint model. Capture the full JSON output.
|
|
49
49
|
|
|
50
|
+
1b. **Optionally run `harness check-arch`** for comprehensive architecture analysis beyond dependency checking. This covers circular dependencies, complexity, coupling, module size, and dependency depth in addition to layer violations.
|
|
51
|
+
|
|
50
52
|
2. **Parse the results.** Each violation includes:
|
|
51
53
|
- The violating file and line number
|
|
52
54
|
- The forbidden import target
|
|
@@ -162,6 +164,8 @@ Module A re-exports from Module B, and Module B imports from Module A. The circu
|
|
|
162
164
|
- **`harness-design-system`** — Provides the design token source of truth (`tokens.json`) that constraints validate against.
|
|
163
165
|
- **`harness-accessibility`** — Provides WCAG contrast validation used by DESIGN-003 constraints.
|
|
164
166
|
- **Design constraint category** — Controlled by `design.strictness` in `harness.config.json`. Design violations surface alongside architectural violations in the same report.
|
|
167
|
+
- **`harness check-arch`** — Architecture assertion framework. Runs all 7 metric collectors against baseline and thresholds. Use for comprehensive structural health checks beyond layer dependencies. Supports `--update-baseline` to capture current state and `--json` for machine-readable output.
|
|
168
|
+
- **`harness check-arch --module <path>`** — Scoped architecture check for a single module. Use when validating a specific subsystem.
|
|
165
169
|
|
|
166
170
|
## Success Criteria
|
|
167
171
|
|
|
@@ -16,28 +16,78 @@
|
|
|
16
16
|
|
|
17
17
|
## Process
|
|
18
18
|
|
|
19
|
-
### Step 1:
|
|
19
|
+
### Step 1: Verify Task Independence
|
|
20
20
|
|
|
21
|
-
Before dispatching anything in parallel,
|
|
21
|
+
Before dispatching anything in parallel, predict conflicts using `predict_conflicts` (preferred) or `check_task_independence` (fallback):
|
|
22
22
|
|
|
23
|
-
1. **List the candidate tasks.** Pull from the plan, or identify from the current work.
|
|
23
|
+
1. **List the candidate tasks.** Pull from the plan, or identify from the current work. For each task, identify the files it will read and write.
|
|
24
24
|
|
|
25
|
-
2. **
|
|
25
|
+
2. **Call `check_task_independence`.** Pass the tasks with their file lists:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"path": "<project-root>",
|
|
30
|
+
"tasks": [
|
|
31
|
+
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
|
|
32
|
+
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
|
|
33
|
+
],
|
|
34
|
+
"depth": 1
|
|
35
|
+
}
|
|
36
|
+
```
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
The tool checks direct file overlap AND transitive dependency overlap (via the knowledge graph when available). It returns:
|
|
39
|
+
- **`pairs`**: Pairwise independence results with overlap details
|
|
40
|
+
- **`groups`**: Safe parallel dispatch groups (connected components of the conflict graph)
|
|
41
|
+
- **`verdict`**: Human-readable summary (e.g., "3 of 4 tasks can run in parallel in 2 groups")
|
|
42
|
+
- **`analysisLevel`**: `"graph-expanded"` (full analysis) or `"file-only"` (graph unavailable)
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
**Preferred: Use `predict_conflicts`** for severity-aware analysis with automatic regrouping:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"path": "<project-root>",
|
|
49
|
+
"tasks": [
|
|
50
|
+
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
|
|
51
|
+
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
|
|
52
|
+
],
|
|
53
|
+
"depth": 1
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The `predict_conflicts` tool extends independence checking with:
|
|
58
|
+
- **`conflicts`**: Severity-classified conflict details with human-readable reasoning
|
|
59
|
+
- **`groups`**: Revised parallel dispatch groups (high-severity conflicts force serialization)
|
|
60
|
+
- **`summary`**: Conflict counts by severity and whether regrouping occurred
|
|
61
|
+
- **`verdict`**: Human-readable summary including severity breakdown
|
|
62
|
+
|
|
63
|
+
If `predict_conflicts` is unavailable, fall back to `check_task_independence`.
|
|
64
|
+
|
|
65
|
+
3. **Act on the result.** Use the returned `groups` for dispatch. Flag any medium-severity conflicts to the coordinator. If high-severity conflicts forced regrouping (`summary.regrouped === true`), log which tasks were serialized and why. If all tasks are in one group, dispatch them all in parallel. If tasks are split across groups, dispatch each group as a separate parallel wave.
|
|
66
|
+
|
|
67
|
+
4. **When in doubt, run serially.** The cost of a false parallel dispatch (merge conflicts, subtle bugs, wasted work) far exceeds the cost of running serially.
|
|
68
|
+
|
|
69
|
+
#### Manual Fallback (when MCP tool is unavailable)
|
|
70
|
+
|
|
71
|
+
If `check_task_independence` is not available, verify independence manually:
|
|
72
|
+
|
|
73
|
+
1. **Check file overlap.** For each pair of tasks, compare the files they will read and write. Any overlap in WRITE targets means they are NOT independent. Overlap in READ targets is acceptable only if neither task writes to those files.
|
|
74
|
+
|
|
75
|
+
2. **Check state overlap.** Do any tasks share database tables, configuration files, environment variables, or in-memory state? If yes, they are NOT independent.
|
|
76
|
+
|
|
77
|
+
3. **Check import graph overlap.** If Task A modifies module X and Task B imports module X, they are NOT independent — Task B's tests may be affected by Task A's changes.
|
|
78
|
+
|
|
79
|
+
4. **When in doubt, run serially.** Same principle as above.
|
|
32
80
|
|
|
33
81
|
### Graph-Enhanced Context (when available)
|
|
34
82
|
|
|
35
|
-
When a knowledge graph exists at `.harness/graph/`,
|
|
83
|
+
When a knowledge graph exists at `.harness/graph/`, `check_task_independence` automatically uses it for transitive dependency analysis (this is the `"graph-expanded"` analysis level). No manual graph queries are needed for independence checking.
|
|
84
|
+
|
|
85
|
+
For custom queries beyond independence checking, these tools remain available:
|
|
36
86
|
|
|
37
|
-
- `query_graph` — get the dependency subgraph
|
|
38
|
-
- `get_impact` —
|
|
87
|
+
- `query_graph` — get the dependency subgraph for a specific module or file
|
|
88
|
+
- `get_impact` — assess the impact radius of changes to a specific module
|
|
39
89
|
|
|
40
|
-
|
|
90
|
+
When no graph is available, `check_task_independence` falls back to file-only overlap detection and flags `analysisLevel: "file-only"` so you know transitive dependencies were not checked.
|
|
41
91
|
|
|
42
92
|
### Step 2: Create Focused Agent Tasks
|
|
43
93
|
|
|
@@ -101,7 +151,7 @@ For each independent task, write a focused agent brief:
|
|
|
101
151
|
|
|
102
152
|
## Success Criteria
|
|
103
153
|
|
|
104
|
-
- Independence was verified before dispatch (
|
|
154
|
+
- Independence was verified before dispatch via `check_task_independence` (or manual fallback if tool unavailable)
|
|
105
155
|
- Each agent had a focused brief with explicit scope, goal, constraints, and expected output
|
|
106
156
|
- All agents completed successfully (or blockers were reported)
|
|
107
157
|
- Integration produced no merge conflicts (or conflicts were resolved)
|
|
@@ -117,17 +167,52 @@ For each independent task, write a focused agent brief:
|
|
|
117
167
|
|
|
118
168
|
**Step 1: Verify independence**
|
|
119
169
|
|
|
170
|
+
Call `check_task_independence`:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"path": ".",
|
|
175
|
+
"tasks": [
|
|
176
|
+
{
|
|
177
|
+
"id": "task-4-user",
|
|
178
|
+
"files": [
|
|
179
|
+
"src/services/user/service.ts",
|
|
180
|
+
"src/services/user/service.test.ts",
|
|
181
|
+
"src/types/user.ts"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "task-5-product",
|
|
186
|
+
"files": [
|
|
187
|
+
"src/services/product/service.ts",
|
|
188
|
+
"src/services/product/service.test.ts",
|
|
189
|
+
"src/types/product.ts"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "task-6-notification",
|
|
194
|
+
"files": [
|
|
195
|
+
"src/services/notification/service.ts",
|
|
196
|
+
"src/services/notification/service.test.ts",
|
|
197
|
+
"src/types/notification.ts"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
120
202
|
```
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
203
|
+
|
|
204
|
+
Result:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"analysisLevel": "graph-expanded",
|
|
209
|
+
"groups": [["task-4-user", "task-5-product", "task-6-notification"]],
|
|
210
|
+
"verdict": "3 of 3 tasks can run in parallel in 1 group"
|
|
211
|
+
}
|
|
129
212
|
```
|
|
130
213
|
|
|
214
|
+
All tasks are independent — safe to parallelize.
|
|
215
|
+
|
|
131
216
|
**Step 2: Create agent briefs**
|
|
132
217
|
|
|
133
218
|
```
|
|
@@ -81,6 +81,26 @@ If a knowledge graph exists at `.harness/graph/` and code files have changed sin
|
|
|
81
81
|
|
|
82
82
|
If no graph exists, skip this step — the tools fall back to non-graph behavior.
|
|
83
83
|
|
|
84
|
+
### Impact Preview
|
|
85
|
+
|
|
86
|
+
After mechanical checks pass, run `harness impact-preview` to surface the blast radius of staged changes. This is informational only — it never blocks the commit.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
harness impact-preview
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Include the output in the report between the mechanical checks section and the AI review section:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Impact Preview (3 staged files)
|
|
96
|
+
Code: 12 files (routes/login.ts, middleware/verify.ts, +10)
|
|
97
|
+
Tests: 3 tests (auth.test.ts, integration.test.ts, +1)
|
|
98
|
+
Docs: 2 docs (auth-guide.md, api-reference.md)
|
|
99
|
+
Total: 17 affected
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If no graph exists, the command prints a nudge message and returns — no action needed. If no files are staged, it says so. Neither case blocks the workflow.
|
|
103
|
+
|
|
84
104
|
### Phase 2: Classify Changes
|
|
85
105
|
|
|
86
106
|
Determine whether AI review is needed based on what changed.
|
|
@@ -192,6 +212,12 @@ Mechanical Checks:
|
|
|
192
212
|
- Tests: PASS (12/12)
|
|
193
213
|
- Security Scan: PASS (0 errors, 0 warnings)
|
|
194
214
|
|
|
215
|
+
Impact Preview (3 staged files)
|
|
216
|
+
Code: 12 files (routes/login.ts, middleware/verify.ts, +10)
|
|
217
|
+
Tests: 3 tests (auth.test.ts, integration.test.ts, +1)
|
|
218
|
+
Docs: 2 docs (auth-guide.md, api-reference.md)
|
|
219
|
+
Total: 17 affected
|
|
220
|
+
|
|
195
221
|
AI Review: PASS (no issues found)
|
|
196
222
|
```
|
|
197
223
|
|
|
@@ -207,6 +233,11 @@ Mechanical Checks:
|
|
|
207
233
|
- Security Scan: WARN (0 errors, 1 warning)
|
|
208
234
|
- [SEC-NET-001] src/cors.ts:5 — CORS wildcard origin
|
|
209
235
|
|
|
236
|
+
Impact Preview (2 staged files)
|
|
237
|
+
Code: 8 files (cors.ts, server.ts, +6)
|
|
238
|
+
Tests: 2 tests (cors.test.ts, server.test.ts)
|
|
239
|
+
Total: 10 affected
|
|
240
|
+
|
|
210
241
|
AI Review: 2 observations
|
|
211
242
|
1. [file:line] Possible null dereference — `user.email` accessed without null check after `findUser()` which can return null.
|
|
212
243
|
2. [file:line] Debug artifact — `console.log('debug:', payload)` appears to be left from debugging.
|
|
@@ -244,6 +275,7 @@ fi
|
|
|
244
275
|
- Complements harness-code-review (full review) — use pre-commit for quick checks, code-review for thorough analysis
|
|
245
276
|
- **`assess_project`** — Used in Phase 1 for harness-specific health checks (validate + deps) in a single call.
|
|
246
277
|
- **`review_changes`** — Used in Phase 4 with `depth: 'quick'` for fast pre-commit diff analysis.
|
|
278
|
+
- **`harness impact-preview`** — Run after mechanical checks pass to show blast radius of staged changes. Informational only — never blocks.
|
|
247
279
|
|
|
248
280
|
## Success Criteria
|
|
249
281
|
|
|
@@ -264,6 +296,11 @@ Mechanical Checks:
|
|
|
264
296
|
- Types: PASS
|
|
265
297
|
- Tests: PASS (12/12)
|
|
266
298
|
|
|
299
|
+
Impact Preview (2 staged files)
|
|
300
|
+
Code: 5 files (auth.ts, login.ts, +3)
|
|
301
|
+
Tests: 2 tests (auth.test.ts, login.test.ts)
|
|
302
|
+
Total: 7 affected
|
|
303
|
+
|
|
267
304
|
AI Review: PASS (no issues found)
|
|
268
305
|
```
|
|
269
306
|
|
|
@@ -47,6 +47,8 @@ Graph queries show the complete violation scope (not just the first occurrence p
|
|
|
47
47
|
|
|
48
48
|
1. **Run `harness check-deps`** to analyze all import statements against the constraint model. Capture the full JSON output.
|
|
49
49
|
|
|
50
|
+
1b. **Optionally run `harness check-arch`** for comprehensive architecture analysis beyond dependency checking. This covers circular dependencies, complexity, coupling, module size, and dependency depth in addition to layer violations.
|
|
51
|
+
|
|
50
52
|
2. **Parse the results.** Each violation includes:
|
|
51
53
|
- The violating file and line number
|
|
52
54
|
- The forbidden import target
|
|
@@ -162,6 +164,8 @@ Module A re-exports from Module B, and Module B imports from Module A. The circu
|
|
|
162
164
|
- **`harness-design-system`** — Provides the design token source of truth (`tokens.json`) that constraints validate against.
|
|
163
165
|
- **`harness-accessibility`** — Provides WCAG contrast validation used by DESIGN-003 constraints.
|
|
164
166
|
- **Design constraint category** — Controlled by `design.strictness` in `harness.config.json`. Design violations surface alongside architectural violations in the same report.
|
|
167
|
+
- **`harness check-arch`** — Architecture assertion framework. Runs all 7 metric collectors against baseline and thresholds. Use for comprehensive structural health checks beyond layer dependencies. Supports `--update-baseline` to capture current state and `--json` for machine-readable output.
|
|
168
|
+
- **`harness check-arch --module <path>`** — Scoped architecture check for a single module. Use when validating a specific subsystem.
|
|
165
169
|
|
|
166
170
|
## Success Criteria
|
|
167
171
|
|
|
@@ -16,28 +16,78 @@
|
|
|
16
16
|
|
|
17
17
|
## Process
|
|
18
18
|
|
|
19
|
-
### Step 1:
|
|
19
|
+
### Step 1: Verify Task Independence
|
|
20
20
|
|
|
21
|
-
Before dispatching anything in parallel,
|
|
21
|
+
Before dispatching anything in parallel, predict conflicts using `predict_conflicts` (preferred) or `check_task_independence` (fallback):
|
|
22
22
|
|
|
23
|
-
1. **List the candidate tasks.** Pull from the plan, or identify from the current work.
|
|
23
|
+
1. **List the candidate tasks.** Pull from the plan, or identify from the current work. For each task, identify the files it will read and write.
|
|
24
24
|
|
|
25
|
-
2. **
|
|
25
|
+
2. **Call `check_task_independence`.** Pass the tasks with their file lists:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"path": "<project-root>",
|
|
30
|
+
"tasks": [
|
|
31
|
+
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
|
|
32
|
+
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
|
|
33
|
+
],
|
|
34
|
+
"depth": 1
|
|
35
|
+
}
|
|
36
|
+
```
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
The tool checks direct file overlap AND transitive dependency overlap (via the knowledge graph when available). It returns:
|
|
39
|
+
- **`pairs`**: Pairwise independence results with overlap details
|
|
40
|
+
- **`groups`**: Safe parallel dispatch groups (connected components of the conflict graph)
|
|
41
|
+
- **`verdict`**: Human-readable summary (e.g., "3 of 4 tasks can run in parallel in 2 groups")
|
|
42
|
+
- **`analysisLevel`**: `"graph-expanded"` (full analysis) or `"file-only"` (graph unavailable)
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
**Preferred: Use `predict_conflicts`** for severity-aware analysis with automatic regrouping:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"path": "<project-root>",
|
|
49
|
+
"tasks": [
|
|
50
|
+
{ "id": "task-a", "files": ["src/module-a/index.ts", "src/module-a/index.test.ts"] },
|
|
51
|
+
{ "id": "task-b", "files": ["src/module-b/index.ts", "src/module-b/index.test.ts"] }
|
|
52
|
+
],
|
|
53
|
+
"depth": 1
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The `predict_conflicts` tool extends independence checking with:
|
|
58
|
+
- **`conflicts`**: Severity-classified conflict details with human-readable reasoning
|
|
59
|
+
- **`groups`**: Revised parallel dispatch groups (high-severity conflicts force serialization)
|
|
60
|
+
- **`summary`**: Conflict counts by severity and whether regrouping occurred
|
|
61
|
+
- **`verdict`**: Human-readable summary including severity breakdown
|
|
62
|
+
|
|
63
|
+
If `predict_conflicts` is unavailable, fall back to `check_task_independence`.
|
|
64
|
+
|
|
65
|
+
3. **Act on the result.** Use the returned `groups` for dispatch. Flag any medium-severity conflicts to the coordinator. If high-severity conflicts forced regrouping (`summary.regrouped === true`), log which tasks were serialized and why. If all tasks are in one group, dispatch them all in parallel. If tasks are split across groups, dispatch each group as a separate parallel wave.
|
|
66
|
+
|
|
67
|
+
4. **When in doubt, run serially.** The cost of a false parallel dispatch (merge conflicts, subtle bugs, wasted work) far exceeds the cost of running serially.
|
|
68
|
+
|
|
69
|
+
#### Manual Fallback (when MCP tool is unavailable)
|
|
70
|
+
|
|
71
|
+
If `check_task_independence` is not available, verify independence manually:
|
|
72
|
+
|
|
73
|
+
1. **Check file overlap.** For each pair of tasks, compare the files they will read and write. Any overlap in WRITE targets means they are NOT independent. Overlap in READ targets is acceptable only if neither task writes to those files.
|
|
74
|
+
|
|
75
|
+
2. **Check state overlap.** Do any tasks share database tables, configuration files, environment variables, or in-memory state? If yes, they are NOT independent.
|
|
76
|
+
|
|
77
|
+
3. **Check import graph overlap.** If Task A modifies module X and Task B imports module X, they are NOT independent — Task B's tests may be affected by Task A's changes.
|
|
78
|
+
|
|
79
|
+
4. **When in doubt, run serially.** Same principle as above.
|
|
32
80
|
|
|
33
81
|
### Graph-Enhanced Context (when available)
|
|
34
82
|
|
|
35
|
-
When a knowledge graph exists at `.harness/graph/`,
|
|
83
|
+
When a knowledge graph exists at `.harness/graph/`, `check_task_independence` automatically uses it for transitive dependency analysis (this is the `"graph-expanded"` analysis level). No manual graph queries are needed for independence checking.
|
|
84
|
+
|
|
85
|
+
For custom queries beyond independence checking, these tools remain available:
|
|
36
86
|
|
|
37
|
-
- `query_graph` — get the dependency subgraph
|
|
38
|
-
- `get_impact` —
|
|
87
|
+
- `query_graph` — get the dependency subgraph for a specific module or file
|
|
88
|
+
- `get_impact` — assess the impact radius of changes to a specific module
|
|
39
89
|
|
|
40
|
-
|
|
90
|
+
When no graph is available, `check_task_independence` falls back to file-only overlap detection and flags `analysisLevel: "file-only"` so you know transitive dependencies were not checked.
|
|
41
91
|
|
|
42
92
|
### Step 2: Create Focused Agent Tasks
|
|
43
93
|
|
|
@@ -101,7 +151,7 @@ For each independent task, write a focused agent brief:
|
|
|
101
151
|
|
|
102
152
|
## Success Criteria
|
|
103
153
|
|
|
104
|
-
- Independence was verified before dispatch (
|
|
154
|
+
- Independence was verified before dispatch via `check_task_independence` (or manual fallback if tool unavailable)
|
|
105
155
|
- Each agent had a focused brief with explicit scope, goal, constraints, and expected output
|
|
106
156
|
- All agents completed successfully (or blockers were reported)
|
|
107
157
|
- Integration produced no merge conflicts (or conflicts were resolved)
|
|
@@ -117,17 +167,52 @@ For each independent task, write a focused agent brief:
|
|
|
117
167
|
|
|
118
168
|
**Step 1: Verify independence**
|
|
119
169
|
|
|
170
|
+
Call `check_task_independence`:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"path": ".",
|
|
175
|
+
"tasks": [
|
|
176
|
+
{
|
|
177
|
+
"id": "task-4-user",
|
|
178
|
+
"files": [
|
|
179
|
+
"src/services/user/service.ts",
|
|
180
|
+
"src/services/user/service.test.ts",
|
|
181
|
+
"src/types/user.ts"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "task-5-product",
|
|
186
|
+
"files": [
|
|
187
|
+
"src/services/product/service.ts",
|
|
188
|
+
"src/services/product/service.test.ts",
|
|
189
|
+
"src/types/product.ts"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "task-6-notification",
|
|
194
|
+
"files": [
|
|
195
|
+
"src/services/notification/service.ts",
|
|
196
|
+
"src/services/notification/service.test.ts",
|
|
197
|
+
"src/types/notification.ts"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
120
202
|
```
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
203
|
+
|
|
204
|
+
Result:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"analysisLevel": "graph-expanded",
|
|
209
|
+
"groups": [["task-4-user", "task-5-product", "task-6-notification"]],
|
|
210
|
+
"verdict": "3 of 3 tasks can run in parallel in 1 group"
|
|
211
|
+
}
|
|
129
212
|
```
|
|
130
213
|
|
|
214
|
+
All tasks are independent — safe to parallelize.
|
|
215
|
+
|
|
131
216
|
**Step 2: Create agent briefs**
|
|
132
217
|
|
|
133
218
|
```
|
|
@@ -81,6 +81,26 @@ If a knowledge graph exists at `.harness/graph/` and code files have changed sin
|
|
|
81
81
|
|
|
82
82
|
If no graph exists, skip this step — the tools fall back to non-graph behavior.
|
|
83
83
|
|
|
84
|
+
### Impact Preview
|
|
85
|
+
|
|
86
|
+
After mechanical checks pass, run `harness impact-preview` to surface the blast radius of staged changes. This is informational only — it never blocks the commit.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
harness impact-preview
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Include the output in the report between the mechanical checks section and the AI review section:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Impact Preview (3 staged files)
|
|
96
|
+
Code: 12 files (routes/login.ts, middleware/verify.ts, +10)
|
|
97
|
+
Tests: 3 tests (auth.test.ts, integration.test.ts, +1)
|
|
98
|
+
Docs: 2 docs (auth-guide.md, api-reference.md)
|
|
99
|
+
Total: 17 affected
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If no graph exists, the command prints a nudge message and returns — no action needed. If no files are staged, it says so. Neither case blocks the workflow.
|
|
103
|
+
|
|
84
104
|
### Phase 2: Classify Changes
|
|
85
105
|
|
|
86
106
|
Determine whether AI review is needed based on what changed.
|
|
@@ -192,6 +212,12 @@ Mechanical Checks:
|
|
|
192
212
|
- Tests: PASS (12/12)
|
|
193
213
|
- Security Scan: PASS (0 errors, 0 warnings)
|
|
194
214
|
|
|
215
|
+
Impact Preview (3 staged files)
|
|
216
|
+
Code: 12 files (routes/login.ts, middleware/verify.ts, +10)
|
|
217
|
+
Tests: 3 tests (auth.test.ts, integration.test.ts, +1)
|
|
218
|
+
Docs: 2 docs (auth-guide.md, api-reference.md)
|
|
219
|
+
Total: 17 affected
|
|
220
|
+
|
|
195
221
|
AI Review: PASS (no issues found)
|
|
196
222
|
```
|
|
197
223
|
|
|
@@ -207,6 +233,11 @@ Mechanical Checks:
|
|
|
207
233
|
- Security Scan: WARN (0 errors, 1 warning)
|
|
208
234
|
- [SEC-NET-001] src/cors.ts:5 — CORS wildcard origin
|
|
209
235
|
|
|
236
|
+
Impact Preview (2 staged files)
|
|
237
|
+
Code: 8 files (cors.ts, server.ts, +6)
|
|
238
|
+
Tests: 2 tests (cors.test.ts, server.test.ts)
|
|
239
|
+
Total: 10 affected
|
|
240
|
+
|
|
210
241
|
AI Review: 2 observations
|
|
211
242
|
1. [file:line] Possible null dereference — `user.email` accessed without null check after `findUser()` which can return null.
|
|
212
243
|
2. [file:line] Debug artifact — `console.log('debug:', payload)` appears to be left from debugging.
|
|
@@ -244,6 +275,7 @@ fi
|
|
|
244
275
|
- Complements harness-code-review (full review) — use pre-commit for quick checks, code-review for thorough analysis
|
|
245
276
|
- **`assess_project`** — Used in Phase 1 for harness-specific health checks (validate + deps) in a single call.
|
|
246
277
|
- **`review_changes`** — Used in Phase 4 with `depth: 'quick'` for fast pre-commit diff analysis.
|
|
278
|
+
- **`harness impact-preview`** — Run after mechanical checks pass to show blast radius of staged changes. Informational only — never blocks.
|
|
247
279
|
|
|
248
280
|
## Success Criteria
|
|
249
281
|
|
|
@@ -264,6 +296,11 @@ Mechanical Checks:
|
|
|
264
296
|
- Types: PASS
|
|
265
297
|
- Tests: PASS (12/12)
|
|
266
298
|
|
|
299
|
+
Impact Preview (2 staged files)
|
|
300
|
+
Code: 5 files (auth.ts, login.ts, +3)
|
|
301
|
+
Tests: 2 tests (auth.test.ts, login.test.ts)
|
|
302
|
+
Total: 7 affected
|
|
303
|
+
|
|
267
304
|
AI Review: PASS (no issues found)
|
|
268
305
|
```
|
|
269
306
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkDependenciesDefinition,
|
|
3
3
|
handleCheckDependencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OIGVQF5V.js";
|
|
5
5
|
import "./chunk-K6XAPGML.js";
|
|
6
6
|
import "./chunk-IDZNPTYD.js";
|
|
7
7
|
import "./chunk-W6Y7ZW3Y.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-AE2OWWDH.js";
|
|
9
9
|
import "./chunk-MHBMTPW7.js";
|
|
10
10
|
export {
|
|
11
11
|
checkDependenciesDefinition,
|
package/dist/bin/harness-mcp.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
startServer
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-747VBPA4.js";
|
|
5
|
+
import "../chunk-JLXOEO5C.js";
|
|
6
|
+
import "../chunk-2SWJ4VO7.js";
|
|
7
|
+
import "../chunk-FLOEMHDF.js";
|
|
8
|
+
import "../chunk-EAURF4LH.js";
|
|
9
|
+
import "../chunk-TJVVU3HB.js";
|
|
10
10
|
import "../chunk-ZOAWBDWU.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-YXOG2277.js";
|
|
12
|
+
import "../chunk-2YPZKGAG.js";
|
|
13
|
+
import "../chunk-OIGVQF5V.js";
|
|
14
14
|
import "../chunk-K6XAPGML.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-CTTFXXKJ.js";
|
|
16
16
|
import "../chunk-IDZNPTYD.js";
|
|
17
17
|
import "../chunk-W6Y7ZW3Y.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-HD4IBGLA.js";
|
|
19
|
+
import "../chunk-3WGJMBKH.js";
|
|
20
|
+
import "../chunk-VRFZWGMS.js";
|
|
21
|
+
import "../chunk-AE2OWWDH.js";
|
|
22
22
|
import "../chunk-MHBMTPW7.js";
|
|
23
23
|
|
|
24
24
|
// src/bin/harness-mcp.ts
|
package/dist/bin/harness.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createProgram
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-B5SBNH4S.js";
|
|
5
5
|
import "../chunk-VUCPTQ6G.js";
|
|
6
6
|
import {
|
|
7
7
|
findConfigFile,
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZU2UBYBY.js";
|
|
10
|
+
import "../chunk-GNGELAXY.js";
|
|
11
11
|
import "../chunk-Q6AB7W5Z.js";
|
|
12
12
|
import "../chunk-TRAPF4IX.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-L2KLU56K.js";
|
|
14
14
|
import "../chunk-TEFCFC4H.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-6N4R6FVX.js";
|
|
16
|
+
import "../chunk-EBJQ6N4M.js";
|
|
17
17
|
import "../chunk-QPEH2QPG.js";
|
|
18
18
|
import "../chunk-JSTQ3AWB.js";
|
|
19
19
|
import "../chunk-KET4QQZB.js";
|
|
20
20
|
import "../chunk-NKDM3FMH.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-747VBPA4.js";
|
|
22
|
+
import "../chunk-JLXOEO5C.js";
|
|
23
|
+
import "../chunk-2SWJ4VO7.js";
|
|
24
|
+
import "../chunk-FLOEMHDF.js";
|
|
25
|
+
import "../chunk-EAURF4LH.js";
|
|
26
|
+
import "../chunk-TJVVU3HB.js";
|
|
27
27
|
import "../chunk-ZOAWBDWU.js";
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-YXOG2277.js";
|
|
29
|
+
import "../chunk-2YPZKGAG.js";
|
|
30
|
+
import "../chunk-OIGVQF5V.js";
|
|
31
31
|
import "../chunk-K6XAPGML.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-CTTFXXKJ.js";
|
|
33
33
|
import "../chunk-IDZNPTYD.js";
|
|
34
34
|
import "../chunk-W6Y7ZW3Y.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-HD4IBGLA.js";
|
|
36
36
|
import {
|
|
37
37
|
handleError
|
|
38
|
-
} from "../chunk-
|
|
39
|
-
import "../chunk-
|
|
38
|
+
} from "../chunk-3WGJMBKH.js";
|
|
39
|
+
import "../chunk-VRFZWGMS.js";
|
|
40
40
|
import {
|
|
41
41
|
CLI_VERSION
|
|
42
42
|
} from "../chunk-BM3PWGXQ.js";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
readCheckState,
|
|
49
49
|
shouldRunCheck,
|
|
50
50
|
spawnBackgroundCheck
|
|
51
|
-
} from "../chunk-
|
|
51
|
+
} from "../chunk-AE2OWWDH.js";
|
|
52
52
|
import "../chunk-MHBMTPW7.js";
|
|
53
53
|
|
|
54
54
|
// src/bin/update-check-hooks.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCheckPhaseGateCommand,
|
|
3
3
|
runCheckPhaseGate
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZU2UBYBY.js";
|
|
5
|
+
import "./chunk-EBJQ6N4M.js";
|
|
6
|
+
import "./chunk-3WGJMBKH.js";
|
|
7
|
+
import "./chunk-AE2OWWDH.js";
|
|
8
8
|
import "./chunk-MHBMTPW7.js";
|
|
9
9
|
export {
|
|
10
10
|
createCheckPhaseGateCommand,
|