Home / Engine / Craft Knowledge

Craft Knowledge Engine - Phase 3 spec: the nightly craft grower (v1, 2026-06-20)

Updated Jun 20, 2026 · Affirmology_CraftEngine_Phase3_GrowthSpec_v1.md

Summary. Phases 1 and 2 are done: the craft base exists (94 entries) and is wired into the council (Hypnos plans the techniques, Orpheus drafts with the plan, Apollo gates on it, Hermes searchcraft in chat). Phase 3 makes the craft base GROW on its own each night, the

Craft Knowledge Engine - Phase 3 spec: the nightly craft grower (v1, 2026-06-20)

Phases 1 and 2 are done: the craft base exists (94 entries) and is wired into the council (Hypnos plans the techniques, Orpheus drafts with the plan, Apollo gates on it, Hermes search_craft in chat). Phase 3 makes the craft base GROW on its own each night, the same way the Interpretation Growth Engine already grows the chart-meaning layer. Jeff: "look wide and far, be smart."

The good news: no new infrastructure

The nightly job already exists and already does exactly the plumbing we need. api/growth_cron.py runs as a Render Cron, pulls corpus.db from R2, runs affirmology.corpus.growth.run_growth(...), and pushes the enriched corpus.db back to R2. The studio re-pulls on next boot, so the new knowledge reaches the agents. The craft table lives in that SAME corpus.db. So Phase 3 is: add a craft-growing STAGE to run_growth, and the existing pull/push/report pipeline carries it for free.

What the existing engine does (so Phase 3 mirrors it)

affirmology/corpus/growth.py runs three stages over the meaning store, all cost-capped by a Budget (hard USD cap + per-run entry cap), all idempotent (upsert, never duplicate), pilot-before-batch (verify one entry before spending on the batch), cheapest good model (Haiku) by default: 1. MEANING BUILDER: walks a prioritized target list (wealth first), grounds each on the raw corpus, writes a craft-voiced meaning entry, upserts it. 2. FEEDBACK / CORRECTIONS: turns every "this reads odd" from the studio feedback store into a permanent distinction + fix-flag. 3. MORNING REPORT: what was added/refined/corrected + the budget ledger, printed to stdout and pushed to R2 (reports/growth_latest.md).

Phase 3 adds a fourth and fifth stage of the same shape, writing to the craft store instead of the meaning store.

What to build

Stage 4 - CRAFT BUILDER (grow the craft base)

A new function build_craft(...) in growth.py, mirroring build_meaning, that walks a prioritized craft backlog and upserts actionable craft entries (the Phase 1 schema: area, name, method, why, when_to_use, how_to_apply, one_liner, body, tags, confidence, source, source_doc).

Stage 5 - CRAFT FEEDBACK (close the loop)

Mirror process_feedback, but for craft. Two inputs become craft refinements: - APOLLO GATE failures from --council renders: when Apollo's technique/hypnos gate says a planned technique was misapplied or something that belonged was missing, that judgment is distilled into a craft correction (sharpen the entry's how_to_apply, or add a when_NOT_to_use). The council already produces this judgment in council_transcript.md; Stage 5 reads a small structured log of gate misses (have the council append gate-miss notes to a craft_feedback channel, same shape as the studio feedback store). - ECHO "didn't land": any audio feedback tagged craft ("the opening dragged", "the ending didn't release") becomes a craft distinction the writer and Hypnos must honor next time.

Wiring + report

Guardrails (hard)

Sequence

Acceptance test

  1. Run locally: GROWTH_CRAFT=1 GROWTH_MAX_COST_USD=0.50 GROWTH_CRAFT_MAX_ENTRIES=3 python -m api.growth_cron against a local corpus.db. PASS = 3 new/ refined craft entries, the morning report shows a CRAFT section with a budget under cap, and a re-run refines rather than duplicates (idempotent).
  2. After the nightly cloud run, search_craft in Hermes and the Hypnos plan in a --council render surface the newly grown entries.

Build brief for Code (paste below)

See the chat message that delivered this spec for the exact Code paste and the run commands.