Skip to content

Define the canonical Workshop comment and source-preservation contract #32

Description

@Teakowa

Parent: #108

Goal

Define the remaining canonical workshop-rs source-preservation contract for authored Workshop comments/trivia and mixed-source consumers without introducing a second opaque representation for Workshop semantics that the current WIR already models canonically.

Current status

Rebaselined from the original workshop-rs 0.1.1 premise.

The current raw Workshop parser/WIR/validation/emitter surface now represents ordinary supported Workshop semantics canonically. A source-language consumer embedding vanilla Workshop should therefore parse/use that canonical representation rather than require a DEL-local or workshop-rs opaque/raw rule model merely because the source originated inside another language.

The durable remaining owner-side question is source preservation: authored comments/trivia and any source-level attachment/provenance needed for safe mixed-source tooling and reconstruction.

Context

del-rs Issue #32 and historical Draft PR #42 provide consumer evidence for source files that mix DEL/OSTW constructs with vanilla Workshop blocks and comments. workshop-rs owns the Workshop-language representation and preservation semantics; del-rs owns how its source grammar embeds/resolves those regions.

Scope

  • Define which Workshop comments/trivia are preserved as part of the public source/WIR contract and which are presentation-only/non-semantic.
  • Define stable attachment/provenance semantics for authored rule/action/condition/settings comments where preservation is supported.
  • Preserve enough source structure for diagnostics, source-aware editing, and useful reconstruction without requiring exact whole-file formatting reproduction.
  • Ensure embedded supported vanilla Workshop content uses the same canonical parser/WIR/validation/emitter path as standalone raw Workshop.
  • Define explicit failure/incompleteness behavior for malformed, genuinely unsupported, legacy, or evidence-insufficient embedded Workshop content.
  • Add focused parse/preserve/edit/emit/reparse evidence for comments and mixed-source Workshop regions where the owner-side contract applies.
  • Keep the contract suitable for consumers other than DEL/OSTW.

Non-goals

  • A second opaque/raw WIR representation for ordinary supported Workshop semantics.
  • DEL/OSTW grammar, project loading, source embedding syntax, or runtime lowering.
  • Exact formatting/trivia identity for untouched whole files unless separately required by a source-edit contract.
  • Full pretty-printer regeneration as the default edit model.
  • Workshop-to-DEL decompilation.
  • A provider-local catalog or emitter.

Acceptance criteria

  • Ordinary embedded Workshop constructs use the same canonical Workshop semantic representation as standalone raw Workshop.
  • A reviewed public contract defines supported comment/trivia preservation and attachment/provenance behavior.
  • Supported source-aware edits can preserve unrelated comments/trivia and structure rather than requiring full regeneration.
  • Malformed/unsupported embedded content fails or remains explicitly incomplete without guessed semantics.
  • Parser/WIR/emitter/source APIs provide enough stable provenance for consumers to explain and preserve authored Workshop content.
  • del-rs and future consumers can integrate through public Workshop source/semantic APIs without copying parser/catalog/emitter logic or inventing a parallel raw Workshop model.

Relationships

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions