Skip to content

docs: resolve imports when checking examples, and mark the aspirational ones - #548

Merged
godofecht merged 2 commits into
mainfrom
docs/vision-aspirational-blocks
Aug 18, 2026
Merged

godofecht merged 2 commits into
mainfrom
docs/vision-aspirational-blocks

Conversation

@godofecht

@godofecht godofecht commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Two commits, separable on review.

1. The checker was wrong about imports

check_doc_examples.py called parse_flow_code directly, so an example that imported a module was type-checked with none of that module's symbols in scope. All fourteen programs in lib/stdlib/audio/README.md failed with Undefined function 'bass':

import "stdlib/audio/livecode.flow"

function main() -> i32 {
    let sound: f32 = bass(note_C(3))  # That's it!
    return 0
}

bass, clock_house, clock_medium, euclidean_pattern and progression_pop all exist. The documentation was right and the tool was wrong.

This is the same class of mistake as bypassing the DSL expanders, which the earlier work already fixed. Reporting correct documentation as broken is worse than missing a real failure, because it pushes an author to rewrite something that already works.

Blocks with imports now go through module_resolver.resolve_modules, the entry point the transpiler uses. About 47ms each and only for importing blocks, so the run stays near seven seconds.

The vacuity and no-op checks deliberately stay on the block's own declarations. The resolved unit carries every imported declaration, and counting those would let a bare import line make an empty block look substantial.

Recovered 15 examples that were correct all along. The audio README now fails with real diagnostics instead: wrong argument types for pattern_4 and euclidean_pattern, and an undeclared clock. Those are genuine doc bugs, and the ratchet grandfathers them for a later pass.

Verified 392 → 407. Unverified 315 → 300.

2. 44 blocks that were never meant to compile

Each now carries a written reason instead of sitting in the ledger as anonymous debt.

VISION.md is a vision document, and all 30 of its Flow blocks describe syntax the language does not have. The reasons distinguish what actually blocks each one:

Reason Blocks
proposed syntax, not implemented represent koopman, analyze, control, guarantee, deploy, task, numeric, every tick, when x > y, RingBuffer<N>
proposed dimensioned flow members state angle : Angle, input voltage : Voltage, … (flow state is f32/f64 today)
fragment of a flow body shown on its own angle evolves as velocity, counter becomes counter + 1, always { … }
proposed temporal syntax continuous / every 1 ms / after 50 us, after disturbance / within 200 ms
illustrates a units mismatch length + voltage, which sits directly under the line "This fails to compile:"

docs/language/syntax.md is a grammar reference, and its 14 failing blocks are notation: a catalogue of literal forms, declaration templates with metasyntactic Type and ReturnType, control-flow shapes with elided bodies, pipe desugaring shown as equivalences (x |> f # f(x)), field and index notation. Names like n, point, signal and Stats are undefined on purpose, because the page teaches shapes. Forcing them into compilable programs would bury what each one shows.

I read every block individually rather than tagging by file, and the reasons are specific enough that a later reader can tell which are waiting on the language and which are notation that will never compile.

Where that leaves the count

examples 751   verified 407   ignored 44   unverified 300

The remaining 300 are real: wrong types, undeclared names, statements without a main, and a handful of compiler backend bugs. The ratchet holds them so they can come down page by page.

Validation

  • Unit suite 1496 passed, 2 skipped
  • --check-ledger clean, ledger refreshed
  • ruff check src clean

godofecht and others added 2 commits August 18, 2026 11:48
The checker called parse_flow_code directly, so an example that imported a
module was type-checked with none of that module's symbols in scope. Every
one of lib/stdlib/audio/README.md's fourteen programs failed with
"Undefined function 'bass'", and bass, clock_house, clock_medium,
euclidean_pattern and progression_pop all exist. The documentation was
right; the tool was wrong.

This is the same class of mistake as bypassing the DSL expanders: reporting
correct documentation as broken pushes an author to rewrite something that
already works, which is worse than missing a real failure.

Blocks with imports now go through module_resolver.resolve_modules, the same
entry point the transpiler uses. Costs about 47ms each and only for blocks
that import, so the whole run stays near seven seconds.

The vacuity and no-op checks stay on the block's own declarations. The
resolved unit carries every imported declaration too, and counting those
would let a bare `import` line make an empty block look substantial.

Recovered 15 examples that were correct all along, and the audio README now
fails with real diagnostics instead: wrong argument types for pattern_4 and
euclidean_pattern, and an undeclared `clock`. Those are genuine doc bugs.

Verified 392 to 407; unverified 315 to 300.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
44 blocks that cannot compile because they were never meant to, each now
carrying a written reason rather than sitting in the ledger as anonymous
debt.

VISION.md is a vision document, and all 30 of its Flow blocks describe
syntax the language does not have yet. The reasons distinguish what is
actually blocking each one: proposed vocabulary that is not implemented
(represent koopman, analyze, control, guarantee, deploy, task, numeric,
every tick, when x > y, RingBuffer<N>), dimensioned flow members where
flow state is f32/f64 today, fragments of a flow body shown on their own,
and proposed temporal syntax. One block sits under the line "This fails to
compile" and illustrates a units mismatch.

docs/language/syntax.md is a grammar reference, and its 14 failing blocks
are notation: a catalogue of literal forms, declaration templates with
metasyntactic Type and ReturnType, control-flow shapes with elided bodies,
pipe desugaring shown as equivalences, field and index notation. Names like
n, point, signal and Stats are undefined on purpose, because the page is
teaching shapes. Forcing them into compilable programs would bury what each
one is showing.

I checked every block individually rather than tagging by file. The reasons
are specific so a later reader can tell which are waiting on the language
and which are notation that will never compile.

Unverified 300 to 256 by count of untagged blocks; ignored 0 to 44.

Unit 1496 passed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@godofecht
godofecht merged commit 2bce179 into main Aug 18, 2026
21 checks passed
@godofecht
godofecht deleted the docs/vision-aspirational-blocks branch August 18, 2026 11:01
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