@automovie/evidence 0.1.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 (173) 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 -8
  15. package/lib/index.js +1 -8
  16. package/lib/index.js.map +1 -1
  17. package/lib/internal/index.d.ts +5 -0
  18. package/lib/internal/index.js +7 -0
  19. package/lib/internal/index.js.map +1 -1
  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 +0 -4
  41. package/lib/narrative/index.js +0 -4
  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/collectProductionClaims.js +5 -2
  69. package/lib/narrative/internal/collectProductionClaims.js.map +1 -1
  70. package/lib/narrative/internal/index.d.ts +0 -1
  71. package/lib/narrative/internal/index.js +0 -1
  72. package/lib/narrative/internal/index.js.map +1 -1
  73. package/lib/narrative/internal/references/createCoverageReference.d.ts +1 -2
  74. package/lib/narrative/internal/references/createCoverageReference.js +2 -2
  75. package/lib/narrative/internal/references/createCoverageReference.js.map +1 -1
  76. package/lib/narrative/internal/references/createDiscoveryReferences.d.ts +2 -2
  77. package/lib/narrative/internal/references/createDiscoveryReferences.js +2 -2
  78. package/lib/narrative/internal/references/createLanguagePrincipleReferences.d.ts +7 -6
  79. package/lib/narrative/internal/references/createLanguagePrincipleReferences.js +7 -7
  80. package/lib/narrative/internal/references/createLanguagePrincipleReferences.js.map +1 -1
  81. package/lib/narrative/internal/references/createLineageReference.d.ts +7 -8
  82. package/lib/narrative/internal/references/createLineageReference.js +8 -8
  83. package/lib/narrative/internal/references/createLineageReference.js.map +1 -1
  84. package/lib/narrative/internal/references/createPrincipleReferences.d.ts +9 -8
  85. package/lib/narrative/internal/references/createPrincipleReferences.js +12 -12
  86. package/lib/narrative/internal/references/createPrincipleReferences.js.map +1 -1
  87. package/lib/narrative/internal/references/createSettingReferences.d.ts +3 -4
  88. package/lib/narrative/internal/references/createSettingReferences.js +6 -6
  89. package/lib/narrative/internal/references/createSettingReferences.js.map +1 -1
  90. package/lib/narrative/internal/references/layerFiles.d.ts +5 -5
  91. package/lib/narrative/internal/references/layerFiles.js +5 -5
  92. package/lib/narrative/internal/topology/createTopologyFiles.d.ts +1 -1
  93. package/lib/narrative/internal/topology/createTopologyFiles.js +1 -1
  94. package/lib/narrative/internal/utilities/BODY_ROOT.d.ts +15 -0
  95. package/lib/narrative/internal/utilities/BODY_ROOT.js +20 -0
  96. package/lib/narrative/internal/utilities/BODY_ROOT.js.map +1 -0
  97. package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.d.ts +6 -6
  98. package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.js +6 -6
  99. package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js +6 -19
  100. package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js.map +1 -1
  101. package/lib/narrative/internal/utilities/createUnitFiles.d.ts +4 -6
  102. package/lib/narrative/internal/utilities/createUnitFiles.js +5 -7
  103. package/lib/narrative/internal/utilities/createUnitFiles.js.map +1 -1
  104. package/lib/narrative/internal/utilities/index.d.ts +1 -1
  105. package/lib/narrative/internal/utilities/index.js +1 -1
  106. package/lib/narrative/internal/utilities/index.js.map +1 -1
  107. package/lib/narrative/internal/utilities/referenceLocation.d.ts +6 -9
  108. package/lib/narrative/internal/utilities/referenceLocation.js +9 -14
  109. package/lib/narrative/internal/utilities/referenceLocation.js.map +1 -1
  110. package/package.json +8 -4
  111. package/src/IAutoMovieDevelopmentProps.ts +7 -6
  112. package/src/IAutoMovieEvidenceConfigProps.ts +9 -8
  113. package/src/IAutoMovieNarrativeProps.ts +0 -4
  114. package/src/IAutoMovieNoNarrativeProps.ts +18 -0
  115. package/src/createDevelopmentContractClaims.ts +38 -14
  116. package/src/createEvidenceConfig.ts +23 -13
  117. package/src/index.ts +8 -8
  118. package/src/internal/index.ts +7 -0
  119. package/src/internal/resolveSkillsDirectory.ts +9 -12
  120. package/src/narrative/IPackageChecklistClaimProps.ts +5 -11
  121. package/src/narrative/IPackageContractProps.ts +0 -9
  122. package/src/narrative/IPackagePopulationContractProps.ts +1 -10
  123. package/src/narrative/IProductionConfigProps.ts +1 -11
  124. package/src/narrative/createBriefFiles.ts +2 -2
  125. package/src/narrative/createNarrativeUnitFiles.ts +28 -20
  126. package/src/narrative/createPackageChecklistClaim.ts +5 -10
  127. package/src/narrative/createPackageContract.ts +3 -15
  128. package/src/narrative/createPackagePopulationContract.ts +11 -26
  129. package/src/narrative/index.ts +0 -4
  130. package/src/narrative/internal/REALIZED_LAYERS.ts +1 -1
  131. package/src/narrative/internal/claims/createDiscoveryClaim.ts +20 -6
  132. package/src/narrative/internal/claims/createExpressionObligationClaims.ts +15 -24
  133. package/src/narrative/internal/claims/createInstructionCoverageClaim.ts +8 -6
  134. package/src/narrative/internal/claims/createLayerClaims.ts +48 -78
  135. package/src/narrative/internal/claims/createOutlineClaims.ts +8 -8
  136. package/src/narrative/internal/claims/createPopulationObligationClaims.ts +5 -5
  137. package/src/narrative/internal/claims/createReviewClaims.ts +69 -91
  138. package/src/narrative/internal/claims/createSettingCoverageClaim.ts +5 -7
  139. package/src/narrative/internal/collectProductionClaims.ts +7 -5
  140. package/src/narrative/internal/index.ts +0 -1
  141. package/src/narrative/internal/references/createCoverageReference.ts +1 -3
  142. package/src/narrative/internal/references/createDiscoveryReferences.ts +2 -2
  143. package/src/narrative/internal/references/createLanguagePrincipleReferences.ts +8 -9
  144. package/src/narrative/internal/references/createLineageReference.ts +7 -9
  145. package/src/narrative/internal/references/createPrincipleReferences.ts +13 -14
  146. package/src/narrative/internal/references/createSettingReferences.ts +5 -8
  147. package/src/narrative/internal/references/layerFiles.ts +5 -5
  148. package/src/narrative/internal/topology/createTopologyFiles.ts +1 -1
  149. package/src/narrative/internal/utilities/BODY_ROOT.ts +17 -0
  150. package/src/narrative/internal/utilities/PACKAGE_DOCS_ROOT.ts +6 -6
  151. package/src/narrative/internal/utilities/assertProductionEvidenceSources.ts +6 -25
  152. package/src/narrative/internal/utilities/createUnitFiles.ts +5 -7
  153. package/src/narrative/internal/utilities/index.ts +1 -1
  154. package/src/narrative/internal/utilities/referenceLocation.ts +8 -18
  155. package/lib/narrative/AuthoredPass.d.ts +0 -16
  156. package/lib/narrative/AuthoredPass.js +0 -3
  157. package/lib/narrative/AuthoredPass.js.map +0 -1
  158. package/lib/narrative/IProductionLayerStages.d.ts +0 -15
  159. package/lib/narrative/IProductionLayerStages.js.map +0 -1
  160. package/lib/narrative/internal/hasNaturalness.d.ts +0 -14
  161. package/lib/narrative/internal/hasNaturalness.js +0 -19
  162. package/lib/narrative/internal/hasNaturalness.js.map +0 -1
  163. package/lib/narrative/internal/utilities/passRoot.d.ts +0 -16
  164. package/lib/narrative/internal/utilities/passRoot.js +0 -22
  165. package/lib/narrative/internal/utilities/passRoot.js.map +0 -1
  166. package/lib/narrative/stripNaturalnessComments.d.ts +0 -12
  167. package/lib/narrative/stripNaturalnessComments.js +0 -34
  168. package/lib/narrative/stripNaturalnessComments.js.map +0 -1
  169. package/src/narrative/AuthoredPass.ts +0 -16
  170. package/src/narrative/IProductionLayerStages.ts +0 -16
  171. package/src/narrative/internal/hasNaturalness.ts +0 -17
  172. package/src/narrative/internal/utilities/passRoot.ts +0 -20
  173. package/src/narrative/stripNaturalnessComments.ts +0 -31
@@ -4,8 +4,8 @@ import { SETTINGS_DOMAINS } from "./internal/SETTINGS_DOMAINS";
4
4
  * Selects a short's brief canon: the scaffold's domain folders under `docs/body/brief`.
5
5
  *
6
6
  * The brief keeps the settings domain layout, `brief/<domain>/<subject>.md`,
7
- * with the work's fixed conditions in `brief/world/work.md`, so the same reader,
8
- * which refuses mixed layouts, and the same citations serve both canon layers.
7
+ * so the same reader, which refuses mixed layouts, and the same citations
8
+ * serve both canon layers.
9
9
  *
10
10
  * @evidence contracts/development/implementation.md#principled-implementation One glob per scaffold domain admits the brief's canon, sharing SETTINGS_DOMAINS with the settings selector and reader so the layouts cannot drift; no top-level glob is admitted because the reader refuses a mixed layout.
11
11
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The selector only describes the brief population; the shared reader owns concrete ordering and layout checks.
@@ -6,27 +6,33 @@ import type { NarrativeScope } from "./NarrativeScope";
6
6
  *
7
7
  * `treatments` is flat and carries no release partition, so its population is
8
8
  * every numbered event file it holds — during a pilot the layer contains only
9
- * the pilot's events, so the same selector serves both modes. `scripts` and
10
- * long-form `screenplay` carry the part partition, so a pilot narrows them to
11
- * the one part it authors. Complete-work screenplay also selects flat Markdown
12
- * for short productions. Route topology validation rejects flat files in long
13
- * work rather than silently omitting their evidence.
9
+ * the pilot's events, so the same selector serves both modes. `scripts` holds
10
+ * one file per episode in its part folders, `NNN-part/NNN-episode.md`.
11
+ * `screenplay` holds one file per scene in a film folder: a short's
12
+ * `<film>/NNN-scene.md`, or long work's `NNN-part/NNN-episode/NNN-scene.md`,
13
+ * whose episode folder takes the place of the script's episode file. A pilot
14
+ * narrows scripts and screenplay to the one part it authors. The layer's
15
+ * topology selector still reaches every other file under it, so the H2s of a
16
+ * misplaced scene file owe their answers instead of silently losing them.
14
17
  *
