feat: instance manifest, tool profiles, metrics, and budget enforcement

Land HARNESS-WP-0001 T01/T02/T04/T05: extend ADR-005 schedule.yml with
harness fields, named tool-profile registry, ADR-004 metrics writes, and
BudgetTracker wiring. CLI gains validate/profiles; task-file path kept.
This commit is contained in:
tegwick 2026-07-17 23:49:03 +02:00
parent 16f5c29c08
commit 4144eba160
17 changed files with 1387 additions and 60 deletions

View file

@ -32,25 +32,27 @@
| Component | File | Today | Target |
|---|---|---|---|
| Instance manifest | `manifest.py` | extends `.kaizen/schedule.yml`; `validate` CLI | unchanged contract; tenant onboarding |
| Tool profiles | `profiles.py` | `green-commit-only`, `blue-mail-triage` registry | additional named profiles as needed |
| Task intake | `taskspec.py` | JSON task-spec file | poll issue-core sink / TaskExecutorWorkflow |
| Persona | `persona.py` | `kaizen-agentic schedule prepare` (ADR-005) | unchanged, plus phase-memory profile hook |
| Session | `adapter.py` | `AgenticClaudeCodeAdapter` (llm-connect subclass, cwd-pinned, hard allow-list) | + hosted adapters; tool profiles (below) |
| Orchestration | `runner.py` | HEAD snapshot → session → commit check → report | + budget enforcement, kaizen metrics write |
| Session | `adapter.py` | `AgenticClaudeCodeAdapter` (cwd-pinned, profile allow-list) | + hosted adapters |
| Orchestration | `runner.py` | profile/budget → session → commit → metrics → hub | activity-core intake |
| Metrics | `metrics.py` | ADR-004 `.kaizen/metrics` write per run | correlate with Helix fleet metrics |
| Mail lane | `mailscan.py` | deterministic credentialed pre-step outside the session | pattern generalizes to other credentialed pre-steps |
| Hub reporting | `hub.py` | REST progress event + task close | unchanged |
| Hub reporting | `hub.py` | REST progress event + task close + token event | unchanged |
## Contracts
**Instance manifest** (in the consuming repo; `.kaizen/schedule.yml` today,
extended per-agent fields as the manifest spec lands in HARNESS-WP-0001):
blueprint name, cadence, `enabled`, plus target additions: `lane`
(green/blue), `tool_profile` (named, defined here), `budget`
(tokens/run), `harness` (pinned major version).
**Instance manifest** — `.kaizen/schedule.yml` (ADR-005 base + harness
extensions). Full contract: [instance-manifest.md](instance-manifest.md).
Fields: blueprint, cadence, `enabled`, `lane` (green/blue),
`tool_profile` (named), `budget` (tokens/run), `harness` (pinned major).
**Tool profiles** are named allow-lists defined centrally in the harness,
referenced by name from manifests — instances never enumerate tools.
Seed profile `green-commit-only` = Read/Write/Edit/Glob/Grep + local git
add/commit/status/log/diff. No push, no network, no arbitrary shell.
**Tool profiles** are named allow-lists defined centrally in the harness
(`profiles.py`), referenced by name from manifests — instances never
enumerate tools. Seed: `green-commit-only`, `blue-mail-triage`. No push,
no network, no arbitrary shell. Unknown profile = refuse to run.
**Completion events** are the idempotence currency: each run posts a
progress event (e.g. `binky_daily_brief`, `binky_mail_intake`) with