@automovie/evidence 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/README.md +13 -9
  2. package/lib/IAutoMovieDevelopmentProps.d.ts +7 -6
  3. package/lib/IAutoMovieEvidenceConfigProps.d.ts +9 -8
  4. package/lib/IAutoMovieNarrativeProps.d.ts +0 -3
  5. package/lib/IAutoMovieNoNarrativeProps.d.ts +16 -0
  6. package/lib/{narrative/IProductionLayerStages.js → IAutoMovieNoNarrativeProps.js} +1 -1
  7. package/lib/IAutoMovieNoNarrativeProps.js.map +1 -0
  8. package/lib/createDevelopmentContractClaims.d.ts +21 -11
  9. package/lib/createDevelopmentContractClaims.js +30 -13
  10. package/lib/createDevelopmentContractClaims.js.map +1 -1
  11. package/lib/createEvidenceConfig.d.ts +3 -3
  12. package/lib/createEvidenceConfig.js +19 -12
  13. package/lib/createEvidenceConfig.js.map +1 -1
  14. package/lib/index.d.ts +7 -7
  15. package/lib/index.js +1 -7
  16. package/lib/index.js.map +1 -1
  17. package/lib/internal/index.d.ts +12 -0
  18. package/lib/internal/index.js +31 -0
  19. package/lib/internal/index.js.map +1 -0
  20. package/lib/internal/resolveSkillsDirectory.d.ts +8 -9
  21. package/lib/internal/resolveSkillsDirectory.js +9 -12
  22. package/lib/internal/resolveSkillsDirectory.js.map +1 -1
  23. package/lib/narrative/IPackageChecklistClaimProps.d.ts +5 -10
  24. package/lib/narrative/IPackageContractProps.d.ts +0 -8
  25. package/lib/narrative/IPackagePopulationContractProps.d.ts +1 -9
  26. package/lib/narrative/IProductionConfigProps.d.ts +1 -10
  27. package/lib/narrative/createBriefFiles.d.ts +2 -2
  28. package/lib/narrative/createBriefFiles.js +2 -2
  29. package/lib/narrative/createNarrativeUnitFiles.d.ts +19 -12
  30. package/lib/narrative/createNarrativeUnitFiles.js +22 -17
  31. package/lib/narrative/createNarrativeUnitFiles.js.map +1 -1
  32. package/lib/narrative/createPackageChecklistClaim.js +5 -10
  33. package/lib/narrative/createPackageChecklistClaim.js.map +1 -1
  34. package/lib/narrative/createPackageContract.d.ts +3 -3
  35. package/lib/narrative/createPackageContract.js +3 -8
  36. package/lib/narrative/createPackageContract.js.map +1 -1
  37. package/lib/narrative/createPackagePopulationContract.d.ts +7 -7
  38. package/lib/narrative/createPackagePopulationContract.js +10 -18
  39. package/lib/narrative/createPackagePopulationContract.js.map +1 -1
  40. package/lib/narrative/index.d.ts +11 -14
  41. package/lib/narrative/index.js +11 -14
  42. package/lib/narrative/index.js.map +1 -1
  43. package/lib/narrative/internal/REALIZED_LAYERS.d.ts +1 -1
  44. package/lib/narrative/internal/REALIZED_LAYERS.js +1 -1
  45. package/lib/narrative/internal/claims/createDiscoveryClaim.d.ts +11 -3
  46. package/lib/narrative/internal/claims/createDiscoveryClaim.js +17 -5
  47. package/lib/narrative/internal/claims/createDiscoveryClaim.js.map +1 -1
  48. package/lib/narrative/internal/claims/createExpressionObligationClaims.d.ts +9 -8
  49. package/lib/narrative/internal/claims/createExpressionObligationClaims.js +15 -22
  50. package/lib/narrative/internal/claims/createExpressionObligationClaims.js.map +1 -1
  51. package/lib/narrative/internal/claims/createInstructionCoverageClaim.d.ts +6 -4
  52. package/lib/narrative/internal/claims/createInstructionCoverageClaim.js +7 -5
  53. package/lib/narrative/internal/claims/createInstructionCoverageClaim.js.map +1 -1
  54. package/lib/narrative/internal/claims/createLayerClaims.d.ts +9 -9
  55. package/lib/narrative/internal/claims/createLayerClaims.js +45 -65
  56. package/lib/narrative/internal/claims/createLayerClaims.js.map +1 -1
  57. package/lib/narrative/internal/claims/createOutlineClaims.js +8 -8
  58. package/lib/narrative/internal/claims/createOutlineClaims.js.map +1 -1
  59. package/lib/narrative/internal/claims/createPopulationObligationClaims.d.ts +3 -3
  60. package/lib/narrative/internal/claims/createPopulationObligationClaims.js +5 -5
  61. package/lib/narrative/internal/claims/createPopulationObligationClaims.js.map +1 -1
  62. package/lib/narrative/internal/claims/createReviewClaims.d.ts +8 -8
  63. package/lib/narrative/internal/claims/createReviewClaims.js +64 -77
  64. package/lib/narrative/internal/claims/createReviewClaims.js.map +1 -1
  65. package/lib/narrative/internal/claims/createSettingCoverageClaim.d.ts +1 -1
  66. package/lib/narrative/internal/claims/createSettingCoverageClaim.js +6 -7
  67. package/lib/narrative/internal/claims/createSettingCoverageClaim.js.map +1 -1
  68. package/lib/narrative/internal/claims/index.d.ts +8 -0
  69. package/lib/narrative/internal/claims/index.js +25 -0
  70. package/lib/narrative/internal/claims/index.js.map +1 -0
  71. package/lib/narrative/internal/collectProductionClaims.js +5 -2
  72. package/lib/narrative/internal/collectProductionClaims.js.map +1 -1
  73. package/lib/narrative/internal/index.d.ts +16 -0
  74. package/lib/narrative/internal/index.js +33 -0
  75. package/lib/narrative/internal/index.js.map +1 -0
  76. package/lib/narrative/internal/metadataRewrite/index.d.ts +43 -0
  77. package/lib/narrative/internal/metadataRewrite/index.js +60 -0
  78. package/lib/narrative/internal/metadataRewrite/index.js.map +1 -0
  79. package/lib/narrative/internal/references/createCoverageReference.d.ts +1 -2
  80. package/lib/narrative/internal/references/createCoverageReference.js +2 -2
  81. package/lib/narrative/internal/references/createCoverageReference.js.map +1 -1
  82. package/lib/narrative/internal/references/createDiscoveryReferences.d.ts +2 -2
  83. package/lib/narrative/internal/references/createDiscoveryReferences.js +2 -2
  84. package/lib/narrative/internal/references/createLanguagePrincipleReferences.d.ts +7 -6
  85. package/lib/narrative/internal/references/createLanguagePrincipleReferences.js +7 -7
  86. package/lib/narrative/internal/references/createLanguagePrincipleReferences.js.map +1 -1
  87. package/lib/narrative/internal/references/createLineageReference.d.ts +7 -8
  88. package/lib/narrative/internal/references/createLineageReference.js +8 -8
  89. package/lib/narrative/internal/references/createLineageReference.js.map +1 -1
  90. package/lib/narrative/internal/references/createPrincipleReferences.d.ts +9 -8
  91. package/lib/narrative/internal/references/createPrincipleReferences.js +12 -12
  92. package/lib/narrative/internal/references/createPrincipleReferences.js.map +1 -1
  93. package/lib/narrative/internal/references/createSettingReferences.d.ts +3 -4
  94. package/lib/narrative/internal/references/createSettingReferences.js +6 -6
  95. package/lib/narrative/internal/references/createSettingReferences.js.map +1 -1
  96. package/lib/narrative/internal/references/index.d.ts +11 -0
  97. package/lib/narrative/internal/references/index.js +28 -0
  98. package/lib/narrative/internal/references/index.js.map +1 -0
  99. package/lib/narrative/internal/references/layerFiles.d.ts +5 -5
  100. package/lib/narrative/internal/references/layerFiles.js +5 -5
  101. package/lib/narrative/internal/topology/createTopologyFiles.d.ts +1 -1
  102. package/lib/narrative/internal/topology/createTopologyFiles.js +1 -1
  103. package/lib/narrative/internal/topology/index.d.ts +1 -0
  104. package/lib/narrative/internal/topology/index.js +18 -0
  105. package/lib/narrative/internal/topology/index.js.map +1 -0
  106. package/lib/narrative/internal/utilities/BODY_ROOT.d.ts +15 -0
  107. package/lib/narrative/internal/utilities/BODY_ROOT.js +20 -0
  108. package/lib/narrative/internal/utilities/BODY_ROOT.js.map +1 -0
  109. package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.d.ts +6 -6
  110. package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.js +6 -6
  111. package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js +6 -19
  112. package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js.map +1 -1
  113. package/lib/narrative/internal/utilities/createUnitFiles.d.ts +4 -6
  114. package/lib/narrative/internal/utilities/createUnitFiles.js +5 -7
  115. package/lib/narrative/internal/utilities/createUnitFiles.js.map +1 -1
  116. package/lib/narrative/internal/utilities/index.d.ts +8 -0
  117. package/lib/narrative/internal/utilities/index.js +25 -0
  118. package/lib/narrative/internal/utilities/index.js.map +1 -0
  119. package/lib/narrative/internal/utilities/referenceLocation.d.ts +6 -9
  120. package/lib/narrative/internal/utilities/referenceLocation.js +9 -14
  121. package/lib/narrative/internal/utilities/referenceLocation.js.map +1 -1
  122. package/package.json +8 -4
  123. package/src/IAutoMovieDevelopmentProps.ts +7 -6
  124. package/src/IAutoMovieEvidenceConfigProps.ts +9 -8
  125. package/src/IAutoMovieNarrativeProps.ts +0 -4
  126. package/src/IAutoMovieNoNarrativeProps.ts +18 -0
  127. package/src/createDevelopmentContractClaims.ts +38 -14
  128. package/src/createEvidenceConfig.ts +23 -13
  129. package/src/index.ts +8 -7
  130. package/src/internal/index.ts +14 -0
  131. package/src/internal/resolveSkillsDirectory.ts +9 -12
  132. package/src/narrative/IPackageChecklistClaimProps.ts +5 -11
  133. package/src/narrative/IPackageContractProps.ts +0 -9
  134. package/src/narrative/IPackagePopulationContractProps.ts +1 -10
  135. package/src/narrative/IProductionConfigProps.ts +1 -11
  136. package/src/narrative/createBriefFiles.ts +2 -2
  137. package/src/narrative/createNarrativeUnitFiles.ts +28 -20
  138. package/src/narrative/createPackageChecklistClaim.ts +5 -10
  139. package/src/narrative/createPackageContract.ts +3 -15
  140. package/src/narrative/createPackagePopulationContract.ts +11 -26
  141. package/src/narrative/index.ts +11 -14
  142. package/src/narrative/internal/REALIZED_LAYERS.ts +1 -1
  143. package/src/narrative/internal/claims/createDiscoveryClaim.ts +20 -6
  144. package/src/narrative/internal/claims/createExpressionObligationClaims.ts +15 -24
  145. package/src/narrative/internal/claims/createInstructionCoverageClaim.ts +8 -6
  146. package/src/narrative/internal/claims/createLayerClaims.ts +48 -78
  147. package/src/narrative/internal/claims/createOutlineClaims.ts +8 -8
  148. package/src/narrative/internal/claims/createPopulationObligationClaims.ts +5 -5
  149. package/src/narrative/internal/claims/createReviewClaims.ts +69 -91
  150. package/src/narrative/internal/claims/createSettingCoverageClaim.ts +5 -7
  151. package/src/narrative/internal/claims/index.ts +8 -0
  152. package/src/narrative/internal/collectProductionClaims.ts +7 -5
  153. package/src/narrative/internal/index.ts +16 -0
  154. package/src/narrative/internal/metadataRewrite/index.ts +43 -0
  155. package/src/narrative/internal/references/createCoverageReference.ts +1 -3
  156. package/src/narrative/internal/references/createDiscoveryReferences.ts +2 -2
  157. package/src/narrative/internal/references/createLanguagePrincipleReferences.ts +8 -9
  158. package/src/narrative/internal/references/createLineageReference.ts +7 -9
  159. package/src/narrative/internal/references/createPrincipleReferences.ts +13 -14
  160. package/src/narrative/internal/references/createSettingReferences.ts +5 -8
  161. package/src/narrative/internal/references/index.ts +11 -0
  162. package/src/narrative/internal/references/layerFiles.ts +5 -5
  163. package/src/narrative/internal/topology/createTopologyFiles.ts +1 -1
  164. package/src/narrative/internal/topology/index.ts +1 -0
  165. package/src/narrative/internal/utilities/BODY_ROOT.ts +17 -0
  166. package/src/narrative/internal/utilities/PACKAGE_DOCS_ROOT.ts +6 -6
  167. package/src/narrative/internal/utilities/assertProductionEvidenceSources.ts +6 -25
  168. package/src/narrative/internal/utilities/createUnitFiles.ts +5 -7
  169. package/src/narrative/internal/utilities/index.ts +8 -0
  170. package/src/narrative/internal/utilities/referenceLocation.ts +8 -18
  171. package/lib/narrative/AuthoredPass.d.ts +0 -16
  172. package/lib/narrative/AuthoredPass.js +0 -3
  173. package/lib/narrative/AuthoredPass.js.map +0 -1
  174. package/lib/narrative/IProductionLayerStages.d.ts +0 -15
  175. package/lib/narrative/IProductionLayerStages.js.map +0 -1
  176. package/lib/narrative/internal/hasNaturalness.d.ts +0 -14
  177. package/lib/narrative/internal/hasNaturalness.js +0 -19
  178. package/lib/narrative/internal/hasNaturalness.js.map +0 -1
  179. package/lib/narrative/internal/utilities/passRoot.d.ts +0 -16
  180. package/lib/narrative/internal/utilities/passRoot.js +0 -22
  181. package/lib/narrative/internal/utilities/passRoot.js.map +0 -1
  182. package/lib/narrative/stripNaturalnessComments.d.ts +0 -12
  183. package/lib/narrative/stripNaturalnessComments.js +0 -34
  184. package/lib/narrative/stripNaturalnessComments.js.map +0 -1
  185. package/src/narrative/AuthoredPass.ts +0 -16
  186. package/src/narrative/IProductionLayerStages.ts +0 -16
  187. package/src/narrative/internal/hasNaturalness.ts +0 -17
  188. package/src/narrative/internal/utilities/passRoot.ts +0 -20
  189. package/src/narrative/stripNaturalnessComments.ts +0 -31
