Orchestrator modernization — Phases 1, 2, 4 #1
No reviewers
Labels
No labels
app
bug
ci
compliance
content
dependencies
docs
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
infra
invalid
javascript
needs-triage
python
question
tests
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: adam/orchestrator#1
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "phase-1-stabilize-foundations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Executes Phases 1, 2, and 4 of the orchestrator modernization assessment (
~/Desktop/orchestrator-modernization-assessment.md). Phase 3 deferred per assessment ("only build if drift pain shows up"); Phase 5+ deferred pending a week of telemetry data.366d724): centralized model IDs asmodels.pyconstants, collapsed six near-identical agent nodes into a singleAGENTSregistry +make_agent_nodefactory, replaced the silentroute = "researcher"fallback with Pydantic structured output (RouteDecision) and an explicitunknownroute, wrapped every LLM invoke inwith_retries(), and added a 20-case pytest golden-set for routing regressions. Killed the four-copy prompt drift surface (graph.py/run.py --route-only/ agent prompts / handbook descriptions) by generating the router prompt fromAGENTS.ac7101f): newretriever.pyembeds~/.claude/projects/-Users-adammoussa-Documents-repositories/memory/*.md(skippingMEMORY.mdindex) withtext-embedding-3-small, caches vectors to.cache/embeddings.jsonkeyed on file mtime so only changed memories re-embed. Wiredretriever_nodeasSTART → retriever → router; top-3 memories injected into the router + downstream agent system prompts.[retrieved: name1, name2, name3]printed before route/result for visibility. Retrieval is read-only and failure-tolerant — if it errors the run continues with empty memory context.f05a98d): every full run appends one JSON line to~/.claude/logs/orchestrator/YYYY-MM-DD.jsonl(timestamp, sha256-prefix task hash, retrieved names, route, runtime, tokens in/out, success/error;risk_classandconfidencereserved as nulls for Phase 5). Telemetry failures are swallowed — never kills a run.scripts/weekly_summary.pyprints a markdown digest of the last 7 days (route distribution, unknown rate, cross-review rate, success rate, total spend, mean tokens per route); intended for/scheduleto pipe into Slack.67180e1): README updated for the new architecture (retriever node, structured router, AGENTS registry, golden-set test).Architectural intent (preserved)
Test plan
ruff check .cleanruff format --check .clean (12 files)pytest tests/test_routing_golden.py -v— 21/21 pass, run twice (Phase 2 and Phase 4 validation)researcher) writes a complete JSONL record with 928 tokens in / 109 tokens out captured fromusage_metadatadone) writes a record withtokens_in/out=0(router-only, expected — structured output doesn't surface usage)python3 scripts/weekly_summary.pyproduces a clean markdown digest from the live log--route-onlysmoke for a memory-relevant task surfaces plausible memories (project_exec_aide,feedback_exec_aide_vip_management,project_seahaven_slack_botfor a Slack deploy task).cache/embeddings.json(2.6 MB, 87 entries) reused without re-embeddingKnown limitations / deferred
with_structured_outputcalls aren't captured (Pydantic return path doesn't surfaceusage_metadatathrough the message trail). Documented in commit message; revisit in Phase 5.scripts/weekly_summary.pyare rough — intended for spotting runaway prompts, not finance.claude-sonnet-4-20250514EOL 2026-06-15. Centralized atmodels.CLAUDE_SONNET— one-line bump when ready (out of scope for this PR).Rollback
Each phase is independently reversible:
f05a98d(deletes telemetry, restores plainapp.invoke).ac7101f(deletes retriever, restoresSTART → router).366d724(restores free-text router + six agent functions).Next
Recommended: run on real workload for ~1 week, then revisit Phase 5 (risk class) using telemetry to decide.