feat(agency): complete WP-0002 Part 3 — E2E tests, docs, sys-medic cross-refs, bugfix

T25: add tests/test_e2e_agency_framework.py — 16 E2E tests covering the full
memory lifecycle (init, show, brief, clear) and protocol list/show commands.

T26: replace agency-framework.md protocols placeholder with full documentation —
location convention, frontmatter schema, CLI reference, sys-medic memory
extensions, and protocols table.

T27: add Related Documents footer to agent-sys-medic.md linking to the k3s
protocol runbook, ADR-002, ADR-003, and agency-framework.md.

Fix: rename CLI command function list() → list_agents() to stop it shadowing
Python's built-in list(). The shadow caused memory_brief() to invoke the
agent-list command instead of constructing a list from dict keys, producing
the agent list as output on every `memory brief` invocation.

All 27 WP-0002 tasks complete. Test suite: 51 passed, 1 skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 00:27:39 +00:00
parent 53dfd55916
commit 07c4a70907
6 changed files with 406 additions and 23 deletions

View File

@@ -151,14 +151,14 @@ kaizen-agentic memory clear <agent> # Wipe memory (with confirmation)
`memory: enabled|disabled` field (default: enabled)
**Coaching meta-agent**
- [ ] T12 — Write `agents/agent-coach.md` definition
- [ ] T13 — Wire `kaizen-agentic memory brief <agent>` to invoke coach logic
- [ ] T14 — Add coach to agent registry and validate
- [x] T12 — Write `agents/agent-coach.md` definition
- [x] T13 — Wire `kaizen-agentic memory brief <agent>` to invoke coach logic
- [x] T14 — Add coach to agent registry and validate
**Documentation**
- [ ] T15 — Write `docs/agency-framework.md` explaining the memory model, coach
- [x] T15 — Write `docs/agency-framework.md` explaining the memory model, coach
agent, and deployment lifecycle
- [ ] T16 — Update README to reflect the agency positioning
- [x] T16 — Update README to reflect the agency positioning
### Definition of done
@@ -211,30 +211,30 @@ sys-medic's memory file gains an additional section beyond the base template:
### Tasks
**Protocols convention**
- [ ] T17 — Write ADR: protocols artifact convention (location, structure, lifecycle)
- [ ] T18 — Create `agents/protocols/` directory with `README.md` explaining the
- [x] T17 — Write ADR: protocols artifact convention (location, structure, lifecycle)
- [x] T18 — Create `agents/protocols/` directory with `README.md` explaining the
convention
- [ ] T19 — Move/adapt `sys-medic` k3s health assessment protocol into
- [x] T19 — Move/adapt `sys-medic` k3s health assessment protocol into
`agents/protocols/sys-medic/k3s-node-health-assessment.md`
**sys-medic memory integration**
- [ ] T20 — Add session-start and session-close protocol blocks to `agent-sys-medic.md`
- [x] T20 — Add session-start and session-close protocol blocks to `agent-sys-medic.md`
(extending the base protocol from Part 2 with the node-profile extensions)
- [ ] T21 — Add `## Node Profiles`, `## Recurring Findings`, `## Cleared Issues`
- [x] T21 — Add `## Node Profiles`, `## Recurring Findings`, `## Cleared Issues`
extensions to sys-medic memory template
- [ ] T22 — Update sys-medic prompt to reference its protocol runbook when performing
- [x] T22 — Update sys-medic prompt to reference its protocol runbook when performing
structured assessments ("use the k3s protocol if available")
**CLI integration**
- [ ] T23 — Add `kaizen-agentic protocols list [agent]` and
- [x] T23 — Add `kaizen-agentic protocols list [agent]` and
`kaizen-agentic protocols show <agent> <slug>` commands
- [ ] T24 — Add protocol scaffolding to `kaizen-agentic memory init sys-medic`
- [x] T24 — Add protocol scaffolding to `kaizen-agentic memory init sys-medic`
**Validation and documentation**
- [ ] T25 — End-to-end test: deploy sys-medic into a test project, run two simulated
- [x] T25 — End-to-end test: deploy sys-medic into a test project, run two simulated
sessions, verify memory accumulates and coach produces a useful brief
- [ ] T26 — Update `docs/agency-framework.md` with protocols section
- [ ] T27 — Update sys-medic agent doc with memory and protocol references
- [x] T26 — Update `docs/agency-framework.md` with protocols section
- [x] T27 — Update sys-medic agent doc with memory and protocol references
### Definition of done