@@ -0,0 +1,11 @@
1
+ export * from "./createCoverageReference";
2
+ export * from "./createDiscoveryReferences";
3
+ export * from "./createLanguageDiscoveryReferences";
4
+ export * from "./createLanguagePrincipleReferences";
5
+ export * from "./createLineageReference";
6
+ export * from "./createLocalContractReference";
7
+ export * from "./createPrincipleReferences";
8
+ export * from "./createSettingReferences";
9
+ export * from "./createSharedReference";
10
+ export * from "./createUpstreamReference";
11
+ export * from "./layerFiles";
@@ -7,14 +7,14 @@ import { isCanonLayer } from "../isCanonLayer";
7
7
  *
8
8
  * Placement is decided by who can truthfully answer an item, so the axis is
9
9
  * the same wherever it appears: everyone, then the layers that inherit a unit,
10
- * then the layers holding literal text, then one layer. Both gates and both
11
- * scopes reuse it, because the question of who can answer does not change with
12
- * when the answer is owed.
10
+ * then the layers holding literal text, then one layer. The principles and
11
+ * expression families and both scopes reuse it, because the question of who
12
+ * can answer does not depend on which family asks it.
13
13
  *
14
14
  * @evidence contracts/development/implementation.md#principled-implementation The fixed candidate order is common, optional inherited-narrative, optional literal-text and exact layer, matching the respondent populations declared by the four-layer pipeline.
15
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared axis serves discovery/principle/obligation selection without duplicating layer eligibility decisions across gates or language scopes.
15
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One shared axis serves discovery/principle/obligation selection without duplicating layer eligibility decisions across families or language scopes.
16
16
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Canon layers omit inherited narrative duties and only REALIZED_LAYERS receives literal-text duties, both explicit semantic differences of the supported pipeline.
17
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains narrowest-last order and why eligibility depends on the respondent rather than gate timing.
17
+ * @evidence contracts/development/common.md#meaningful-documentation The prose explains narrowest-last order and why eligibility depends on the respondent rather than the asking family.
18
18
  * @evidence contracts/development/implementation.md#efficient-algorithms At most four filenames and one constant-time Set membership check are produced, giving constant work and space independent of manuscript length.
19
19
  * @evidence contracts/development/implementation.md#reuse-equivalent-work REALIZED_LAYERS is the shared eligibility set, while the returned array is fresh so filtering or mutation by one family cannot alter another family selection.
20
20
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The at-most-four-element result is caller-owned and no cache or resource handle is retained.
@@ -5,7 +5,7 @@ import type { NarrativeScope } from "../../NarrativeScope";
5
5
  * Captures indexes and misplaced files without widening an exact pilot slice.
6
6
  *
7
7
  * @evidence contracts/development/implementation.md#principled-implementation Topology captures all descendants of a layer so indexes and malformed paths remain visible, narrowing scripts/screenplay only to the exact declared pilot part; treatments stay flat at validation time.
8
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One selector helper separates broad topology capture from the partitioned/flat-short authored-unit selector used by ordinary evidence.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One selector helper separates broad topology capture from the partition and film-folder authored-unit selector used by ordinary evidence.
9
9
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The first-part pilot is a declared production scope, so the selector retains that exact slice instead of widening to other parts.
10
10
  * @evidence contracts/development/common.md#meaningful-documentation The comment explains why indexes and misplaced files are included while an exact pilot slice stays narrow.
11
11
  * @evidence contracts/development/implementation.md#efficient-algorithms One conditional constructs one glob string; work and returned storage scale only with layer and optional part text lengths.
