epiphany/spec
Levi Neuwirth 56950f8d7c Push 4b: ji-adaptive-5limit resolves, and the blocker was never HarmonicContext
The last fail-closed entry in the built-in tuning catalog now resolves, leaving
only the compatibility-mapping registry open in Push 4b.

The recorded blocker was wrong. Five places in tuning.rs claimed adaptive
"needs HarmonicContext, which does not exist in Rust". But
req:tuning:adaptive-default-version makes version 1 a pure function of
(position, anchor pitch class) — it ignores concurrent, recent, hints,
parameters, and mode. And two of HarmonicContext's four specified fields are
UNIMPLEMENTABLE: key_context and hints are typed on KeyContext / ContextHint,
which core_spec.tex:4111 leaves undefined deliberately, "so defining them now
would freeze a type surface on a chapter with no consumer". The minimal
one-field shape was not a preference; it was the only implementable one. Each
remaining field arrives with the first function that consumes it.

The real blocker was structural and small: locate_voice returned
(RegionId, StaffId) while key_sequence lives on StaffInstance, so the resolver
threw away the only object that could answer "what key is prevailing here".

No new pitch math. ji_static_5limit_ratios already took a runtime anchor — the
three ji-static-5limit-{C,G,D} built-ins are that one function at anchors
0, 7, 2 — so adaptive v1 is that same call with a derived anchor. Verified as
an identity: adaptive at anchor 0 is bit-identical to ji-static-5limit-C and at
anchor 7 to ji-static-5limit-G, across all seven naturals.

A missing tonal centre is NOT an error. core_spec.tex:3452 mandates C
(chromatic position 0) when none is supplied, so that is a defined default, not
a fail-closed case; a test pins it against a future "fail closed" refactor.
Fail-closed applies to exactly two things: an unregistered
AdaptiveTuningFunctionId (hard error, no fallback) and a TimeAnchor that cannot
be unambiguously ordered against the onset (AnchorNotOrderable, naming the kind
that defeated it). If any KeySignatureChange in a sequence is unorderable the
whole derivation fails, rather than risk skipping the true prevailing signature.

