Register kaizen.metrics.recorded event type for activity-core catalog (T03)
Some checks failed
ci / test (push) Has been cancelled
Some checks failed
ci / test (push) Has been cancelled
Producer-owned event-types/kaizen.metrics.recorded.md unblocks ACTIVITY-WP-0011 registry gate. Documents schema ownership and sync path for activity-core.
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
**Status:** implemented — `kaizen-agentic metrics record --emit-event`
|
||||
|
||||
**Registry:** `event-types/kaizen.metrics.recorded.md` (producer-owned, synced via
|
||||
activity-core `make sync-event-types` with `ACTIVITY_DEFINITION_DIRS` including
|
||||
this repo)
|
||||
|
||||
Emitted after a successful metrics append when `--emit-event` is set. Default
|
||||
off for backward compatibility.
|
||||
|
||||
|
||||
65
event-types/kaizen.metrics.recorded.md
Normal file
65
event-types/kaizen.metrics.recorded.md
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
type_id: kaizen.metrics.recorded
|
||||
version: "1.0"
|
||||
publisher: kaizen-agentic
|
||||
governance: publisher-declared
|
||||
status: active
|
||||
---
|
||||
|
||||
# kaizen.metrics.recorded
|
||||
|
||||
## Intent
|
||||
|
||||
Emitted when a project records agent execution metrics via
|
||||
`kaizen-agentic metrics record --emit-event`. Signals that rolling performance
|
||||
summary changed and may trigger quality-escalation ActivityDefinitions.
|
||||
|
||||
**Owning repo:** `kaizen-agentic` — schema changes require supplier review.
|
||||
|
||||
## When Published
|
||||
|
||||
- CLI: `kaizen-agentic metrics record <agent> --emit-event` after successful append
|
||||
- Not emitted when append is skipped (duplicate idempotency key)
|
||||
- NATS subject: `activity.kaizen.metrics.recorded`
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| agent | string | yes | Agent name from `metrics record <agent>` |
|
||||
| project | string | yes | Repo slug (`KAIZEN_PROJECT_SLUG` or directory basename) |
|
||||
| summary.success_rate | float | yes | Rolling success rate from `summary.json` after append |
|
||||
| summary.execution_count | integer | yes | Total execution count |
|
||||
| summary.avg_quality | float | no | Average quality score (maps from `avg_quality_score`) |
|
||||
|
||||
## Example Payload
|
||||
|
||||
```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
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Consumer Notes
|
||||
|
||||
- **activity-core**: `event-payload` resolver binds `attributes` → `context.metrics`
|
||||
for rules such as `flag-low-success-rate`
|
||||
- **coulomb-loop**: `low-success-rate-review` (LOOP-WP-0002) — primary reactive path
|
||||
|
||||
## Related
|
||||
|
||||
- `docs/integrations/kaizen-metrics-recorded-event.md`
|
||||
- `coulomb-loop/loops/quality-escalation/event-payload.md`
|
||||
Reference in New Issue
Block a user