Implement SPEC-06: compile service, sparse channels (Stage 2)#16
Merged
Conversation
Stage 2 of the ASSAY build. Research-first (DEC-11): docs/research/02-compile.md
decides the sparse channel representation from the Stage-0 dense-world benchmark
(~1.2M cells → 84.9 MB, ~19.4 s serialise+hash per recompile — not viable) and
ATP 2-01.3 MCOO doctrine (overlays record deviations, not per-cell attributes),
retiring dense Channel.cells and resolving seam contract open item 2.
SPEC-06 specified via spec-kit (specs/006-compile/) and implemented:
- Schema: Channel is now {default: Band, regions: RegionOverride[]}; new
VignetteConfig {grid, channels, regions, subject_map} holds region geometry
and subject→(channel,region) routing once, not per world. Types regenerated.
- src/compile.ts (CompileService): knowledge subset + config → CompiledWorld.
Refuses contested_knowledge (G5, completing what SPEC-05 marked, via
isCompilable), stale_input (effectiveStatus), and encoding_violation/
waiver_required as defence in depth (reusing the pure checkEncoding);
firewalls scenario_weight; applies a COA excursion as a region-override
overlay folded into the stamp. Deterministic stamp over sorted inputs (G1);
one compiled_into edge per consumed object + a waives edge per waiver, and
every RegionOverride names its source, so every channel value is
backward-traceable to named knowledge (G3). No delta (seam §4).
- src/components/channelTrace.ts: the channel-trace surface (region → band →
backing knowledge with owner). fixtures/vignette-config.json authored.
- Compile demo moment renders in the gallery ("contested never compiles",
then resolve → recompile). 107 tests pass, typecheck clean.
All three Stage-2 exits demonstrated on Meridian. The sparse-channel schema
change is recorded as a flagged register candidate (concept §6, item 12), built
under seam open item 2's delegated authority pending batch ratification. Batch
propagation: knowledge-model §7/§11, seam contract open item 2, vignette §8,
CLAUDE.md current-phase.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qeyKmS8aAPLRLxK8wmdHR
49f79ed to
ee1666e
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 — Compile (knowledge → CompiledWorld)
Research-first (ASSAY-DEC-11):
docs/research/02-compile.mdis the gate. It decides the sparse channel representation from the Stage-0 dense-world benchmark (a dense CompiledWorld is ~1.2M cells → 84.9 MB, ~19.4 s serialise+hash per recompile — re-measured this session, not viable even in the mock) and from ATP 2-01.3 MCOO doctrine (overlays record deviations, not per-cell attributes). This retires denseChannel.cellsand resolves seam contract open item 2.SPEC-06 was specified through spec-kit (
specs/006-compile/) and implemented.What changed
Schema (LinkML → regenerated types)
Channelis now{ name, kind, default: Band, regions: RegionOverride[] }— a per-channel default plus named, optionally time-boxed deviations.ChannelCell(dense) is removed.RegionOverride { region, value: Band, from_step?, until_step?, source? }.VignetteConfig { grid, channels, regions, subject_map }holds region→cell geometry andsubject → (channel, region)routing once, not per world.Compile service (
src/compile.ts)POST /compile(seam §4): knowledge subset + config →CompiledWorld.contested_knowledge(G5 — completes at the compile refusal what SPEC-05 marked, reusingisCompilable),stale_input(viaeffectiveStatus), andencoding_violation/waiver_requiredas defence in depth (reusing the purecheckEncoding); persists nothing on refusal.scenario_weight(K14 never reaches a channel); applies a COA excursion as a region-override overlay folded into the stamp.stampover sorted inputs (G1); onecompiled_intoedge per consumed object + awaivesedge per waiver; everyRegionOverridenames itssource, so every channel value is backward-traceable to named knowledge with a named owner (G3). No delta (compile is a read-of-knowledge, seam §4).Surface & fixtures
src/components/channelTrace.ts— the channel-trace surface (region → band pill → backing knowledge + owner), framework-free, arranges projections only.fixtures/vignette-config.json— Meridian grid, per-channel defaults, region geometry, subject map.Verification
npm run typecheckclean;npm test107 passing (14 new compile contract-invariant tests + 3 channel-trace + config validation).schema/*.yamlremain byte-identical (bodies) per the source-of-truth invariant.Register discipline
The sparse-channel schema change is a decision, so it is recorded as a flagged register candidate (
docs/assay-concept.md§6, item 12) — not asserted in a peer doc (ASSAY-DEC-2). SPEC-06 builds against it under seam open item 2's delegated authority, pending batch ratification (mirroring how note 01's floor entered on landing per DEC-16). Batch propagation swept knowledge-model §7/§11, seam contract open item 2, vignette §8, and the CLAUDE.md current-phase line in this change.🤖 Generated with Claude Code
Generated by Claude Code