| name | organ-formula-foundry-bakeoff |
| description | Foundry Core B bakeoff harness and promotion/demotion ledger that runs synthesized formula candidates up a staged promotion ladder and records every gate verdict to an append-only ledger. Use when formula candidates need scoring, promotion, or demotion through the staged ladder, or when invoking the bakeoff to test and govern formula quality. |
| triggers | ["organ-formula-foundry-bakeoff","how do I use formula-foundry-bakeoff","formula-foundry-bakeoff usage","formula-foundry-bakeoff guide","Formula Foundry Bakeoff + Promotion Ledger (Core B test layer)"] |
| generated | true |
| source_node | formula-foundry-bakeoff |
| source_file | _SYSTEM/Scripts/math/formula-foundry-bakeoff.mjs |
| scope | harness |
| invocation | ability |
Organ Guide — Formula Foundry Bakeoff + Promotion Ledger (Core B test layer)
Module: _SYSTEM/Scripts/math/formula-foundry-bakeoff.mjs · Layer: Energy & Math · Invocation: both · CLI: ledger
Purpose. Foundry CHUNK 3 — the bakeoff harness + the promotion/demotion ledger (the SCORER + GOVERNANCE side of Core B). Takes already-synthesized candidates as INPUT and runs them up a staged promotion ladder, recording every gate verdict to an append-only ledger. Deliberately the GENERATOR≠SCORER boundary: it never imports the synthesizer, so a synthesizer can never grade its own candidate.
Exports
stableHash(obj)
- in: any JSON-serializable object
- out: a deterministic stable hash string (sorted-key, no clock)
PROMOTION_LADDER (frozen const)
- in: —
- out: the ordered, frozen list of promotion rungs
readLedger(ledgerPath = LEDGER_PATH)
- in: optional ledger path
- out: array of gate records (malformed lines skipped)
appendGateRecord(record, ledgerPath = LEDGER_PATH)
- in: a gate record + optional path
- out: appends one JSONL line to the ledger (mkdir-safe)
canPromote(formulaId, toRung, ledger = readLedger())
- in: formula id + target rung + optional ledger
- out: boolean — whether the ladder + evidence permit promotion to that rung
promote(card, toRung, ledger = readLedger())
- in: card + target rung + optional ledger
- out: the promotion result; records a gate entry
demote(formulaId, toRung, reason, opts = {})
- in: formula id + target rung + reason
- out: the demotion result; records a gate entry with the reason
stage0Intake(candidate)
- in: a candidate
- out: stage-0 intake verdict
stage1Fixtures(card)
- in: a card
- out: stage-1 fixture-test verdict
async stage2Counterexamples(card, opts = {})
- in: a card + opts
- out: stage-2 counterexample-search verdict