Enable kaizen agents to run on a regular cadence against a preselected repo roster, orchestrated by activity-core and prepared by kaizen-agentic — without this repo owning cron, Temporal workers, or an LLM runtime. CLI + module: - src/kaizen_agentic/schedule.py — .kaizen/schedule.yml parse/validate/scaffold - `kaizen-agentic schedule` group: init, validate, list, prepare <agent> (prepare bundles agent prompt + memory + metrics + repo pointers, offline) - tests/test_schedule_cli.py — 15 tests Contract & design: - ADR-005 scheduled agent execution; schema doc + example manifest - discover_kaizen_scheduled_repos resolver spec, state-hub roster fields, kaizen.schedule.prepared event payload, activity-core handoff checklist - INTEGRATION_PATTERNS Pattern 2 extended with roster model ActivityDefinition drafts (enabled: false): - weekly-coach-orientation, weekly-optimization-review Docs: agency-framework, CLI cheat sheet, PACKAGE_RELEASE runner prereqs, EcosystemIntegration, CHANGELOG, TODO. Workplan closed (status: done). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
3.2 KiB
Markdown
70 lines
3.2 KiB
Markdown
# activity-core Handoff — Scheduled Agent Execution (WP-0006)
|
|
|
|
Coordination checklist for the **activity-core** team to enable kaizen scheduled
|
|
agent runs. kaizen-agentic owns the schedule contract, the prepare CLI, and the
|
|
ActivityDefinition **drafts**; activity-core owns the resolver, the schedule
|
|
firing, and task creation (repo boundary, ADR-005).
|
|
|
|
Open this as an activity-core issue/PR titled *"Enable kaizen scheduled agent
|
|
execution (WP-0006)"* and track the boxes there.
|
|
|
|
## What kaizen-agentic ships (done in this repo)
|
|
|
|
- [x] `.kaizen/schedule.yml` schema + `schedule validate|init|list|prepare` CLI
|
|
- [x] ADR-005 contract
|
|
- [x] Resolver spec: [discover-kaizen-scheduled-repos.md](discover-kaizen-scheduled-repos.md)
|
|
- [x] State Hub roster fields design: [state-hub-roster-fields.md](state-hub-roster-fields.md)
|
|
- [x] Draft definitions (`enabled: false`):
|
|
[weekly-coach-orientation](activity-definitions/weekly-coach-orientation.md),
|
|
[weekly-optimization-review](activity-definitions/weekly-optimization-review.md)
|
|
- [x] Event payload spec: [kaizen-schedule-prepared-event.md](kaizen-schedule-prepared-event.md)
|
|
|
|
## What activity-core must do
|
|
|
|
- [ ] **Implement resolver** `discover_kaizen_scheduled_repos` per the spec
|
|
(hub roster ∩ repos with valid `.kaizen/schedule.yml`).
|
|
- [ ] **Add resolver unit tests** using the four fixtures in the spec.
|
|
- [ ] **Copy definitions** from `docs/integrations/activity-definitions/`
|
|
(`weekly-coach-orientation.md`, `weekly-optimization-review.md`) into the
|
|
activity-core catalog path (per ACT-ADR-002).
|
|
- [ ] **Register** each definition slug in the activity-core index.
|
|
- [ ] **Run** `make sync-activity-definitions` in activity-core.
|
|
- [ ] **Wire cron** triggers (Mon 09:00 / 10:00 Europe/Berlin) to the resolver.
|
|
- [ ] **Smoke test** against a pilot repo (see below) with the definition still
|
|
`enabled: false` (dry-run task creation).
|
|
- [ ] **Enable gradually** — flip one definition to `enabled: true` in staging
|
|
after the smoke test passes.
|
|
- [ ] **Verify runner prerequisites** — `kaizen-agentic` on PATH and the Gitea
|
|
PyPI extra index if the runner installs from registry (see
|
|
[PACKAGE_RELEASE.md](../PACKAGE_RELEASE.md)).
|
|
|
|
## State Hub team (the-custodian)
|
|
|
|
- [ ] Optional: add `kaizen_schedule_enabled` repo flag + `GET /repos/` filter
|
|
(v2 pre-filter; the repo file remains the source of truth).
|
|
|
|
## Smoke test (manual, runner-agnostic)
|
|
|
|
```bash
|
|
cd /path/to/pilot-repo
|
|
kaizen-agentic schedule init # if not already present
|
|
kaizen-agentic schedule validate # exit 0
|
|
kaizen-agentic schedule list # shows coach + optimization enabled
|
|
kaizen-agentic schedule prepare coach # non-empty orientation bundle
|
|
```
|
|
|
|
Then in activity-core: run the resolver (dry-run) and confirm one
|
|
`scheduled_run` per enabled `(repo, agent)` with a correct `prepare_command`.
|
|
|
|
## Pilot roster
|
|
|
|
- `kaizen-agentic` (dogfood)
|
|
- `the-custodian` (hub operator)
|
|
- one additional custodian-domain repo with `.kaizen/` state (TBD at pilot time)
|
|
|
|
## Related
|
|
|
|
- [ADR-005](../adr/ADR-005-scheduled-agent-execution.md)
|
|
- [INTEGRATION_PATTERNS.md Pattern 2](../INTEGRATION_PATTERNS.md)
|
|
- [KAIZEN-WP-0006](../../workplans/kaizen-agentic-WP-0006-scheduled-agent-execution.md)
|