Skip to content

docs(examples): coder-loop + researcher-loop + mcp-delegation + fleet-delegation#51

Merged
tangletools merged 1 commit into
mainfrom
docs/loop-examples
May 24, 2026
Merged

docs(examples): coder-loop + researcher-loop + mcp-delegation + fleet-delegation#51
tangletools merged 1 commit into
mainfrom
docs/loop-examples

Conversation

@tangletools
Copy link
Copy Markdown
Contributor

Summary

Add four runnable examples covering the driven-loop kernel (0.19+), the
canonical profile presets, the MCP delegation server, and fleet vs sibling
placement. Existing examples covered basic primitives but nothing post-0.18.

  • coder-loop/ — `coderProfile` + `runLoop` + `FanoutVote`; two
    parallel coder iterations through a synthetic sandbox client; validator
    scores test + typecheck + diff cap; kernel picks the winner.
  • researcher-loop/ — same shape via `researcherProfile` from
    `@tangle-network/agent-knowledge/profiles`; second iteration leaks into
    a foreign namespace and the validator hard-fails it.
  • mcp-delegation/ — the literal `AgentProfile.mcp` entry a product
    passes to `sandboxClient.create`, plus a stdio JSON-RPC smoke that
    spawns the locally-built `agent-runtime-mcp` bin and asserts the five
    canonical tools surface (`delegate_code`, `delegate_research`,
    `delegate_feedback`, `delegation_status`, `delegation_history`).
  • fleet-delegation/ — `TANGLE_FLEET_ID` env flip; runs both
    `createSiblingSandboxExecutor` and `createFleetWorkspaceExecutor`
    against structural stubs; ASCII topology diagram.

`examples/README.md` gains a "Trace derivation" section with the diagram
showing how `loop.iteration.ended` events flow into `RuntimeRunHandle`,
the ingestion ndjson, analyst loops, and the production-loop CI gate.
Top-level README adds the four entries to the example list.

Bumps `DEFAULT_SERVER_VERSION` in `src/mcp/server.ts` to match the
package version so the `initialize` smoke reflects the actual build.

Version bump: 0.21.0 → 0.21.1 (examples + docs + minor server-version sync).

Test plan

  • `pnpm typecheck` — clean
  • `pnpm test` — 24 files / 235 tests pass (unchanged)
  • `pnpm exec biome check src tests examples` — clean
  • `pnpm build` — clean
  • `pnpm tsx examples/coder-loop/coder-loop.ts` — winner picked, valid=true, score=0.996
  • `pnpm tsx examples/researcher-loop/researcher-loop.ts` — winner picked, valid=true, score=0.700
  • `pnpm tsx examples/mcp-delegation/mcp-delegation.ts` — server: agent-runtime-mcp@0.21.1; all 5 tools listed
  • `pnpm tsx examples/fleet-delegation/fleet-delegation.ts` — three round-robin dispatches across worker-a/b/c

…-delegation

Add four runnable examples covering the driven-loop kernel, the canonical
profile presets, the MCP delegation server, and fleet vs sibling placement.

- examples/coder-loop — `coderProfile` + `runLoop` + `FanoutVote`; two
  parallel coder iterations through a synthetic sandbox client; the
  validator scores test + typecheck + diff cap; kernel picks the winner.
- examples/researcher-loop — same shape via `researcherProfile` from
  `@tangle-network/agent-knowledge/profiles`; the second iteration leaks
  into a foreign namespace and the validator hard-fails it.
- examples/mcp-delegation — the literal `AgentProfile.mcp` entry a product
  passes to `sandboxClient.create`, plus a stdio JSON-RPC smoke that spawns
  the locally-built `agent-runtime-mcp` bin and asserts the five canonical
  tools surface (`delegate_code`, `delegate_research`, `delegate_feedback`,
  `delegation_status`, `delegation_history`).
- examples/fleet-delegation — `TANGLE_FLEET_ID` env flip; runs both
  `createSiblingSandboxExecutor` and `createFleetWorkspaceExecutor`
  against structural stubs; ASCII topology diagram.

examples/README.md grows a "Trace derivation" section with the diagram
showing how `loop.iteration.ended` events flow into `RuntimeRunHandle`,
the ingestion ndjson, analyst loops, and the production-loop CI gate.

Top-level README adds the four entries to the example list.

Bump server version constant in `src/mcp/server.ts` to match the package
version so the `initialize` smoke reflects the actual build.

0.21.1 — examples + docs + minor server-version sync. No production API
changes.
@tangletools tangletools merged commit 8654e33 into main May 24, 2026
1 check passed
@tangletools tangletools deleted the docs/loop-examples branch May 24, 2026 22:00
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