Skip to content

docs(examples): prune + clarify the example set for tip-top DX#368

Merged
drewstone merged 2 commits into
mainfrom
chore/examples-dx-overhaul
Jun 23, 2026
Merged

docs(examples): prune + clarify the example set for tip-top DX#368
drewstone merged 2 commits into
mainfrom
chore/examples-dx-overhaul

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Make examples/ tip-top for DX: land a developer here, let them read ONE short example, and feel the power. Three confirmed defects fixed, the missing centerpiece added, and the index rewritten as an ordered "use this when" path. All edits stay inside examples/.

DELETE

  • examples/coder-loop/ — its .ts was refactored off runLoop onto worktreeLoopRunner, and its README still taught the deleted coderProfile export, so it no longer demonstrated "the same runLoop kernel" it claimed. researcher-loop/ is now the primary runLoop teacher.

ADD — the centerpiece

  • examples/driver-loop/ — the one concept the request asked to SEE: a multi-round refine driver whose plan() reads the last worker's output from history and composes the next prompt from it ("the fold"), made visible with heavy plain-language comments. A second labeled section contrasts it with runMultishot so round vs shot sit side by side. Runs fully offline and is proven e2e:
    • ROUND 0: [reject] "Shipped one-click restore for failed deploys." (no "rollback")
    • driver folds the rejected output → ROUND 1: [PASS] "...with an instant rollback path..." → decision: pick-winner.
    • Caught + fixed + documented a real footgun while building it: a decide() that returns a terminal value (fail) before refining stops the loop early — the example now teaches the non-terminal refine decision.

IMPROVE — stale-API docs + teaching comments

  • mcp-delegation/README + fleet-delegation/README: replace the deleted delegate_code/delegate_research tools with the generic delegate verb + the MCP_ENABLE_DELEGATE=1 gate + the always-on delegate_feedback/delegation_status/delegation_history trio. (The .ts was already correct — only the READMEs lied.)
  • product-eval/README: teach runPersonaConversation (the facade evalPersona was deleted in 0.76.0 by chore(cleanup): delete dead eval-persona facade + orphaned topology module #367; the .ts already uses the canonical surface).
  • researcher-loop / ui-audit / self-improving-loop / supervisor-loop: inline-define round and shot the first time each appears and point at driver-loop/ as the example that actually shows the fold.
  • delegate: import from the @tangle-network/agent-runtime/loops subpath instead of a relative dist path; strip emoji from console output.

INDEX

  • examples/README.md rewritten as an ordered "use this when" path over tiers (cores → driver/supervisor → runLoop kernel → production runtime → self-improvement), with a vocabulary block up top, the missing driver-loop/supervise/delegate/intelligence-drop-in rows added, and coder-loop dropped.

Verification

  • pnpm build, pnpm run typecheck, pnpm run typecheck:examples, pnpm run lint (Biome) — all green.
  • pnpm run docs:check — freshness OK, no drift.
  • driver-loop and researcher-loop run offline; merges cleanly into origin/main.

🤖 Generated with Claude Code

Land a developer in examples/, let them read ONE short example, and feel
the power. Three confirmed defects fixed plus the centerpiece added.

- DELETE examples/coder-loop/: its .ts was refactored off runLoop to
  worktreeLoopRunner, and its README still taught the deleted coderProfile
  export, so it no longer demonstrated "the same runLoop kernel" it claimed.
  researcher-loop is now the primary runLoop teacher.

- ADD examples/driver-loop/: the centerpiece. A multi-round refine driver
  whose plan() READS the last worker's output from history and COMPOSES the
  next prompt FROM it — "the fold" every supervisor is built on, made visible
  with heavy plain-language comments. A second labeled section contrasts it
  with multishot so round vs shot sit side by side. Offline, e2e-proven
  (round 0 rejected -> driver folds -> round 1 passes via the corrected prompt).

- IMPROVE stale-API docs and teaching comments:
  - mcp-delegation/README + fleet-delegation/README: replace the deleted
    delegate_code/delegate_research tools with the generic delegate verb +
    the MCP_ENABLE_DELEGATE=1 gate + the always-on feedback/status/history trio.
  - product-eval/README: teach runPersonaConversation (evalPersona was deleted
    in 0.76.0); the .ts was already correct.
  - researcher-loop / ui-audit / self-improving-loop / supervisor-loop:
    inline-define round and shot the first time each appears, and point at
    driver-loop/ as the example that actually shows the fold.
  - delegate: import from the @tangle-network/agent-runtime/loops subpath
    instead of a relative dist path; strip emoji from console output.

- INDEX examples/README.md: rewrite as an ordered "use this when" path over
  tiers (cores -> driver/supervisor -> runLoop kernel -> production runtime ->
  self-improvement), add a vocabulary block, add the missing driver-loop /
  supervise / delegate / intelligence-drop-in rows, drop coder-loop.

All edits stay inside examples/; build + typecheck + typecheck:examples +
Biome lint are green, and driver-loop and researcher-loop run offline.
tangletools
tangletools previously approved these changes Jun 23, 2026

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 21608ef3

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-23T22:27:04Z

…orker exchange

shot = round = turn = one (driver prompts worker -> worker output -> driver) exchange;
'many shots' is the sequence where each output folds into the next prompt. Remove the
runMultishot 'parallel shots' section: runMultishot is a multi-turn conversation, not a
fanout, so it mislabeled the breadth axis. Point to researcher-loop for fanout instead.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 56b143c1

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-23T22:41:08Z

@drewstone drewstone merged commit cfacf1c into main Jun 23, 2026
1 check passed
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