Lofn qa

From LocalSymmetry/lofn · View interactive version

Lofn qa is an AI agent skill from the GitHub repository LocalSymmetry/lofn. Audit, validate, and classify completed Lofn pipeline outputs against the strict quality gates, backed by Claude. Use after a lofn-music / lofn-image / lofn-video / lofn-story run, or on a suspicious partial run, to get a SHIP / REPAIR / FAIL verdict and a repair brief. Do NOT use for creative gener

How to use this skill

Skill file

Lofn QA — Claude-backed adversarial gate

The competitive auditor. It proves two things at once: a listener/viewer can grasp the surface, and a second pass reveals the cathedral. It fails both extremes — impressive obscurity AND competent blandness. QA stays strict: it does not loosen structural gates to protect "creative freedom."

Replaces the OpenClaw Python validators with Claude judgment + the same checklists. Adopt the auditor stance from skills/orchestration/references/adversarial_qa_stance.md first.

Procedure

  1. Run in a fresh, clean-context judgment subagent. The QA / Somatic / Step-11-reject judgment MUST execute in a clean Agent-tool subagent — never appended to the thread that generated the artifact. A generator grading its own homework is the conflict that ships corpses past the Andon Cord. Music uses two sealed stages: Stage A receives only the shuffled plain-lyric plate + music_absolute_force_gate.md questions and saves its receipt; only after that file is frozen may Stage B receive the artifact + verbatim ICB + full gate spec + GATE_REPORT.json. Do not put prompts, scores, [Theme:], [SONG FORM:], EMO/Disc headers, rationales, or Golden identities into Stage A. Other modalities receive the artifact + ICB + gate evidence directly. Tier follows the role (judge, not generate), never the step number; this is a dedicated clean-context spawn, not a per-spawn flag that can silently fall back.
  2. Identify the run directory + modality.
  3. Load the gates just-in-time:
  1. Music: freeze Stage A before deterministic evidence. Other modalities: read deterministic evidence first. Once the music plain-lyric receipt exists, or immediately for another modality, load GATE_REPORT.json if scripts/validate_step.py wrote one and paste its measured {pair, step, check, expected, actual, pass} rows verbatim as proof-of-fix evidence in the Evidence column. These are computed values, not QA guesses, and they never retroactively alter the frozen listener read. The helper is fail-open: if absent or warning, fall back to in-prose measurement and note it; never block a valid run on a missing/broken helper.
  2. Verify ICB integrity (cheap proof, not a soul substitute). Confirm the canonical ICB / CREATIVE_CONTEXT prefix appears as an unbroken verbatim substring at the head of each step's prompt (additions below pass; edits above the block fail), and that the count of (after speaker tags == 18. A voice count ≠ 18 or a broken prefix is caught as REPAIR — THREAD LOSS. The count proves presence, not fidelity — a paraphrase can match length and voice-count. So this is only the cheap tripwire for a gross drop; the human personality-fidelity read (below) stays the real guarantee, and the count never substitutes for the soul read. Never summarize, trim, or "optimize" the ICB to make a count easier.

4.5. Music Absolute Force bracket — plain lyrics, actual house bar. The coordinator (not the judge) builds one shuffled Stage-A plate per finalist with: the candidate's plain sung words, all three core controls (Triple Arch Over Me, Spare Hair Tie, Burning Bush With a Barcode), and one known-mediocre decoy. Use scripts/build_blind_set.py --mode lyrics; keep the key outside the blind directory. Add ASK FOR IT BY NAME and The Wedding Takes It Louder as challenge controls when cleverness, formal machinery, moral debt, or dense constraint is central. The judge freezes the six-question receipt and rank before identity reveal. Readings:

Full-package golden+decoy comparison may still audit package judgment, but cannot contribute positive evidence to Absolute Force or Overall SHIP. The complete contract is music_absolute_force_gate.md.

  1. Run the gate without weakening any check. For music, run the pressure/mechanism proxy-capture sentences and evidence-boundary check before Somatic voting. Apply the Claude-native self-check gates in .claude/skills/lofn/EXECUTION.md §4 for structural/pipeline integrity.
  2. Write QA_REPORT.md in the run directory, including the structured evidence block (below) BESIDE the verdict. Music reports also include the frozen Plain-Lyric First Read, Absolute High-Bar Bracket, Evidence Boundary, Proxy-Capture Check, and an Absolute Force: CLEAR / HOLD / REPAIR verdict; without them Overall cannot be SHIP. If failures require rerun, write the repair brief in the rerun format from qa_full_legacy.md and route to the failing step (09/07 for music thread loss, 08 for prompt-format, etc.). REDIRECT — mandatory when the gate is stuck (EXECUTION.md §7.3): if the specific failed gate's value has not moved across attempts (the no-progress predicate), the repair brief MUST carry a sideways PROPOSAL beside the return target — one of: promote a step-05 cut-ledger reserve concept, re-derive that pair's variation angles, or re-run the panel's skeptic transformation for that pair's slice. The Skeptics' COUNTER-MOVES (Somatic Gate, below) are the raw material for this proposal. The brief proposes; executing sideways is a coordinator decision surfaced to the human — the frozen ICB is never edited mid-run, a sideways route spawns a NEW pair artifact chain.
  3. On SHIP (every shipped/selected piece): append ONE curated failure-ledger entry to vault/COMPETITION_LEARNINGS.md — see "Failure-ledger write-back" below.

What every PASS must clear

Named-corpse Andon checklist (prompts for the 3-Hyper-Skeptic bloc)

