Home / Ops / More in this area
Updated Jul 11, 2026 · Affirmology_QC_Audit_and_Plan_v1.md
Written 2026-07-11 (DATA/engine chat) at Jeff's request, after he watched the mirror renders come out slow and arduous and got (rightly) scared about quality control. Jeff's steer: the #1 problem is DRIFT FROM STRUCTURE, especially while we are testing new structures. Generic / wishy-washy / length matter too, but we are already fixing those and they should be baked into a structure at approval time. So this plan is built around structural conformance first.
Read with: Affirmology_FirstReading_Structure_v1.md (the Mirror's spec'd 12-rule gate, doc-only
today), Affirmology_ReadingCraft_HeroStory_Synthesis_v1.md (the craft bar), the memory
self-healing-agent-loops (the parked accountability workstream this advances).
The pipeline reliably prevents broken and wrong. It has almost nothing preventing drifted or mediocre.
directive; the
model interprets it; nothing verifies the render followed the intended beats, in order, carrying the
threaded symbol, opening and closing the loop, sealing. The only shape enforcement anywhere is the
Origin's fixed last line (enforce_origin_close).This is fixable, and most of it is cheap. The core build is: give every structure a machine-checkable blueprint, add a conformance gate that scores each render against its blueprint and blocks drift, and wrap both in accountable agents that hold weak renders, log verdicts per person and per structure, and never silently ship or drop.
| Gate | File | Layer it protects | Enforced? | Covers the Mirror? |
|---|---|---|---|---|
| Technical audio QC (dropouts, LUFS) | affirmology-agent/scripts/audio_qc.py, wired in api/pipeline.py:13 |
Broken audio | YES, on every render | Yes |
| Chart-integrity guard | api/chart_guard.py, raised in api/jobs.py:722 |
Wrong person / contamination | YES | Yes |
| Mechanical script gate | .../agents/script_qc.py, called script_generator.py:697 |
Brand tokens, fixed close, length band | YES (deterministic) | Yes (compose -> generate_script) |
| Send gate | Ops/verify_send.py |
Pre-send checks | NO - orphaned, no callers found | n/a |
| The Mirror "12-rule QC gate" | Affirmology_FirstReading_Structure_v1.md |
Structural + craft | NO - doc-only, not in code | Spec only |
| Structural conformance | (does not exist) | DRIFT (the #1 fear) | NO | No |
| Craft-quality judge (generic / wishy-washy / hope-dominant / cadence) | (does not exist) | Mediocre | NO | No |
What the mechanical gate actually does (script_qc.py): replaces em/en dashes with commas; for the
Origin, guarantees the exact fixed close (enforce_origin_close); bans raw HD gate/channel numbers;
flags word count outside a band of target_minutes * 110 to * 175 (very wide - see §3). It is a
pure deterministic pass. It does NOT read for meaning, structure, personalization, or tone.
Structures: 28 registered (api/structures.py:108). Each is a Structure dataclass whose shape
lives in two free-text fields, directive (the locked concept passed to the generator, line 62) and
overview (line 63). There is no ordered list of required beats, no per-beat lead-system, no
threaded-symbol or open-loop requirement in any machine-readable form. The generator is TOLD the
shape in prose and trusted to hit it.
Structural drift is unmeasured and unguarded. Because a structure is prose and the only shape check in the codebase is the Origin's closing line, a render can silently: skip a beat, reorder beats, lead with the wrong system, drop the threaded symbol, leave the loop unopened or unclosed, or omit the seal - and pass every gate we have. When we test a NEW structure, we have no automated signal for whether the output matched the intent; we find out by listening to the whole thing. That is the arduous, scary loop.
target_minutes * 140..150 words (script_generator.py:646), the QC band is
* 110..175 (script_qc.py:121), pacing uses PACE_WPM = deep 118 / standard 132 / activation 145
(pacing.py:39), and the soul-song calibration note is ~2.1 words/sec (~126 wpm). Four different
words-per-minute truths. A single source of truth for length would stop the overshoot.verify_send.py is orphaned - a send gate nothing calls. Either wire it in or delete it so it
is not mistaken for protection.Principle: a structure is not "the prose we hope the model follows"; it is a checkable blueprint, and every render is scored against ITS blueprint before it can ship. Craft requirements (definite, personal, hope-dominant, length) get baked into the blueprint at approval time, so conformance to an approved structure implicitly enforces the craft bar - exactly Jeff's model.
Add a blueprint to the Structure dataclass (additive; untagged structures keep behaving exactly as
today). A blueprint is an ordered list of beats, each with:
- id + human name (e.g. promise, being_seen, three_doors, install, seal)
- required (hard) vs optional
- lead_systems (which of astrology / HD / gene keys / numerology should drive this beat)
- must_contain markers the render must exhibit (e.g. the threaded symbol is introduced in beat 1 and
recurs; an open loop is opened and later closed; the seal is the final movement)
- share_of_length (rough fraction of total words) so one beat can't eat the whole piece
- plus structure-level rules: total length band (from the single source of truth), banned tokens, the
fixed close (Origin), hope-dominant / definite / no-catastrophe, personalization floor.
chart_guard). Catches the cheap, obvious drift with zero tokens.ConformanceVerdict.When testing a new structure: generate K renders across K varied charts, score each against the
blueprint, and report the drift pattern - which beat drifts most, whether the loop reliably closes,
length variance - so you fix the directive OR the blueprint before approving. This turns
new-structure testing from "listen to 25 minutes and hope" into "read a one-page conformance report."
The render stops being fire-and-forget and becomes accountable to the structure's blueprint.
approved / production until it clears a conformance pass-rate threshold
across its test renders. Approval literally means "its blueprint is defined and it passes." Until then
it stays experimental and its renders are held for human review by default.Nothing here is built yet - this is the audit + plan for review. On Jeff's go, step 1-3 (all free / no-LLM) can start immediately; step 4 (the judge, the only spend) waits for a credit check.
Jeff's decisions: (1) direction green-lit; (2) floors "propose smart", plus his key rule: sound beds that STRETCH tolerate length variance, beds that can't stretch need tight length or the ending goes weird; (3) approval bar 90% and tune.
DONE (commit fd46119, push HELD for the mirror render window; log-only, blocks nothing):
- Step 1 - blueprint schema + the Mirror blueprint (Promise, Being Seen, Three Doors, Install, Seal;
threaded symbol; open loop; seal-last) + the Origin blueprint (fixed bed, tight length).
affirmology-agent/.../agents/conformance.py.
- Step 2 - deterministic conformance engine: beat presence + order + seal-last + per-beat length
share (via beat markers), bed-aware length. Beat markers emit/parse/strip with a no-leak assertion.
Wired into council.compose in the existing Apollo gate loop, guarded so QC can never break a render.
- Step 3 - single source of truth for length: pacing.word_band(minutes, pace, bed_stretchable).
Stretchable = generous band + soft flag; fixed bed = tight band + HARD block (Jeff's rule).
- Floors implemented: HARD = missing/out-of-order required beat, seal not last, length out of band only
for fixed (non-stretchable) beds. Soft (flag only) = length for stretchable beds, per-beat imbalance.
- 16 tests pass (tests/test_conformance.py + standalone).
Modes (env): AFFIRMOLOGY_CONFORMANCE = off | log (default: compute + log, block nothing) |
enforce. AFFIRMOLOGY_CONFORMANCE_MARKERS = 0 (default; no markers emitted, so live generation output
is unchanged and no marker can leak) | 1.
NEXT (needs Jeff / a later increment): - Jeff signs off the Mirror blueprint (the 5 beats + shares) -> then enable markers on the Mirror and flip that structure to enforce. Cowork authors blueprints for the other structures at approval. - Step 4 - the LLM craft-judge (generic / wishy-washy / hope-dominant + beat-quality), the only spend; waits for a credit check per the standing rule. - Steps 5-6 - ConformanceVerdict logging + the per-structure scoreboard + the 90% approval gate + the accountable hold/retry loop wired to the self-heal ledger.