generated from coulomb/repo-seed
C2: document actual GHC cache behavior (-fbyte-code, no .o files, .hi caching via -fwrite-interface) and correct CLAUDE.md cache claim. C3: create IHUB-WP-0017 error-fix loop workplan (ralph-compatible, 5 tasks E1-E5, runs inside devenv shell). WP-0016 status → done. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
121 lines
3.0 KiB
Markdown
121 lines
3.0 KiB
Markdown
---
|
||
id: IHUB-WP-0017
|
||
type: workplan
|
||
title: "Autonomous Error-Fix Loop: Reach Clean Build"
|
||
domain: inter_hub
|
||
repo: inter-hub
|
||
status: active
|
||
owner: custodian
|
||
created: "2026-04-10"
|
||
updated: "2026-04-10"
|
||
depends_on: [IHUB-WP-0016]
|
||
---
|
||
|
||
# IHUB-WP-0017 — Autonomous Error-Fix Loop: Reach Clean Build
|
||
|
||
## Goal
|
||
|
||
Drive the inter-hub codebase to a clean `ghcid` build ("All good, N modules loaded")
|
||
by fixing compilation errors bottom-up, one module at a time.
|
||
|
||
## Pre-conditions
|
||
|
||
- Must be run inside `devenv shell` (IHP_LIB must be set, ghcid in PATH)
|
||
- WP-0016 complete (compile-check scripts and ghci flags in place)
|
||
|
||
## How to start
|
||
|
||
```bash
|
||
# Enter devenv shell first:
|
||
devenv shell
|
||
|
||
# Then start this loop:
|
||
/ralph-workplan workplans/IHUB-WP-0017-error-fix-loop.md
|
||
```
|
||
|
||
## Error-Fix SOP (Standard Operating Procedure)
|
||
|
||
```
|
||
1. Run: scripts/compile-check --bg
|
||
2. Tail /tmp/ihub-compile-errors.txt
|
||
3. Parse errors: group by module, order by Layer (1 → 4)
|
||
4. Fix Layer 1 errors first (rare; usually type/import issues in Web/Types.hs)
|
||
5. For each failing module in Layer 2–3:
|
||
a. Read current module state
|
||
b. Apply targeted fix (one module at a time)
|
||
c. Wait for ghcid "Reloading..." + result
|
||
d. If still failing: re-read error, apply next fix
|
||
e. If 3 attempts fail: escalate — flag_for_human with module name and error
|
||
6. After Layer 3 clean: fix Layer 4 (FrontController/Routes)
|
||
7. "All good (N modules)" in log = build clean
|
||
```
|
||
|
||
**Layer discipline** (never violate):
|
||
- Never modify Layer 1 (`Web/Types.hs`, `build/Generated/*.hs`) during error-fix loops
|
||
- Layer 1 changes invalidate ALL 59 controllers and 120 views simultaneously
|
||
- Fix within the layer where the error is reported; escalate if the fix requires Layer 1
|
||
|
||
## Tasks
|
||
|
||
### E1 — Start compile-check and capture initial error set
|
||
|
||
```task
|
||
id: E1
|
||
status: todo
|
||
priority: high
|
||
```
|
||
|
||
Run `scripts/compile-check --bg` and read `/tmp/ihub-compile-errors.txt`. List all
|
||
failing modules and their layers.
|
||
|
||
### E2 — Fix Layer 2 errors (Application/Helper/*.hs)
|
||
|
||
```task
|
||
id: E2
|
||
status: todo
|
||
priority: high
|
||
```
|
||
|
||
Fix all errors in `Application/Helper/*.hs`. Verify via ghcid reload. Mark done when
|
||
Layer 2 shows no errors.
|
||
|
||
### E3 — Fix Layer 3 errors (Web/Controller/*.hs and Web/View/**/*.hs)
|
||
|
||
```task
|
||
id: E3
|
||
status: todo
|
||
priority: high
|
||
```
|
||
|
||
Fix errors in controllers and views. Work module-by-module, bottom-up. Mark done when
|
||
Layer 3 shows no errors.
|
||
|
||
### E4 — Fix Layer 4 errors (Web/FrontController.hs, Web/Routes.hs)
|
||
|
||
```task
|
||
id: E4
|
||
status: todo
|
||
priority: medium
|
||
```
|
||
|
||
Fix wiring errors last. Mark done when `ghcid` reports "All good, N modules loaded".
|
||
|
||
### E5 — Commit clean build and close WP-0014/A1
|
||
|
||
```task
|
||
id: E5
|
||
status: todo
|
||
priority: medium
|
||
```
|
||
|
||
After "All good" state:
|
||
1. Commit all fixes with `fix(WP-0017): reach clean build`
|
||
2. Update `workplans/IHUB-WP-0014-pre-flight-deployment-gaps.md` A1 status to done
|
||
3. Mark this workplan done
|
||
|
||
## Exit Criteria
|
||
|
||
- `ghcid` reports "All good, N modules loaded" with no errors
|
||
- All fixes committed
|
||
- WP-0014/A1 closed
|