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.
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
SourceMapdefined by ADR-0013, and the shape guard on attached source mappings.Scope
workshop-rs/text-v1andworkshop-rs/mapped-text-v1(file table, program shape, position-keyed spans).SourceMap: extract from a span-bearingProgram; apply to aProgramparsed from the same Workshop text; reject the whole mapping on shape mismatch.Noneafter structural drift.Non-goals
#[non_exhaustive]onRule/Condition(tracked in Freeze the workshop-rs public API for 1.0 #252).Acceptance criteria
docs/source-preservation.mdand the public API docs.SourceMapextract → emit → parse → apply round-trips every mapped position on real-project fixtures.None(tested).Positionunits (1-based Unicode scalar values), tested with non-ASCII source.cargo-semver-checksshows the change is additive.