Skip to content

feat: example 10 - AI judges state, the graph schedules (simulated detectors, real model calls) - #8

Merged
bigboateng merged 1 commit into
feat/example-09from
feat/example-10
Jun 15, 2026
Merged

feat: example 10 - AI judges state, the graph schedules (simulated detectors, real model calls)#8
bigboateng merged 1 commit into
feat/example-09from
feat/example-10

Conversation

@bigboateng

Copy link
Copy Markdown
Contributor

What

The AI version of example 09. Example 09 proved the scheduler deterministically (state given as data). This fills that state with a real model, and changes nothing else.

  • Each task carries a plain-language done_when + evidence simulated from detectors (GitHub / deploys / filesystem). The detectors are simulated; the AI judgment is real.
  • The assess stage (the seam example 09 reserved) is now a model-call transform: it reads each task's evidence and returns {status, value, cost, confidence, reason}. The example-09 scheduler below it is unchanged.
  • One deliberately ambiguous task (storage-adapter: code on an unmerged PR) so the model has to judge, not keyword-match.

How

  • Model adapter (model.py) mirrors how intelligence-flow runs terminal-bench calls: LiteLLM model-string routing, so the provider is one env var (MODEL). The LLM client lives in the example, never in core (capability gap math: expose error sensitivity signal #1, done right).
  • Offline by default: a deterministic stub stands in for the model, so it runs with no key and yields a stable expected-output.txt.
  • Live: MODEL=vertex_ai/minimaxai/minimax-m2-maas (Vertex MaaS, ADC) for the author, or openrouter/ / openai/ / gemini/ for anyone else.

The point (Takeaways)

The README closes with what this way of working buys you vs how the same feature usually gets built: prove the graph deterministically, then add AI at a clean seam. A committed sample-live-output.txt (real MiniMax run) shows it: the model judged the unmerged-PR task as not-done, and its value/cost estimates shifted the critical path (10 -> 21) and the top unblock (storage-adapter -> auth) vs the stub. Same engine, different inputs, different schedule.

Verify

python3 python/examples/10-best-time-to-implement-ai/main.py   # offline stub, self-check PASS

Self-check asserts invariants that hold for ANY assessment, plus the exact stub values; a live run stays structurally validated even though its numbers vary.

Note

Stacked on #7 (base feat/example-09) because it adds a pointer to example 09's README; retargets to main once #7 merges. Python first; TypeScript parity deferred.

🤖 Generated with Claude Code

…Vertex MaaS)

The AI version of example 09: each task carries a done_when + simulated detector
evidence; the assess stage is now a real model-call transform (LiteLLM model-string
routing) that judges {status, value, cost}, and the example-09 scheduler consumes it
unchanged. Offline deterministic stub (expected-output.txt) + live via MODEL (Vertex
MaaS / OpenRouter / OpenAI / Gemini); the LLM adapter lives in the example, not core.
Includes a real MiniMax sample run, a Takeaways section, and a pointer from example 09.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bigboateng
bigboateng merged commit d665a59 into feat/example-09 Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants