Files
coulomb-loop/workplans/LOOP-WP-0001-kaizen-improvement-stack.md
tegwick 18ec8e2bbe Complete activity-core handoff for kaizen resolver bootstrap.
Point ActivityDefinitions at kaizen source type, record dry-run success in
bootstrap log, and close LOOP-WP-0001 T05 after resolver implementation.
2026-06-18 07:46:46 +02:00

278 lines
8.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: LOOP-WP-0001
type: workplan
title: "Kaizen Improvement Stack (coach + metrics + optimization)"
domain: coulomb_social
repo: coulomb-loop
status: active
owner: coulomb-loop
topic_slug: coulomb_social
supplier: kaizen-agentic
created: "2026-06-18"
updated: "2026-06-18"
depends_on: []
tasks:
- id: T01
status: done
title: Register coulomb-loop in state-hub and sync workplans
- id: T02
status: done
title: Declare pilot roster for kaizen improvement stack
- id: T03
status: done
title: Scaffold .kaizen/schedule.yml on pilot target repos
- id: T04
status: done
title: Copy and tune ActivityDefinitions for hourly bootstrap cadence
- id: T05
status: done
title: activity-core handoff — enable resolver and sync definitions
- id: T06
status: done
title: Hourly bootstrap smoke test on single pilot repo
- id: T07
status: todo
title: Expand pilot to three repos and record metrics at session close
- id: T08
status: todo
title: Promote cadence to daily after bootstrap exit criteria met
state_hub_workstream_id: "90a05147-7b95-4ce7-96bf-39cdb487b557"
---
# LOOP-WP-0001 — Kaizen Improvement Stack
**Status:** active
**Owner:** coulomb-loop (customer)
**Supplier:** kaizen-agentic
**Repo:** coulomb-loop
## Goal
Establish the **primary self-improvement loop** for the Coulomb fleet: a chained
sequence that turns project metrics into coach synthesis and optimization action.
```mermaid
flowchart LR
AC[activity-core hourly cron]
RES[discover_kaizen_scheduled_repos]
M[metrics optimize]
C[schedule prepare coach]
O[schedule prepare optimization]
AC --> RES --> M --> C --> O
```
This loop generalizes the supplier's Monday Stack (`weekly-metrics-optimize`
`weekly-coach-orientation``weekly-optimization-review`) into a **cadence-ramped**
engagement starting at **hourly** during bootstrap.
## Customer / supplier boundary
| coulomb-loop (customer) | kaizen-agentic (supplier) |
|-------------------------|---------------------------|
| Pilot roster, acceptance criteria, cadence policy | Agent prompts, `schedule` / `metrics` CLI, ADR-005 contract |
| ActivityDefinition copies under `activity-definitions/` | Reference definitions in `docs/integrations/activity-definitions/` |
| Loop health records in `loops/kaizen-stack/` | Customer-repo bootstrap learnings fed back to supplier |
Agents (`coach`, `optimization`) accumulate memory in **target repos**, not in
`coulomb-loop`. This repo holds contracts and operations only.
## Cadence ramp
| Phase | Cron (Europe/Berlin) | ActivityDefinitions |
|-------|----------------------|---------------------|
| Bootstrap | `0 * * * *` (hourly) | `hourly-metrics-optimize`, `hourly-coach-orientation`, `hourly-optimization-review` |
| Stabilize | `0 8 * * *` (daily 08:00) | rename/switch to daily variants |
| Operate | Mon 08:0010:00 (weekly) | align with supplier weekly templates |
Promotion from hourly → daily requires LOOP-WP-0004 regulator sign-off after
bootstrap exit criteria (see Part 4).
## Part 1 — Engagement bootstrap
## Register coulomb-loop in state-hub
```task
id: LOOP-WP-0001-T01
status: done
priority: high
state_hub_task_id: "c66d2e98-8f3e-4119-89e7-2b6f67b6596d"
```
Completed 2026-06-18: `register_project.sh coulomb_social`, topic_id patched,
`fix-consistency` indexed LOOP-WP-00010004. See LOOP-WP-0000.
## Declare pilot roster
```task
id: LOOP-WP-0001-T02
status: done
priority: high
state_hub_task_id: "65994889-2f41-46e3-9c47-00cedc59fd81"
```
DEC-001 option A accepted. `loops/kaizen-stack/roster.yaml` committed with
`active` (3 custodian pilots), `expansion_queue`, and `saturated` per ADR-004.
## Scaffold schedule opt-in on pilot repos
```task
id: LOOP-WP-0001-T03
status: done
priority: high
state_hub_task_id: "2293b8bd-20b1-4d54-bd1c-8311004e59f9"
```
Completed 2026-06-18: `schedule init`, `memory init coach|optimization`, bootstrap
hourly crons (`coach :15`, `optimization :30`) on kaizen-agentic, the-custodian,
activity-core. All `schedule validate` pass.
## Scaffold schedule opt-in on pilot repos (reference)
In each pilot **target repo** (not coulomb-loop):
```bash
kaizen-agentic schedule init --timezone Europe/Berlin
kaizen-agentic schedule validate
```
Override defaults for bootstrap:
```yaml
agents:
coach:
cadence: daily # schema enum; cron carries hourly during bootstrap
cron: "0 * * * *"
enabled: true
optimization:
cadence: daily
cron: "30 * * * *" # offset 30 min after metrics+coach chain
enabled: true
```
Commit `.kaizen/schedule.yml` in each pilot repo. Initialize metrics dirs:
`kaizen-agentic memory init coach` and `memory init optimization` (creates metrics scaffold).
## Part 2 — activity-core integration
## Copy and tune ActivityDefinitions
```task
id: LOOP-WP-0001-T04
status: done
priority: high
state_hub_task_id: "53025f59-f00a-4792-950a-878e867803b2"
```
Five definitions in `coulomb-loop/activity-definitions/` (hourly stack + quality).
Handoff doc: `docs/integrations/activity-core-handoff.md`.
Copy supplier templates into `coulomb-loop/activity-definitions/`:
| File | Based on | Bootstrap cron |
|------|----------|----------------|
| `hourly-metrics-optimize.md` | `weekly-metrics-optimize` | `0 * * * *` |
| `hourly-coach-orientation.md` | `weekly-coach-orientation` | `15 * * * *` |
| `hourly-optimization-review.md` | `weekly-optimization-review` | `30 * * * *` |
Set `owner: coulomb-loop`, `governance: coulomb_social`, `enabled: false` until
smoke test passes. Resolver params: `domain: custodian` for pilot, `cadence: daily`
(schema) with per-repo cron override from schedule.yml.
## activity-core handoff
```task
id: LOOP-WP-0001-T05
status: done
priority: high
state_hub_task_id: "16c54902-a1c5-4e24-9bc3-5c7b8c30abe3"
```
2026-06-18: `activity_core/context_resolvers/kaizen.py` shipped (7 tests pass).
Dry-run returned 6 scheduled runs. `ACTIVITY_DEFINITION_DIRS` includes coulomb-loop;
DB sync pending when `ACTCORE_DB_URL` stack is up. Enable definitions incrementally.
Reference: `docs/integrations/activity-core-handoff.md` (coulomb-loop) and
`kaizen-agentic/docs/integrations/activity-core-handoff-wp0006.md` (supplier).
## Part 3 — Pilot and promote
## Hourly bootstrap smoke test (single repo)
```task
id: LOOP-WP-0001-T06
status: done
priority: medium
state_hub_task_id: "a5ecda96-f299-421c-b393-ae54bfbf9ae0"
```
Smoke pass on all 3 pilots (prepare bundles 6.99.7 KB). Log:
`loops/kaizen-stack/bootstrap-log.md`. activity-core wiring still pending (T05).
On `kaizen-agentic` only:
```bash
kaizen-agentic schedule validate
kaizen-agentic schedule prepare coach
kaizen-agentic metrics optimize
kaizen-agentic schedule prepare optimization
```
Verify non-empty prepare bundles. Manually simulate activity-core task payload.
Record outcome in `loops/kaizen-stack/bootstrap-log.md`.
**Bootstrap exit (single repo):** 3 consecutive hours where all three steps complete
without manual intervention.
## Three-repo pilot with metrics
```task
id: LOOP-WP-0001-T07
status: todo
priority: medium
state_hub_task_id: "e60fa833-9407-460a-b1d1-7e08850fa291"
```
Enable activity-core definitions for full pilot roster. Each session close:
```bash
kaizen-agentic metrics record coach --success --time <s> --quality <0-1>
kaizen-agentic metrics record optimization --success --time <s> --quality <0-1>
```
**Bootstrap exit (fleet pilot):** 3 consecutive hourly cycles across all 3 repos.
## Promote to daily cadence
```task
id: LOOP-WP-0001-T08
status: todo
priority: low
state_hub_task_id: "7c77ec4f-594c-4122-9c64-af5c4071446d"
```
After LOOP-WP-0004 regulator approves:
1. Update pilot `schedule.yml` crons to daily (`0 8`, `0 9`, `0 10`)
2. Switch activity-core definitions to daily variants
3. Record promotion decision in state-hub
## Definition of done
- Hourly loop runs end-to-end on 3 pilot repos via activity-core task creation
- `schedule prepare` bundles are actionable in coding-agent sessions
- Metrics recorded for coach and optimization on each run
- Cadence promotion path documented and ready for regulator approval
## Out of scope
- Fleet-wide rollout beyond pilot (follows LOOP-WP-0004 approval)
- Implementing resolvers in coulomb-loop (activity-core owns runtime)
- Headless LLM invocation
## Supplier feedback (for kaizen-agentic)
Capture in `loops/kaizen-stack/supplier-notes.md`:
- friction from `schedule init` / `prepare` on customer engagement
- missing CLI flags for engagement repos
- template gaps for customer ActivityDefinition copies