feat: Phase 7 Local Agent Contract — passports, handoff graph, session tail, postrun report, quality gate #2

Merged
zarubinvibe merged 5 commits from phase7-local-agent-contract into main 2026-06-23 19:12:41 +00:00
zarubinvibe commented 2026-06-23 18:51:54 +00:00 (Migrated from github.com)

Summary

Phase 7 «Local Agent Contract» (Hire-Agents, local-first): adds a behavioral layer that checks agent workflow — roles, handoff transitions, reports, and eval records. A job is not done when there is only a text answer.

What changed

Steps 1–3 (passports + graph + smoke):

  • specs/07-local-agent-contract.md — full phase spec (EN), grafted 6 load-bearing contracts lost in prior compression
  • chezmoi/dot_agents/role-passports/*.md — 7 passports: athena-{router,guard,runner,reconciler,reviewer,librarian,steward} (English-first, model/tools/contract/won't/parity)
  • chezmoi/dot_agents/handoff-graph.yaml — machine-readable directed DAG with when/payload per edge, forbidden entries with why, final-learning-tail gate
  • smoke/agent-contract.sh — zero-dep integrity check: 7 passports × canon fields, graph keys, orphan detection, every edge has when, every forbidden has why, all 4 tail outputs present

Steps 4–6 (session tail + postrun report + quality gate):

  • skills/agent-session-review/SKILL.md (dual-write root + chezmoi) — 4 mandatory blocks: brief_md / agent_trace / self_reflection / most_important. Mandatory before the deliver gate fires (Karpathy method: synthesize on write)
  • chezmoi/dot_agents/registry/scripts/athena-postrun-report.mjs — adapted from mnemazine-postrun-knowledge-report.mjs (520 → ~120 lines, vault-specific logic removed). Input: --results-json [{group_id, outcome, helps, next_action}]. Output: --format md|html|json. Env: ATHENA_REPORTS, ATHENA_RUN_ID
  • chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs — 5 rules: no-raw-ocr / no-local-paths / no-secrets / has-outcome / has-next-action. Accepts .html and .md. Exit 0 = pass, 1 = fail
  • smoke/agent-contract.sh +4 checks: SKILL.md 4-block presence, synthetic postrun run, gate PASS on good report, gate FAIL on bad report (negative test)

Language policy:

  • Setup-os step 0.1 asks communication language first; if Russian → inviolable rule written to owner profile
  • All artifacts (passports, spec, contracts, scripts) = English-first

DoD status

Gate Status
smoke/smoke.sh green ✅
shellcheck -S error 0 ✅
7 passports + handoff graph integrity ✅
session tail 4 blocks present ✅
postrun report synthetic run ✅
quality gate positive PASS ✅
quality gate negative FAIL ✅
0 hardcoded paths ✅

Remaining (steps 7–10, next session)

  • job-lifecycle.yaml FSM + claude-starter/project.yaml template
  • eval-loop → router (routing-evals.jsonl), start matrix per-class
  • Parity smoke (same task through both Claude + Codex → compare route cards)
  • Dashboard as thin UI over verified local workflows

Test plan

  • bash smoke/smoke.sh → SMOKE OK
  • shellcheck -S error smoke/agent-contract.sh → exit 0
  • node chezmoi/dot_agents/registry/scripts/athena-postrun-report.mjs --results-json <file> --run-id test → produces .md in ATHENA_REPORTS
  • node chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs --report <good.md> → exit 0
  • node chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs --report <bad.md> → exit 1
  • chezmoi apply --dry-run on a clean machine — zero hardcoded /Users/ paths

🤖 Generated with Claude Code

## Summary Phase 7 «Local Agent Contract» (Hire-Agents, local-first): adds a behavioral layer that checks agent workflow — roles, handoff transitions, reports, and eval records. **A job is not done when there is only a text answer.** ### What changed **Steps 1–3 (passports + graph + smoke):** - `specs/07-local-agent-contract.md` — full phase spec (EN), grafted 6 load-bearing contracts lost in prior compression - `chezmoi/dot_agents/role-passports/*.md` — 7 passports: `athena-{router,guard,runner,reconciler,reviewer,librarian,steward}` (English-first, model/tools/contract/won't/parity) - `chezmoi/dot_agents/handoff-graph.yaml` — machine-readable directed DAG with `when`/`payload` per edge, `forbidden` entries with `why`, `final-learning-tail` gate - `smoke/agent-contract.sh` — zero-dep integrity check: 7 passports × canon fields, graph keys, orphan detection, every edge has `when`, every forbidden has `why`, all 4 tail outputs present **Steps 4–6 (session tail + postrun report + quality gate):** - `skills/agent-session-review/SKILL.md` (dual-write root + chezmoi) — 4 mandatory blocks: `brief_md / agent_trace / self_reflection / most_important`. Mandatory before the deliver gate fires (Karpathy method: synthesize on write) - `chezmoi/dot_agents/registry/scripts/athena-postrun-report.mjs` — adapted from `mnemazine-postrun-knowledge-report.mjs` (520 → ~120 lines, vault-specific logic removed). Input: `--results-json [{group_id, outcome, helps, next_action}]`. Output: `--format md|html|json`. Env: `ATHENA_REPORTS`, `ATHENA_RUN_ID` - `chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs` — 5 rules: `no-raw-ocr` / `no-local-paths` / `no-secrets` / `has-outcome` / `has-next-action`. Accepts `.html` and `.md`. Exit 0 = pass, 1 = fail - `smoke/agent-contract.sh` +4 checks: SKILL.md 4-block presence, synthetic postrun run, gate PASS on good report, gate FAIL on bad report (negative test) **Language policy:** - Setup-os step 0.1 asks communication language first; if Russian → inviolable rule written to owner profile - All artifacts (passports, spec, contracts, scripts) = English-first ### DoD status | Gate | Status | |---|---| | `smoke/smoke.sh` green | ✅ | | `shellcheck -S error` 0 | ✅ | | 7 passports + handoff graph integrity | ✅ | | session tail 4 blocks present | ✅ | | postrun report synthetic run | ✅ | | quality gate positive PASS | ✅ | | quality gate negative FAIL | ✅ | | 0 hardcoded paths | ✅ | ### Remaining (steps 7–10, next session) - `job-lifecycle.yaml` FSM + `claude-starter/project.yaml` template - eval-loop → router (`routing-evals.jsonl`), start matrix per-class - Parity smoke (same task through both Claude + Codex → compare route cards) - Dashboard as thin UI over verified local workflows ## Test plan - [ ] `bash smoke/smoke.sh` → `SMOKE OK` - [ ] `shellcheck -S error smoke/agent-contract.sh` → exit 0 - [ ] `node chezmoi/dot_agents/registry/scripts/athena-postrun-report.mjs --results-json <file> --run-id test` → produces `.md` in `ATHENA_REPORTS` - [ ] `node chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs --report <good.md>` → exit 0 - [ ] `node chezmoi/dot_agents/registry/scripts/athena-report-quality-gate.mjs --report <bad.md>` → exit 1 - [ ] `chezmoi apply --dry-run` on a clean machine — zero hardcoded `/Users/` paths 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.