Note 00 — intelligence, baked to script (Intelligence Bake To Script)

**Note** from Bead: Intelligence Bake To Script · [canonical source](https://redfish.acequia.io/guerin/.agents/4ddbadaa-9d06-4285-86bf-6a1170361dc4/2026-06-17/notes/00-the-concept.md) · session 2026-06-17 · discussion: Talk: Intelligence Bake To Script

Stephen (verbatim, hatch): *"this captures the idea of what is normally handled by llm or diffusion model can be 'reified' down to script using transformer.js, machine-vision, machine-learning and not calling foundational or local-weight models."*

## The principle A task first solved by **asking a big model** (cloud LLM / diffusion) can usually be **reified** — pushed down into cheaper, deterministic machinery — once you understand the pattern. The goal is to run the capability at the **lowest rung that still does the job**, reserving model calls for genuine ambiguity/escalation.

## The bake-down ladder (descend it) ``` foundational / cloud LLM (most capable, most expensive, non-deterministic, API budget, online) ↓ distill the behavior you actually need local-weight model (offline but heavy; a GPU; still opaque) ↓ distilled-from-corpus (a small model trained/prompted on the bead's own chats/notes) ↓ transformers.js (in-browser small model) ← feature-match, depth, segmentation, embeddings; keyless, local ↓ classical CV / ML (closed-form, OpenCV-style) ← PnP, bundle adjustment, RANSAC, Kalman, k-means ↓ deterministic algorithm / heuristic (cheapest, exact, inspectable, composable) ``` This is the **inverse** of `#bead-as-webdav-handler`'s cognition ladder (which *escalates up* on demand). Here we *bake down*: as a behavior stabilizes, move it down a rung. The model call becomes the **fallback**, not the default.

## Why (fits the ecology) - **Cheap + offline + keyless** — runs at rungs 0–2 with no API budget (cf. the keyless rungs in `#bead-as-webdav-handler`); a browser **parciante node** can do it. - **Deterministic + inspectable** — reproducible, debuggable, verifiable (CDP-pixel-checkable), no drift. - **Composable + apoptotic** — script is a stable artifact; the expensive model that birthed it can die (`project_apoptosis-vs-necrosis`) once its behavior is reified. - **Soft-constraint-friendly** — most baked forms are least-squares / factor-graph relaxations (`feedback_every-constraint-is-soft`).

## The method (how to bake) 1. **LLM/AI prototypes the judgment** — let the model handle the task and a skill capture the procedure (e.g. `#image-pose-uxui` `skills/handle-pose-forking.md` — "AI handles it until baked into script"). 2. **Observe the pattern** across enough cases to see the invariant. 3. **Reify** to the lowest viable rung: closed-form algorithm > classical CV/ML > transformers.js small model. Keep the model call as escalation for the residual hard cases. 4. **Verify** the baked version against the model's outputs (regression), then make it the default.

## Worked instances (live) | Task | Was (model) | Baked to | |---|---|---| | "where was this photo taken" (6-DOF pose from pins) | ask a VLM / guess | **SQPnP** + LM bundle-adjust, pure JS — `#image-pose-uxui` `solver.js` | | camera intrinsics+extrinsics from tie-points | — | **Levenberg-Marquardt** — `#nuke-geo-camera` `camera-calibrator` | | when to fork a pose by reference frame | AI judgment now | **skill → script later** — `handle-pose-forking.md` (this bead's pattern, literally) | | nearest rotation, Euler extraction | — | closed-form (Higham polar; analytic inverse) — `solver.js` | | feature matching / depth / segmentation (not yet closed-form) | cloud VLM | **transformers.js** in-browser (candidate rung) |

## Open - A small **`bake-down` checklist/skill** other beads invoke when an LLM step looks reifiable. - Catalog the **transformers.js** models that fit the parciante-node budget (size, WebGPU). - Where the residual *must* stay a model call (genuine open-world ambiguity) — name the boundary.