@kodevibe/harness 0.11.2 β 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +4 -2
- package/README.md +4 -2
- package/harness/agents/lead.md +13 -4
- package/harness/agents/pm.md +25 -19
- package/harness/agents/reviewer.md +36 -38
- package/harness/project-state.md +11 -0
- package/harness/skills/breakdown.md +2 -1
- package/harness/skills/pr-review.md +16 -0
- package/harness/skills/setup.md +3 -4
- package/harness/skills/state-check.md +72 -1
- package/harness/skills/wrap-up.md +59 -27
- package/package.json +1 -1
- package/src/guard.js +496 -0
|
@@ -20,22 +20,21 @@ This is kode:harness's memory mechanism β without it, the same mistakes repeat
|
|
|
20
20
|
- After a review revealed a repeated mistake
|
|
21
21
|
- When the user explicitly asks to record a lesson
|
|
22
22
|
|
|
23
|
-
> **Timing**: Invoke
|
|
23
|
+
> **Timing**: Invoke once at session end; aggregate the whole session into state files.
|
|
24
24
|
|
|
25
25
|
## Procedure
|
|
26
26
|
|
|
27
27
|
### Step 1: Review Session Activity
|
|
28
28
|
|
|
29
29
|
1. Scan recent git changes: `git log --oneline -10` and `git diff --stat HEAD~3`
|
|
30
|
-
2. Identify
|
|
31
|
-
3. Identify any errors, failures, or unexpected issues that occurred
|
|
30
|
+
2. Identify accomplishments and unexpected issues
|
|
32
31
|
|
|
33
32
|
**Edge Case: Zero-Change Session**
|
|
34
33
|
If `git diff --stat` shows no changes and `git log` shows no new commits this session:
|
|
35
34
|
- Report: "π Quiet session β status checks only, no code changes."
|
|
36
35
|
- Skip Step 3 (Failure Pattern Detection) β no code changes means no new failure patterns
|
|
37
36
|
- Skip Step 5 (features.md update) and Step 5.5 (dependency-map.md verify) β nothing changed
|
|
38
|
-
- Still execute Step 4
|
|
37
|
+
- Still execute Step 4 and Step 6 if an agent was used
|
|
39
38
|
- Still execute Step 2 (Direction Drift Check) β discussion-only drift is possible
|
|
40
39
|
|
|
41
40
|
### Step 2: Direction Drift Check
|
|
@@ -49,14 +48,14 @@ Before recording failures, verify that the session's work stayed aligned with pr
|
|
|
49
48
|
- Did the user explicitly change direction during this session? β Note for pivot recommendation
|
|
50
49
|
3. **If drift detected**:
|
|
51
50
|
- Add a warning to the Step 7 Report: `β οΈ Direction drift: [description of misalignment]`
|
|
52
|
-
- Recommend
|
|
51
|
+
- Recommend `pivot` after wrap-up
|
|
53
52
|
- Do NOT block β the wrap-up skill always completes
|
|
54
53
|
4. **If no drift**: Proceed silently (no output for this step)
|
|
55
54
|
|
|
56
55
|
<!-- CREW_MODE_START -->
|
|
57
56
|
#### Step 2.5: Validation Tracker Update (π£ Pipeline only) β οΈ MANDATORY
|
|
58
57
|
|
|
59
|
-
> **β Completion Gate**:
|
|
58
|
+
> **β Completion Gate**: Validation Trackerκ° μμΌλ©΄ κ°±μ ν Step 3μΌλ‘ μ§ννμΈμ.
|
|
60
59
|
|
|
61
60
|
If `docs/project-brief.md` contains a `## Validation Tracker` section with data:
|
|
62
61
|
|
|
@@ -70,9 +69,9 @@ If `docs/project-brief.md` contains a `## Validation Tracker` section with data:
|
|
|
70
69
|
- Did this session produce Stories/code that don't map to any FR or KPI? β warn
|
|
71
70
|
- Are there KPIs/FRs with no Stories after 2+ sprints? β warn as "β οΈ Unplanned KPI/FR risk"
|
|
72
71
|
- Include warnings in Step 7 Report
|
|
73
|
-
5. **Self-check**:
|
|
72
|
+
5. **Self-check**: KPI/FR/ARB μνκ° μλ£ Storyμ μΌμΉν΄μΌ ν©λλ€. λλ½ μ μ¦μ κ°±μ .
|
|
74
73
|
|
|
75
|
-
> β
|
|
74
|
+
> β Tracker κ°±μ μμ΄ Step 3μΌλ‘ μ§ννμ§ λ§μΈμ.
|
|
76
75
|
|
|
77
76
|
If no Validation Tracker β skip this step entirely.
|
|
78
77
|
<!-- CREW_MODE_END -->
|
|
@@ -83,7 +82,7 @@ For each issue/error that occurred in this session:
|
|
|
83
82
|
|
|
84
83
|
1. Read `docs/failure-patterns.md`
|
|
85
84
|
2. Check if this matches an existing pattern (FP-NNN):
|
|
86
|
-
- **If match found AND already incremented by `debug` in this session**: Skip
|
|
85
|
+
- **If match found AND already incremented by `debug` in this session**: Skip. Check Recent Changes to avoid double-count.
|
|
87
86
|
- **If match found AND NOT already incremented this session**: Increment the Frequency counter, add the Sprint/Story to "Occurred"
|
|
88
87
|
- **If new pattern**: Assign next FP-NNN number, create a new entry using this format:
|
|
89
88
|
|
|
@@ -100,7 +99,7 @@ For each issue/error that occurred in this session:
|
|
|
100
99
|
|
|
101
100
|
3. If the failure relates to a specific skill or agent, note it for that skill's checklist
|
|
102
101
|
|
|
103
|
-
> **Self-check**:
|
|
102
|
+
> **Self-check**: `docs/failure-patterns.md` has at least one FP entry; if no new failure, existing entries are enough.
|
|
104
103
|
|
|
105
104
|
### Step 4: Update docs/project-state.md β οΈ MANDATORY
|
|
106
105
|
|
|
@@ -116,6 +115,9 @@ For each issue/error that occurred in this session:
|
|
|
116
115
|
```
|
|
117
116
|
- [YYYY-MM-DD] S{N}-{M}: {what was done} (STATUS: DONE)
|
|
118
117
|
```
|
|
118
|
+
- Append compact changelog rows only. If creating the section, place it before `## Session Handoff Protocol` or EOF.
|
|
119
|
+
- Never insert it inside proof/evidence sections (`Proof Ledger`, durable UI evidence, smoke/manual proof).
|
|
120
|
+
- Self-check: no nested headings or UI/proof checklist bullets under `## Recent Changes`.
|
|
119
121
|
|
|
120
122
|
### Step 5: Update docs/features.md (if applicable)
|
|
121
123
|
|
|
@@ -136,7 +138,23 @@ For each issue/error that occurred in this session:
|
|
|
136
138
|
- WARN β include warnings in the final wrap-up report, then proceed
|
|
137
139
|
- FAIL β fix the listed drift (update affected state files), then re-run state-check until PASS or WARN
|
|
138
140
|
|
|
139
|
-
> **Self-check**: `docs/dependency-map.md
|
|
141
|
+
> **Self-check**: New modules are registered in `docs/dependency-map.md`; state-check is PASS/WARN.
|
|
142
|
+
|
|
143
|
+
#### Step 5.5b: Guard Evidence (R16) β οΈ MANDATORY
|
|
144
|
+
|
|
145
|
+
Before saying `state-check PASS`, `0 FAIL`, `0 WARN`, `STATUS: DONE`, or `Session Learn Complete`, run and quote one guard summary:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
HARNESS_GUARD_ROOT="$PWD" node /path/to/k-harness/scripts/harness-guard.js docs/project-state.md
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
or installed script:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm run harness:guard:wrap-up
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Rules: paste the exact guard summary. Errors block `STATUS: DONE`; warnings must be listed. Never write `0 FAIL, 0 WARN` unless guard says no issues.
|
|
140
158
|
|
|
141
159
|
### Step 5.55: Refresh Project Docs Hub Index (if applicable)
|
|
142
160
|
|
|
@@ -145,7 +163,7 @@ Run only if user used/requested `docs-bridge`, or Project Docs Hub Index has rea
|
|
|
145
163
|
1. For changed docs (`README*`, `docs/`, ADR/design/runbook/API specs), refresh indexed review/status.
|
|
146
164
|
2. For new docs, add `proposed` rows or recommend `docs-bridge`.
|
|
147
165
|
3. Never write external hubs, invent targets, change visibility, or convert `local-only` / `pending` without explicit request.
|
|
148
|
-
4. Keep
|
|
166
|
+
4. Keep private paths/IDs/resolvers out of tracked state; use `.harness/docs-bridge.local.*`.
|
|
149
167
|
|
|
150
168
|
### Step 5.6: Resolve STATE-AUDIT Flags (if applicable)
|
|
151
169
|
|
|
@@ -160,8 +178,12 @@ Before session end, record the working proof that justified completion:
|
|
|
160
178
|
1. Read reviewer output or recent terminal evidence for passing tests/smoke proof.
|
|
161
179
|
2. Add one compact row to `docs/project-state.md` β `## Proof Ledger` for each completed Story.
|
|
162
180
|
3. Cross-check completed Stories against `## Evidence Summary` / `## Proof Ledger`.
|
|
163
|
-
4.
|
|
164
|
-
5.
|
|
181
|
+
4. Check `## Story Contracts`: completed Story rows must be `β
pass`/`proven`; otherwise `[CONTRACT-GAP]`.
|
|
182
|
+
5. UI/manual/smoke proof needs artifact/checklist or URL + exact counts/elements.
|
|
183
|
+
6. Keep durable UI evidence in its own section, never under `## Recent Changes`.
|
|
184
|
+
7. Split FR/KPI/ARB mappings need `Scope split approved: <reason>`.
|
|
185
|
+
8. If proof is missing, write `[PROOF-GAP]` and return to `reviewer`.
|
|
186
|
+
9. If `[PROOF-GAP]` or `[CONTRACT-GAP]` exists, STOP before Step 5.65.
|
|
165
187
|
|
|
166
188
|
Proof rows must stay short: Date, Story, Evidence, Result, Command / Observation. Do not paste long logs.
|
|
167
189
|
|
|
@@ -171,24 +193,34 @@ State file λ³κ²½μ¬νμ 컀λ°ν©λλ€. Learn μ€ν κ²°κ³Όκ° μ»€λ°λμ§
|
|
|
171
193
|
|
|
172
194
|
1. Stage state files: `git add docs/project-state.md docs/failure-patterns.md docs/features.md docs/dependency-map.md docs/agent-memory/`
|
|
173
195
|
2. Commit: `git commit -m "wrap-up: session lessons captured"`
|
|
174
|
-
3. If
|
|
196
|
+
3. If nothing to commit, skip.
|
|
175
197
|
|
|
176
198
|
> **Self-check**: `git status`μ docs/ μλ unstaged νμΌμ΄ μμ΄μΌ ν©λλ€.
|
|
177
199
|
|
|
200
|
+
#### Step 5.65b: Dirty Worktree Truth (R16) β οΈ MANDATORY
|
|
201
|
+
|
|
202
|
+
Run:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
git status --short
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Rules: paste exact `git status --short` or `clean`. Dirty `src/`, `test/`, `public/`, or app files mean work is not fully committed. If they remain by policy, report `Session End: DIRTY WORKTREE`.
|
|
209
|
+
|
|
178
210
|
### Step 5.7: Git Push Check (session end)
|
|
179
211
|
|
|
180
212
|
Before ending the session, check for unpushed commits:
|
|
181
213
|
|
|
182
|
-
1. Run `git log --oneline @{u}..HEAD 2>/dev/null || echo "no upstream"`
|
|
214
|
+
1. Run `git log --oneline @{u}..HEAD 2>/dev/null || echo "no upstream"`
|
|
183
215
|
2. **If unpushed commits exist**:
|
|
184
216
|
- List the commits: `git log --oneline @{u}..HEAD`
|
|
185
217
|
- Solo mode: Recommend push β `git push origin {branch}`
|
|
186
|
-
- Team mode: **Strongly recommend** push
|
|
218
|
+
- Team mode: **Strongly recommend** push
|
|
187
219
|
- Warn: "β οΈ {N}κ°μ 컀λ°μ΄ pushλμ§ μμμ΅λλ€. μμ
λ¬Όμ μ격μ λ°±μ
νμΈμ."
|
|
188
220
|
3. **If no upstream configured** (`no upstream`):
|
|
189
221
|
- Check if remote exists: `git remote -v`
|
|
190
222
|
- If remote exists: Suggest `git push -u origin {branch}` (first push)
|
|
191
|
-
- If no remote: Note "μ격 μ μ₯μκ° μ€μ λμ§ μμμ΅λλ€.
|
|
223
|
+
- If no remote: Note "μ격 μ μ₯μκ° μ€μ λμ§ μμμ΅λλ€."
|
|
192
224
|
4. **If all commits are pushed**: Skip (no output)
|
|
193
225
|
|
|
194
226
|
### Step 6: Update Agent Memory (if applicable)
|
|
@@ -199,15 +231,15 @@ If an agent (reviewer, pm, lead, architect) was used in this session, update its
|
|
|
199
231
|
2. **Auto-initialize if needed**: If the file only contains `<!-- Example entries` placeholder comments and no real data:
|
|
200
232
|
- Replace the placeholder block with actual entries from this session
|
|
201
233
|
- Initialize statistics counters with real values
|
|
202
|
-
- If real entries
|
|
203
|
-
-
|
|
234
|
+
- If real entries exist, APPEND and remove only placeholder comments.
|
|
235
|
+
- Initialize on the first wrap-up session where the agent was used.
|
|
204
236
|
- Example transformation:
|
|
205
237
|
```
|
|
206
238
|
Before: <!-- Example entries (replace with real findings after first review):
|
|
207
239
|
After: - [S1-1] Mock sync missed for UserService interface change
|
|
208
240
|
```
|
|
209
241
|
3. **Append session learnings** to the appropriate section:
|
|
210
|
-
- **reviewer.md**: Add review patterns
|
|
242
|
+
- **reviewer.md**: Add review patterns and update statistics
|
|
211
243
|
- **pm.md**: Record estimation accuracy (planned vs actual), note architecture discoveries
|
|
212
244
|
- **lead.md**: Update velocity (stories done/planned), record any scope drift incidents
|
|
213
245
|
- **architect.md**: Record design decisions made, module boundary insights, anti-patterns observed
|
|
@@ -275,11 +307,11 @@ If crew artifacts were used this session (π£ pipeline), also append:
|
|
|
275
307
|
- Keep failure pattern descriptions concise (1-2 sentences for Cause and Prevention)
|
|
276
308
|
- If no failures occurred, skip Step 2 and just update state files
|
|
277
309
|
- Do not modify source code β this skill only updates state files
|
|
278
|
-
- Quick Summary must be exactly 3 lines
|
|
310
|
+
- Quick Summary must be exactly 3 lines
|
|
279
311
|
|
|
280
312
|
## Enforced Rules
|
|
281
313
|
|
|
282
|
-
- **Session Handoff**: Before ending
|
|
314
|
+
- **Session Handoff**: Before ending, update docs/project-state.md Quick Summary.
|
|
283
315
|
- **State File Size Limits**: Keep state files compact for LLM context windows:
|
|
284
316
|
- docs/project-brief.md: Max 200 lines
|
|
285
317
|
- docs/project-state.md: Max 300 lines (archive completed sprints)
|
|
@@ -302,7 +334,7 @@ If crew artifacts were used this session (π£ pipeline), also append:
|
|
|
302
334
|
## Team Mode: Session Wrap-up
|
|
303
335
|
|
|
304
336
|
### Pre-Pull (mandatory before any shared file edit)
|
|
305
|
-
1. Run `git pull` on the default branch before updating docs/features.md or docs/dependency-map.md (
|
|
337
|
+
1. Run `git pull` on the default branch before updating docs/features.md or docs/dependency-map.md (default: main)
|
|
306
338
|
2. If merge conflicts occur, follow the **Merge Conflict SOP** below
|
|
307
339
|
|
|
308
340
|
### Merge Conflict SOP
|
|
@@ -319,7 +351,7 @@ When `git pull` causes merge conflicts in shared state files:
|
|
|
319
351
|
| `docs/failure-patterns.md` | Keep BOTH entries, deduplicate by FP-NNN number |
|
|
320
352
|
3. **After resolving**: `git add <resolved-files> && git commit`
|
|
321
353
|
4. **Verify**: Re-read the resolved file and confirm no data was lost
|
|
322
|
-
5. **If unsure**: Do NOT force-resolve. Ask the designated authority
|
|
354
|
+
5. **If unsure**: Do NOT force-resolve. Ask the designated authority or row Owner.
|
|
323
355
|
|
|
324
356
|
### Owner-Scoped Updates
|
|
325
357
|
- **docs/features.md**: only update rows where Owner = you
|
|
@@ -327,7 +359,7 @@ When `git pull` causes merge conflicts in shared state files:
|
|
|
327
359
|
- **Personal files** (.harness/project-state.md, .harness/failure-patterns.md, .harness/agent-memory/): update freely β no coordination needed
|
|
328
360
|
|
|
329
361
|
### Failure Pattern Promotion
|
|
330
|
-
If a personal
|
|
362
|
+
If a personal FP in `.harness/failure-patterns.md` may affect others:
|
|
331
363
|
1. Discuss with the team (Slack, PR comment, etc.)
|
|
332
|
-
2. If agreed, add it to a shared location
|
|
364
|
+
2. If agreed, add it to a shared location so others can copy it.
|
|
333
365
|
<!-- TEAM_MODE_END -->
|