Plan 3: Job & phase scaffold + KB foundation#1
Conversation
Adds the design document for Plan 3: a persistent job model (manifest, brief, phase log, lessons) with phase-tagged journal entries, slash commands for lifecycle and lesson capture, a two-layer knowledge base (universal + per-project), and a read-only dashboard Jobs panel. Foundation for Plans 4-8 (fleet, research/code/review phases, learning loop retrieval). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bite-sized tasks covering: job-lib.ps1 (state-file R/W, slug, project detect, manifest/phase-log/sequence, lesson taxonomy), 7 slash commands (job-start, status, list, phase, resume, lesson, consolidate-lessons), hook + OTel-parser extensions for phase tagging via current-job.json state file, dashboard journal parser + models extensions, jobs reader + router + templates + integration, bootstrap migration of model-routing.md into knowledge/universal/, full TDD loop per task with PS1 + pytest tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends PostToolUse hook to read ~/.claude/current-job.json (overridable via $env:CAO_STATE_PATH) and append trailing `| job:<id> | phase:<phase>` fields to journal lines when both values are present. Backward-compatible: missing/empty/corrupted state files leave the Plan 1 line format unchanged. Adds three Plan 3 tagging tests (no-state, active-job, corrupted-state). Also fixes a PowerShell scalar-vs-array indexing bug in the test helper (@() wrapper on Where-Object result) that caused false failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds lesson taxonomy ($script:LessonCategories) to job-lib.ps1 with Test-LessonCategory, Get-LessonDefaultScope, Get-LessonCategories, and Append-LessonToJob helpers. Adds /job-lesson slash command that appends to lessons.md and writes a `lesson` journal line. Tests verify all category/scope mappings and bogus-category rejection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reads CAO_STATE_PATH (or ~/.claude/current-job.json) once at startup and appends ' | job:<id> | phase:<phase>' to each api_request journal line when a valid state file is present; falls back silently to untagged output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Walk every job's lessons.md, route entries to KB files by category+scope, mark source lines consolidated. Idempotent (second run is a no-op). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends parse_journal_line to strip trailing job:/phase: pipe fields from any line type, threads them into HookEntry/OtelEntry/NoteEntry, and adds a new 'lesson' source dispatched to LessonEntry (stubbed until Task 13 adds the model). Five new tests appended (import of LessonEntry will fail until Task 13). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ummary,Detail} Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hase cost) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds FastAPI jobs router with constructor pattern (build_router), partial
/partials/jobs list endpoint, /jobs/{job_id} detail endpoint with 404
handling, and minimal stub templates sufficient for the 3 router tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds JOBS_ROOT module-level constant, wires app.state.jobs_root, includes build_jobs_router in the FastAPI app, and adds 3 integration tests verifying the jobs partial, detail page, and index card are all reachable via the main app. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… migrate routing.md
Extends scripts/bootstrap.ps1 with Steps 5b-5d:
- Step 5: foreach now includes all 7 Plan 3 commands (job-start/status/list/phase/resume/lesson, consolidate-lessons)
- Step 5b: deploys job-lib.ps1 + consolidate-lessons.ps1 to ~/.claude/scripts/
- Step 5c: creates ~/.claude/jobs/ and knowledge/universal/{topics}/+projects/ dirs; seeds 5 KB stub files
- Step 5d: migrates ~/.claude/model-routing.md into knowledge/universal/routing.md (idempotent via .migrated sentinel)
- Summary updated to Plan 3 scope with job/KB next-step hints
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e + drill-in auto-refresh - bootstrap.ps1 Step 6: skip legacy catalog seed when .migrated sentinel exists (prevents resurrection after Plan 1 → Plan 3 migration) - job-lib.ps1 Append-LessonToJob: add Mandatory $Scope param; write ts | cat | scope | "text" (new format) - consolidate-lessons.ps1: extend $lessonLineRe to capture optional scope field; prefer explicit scope over Get-LessonDefaultScope (backward-compat: old lines without scope field still work) - dashboard/readers/jobs.py _LESSON_LINE_RE: tolerate optional scope field between category and quoted text - commands/job-lesson.md: pass -Scope $scope to Append-LessonToJob - test-consolidate-lessons.ps1: update fake lessons.md to new format; assert universal override lands in universal/mistakes.md, not projects/<id>/mistakes.md - job_detail.html: add 30s auto-refresh via setTimeout(() => location.reload(), 30000) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures the 30-second picture, key data contracts (state file, journal format, KB layout), decisions and their rationale, what's deferred to Plans 4-8, known follow-ups, E2E verification recipe, and a starting hint for Plan 4 (fleet config + multi-machine local). Designed so any LLM or developer can pick up where this branch left off without rereading the full spec/plan.
Execution logFor the record of how this branch was built (relevant if you're auditing the process, not just the result): Process
What the final review caught
Five Minor issues were accepted as known-deferred: brief rendered as TDD disciplineEvery task followed red → green → commit:
This is reflected in the linear commit history — 19 implementation commits (one per plan task) + 1 quality-fix commit on Task 1 + 1 post-review-fix commit + 1 README commit + 1 handoff-doc commit = 21 commits total. Documentation chain (for cold pickup)
Plan 4 (fleet config + multi-machine Ollama) is the next slice and unblocks the actual multi-model dispatch in Plans 5-7. |
…t worker (#61) * docs(worker-adapter): Sprint 6 design spec + release-tag drift fix Spec for the GitHub Models worker adapter — a self-metering, budget-aware fleet worker that closes the dispatch->meter->forecast->route-around loop. Decisions d-wa-1..5. Also corrects the next-session release note (Sprint 5 shipped in stable v1.2.0; rc line closed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(worker-adapter): Sprint 6 implementation plan (5 TDD tasks) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat(worker): rate-limit parser + api-hit test (Sprint 6 Task 1) * feat(worker): adapter registry + report (Sprint 6 Task 2) * feat(worker): seamed Invoke-Worker + Get-WorkerStatus (Sprint 6 Task 3) * feat(worker): fleet-worker CLI + /baton:worker + github-models seed (Sprint 6 Task 4) * build(worker): deploy manifest + asserts + plugin 1.3.0-rc.1 (Sprint 6 Task 5) * fix(worker): bare 429 needs HTTP/rate context to signal a limit (review Minor #1) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…pus review d079) - Replace U+00B7 middle-dots with ASCII '|' in run-rate + by-model lines (honors the function's own ASCII-only console-encoding contract; would mojibake on a non-UTF-8 Windows console). Finding #1 (Important). - Classify 403 / 'not accessible' as insufficient-scope so the gh-auth hint fires for scope failures that return 403 not 404. Finding #2 (hardening). - New asserts: C3b (403 -> insufficient-scope), P1b (panel body ASCII-only) so both guarantees can't regress. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… + Grok tweaks Kevin approved the split after Codex draft + Grok adversarial review converged: the stakes->tier work is a real subsystem, not a defaults flip. Addendum records PR-A/PR-B scope, the 5 locked open-question answers (Codex+Grok consensus), and Grok's SHIP-WITH-TWEAKS punch-list for the implementer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…il-open' Under -AcceptanceFailLoud, a diff-provider throw and a no-verdict gate both degrade the run to acceptance-degraded and halt, but the event text still said '(fail-open)' at Level warn — a misleading ops narrative in exactly the case this node exists to make loud. Narrate 'acceptance-degraded — run halts' at Level error when fail-loud; keep '(fail-open)' + warn only on the advisory path. Narrative-only; terminal status unchanged. Grok review nit #1 (SHIP AS-IS). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ode #1, PR-A) (#99) * node #1: Codex-drafted design for /baton:go --execute defaults flip + roadmap currency - docs/superpowers/specs/2026-07-14-go-execute-defaults-flip-design.md: design proposal (Codex, fleet-farmed) for flipping --execute quality nodes opt-in -> opt-out, fail-loud on degraded gates, and depth-matched-to-stakes logged routing. DRAFT — pending Grok review + Kevin sign-off on 5 open questions. - docs/roadmap.md: post-v1.16.0 currency — mark Review Named Panel (node #2) SHIPPED, bump header. d086 spine now tracked as GitHub issues #89-#97 on Project #5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * node #1: split into PR-A (gates flip) + PR-B (stakes); lock 5 answers + Grok tweaks Kevin approved the split after Codex draft + Grok adversarial review converged: the stakes->tier work is a real subsystem, not a defaults flip. Addendum records PR-A/PR-B scope, the 5 locked open-question answers (Codex+Grok consensus), and Grok's SHIP-WITH-TWEAKS punch-list for the implementer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat(plan-gate): fail loud on degraded reviewer rosters * feat(gate): fail loud on unusable panel roles * feat(go): make execute governance default and fail loud * test(otel): isolate parser state fixture * fix(conductor): fail-loud acceptance events narrate the halt, not 'fail-open' Under -AcceptanceFailLoud, a diff-provider throw and a no-verdict gate both degrade the run to acceptance-degraded and halt, but the event text still said '(fail-open)' at Level warn — a misleading ops narrative in exactly the case this node exists to make loud. Narrate 'acceptance-degraded — run halts' at Level error when fail-loud; keep '(fail-open)' + warn only on the advisory path. Narrative-only; terminal status unchanged. Grok review nit #1 (SHIP AS-IS). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
, PR-B) (#100) * feat(go): add task stakes schema and override * wip(test): executor depth-tier tests (Codex partial, usage cap hit mid-build) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(go): route task depth by stakes and log policy * test+docs: PR-B review tweaks — depth_applied wording, positional-ABI proof, decisions.jsonl e2e, RequireVerify prose --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
Plan 3 of the coding-agent-orchestrator vision. Adds a persistent job lifecycle with phase tracking, lesson capture, a two-layer knowledge base, and a read-only Jobs panel on the Plan 2 dashboard. Foundation only — no multi-model dispatch yet (that's Plan 4+).
/job-start,/job-status,/job-list,/job-phase,/job-resume,/job-lesson,/consolidate-lessonsjob:+phase:when a job is active (backward-compatible — Plan 1/2 lines still parse and still emit untagged when no job is active)~/.claude/jobs/<id>/and~/.claude/knowledge/{universal,projects/<id>}/directory structuremodel-routing.mdmigrated intoknowledge/universal/routing.md/jobs/<id>with per-phase cost breakdownWhat this branch contains
scripts/job-lib.ps1(shared lib), newscripts/consolidate-lessons.ps1, extensions toscripts/hooks/log-tool-call.ps1,scripts/parse-otel.ps1,scripts/bootstrap.ps1.mdfiles undercommands/dashboard/readers/jobs.py,dashboard/routers/jobs.py, two new templates, extensions todashboard/readers/journal.py,dashboard/models/events.py,dashboard/main.py, CSS additionsArchitectural decisions (and why)
What's deliberately deferred
Known follow-ups (not blocking)
Test plan
Run all tests after merging:
```powershell
pwsh -NoProfile -File scripts/test-job-lib.ps1
pwsh -NoProfile -File scripts/test-jobs.ps1
pwsh -NoProfile -File scripts/test-hook.ps1
pwsh -NoProfile -File scripts/test-otel-parser.ps1
pwsh -NoProfile -File scripts/test-consolidate-lessons.ps1
python -m pytest dashboard/tests/ -v
```
All should be green (verified on the branch).
Manual smoke (from a Claude Code session in the repo):
Documents to read for context
Bootstrap migration note
Existing Plan 1/2 users: running `scripts/bootstrap.ps1` after this merges will migrate `
/.claude/model-routing.md` into `/.claude/knowledge/universal/routing.md` and leave a `.migrated` sentinel so re-runs are idempotent. The deploy of new slash commands + lib scripts is also idempotent. Safe to re-run.🤖 Generated with Claude Code