bootstrap: fix rule syntax, enable metrics+coach definitions

Align coulomb ActivityDefinition rules with activity-core path syntax
(context.p.* / {context.p.*}). Enable hourly-metrics-optimize and
hourly-coach-orientation; record first E2E cycle in bootstrap-log.
This commit is contained in:
2026-06-18 08:11:09 +02:00
parent 32c935470f
commit 2bdcb6830d
6 changed files with 33 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
---
id: coulomb-hourly-coach-orientation
name: Hourly Kaizen Coach Orientation (coulomb-loop bootstrap)
enabled: false
enabled: true
owner: coulomb-loop
governance: coulomb_social
status: proposed
@@ -25,14 +25,14 @@ context_sources:
id: run-hourly-coach
for_each: context.scheduled_runs
bind_as: r
condition: 'r.agent == "coach" and r.enabled == true'
condition: 'context.r.agent == "coach" and context.r.enabled'
action:
task_template: "Hourly coach orientation: {{r.repo}}"
task_template: "Hourly coach orientation: {context.r.repo}"
description: |
{{r.prepare_command}}
{context.r.prepare_command}
Load agents/agent-coach.md, execute coach synthesis.
Session close: kaizen-agentic metrics record coach --success --time <s> --quality <0-1>
target_repo: "{{r.repo}}"
target_repo: context.r.repo
priority: medium
labels: ["kaizen", "agent-run", "coach", "coulomb-loop", "bootstrap"]
```

View File

@@ -27,15 +27,15 @@ Bootstrap fallback per DEC-002 option A until `kaizen.metrics.recorded` events s
id: flag-low-success-hourly
for_each: context.projects
bind_as: p
condition: 'p.summary.success_rate < 0.8 and p.summary.execution_count >= 5'
condition: 'context.p.summary.success_rate < 0.8 and context.p.summary.execution_count >= 5'
action:
task_template: "Review {{p.agent}} success rate on {{p.repo}}"
task_template: "Review {context.p.agent} success rate on {context.p.repo}"
description: |
Agent metrics below threshold on {{p.repo}}.
Agent metrics below threshold on {context.p.repo}.
kaizen-agentic metrics show <agent>
kaizen-agentic metrics optimize <agent>
Load agents/agent-optimization.md for review.
target_repo: "{{p.repo}}"
target_repo: context.p.repo
priority: high
labels: ["kaizen", "quality-escalation", "coulomb-loop", "bootstrap"]
```

View File

@@ -1,7 +1,7 @@
---
id: coulomb-hourly-metrics-optimize
name: Hourly Kaizen Metrics Optimization (coulomb-loop bootstrap)
enabled: false
enabled: true
owner: coulomb-loop
governance: coulomb_social
status: proposed
@@ -28,13 +28,13 @@ Runs hourly during coulomb-loop bootstrap phase. Limited to pilot roster
id: run-hourly-optimizer
for_each: context.projects
bind_as: p
condition: 'p.has_metrics == true and p.in_pilot_roster == true'
condition: 'context.p.has_metrics and context.p.in_pilot_roster'
action:
task_template: "Run kaizen metrics optimize on {{p.repo}}"
task_template: "Run kaizen metrics optimize on {context.p.repo}"
description: |
cd {{p.root}} && kaizen-agentic metrics optimize
cd {context.p.root} && kaizen-agentic metrics optimize
Optional: kaizen-agentic metrics publish (when artifact-store configured)
target_repo: "{{p.repo}}"
target_repo: context.p.repo
priority: medium
labels: ["kaizen", "metrics", "optimizer", "coulomb-loop", "bootstrap"]
```

View File

@@ -25,16 +25,16 @@ context_sources:
id: run-hourly-optimization
for_each: context.scheduled_runs
bind_as: r
condition: 'r.agent == "optimization" and r.enabled == true'
condition: 'context.r.agent == "optimization" and context.r.enabled'
action:
task_template: "Hourly optimization review: {{r.repo}}"
task_template: "Hourly optimization review: {context.r.repo}"
description: |
{{r.prepare_command}}
{context.r.prepare_command}
kaizen-agentic metrics optimize
Load agents/agent-optimization.md; act on recommendations.
Session close: kaizen-agentic metrics record optimization --success --time <s> --quality <0-1>
If saturation signals fire (ADR-004), file regulator rotation recommendation.
target_repo: "{{r.repo}}"
target_repo: context.r.repo
priority: medium
labels: ["kaizen", "agent-run", "optimization", "coulomb-loop", "bootstrap"]
```

View File

@@ -7,17 +7,19 @@
- [x] Pilot roster: `loops/kaizen-stack/roster.yaml`
- [x] `.kaizen/schedule.yml` on kaizen-agentic, the-custodian, activity-core
- [x] ActivityDefinition copies in `coulomb-loop/activity-definitions/` (all `enabled: false`)
- [x] ActivityDefinition copies in `coulomb-loop/activity-definitions/`
## activity-core checklist
- [x] Implement `discover_kaizen_scheduled_repos` + `discover_kaizen_projects`
(`activity_core/context_resolvers/kaizen.py`; types `kaizen` / `resolver` / `shell`)
- [x] Dry-run: 6 `scheduled_runs` for pilot roster (2026-06-18)
- [ ] Copy definitions from `coulomb-loop/activity-definitions/` to catalog
- [ ] `make sync-activity-definitions`
- [ ] Dry-run hourly chain (no `enabled: true` yet)
- [ ] Enable `hourly-metrics-optimize` first after dry-run pass
- [x] `ACTIVITY_DEFINITION_DIRS` includes coulomb-loop; `sync_activity_definitions` (7 upserted)
- [x] Dev stack up (docker compose, alembic, worker + API on 8010)
- [x] E2E manual trigger: `hourly-metrics-optimize` → 6 tasks (2026-06-18)
- [x] Enable `hourly-metrics-optimize` (hourly cron active)
- [x] Enable `hourly-coach-orientation` → 3 coach tasks (2026-06-18)
- [ ] Enable `hourly-optimization-review`
## Smoke commands (pilot)

View File

@@ -14,6 +14,12 @@
| 2026-06-18T04:54 | activity-core | schedule prepare coach+optimization | pass | 6900/9643 bytes |
| 2026-06-18T05:00 | activity-core | discover_kaizen_scheduled_repos dry-run | pass | 6 runs (3 repos × 2 agents) |
| 2026-06-18T06:07 | activity-core | dev stack up (docker compose, alembic, sync) | pass | 7 definitions upserted |
| 2026-06-18T06:07 | coulomb-loop | enable hourly-metrics-optimize | pass | Temporal schedule upserted |
| 2026-06-18T06:09 | activity-core | E2E trigger metrics-optimize (manual) | pass | 6 tasks spawned (3 repos × 2 agent metrics dirs) |
| 2026-06-18T06:10 | all pilots | metrics record coach+optimization | pass | bootstrap session-close samples |
| 2026-06-18T06:10 | coulomb-loop | enable hourly-coach-orientation | pass | 3 coach tasks spawned (1 per pilot repo) |
**Bootstrap exit (single repo):** manual smoke pass; 0/3 consecutive hourly E2E cycles.
**Next:** `make sync-activity-definitions` when ACTCORE_DB up; enable definitions one-by-one.
**Bootstrap exit (single repo):** manual smoke pass; 1/3 consecutive hourly E2E cycles.
**Bootstrap exit (fleet pilot):** 1/3 consecutive hourly cycles across 3 repos.
**Next:** enable `hourly-optimization-review`; fix activity-core context bind unwrap (done); 2 more hourly cycles.