Skip to content

feat: add aot, the flow that writes a flow - #8

Open
DongyunZou wants to merge 3 commits into
mainfrom
feat/aot
Open

feat: add aot, the flow that writes a flow#8
DongyunZou wants to merge 3 commits into
mainfrom
feat/aot

Conversation

@DongyunZou

@DongyunZou DongyunZou commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

A description in, a checked and proved flow out.

What this is

official/aot compiles a natural-language description into a flow that lands in the flows of your own. The writer draws a spec from the description against a briefing of what the installed humanize serves — an ask nothing serves is refused at compile time, with the person at the prompt asked whether to narrow. The draft is then held to three gates, with every refusal handed back to the writer's own session word for word for repair:

  1. The static checker (hmz.flows.checked) reads it without running it.
  2. The stub-driven proof (hmz.flows.proved) drives it in a subprocess held to a clock, against the reviewer that never says done, the reviewer that always does, and the world where every turn fails.
  3. A critic that shares nothing with the writer reads it fresh against the spec.

One rule is the compiler's own: a generated loop is bounded, always — the checker's unbounded-loop warning is a refusal here whatever strict says, so what lands ends even when its reviewer never says the work is done. What passes is copied whole and atomically; a name already taken is never written over.

Requirements

Needs an hmz with checking, proving and the capability catalogue (humanfia/humanize2#29): checked, proved, briefed, catalogue, Scenario, MINE and friends handed through hmz.flows.

Tests

  • tests/test_aot.py — deterministic, stub-driven, every gate shown to gate; the compiler passes its own gates (checked(flows/aot) == ()).
  • tests/test_aot_golden.py — agent-gated (AOT_WRITER=cli/model:effort, AOT_SMOKE=1): compiles flame-chase from one line and gen-idea / gen-plan / rlcr from their descriptions, asserting structural equivalence — loads, drives as described, reads clean, ends under never-done — and drives the compiled review loop once on a toy repository.

Ran green end to end with claude/claude-sonnet-5:medium (all five, the smoke included — the compiled review loop built hello.txt on a toy repo and its reviewer verified it byte-for-byte before saying done) and with codex/gpt-5.6-sol:medium (whose critic caught and had repaired a real alternation bug before approving).

🤖 Generated with Claude Code

DongyunZou and others added 2 commits August 28, 2026 23:26
A description in, a checked and proved flow out. The writer reads the
description against a briefing of what the installed humanize serves and
answers with a spec -- places, settings, endings, needs -- and a need
nothing serves is refused at compile time, with the person asked whether
to narrow. Then the writer writes the flow in a scratch directory, and
three gates hold it: the static checker, the stub-driven proof against
the reviewer that never says done, and a critic that shares nothing with
the writer. Refusals go back to the writer's own session word for word,
for as many repairs as the config allows.

One rule is the compiler's own: a generated loop is bounded, always --
the checker's unbounded-loop warning is a refusal here whatever strict
says. What passes lands whole and atomically in the flows of your own,
and the compile ends with a report and the line that runs it.

Every shaped answer's model declares every field required: a backend
that holds a model to a strict schema refuses defaults, and the compiler
compiles on any backend that shapes. The writing-flows skill is the
contract the drafts are held to, and the stub tests drive every gate --
including that the compiler passes its own.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Agent-gated golden compiles -- AOT_WRITER=cli/model:effort runs them,
and AOT_SMOKE=1 besides drives the compiled review loop once on a toy
repository. What is asserted is structural equivalence with the flow
each description describes, never text: it loads, drives as many agents
as the description says, can be set up, reads clean, and ends under the
reviewer that never says done. The flow's own skills are mounted the
way a real run mounts them.

Ran green with claude/claude-sonnet-5:medium (all five, the smoke
included) and with codex/gpt-5.6-sol:medium.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sked

An unserved need is more often the description's words taken for a
capability -- writing a file, reading the repository -- than a real
hole, and a headless compile was stopping on one where the writer could
have restated the spec in the catalogue's vocabulary. Now it is handed
back to the writer once; only what is still unserved after that reaches
the person, or ends the compile where nobody is.

Found in the wild: a compile of the gen-plan description declared
'plan file' as a need and aborted where a restatement lands it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DongyunZou
DongyunZou marked this pull request as ready for review August 29, 2026 03:43
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.

1 participant