You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--config FILE is the intended "one schema, many outputs" entry point, but its outputs are restricted to converters.LANGUAGES:
// dist/generation-config.jsconstlanguageValue=(value)=>converters.LANGUAGES.some((language)=>language===value);constparseOutput=([language,path])=>!languageValue(language)
? err({message: `unsupported output language '${language}'`})
: …
tdbin is not a converter language, so there is no way to say "also emit the codec module here" in a config file. tdbin generation has to be driven as separate encode/decode shell-outs, outside the config, outside --watch.
That splits one logical generation step into two mechanisms with two failure modes, and --watch regenerates only half of it — leaving codecs silently stale against the types they encode. Given that the whole point of the LAYOUT_HASH constant is to catch layout drift, having the tooling cause drift on every watched edit is a bad default.
Ask
Make tdbin a first-class config output. Something like:
Deslop generates Rust + TypeScript from one .td file today via a wrapper script that invokes the CLI once per target and post-processes each. Adding tdbin should add a line to a config file, not a third bespoke code path.
Problem
--config FILEis the intended "one schema, many outputs" entry point, but its outputs are restricted toconverters.LANGUAGES:tdbin is not a converter language, so there is no way to say "also emit the codec module here" in a config file. tdbin generation has to be driven as separate
encode/decodeshell-outs, outside the config, outside--watch.That splits one logical generation step into two mechanisms with two failure modes, and
--watchregenerates only half of it — leaving codecs silently stale against the types they encode. Given that the whole point of theLAYOUT_HASHconstant is to catch layout drift, having the tooling cause drift on every watched edit is a bad default.Ask
Make tdbin a first-class config output. Something like:
{ "source": "docs/models/live-ipc.td", "outputs": { "rust": "crates/deslop-core/src/wire_generated.rs", "typescript": "clients/vscode/src/types/wire-generated.ts" }, "tdbin": { "rust": { "path": "crates/deslop-core/src/wire_codec.rs", "mode": "codec-only" }, "typescript": { "path": "clients/vscode/src/types/wire-codec.ts" } } }Requirements:
--watchregenerates types and codecs from the same parse, so they can never disagree.mode: "codec-only"maps to today'sdecodebehaviour (impls against externally-emitted types); a"full"mode maps toencode.LAYOUT_HASHset changed relative to the file on disk, so CI can gate wire-format changes. This is the tdbin analogue of the--checkmode requested in Generated output: provenance header (source SHA + version) + built-in --check + deterministic ordering #41, and it is what actually makes the format's schema-evolution guarantees enforceable rather than aspirational.Context
Deslop generates Rust + TypeScript from one
.tdfile today via a wrapper script that invokes the CLI once per target and post-processes each. Adding tdbin should add a line to a config file, not a third bespoke code path.Related: #41 (provenance header,
--check, deterministic ordering).