generated from coulomb/repo-seed
feat: advance LOOP-WP-0002/0003/0004 without activity-core blockers
Document event payload contract, draft disabled ActivityDefinitions for CI/regulator/registry hygiene, initialize loop health snapshots and regulator dashboard, record DEC-005 kaizen-stack promotion, and close supplier-independent workplan tasks.
This commit is contained in:
60
loops/quality-escalation/event-payload.md
Normal file
60
loops/quality-escalation/event-payload.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Event payload contract — `kaizen.metrics.recorded`
|
||||
|
||||
Customer contract for LOOP-WP-0002 T03. Supplier implementation:
|
||||
`kaizen-agentic metrics record --emit-event` (shipped KAIZEN-WP-0008 T03).
|
||||
|
||||
## NATS subject
|
||||
|
||||
```
|
||||
activity.kaizen.metrics.recorded
|
||||
```
|
||||
|
||||
## Envelope (activity-core EventEnvelope)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "550e8400-e29b-41d4-a716-446655440000",
|
||||
"type": "kaizen.metrics.recorded",
|
||||
"version": "1.0",
|
||||
"timestamp": "2026-06-18T12:00:00Z",
|
||||
"publisher": "kaizen-agentic",
|
||||
"attributes": {
|
||||
"agent": "coach",
|
||||
"project": "kaizen-agentic",
|
||||
"summary": {
|
||||
"success_rate": 0.75,
|
||||
"execution_count": 12,
|
||||
"avg_quality": 0.81
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Attribute fields
|
||||
|
||||
| Field | Type | Notes |
|
||||
|-------|------|-------|
|
||||
| `agent` | string | Agent from `metrics record <agent>` |
|
||||
| `project` | string | Repo slug (`KAIZEN_PROJECT_SLUG` or directory basename) |
|
||||
| `summary.success_rate` | float | Rolling rate from `summary.json` after append |
|
||||
| `summary.execution_count` | int | Total executions |
|
||||
| `summary.avg_quality` | float | From `avg_quality_score` in ADR-004 summary |
|
||||
|
||||
## ActivityDefinition binding
|
||||
|
||||
`low-success-rate-review` uses `type: event-payload` → `context.metrics`.
|
||||
Rule evaluates `context.metrics.summary.success_rate` (requires activity-core R1).
|
||||
|
||||
## CLI (target repo)
|
||||
|
||||
```bash
|
||||
kaizen-agentic metrics record coach --success --time 120 --quality 0.9 --emit-event
|
||||
```
|
||||
|
||||
Requires `pip install 'kaizen-agentic[events]'` and `NATS_URL`.
|
||||
|
||||
## Related
|
||||
|
||||
- Supplier spec: `kaizen-agentic/docs/integrations/kaizen-metrics-recorded-event.md`
|
||||
- Thresholds: `loops/quality-escalation/thresholds.yml`
|
||||
- Definition: `activity-definitions/low-success-rate-review.md`
|
||||
Reference in New Issue
Block a user