Skip to content

feat(extensions): publish canonical semantic-generation input and provenance contract #728

Description

@flyingrobots

Purpose

Expose a pure, versioned wesley-core contract that external generators such as echo-wesley-gen can consume without scraping CLI JSON, duplicating canonicalization, or adopting Wesley's descriptor-only external-target protocol.

This is the only Wesley-owned prerequisite requested by the Echo provider handoff in flyingrobots/echo#650. Echo-specific declarations, validation, lawpacks, target profiles, authority facts, and provider packaging remain in flyingrobots/echo.

Contract

Add a domain-neutral ExtensionGenerationInputV1 that composes:

  • canonical WesleyIR;
  • the normalized operation catalog;
  • optional validated LawIrV1 plus exact hashes;
  • explicit owner-declaration artifact references;
  • an explicit generator-settings digest;
  • requested projection roles.

Add canonical serialization and hashing APIs plus a GenerationProvenanceManifestV1 binding:

  • generator coordinate, version, and digest;
  • exact source artifact references and digests;
  • generation-input digest;
  • settings digest;
  • schema and ABI versions;
  • emitted artifact references and digests.

Emit a deterministic review JSON projection that is explicitly derived and non-authoritative.

Acceptance criteria

  • Repeated construction produces byte-identical canonical input and provenance bytes.
  • Reordering set-like declarations does not change canonical bytes.
  • Shape, Law, owner-declaration, or settings changes move the input digest.
  • Paths, timestamps, request IDs, environment, and other ambient metadata cannot affect semantic input.
  • One coordinate with conflicting digests fails with a stable structured diagnostic.
  • Provenance verification recomputes every referenced source and output digest.
  • An external Rust crate consumes the public API without spawning the wesley CLI.
  • Review JSON is deterministic and clearly non-authoritative.
  • Checked JSON fixtures validate against published schemas.
  • Documentation states that target semantics and output schemas remain externally owned.

Boundaries

  • No echo.* or Edict runtime types in Wesley.
  • No Echo/Edict semantic interpretation.
  • No filesystem discovery, registry lookup, network, clock, environment, or target execution.
  • No revival of retired Wesley browser/Bun/Deno hosts.
  • No implementation of the unfinished executable-target protocol.

Dependencies

Design inputs are already landed in flyingrobots/edict#139 and flyingrobots/edict#141. Co-design with the Echo semantic-source slice under flyingrobots/echo#650.

This blocks only final provenance integration in Echo's generated provider-artifact slice. It does not block Echo semantic inventory, lowerer design, verifier design, or provider-manifest design. Wesley #651 is conditional only if the chosen minimal fixture requires its additional profile metadata; Wesley #453 is adjacent, not a prerequisite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestlegend:EVIDENCEEvidence/Holmes/CI/proof worklegend:PLATFORMPlatform/infrastructure worklegend:TRANSMUTETransformation/emitter/generator workpkg:wesley-corework:enablerCreates capability needed for a later product slice

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions