Skip to content

web+docs: a complete, verified, AI-readable documentation platform - #14

Merged
MotherOfProgrammers merged 3 commits into
Project-Lithon:masterfrom
Tenuka22:feature/docs-overhaul-and-site-hardening
Oct 21, 2026
Merged

MotherOfProgrammers merged 3 commits into
Project-Lithon:masterfrom
Tenuka22:feature/docs-overhaul-and-site-hardening

Conversation

@Tenuka22

@Tenuka22 Tenuka22 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

The documentation was half-backed and the website was missing the things a reader actually comes for. This PR brings both up to the engine's actual state, and adds the missing pages, the changelog, and the AI-facing surfaces.

New documentation pages (5) — each written from the implementation, not from the old prose:

Page What it covers
/docs/strings The bounded str[N] model: layout, the three methods (find, count, split), printing, pointers, and what strings cannot do
/docs/match The enum dispatch statement: the four arm forms, the exhaustiveness rule, binding rules, the subject rules, and every refused shape
/docs/exceptions try/except/else/finally over the closed set of seven engine traps, nesting, and the trap boundary
/docs/networking A real TCP loopback from raw syscalls, checked against a C oracle, and the byte-order obligation
/docs/python-divergences The eleven places Lithon deliberately differs from CPython, each with the reason

New site sections (2)

  • /changelog — every shipped change, grouped by area, each entry linking to the documentation that covers it and to the commit.
  • /next — the open items, item by item: the language gaps, the engine work, the toolchain debt, and the recently shipped list.

Docs index, rebuilt

  • An explicit reading path: the 20 pages marked essential, in order, each stating the outcome you get from it.
  • Every page carries a priority, so a reference lookup is never mistaken for reading material.
  • Six new block kinds — callout, tabs, comparison, deflist, layout, quote — so the same concept can be shown several ways side by side.

Facts corrected against the implementation

  • float[32] does not exist. It was advertised in the start page and the roadmap language page; it is now correctly documented as rejected (LITHON-E0105).
  • A syscall argument may be a pointer, and it is a real host address in both tiers. The docs claimed pointers were rejected at compile time; the shipped TCP loopback depends on the opposite.
  • len(xs) is the live length carried in a companion slot, not the capacity.
  • **, //, <= and >= are refused outright, not "limited" or "not yet implemented".
  • 55 IR opcodes, all emitted — not "26 of 27, Phi unemitted". The direct-Phi path ships.
  • The benchmark and suite numbers now match benchmarks/results/latest.json (168.0×, 33/33 CTest, 46/46 typed, 18,379 encoder cases).
  • The trap text is error: division by zero, not a LITHON-E code.
  • The stale NotImplementedError: prefixes in the documented diagnostics are now the real LITHON-Ennnn: messages.

Encoding

314 runs of Windows-1252 mojibake repaired across the site, some of them double-encoded — including a stray , that rendered as , · not started on the roadmap. scripts/fix-encoding.ts is now a permanent guard, and it runs to zero.

AI-friendly

  • llms.txt and llms-full.txt (144 KB of plain text), generated from the same registry the site renders.
  • JSON-LD on every route, not just the docs pages.
  • Body-text search, so an error code (E0301) or an operator (wrap_add) is findable — the palette previously suggested queries the engine could not answer.
  • <lastmod> in the sitemap.

Also

  • The "a small Lithon program" example now opens on its Execution tab rather than Source.
  • The browser IR model no longer silently treats an unknown opcode as a no-op, and float registers and slots are scoped per frame (recursion no longer leaks float-ness).
  • The playground falls back to the recorded IR in production instead of failing, and its SEO no longer advertises a live compiler that only exists in vite dev.
  • The CI status footer caches for five minutes and only tracks master — the unauthenticated GitHub API allows 60 requests/hour/IP, and the footer was on every page.
  • CI now runs verify-docs, the IR freshness check, typecheck and lint.
  • The toolchain scripts work on every platform; the uv path was hard-coded to a Windows winget install.

Compiler Component Impacted

  • Frontend / AST
  • IR Generation
  • Tier1 / JIT Execution Engine (tier_runner)
  • x64 Codegen
  • CI/CD & Benchmarks

