Skip to content

feat(v2): elevate KitchenSpeak to a physically-grounded DSL + reference toolchain - #1

Merged
hyperpolymath merged 2 commits into
mainfrom
feat/v2-dsl-elevation
Jun 15, 2026
Merged

feat(v2): elevate KitchenSpeak to a physically-grounded DSL + reference toolchain#1
hyperpolymath merged 2 commits into
mainfrom
feat/v2-dsl-elevation

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

Elevates KitchenSpeak from a v1.0 teaching DSL into a production orchestration
language whose superpower is physics in the types: materials carry
thermal/mechanical/chemical safety envelopes, appliances carry capability
envelopes, and an action type-checks only inside their intersection — so a
program that could curdle the milk, scorch the egg, bake the silicone spatula,
or over-torque the robot arm fails to compile
, never reaching the hardware. The
same types lower to machine-checked Agda proofs and to a HAL over Matter / MQTT
/ ROS 2.

Heals the two-copy split first

Re-homes the design substance lost in the original excavation from the
nextgen-languages monorepo: proofs/agda/{Dough,PoachedEgg,EchoBridge},
proofs/Makefile, ADRs 0002–0004, ROADMAP.adoc. Corrects STATE.a2ml (was
still project "rsr-template-repo") and the root allowlist.

What's included

  • Design blueprint (docs/): design/0001-v2-constitution.adoc (binding
    contract) + spec/{lexical,concrete-grammar,type-system} (close grammar.ebnf
    O1/O2/O3) + design/{semantics,hal-and-hardware,stdlib-ontology,blueprint-index}.
  • Reference compiler (src/compiler/, dependency-free OCaml ~1240 LOC):
    lexer → parser → typed AST → physical-safety checker → HAL lowering.
    ksc check | lower (matter|mqtt|ros2) | parse.
  • Corpus (examples/v2/ + tests/run-corpus.sh): 15/15 — 5 accept,
    10 reject-with-expected-code (CURDLE, MELT_TOOL, OVER_TORQUE, OVER_REACH,
    DOUBLE_USE, UNWITNESSED_SYNC, DIM_MISMATCH, NO_CAPABILITY, MISSING_ONFAIL).
  • Proof (proofs/agda/NoCurdle.agda): v2 flagship, machine-checked
    (exit 0, 0 unsolved goals) — milk never reaches its curdle envelope; phase
    never becomes CURDLED. Wired into proofs/Makefile.

Verified

  • cd src/compiler && dune build — clean.
  • bash tests/run-corpus.sh — 15/15.
  • make -C proofs nocurdle (+ Dough/PoachedEgg) — machine-check, exit 0.

Deferred (tracked in ROADMAP.adoc)

  • Choreographic deadlock-freedom + ceremony-commutation are specified but not
    yet enforced by the checker.
  • Emulsion/Sear proofs; QTT-Agda linearity port; Lean 4 port.
  • Real HAL adapters (the prototype emits trace JSON only).
  • The blueprint's adversarial completeness pass was cut short by a spend cap;
    the 4 workflow-generated docs are drafts pending that review.

🤖 Generated with Claude Code

hyperpolymath and others added 2 commits June 15, 2026 14:43
…ce toolchain

Make typing the safety superpower: materials carry thermal/mechanical/chemical
envelopes, appliances carry capability envelopes, and an action type-checks only
inside their intersection — so curdle-the-milk, bake-the-spatula, and
over-torque-the-arm are COMPILE errors, not firmware run-time faults.

Heal the two-copy split first: re-home the proofs, ROADMAP, and ADRs 0002-0004
from the nextgen-languages monorepo copy into this canonical standalone repo, and
correct the STATE.a2ml identity (was still "rsr-template-repo") plus root-allow.

Design blueprint (docs/):
- design/0001-v2-constitution.adoc  binding contract: data model, the physical-
  safety judgement (§5), the AST shape, proof obligations.
- spec/{0001-lexical,0002-concrete-grammar,0003-type-system}.adoc  close
  grammar.ebnf open items O1/O2/O3 with normative grammar + typing rules.
- design/{0002-semantics,0003-hal-and-hardware,0004-stdlib-ontology,
  0000-blueprint-index}.adoc.  Lexical/grammar/type-system/semantics drafted by a
  multi-agent workflow; HAL/ontology/index hand-authored after the run hit a
  spend cap, grounded in the compiler so docs and code agree.

Reference compiler (src/compiler/, dependency-free OCaml, ~1240 LOC):
- lexer -> parser -> typed AST -> physical-safety checker -> HAL lowering.
- ksc check | lower (matter|mqtt|ros2) | parse.
- corpus tests/run-corpus.sh: 15/15 (5 accept, 10 reject-with-expected-code,
  incl. CURDLE/MELT_TOOL/OVER_TORQUE/OVER_REACH/DOUBLE_USE/UNWITNESSED_SYNC).

Proofs:
- proofs/agda/NoCurdle.agda  v2 flagship, machine-checked (exit 0, 0 unsolved
  goals): a bounded controller keeps milk below its curdle envelope and the milk
  phase never becomes CURDLED. Wired into proofs/Makefile alongside the re-homed
  Dough/PoachedEgg/EchoBridge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tions

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit 708e9f1 into main Jun 15, 2026
20 of 22 checks passed
@hyperpolymath
hyperpolymath deleted the feat/v2-dsl-elevation branch June 22, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant