No open questions and no blocking questions; implementation binding present, verifier binding present, and expected-outcome oracle none.
Intent
actor
A coding agent or maintainer.
outcome
Convert a TypeScript-carrier Spec into an idiomatic Markdown carrier beside its source.
value
The TypeScript DSL remains an import source and a lawful per-ID option; the author chooses which carrier remains canonical.
Behavior
ruleline 18 · specs/carrier/sdp-import.sdp.md:18
Import writes the emitted Markdown sibling beside the TypeScript carrier and never deletes the source carrier.
ruleline 19 · specs/carrier/sdp-import.sdp.md:19
A written Markdown sibling and its retained TypeScript source carry the same Spec id; before extracting both paths in one root, the author keeps one canonical surface by moving, renaming, excluding or removing the source, and the import success message explains this hand-off.
ruleline 20 · specs/carrier/sdp-import.sdp.md:20
Import refuses an existing Markdown sibling rather than overwriting it.
ruleline 21 · specs/carrier/sdp-import.sdp.md:21
Refusal outcomes retain the TypeScript reifier findings and add import-local findings honestly.
ruleline 22 · specs/carrier/sdp-import.sdp.md:22
Import consumes the TypeScript reifier so source acceptance follows one validation path.
ruleline 23 · specs/carrier/sdp-import.sdp.md:23
Import accepts only carriers whose builders come from the public package or its /anchors subpath; a relative builder import that a source checkout trusts during extraction is refused here.
ruleline 24 · specs/carrier/sdp-import.sdp.md:24
sdp import converts Spec carriers; Pack manifests are out of scope — the TypeScript manifest stays a lawful per-ID option.
ruleline 25 · specs/carrier/sdp-import.sdp.md:25
A batch walks only ordinary directory entries in requested source directories, skips dot-directories and node_modules, dist, generated and coverage, selects .sdp.ts files, canonicalizes physical carrier identity, and computes refusals and target collisions before publishing.
ruleline 26 · specs/carrier/sdp-import.sdp.md:26
Publication prepares exclusive temporary siblings and atomically creates targets without clobbering; rollback attempts every artifact, reports survivors, and never deletes a TypeScript source.
import/refusal, import/pack-unsupported, import/target-exists, import/unsupported-construct, import/invalid-source-path, import/no-sources and import/empty name the importer's findings; retained TypeScript reifier findings keep their own ids.
sdp import <path...> --dry-run computes refusals and target collisions, prints the planned Markdown siblings and writes none.
no citation recorded
Verification
Verifier bindings
spec:carrier.sdp-import.round-trip · A TypeScript carrier survives import as an equal Markdown graph · declared · example enabled · specs/carrier/sdp-import.round-trip.sdp.md
External run evidence from test/self-hosting-sdp-import.test.ts
Specs default to Markdown; Packs remain TS until a Pack syntax ruling; the TS DSL survives as import source and a lawful per-ID option. Later refinements keep this default and the one-surface law without repealing them: the Pack syntax ruling completes Pack Markdown, and the Gherkin carrier option admits graph-aware Gherkin as a lawful per-ID option for behavior and example Specs only, with the canonical suffix settled as .sdp.gherkin.
component:protocol.import · canonical conversion with a fidelity boundary · src/import/import.ts:45 · role service · layer application · context protocol
impl:protocol.import-fidelity · refuses Markdown emission that changes authored meaning · src/import/markdown-fidelity.ts:102 · role validator · component component:protocol.import · layer application · context protocol
impl:protocol.sdp-import · plans, refuses, and publishes TypeScript-to-Markdown Spec imports · src/cli/import-command.ts:71 · role service · component component:protocol.cli · layer edge · context protocol
impl:protocol.sdp-import-core · converts a TypeScript-carrier Spec into an idiomatic Markdown twin · src/import/import.ts:58 · role service · component component:protocol.import · layer application · context protocol
impl:protocol.sdp-import-markdown-emit · emits the Markdown document twin for an imported Spec · src/import/emit-markdown.ts:253 · role codec · component component:protocol.import · layer application · context protocol
impl:protocol.sdp-import-publish · stages Markdown siblings and publishes them with atomic hard links · src/cli/import-publish.ts:23 · role publisher · component component:protocol.cli · layer edge · context protocol
impl:protocol.sdp-import-scan · collects .sdp.ts paths and reports scan failures · src/cli/import-scan.ts:62 · role service · component component:protocol.cli · layer edge · context protocol
Design reference: none
Verifier binding: present
spec:carrier.sdp-import.round-trip · A TypeScript carrier survives import as an equal Markdown graph · declared · specs/carrier/sdp-import.round-trip.sdp.md · example enabled