No compiler, engine, or IR change. This PR is the website and the documentation only; the engine is untouched.

Verification

docs verification: 34 pages · 135 examples · 114 compiled · 67 repo refs
ALL DOCS EXAMPLES VERIFIED against the real Lithon toolchain

Every example on the site is compiled by the real Lithon frontend and pinned to the repo's regression outputs. bun run verify:docs runs the real tools/typecheck.py and src/frontend/frontend.py over every example and fails on drift — and CI now runs it, so a doc that drifts from the engine fails the build rather than misleading a reader.

Also green: typecheck, lint, build (47 routes prerendered), and the encoding guard.

Benchmark Verification

  • Benchmarks executed locally (./benchmark_fib).
  • Mamba bot verification expected on merge.

No benchmark numbers changed; the site now quotes benchmarks/results/latest.json accurately instead of a stale copy.

The docs were half-backed and the site was missing the things a reader
comes for. This brings both up to the engine's actual state.

New pages (5, all verified against the real toolchain)
  - strings      the bounded str[N] model: layout, the three methods,
                 what strings cannot do
  - match        the enum dispatch statement: arm forms, exhaustiveness,
                 binding rules, every refused shape
  - exceptions   try/except/else/finally over the closed set of seven
                 engine traps, and the trap boundary
  - networking   a real TCP loopback from raw syscalls, checked against
                 a C oracle
  - python-divergences
                the eleven places Lithon deliberately differs from CPython

New site sections (2)
  - /changelog   every shipped change, grouped and linked to its docs
  - /next        the open items, item by item, with what was recently
                 closed

Docs index, rebuilt
  - an explicit "reading path": the pages marked essential, in order,
    each with the outcome you get from it
  - every page carries a priority, so a reference lookup is never
    mistaken for reading material
  - six new block kinds: callout, tabs, comparison, deflist, layout, quote

Facts corrected against the implementation
  - float[32] does not exist (it was in the start page and the roadmap)
  - a syscall argument may be a pointer, and it is a real host address
    in both tiers; the shipped TCP loopback depends on it
  - len() is the live length, not the capacity
  - `**`, `//`, `<=`, `>=` are refused, not "limited"
  - 55 IR opcodes, all emitted -- not "26 of 27, Phi missing"
  - the benchmark and suite numbers now match benchmarks/results/latest.json
  - the trap text is "error: division by zero", not a LITHON-E code
  - the stale NotImplementedError prefixes in the documented diagnostics

Encoding
  - 314 runs of Windows-1252 mojibake repaired across the site (some
    double-encoded); scripts/fix-encoding.ts is now a permanent guard

AI-friendly
  - llms.txt and llms-full.txt, generated from the same registry the
    site renders
  - JSON-LD on every route, not just the docs pages
  - body-text search, so an error code or an operator is findable
  - <lastmod> in the sitemap

Also
  - the "a small Lithon program" example now opens on its Execution tab
  - the browser IR model no longer silently treats an unknown opcode as a
    no-op, and float registers and slots are scoped per frame
  - the playground falls back to the recorded IR in production instead of
    failing
  - the CI status footer caches for five minutes and only tracks master
  - CI now runs verify-docs, the IR freshness check, typecheck and lint
  - the toolchain scripts work on every platform, not just Windows

135 examples across 34 pages, every one compiled by the real frontend
and pinned to the repo's regression outputs.
The fix-encoding script documented the mojibake it repairs with literal
examples, so the guard flagged itself. The examples are now described by
code point instead of by character.
CI caught a real bug in the freshness check: the frontend emits its IR
with the platform's line ending, so the same program produced CRLF on
Windows and LF on Linux. The generator copied whatever it was given, so
the committed file was a Windows artefact and the check could never
pass on Linux.

The generators now normalise the frontend's output to LF, and
.gitattributes pins the generated files (and the llms.txt surfaces) to
LF, so a checkout cannot rewrite them either.

With this the check is what it claims to be: the committed bytes are
exactly what the frontend produces today, on every platform.
@MotherOfProgrammers
MotherOfProgrammers merged commit 764670a into Project-Lithon:master Oct 21, 2026
2 checks passed
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