@@ -0,0 +1 @@
1
+ export * from "./createTopologyFiles";
@@ -0,0 +1,17 @@
1
+ import { PACKAGE_DOCS_ROOT } from "./PACKAGE_DOCS_ROOT";
2
+
3
+ /**
4
+ * Names the docs subtree that holds every authored narrative body.
5
+ *
6
+ * Every authored claim hosts this tree, and every inherited reference selects
7
+ * it, because each layer's authored text lives only in the body.
8
+ *
9
+ * Principled implementation: The value joins PACKAGE_DOCS_ROOT with `body`, the one location the document layout gives authored layers.
10
+ * Clear and simple design: One constant supplies the body spelling to every claim factory and reference builder, derived from the docs folder so the two cannot drift.
11
+ * Prohibited implementation shortcuts: The body directory is a declared production layout value; it is not selected from fixture names, measured output or host-specific paths.
12
+ * Meaningful documentation: The prose states that the body is the single authored tree hosts and references share.
13
+ * Efficient algorithms: The string initializer is constant-sized and performs no filesystem or population traversal.
14
+ * Reuse equivalent work: Consumers reuse the same immutable string, so no equivalent derivation or invalidation mechanism is needed unless the source layout contract changes.
15
+ * Bound retention and release resources: One fixed string is retained for module lifetime; it has no dynamic population, file handle or task to release.
16
+ */
17
+ export const BODY_ROOT: string = `${PACKAGE_DOCS_ROOT}/body`;
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Names the package's docs folder.
3
3
  *
4
- * Authored claims select body or the naturalness working tree through `passRoot`.
5
- * Only the instruction coverage reference uses this constant directly,
6
- * because `docs/instructions` is input that belongs to neither pass.
4
+ * Authored claims select the body through `BODY_ROOT`. The instruction and
5
+ * review relations use this constant directly, because their documents sit
6
+ * beside the body rather than in it.
7
7
  *
8
- * Principled implementation: The literal docs string is the package-relative document directory shared by pass roots and instruction references, rather than a resolved filesystem identity.
9
- * Clear and simple design: One constant supplies the common directory spelling while passRoot owns the distinction between current body and naturalness working text.
8
+ * Principled implementation: The literal docs string is the package-relative document directory shared by the body root and the instruction and review locations, rather than a resolved filesystem identity.
9
+ * Clear and simple design: One constant supplies the common directory spelling while BODY_ROOT names the authored body inside it.
10
10
  * Prohibited implementation shortcuts: The docs directory is a declared production layout value; it is not selected from fixture names, measured output or host-specific paths.
11
- * Meaningful documentation: The prose identifies which consumers use the constant directly and which select an authored pass through passRoot.
11
+ * Meaningful documentation: The prose identifies which consumers use the constant directly and which select the body through BODY_ROOT.
12
12
  * Efficient algorithms: The string initializer is constant-sized and performs no filesystem or population traversal.
13
13
  * Reuse equivalent work: Consumers reuse the same immutable string, so no equivalent derivation or invalidation mechanism is needed unless the source layout contract changes.
14
14
  * Bound retention and release resources: One fixed string is retained for module lifetime; it has no dynamic population, file handle or task to release.
@@ -4,7 +4,6 @@ import type { AuthoredLayer } from "../../AuthoredLayer";
4
4
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
5
5
  import { AUTHORED_LAYERS } from "../AUTHORED_LAYERS";
6
6
  import { constructionStage } from "../constructionStage";
7
- import { hasNaturalness } from "../hasNaturalness";
8
7
  import { productionLayers } from "../productionLayers";
9
8
 