15
- * The selector is relative to the authored pass root. A naturalness comparison uses the
16
- * same relative file identity under `docs/revision`.
18
+ * The selector is relative to the body root.
17
19
  *
18
- * @evidence contracts/development/implementation.md#principled-implementation Layer-specific globs preserve flat numbered treatments, partitioned scripts and exact first-part pilots; complete-work screenplay also captures flat short-film documents, with route-specific admission owned by topology validation.
19
- * @evidence contracts/development/implementation.md#clear-and-simple-structure The selector owns only relative narrative population paths; callers choose body, frozen or working roots independently.
20
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Flat short screenplays and numbered long partitions are supported production layouts; no file or production name controls selection, and first-part pilots remain confined to their exact directory.
21
- * @evidence contracts/development/common.md#meaningful-documentation The prose states layer partition differences, pilot behavior, root relativity and frozen-snapshot identity.
20
+ * @evidence contracts/development/implementation.md#principled-implementation Layer-specific globs select flat numbered treatments, episode files of scripts, and screenplay scene files in a short's film folder or long work's episode folders, narrowing scripts and screenplay to an exact first part for a pilot.
21
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The selector owns only relative narrative population paths; callers add the body root.
22
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Short film folders and numbered long partitions are supported production layouts; no file or production name controls selection, and first-part pilots remain confined to their exact directory.
23
+ * @evidence contracts/development/common.md#meaningful-documentation The prose states each layer's partition, the scene-file screenplay layout, pilot behavior and root relativity.
22
24
  * @evidence contracts/development/implementation.md#efficient-algorithms Complete-work returns one or two fixed-size globs; pilot validation and interpolation take time and output space proportional to the selected part string length.
23
25
  * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This selector builds one result from supplied values and coordinates no cross-request work; independent arrays avoid shared mutable selector state.
24
26
  * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Only the returned small selector array survives the call; no descriptor, task or module cache is acquired.
25
27
  */
