Skip to content

Ship bounded native Braid Capsule DSL v0 - #90

Merged
srinji-kaggss merged 1 commit into
mainfrom
feat/native-braid-dsl-v0
Aug 30, 2026
Merged

srinji-kaggss merged 1 commit into
mainfrom
feat/native-braid-dsl-v0

Conversation

@srinji-kaggss

Copy link
Copy Markdown
Owner

Based on main at 41c1a9cf. Closes #77.

The gap

The only human CLI authoring path was JSON shaped exactly like the IR. The JavaScript elaborator proved the frontend seam, but it could not express the Day-0 CMS graph as native Braid source. D6 therefore remained unfired and Braid still had no bounded language of its own.

The fix

Ratify D33 and add one closed cms::v1 Capsule grammar. The frontend bounds source work before allocation, lowers exclusively through braid_sdk::Builder, compares declared capabilities and effects to the derived graph, encodes the existing Capsule wire, and re-enters the independent verifier before returning success.

A general-purpose grammar was the rejected alternative. It is worse because schemas, state, Flow, imports, macros, recurrence, literals, and arbitrary registries do not have canonical substrate contracts. Accepting syntax for them would create a second authority by implication.

The real user path

$ braid dsl check crates/braid-elaborate-dsl/tests/fixtures/edit-home-hero.brd
capsule: 26f6162e1a5fb5f6e3a46724a991a8b4dc48e08c223016fb86c3c8de38594226
intent: demo-port: edit the home hero section and render a preview — reversible, local
ir_version: 0
vocab_version: 1
registry: afaa7dcc9ab2f7d1530da72306c7d821c573f8aa9eda2b5c6e463f121f634acd
capabilities: signal.emit
effects: pure, reversible-write
irreversible_strands: 0
egress_strands: 0
strands: 4
cost: 12 / budget 20
confirm: none
evidence: fact.cid

cid 26f6162e1a5fb5f6e3a46724a991a8b4dc48e08c223016fb86c3c8de38594226
exit 0

$ braid dsl check /dev/null
error: /dev/null: BRD004_UNEXPECTED_TOKEN at byte 0: expected keyword `capsule`, found Eof
exit 2

Regressions

Twenty crate-level cases drive source through parse, lowering, canonical encoding, independent admission, and rendering. They include ten pinned CID programs, typed refusals for authority and effect mismatches, hostile UTF-8 generation, and bounded pipeline work. Four black-box CLI cases compare the DSL and JSON-of-IR bytes, verify widening behavior, and prove rejected source leaves no artifact. Two execution cases prepare the verifier and planner proofs and reach execute_runnable; a transplanted authority set is refused before any host call.

Source-only names do not alter identity

Three golden variants rename only the source capsule or step label and retain the same CID. The labels are diagnostics, not hidden fields in the canonical wire.

Touched-surface account

surface files constraint
parser, lowering, and source fixtures 7 one version, one registry, no new wire or verifier
CLI and black-box tests 3 check writes nothing; compile writes only after admission
workspace and lock wiring 2 only workspace-local crate edges added
decision, spec, debt, README, and journey 7 D33 unlocks only the enumerated v0 subset

Full CI, run locally at 3f287331f8c5

gate result
.wwfd/local-ci.sh GREEN, 27/27 lanes
workspace tests and doctests passed
strict Clippy passed with -D warnings
lgwks_std feature and MSRV matrix passed
package smoke packed and compiled an external consumer
no path fallback and version pin passed

Receipt: /Users/srinji/wwfd/state/local-ci-receipt.json, subject 3f287331f8c5.

What is still not done

Schemas, state and statecharts, Flow authoring, imports, macros, recurrence, runtime literal payloads, arbitrary registries, and replacement-language claims remain refused. This does not publish crates, update the installed binary, or fix the dependency register that is currently operating with enforcement disabled; those are separate release and dependency-authority changes.

@srinji-kaggss
srinji-kaggss merged commit e40aab4 into main Aug 30, 2026
14 checks passed
@srinji-kaggss
srinji-kaggss deleted the feat/native-braid-dsl-v0 branch August 30, 2026 17:18
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.

P1: Ship the first real Braid authoring elaborator without bypassing D6

1 participant