# The Program Library

The crew's computers carry the house's learning as **runnable, self-checking
programs** — not documents about knowledge. Every program here was distilled
from filed house work (receipts, measurements, proven modules) and carries
its own proof: a worked example on real house data, and a check that
reproduces at least one number exactly as filed in the source record.

Built under the founder's order of 2026-11-07 04:42 EST: *"use everything we
learn to achieve a better style of graphics — update their computer programs
to be way more extensive."* See `LIBRARY-RECEIPT.md` at the tree root for the
expansion record, and `INDEX.md` in this directory for the full map.

## Layout

```text
workshop/library/
  programs.json     the registry (slug, lesson, consumers, earned status)
  lessons.json      lesson catalog in the school curriculum schema —
                    a companion to workshop/school/curriculum.json (the
                    14-lesson catalog is untouched); each lesson's
                    resources point at a runnable program
  INDEX.md          program -> lesson -> worked example -> check -> consumer
  run-checks.cjs    runs every proven program's check.cjs, aggregates
  library.test.cjs  suite bridge: one node:test per proven program
  <slug>/           one directory per program:
    program.cjs     the program (CommonJS, Node builtins only)
    example.cjs     the worked example: node example.cjs
    check.cjs       the self-check: exports runCheck(); standalone prints
                    "PASS <n> FAIL <m>" and exits non-zero on any failure
    example/        fixtures — real house data, minimized, provenance cited
    PROGRAM.md      the lesson card: lesson, provenance, claims, limits
```

## The contract (how a program earns `proven`)

1. **Runnable.** `node example.cjs` works in this tree, offline, on the
   committed fixtures.
2. **Self-checking.** `check.cjs` reproduces at least one number exactly as
   filed in a house receipt or measurements file. The filed file always
   wins over any secondhand figure.
3. **Honest status.** `programs.json` marks a program `proven` only when
   its check runs green here. Anything else is `building`, `stub`, or
   `pending` — and says why. An unproven program is never counted.
4. **Wrapping, never editing.** The canonical renderer
   (`mesh-render.js`, md5 `b502e751ce23f90905820b1dd55cb166`) and every
   source tree the programs were distilled from remain byte-untouched.
   Programs wrap, import, or invoke; they never edit their sources.

## Running

```text
node workshop/library/run-checks.cjs          # every program check, tallied
node tools/agent-workbench.cjs run library    # the same, inside the suite
node workshop/library/materials/example.cjs   # one program's worked example
```

Graphics-style programs come first by the founder's sentence — materials,
world clock, depth, the rendition stages, the painting grammar, the texel
invariant, the probe — then the math modules (fields, gravity, scope), then
the eyes/proof instruments.