26
- export function createNarrativeUnitFiles(
27
- layer: NarrativeLayer,
28
- scope: NarrativeScope,
29
- ): string[] {
28
+ export function createNarrativeUnitFiles(props: {
29
+ /** The narrative layer whose unit files are selected. */
30
+ layer: NarrativeLayer;
31
+
32
+ /** The complete work, or the exact first part a pilot authors. */
33
+ scope: NarrativeScope;
34
+ }): string[] {
35
+ const { layer, scope } = props;
30
36
  if (
31
37
  scope.mode !== "complete-work" &&
32
38
  (scope.mode !== "first-part-pilot" ||
@@ -36,9 +42,11 @@ export function createNarrativeUnitFiles(
36
42
  "A first-part pilot requires one exact 001-lower-kebab-case part directory.",
37
43
  );
38
44
  if (layer === "treatments") return [`${layer}/???-*.md`];
39
- if (scope.mode === "complete-work")
40
- return layer === "screenplay"
41
- ? [`${layer}/*.md`, `${layer}/*/???-*.md`]
42
- : [`${layer}/*/???-*.md`];
43
- return [`${layer}/${scope.part}/???-*.md`];
45
+ if (layer === "screenplay")
46
+ return scope.mode === "complete-work"
47
+ ? [`${layer}/*/???-*.md`, `${layer}/*/*/???-*.md`]
48
+ : [`${layer}/${scope.part}/*/???-*.md`];
49
+ return scope.mode === "complete-work"
50
+ ? [`${layer}/*/???-*.md`]
51
+ : [`${layer}/${scope.part}/???-*.md`];
44
52
  }
@@ -5,8 +5,8 @@ import type {
5
5
 
6
6
  import { PRODUCTION_CONTRACTS } from "../internal/PRODUCTION_CONTRACTS";
7
7
  import type { IPackageChecklistClaimProps } from "./IPackageChecklistClaimProps";
8
+ import { BODY_ROOT } from "./internal/utilities/BODY_ROOT";
8
9
  import { createEvidenceFiles } from "./internal/utilities/createEvidenceFiles";
9
- import { passRoot } from "./internal/utilities/passRoot";
10
10
 
11
11
  /**
12
12
  * Creates one work-local contract claim.
@@ -81,14 +81,10 @@ export function createPackageChecklistClaim(
81
81
  return {
82
82
  name: props.name,
83
83
  type: "markdown",
84
- root: passRoot(props.pass ?? "draft"),
84
+ root: BODY_ROOT,
85
85
  files: props.files,
86
86
  symbol: props.symbol,
87
- ...(props.pass === "final"
88
- ? {}
89
- : {
90
- evidenceFiles: createEvidenceFiles(symbols[0], props.files),
91
- }),
87
+ evidenceFiles: createEvidenceFiles(symbols[0], props.files),
92
88
  disabled: props.stage === "disabled" || props.inapplicable === true,
93
89
  reference: canonicalDocuments.map(
94
90
  (
@@ -116,9 +112,8 @@ export function createPackageChecklistClaim(
116
112
  * Keeps the package API on the tracked work-owned contract subtree.
117
113
  *
118
114
  * `naturalness` is admitted for the same reason the shared and language trees
119
- * carry one: a work's own observable form is a question its finished text
120
- * answers. Screenplay selects `pass: "final"` and its naturalness stage; scripts
121
- * select `pass: "draft"` and scripts construction explicitly. The document
115
+ * carry one: a work's own expression questions, which scripts construction
116
+ * answers. The caller selects the hosts and their stage; the document
122
117
  * directory alone never chooses its host population.
123
118
  */
124
119
  function isWorkDocument(document: string): boolean {
@@ -4,7 +4,6 @@ import type { AuthoredLayer } from "./AuthoredLayer";
4
4
  import type { IPackageContractProps } from "./IPackageContractProps";
5
5
  import type { ProductionStage } from "./ProductionStage";
6
6
  import { createPackageChecklistClaim } from "./createPackageChecklistClaim";
7
- import { hasNaturalness } from "./internal/hasNaturalness";
8
7
  import { createUnitFiles } from "./internal/utilities/createUnitFiles";
9
8
 
10
9
  /**
@@ -14,10 +13,10 @@ import { createUnitFiles } from "./internal/utilities/createUnitFiles";
14
13
  * out is the same claim four times with only the layer's name, stage, and file
15
14
  * glob changing. State the layers instead, and the wiring follows from them.
16
15
  *
17
- * @evidence contracts/development/implementation.md#principled-implementation Each declared layer stage becomes one checklist claim with that layer's exact narrative selector; final-pass contracts reject layers without naturalness before mapping.
16
+ * @evidence contracts/development/implementation.md#principled-implementation Each declared layer stage becomes one checklist claim with that layer's exact narrative selector, after an empty layer map is rejected.
18
17
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The wrapper keeps adopted rule identity and layer ownership together, delegating exact document/host checks to createPackageChecklistClaim.
19
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Only the two actual naturalness layers are admitted on final; no special claim name or fixture changes validation.
20
- * @evidence contracts/development/common.md#meaningful-documentation The prose states that one adopted contract expands to its owning layers; props document pass, granularity, activation and pilot scope.
18
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every authored layer is admitted on the same terms; no special claim name or fixture changes validation.
19
+ * @evidence contracts/development/common.md#meaningful-documentation The prose states that one adopted contract expands to its owning layers; props document granularity, activation and pilot scope.
21
20
  * @evidence contracts/development/implementation.md#efficient-algorithms For l owning layers, d document-path characters and f selector output, expansion costs O(l*(d+f)) through delegated validation; l is at most the supported authored layer set for typed callers.
22
21
  * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each layer needs a distinct claim and diagnostic name; equivalent shared document paths are inputs, not cached effectful results, and no cross-request coordinator is created.
23
22
  * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The result owns l claim objects and their delegated arrays; local layer entries are discarded on completion or failure, with no handles or running tasks.
@@ -28,16 +27,6 @@ export function createPackageContract(
28
27
  const layers: [string, ProductionStage][] = Object.entries(props.layers);
29
28
  if (layers.length === 0)
30
29
  throw new Error("A package contract requires at least one owning layer.");
31
- if (
32
- props.pass === "final" &&
33
- layers.some(
34
- ([layer]: [string, ProductionStage]): boolean =>
35
- !hasNaturalness(layer as AuthoredLayer),
36
- )
37
- )
38
- throw new Error(
39
- "Only screenplay has a naturalness pass; adopt scripts contracts in construction.",
40
- );
41
30
 
42
31
  return layers.map(
43
32
  ([layer, stage]: [string, ProductionStage]): IEvidenceClaim =>
@@ -46,7 +35,6 @@ export function createPackageContract(
46
35
  document: props.document,
47
36
  files: createUnitFiles(layer as AuthoredLayer, props.narrativeScope),
48
37
  stage,
49
- pass: props.pass,
50
38
  symbol: props.symbol,
51
39
  checklist: props.checklist,
52
40
  inapplicable: props.inapplicable,
@@ -7,25 +7,24 @@ import { PRODUCTION_CONTRACTS } from "../internal/PRODUCTION_CONTRACTS";
7
7
  import type { AuthoredLayer } from "./AuthoredLayer";
8
8
  import type { IPackagePopulationContractProps } from "./IPackagePopulationContractProps";
9
9
  import type { ProductionStage } from "./ProductionStage";
10
- import { hasNaturalness } from "./internal/hasNaturalness";
10
+ import { BODY_ROOT } from "./internal/utilities/BODY_ROOT";
11
11
  import { createEvidenceFiles } from "./internal/utilities/createEvidenceFiles";
12
12
  import { createUnitFiles } from "./internal/utilities/createUnitFiles";
13
- import { passRoot } from "./internal/utilities/passRoot";
14
13
 
15
14
  /**
16
15
  * Creates one population obligation claim per selected layer.
17
16
  *
18
- * The layer's own documents answer each duty once, at file level. Construction
19
- * uses detached evidence; naturalness uses a working-file comment. Each duty
20
- * has exactly one answering document. A duty is never repeated per H2, because a
21
- * population question restated on every unit is no longer one comparison.
17
+ * The layer's own documents answer each duty once, at file level, through
18
+ * detached construction evidence. Each duty has exactly one answering
19
+ * document. A duty is never repeated per H2, because a population question
20
+ * restated on every unit is no longer one comparison.
22
21
  *
23
- * @evidence contracts/development/implementation.md#principled-implementation An exact work/obligations path yields one unique-evidence file-level duty reference per owning layer; naturalness eligibility and pilot-only inapplicability are checked before constructing claims. The reference roots at the production's own `docs/contracts`, because the work obligation is production-owned even when a workspace keeps the shared contracts elsewhere.
22
+ * @evidence contracts/development/implementation.md#principled-implementation An exact work/obligations path yields one unique-evidence file-level duty reference per owning layer; pilot-only inapplicability is checked before constructing claims. The reference roots at the production's own `docs/contracts`, because the work obligation is production-owned even when a workspace keeps the shared contracts elsewhere.
24
23
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The factory keeps once-per-population ownership separate from per-H2 checklist expansion and delegates manuscript selectors to createUnitFiles.
25
24
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Pilot-only deferral follows the explicit scope contract; complete-work obligations cannot be suppressed through the inapplicable flag.
26
- * @evidence contracts/development/common.md#meaningful-documentation The comment identifies detached versus inline evidence, file-level answering and exactly one answering document per duty; props state ownership and deferral.
25
+ * @evidence contracts/development/common.md#meaningful-documentation The comment identifies detached evidence, file-level answering and exactly one answering document per duty; props state ownership and deferral.
27
26
  * @evidence contracts/development/implementation.md#efficient-algorithms The document path is scanned once, then l layer entries each produce selector strings and one reference. Time and allocation scale with path bytes plus layer/selector output; typed workloads have only the authored layer set.
28
- * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Claims remain distinct per layer and their evidence roots differ by pass; this stateless factory coordinates no reusable requests or mutable shared result.
27
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Claims remain distinct per layer with their own selectors and stages; this stateless factory coordinates no reusable requests or mutable shared result.
29
28
  * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Local path and entry arrays expire on return or throw; the returned claims own their reference and selector arrays and acquire no file handles or tasks.
30
29
  */
31
30
  export function createPackagePopulationContract(
@@ -52,16 +51,6 @@ export function createPackagePopulationContract(
52
51
  throw new Error(
53
52
  "A population contract requires at least one owning layer.",
54
53
  );
55
- if (
56
- props.pass === "final" &&
57
- layers.some(
58
- ([layer]: [string, ProductionStage]): boolean =>
59
- !hasNaturalness(layer as AuthoredLayer),
60
- )
61
- )
62
- throw new Error(
63
- "Only screenplay has a naturalness pass; adopt scripts obligations in construction.",
64
- );
65
54
  if (
66
55
  props.inapplicable === true &&
67
56
  props.narrativeScope.mode !== "first-part-pilot"
@@ -74,7 +63,7 @@ export function createPackagePopulationContract(
74
63
  ([layer, stage]: [string, ProductionStage]): {
75
64
  disabled: boolean;
76
65
  reference: IEvidenceMarkdownReference;
77
- evidenceFiles?: string[] | undefined;
66
+ evidenceFiles: string[];
78
67
  name: string;
79
68
  type: "markdown";
80
69
  root: string;
@@ -96,14 +85,10 @@ export function createPackagePopulationContract(
96
85
  return {
97
86
  name: `${layer} documents ${props.reason}`,
98
87
  type: "markdown",
99
- root: passRoot(props.pass ?? "draft"),
88
+ root: BODY_ROOT,
100
89
  files,
101
90
  symbol: "file",
102
- ...(props.pass === "final"
103
- ? {}
104
- : {
105
- evidenceFiles: createEvidenceFiles("file", files),
106
- }),
91
+ evidenceFiles: createEvidenceFiles("file", files),
107
92
  disabled: stage === "disabled" || props.inapplicable === true,
108
93
  reference: obligation,
109
94
  };
@@ -1,5 +1,4 @@
1
1
  export * from "./AuthoredLayer";
2
- export * from "./AuthoredPass";
3
2
  export * from "./EvidenceMetadataRewriteOwnership";
4
3
  export * from "./IEvidenceMetadataRenderedSample";
5
4
  export * from "./IEvidenceMetadataRewriteFile";
@@ -10,7 +9,6 @@ export * from "./IPackageContractProps";
10
9
  export * from "./IPackagePopulationContractProps";
11
10
  export * from "./IProductionConfigProps";
12
11
  export * from "./IProductionConstruction";
13
- export * from "./IProductionLayerStages";
14
12
  export * from "./NarrativeLayer";
15
13
  export * from "./NarrativeScope";
16
14
  export * from "./ProductionStage";
@@ -22,7 +20,5 @@ export * from "./createPackagePopulationContract";
22
20
  export * from "./createProductionClaims";
23
21
  export * from "./createProductionConfig";
24
22
  export * from "./createSettingsFiles";
25
- export * from "./internal";
26
23
  export * from "./isFirstPartPilot";
27
- export * from "./stripNaturalnessComments";
28
24
  export * from "./verifyEvidenceMetadataRewrite";
@@ -7,7 +7,7 @@ import type { AuthoredLayer } from "../AuthoredLayer";
7
7
  * below, so a question about the words themselves can only be asked here.
8
8
  *
9
9
  * Principled implementation: The set names scripts and screenplay as the only layers holding literal expression rather than documentary plans.
10
- * Clear and simple design: Naturalness question discovery shares this two-layer eligibility vocabulary.
10
+ * Clear and simple design: layerFiles reads this two-layer eligibility vocabulary for every contract family that asks about literal text.
11
11
  * Prohibited implementation shortcuts: The literal layers express supported domain responsibility and do not depend on caller or fixture identities.
12
12
  * Meaningful documentation: The prose states the ordering or expression-versus-plan distinction needed by consumers.
13
13
  * Efficient algorithms: Initialization stores a fixed four-element array or two-element set; iteration is bounded by that vocabulary and set membership is expected constant time.
@@ -2,8 +2,8 @@ import type { IEvidenceClaim } from "@wrtnlabs/evidence";
2
2
 
3
3
  import type { AuthoredLayer } from "../../AuthoredLayer";
4
4
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
5
- import type { ProductionStage } from "../../ProductionStage";
6
5
  import { constructionStage } from "../constructionStage";
6
+ import { productionLayers } from "../productionLayers";
7
7
  import { createDiscoveryReferences } from "../references/createDiscoveryReferences";
8
8
  import { createContractRoot } from "../utilities/createContractRoot";
9
9
 
@@ -27,11 +27,19 @@ import { createContractRoot } from "../utilities/createContractRoot";
27
27
  * one a work declared has to be possible in a single file; scattered through
28
28
  * the contracts it means reading the contracts to find out what was skipped.
29
29
  *
30
- * @evidence contracts/development/implementation.md#principled-implementation Open-world duties target shared/language discovery H2s while their hosts are the production's own work-contract files, rooted by createContractRoot at its own `docs/contracts` even when a workspace keeps the shared targets elsewhere, with negative findings centralized on one discovery carrier and stage activation derived from construction.
30
+ * Every layer's claim shares those hosts, and a citation resolves only to a
31
+ * contract some active claim selects. A finished layer turned back to
32
+ * `disabled` would therefore leave its recorded findings unresolvable for the
33
+ * layers still running. The claim stays active while its layer or any later
34
+ * layer of the route is in `evidence`: the route closes its layers in order,
35
+ * so an earlier layer's findings are written and stay checked, while a layer
36
+ * not yet reached owes none.
37
+ *
38
+ * @evidence contracts/development/implementation.md#principled-implementation Open-world duties target shared/language discovery H2s while their hosts are the production's own work-contract files, rooted by createContractRoot at its own `docs/contracts` even when a workspace keeps the shared targets elsewhere, with negative findings centralized on one discovery carrier; the claim is active while its layer or a later layer of the route is in evidence, so a closed earlier layer's findings keep resolving.
31
39
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The claim factory owns this contract-to-contract relation rather than asking manuscript units to testify about whether their contract was discovered.
32
40
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The one negative-results carrier is the declared discovery workflow, and canon layers omit narrative-layer questions through the shared reference factory rather than a consumer exception.
33
- * @evidence contracts/development/common.md#meaningful-documentation The prose identifies adopted-rule hosts, truthful negative findings, the single negative carrier and why manuscript hosts cannot answer this relation.
34
- * @evidence contracts/development/implementation.md#efficient-algorithms The factory constructs one claim and a fixed-size discovery-reference list; its one optional language-file existence probe and path operations dominate fixed population work, independent of manuscript length.
41
+ * @evidence contracts/development/common.md#meaningful-documentation The prose identifies adopted-rule hosts, truthful negative findings, the single negative carrier, why manuscript hosts cannot answer this relation and why a closed earlier layer's claim stays active.
42
+ * @evidence contracts/development/implementation.md#efficient-algorithms The factory scans at most four route stages and constructs one claim and a fixed-size discovery-reference list; its one optional language-file existence probe and path operations dominate fixed population work, independent of manuscript length.
35
43
  * @evidence contracts/development/implementation.md#reuse-equivalent-work Shared and language discovery reference builders own their selection rules; the optional language contract is probed on each config construction so installation changes are not hidden behind a cache.
36
44
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned claim and references are caller-owned, with a fixed family count; the synchronous existence probe exposes no retained handle or background task.
37
45
  */
@@ -39,7 +47,13 @@ export function createDiscoveryClaim(
39
47
  props: IProductionConfigProps,
40
48
  layer: AuthoredLayer,
41
49
  ): IEvidenceClaim {
42
- const stage: ProductionStage = constructionStage(props, layer);
50
+ const route: readonly AuthoredLayer[] = productionLayers(props);
51
+ const disabled: boolean = route
52
+ .slice(route.indexOf(layer))
53
+ .every(
54
+ (later: AuthoredLayer): boolean =>
55
+ constructionStage(props, later) === "disabled",
56
+ );
43
57
  return {
44
58
  name: `the ${layer} work-specific contract accounts for its open-world discovery duties`,
45
59
  type: "markdown",
@@ -47,7 +61,7 @@ export function createDiscoveryClaim(
47
61
  files: ["work/**/*.md"],
48
62
  evidenceExcludeCarriers: ["work/discovery/results.md"],
49
63
  symbol: "file",
50
- disabled: stage === "disabled",
64
+ disabled,
51
65
  reference: createDiscoveryReferences(props, layer),
52
66
  };
53
67
  }
@@ -8,34 +8,32 @@ import path from "node:path";
8
8
  import type { IContractLocation } from "../../../internal/IContractLocation";
9
9
  import type { AuthoredLayer } from "../../AuthoredLayer";
10
10
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
11
- import type { ProductionStage } from "../../ProductionStage";
12
- import { REALIZED_LAYERS } from "../REALIZED_LAYERS";
13
11
  import { constructionStage } from "../constructionStage";
14
- import { hasNaturalness } from "../hasNaturalness";
15
12
  import { createLocalContractReference } from "../references/createLocalContractReference";
16
13
  import { createSharedReference } from "../references/createSharedReference";
17
14
  import { layerFiles } from "../references/layerFiles";
15
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
18
16
  import { createContractDirectory } from "../utilities/createContractDirectory";
19
17
  import { createUnitFiles } from "../utilities/createUnitFiles";
20
- import { passRoot } from "../utilities/passRoot";
21
18
 
22
19
  /**
23
- * Creates population expression claims for the edition that settles its language.
20
+ * Creates the scripts population expression claims.
24
21
  *
25
22
  * A population question about expression, such as which sentence frames recur
26
23
  * or how endings converge, is about the language of the finished layer.
27
- * Scripts settles that language in construction; final screenplay settles it
28
- * in naturalness. The finished population answers once at file level under
29
- * the same stage as its unit expression questions.
24
+ * Scripts settle that language in construction, so the script population
25
+ * answers once at file level under the scripts construction stage. The
26
+ * screenplay settles its speech in construction too, under its realized-speech
27
+ * principles, and owes no separate expression family.
30
28
  *
31
29
  * The contract files sit under `naturalness/obligations`, a folder the unit
32
30
  * checklists never select, so a population duty cannot leak into a per-unit
33
31
  * checklist. A package whose contract predates the folder has no such claim.
34
32
  *
35
- * @evidence contracts/development/implementation.md#principled-implementation Only expression-bearing layers receive file-level obligation claims in their finished edition; installed shared and language files are selected separately, each requiring exactly one respondent for every population item; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
36
- * @evidence contracts/development/implementation.md#clear-and-simple-structure Expression population questions have their own file-level family; scripts use construction and screenplay uses naturalness without leaking whole-population duties into unit checklists.
37
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent optional obligation document produces no claim under the supported older-contract layout; settings/treatments have no independent naturalness stage by contract.
38
- * @evidence contracts/development/common.md#meaningful-documentation The prose identifies finished-text respondents, file-level population semantics, layer-specific activation and optional older contract families.
33
+ * @evidence contracts/development/implementation.md#principled-implementation Only scripts receive file-level expression obligation claims, under their construction stage; installed shared and language files are selected separately, each requiring exactly one respondent for every population item; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
34
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Expression population questions have their own file-level family under scripts construction without leaking whole-population duties into unit checklists.
35
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent optional obligation document produces no claim under the supported older-contract layout; every other layer finishes its language in its own construction questions.
36
+ * @evidence contracts/development/common.md#meaningful-documentation The prose identifies the scripts respondents, file-level population semantics, construction activation and optional older contract families.
39
37
  * @evidence contracts/development/implementation.md#efficient-algorithms layerFiles supplies at most four candidate documents per scope; a bounded number of synchronous existence probes and path constructions dominate, and returned claims/references are fixed in count.
40
38
  * @evidence contracts/development/implementation.md#reuse-equivalent-work Both scopes reuse layerFiles and shared reference constructors; existence is refreshed for each config build because installed contract files can change between builds.
41
39
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only bounded claim arrays and reference objects survive under caller ownership; fs.existsSync calls retain no exposed descriptor and there is no process-wide family cache.
@@ -44,12 +42,8 @@ export function createExpressionObligationClaims(
44
42
  props: IProductionConfigProps,
45
43
  layer: AuthoredLayer,
46
44
  ): IEvidenceClaim[] {
47
- if (!REALIZED_LAYERS.has(layer)) return [];
48
- const revised: boolean = hasNaturalness(layer);
49
- const stage: ProductionStage = revised
50
- ? props.naturalness.screenplay
51
- : constructionStage(props, layer);
52
- const disabled: boolean = stage === "disabled";
45
+ if (layer !== "scripts") return [];
46
+ const disabled: boolean = constructionStage(props, layer) === "disabled";
53
47
  const directory: string = "naturalness/obligations";
54
48
 
55
49
  const shared: IEvidenceClaim[] = layerFiles(layer)
@@ -60,7 +54,6 @@ export function createExpressionObligationClaims(
60
54
  (file: string): IEvidenceClaim =>
61
55
  claim({
62
56
  disabled,
63
- revised,
64
57
  layer,
65
58
  scope: props.narrativeScope,
66
59
  reference: createSharedReference({
@@ -87,7 +80,6 @@ export function createExpressionObligationClaims(
87
80
  : [
88
81
  claim({
89
82
  disabled,
90
- revised,
91
83
  layer,
92
84
  scope: props.narrativeScope,
93
85
  reference,
@@ -99,18 +91,17 @@ export function createExpressionObligationClaims(
99
91
  return [...shared, ...language];
100
92
  }
101
93
 
102
- /** Creates one claim whose finished documents answer each item exactly once. */
94
+ /** Creates one claim whose layer documents answer each item exactly once. */
103
95
  function claim(props: {
104
96
  disabled: boolean;
105
- revised: boolean;
106
97
  layer: AuthoredLayer;
107
98
  reference: IEvidenceMarkdownReference;
108
99
  scope: IProductionConfigProps["narrativeScope"];
109
100
  }): IEvidenceClaim {
110
101
  return {
111
- name: `${props.layer} ${props.revised ? "final" : "draft"} documents answer each ${props.reference.files[0]} item once`,
102
+ name: `${props.layer} documents answer each ${props.reference.files[0]} item once`,
112
103
  type: "markdown",
113
- root: passRoot(props.revised ? "final" : "draft"),
104
+ root: BODY_ROOT,
114
105
  files: createUnitFiles(props.layer, props.scope),
115
106
  symbol: "file",
116
107
  disabled: props.disabled,
@@ -5,18 +5,20 @@ import path from "node:path";
5
5
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
6
6
  import type { ProductionStage } from "../../ProductionStage";
7
7
  import { constructionStage } from "../constructionStage";
8
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
8
9
  import { PACKAGE_DOCS_ROOT } from "../utilities/PACKAGE_DOCS_ROOT";
9
10
  import { createUnitFiles } from "../utilities/createUnitFiles";
10
- import { passRoot } from "../utilities/passRoot";
11
11
 
12
12
  /**
13
- * Tracks instruction adoption in canon, settings or a short's brief, and realization in treatments or a short's screenplay.
13
+ * Tracks instruction adoption in long work's settings, and realization in treatments or a short's screenplay.
14
14
  * Each layer covers the targets independently through its own construction
15
15
  * hosts and stage. Settings accounts for every adopted requirement; treatments
16
- * can exclude requirements outside its selected narrative population.
16
+ * can exclude requirements outside its selected narrative population. A
17
+ * short's brief holds only what the commission leaves open, so it owes no
18
+ * instruction citation and its screenplay realizes every requirement.
17
19
  * Instructions remain targets only. No instructions folder means no claim.
18
20
  *
19
- * @evidence contracts/development/implementation.md#principled-implementation When docs/instructions exists, selected draft H2 hosts independently cover every instruction H2; treatments may exclude out-of-population requirements while canon or short screenplay may not.
21
+ * @evidence contracts/development/implementation.md#principled-implementation When docs/instructions exists, selected body H2 hosts independently cover every instruction H2; treatments may exclude out-of-population requirements while settings or short screenplay may not.
20
22
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The optional instruction input stays a reference population rather than becoming another authored host tree.
21
23
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The treatments exclusion difference follows narrative-population scope; an absent instruction directory returns undefined rather than manufacturing an input requirement.
22
24
  * @evidence contracts/development/common.md#meaningful-documentation The prose states adoption versus realization, independent stage ownership, target-only instructions and the absent-directory result.
@@ -26,7 +28,7 @@ import { passRoot } from "../utilities/passRoot";
26
28
  */
27
29
  export function createInstructionCoverageClaim(
28
30
  props: IProductionConfigProps,
29
- layer: "settings" | "brief" | "treatments" | "screenplay",
31
+ layer: "settings" | "treatments" | "screenplay",
30
32
  ): IEvidenceClaim | undefined {
31
33
  const stage: ProductionStage = constructionStage(props, layer);
32
34
  const directory: string = path.join(
@@ -38,7 +40,7 @@ export function createInstructionCoverageClaim(
38
40
  return {
39
41
  name: `the ${layer} canon realizes every user instruction`,
40
42
  type: "markdown",
41
- root: passRoot("draft"),
43
+ root: BODY_ROOT,
42
44
  files: createUnitFiles(layer, props.narrativeScope),
43
45
  symbol: "h2",
44
46
  disabled: stage === "disabled",