Anchor arithmetic is (7 * fifths).rem_euclid(12), never %: fifths reaches -7 and
% yields a negative pitch class. ChromaticPitchClass is a checked 0..=11 newtype,
so the sign bug cannot degrade into a silently wrong anchor — under mutation it
panics outright. Verified by hand across the whole -7..=7 range, including the
enharmonic collisions (6 and -6 both F#/Gb = 6).

Nothing reaches the wire: TuningResolution is catalog-computed and appears in
neither codec.rs nor textvalue_graph.rs, so TuningResolution::Adaptive and
HarmonicContext are in-memory only and schema major 3 is untouched. Zero Codec
impls added; no vector or golden moved.

Gate: fmt clean, clippy 0, 1311 passed / 0 failed, doc 0, conformance 8/8,
requirement labels 6/6 at 212/282/282. Independently verified: the C default,
static systems ignoring context, statelessness across reordered resolution, and
the 0..=11 invariant. Two mutations killed — rem_euclid -> % and a silent
fallback for an unregistered id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 10:17:46 -04:00
..
vectors Text Projection: whole-document conformance, and a corpus with teeth 2026-07-21 15:44:25 -04:00
CONTRACT_EDITOR_T1A_GOLDENS.md Editor track: the plan, and the T1a golden-harness contract 2026-07-23 14:57:43 -04:00
CONTRACT_EDITOR_T2_SELECTION.md Editor T2: contract for selection v2, the golden gate, and copy/paste 2026-07-23 17:07:18 -04:00
CONTRACT_P13S1_LABELS.md P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
CONTRACT_P13S6_PROMOTION.md P13-S6 ratified: the lattice block, and an argument that did not survive arithmetic 2026-07-22 14:26:08 -04:00
CONTRACT_P13S6_TEMPERAMENTS.md P13-S6: the tuning constructions, drafted -- and why sourcing was not enough 2026-07-22 11:50:06 -04:00
CONTRACT_PUSH4B_3BII_IDENTITY.md Push 4b tranche 3b-ii: one SmuflVersion, and a live ordering bug dies with the homonym 2026-07-23 19:30:52 -04:00
CONTRACT_PUSH4B_3BI_WIRE.md Push 4b tranche 3b-i: the score wire opens schema major 3 2026-07-23 17:35:55 -04:00
CONTRACT_PUSH4B_ACCIDENTALS.md Push 4b tranche 3a: contract for the accidental vocabulary, and S10-S12 filed 2026-07-23 13:55:19 -04:00
CONTRACT_PUSH4B_ADAPTIVE.md Push 4b: ji-adaptive-5limit resolves, and the blocker was never HarmonicContext 2026-07-24 10:17:46 -04:00
CONTRACT_PUSH4B_PITCHSPACES.md Push 4b tranche 1: contract for the pitch-space slice 2026-07-22 17:08:00 -04:00
CONTRACT_PUSH4B_RESOLVER.md Push 4b tranche 2: contract for the in-memory tuning resolver 2026-07-23 10:06:25 -04:00
CONTRACT_PUSH4B_SPEC1.md Push 4b Wave 1a: three ratified corrections, and a citation that pointed the wrong way 2026-07-22 11:49:40 -04:00
CONTRACT_PUSH4B_TEMPERAMENTS.md Push 4b tranche 2b: contract for the ten historical temperaments 2026-07-23 11:38:14 -04:00
CONTRACT_TEXTPROJ_DOCUMENT.md Text Projection: the document layer, and the equation closes 2026-07-21 15:05:28 -04:00
CONTRACT_TEXTPROJ_OPS.md Text Projection: the operation layer, and the tests that can see it fail 2026-07-21 13:43:09 -04:00
DRAFT_P13S6_TEMPERAMENTS.md P13-S6 ratified: the lattice block, and an argument that did not survive arithmetic 2026-07-22 14:26:08 -04:00
PASS11_RATIFICATION_LOG.md P12-I2: wire the ratified MUSCLOID layout-object id derivation 2026-06-27 12:46:19 -04:00
PASS11_WORKLIST.md Pass 11: ratify provisional byte choices into normative spec text 2026-06-21 22:30:06 -04:00
PASS12_BATCH.md Pass 12 G-pass: ratify the full batch (28 rows) — spec tranche 2026-07-07 10:23:30 -04:00
PASS12_RATIFICATION_LOG.md P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
PASS12_WORKLIST.md Pass 12 G-pass: ratify the full batch (28 rows) — spec tranche 2026-07-07 10:23:30 -04:00
PASS13_CANDIDATES.md Push 4b tranche 3b-ii: one SmuflVersion, and a live ordering bug dies with the homonym 2026-07-23 19:30:52 -04:00
PHASE2_F_WEEK0_WORKLIST.md Phase 2: spelling + decomposition pre-passes (Agent H) with F merge gate 2026-06-23 16:33:39 -04:00
PHASE2_QUICKSTART.md Phase 2: spelling + decomposition pre-passes (Agent H) with F merge gate 2026-06-23 16:33:39 -04:00
PLAN_EDITOR_APP.md Editor T2: contract for selection v2, the golden gate, and copy/paste 2026-07-23 17:07:18 -04:00
PLAN_P13S1_LABELS.md P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
PLAN_P13S2_CMN24.md P13-S2: the alteration is space-relative, and the core fails closed 2026-07-22 09:00:09 -04:00
PLAN_PUSH4B_TUNING.md Push 4b Wave 1a: three ratified corrections, and a citation that pointed the wrong way 2026-07-22 11:49:40 -04:00
PLAN_TEXTPROJ_DOCUMENT.md Text Projection: the document layer, and the equation closes 2026-07-21 15:05:28 -04:00
PLAN_TEXTPROJ_OPS.md Text Projection: the operation layer, and the tests that can see it fail 2026-07-21 13:43:09 -04:00
QUICKSTART.md Pass 11: ratify provisional byte choices into normative spec text 2026-06-21 22:30:06 -04:00
binary_format.pdf P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
binary_format.tex Push 4b tranche 3b-i: the score wire opens schema major 3 2026-07-23 17:35:55 -04:00
core_spec.pdf Push 4b tranche 3b-ii: one SmuflVersion, and a live ordering bug dies with the homonym 2026-07-23 19:30:52 -04:00
core_spec.tex Push 4b tranche 3b-ii: one SmuflVersion, and a live ordering bug dies with the homonym 2026-07-23 19:30:52 -04:00
operation_catalog.pdf P13-S2: the alteration is space-relative, and the core fails closed 2026-07-22 09:00:09 -04:00
operation_catalog.tex P13-S2: the alteration is space-relative, and the core fails closed 2026-07-22 09:00:09 -04:00
quality_metric_catalog.pdf P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
quality_metric_catalog.tex P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
reference_suite.pdf P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
reference_suite.tex P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
text_projection.pdf P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00
text_projection.tex P13-S1: every requirement is named, and now it is also numbered 2026-07-21 18:27:52 -04:00