10
9
  /**
@@ -32,10 +31,7 @@ export function assertProductionEvidenceSources(
32
31
  const routed: readonly AuthoredLayer[] = productionLayers(props);
33
32
  for (const layer of AUTHORED_LAYERS) {
34
33
  if (routed.includes(layer)) continue;
35
- if (
36
- constructionStage(props, layer) !== "disabled" ||
37
- (hasNaturalness(layer) && props.naturalness.screenplay !== "disabled")
38
- )
34
+ if (constructionStage(props, layer) !== "disabled")
39
35
  throw new Error(
40
36
  "Layers outside the production route must stay disabled.",
41
37
  );
@@ -52,24 +48,9 @@ export function assertProductionEvidenceSources(
52
48
  props.construction.index !== "evidence"
53
49
  )
54
50
  throw new Error("Unknown outline stage.");
55
- for (const layer of AUTHORED_LAYERS)
56
- for (const pass of ["construction", "naturalness"] as const) {
57
- if (pass === "naturalness" && !hasNaturalness(layer)) continue;
58
- const stage: unknown =
59
- pass === "construction"
60
- ? constructionStage(props, layer)
61
- : props.naturalness.screenplay;
62
- if (stage !== "disabled" && stage !== "evidence")
63
- throw new Error("Unknown stage: a layer is disabled or evidence.");
64
- }
65
- if ("scripts" in props.naturalness)
66
- throw new Error(
67
- "Scripts finish in construction; remove naturalness.scripts.",
68
- );
69
- if (
70
- "settings" in props.naturalness ||
71
- "brief" in props.naturalness ||
72
- "treatments" in props.naturalness
73
- )
74
- throw new Error("Settings, brief and treatments finish in construction.");
51
+ for (const layer of AUTHORED_LAYERS) {
52
+ const stage: unknown = constructionStage(props, layer);
53
+ if (stage !== "disabled" && stage !== "evidence")
54
+ throw new Error("Unknown stage: a layer is disabled or evidence.");
55
+ }
75
56
  }
@@ -5,19 +5,17 @@ import { createNarrativeUnitFiles } from "../../createNarrativeUnitFiles";
5
5
  import { createSettingsFiles } from "../../createSettingsFiles";
6
6
 
7
7
  /**
8
- * Selects authored unit files relative to body, revision, or the naturalness working tree.
8
+ * Selects authored unit files relative to the body root.
9
9
  *
10
10
  * Settings accepts the legacy flat layout, numbered subject folders or the
11
11
  * scaffold's domain folders, and a short's brief the domain folders. The
12
12
  * settings outline remains outside canon selectors. Narrative layers retain
13
- * their release partition or flat short screenplay and delegate to their own selector.
14
- * `referenceLocation` qualifies lineage targets against the revision snapshot;
15
- * both logical passes host the same current manuscript paths.
13
+ * their release partition or film folders and delegate to their own selector.
16
14
  *
17
- * @evidence contracts/development/implementation.md#principled-implementation Settings and brief use their dedicated canon selectors excluding outline navigation, while narrative layers delegate to the scope-validating partition/flat-short selector; all outputs remain relative to the selected pass root.
15
+ * @evidence contracts/development/implementation.md#principled-implementation Settings and brief use their dedicated canon selectors excluding outline navigation, while narrative layers delegate to the scope-validating partition and film-folder selector; all outputs remain relative to the body root.
18
16
  * @evidence contracts/development/implementation.md#clear-and-simple-structure This dispatcher owns the authored-layer distinction and delegates narrative pilot/complete-work rules rather than repeating their validation.
19
17
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Legacy flat settings and exact first-part pilots are supported layouts/scopes; invalid narrative scope is rejected by the shared selector rather than widened to a matching fixture.
20
- * @evidence contracts/development/common.md#meaningful-documentation The prose names supported settings layouts, outline exclusion, partitioned or flat-short narrative selection and revision-reference qualification.
18
+ * @evidence contracts/development/common.md#meaningful-documentation The prose names supported settings layouts, outline exclusion and partitioned or film-folder narrative selection relative to the body root.
21
19
  * @evidence contracts/development/implementation.md#efficient-algorithms Each branch returns at most two selectors; narrative branches also validate scope text, so cost/storage are bounded by the selected scope/path text and independent of manuscript size.
22
20
  * @evidence contracts/development/implementation.md#reuse-equivalent-work The same settings/narrative selector helpers serve hosts and references; fresh returned selector arrays keep config mutations local and no filesystem membership is cached.
23
21
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns the one- or two-string result; this dispatcher opens no handle, starts no task and retains no population state.
@@ -28,5 +26,5 @@ export function createUnitFiles(
28
26
  ): string[] {
29
27
  if (layer === "settings") return createSettingsFiles();
30
28
  if (layer === "brief") return createBriefFiles();
31
- return createNarrativeUnitFiles(layer, scope);
29
+ return createNarrativeUnitFiles({ layer, scope });
32
30
  }
@@ -0,0 +1,8 @@
1
+ export * from "./BODY_ROOT";
2
+ export * from "./PACKAGE_DOCS_ROOT";
3
+ export * from "./assertProductionEvidenceSources";
4
+ export * from "./createContractDirectory";
5
+ export * from "./createContractRoot";
6
+ export * from "./createEvidenceFiles";
7
+ export * from "./createUnitFiles";
8
+ export * from "./referenceLocation";
@@ -1,12 +1,9 @@
1
- import type { AuthoredPass } from "../../AuthoredPass";
2
- import { PACKAGE_DOCS_ROOT } from "./PACKAGE_DOCS_ROOT";
1
+ import { BODY_ROOT } from "./BODY_ROOT";
3
2
 
4
3
  /**
5
4
  * Gives reference targets an explicit address in the graph's global space.
6
5
  *
7
- * Upstream references select the promoted manuscript for either pass. This is
8
- * distinct from a naturalness claim's working host; revision references select
9
- * its frozen pre-revision snapshot.
6
+ * Every inherited reference selects the body, where each layer's authored text lives.
10
7
  *
11
8
  * File references use package-relative addresses. A claim that selects file
12
9
  * hosts and a claim that selects section hosts read the same documents, and the
@@ -16,17 +13,16 @@ import { PACKAGE_DOCS_ROOT } from "./PACKAGE_DOCS_ROOT";
16
13
  * a section host. A distinct address space keeps each annotation with the
17
14
  * reference it answers.
18
15
  *
19
- * @evidence contracts/development/implementation.md#principled-implementation Upstream draft/final references always target promoted body bytes, revision references target frozen bytes, and file references use package-global addresses distinct from H2-root addresses to avoid aggregate-target collisions.
16
+ * @evidence contracts/development/implementation.md#principled-implementation References always target the body, and file references use package-global addresses distinct from H2-root addresses to avoid aggregate-target collisions.
20
17
  * @evidence contracts/development/implementation.md#clear-and-simple-structure Address qualification is centralized for coverage, lineage and settings references, keeping native binder address-space rules out of their semantic flag builders.
21
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The file/H2 address distinction follows native aggregate binding semantics; no citation is rewritten to match an expected answer or silently redirected to a working edition.
22
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains promoted versus working ownership, frozen revision targets and why file references need a separate global address space.
18
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The file/H2 address distinction follows native aggregate binding semantics; no citation is rewritten to match an expected answer.
19
+ * @evidence contracts/development/common.md#meaningful-documentation The prose explains body targeting and why file references need a separate global address space.
23
20
  * @evidence contracts/development/implementation.md#efficient-algorithms File mode maps n selectors and their total text length p into qualified paths in O(n + p) work/storage; H2 mode constructs only its root and reuses the supplied files array.
24
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Coverage and lineage share this address rule, and H2 mode reuses the input selector array; there is no cache that could incorrectly equate mutable files arrays or different passes.
21
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work Coverage and lineage share this address rule, and H2 mode reuses the input selector array; there is no cache that could incorrectly equate mutable files arrays.
25
22
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns the returned root/files record; file mode owns n new strings while H2 mode retains the caller array reference, with no filesystem handle or running task.
26
23
  */
