Skip to content

Zero hand-written Rust: prompt-generate the glue (dispatch, adapters, LSP wiring, wasm bindings) #40

Description

@omridevk

Principle (maintainer ruling)

A self-hosted toolchain is not self-hosted while any Rust is written by hand. The historical glue exemption (napl-cli dispatch, the 6 seam adapters, napl-lsp wiring, napl-wasm bindings) was pragmatic inheritance, not an endpoint. Bootstrapping does not require hand-written code - the pinned previous binary runs the gens, exactly as rustc builds rustc.

Scope

  • rust/crates/napl-cli/src/main.rs (dispatch) -> generated from a napl_cli prompt.
  • The 6 seam adapter files -> generated (their whole content is derivable from the shells' seam declarations; pairs with Layout boilerplate must be toolchain-injected, not hand-written in every prompt #37's derive-what-the-toolchain-knows principle).
  • napl-lsp server wiring -> generated.
  • rust/napl-wasm bindings -> generated (after the G2 transport contract is ruled).
  • End state: zero hand-written .rs in the repo; the only human-owned inputs are .napl prompts and project config.

Sequencing

After the store rewrite (#30) activates: the store-era seam surface is the stable thing to specify. Candidate order: adapters first (most mechanical), then dispatch, then LSP/wasm.

Acceptance criteria

  • Every .rs file in the shipping workspace is generated from a prompt and locked 0444.
  • A full bootstrap cycle (pinned binary -> gen all -> build new binary -> regen check) is green with no hand edits anywhere.
  • The glue-seam exemption is deleted from the standing policies.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p3Later work or needs redesign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions