diff --git a/build.js b/build.js index 622d649..4c249be 100644 --- a/build.js +++ b/build.js @@ -51,6 +51,7 @@ function md(src) { let inCode = false; let codeLang = ""; let codeLines = []; + let inRaw = false; function closeUl() { if (inUl) { html += "\n"; inUl = false; } @@ -59,6 +60,13 @@ function md(src) { for (let i = 0; i < lines.length; i++) { const line = lines[i]; + // Raw HTML passthrough — everything between and + // is emitted verbatim (no escaping, no
wrap). For inline SVG diagrams, + // tables, or any hand-authored markup the minimal converter can't express. + if (line.trim() === "") { closeUl(); inRaw = true; continue; } + if (line.trim() === "") { inRaw = false; continue; } + if (inRaw) { html += line + "\n"; continue; } + // Fenced code blocks if (line.startsWith("```")) { if (!inCode) { diff --git a/pi-flow-native-brain.html b/pi-flow-native-brain.html index 5ef0566..c48b256 100644 --- a/pi-flow-native-brain.html +++ b/pi-flow-native-brain.html @@ -236,12 +236,46 @@
verify_build tool (.pi/extensions/tinqs-verify.ts) is the canonical gate. It compiles the game and sim, runs tests, and returns a structured PASS/FAIL verdict with file:line errors. Agents route through it; the gate decides whether to proceed.The result is a pipeline that flows naturally:
-context → build → build-gate → (pass? → tests → tests-gate → vision)
- ↘ (fail? → report)
-Critically, the flow is not fixed. Agents can add gates, reorder steps, or branch on conditions. The flow engine handles orchestration; the agents handle decisions.
+The result is a pipeline that flows naturally — a plan, an implementation, then a ladder of oracle-backed gates:
+It started as three gates — build, test, vision. Gates are cheap to add, so it grew: a feature now also passes a live-game behaviour probe and a measured feel check before the judge signs off. Critically, the flow is not fixed. Agents can add gates, reorder steps, or branch on conditions. The flow engine handles orchestration; the agents handle decisions.
The commit removes 1,050 lines across 15 files:
events.ts (47 lines) — inter-process event busNone of this was bad code. It was just the wrong layer. Flows gives us all of this — orchestration, state, gates, retry policy, event routing — as a framework primitive. We were maintaining a parallel implementation of something the framework already provided.
The durable asset we kept: verify_build, the build oracle. It's now reused as the gate tool that powers the flow pipeline.
Observability. FlowDashboard visualizes the entire pipeline. You can see which gates passed, which failed, and where the agent decided to retry. The old supervisor logged to stdout.
Self-modification. Agents can read the flow graph, understand where they are in the pipeline, and decide what to do next. The supervisor's decision tree was opaque to the agents it was supervising. Flows makes the pipeline itself part of the agent's context.
| Layer | What | How |
-|——-|——|—–|
-| Flow engine | pi-flows orchestrator | Composes agents, gates, and decision points |
-| Gates | verify_build oracle | Compiles, tests, returns PASS/FAIL with errors |
-| Sub-agents | G1 (build), G2 (test), G3 (vision) | Role-split, each with its own toolset |
-| Decision | Agent-loop Reflexion | Self-reflect on failures, retry or escalate |
-| Visualization | FlowDashboard | Real-time pipeline state |
+| Layer | +What | +How | +
|---|---|---|
| Flow engine | pi-flows orchestrator | Composes agents, gates and decision points |
| Gates | verify_build oracle | Compiles, tests, returns PASS/FAIL with file:line errors |
| Sub-agents | G1 build · G2 tests · G3 behaviour · G4 feel · G5 visual | Role-split, each with its own toolset |
| Decision | Agent-loop Reflexion | Self-reflect on failures, retry (≤3) or escalate |
| Visualization | FlowDashboard | Real-time pipeline state at localhost:33634 |
The old supervisor was 1,050 lines of code that did one thing well: verify that agent output compiled and passed tests. The new flow-native brain does the same thing with less code, more flexibility, and a bug we'll never hit again. Sometimes the best commit is a deletion.
The flow-native brain runs on our Pi fork inside Tinqs Studio. The verify_build extension is ~300 lines of TypeScript, MIT licensed, and reusable in any Pi project.
diff --git a/posts/pi-flow-native-brain.md b/posts/pi-flow-native-brain.md index a2fd7e0..aada3f6 100644 --- a/posts/pi-flow-native-brain.md +++ b/posts/pi-flow-native-brain.md @@ -33,16 +33,50 @@ The core pieces: - **Oracle-backed gates.** The `verify_build` tool (`.pi/extensions/tinqs-verify.ts`) is the canonical gate. It compiles the game and sim, runs tests, and returns a structured PASS/FAIL verdict with file:line errors. Agents route through it; the gate decides whether to proceed. - **Agent-loop-decision Reflexion.** Instead of a fixed two-phase TDAID loop, agents self-reflect on build failures. The flow engine gives them the failure report; they decide whether to fix and retry or escalate. -- **Role-split agents.** Build-verifier (G1), test-runner (G2), and vision-QA (G3) are separate sub-agents, each with their own toolset and context, composed by the flow. +- **Role-split agents.** G1 build, G2 tests, G3 behaviour (drives the live game), G4 feel (measured game-feel) and G5 visual (animation) are separate sub-agents, each with its own toolset and context, composed by the flow. -The result is a pipeline that flows naturally: +The result is a pipeline that flows naturally — a plan, an implementation, then a ladder of oracle-backed gates: -``` -context → build → build-gate → (pass? → tests → tests-gate → vision) - ↘ (fail? → report) -``` + +| Layer | +What | +How | +
|---|---|---|
| Flow engine | pi-flows orchestrator | Composes agents, gates and decision points |
| Gates | verify_build oracle | Compiles, tests, returns PASS/FAIL with file:line errors |
| Sub-agents | G1 build · G2 tests · G3 behaviour · G4 feel · G5 visual | Role-split, each with its own toolset |
| Decision | Agent-loop Reflexion | Self-reflect on failures, retry (≤3) or escalate |
| Visualization | FlowDashboard | Real-time pipeline state at localhost:33634 |