These are enumerated reject-conditions worded as prompts the Hyper-Skeptics carry into the Somatic Gate — not scores, not auto-reject floors, not a Python detector. Pulling the cord is never failure; shipping past it is. A Skeptic who flags one must cite the named condition with evidence ("emotion goes nowhere — no second movement") rather than a bare "feels generic." Under-flagging is acceptable; the conditions exist to give the human a sharper language, not to auto-fail. Walk each:

A deliberate refrain, villanelle, incantatory INDIGNATION dirge, or sustained-register elegy is NOT a corpse. These prompts ask the Skeptic to tell intentional return from creative exhaustion — a judgment only a human read makes. Never convert any of these into a numeric threshold that gates SHIP/FAIL.

Modality hard gates (non-waivable — a custom/looser parent checklist cannot waive these)

Phrase each check as a natural-language assertion that names the concrete checkable value — e.g. "the EXCLUDE field is present and its content is under cap", "the lyric carries a 3+3 emotional duality", "the MUSIC PROMPT is a dense paragraph of 850–1000 chars, NOT bracket tag-soup". Evaluate the assertion by meaning, not by an exact-string grep that false-fails on minor format drift; the concrete band / EMO-header shape stays inside the assertion so "robust" never decays into vibes.

Human-Subject identifiability backstop (HOLD-FOR-HUMAN)

QA enforces the identifiability backstop from vault/HUMAN_SUBJECT_STANDARD.md. The line forbidden is identifiability, not subject matter: a real, named, or recognizably-depicted private individual rendered in a way that ties the piece to that person. On any reasonable suspicion of an identifiable real human subject, the verdict is HOLD-FOR-HUMAN — not an auto-FAIL, not a silent SHIP. The piece does not ship and is surfaced to the human for an explicit decision. This backstop sits above every numeric and somatic gate and is non-waivable by a looser parent checklist.

Structured QA evidence block (BESIDE the verdict, never replacing it)

Surface the measured values QA already reasons about as a structured block alongside SHIP / REPAIR / FAIL so verdicts are trace-auditable and trendable across runs — a floor under the judgment, never a substitute for it. Quantify the corpses; do not pretend to quantify the soul. Report, for the modality:

Where GATE_REPORT.json exists, populate these from its measured rows. A piece that passes every count can still be REPAIR — SOUL LOSS by the somatic read. The structured block sits beside the 3-Hyper-Skeptic verdict; it never displaces it.

Failure-ledger write-back (advisory, capped, INDIGNATION-exempt)

On every shipped/selected piece, append exactly ONE curated entry to vault/COMPETITION_LEARNINGS.md capturing: theme-tags (theme-type / venue / modality), what the gate caught, one transferable rule, and a confidence %. Discipline:

Operational-ledger write-back (infra/process only — FIREWALLED from the aesthetic ledger above)

If the run hit an operational failure — a dropped/quarantined pair, a stale path, a quota/API error, a timeout, a gate that false-failed a valid artifact, a resume/manifest disagreement — append ONE row to vault/RUN_LEDGER.md with the fixed schema {date · run_id · what_broke · root_cause · infra_fix · status}. This is the operational ledger, not the aesthetic one: it records ONLY plumbing facts and never a taste claim (taste lessons stay in COMPETITION_LEARNINGS.md, INDIGNATION-exempt). Nothing is written if the run had no operational failure. It is read back at Phase −1 as a heads-up, never as a creative constraint.

Release the run lock (last action, after the INDEX)

python3 scripts/run_lock.py release <run-dir> — see EXECUTION.md §5.1. The file is kept as the run's record, and the directory stays claimed: a finished run's artifacts are at least as destroyable as a live run's, so a different run is still refused and must use its own directory. If release reports the lock is not yours, that is an operational failure — write the row, and say plainly in the report that this run may have been writing into another run's directory.

Verdicts (every report)

The publish bar (standards never float)

Report format (`QA_REPORT.md`)

# Lofn QA Report — <run> (<modality>)
## Verdicts
- Pipeline Integrity: …
- Package: …
- Human-Subject: CLEAR | HOLD-FOR-HUMAN
- Absolute Force (music): CLEAR | HOLD | REPAIR
- Overall: …
## Plain-Lyric First Read (music; frozen before package/ICB reveal)
## Absolute High-Bar Bracket (music; 3 core controls + decoy)
## Evidence Boundary (music; text vs production intent vs rendered fact)
## Proxy-Capture Check (music; pressure sentence vs mechanism sentence)
## ICB Integrity
- prefix verbatim substring: yes/no · `(after ` voice count: N (==18?) · injected bytes: N
## Structured Evidence Block  (measured values, BESIDE the verdict — from GATE_REPORT.json where present)
| Metric | Measured | Band/Cap | Pass/Flag |
(char counts vs caps · sung-line count vs 70–120 · EMO-tag balance · repeated-line ratio = FLAG only, chorus-exempt)
## Score Table
| # | Gate | Verdict | Evidence | Repair |
## Blocking Fails
## Somatic Gate (3 Hyper-Skeptics)  — PRIMARY; cite named-corpse conditions with evidence
## Required Repairs  (routed to step N)
## Failure-ledger entry appended (on SHIP)  — theme-tags · what the gate caught · transferable rule · confidence
## Final Recommendation

A strong artifact with weak structure still fails; a soulful artifact missing required pieces still fails structurally. A piece that passes every measured count still fails if the Somatic Gate reads SOUL LOSS — the numbers are a floor, the somatic read is the guarantee. Fix, then re-QA before delivery.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.