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 @@

-

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:

+
+ + + + + + + Context + + Plan + + Implement + + + + VERIFY-HEAVY GATES — most compute is spent checking, not writing + + G1 · Build + + G2 · Tests + + G3 · Behaviour + + G4 · Feel + + G5 · Visual + + + all green ⇒ done · any fail ⇒ report + + Judge — honest verdict + + Reflexion · fix & retry ≤ 3 + +
A real in-game failure loops back to implement with the gate evidence (bounded to three tries); anything green — or skipped because no live instance is running — falls through to a single honest judge.
+
+

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.

What We Deleted

The commit removes 1,050 lines across 15 files:

+
+ + Net change: −750 lines, + a composable pipeline + Deleted + + supervisor/ — 1,050 lines · 15 files + Kept + + verify_build — ~300 lines · 1 oracle + +
The whole orchestration loop was deleted; only the build oracle survived — and it became the gate that powers the flow.
+

None 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.

The Bug That Took a Day to Find

@@ -267,13 +313,22 @@

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.

The Stack Today

-

| 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 |

+ + + + + + + + + + + + + + + +
LayerWhatHow
Flow enginepi-flows orchestratorComposes agents, gates and decision points
Gatesverify_build oracleCompiles, tests, returns PASS/FAIL with file:line errors
Sub-agentsG1 build · G2 tests · G3 behaviour · G4 feel · G5 visualRole-split, each with its own toolset
DecisionAgent-loop ReflexionSelf-reflect on failures, retry (≤3) or escalate
VisualizationFlowDashboardReal-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) -``` + +
+ + + + + + + Context + + Plan + + Implement + + + + VERIFY-HEAVY GATES — most compute is spent checking, not writing + + G1 · Build + + G2 · Tests + + G3 · Behaviour + + G4 · Feel + + G5 · Visual + + + all green ⇒ done · any fail ⇒ report + + Judge — honest verdict + + Reflexion · fix & retry ≤ 3 + +
A real in-game failure loops back to implement with the gate evidence (bounded to three tries); anything green — or skipped because no live instance is running — falls through to a single honest judge.
+
+ -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. +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. ## What We Deleted @@ -57,6 +91,21 @@ The commit removes 1,050 lines across 15 files: - `events.ts` (47 lines) — inter-process event bus - Plus tests, examples, and documentation + +
+ + Net change: −750 lines, + a composable pipeline + Deleted + + supervisor/ — 1,050 lines · 15 files + Kept + + verify_build — ~300 lines · 1 oracle + +
The whole orchestration loop was deleted; only the build oracle survived — and it became the gate that powers the flow.
+
+ + None 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. @@ -83,13 +132,24 @@ Verified live: `game-check` now routes `context → build → build-gate(pass) ## The Stack Today -| 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 | + + + + + + + + + + + + + + + + +
LayerWhatHow
Flow enginepi-flows orchestratorComposes agents, gates and decision points
Gatesverify_build oracleCompiles, tests, returns PASS/FAIL with file:line errors
Sub-agentsG1 build · G2 tests · G3 behaviour · G4 feel · G5 visualRole-split, each with its own toolset
DecisionAgent-loop ReflexionSelf-reflect on failures, retry (≤3) or escalate
VisualizationFlowDashboardReal-time pipeline state at localhost:33634
+ ---