codeharness 0.19.2 → 0.19.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/dist/index.js +4531 -2896
- package/package.json +1 -1
- package/patches/AGENTS.md +42 -0
- package/patches/{dev-enforcement.md → dev/enforcement.md} +9 -0
- package/patches/{retro-enforcement.md → retro/enforcement.md} +9 -0
- package/patches/{review-enforcement.md → review/enforcement.md} +9 -0
- package/patches/{sprint-planning.md → sprint/planning.md} +9 -0
- package/patches/{story-verification.md → verify/story-verification.md} +9 -0
- package/ralph/ralph.sh +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# patches/ — BMAD Workflow Enforcement Patches
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Markdown patch files applied to BMAD workflow targets during `codeharness init`.
|
|
6
|
+
Each patch encodes operational learnings (FR33) as enforcement rules that
|
|
7
|
+
prevent recurrence of observed failures.
|
|
8
|
+
|
|
9
|
+
## Directory Structure (FR35)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
patches/
|
|
13
|
+
dev/enforcement.md — Dev agent guardrails
|
|
14
|
+
review/enforcement.md — Review gates (proof quality, coverage)
|
|
15
|
+
verify/story-verification.md — Black-box proof requirements
|
|
16
|
+
sprint/planning.md — Sprint planning pre-checks
|
|
17
|
+
retro/enforcement.md — Retrospective quality metrics
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Subdirectories map to BMAD workflow roles.
|
|
21
|
+
|
|
22
|
+
## How Patches Work
|
|
23
|
+
|
|
24
|
+
1. `src/templates/bmad-patches.ts` reads files via `readPatchFile(role, name)`
|
|
25
|
+
2. `src/lib/bmad.ts` maps patch names to BMAD workflow target files via `PATCH_TARGETS`
|
|
26
|
+
3. `src/lib/patch-engine.ts` injects patch content between `CODEHARNESS-PATCH-START/END` markers
|
|
27
|
+
4. `src/commands/teardown.ts` removes patches on teardown
|
|
28
|
+
|
|
29
|
+
## Editing Patches
|
|
30
|
+
|
|
31
|
+
- Edit `.md` files directly — no TypeScript rebuild required (runtime `readFileSync`)
|
|
32
|
+
- Each patch MUST have a `## WHY` section explaining the operational failure it prevents (FR36)
|
|
33
|
+
- Do NOT change filenames without updating `readPatchFile()` calls in `bmad-patches.ts`
|
|
34
|
+
- Do NOT remove inline fallback strings in `bmad-patches.ts` — they cover npm installs without `patches/`
|
|
35
|
+
|
|
36
|
+
## Adding a New Patch
|
|
37
|
+
|
|
38
|
+
1. Create `patches/{role}/{name}.md` with `## WHY` section
|
|
39
|
+
2. Add a template function in `src/templates/bmad-patches.ts` calling `readPatchFile(role, name)`
|
|
40
|
+
3. Add entry to `PATCH_TEMPLATES` in `bmad-patches.ts`
|
|
41
|
+
4. Add target mapping in `PATCH_TARGETS` in `src/lib/bmad.ts`
|
|
42
|
+
5. Add tests in `src/templates/__tests__/bmad-patches.test.ts`
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## WHY
|
|
2
|
+
|
|
3
|
+
Dev agents repeatedly shipped code without reading module conventions (AGENTS.md),
|
|
4
|
+
skipped observability checks, and produced features that could not be verified
|
|
5
|
+
from outside the source tree. This patch enforces architecture awareness,
|
|
6
|
+
observability validation, documentation hygiene, test coverage gates, and
|
|
7
|
+
black-box thinking — all operational failures observed in prior sprints.
|
|
8
|
+
(FR33, FR34, NFR20)
|
|
9
|
+
|
|
1
10
|
## Codeharness Development Enforcement
|
|
2
11
|
|
|
3
12
|
### Architecture Awareness
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## WHY
|
|
2
|
+
|
|
3
|
+
Retrospectives produced vague observations without actionable items, and
|
|
4
|
+
verification pipeline issues (hangs, false positives, verify-dev loops) were
|
|
5
|
+
not systematically tracked. This patch structures retro analysis around
|
|
6
|
+
verification effectiveness, pipeline health, documentation accuracy, test
|
|
7
|
+
quality trends, and mandatory concrete action items with owners.
|
|
8
|
+
(FR33, FR36, NFR20)
|
|
9
|
+
|
|
1
10
|
## Codeharness Retrospective Quality Metrics
|
|
2
11
|
|
|
3
12
|
### Verification Effectiveness
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## WHY
|
|
2
|
+
|
|
3
|
+
Review agents approved stories without verifying proof documents existed or
|
|
4
|
+
checking that evidence was black-box (not source-grep). Stories passed review
|
|
5
|
+
with fabricated output and missing coverage data. This patch enforces proof
|
|
6
|
+
existence, black-box evidence quality, and coverage delta reporting as hard
|
|
7
|
+
gates before a story can leave review.
|
|
8
|
+
(FR33, FR34, NFR20)
|
|
9
|
+
|
|
1
10
|
## Codeharness Review Gates
|
|
2
11
|
|
|
3
12
|
### Verification Proof
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## WHY
|
|
2
|
+
|
|
3
|
+
Sprint planning repeatedly started new work while retrospective action items
|
|
4
|
+
were unresolved, leading to compounding tech debt. Stories entered sprints
|
|
5
|
+
with untestable ACs or missing backlog sources, causing mid-sprint scope
|
|
6
|
+
discovery. This patch enforces pre-planning retro review, multi-source backlog
|
|
7
|
+
import, and story readiness checks.
|
|
8
|
+
(FR33, FR34, NFR20)
|
|
9
|
+
|
|
1
10
|
## Codeharness Sprint Planning Integration
|
|
2
11
|
|
|
3
12
|
### Pre-Planning Checks
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## WHY
|
|
2
|
+
|
|
3
|
+
Stories were marked "done" with no proof artifact, or with proofs that only
|
|
4
|
+
grepped source code instead of exercising the feature from the user's
|
|
5
|
+
perspective. This patch mandates black-box proof documents, docker exec evidence,
|
|
6
|
+
verification tags per AC, and test coverage targets — preventing regressions
|
|
7
|
+
from being hidden behind source-level assertions.
|
|
8
|
+
(FR33, FR36, NFR20)
|
|
9
|
+
|
|
1
10
|
## Verification Requirements
|
|
2
11
|
|
|
3
12
|
Every story must produce a **black-box proof** — evidence that the feature works from the user's perspective, NOT from reading source code.
|
package/ralph/ralph.sh
CHANGED
|
@@ -38,7 +38,7 @@ LOG_DIR=""
|
|
|
38
38
|
# Loop limits
|
|
39
39
|
MAX_ITERATIONS=${MAX_ITERATIONS:-50}
|
|
40
40
|
MAX_STORY_RETRIES=${MAX_STORY_RETRIES:-10}
|
|
41
|
-
LOOP_TIMEOUT_SECONDS=${LOOP_TIMEOUT_SECONDS:-
|
|
41
|
+
LOOP_TIMEOUT_SECONDS=${LOOP_TIMEOUT_SECONDS:-43200} # 12 hours default
|
|
42
42
|
ITERATION_TIMEOUT_MINUTES=${ITERATION_TIMEOUT_MINUTES:-30}
|
|
43
43
|
|
|
44
44
|
# Rate limiting
|