27
24
  export function referenceLocation(
28
25
  files: string[],
29
- pass: AuthoredPass | "revision",
30
26
  symbol: "file" | "h2" = "h2",
31
27
  ): {
32
28
  root: string;
@@ -35,13 +31,7 @@ export function referenceLocation(
35
31
  if (symbol === "file")
36
32
  return {
37
33
  root: ".",
38
- files: files.map(
39
- (file: string): string =>
40
- `${PACKAGE_DOCS_ROOT}/${pass === "revision" ? "revision" : "body"}/${file}`,
41
- ),
34
+ files: files.map((file: string): string => `${BODY_ROOT}/${file}`),
42
35
  };
43
- return {
44
- root: `${PACKAGE_DOCS_ROOT}/${pass === "revision" ? "revision" : "body"}`,
45
- files,
46
- };
36
+ return { root: BODY_ROOT, files };
47
37
  }
@@ -1,16 +0,0 @@
1
- /**
2
- * Names the two logical authored passes of one shared manuscript.
3
- *
4
- * `draft` means construction. `final` means screenplay naturalness. They select
5
- * `docs/body` and `docs/naturalness` respectively; construction evidence is detached,
6
- * while naturalness evidence stays inline in the working text.
7
- *
8
- * Naturalness compares its working text with the frozen construction snapshot
9
- * in `docs/revision`. The source flag chooses upstream approval dependencies.
10
- *
11
- * @evidence contracts/development/design.md#principled-representation The closed draft/final spelling maps authoring selections to body versus naturalness trees; final is the expression revision, not a creative approval.
12
- * @evidence contracts/development/design.md#minimal-and-owned-surface Two legacy selector spellings keep root selection separate from the construction/naturalness gate vocabulary.
13
- * @evidence contracts/development/design.md#prohibited-design-shortcuts The alias does not certify creative completion; its final spelling is explicitly expression revision.
14
- * @evidence contracts/development/common.md#meaningful-documentation The prose defines draft/final roots, detached versus inline evidence and frozen comparison dependencies.
15
- */
16
- export type AuthoredPass = "draft" | "final";
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AuthoredPass.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthoredPass.js","sourceRoot":"","sources":["../../src/narrative/AuthoredPass.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- import type { ProductionStage } from "./ProductionStage";
2
- /**
3
- * The independent naturalness stage of final screenplay.
4
- * Settings, treatments and scripts finish within construction; scripts
5
- * construction also answers its expression questions.
6
- *
7
- * @evidence contracts/development/design.md#principled-representation Only screenplay has a separate expression stage; scripts construction owns its expression questions, and documentary layers finish within construction.
8
- * @evidence contracts/development/design.md#minimal-and-owned-surface One field represents the actual revision pass without a frozen script-content cycle.
9
- * @evidence contracts/development/design.md#prohibited-design-shortcuts The factory checks stage values; the type supplies no disabled-check compensation or special consumer path.
10
- * @evidence contracts/development/common.md#meaningful-documentation The prose identifies construction-only layers and the screenplay naturalness stage.
11
- */
12
- export interface IProductionLayerStages {
13
- /** The stage of `screenplay` in this pass. */
14
- screenplay: ProductionStage;
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"IProductionLayerStages.js","sourceRoot":"","sources":["../../src/narrative/IProductionLayerStages.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import type { AuthoredLayer } from "../AuthoredLayer";
2
- /**
3
- * Only final screenplay has an independent expression pass. Scripts construction
4
- * also answers expression questions so content-shaped defects remain repairable.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation Literal membership limits separate expression revision to screenplay; scripts expression remains in construction.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The shared type guard keeps the same eligibility rule in claim factories and dependency validation.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The admitted layer is the actual separate expression pass, not a consumer-specific exception.
9
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies the separate expression layer and scripts construction responsibility; the return type narrows callers to the naturalness stage key.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms One literal comparison takes constant time and no collection allocation.
11
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure membership predicate coordinates no reusable requests or effectful work.
12
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function owns no retained state, descriptor or task.
13
- */
14
- export declare function hasNaturalness(layer: AuthoredLayer): layer is "screenplay";
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasNaturalness = hasNaturalness;
4
- /**
5
- * Only final screenplay has an independent expression pass. Scripts construction
6
- * also answers expression questions so content-shaped defects remain repairable.
7
- *
8
- * @evidence contracts/development/implementation.md#principled-implementation Literal membership limits separate expression revision to screenplay; scripts expression remains in construction.
9
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The shared type guard keeps the same eligibility rule in claim factories and dependency validation.
10
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The admitted layer is the actual separate expression pass, not a consumer-specific exception.
11
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies the separate expression layer and scripts construction responsibility; the return type narrows callers to the naturalness stage key.
12
- * @evidence contracts/development/implementation.md#efficient-algorithms One literal comparison takes constant time and no collection allocation.
13
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure membership predicate coordinates no reusable requests or effectful work.
14
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function owns no retained state, descriptor or task.
15
- */
16
- function hasNaturalness(layer) {
17
- return layer === "screenplay";
18
- }
19
- //# sourceMappingURL=hasNaturalness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasNaturalness.js","sourceRoot":"","sources":["../../../src/narrative/internal/hasNaturalness.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,wBAA+B,KAAoB;IACjD,OAAO,KAAK,KAAK,YAAY,CAAC;AAChC,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { AuthoredPass } from "../../AuthoredPass";
2
- /**
3
- * Names the docs subtree one pass writes into.
4
- *
5
- * Construction reads the current manuscript. Naturalness is written, evidenced,
6
- * and reviewed in its working tree before comment-free promotion to body.
7
- *
8
- * @evidence contracts/development/implementation.md#principled-implementation The draft edition addresses the current body tree and the final edition addresses the naturalness working tree; frozen revision references are deliberately handled by referenceLocation instead.
9
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One two-way pass-root rule is shared by authored claim factories, while upstream/frozen reference addressing stays with the relation owner.
10
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The final-to-naturalness mapping is the declared review-before-promotion lifecycle and does not redirect a consumer to fabricated final output.
11
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains current manuscript ownership and that naturalness is authored, evidenced and reviewed before comment-free promotion.
12
- * @evidence contracts/development/implementation.md#efficient-algorithms One branch and string interpolation allocate a fixed-size relative path, independent of file population or document size.
13
- * @evidence contracts/development/implementation.md#reuse-equivalent-work PACKAGE_DOCS_ROOT shares the directory spelling across callers; this pure fixed mapping has no effectful work or cross-request result cache.
14
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned path is caller-owned and constant-sized; there are no open handles, retained tasks or growing module collections.
15
- */
16
- export declare function passRoot(pass: AuthoredPass): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.passRoot = passRoot;
4
- const PACKAGE_DOCS_ROOT_1 = require("./PACKAGE_DOCS_ROOT");
5
- /**
6
- * Names the docs subtree one pass writes into.
7
- *
8
- * Construction reads the current manuscript. Naturalness is written, evidenced,
9
- * and reviewed in its working tree before comment-free promotion to body.
10
- *
11
- * @evidence contracts/development/implementation.md#principled-implementation The draft edition addresses the current body tree and the final edition addresses the naturalness working tree; frozen revision references are deliberately handled by referenceLocation instead.
12
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One two-way pass-root rule is shared by authored claim factories, while upstream/frozen reference addressing stays with the relation owner.
13
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The final-to-naturalness mapping is the declared review-before-promotion lifecycle and does not redirect a consumer to fabricated final output.
14
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains current manuscript ownership and that naturalness is authored, evidenced and reviewed before comment-free promotion.
15
- * @evidence contracts/development/implementation.md#efficient-algorithms One branch and string interpolation allocate a fixed-size relative path, independent of file population or document size.
16
- * @evidence contracts/development/implementation.md#reuse-equivalent-work PACKAGE_DOCS_ROOT shares the directory spelling across callers; this pure fixed mapping has no effectful work or cross-request result cache.
17
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned path is caller-owned and constant-sized; there are no open handles, retained tasks or growing module collections.
18
- */
19
- function passRoot(pass) {
20
- return `${PACKAGE_DOCS_ROOT_1.PACKAGE_DOCS_ROOT}/${pass === "final" ? "naturalness" : "body"}`;
21
- }
22
- //# sourceMappingURL=passRoot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"passRoot.js","sourceRoot":"","sources":["../../../../src/narrative/internal/utilities/passRoot.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AAExD;;;;;;;;;;;;;GAaG;AACH,kBAAyB,IAAkB;IACzC,OAAO,GAAG,qCAAiB,IAAI,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAC7E,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Removes complete HTML comments without changing any surrounding UTF-8 bytes.
3
- *
4
- * @evidence contracts/development/implementation.md#principled-implementation Fatal UTF-8 decoding validates bytes before delimiter-based removal of every complete HTML comment; retained subarrays are concatenated without decoding/re-encoding them, preserving exact surrounding bytes.
5
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The helper owns only byte-preserving comment removal; topology and evidence metadata policy remain with their callers.
6
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unclosed comments and invalid UTF-8 throw rather than being silently repaired; all HTML comments are removed regardless of evidence content.
7
- * @evidence contracts/development/common.md#meaningful-documentation The comment promises complete-comment removal and exact surrounding UTF-8 preservation; the thrown error names an unterminated working comment.
8
- * @evidence contracts/development/implementation.md#efficient-algorithms Decoding, forward delimiter searches and final concatenation take linear work in byte count; temporary decoded text, slice descriptors and returned bytes require linear memory.
9
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each buffer is processed independently because its bytes are the complete input and callers may mutate buffers; there is no coordinated request cache.
10
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Subarray views retain input storage only until concatenation and return; the result owns its output bytes, and the function opens no handle or task.
11
- */
12
- export declare function stripNaturalnessComments(bytes: Buffer): Buffer;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripNaturalnessComments = stripNaturalnessComments;
4
- const node_util_1 = require("node:util");
5
- /**
6
- * Removes complete HTML comments without changing any surrounding UTF-8 bytes.
7
- *
8
- * @evidence contracts/development/implementation.md#principled-implementation Fatal UTF-8 decoding validates bytes before delimiter-based removal of every complete HTML comment; retained subarrays are concatenated without decoding/re-encoding them, preserving exact surrounding bytes.
9
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The helper owns only byte-preserving comment removal; topology and evidence metadata policy remain with their callers.
10
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unclosed comments and invalid UTF-8 throw rather than being silently repaired; all HTML comments are removed regardless of evidence content.
11
- * @evidence contracts/development/common.md#meaningful-documentation The comment promises complete-comment removal and exact surrounding UTF-8 preservation; the thrown error names an unterminated working comment.
12
- * @evidence contracts/development/implementation.md#efficient-algorithms Decoding, forward delimiter searches and final concatenation take linear work in byte count; temporary decoded text, slice descriptors and returned bytes require linear memory.
13
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each buffer is processed independently because its bytes are the complete input and callers may mutate buffers; there is no coordinated request cache.
14
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Subarray views retain input storage only until concatenation and return; the result owns its output bytes, and the function opens no handle or task.
15
- */
16
- function stripNaturalnessComments(bytes) {
17
- new node_util_1.TextDecoder("utf-8", { fatal: true }).decode(bytes);
18
- const chunks = [];
19
- let offset = 0;
20
- while (true) {
21
- const opening = bytes.indexOf("<!--", offset);
22
- if (opening === -1) {
23
- chunks.push(bytes.subarray(offset));
24
- break;
25
- }
26
- const closing = bytes.indexOf("-->", opening + 4);
27
- if (closing === -1)
28
- throw new Error("Naturalness working file has an unclosed HTML comment.");
29
- chunks.push(bytes.subarray(offset, opening));
30
- offset = closing + 3;
31
- }
32
- return Buffer.concat(chunks);
33
- }
34
- //# sourceMappingURL=stripNaturalnessComments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stripNaturalnessComments.js","sourceRoot":"","sources":["../../src/narrative/stripNaturalnessComments.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AAExC;;;;;;;;;;GAUG;AACH,kCAAyC,KAAa;IACpD,IAAI,uBAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,MAAM,GAAW,CAAC,CAAC;IACvB,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,OAAO,GAAW,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtD,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACpC,MAAM;QACR,CAAC;QACD,MAAM,OAAO,GAAW,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;QAC1D,IAAI,OAAO,KAAK,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Names the two logical authored passes of one shared manuscript.
3
- *
4
- * `draft` means construction. `final` means screenplay naturalness. They select
5
- * `docs/body` and `docs/naturalness` respectively; construction evidence is detached,
6
- * while naturalness evidence stays inline in the working text.
7
- *
8
- * Naturalness compares its working text with the frozen construction snapshot
9
- * in `docs/revision`. The source flag chooses upstream approval dependencies.
10
- *
11
- * @evidence contracts/development/design.md#principled-representation The closed draft/final spelling maps authoring selections to body versus naturalness trees; final is the expression revision, not a creative approval.
12
- * @evidence contracts/development/design.md#minimal-and-owned-surface Two legacy selector spellings keep root selection separate from the construction/naturalness gate vocabulary.
13
- * @evidence contracts/development/design.md#prohibited-design-shortcuts The alias does not certify creative completion; its final spelling is explicitly expression revision.
14
- * @evidence contracts/development/common.md#meaningful-documentation The prose defines draft/final roots, detached versus inline evidence and frozen comparison dependencies.
15
- */
16
- export type AuthoredPass = "draft" | "final";
@@ -1,16 +0,0 @@
1
- import type { ProductionStage } from "./ProductionStage";
2
-
3
- /**
4
- * The independent naturalness stage of final screenplay.
5
- * Settings, treatments and scripts finish within construction; scripts
6
- * construction also answers its expression questions.
7
- *
8
- * @evidence contracts/development/design.md#principled-representation Only screenplay has a separate expression stage; scripts construction owns its expression questions, and documentary layers finish within construction.
9
- * @evidence contracts/development/design.md#minimal-and-owned-surface One field represents the actual revision pass without a frozen script-content cycle.
10
- * @evidence contracts/development/design.md#prohibited-design-shortcuts The factory checks stage values; the type supplies no disabled-check compensation or special consumer path.
11
- * @evidence contracts/development/common.md#meaningful-documentation The prose identifies construction-only layers and the screenplay naturalness stage.
12
- */
13
- export interface IProductionLayerStages {
14
- /** The stage of `screenplay` in this pass. */
15
- screenplay: ProductionStage;
16
- }
@@ -1,17 +0,0 @@
1
- import type { AuthoredLayer } from "../AuthoredLayer";
2
-
3
- /**
4
- * Only final screenplay has an independent expression pass. Scripts construction
5
- * also answers expression questions so content-shaped defects remain repairable.
6
- *
7
- * @evidence contracts/development/implementation.md#principled-implementation Literal membership limits separate expression revision to screenplay; scripts expression remains in construction.
8
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The shared type guard keeps the same eligibility rule in claim factories and dependency validation.
9
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The admitted layer is the actual separate expression pass, not a consumer-specific exception.
10
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies the separate expression layer and scripts construction responsibility; the return type narrows callers to the naturalness stage key.
11
- * @evidence contracts/development/implementation.md#efficient-algorithms One literal comparison takes constant time and no collection allocation.
12
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure membership predicate coordinates no reusable requests or effectful work.
13
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function owns no retained state, descriptor or task.
14
- */
15
- export function hasNaturalness(layer: AuthoredLayer): layer is "screenplay" {
16
- return layer === "screenplay";
17
- }
@@ -1,20 +0,0 @@
1
- import type { AuthoredPass } from "../../AuthoredPass";
2
- import { PACKAGE_DOCS_ROOT } from "./PACKAGE_DOCS_ROOT";
3
-
4
- /**
5
- * Names the docs subtree one pass writes into.
6
- *
7
- * Construction reads the current manuscript. Naturalness is written, evidenced,
8
- * and reviewed in its working tree before comment-free promotion to body.
9
- *
10
- * @evidence contracts/development/implementation.md#principled-implementation The draft edition addresses the current body tree and the final edition addresses the naturalness working tree; frozen revision references are deliberately handled by referenceLocation instead.
11
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One two-way pass-root rule is shared by authored claim factories, while upstream/frozen reference addressing stays with the relation owner.
12
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The final-to-naturalness mapping is the declared review-before-promotion lifecycle and does not redirect a consumer to fabricated final output.
13
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains current manuscript ownership and that naturalness is authored, evidenced and reviewed before comment-free promotion.
14
- * @evidence contracts/development/implementation.md#efficient-algorithms One branch and string interpolation allocate a fixed-size relative path, independent of file population or document size.
15
- * @evidence contracts/development/implementation.md#reuse-equivalent-work PACKAGE_DOCS_ROOT shares the directory spelling across callers; this pure fixed mapping has no effectful work or cross-request result cache.
16
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned path is caller-owned and constant-sized; there are no open handles, retained tasks or growing module collections.
17
- */
18
- export function passRoot(pass: AuthoredPass): string {
19
- return `${PACKAGE_DOCS_ROOT}/${pass === "final" ? "naturalness" : "body"}`;
20
- }
@@ -1,31 +0,0 @@
1
- import { TextDecoder } from "node:util";
2
-
3
- /**
4
- * Removes complete HTML comments without changing any surrounding UTF-8 bytes.
5
- *
6
- * @evidence contracts/development/implementation.md#principled-implementation Fatal UTF-8 decoding validates bytes before delimiter-based removal of every complete HTML comment; retained subarrays are concatenated without decoding/re-encoding them, preserving exact surrounding bytes.
7
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The helper owns only byte-preserving comment removal; topology and evidence metadata policy remain with their callers.
8
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Unclosed comments and invalid UTF-8 throw rather than being silently repaired; all HTML comments are removed regardless of evidence content.
9
- * @evidence contracts/development/common.md#meaningful-documentation The comment promises complete-comment removal and exact surrounding UTF-8 preservation; the thrown error names an unterminated working comment.
10
- * @evidence contracts/development/implementation.md#efficient-algorithms Decoding, forward delimiter searches and final concatenation take linear work in byte count; temporary decoded text, slice descriptors and returned bytes require linear memory.
11
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each buffer is processed independently because its bytes are the complete input and callers may mutate buffers; there is no coordinated request cache.
12
- * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Subarray views retain input storage only until concatenation and return; the result owns its output bytes, and the function opens no handle or task.
13
- */
14
- export function stripNaturalnessComments(bytes: Buffer): Buffer {
15
- new TextDecoder("utf-8", { fatal: true }).decode(bytes);
16
- const chunks: Buffer[] = [];
17
- let offset: number = 0;
18
- while (true) {
19
- const opening: number = bytes.indexOf("<!--", offset);
20
- if (opening === -1) {
21
- chunks.push(bytes.subarray(offset));
22
- break;
23
- }
24
- const closing: number = bytes.indexOf("-->", opening + 4);
25
- if (closing === -1)
26
- throw new Error("Naturalness working file has an unclosed HTML comment.");
27
- chunks.push(bytes.subarray(offset, opening));
28
- offset = closing + 3;
29
- }
30
- return Buffer.concat(chunks);
31
- }