Skip to content

Define canonical Workshop artifact formats and SourceMap #272

Description

@e54-bot

Parent decision: #271 · ADR-0013 (docs/adr/0013-source-mapping-across-provider-boundary.md)

Readiness: ready-for-implementation. First in the chain; the LPP, opy-rs, and Wright follow-ups depend on it.

Goal

Implement the canonical Workshop artifact formats and the public SourceMap defined by ADR-0013, and the shape guard on attached source mappings.

Scope

  • Document workshop-rs/text-v1 and workshop-rs/mapped-text-v1 (file table, program shape, position-keyed spans).
  • Public SourceMap: extract from a span-bearing Program; apply to a Program parsed from the same Workshop text; reject the whole mapping on shape mismatch.
  • Shape guard: attached mappings record the shape they were attached to; span accessors return None after structural drift.
  • Mapping granularity per ADR-0013: rule, condition, action, direct action argument, declarations.

Non-goals

Acceptance criteria

  • Both formats are documented in docs/source-preservation.md and the public API docs.
  • SourceMap extract → emit → parse → apply round-trips every mapped position on real-project fixtures.
  • A shape mismatch rejects the whole mapping with a typed error; no partial application.
  • After inserting or removing a rule, condition, or action, affected span accessors return None (tested).
  • Columns use Position units (1-based Unicode scalar values), tested with non-ASCII source.
  • cargo-semver-checks shows the change is additive.

Activity

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 request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions