@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
@@ -5,7 +5,6 @@ import type { IProductionConfigProps } from "../../IProductionConfigProps";
5
5
  import type { ProductionStage } from "../../ProductionStage";
6
6
  import { createNarrativeUnitFiles } from "../../createNarrativeUnitFiles";
7
7
  import { constructionStage } from "../constructionStage";
8
- import { hasNaturalness } from "../hasNaturalness";
9
8
  import { isCanonLayer } from "../isCanonLayer";
10
9
  import { createCoverageReference } from "../references/createCoverageReference";
11
10
  import { createLanguagePrincipleReferences } from "../references/createLanguagePrincipleReferences";
@@ -13,8 +12,8 @@ import { createLineageReference } from "../references/createLineageReference";
13
12
  import { createPrincipleReferences } from "../references/createPrincipleReferences";
14
13
  import { createUpstreamReference } from "../references/createUpstreamReference";
15
14
  import { createTopologyFiles } from "../topology/createTopologyFiles";
15
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
16
16
  import { createUnitFiles } from "../utilities/createUnitFiles";
17
- import { passRoot } from "../utilities/passRoot";
18
17
  import { createSettingCoverageClaim } from "./createSettingCoverageClaim";
19
18
 
20
19
  /**
@@ -28,18 +27,18 @@ import { createSettingCoverageClaim } from "./createSettingCoverageClaim";
28
27
  * What differs between layers is which parents exist. Canon, settings or a
29
28
  * short's brief, inherits nothing, so it has no construction file claim.
30
29
  * Treatments account for settings, and a short's screenplay for its brief.
31
- * Scripts realize the treatments they divide, and screenplay additionally preserves
32
- * the script partition exactly.
30
+ * Scripts realize the treatments they divide. A long screenplay keeps the
31
+ * script partition: each screenplay scene file realizes exactly one script
32
+ * scene H2, so a script episode file becomes the screenplay episode folder of
33
+ * its scene files.
33
34
  *
34
- * Construction hosts body; screenplay naturalness hosts working text against
35
- * frozen construction. Script construction also answers expression questions,
36
- * because a frozen content-preserving revision cannot repair content-shaped
37
- * speech defects where those questions find them.
35
+ * Script construction also answers the expression questions, because scripts
36
+ * settle their own language and no later pass revises it.
38
37
  *
39
- * @evidence contracts/development/implementation.md#principled-implementation Construction H2 claims, file inheritance and independent naturalness claims use native reference flags for per-unit checklists, treatment coverage and exact script/frozen lineage; naturalness hosts the working tree and targets its frozen construction.
38
+ * @evidence contracts/development/implementation.md#principled-implementation Construction H2 claims and file inheritance use native reference flags for per-unit checklists, treatment coverage and exact script-scene lineage, where each screenplay scene file cites the one script scene H2 it realizes; scripts construction also selects its expression family.
40
39
  * @evidence contracts/development/implementation.md#clear-and-simple-structure One layer factory centralizes stage/root/parent choices, while population obligations, discovery and review remain separate factories with their distinct respondents.
41
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Short screenplay cites its actual brief and compact short its actual settings without invented treatment or script parents; canon has no inherited file claim, and only screenplay receives separate naturalness claims, while scripts construction selects its expression questions.
42
- * @evidence contracts/development/common.md#meaningful-documentation The prose distinguishes unit/population duties, layer-specific parents and body versus working hosts; nearby comments explain topology capture and frozen-reference ownership.
40
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Short screenplay cites its actual brief without invented treatment or script parents; canon has no inherited file claim, and only scripts construction selects the expression questions.
41
+ * @evidence contracts/development/common.md#meaningful-documentation The prose distinguishes unit/population duties, layer-specific parents, the scene-file lineage and scripts expression; nearby comments explain topology capture.
43
42
  * @evidence contracts/development/implementation.md#efficient-algorithms A fixed number of claims and reference families are constructed per layer; helper existence probes dominate most layers, while treatments and short screenplay also enumerate canon files for coverage, whose scans and sorting scale with the installed canon.
44
43
  * @evidence contracts/development/implementation.md#reuse-equivalent-work Unit/topology selectors, parent-reference builders and scalar stages are reused within the construction; each build refreshes filesystem-dependent contract/canon observations instead of retaining stale config results.
45
44
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned native claims own their layer-family objects and any canon-derived references; synchronous discovery leaves no filesystem handle or background task open.
@@ -53,19 +52,18 @@ export function createLayerClaims(
53
52
  const files: string[] = createUnitFiles(layer, props.narrativeScope);
54
53
 
55
54
  // Indexes and invalid paths must enter the same snapshot as the authored H2s.
56
- const topology: string[] =
57
- isCanonLayer(layer)
58
- ? files
59
- : createTopologyFiles(layer, props.narrativeScope);
55
+ const topology: string[] = isCanonLayer(layer)
56
+ ? files
57
+ : createTopologyFiles(layer, props.narrativeScope);
60
58
 
61
- const treatments: string[] = createNarrativeUnitFiles(
62
- "treatments",
63
- props.narrativeScope,
64
- );
65
- const scripts: string[] = createNarrativeUnitFiles(
66
- "scripts",
67
- props.narrativeScope,
68
- );
59
+ const treatments: string[] = createNarrativeUnitFiles({
60
+ layer: "treatments",
61
+ scope: props.narrativeScope,
62
+ });
63
+ const scripts: string[] = createNarrativeUnitFiles({
64
+ layer: "scripts",
65
+ scope: props.narrativeScope,
66
+ });
69
67
 
70
68
  const parents: (symbol: "file" | "h2") => IEvidenceReference[] = (
71
69
  symbol: "file" | "h2",
@@ -73,37 +71,40 @@ export function createLayerClaims(
73
71
  props.mode !== "long"
74
72
  ? []
75
73
  : [
76
- ...(layer === "screenplay"
77
- ? [createLineageReference(scripts, symbol, "draft")]
74
+ // A screenplay scene file realizes one script scene, an H2 of its
75
+ // episode file; its sections have no one-to-one script parent.
76
+ ...(layer === "screenplay" && symbol === "file"
77
+ ? [createLineageReference(scripts, "h2")]
78
78
  : []),
79
79
  ...(layer === "scripts" || layer === "screenplay"
80
- ? [createCoverageReference(treatments, symbol, "draft")]
80
+ ? [createCoverageReference(treatments, symbol)]
81
81
  : []),
82
82
  ];
83
83
 
84
- const naturalness: IEvidenceReference[] = [
85
- ...createPrincipleReferences({
86
- contracts: props,
87
- layer,
88
- gate: "naturalness",
89
- }),
90
- ...createLanguagePrincipleReferences({
91
- location: props.location,
92
- layer,
93
- gate: "naturalness",
94
- }),
95
- ];
96
-
97
84
  // Script expression must remain repairable in the same construction body.
98
85
  const expression: IEvidenceReference[] =
99
- layer === "scripts" ? naturalness : [];
86
+ layer === "scripts"
87
+ ? [
88
+ ...createPrincipleReferences({
89
+ contracts: props,
90
+ layer,
91
+ family: "naturalness",
92
+ }),
93
+ ...createLanguagePrincipleReferences({
94
+ location: props.location,
95
+ layer,
96
+ family: "naturalness",
97
+ }),
98
+ ]
99
+ : [];
100
100
 
101
- const inherits: string =
102
- isCanonLayer(layer) ? "" : ", and account for the layers they inherit";
101
+ const inherits: string = isCanonLayer(layer)
102
+ ? ""
103
+ : ", and account for the layers they inherit";
103
104
  const unit: IEvidenceClaim = {
104
105
  name: `${layer} H2 units answer their principle checklists${inherits}`,
105
106
  type: "markdown",
106
- root: passRoot("draft"),
107
+ root: BODY_ROOT,
107
108
  files: topology,
108
109
  symbol: "h2",
109
110
  disabled,
@@ -111,49 +112,19 @@ export function createLayerClaims(
111
112
  ...createPrincipleReferences({
112
113
  contracts: props,
113
114
  layer,
114
- gate: "layer",
115
+ family: "principles",
115
116
  }),
116
117
  ...createLanguagePrincipleReferences({
117
118
  location: props.location,
118
119
  layer,
119
- gate: "layer",
120
+ family: "principles",
120
121
  }),
121
122
  ...(isCanonLayer(layer) ? [] : [createUpstreamReference(props, layer)]),
122
123
  ...expression,
123
124
  ...parents("h2"),
124
125
  ],
125
126
  };
126
-
127
- // The revision snapshot is a reference, not another authored edition.
128
- const second: ProductionStage = hasNaturalness(layer)
129
- ? props.naturalness.screenplay
130
- : "disabled";
131
- const surface: IEvidenceClaim[] = hasNaturalness(layer)
132
- ? [
133
- {
134
- name: `${layer} final files preserve their draft lineage for naturalness`,
135
- type: "markdown",
136
- root: passRoot("final"),
137
- files,
138
- symbol: "file",
139
- disabled: second === "disabled",
140
- reference: [createLineageReference(files, "file", "revision")],
141
- },
142
- {
143
- name: `${layer} final H2 units answer their naturalness checklists`,
144
- type: "markdown",
145
- root: passRoot("final"),
146
- files: topology,
147
- symbol: "h2",
148
- disabled: second === "disabled",
149
- reference: [
150
- createLineageReference(topology, "h2", "revision"),
151
- ...naturalness,
152
- ],
153
- },
154
- ]
155
- : [];
156
- if (isCanonLayer(layer)) return [unit, ...surface];
127
+ if (isCanonLayer(layer)) return [unit];
157
128
 
158
129
  const coverage: IEvidenceClaim | undefined =
159
130
  layer === "treatments"
@@ -165,14 +136,13 @@ export function createLayerClaims(
165
136
  {
166
137
  name: `${layer} unit files account for the layers they inherit`,
167
138
  type: "markdown",
168
- root: passRoot("draft"),
139
+ root: BODY_ROOT,
169
140
  files,
170
141
  symbol: "file",
171
142
  disabled,
172
143
  reference: parents("file"),
173
144
  },
174
145
  unit,
175
- ...surface,
176
146
  ...(coverage === undefined ? [] : [coverage]),
177
147
  ];
178
148
  }
@@ -4,9 +4,9 @@ import path from "node:path";
4
4
 
5
5
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
6
6
  import { createSharedReference } from "../references/createSharedReference";
7
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
7
8
  import { createContractDirectory } from "../utilities/createContractDirectory";
8
9
  import { createUnitFiles } from "../utilities/createUnitFiles";
9
- import { passRoot } from "../utilities/passRoot";
10
10
  import { validateSettingsOutline } from "../validateSettingsOutline";
11
11
 
12
12
  /**
@@ -56,18 +56,18 @@ export function createOutlineClaims(
56
56
  throw new Error("Settings outline contracts must be installed as a pair.");
57
57
 
58
58
  if (principle === false) {
59
- if (!fs.existsSync(path.join(props.location, passRoot("draft"), outline)))
59
+ if (!fs.existsSync(path.join(props.location, BODY_ROOT, outline)))
60
60
  return [];
61
61
  return [
62
62
  {
63
63
  name: "each settings file belongs to exactly one part of the outline",
64
64
  type: "markdown",
65
- root: passRoot("draft"),
65
+ root: BODY_ROOT,
66
66
  files: createUnitFiles("settings", props.narrativeScope),
67
67
  symbol: "file",
68
68
  reference: {
69
69
  type: "markdown",
70
- root: passRoot("draft"),
70
+ root: BODY_ROOT,
71
71
  files: [outline],
72
72
  symbol: "h2",
73
73
  singleEvidencePerSymbol: true,
@@ -89,7 +89,7 @@ export function createOutlineClaims(
89
89
  {
90
90
  name: "settings outline parts answer their own principle checklist",
91
91
  type: "markdown",
92
- root: passRoot("draft"),
92
+ root: BODY_ROOT,
93
93
  files: [outline],
94
94
  symbol: "h2",
95
95
  disabled: outlineDisabled,
@@ -103,7 +103,7 @@ export function createOutlineClaims(
103
103
  {
104
104
  name: "settings outline answers each arrangement obligation once",
105
105
  type: "markdown",
106
- root: passRoot("draft"),
106
+ root: BODY_ROOT,
107
107
  files: [outline],
108
108
  symbol: "file",
109
109
  disabled: outlineDisabled,
@@ -120,13 +120,13 @@ export function createOutlineClaims(
120
120
  {
121
121
  name: "each settings file corresponds to exactly one outline entry",
122
122
  type: "markdown",
123
- root: passRoot("draft"),
123
+ root: BODY_ROOT,
124
124
  files: createUnitFiles("settings", props.narrativeScope),
125
125
  symbol: "file",
126
126
  disabled,
127
127
  reference: {
128
128
  type: "markdown",
129
- root: passRoot("draft"),
129
+ root: BODY_ROOT,
130
130
  files: [outline],
131
131
  symbol: "h3",
132
132
  singleEvidencePerSymbol: true,
@@ -14,9 +14,9 @@ import { constructionStage } from "../constructionStage";
14
14
  import { createLocalContractReference } from "../references/createLocalContractReference";
15
15
  import { createSharedReference } from "../references/createSharedReference";
16
16
  import { layerFiles } from "../references/layerFiles";
17
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
17
18
  import { createContractDirectory } from "../utilities/createContractDirectory";
18
19
  import { createUnitFiles } from "../utilities/createUnitFiles";
19
- import { passRoot } from "../utilities/passRoot";
20
20
 
21
21
  /**
22
22
  * Creates the population obligation claims for a complete layer.
@@ -28,13 +28,13 @@ import { passRoot } from "../utilities/passRoot";
28
28
  * repeating a population question on every unit turns one comparison into a
29
29
  * restatement per unit.
30
30
  *
31
- * Unit duties use checklists. Naturalness population comparisons have separate
32
- * expression obligation claims rather than repeating their question per unit.
31
+ * Unit duties use checklists. Script expression population comparisons have
32
+ * separate expression obligation claims rather than repeating their question per unit.
33
33
  *
34
34
  * @evidence contracts/development/implementation.md#principled-implementation Construction stage controls whole-layer file-level obligation coverage, with one answering document per shared/language population item and no per-H2 repetition of the same comparison; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
35
35
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The exported factory delegates one family build while keeping population scope distinct from principle checklists and expression obligations.
36
36
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Required shared common/narrative files stay selected even when missing so the compiler reports a broken tree; only realized and layer-specific optional documents are conditionally selected.
37
- * @evidence contracts/development/common.md#meaningful-documentation The prose explains whole-layer respondents, unique evidence and the boundary with per-unit and naturalness families; the helper comment identifies optional-file compatibility.
37
+ * @evidence contracts/development/common.md#meaningful-documentation The prose explains whole-layer respondents, unique evidence and the boundary with per-unit and script expression families; the helper comment identifies optional-file compatibility.
38
38
  * @evidence contracts/development/implementation.md#efficient-algorithms At most four candidates per scope are filtered and mapped, with a bounded number of synchronous existence probes and selector constructions; this factory never scans the manuscript population.
39
39
  * @evidence contracts/development/implementation.md#reuse-equivalent-work Shared/language selection reuses layerFiles and reference builders; optional installed files are observed per config build, so changes in the contract tree invalidate naturally without a retained cache.
40
40
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Intermediate and returned arrays have a fixed family bound; returned claim/reference objects belong to the config owner and existence probes retain no exposed handles.
@@ -110,7 +110,7 @@ function claim(props: {
110
110
  return {
111
111
  name: `${props.layer} documents answer each ${props.reference.files[0]} item once`,
112
112
  type: "markdown",
113
- root: passRoot("draft"),
113
+ root: BODY_ROOT,
114
114
  files: createUnitFiles(props.layer, props.scope),
115
115
  symbol: "file",
116
116
  disabled: props.disabled,
@@ -8,23 +8,20 @@ import path from "node:path";
8
8
 
9
9
  import type { IContractLocation } from "../../../internal/IContractLocation";
10
10
  import type { AuthoredLayer } from "../../AuthoredLayer";
11
- import type { AuthoredPass } from "../../AuthoredPass";
12
11
  import type { IProductionConfigProps } from "../../IProductionConfigProps";
13
- import type { ProductionStage } from "../../ProductionStage";
14
12
  import { constructionStage } from "../constructionStage";
15
- import { hasNaturalness } from "../hasNaturalness";
16
13
  import { createLineageReference } from "../references/createLineageReference";
17
14
  import { createSharedReference } from "../references/createSharedReference";
15
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
18
16
  import { PACKAGE_DOCS_ROOT } from "../utilities/PACKAGE_DOCS_ROOT";
19
17
  import { createContractDirectory } from "../utilities/createContractDirectory";
20
18
  import { createUnitFiles } from "../utilities/createUnitFiles";
21
- import { passRoot } from "../utilities/passRoot";
22
19
 
23
20
  /**
24
21
  * Creates the claims that record the evidence-stage reviews in the graph.
25
22
  *
26
23
  * A reviewer writes one review file per authored file and one review H2 per
27
- * authored H2, directly under `docs/review/<pass>/<layer>` in a tree that
24
+ * authored H2, directly under `docs/review/draft/<layer>` in a tree that
28
25
  * mirrors the authored layer. A selected review file or `verdict/index.md`
29
26
  * starts this current population; missing counterparts never come from a
30
27
  * legacy round. Without current files, the highest numbered legacy round
@@ -37,110 +34,91 @@ import { passRoot } from "../utilities/passRoot";
37
34
  * No claim binds the review files to the authored files one to one, because
38
35
  * the H2 bijection already leaves no authored H2 without a review.
39
36
  *
40
- * Review claims are active only while the reviewed pass is in `evidence`.
41
- * A package whose installed contract predates the review family, or whose
42
- * reviewer has not yet written current files or a legacy round under
43
- * `docs/review/<pass>/<layer>`, has no review claims for that pass.
37
+ * Review claims are active only while the layer's construction stage is
38
+ * `evidence`. A package whose installed contract predates the review family,
39
+ * or whose reviewer has not yet written current files or a legacy round under
40
+ * `docs/review/draft/<layer>`, has no review claims for that layer.
44
41
  *
45
- * @evidence contracts/development/implementation.md#principled-implementation Actual in-scope direct review files or a verdict select the canonical population exclusively; otherwise the highest numeric legacy round supplies exact current-review lineage and a separate file-level verdict obligation, with stages preserved.
42
+ * @evidence contracts/development/implementation.md#principled-implementation Actual in-scope direct review files or a verdict select the canonical population exclusively; otherwise the highest numeric legacy round supplies exact current-review lineage and a separate file-level verdict obligation, both following the construction stage.
46
43
  * @evidence contracts/development/implementation.md#clear-and-simple-structure One root selector keeps current-versus-legacy admission separate from the unchanged unit bijection, freshness and whole-population verdict claims.
47
44
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Older contract families, probed in the shared skills tree that also roots their references, and not-yet-created review roots yield no claims; native inactive populations do not establish that independent review occurred.
48
45
  * @evidence contracts/development/common.md#meaningful-documentation The prose states canonical admission, exclusive legacy fallback, current-review invalidation, H2 bijection, verdict ownership and optional roots/contracts.
49
- * @evidence contracts/development/implementation.md#efficient-algorithms Up to two editions scan entries only as deep as their actual selectors; directory entries and native glob matching dominate, with a linear root scan for legacy selection when no canonical file exists.
50
- * @evidence contracts/development/implementation.md#reuse-equivalent-work Each edition reuses its resolved files, selected root and lineage for both claims; filesystem observation repeats per config build so new current files replace legacy selection.
46
+ * @evidence contracts/development/implementation.md#efficient-algorithms One review root scans entries only as deep as its actual selectors; directory entries and native glob matching dominate, with a linear root scan for legacy selection when no canonical file exists.
47
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work The resolved files, selected root and lineage serve both claims; filesystem observation repeats per config build so new current files replace legacy selection.
51
48
  * @evidence contracts/development/implementation.md#bound-retention-and-release-resources Directory arrays are transient and bounded by visited entries; returned claims belong to the config, and synchronous scans retain no history, handle or task.
52
49
  */
53
50
  export function createReviewClaims(
54
51
  props: IProductionConfigProps,
55
52
  layer: AuthoredLayer,
56
53
  ): IEvidenceClaim[] {
57
- const passes: [AuthoredPass, ProductionStage][] = [
58
- ["draft", constructionStage(props, layer)],
59
- ...(hasNaturalness(layer)
60
- ? [
61
- ["final", props.naturalness.screenplay] as [
62
- AuthoredPass,
63
- ProductionStage,
64
- ],
65
- ]
66
- : []),
67
- ];
68
54
  const principles: boolean = installed(props, "principles/review.md");
69
55
  const obligations: boolean = installed(props, "obligations/review.md");
70
56
  if (!principles && !obligations) return [];
71
57
  const files: string[] = createUnitFiles(layer, props.narrativeScope);
72
-
73
- return passes.flatMap(
74
- ([pass, stage]: [AuthoredPass, ProductionStage]): IEvidenceClaim[] => {
75
- // Naturalness approval stays with the working text, even after promotion.
76
- const inside: string[] = files.map((file: string): string =>
77
- file.slice(layer.length + 1),
78
- );
79
- const base: string = `${PACKAGE_DOCS_ROOT}/review/${pass}/${layer}`;
80
- const selected: { root: string; files: string[] } | null =
81
- selectReviewRoot(path.join(props.location, base), inside);
82
- if (selected === null) return [];
83
- const disabled: boolean = stage === "disabled";
84
- const root: string =
85
- selected.root === "" ? base : `${base}/${selected.root}`;
86
- const lineage: IEvidenceMarkdownReference = {
87
- ...(createLineageReference(
88
- files,
89
- "h2",
90
- pass,
91
- true,
92
- ) as IEvidenceMarkdownReference),
93
- root: `${passRoot(pass)}/${layer}`,
94
- files: inside,
95
- };
96
- const where: "construction" | "naturalness" =
97
- pass === "draft" ? "construction" : "naturalness";
98
- return [
99
- {
100
- name: `${layer} ${where} review H2 units keep a current review of their ${pass} H2`,
101
- type: "markdown",
102
- root,
103
- files: selected.files,
104
- symbol: "h2",
105
- disabled,
106
- reference: [
107
- lineage,
108
- ...(principles
109
- ? [
110
- createSharedReference({
111
- contracts: props,
112
- file: "principles/review.md",
113
- checklist: true,
114
- exclusion: false,
115
- }),
116
- ]
117
- : []),
118
- ],
119
- },
120
- ...(obligations
58
+ const inside: string[] = files.map((file: string): string =>
59
+ file.slice(layer.length + 1),
60
+ );
61
+ const base: string = `${PACKAGE_DOCS_ROOT}/review/draft/${layer}`;
62
+ const selected: { root: string; files: string[] } | null = selectReviewRoot(
63
+ path.join(props.location, base),
64
+ inside,
65
+ );
66
+ if (selected === null) return [];
67
+ const disabled: boolean = constructionStage(props, layer) === "disabled";
68
+ const root: string = selected.root === "" ? base : `${base}/${selected.root}`;
69
+ const lineage: IEvidenceMarkdownReference = {
70
+ ...(createLineageReference(
71
+ files,
72
+ "h2",
73
+ true,
74
+ ) as IEvidenceMarkdownReference),
75
+ root: `${BODY_ROOT}/${layer}`,
76
+ files: inside,
77
+ };
78
+ return [
79
+ {
80
+ name: `${layer} construction review H2 units keep a current review of their body H2`,
81
+ type: "markdown",
82
+ root,
83
+ files: selected.files,
84
+ symbol: "h2",
85
+ disabled,
86
+ reference: [
87
+ lineage,
88
+ ...(principles
121
89
  ? [
122
- {
123
- name: `${layer} ${where} verdict answers each review obligation once`,
124
- type: "markdown",
125
- root,
126
- files: ["verdict/index.md"],
127
- symbol: "file",
128
- disabled,
129
- reference: {
130
- ...createSharedReference({
131
- contracts: props,
132
- file: "obligations/review.md",
133
- checklist: false,
134
- exclusion: false,
135
- }),
136
- uniqueEvidence: true,
137
- },
138
- } satisfies IEvidenceClaim,
90
+ createSharedReference({
91
+ contracts: props,
92
+ file: "principles/review.md",
93
+ checklist: true,
94
+ exclusion: false,
95
+ }),
139
96
  ]
140
97
  : []),
141
- ];
98
+ ],
142
99
  },
143
- );
100
+ ...(obligations
101
+ ? [
102
+ {
103
+ name: `${layer} construction verdict answers each review obligation once`,
104
+ type: "markdown",
105
+ root,
106
+ files: ["verdict/index.md"],
107
+ symbol: "file",
108
+ disabled,
109
+ reference: {
110
+ ...createSharedReference({
111
+ contracts: props,
112
+ file: "obligations/review.md",
113
+ checklist: false,
114
+ exclusion: false,
115
+ }),
116
+ uniqueEvidence: true,
117
+ },
118
+ } satisfies IEvidenceClaim,
119
+ ]
120
+ : []),
121
+ ];
144
122
  }
145
123
 
146
124
  /**
@@ -5,7 +5,7 @@ import type { ProductionStage } from "../../ProductionStage";
5
5
  import { createNarrativeUnitFiles } from "../../createNarrativeUnitFiles";
6
6
  import { constructionStage } from "../constructionStage";
7
7
  import { createSettingReferences } from "../references/createSettingReferences";
8
- import { passRoot } from "../utilities/passRoot";
8
+ import { BODY_ROOT } from "../utilities/BODY_ROOT";
9
9
 
10
10
  /**
11
11
  * Creates canon dependencies on treatments or short screenplay H2s: settings for treatments and compact shorts, the brief for shorts.
@@ -14,7 +14,7 @@ import { passRoot } from "../utilities/passRoot";
14
14
  * depends on, and a canon H2 no selected narrative H2 uses is answered by an
15
15
  * exclusion on the narrative H2 whose scope makes it absent.
16
16
  *
17
- * @evidence contracts/development/implementation.md#principled-implementation Actual treatment or short-screenplay H2 consumers cover H2s of every enumerated promoted canon file, settings or brief as `canon` names, selecting its body edition while the scalar construction stage controls the consumer stage; an empty canon returns undefined.
17
+ * @evidence contracts/development/implementation.md#principled-implementation Actual treatment or short-screenplay H2 consumers cover H2s of every enumerated canon body file, settings or brief as `canon` names, while the scalar construction stage controls the consumer stage; an empty canon returns undefined.
18
18
  * @evidence contracts/development/implementation.md#clear-and-simple-structure Canon coverage lives on the concrete event or short-scene consumers, separate from structural prerequisite readiness and inherited script/screenplay relations.
19
19
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Empty reference populations are omitted because there is no canon dependency to cite; pass readiness remains a separate required check rather than being excused by this omission.
20
20
  * @evidence contracts/development/common.md#meaningful-documentation The prose states which canon each consumer cites, dependency hosts and truthful scope exclusions, and the nearby comment distinguishes empty coverage from readiness.
@@ -30,17 +30,15 @@ export function createSettingCoverageClaim(
30
30
  const stage: ProductionStage = constructionStage(props, layer);
31
31
  const reference: IEvidenceReference[] = createSettingReferences(
32
32
  props.location,
33
- "draft",
34
33
  canon,
35
34
  );
36
- // An empty canon has no dependency to cite. Structural prerequisite readiness is
37
- // checked separately by pass validation; canon is always read in body.
35
+ // An empty canon has no dependency to cite.
38
36
  if (reference.length === 0) return undefined;
39
37
  return {
40
38
  name: `${layer} H2 consumers cite their ${canon} dependencies`,
41
39
  type: "markdown",
42
- root: passRoot("draft"),
43
- files: createNarrativeUnitFiles(layer, props.narrativeScope),
40
+ root: BODY_ROOT,
41
+ files: createNarrativeUnitFiles({ layer, scope: props.narrativeScope }),
44
42
  symbol: "h2",
45
43
  disabled: stage === "disabled",
46
44
  reference,
@@ -10,6 +10,7 @@ import { createOutlineClaims } from "./claims/createOutlineClaims";
10
10
  import { createPopulationObligationClaims } from "./claims/createPopulationObligationClaims";
11
11
  import { createReviewClaims } from "./claims/createReviewClaims";
12
12
  import { productionLayers } from "./productionLayers";
13
+ import { BODY_ROOT } from "./utilities/BODY_ROOT";
13
14
  import { assertProductionEvidenceSources } from "./utilities/assertProductionEvidenceSources";
14
15
  import { createEvidenceFiles } from "./utilities/createEvidenceFiles";
15
16
 
@@ -28,16 +29,17 @@ export function collectProductionClaims(
28
29
  props: IProductionConfigProps,
29
30
  ): IEvidenceClaim[] {
30
31
  assertProductionEvidenceSources(props);
32
+
33
+ // A short's brief holds only what the commission does not fix, so its
34
+ // screenplay alone realizes the instructions.
31
35
  const instructions: IEvidenceClaim[] = (
32
36
  props.mode === "long"
33
37
  ? (["settings", "treatments"] as const)
34
38
  : props.mode === "short"
35
- ? (["brief", "screenplay"] as const)
39
+ ? (["screenplay"] as const)
36
40
  : []
37
41
  ).flatMap(
38
- (
39
- layer: "settings" | "brief" | "treatments" | "screenplay",
40
- ): IEvidenceClaim[] => {
42
+ (layer: "settings" | "treatments" | "screenplay"): IEvidenceClaim[] => {
41
43
  const claim: IEvidenceClaim | undefined = createInstructionCoverageClaim(
42
44
  props,
43
45
  layer,
@@ -69,7 +71,7 @@ export function collectProductionClaims(
69
71
  for (const claim of claims) {
70
72
  if (
71
73
  claim.type === "markdown" &&
72
- claim.root === "docs/body" &&
74
+ claim.root === BODY_ROOT &&
73
75
  claim.evidenceFiles === undefined &&
74
76
  (claim.symbol === "file" || claim.symbol === "h2")
75
77
  )
@@ -5,7 +5,6 @@ export * from "./claims";
5
5
  export * from "./collectProductionClaims";
6
6
  export * from "./constructionStage";
7
7
  export * from "./createGraphConfig";
8
- export * from "./hasNaturalness";
9
8
  export * from "./isCanonLayer";
10
9
  export * from "./metadataRewrite";
11
10
  export * from "./productionLayers";
@@ -1,6 +1,5 @@
1
1
  import type { IEvidenceReference } from "@wrtnlabs/evidence";
2
2
 
3
- import type { AuthoredPass } from "../../AuthoredPass";
4
3
  import { referenceLocation } from "../utilities/referenceLocation";
5
4
 
6
5
  /**
@@ -32,11 +31,10 @@ import { referenceLocation } from "../utilities/referenceLocation";
32
31
  export function createCoverageReference(
33
32
  files: string[],
34
33
  symbol: "file" | "h2",
35
- pass: AuthoredPass = "draft",
36
34
  ): IEvidenceReference {
37
35
  return {
38
36
  type: "markdown",
39
- ...referenceLocation(files, pass, symbol),
37
+ ...referenceLocation(files, symbol),
40
38
  symbol,
41
39
  noEvidenceExclude: true,
42
40
  };
@@ -12,8 +12,8 @@ import { createSharedReference } from "./createSharedReference";
12
12
  /**
13
13
  * Creates the open-world discovery duties one layer's population covers.
14
14
  *
15
- * Canon, settings or a short's brief, searches its own directives, promise, and subject, and backcasts the
16
- * planned narrative to find what those layers would otherwise have to invent.
15
+ * Canon, settings or a short's brief, searches its own directives and subject,
16
+ * and backcasts the planned narrative to find what those layers would otherwise have to invent.
17
17
  * That backcast is how settings anticipates the cross-layer narrative contract,
18
18
  * so `discovery/narratives.md` is not selected here: it is the duty each
19
19
  * narrative layer answers when it rechecks that contract against what it