Repository navigation
feat(programs): programs own their orchestrator flows and prompts - #1498
Draft
edwinyjlim wants to merge 2 commits into
Draft
edwinyjlim wants to merge 2 commits into
edwinyjlim wants to merge 2 commits into
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
4 of 6 tasks
The five orchestrator programs (posthog-integration, error-tracking, feature-flags, metrics, replay-vision) declare their task graph in `flow.ts` with `defineFlow` from the program contract, and keep their task prompts in `agent/<type>.md`. `pnpm bundle:agent-prompts` generates each program's `agent-prompts.ts`, which `ProgramConfig.agentPrompts` loads on first use. `resolveFlow` applies the run's project traits and flags, dropping a node whose `when` fails and splicing its edges into its dependents. The program runner hands the graph to the orchestrator as `RunConfig.taskGraph`, and the prompts as `RunConfig.agentPrompts`. With `wizard-agent-dag` on, the orchestrator loads the bundled prompts, falling back to context-mill's on any failure, and rewires the planner's queue to the typed graph through `QueueStore.replaceDependencies`. Off, it fetches the prompts as before. Either way it logs `orchestrator graph diff` and `orchestrator exclusions differ` where the typed graph and the planner disagree. The prompts match the recorded context-mill release byte for byte, and assemble the same seed and task prompts as the fetched ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edwinyjlim
changed the base branch from
dag/w1-skills-by-traits
to
dag/d1-framework-traits
October 29, 2026 22:52
edwinyjlim
force-pushed
the
dag/w2-program-flows
branch
from
October 29, 2026 22:52
8d5e5b6 to
e3c6869
Compare
This was referenced Oct 29, 2026
Each program's agent-prompts.ts imports its agent/<type>.md files as text instead of carrying a generated copy. tsdown's .md text loader inlines them in the build, a Vitest plugin loads them in tests, and pnpm try registers a Node load hook that does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The five orchestrator programs declare their task graph in code and carry their own task prompts. With
wizard-agent-dagon, the orchestrator runs on them. Off, it fetches prompts from context-mill and follows the planner, as today. Either way, each run logs where the typed graph and the planner disagree.Stack
The four PRs, in merge order:
wizard-agent-dagflag that decides which pick installs.main. Reads C1's tags but works without them. D1 builds on its traits service, and W2 on its traits and flag.wizard-agent-dagon, runs use them instead of the fetched prompts and the planner's graph.W1, D1 and W2 merge in that order and ship together in one wizard release, with
wizard-agent-dagoff. A later PR, W3, removes the flag and the paths it replaced after a week at 100%.How a run uses them
flowchart TD flow["flow.ts<br/>nodes, dependsOn, when"] --> resolve["resolveFlow<br/>with the run's traits and flags"] resolve -->|RunConfig.taskGraph| orch prompts["agent/*.md<br/>imported as text"] -->|RunConfig.agentPrompts| orch orch["Orchestrator run"] --> flag{"wizard-agent-dag"} flag -- off --> off["Prompts fetched from context-mill<br/>Queue as the planner builds it"] flag -- on --> on["Bundled prompts, fetched if loading fails<br/>Queue rewired to the typed graph"] off & on -.-> events(["orchestrator graph diff<br/>orchestrator exclusions differ"])wizard-agent-dagoffwizard-agent-dagonexcludedTaskTypesresolveFlowdroppedExample: posthog-integration
ai-observabilityruns unlesswizard-default-aio-logsisfalseor thecallsLlmApitrait isno.logsruns unless that flag isfalse.warehouse(dotted) is queued only when the wizard finds data sources.The five flows
Each program has one prompt per task plus its planner's, 41 in all, in
src/programs/<id>/agent/<type>.md. Itsagent-prompts.tsimports them as text, andProgramConfig.agentPromptsloads it on first use. The build inlines the files with tsdown's.mdloader, tests load them through a Vitest plugin, andpnpm trythrough a Node load hook (scripts/markdown-loader.no-jest.mjs). Context-mill'sintegration-v2flow lands inposthog-integration/agent/. In error tracking,verifyruns after every task that edits code exceptwire-ci, and the report waits for it.Telemetry
orchestrator graph difforchestrator exclusions differorchestrator agent prompts loadedsourceisbundle, orfallbackwhen the prompts came from context-millTest plan
pnpm typecheck,pnpm lint(no errors, no new warnings in new files)pnpm test: 263 files, 3,878 testsexcludedTaskTypesfor every AIO/Logs flag value, and the integration graph matches its planner prompt.mdfiles, for all five programssrc/programs/*/agent/src/programs/*/agent/*.mdin CI. Context-mill's scan triages matches with an LLM through the gateway, which needs CI secrets in this repo. It is needed before prompts are edited here.🤖 Generated with Claude Code