Skip to content

refactor(cli): share native emit target dispatch #572

Description

@flyingrobots

Rust-native audit disposition

Kept and rewritten as current Rust CLI refactoring work.

crates/wesley-cli/src/main.rs still handles each native emit target with similar match-arm flow: parse options, read schema, lower to IR, collect operations, optionally load law data, call the target emitter, write output, and write metadata.

Current task

Introduce a small shared dispatch layer for native emit targets so adding or changing a target does not require copy-paste across command handling and help text.

Current targets include:

  • emit rust
  • emit typescript
  • emit le-binary-rust
  • emit le-binary-typescript

Acceptance criteria

  • Shared code owns the common schema/IR/operation/law-loading flow.
  • Target-specific code remains explicit for options and emitter calls.
  • CLI help and command dispatch stay in sync through one source of target metadata or a tested equivalent.
  • Existing CLI integration tests remain green.
  • At least one focused test proves all emit targets are still listed and routable.

Out of scope

  • External target execution.
  • New emit targets.
  • Changing generated artifact contents.

Activity

  1. added
    triage:bad-codeDebt intake that still needs scheduling, closure, or a repo move
    legend:RUNTIMERuntime/tooling/host/operator flow work
    on Jun 4, 2026
  2. coderabbitai commented on Jun 4, 2026

    @coderabbitai
    🔗 Related PRs

    #521 - Add Rust IR performance baseline [merged]
    #526 - feat: add rust-native doctor command [merged]
    #534 - Validate strict weslaw bindings [merged]
    #618 - feat: LE binary Rust codec emitter (le-binary-rust) + output-object codecs [merged]
    #686 - docs: add plain Wesley onboarding path [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command 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!

  3. flyingrobots commented on Jun 25, 2026

    @flyingrobots
    OwnerAuthor

    Triage decision: keep this in Wesley and move it out of the inbox into lane:v0.4.0 / Goalpost: Make It Boring.

    Rationale: Duplicate emit-target handler plumbing is concrete CLI maintainability debt in Wesley itself.

    This is scheduled core Wesley work now, not an inbox item. The triage label is being removed as part of this state change.

  4. added
    v0.4.0Scheduled work for the v0.4.0 release.
    and removed
    triage:bad-codeDebt intake that still needs scheduling, closure, or a repo move
    on Jun 25, 2026
  5. changed the title [-]`wesley emit <target>` handlers are copy-paste[/-] [+]refactor(cli): share native emit target dispatch[/+] on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlegend:RUNTIMERuntime/tooling/host/operator flow workpkg:wesley-cliv0.4.0Scheduled work for the v0.4.0 release.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions