Repository navigation
echo-wesley-gen carries local generator behavior that wants to live in Wesley #674
Description
Activity
- addedlegend:PLATFORMPlatform/infrastructure workPlatform/infrastructure work
on Jun 1, 2026 🔗 Related PRs
flyingrobots/echo#344 - feat(wesley): consume canonical requirements artifacts [merged]
flyingrobots/echo#365 - feat(wesley): emit query observer host helpers [merged]
flyingrobots/echo#382 - 0024 universal LE binary codec + 0025 sessions design (design-only) [merged]
flyingrobots/echo#383 - chore(dev-loop): kill the slow iteration loop on echo-wesley-gen tests [merged]
flyingrobots/echo#385 - docs(backlog): two follow-ups from the 2026-05-30 merge session [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.- Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:issue_enrichment: auto_enrich: enabled: false
💬 Have feedback or questions? Drop into our discord!
🔗 Related PRs
#389 - feat(echo): implement complete E0–E4 roadmap (22/22 tasks) [merged]
#402 - feat: add WASM ABI codec generation to generator-echo [merged]
#499 - test(stack): add Stack Witness 0001 fixture artifact shape [merged]
#504 - Compile runtime optic artifacts [merged]
#618 - feat: LE binary Rust codec emitter (le-binary-rust) + output-object codecs [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.- Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:issue_enrichment: auto_enrich: enabled: false
💬 Have feedback or questions? Drop into our discord!
- addedtriage:bad-codeDebt intake that still needs scheduling, closure, or a repo moveDebt intake that still needs scheduling, closure, or a repo move
on Jul 5, 2026 Bookkeeping triage: restored the required scheduling-state label
triage:bad-codefrom the migrated bad-code backlog source. This remains debt intake until scheduled, split, moved, or closed.Roadmap reconsideration after the Rust-native reset:
Closing this as non-actionable in Wesley as written. It is a migrated bad-code card about
echo-wesley-geninternals and older cross-repo generator duplication. Some concerns were real, but the card itself says the fixes should become separate Wesley cycles and should not be implemented wholesale here.The current Wesley-owned pieces already have better tracking surfaces:
- deterministic contract/profile metadata: Keep Wesley profile-neutral for deterministic contract extensions #651
- structural IR/schema diff classification:
wesley diff <old-ir> <new-ir>: structural classifier for schema migrations #672 - cross-language fixture vectors: idea(codecs): emit cross-language LE binary fixture vectors #673
- external target protocol and descriptor verification: landed through the recent target-protocol slices
Echo-specific generator cleanup should live in Echo once Wesley exposes the needed generic surface. Keeping this as a Wesley bad-code task would preserve old cross-repo sludge instead of naming the exact compiler work.
Migrated from Method backlog
This issue was created from a legacy filesystem backlog card. GitHub Issues are now the live work tracker; repository docs remain Method evidence.
Source backlog:
docs/method/backlog/bad-code/PLATFORM_echo-wesley-gen-local-emitter-duplication.mdOriginal lane:
bad-codeOriginal legend:
PLATFORMOriginal backlog card
echo-wesley-gencarries local generator behavior that wants to live in WesleyLegend:
PLATFORMThe smell
crates/echo-wesley-gen/src/main.rscurrently carries generatorbehavior that should eventually live upstream in wesley-core / the
Wesley emitter, with echo's copy collapsing on a dependency bump.
The duplication exists because echo could not wait for wesley-core
to ship the matching behavior before PR flyingrobots/echo#382 (universal LE binary
codec) landed; the echo-side fixes were the minimum-viable response
to keep flyingrobots/echo#382 mergeable.
Concrete examples currently in the file:
fnv1_stepand the duplicatedstable_op_idderivation. Thesource comment is explicit: "Must stay bytewise identical to
wesley_core::stable_op_id(added in wesley-core ≥0.0.5). Theduplication will collapse when echo bumps its wesley-core
dependency to 0.0.5+; until then both copies are pinned to the
same outputs in unit tests." Cross-language op-id drift is the
exact class of thing that waits patiently and then bites during a
release.
ir.codec_idnormalization. PR 0024 universal LE binary codec + 0025 sessions design (design-only) echo#382 patched the generator toforce
ir.codec_id = DEFAULT_CODEC_IDafter parsing, so theartifact hash / observer identity / footprint certificate
preimages cannot be computed under a stale codec id. The right
long-term home for that policy is the Wesley IR validator, not a
per-emitter prologue.
use echo_wasm_abi::codec::{Decode as _, Encode as _};). Added becausegenerated
impl Encode / Decodebodies call method-syntax.encode(w)/Type::decode(r)on nested user types. The Wesleyemitter should own this prelude shape rather than having every
generator that targets the codec trait re-derive it.
scalar_list_element_encoder/_decoder(and the priorscalar-helper fix in
8ef2fc97) belong in the canonical WesleyTypeScript / Rust emitters that target
no_stdconsumers, notduplicated in echo-wesley-gen alone.
The sibling concern in the jedit repo is
jedit/docs/method/backlog/bad-code/generated-rope-codec-manual-fixes.md,which records the same shape one layer downstream: jedit carries
hand-edits on a generated codec file because the TS emitter does
not yet produce the trailing-byte check. Same root cause; different
half of the stack.
Why this matters
stable_op_id/fnv1_step)that has two implementations in two repos must stay byte-wise
identical forever. Until the duplication collapses, one repo can
drift and the only thing that catches it is the unit test that
pins both sides — and only if it stays current with both
implementations.
load-bearing for artifact identity (the hash preimage formerly
could be derived under one codec while the artifact advertised
another). Putting that policy in the IR validator would make it
impossible to skip — the current shape is a per-binary prologue
that a sibling generator can omit.
the eventual collapse-onto-wesley-core diff and makes the version
bump scarier. Today this is ~50 lines; left for two more PR
cycles it will be ~500.
The fix shape
stable_op_idderivation to wesley-core≥0.0.5 (or whichever version actually ships it), bump echo's
wesley-core dependency, and delete the local copy + its pinned
test. The pinned vectors stay; they just become a regression
against the upstream function.
ir.codec_idnormalization to the wesley-core IRvalidator. Echo's generator then trusts the IR rather than
patching it post-parse.
trait-targeting generators. Echo's generator drops the manual
tokens.extendfor those imports.Rust emitter targets the
no_stdmapping correctly in listcontexts (this is the same issue PR 0024 universal LE binary codec + 0025 sessions design (design-only) echo#382 fixed at scalar AND list
level locally). The jedit-side sibling card tracks the TS emitter
half.
Out of scope here
belongs in its own Wesley cycle / PR with the matching pinned
vectors and test surface.
upstream replacement has shipped, the dependency bump has landed
on echo's main, and the pinned regression tests stay green
against the upstream surface.
Trigger / acceptance
Resolve this card when:
stable_op_id/fnv1_step(or namedequivalents) and echo bumps the dep.
crates/echo-wesley-gen/src/main.rsdeletes the duplicatedhelper and its doc comment; the pinned op-id regression test
keeps the contract.
normalization; the generator drops the post-parse
ir.codec_id = ...patch.ID list element mapping; the generator drops the manual
tokens.extendfor those.Companion
jedit/docs/method/backlog/bad-code/generated-rope-codec-manual-fixes.md— same root cause, downstream half. The two cards should resolve
together; resolving one alone leaves the other carrying the
emitter gap.
docs/method/backlog/cool-ideas/PLATFORM_wesley-gen-test-loop-speedup.md— orthogonal but adjacent (it touches echo-wesley-gen's test
harness, this card touches echo-wesley-gen's emit logic).