@automovie/evidence 0.1.0 → 0.3.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.
- package/README.md +14 -10
- package/lib/IAutoMovieDevelopmentProps.d.ts +11 -10
- package/lib/IAutoMovieEvidenceConfigProps.d.ts +9 -8
- package/lib/IAutoMovieNarrativeProps.d.ts +0 -3
- package/lib/IAutoMovieNoNarrativeProps.d.ts +16 -0
- package/lib/{narrative/IProductionLayerStages.js → IAutoMovieNoNarrativeProps.js} +1 -1
- package/lib/IAutoMovieNoNarrativeProps.js.map +1 -0
- package/lib/createDevelopmentContractClaims.d.ts +26 -14
- package/lib/createDevelopmentContractClaims.js +35 -21
- package/lib/createDevelopmentContractClaims.js.map +1 -1
- package/lib/createEvidenceConfig.d.ts +3 -3
- package/lib/createEvidenceConfig.js +19 -12
- package/lib/createEvidenceConfig.js.map +1 -1
- package/lib/index.d.ts +7 -8
- package/lib/index.js +1 -8
- package/lib/index.js.map +1 -1
- package/lib/internal/index.d.ts +5 -0
- package/lib/internal/index.js +7 -0
- package/lib/internal/index.js.map +1 -1
- package/lib/internal/resolveSkillsDirectory.d.ts +8 -9
- package/lib/internal/resolveSkillsDirectory.js +9 -12
- package/lib/internal/resolveSkillsDirectory.js.map +1 -1
- package/lib/narrative/IPackageChecklistClaimProps.d.ts +5 -10
- package/lib/narrative/IPackageContractProps.d.ts +0 -8
- package/lib/narrative/IPackagePopulationContractProps.d.ts +1 -9
- package/lib/narrative/IProductionConfigProps.d.ts +1 -10
- package/lib/narrative/createBriefFiles.d.ts +2 -2
- package/lib/narrative/createBriefFiles.js +2 -2
- package/lib/narrative/createNarrativeUnitFiles.d.ts +19 -12
- package/lib/narrative/createNarrativeUnitFiles.js +22 -17
- package/lib/narrative/createNarrativeUnitFiles.js.map +1 -1
- package/lib/narrative/createPackageChecklistClaim.js +5 -10
- package/lib/narrative/createPackageChecklistClaim.js.map +1 -1
- package/lib/narrative/createPackageContract.d.ts +3 -3
- package/lib/narrative/createPackageContract.js +3 -8
- package/lib/narrative/createPackageContract.js.map +1 -1
- package/lib/narrative/createPackagePopulationContract.d.ts +7 -7
- package/lib/narrative/createPackagePopulationContract.js +10 -18
- package/lib/narrative/createPackagePopulationContract.js.map +1 -1
- package/lib/narrative/index.d.ts +0 -4
- package/lib/narrative/index.js +0 -4
- package/lib/narrative/index.js.map +1 -1
- package/lib/narrative/internal/REALIZED_LAYERS.d.ts +1 -1
- package/lib/narrative/internal/REALIZED_LAYERS.js +1 -1
- package/lib/narrative/internal/claims/createDiscoveryClaim.d.ts +11 -3
- package/lib/narrative/internal/claims/createDiscoveryClaim.js +17 -5
- package/lib/narrative/internal/claims/createDiscoveryClaim.js.map +1 -1
- package/lib/narrative/internal/claims/createExpressionObligationClaims.d.ts +9 -8
- package/lib/narrative/internal/claims/createExpressionObligationClaims.js +15 -22
- package/lib/narrative/internal/claims/createExpressionObligationClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createInstructionCoverageClaim.d.ts +6 -4
- package/lib/narrative/internal/claims/createInstructionCoverageClaim.js +7 -5
- package/lib/narrative/internal/claims/createInstructionCoverageClaim.js.map +1 -1
- package/lib/narrative/internal/claims/createLayerClaims.d.ts +9 -9
- package/lib/narrative/internal/claims/createLayerClaims.js +45 -65
- package/lib/narrative/internal/claims/createLayerClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createOutlineClaims.js +8 -8
- package/lib/narrative/internal/claims/createOutlineClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createPopulationObligationClaims.d.ts +3 -3
- package/lib/narrative/internal/claims/createPopulationObligationClaims.js +5 -5
- package/lib/narrative/internal/claims/createPopulationObligationClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createReviewClaims.d.ts +8 -8
- package/lib/narrative/internal/claims/createReviewClaims.js +64 -77
- package/lib/narrative/internal/claims/createReviewClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createSettingCoverageClaim.d.ts +1 -1
- package/lib/narrative/internal/claims/createSettingCoverageClaim.js +6 -7
- package/lib/narrative/internal/claims/createSettingCoverageClaim.js.map +1 -1
- package/lib/narrative/internal/collectProductionClaims.js +5 -2
- package/lib/narrative/internal/collectProductionClaims.js.map +1 -1
- package/lib/narrative/internal/index.d.ts +0 -1
- package/lib/narrative/internal/index.js +0 -1
- package/lib/narrative/internal/index.js.map +1 -1
- package/lib/narrative/internal/readSettingsFiles.d.ts +6 -5
- package/lib/narrative/internal/readSettingsFiles.js +12 -9
- package/lib/narrative/internal/readSettingsFiles.js.map +1 -1
- package/lib/narrative/internal/references/createCoverageReference.d.ts +1 -2
- package/lib/narrative/internal/references/createCoverageReference.js +2 -2
- package/lib/narrative/internal/references/createCoverageReference.js.map +1 -1
- package/lib/narrative/internal/references/createDiscoveryReferences.d.ts +2 -2
- package/lib/narrative/internal/references/createDiscoveryReferences.js +2 -2
- package/lib/narrative/internal/references/createLanguagePrincipleReferences.d.ts +7 -6
- package/lib/narrative/internal/references/createLanguagePrincipleReferences.js +7 -7
- package/lib/narrative/internal/references/createLanguagePrincipleReferences.js.map +1 -1
- package/lib/narrative/internal/references/createLineageReference.d.ts +7 -8
- package/lib/narrative/internal/references/createLineageReference.js +8 -8
- package/lib/narrative/internal/references/createLineageReference.js.map +1 -1
- package/lib/narrative/internal/references/createPrincipleReferences.d.ts +9 -8
- package/lib/narrative/internal/references/createPrincipleReferences.js +12 -12
- package/lib/narrative/internal/references/createPrincipleReferences.js.map +1 -1
- package/lib/narrative/internal/references/createSettingReferences.d.ts +3 -4
- package/lib/narrative/internal/references/createSettingReferences.js +6 -6
- package/lib/narrative/internal/references/createSettingReferences.js.map +1 -1
- package/lib/narrative/internal/references/layerFiles.d.ts +5 -5
- package/lib/narrative/internal/references/layerFiles.js +5 -5
- package/lib/narrative/internal/topology/createTopologyFiles.d.ts +1 -1
- package/lib/narrative/internal/topology/createTopologyFiles.js +1 -1
- package/lib/narrative/internal/utilities/BODY_ROOT.d.ts +15 -0
- package/lib/narrative/internal/utilities/BODY_ROOT.js +20 -0
- package/lib/narrative/internal/utilities/BODY_ROOT.js.map +1 -0
- package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.d.ts +6 -6
- package/lib/narrative/internal/utilities/PACKAGE_DOCS_ROOT.js +6 -6
- package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js +6 -19
- package/lib/narrative/internal/utilities/assertProductionEvidenceSources.js.map +1 -1
- package/lib/narrative/internal/utilities/createUnitFiles.d.ts +4 -6
- package/lib/narrative/internal/utilities/createUnitFiles.js +5 -7
- package/lib/narrative/internal/utilities/createUnitFiles.js.map +1 -1
- package/lib/narrative/internal/utilities/index.d.ts +1 -1
- package/lib/narrative/internal/utilities/index.js +1 -1
- package/lib/narrative/internal/utilities/index.js.map +1 -1
- package/lib/narrative/internal/utilities/referenceLocation.d.ts +6 -9
- package/lib/narrative/internal/utilities/referenceLocation.js +9 -14
- package/lib/narrative/internal/utilities/referenceLocation.js.map +1 -1
- package/package.json +8 -4
- package/src/IAutoMovieDevelopmentProps.ts +11 -10
- package/src/IAutoMovieEvidenceConfigProps.ts +9 -8
- package/src/IAutoMovieNarrativeProps.ts +0 -4
- package/src/IAutoMovieNoNarrativeProps.ts +18 -0
- package/src/createDevelopmentContractClaims.ts +43 -22
- package/src/createEvidenceConfig.ts +23 -13
- package/src/index.ts +8 -8
- package/src/internal/index.ts +7 -0
- package/src/internal/resolveSkillsDirectory.ts +9 -12
- package/src/narrative/IPackageChecklistClaimProps.ts +5 -11
- package/src/narrative/IPackageContractProps.ts +0 -9
- package/src/narrative/IPackagePopulationContractProps.ts +1 -10
- package/src/narrative/IProductionConfigProps.ts +1 -11
- package/src/narrative/createBriefFiles.ts +2 -2
- package/src/narrative/createNarrativeUnitFiles.ts +28 -20
- package/src/narrative/createPackageChecklistClaim.ts +5 -10
- package/src/narrative/createPackageContract.ts +3 -15
- package/src/narrative/createPackagePopulationContract.ts +11 -26
- package/src/narrative/index.ts +0 -4
- package/src/narrative/internal/REALIZED_LAYERS.ts +1 -1
- package/src/narrative/internal/claims/createDiscoveryClaim.ts +20 -6
- package/src/narrative/internal/claims/createExpressionObligationClaims.ts +15 -24
- package/src/narrative/internal/claims/createInstructionCoverageClaim.ts +8 -6
- package/src/narrative/internal/claims/createLayerClaims.ts +48 -78
- package/src/narrative/internal/claims/createOutlineClaims.ts +8 -8
- package/src/narrative/internal/claims/createPopulationObligationClaims.ts +5 -5
- package/src/narrative/internal/claims/createReviewClaims.ts +69 -91
- package/src/narrative/internal/claims/createSettingCoverageClaim.ts +5 -7
- package/src/narrative/internal/collectProductionClaims.ts +7 -5
- package/src/narrative/internal/index.ts +0 -1
- package/src/narrative/internal/readSettingsFiles.ts +14 -9
- package/src/narrative/internal/references/createCoverageReference.ts +1 -3
- package/src/narrative/internal/references/createDiscoveryReferences.ts +2 -2
- package/src/narrative/internal/references/createLanguagePrincipleReferences.ts +8 -9
- package/src/narrative/internal/references/createLineageReference.ts +7 -9
- package/src/narrative/internal/references/createPrincipleReferences.ts +13 -14
- package/src/narrative/internal/references/createSettingReferences.ts +5 -8
- package/src/narrative/internal/references/layerFiles.ts +5 -5
- package/src/narrative/internal/topology/createTopologyFiles.ts +1 -1
- package/src/narrative/internal/utilities/BODY_ROOT.ts +17 -0
- package/src/narrative/internal/utilities/PACKAGE_DOCS_ROOT.ts +6 -6
- package/src/narrative/internal/utilities/assertProductionEvidenceSources.ts +6 -25
- package/src/narrative/internal/utilities/createUnitFiles.ts +5 -7
- package/src/narrative/internal/utilities/index.ts +1 -1
- package/src/narrative/internal/utilities/referenceLocation.ts +8 -18
- package/lib/narrative/AuthoredPass.d.ts +0 -16
- package/lib/narrative/AuthoredPass.js +0 -3
- package/lib/narrative/AuthoredPass.js.map +0 -1
- package/lib/narrative/IProductionLayerStages.d.ts +0 -15
- package/lib/narrative/IProductionLayerStages.js.map +0 -1
- package/lib/narrative/internal/hasNaturalness.d.ts +0 -14
- package/lib/narrative/internal/hasNaturalness.js +0 -19
- package/lib/narrative/internal/hasNaturalness.js.map +0 -1
- package/lib/narrative/internal/utilities/passRoot.d.ts +0 -16
- package/lib/narrative/internal/utilities/passRoot.js +0 -22
- package/lib/narrative/internal/utilities/passRoot.js.map +0 -1
- package/lib/narrative/stripNaturalnessComments.d.ts +0 -12
- package/lib/narrative/stripNaturalnessComments.js +0 -34
- package/lib/narrative/stripNaturalnessComments.js.map +0 -1
- package/src/narrative/AuthoredPass.ts +0 -16
- package/src/narrative/IProductionLayerStages.ts +0 -16
- package/src/narrative/internal/hasNaturalness.ts +0 -17
- package/src/narrative/internal/utilities/passRoot.ts +0 -20
- package/src/narrative/stripNaturalnessComments.ts +0 -31
|
@@ -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/<
|
|
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
|
|
41
|
-
* A package whose installed contract predates the review family,
|
|
42
|
-
* reviewer has not yet written current files or a legacy round under
|
|
43
|
-
* `docs/review/<
|
|
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,
|
|
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
|
|
50
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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 {
|
|
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
|
|
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.
|
|
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:
|
|
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
|
-
? (["
|
|
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 ===
|
|
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";
|
|
@@ -9,13 +9,14 @@ import { SETTINGS_DOMAINS } from "./SETTINGS_DOMAINS";
|
|
|
9
9
|
*
|
|
10
10
|
* The scaffold's layout is `docs/body/settings/<domain>/<subject>.md` with the
|
|
11
11
|
* domains `world`, `cast`, `crowds`, `props`, `sets`, `cinematography` and
|
|
12
|
-
* `sound`, read in that order and alphabetically within a domain.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* `sound`, read in that order and alphabetically within a domain. Domain
|
|
13
|
+
* files use lower-kebab-case names and exclude the numbered `NNN-entry.md`
|
|
14
|
+
* form. Numbered `NNN-subject/NNN-entry.md` folders read in number order.
|
|
15
|
+
* One settings root uses one layout; `outline` is navigation, not canon.
|
|
15
16
|
*
|
|
16
|
-
* @evidence contracts/development/implementation.md#principled-implementation Concrete directory entries select legacy flat Markdown, the scaffold's closed domain folders or numbered subject folders, forbid mixed/nested/symlinked layouts, enforce unique three-digit order keys for numbered folders and return deterministic relative reading order.
|
|
17
|
+
* @evidence contracts/development/implementation.md#principled-implementation Concrete directory entries select legacy flat Markdown, the scaffold's closed domain folders or numbered subject folders, forbid mixed/nested/symlinked layouts, exclude the shared NUMBERED_FILE grammar from domain filenames, enforce unique three-digit order keys for numbered folders and return deterministic relative reading order.
|
|
17
18
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure The filesystem reader owns canon layout validation; callers build outline and evidence relationships from the returned order without rewriting existing files.
|
|
18
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Legacy flat settings and numbered folders stay supported; absent settings return empty, while unknown domains, malformed names, mixed layouts, duplicate order keys and symlinks fail for every production.
|
|
19
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Legacy flat settings and numbered folders stay supported; absent settings return empty, while unknown domains, malformed names, numbered files inside domains, mixed layouts, duplicate order keys and symlinks fail for every production. Domain admission excludes exactly the existing numbered-file grammar, preserving other digit-bearing lower-kebab-case names.
|
|
19
20
|
* @evidence contracts/development/common.md#meaningful-documentation The comment states the scaffold domain layout and its reading order, numbered and legacy retention, and that outline is navigation; errors identify mixed layouts, naming, empty folders, nesting and duplicate order numbers.
|
|
20
21
|
* @evidence contracts/development/implementation.md#efficient-algorithms For e root/subject entries, directory enumeration and name validation scan entry text; sorting folders and entries costs O(e log e) comparisons in the worst distribution, with O(e) output/sets and directory arrays. No canon bytes are read.
|
|
21
22
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work Each directory is listed once per call and duplicate-number sets avoid repeated pairwise comparisons; later calls rerun because current settings topology can change.
|
|
@@ -87,7 +88,7 @@ const NUMBERED: RegExp = /^[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
|
87
88
|
/** A numbered canon file name. */
|
|
88
89
|
const NUMBERED_FILE: RegExp = /^[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*\.md$/u;
|
|
89
90
|
|
|
90
|
-
/**
|
|
91
|
+
/** Base domain filename grammar; list additionally excludes NUMBERED_FILE. */
|
|
91
92
|
const KEBAB_FILE: RegExp = /^[a-z0-9]+(?:-[a-z0-9]+)*\.md$/u;
|
|
92
93
|
|
|
93
94
|
/** Code-unit order, independent of locale. */
|
|
@@ -95,15 +96,19 @@ function compare(left: string, right: string): 1 | -1 | 0 {
|
|
|
95
96
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
/** The sorted Markdown files of one settings folder, refusing nesting, bad names and emptiness. */
|
|
99
|
+
/** The sorted Markdown files of one settings folder, keeping domain and numbered names disjoint and refusing nesting, bad names and emptiness. */
|
|
99
100
|
function list(root: string, folder: string, pattern: RegExp): string[] {
|
|
100
101
|
const names: string[] = [];
|
|
101
102
|
for (const entry of fs.readdirSync(path.join(root, folder), {
|
|
102
103
|
withFileTypes: true,
|
|
103
104
|
})) {
|
|
104
|
-
if (
|
|
105
|
+
if (
|
|
106
|
+
!entry.isFile() ||
|
|
107
|
+
!pattern.test(entry.name) ||
|
|
108
|
+
(pattern === KEBAB_FILE && NUMBERED_FILE.test(entry.name))
|
|
109
|
+
)
|
|
105
110
|
throw new Error(
|
|
106
|
-
`${path.join(root, folder, entry.name)}: settings folders hold ${pattern === NUMBERED_FILE ? "numbered" : "lower-kebab-case"} Markdown files only, without nesting.`,
|
|
111
|
+
`${path.join(root, folder, entry.name)}: settings folders hold ${pattern === NUMBERED_FILE ? "numbered" : "unnumbered lower-kebab-case"} Markdown files only, without nesting.`,
|
|
107
112
|
);
|
|
108
113
|
names.push(entry.name);
|
|
109
114
|
}
|
|
@@ -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,
|
|
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
|
|
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
|
|
@@ -8,15 +8,16 @@ import { createLocalContractReference } from "./createLocalContractReference";
|
|
|
8
8
|
import { layerFiles } from "./layerFiles";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Selects the installed language's per-unit questions for one
|
|
11
|
+
* Selects the installed language's per-unit questions for one family.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* A language module's principles apply to every construction; its
|
|
14
|
+
* `naturalness/` questions apply to scripts construction, the one layer that
|
|
15
|
+
* selects the expression family.
|
|
15
16
|
*
|
|
16
|
-
* @evidence contracts/development/implementation.md#principled-implementation Layer-specific candidate files are selected from the installed language principles or
|
|
17
|
+
* @evidence contracts/development/implementation.md#principled-implementation Layer-specific candidate files are selected from the installed language principles or expression family, with every present file forming a per-unit H2 checklist and exclusions forbidden.
|
|
17
18
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure Family selection is localized here while local-file admission and contract-relative addresses belong to createLocalContractReference.
|
|
18
19
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Missing optional language files are omitted according to the sparse installed module; no default language or synthetic question is substituted.
|
|
19
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose states per-unit ownership,
|
|
20
|
+
* @evidence contracts/development/common.md#meaningful-documentation The prose states per-unit ownership, family selection and which construction answers the expression family.
|
|
20
21
|
* @evidence contracts/development/implementation.md#efficient-algorithms At most four candidate files each require one synchronous existence probe; mapping/filtering and allocated references have a fixed family bound with path-length-dependent string work.
|
|
21
22
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work layerFiles and the local-reference builder centralize equivalent scope/address rules; installation state is observed for each build, not cached across edits.
|
|
22
23
|
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only the bounded returned references remain with the claim owner; intermediate optional arrays and paths expire after the call with no open handles or tasks.
|
|
@@ -24,16 +25,14 @@ import { layerFiles } from "./layerFiles";
|
|
|
24
25
|
export function createLanguagePrincipleReferences(props: {
|
|
25
26
|
location: string;
|
|
26
27
|
layer: AuthoredLayer;
|
|
27
|
-
|
|
28
|
+
family: "principles" | "naturalness";
|
|
28
29
|
}): IEvidenceReference[] {
|
|
29
|
-
const family: string =
|
|
30
|
-
props.gate === "naturalness" ? "naturalness" : "principles";
|
|
31
30
|
return layerFiles(props.layer)
|
|
32
31
|
.map((file: string): IEvidenceMarkdownReference | undefined =>
|
|
33
32
|
createLocalContractReference({
|
|
34
33
|
location: props.location,
|
|
35
34
|
scope: "language",
|
|
36
|
-
file: `${family}/${file}`,
|
|
35
|
+
file: `${props.family}/${file}`,
|
|
37
36
|
checklist: true,
|
|
38
37
|
exclusion: false,
|
|
39
38
|
}),
|
|
@@ -1,14 +1,13 @@
|
|
|
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
|
/**
|
|
7
|
-
* Creates a reference to one parent story unit
|
|
6
|
+
* Creates a reference to one parent story unit.
|
|
8
7
|
*
|
|
9
|
-
* Each child
|
|
10
|
-
* exclude. This binds screenplay
|
|
11
|
-
*
|
|
8
|
+
* Each child host cites one parent, each parent has one child, and neither may
|
|
9
|
+
* exclude. This binds each long screenplay scene file to the script scene H2
|
|
10
|
+
* it realizes, and each review H2 to the authored H2 it read.
|
|
12
11
|
* Use {@link createCoverageReference} for differently partitioned layers.
|
|
13
12
|
*
|
|
14
13
|
* `review` additionally demands a current review of the cited unit. The
|
|
@@ -16,9 +15,9 @@ import { referenceLocation } from "../utilities/referenceLocation";
|
|
|
16
15
|
* unit expires the review, and the graph names the one unit to read again.
|
|
17
16
|
*
|
|
18
17
|
* @evidence contracts/development/implementation.md#principled-implementation UniqueEvidence, singleEvidencePerSymbol and noEvidenceExclude together form a one-to-one non-excludable relation; optional requireReview binds a reviewer to the exact cited unit version through native review semantics.
|
|
19
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure The strict-lineage helper stays separate from many-to-many coverage and delegates body/
|
|
18
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The strict-lineage helper stays separate from many-to-many coverage and delegates body/global address rules to referenceLocation.
|
|
20
19
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Review is an explicit supported relation variant rather than a bypass for stale text, and no expected parent is inferred from a consumer label.
|
|
21
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose states one-parent/one-child ownership,
|
|
20
|
+
* @evidence contracts/development/common.md#meaningful-documentation The prose states one-parent/one-child ownership, its screenplay and review uses and invalidation of a review when its cited unit changes.
|
|
22
21
|
* @evidence contracts/development/implementation.md#efficient-algorithms Fixed flag assembly is constant-sized; address qualification costs O(n) selector text for file hosts and retains the original selector array for H2 hosts.
|
|
23
22
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work The same address builder serves lineage and coverage; references are freshly built and optional review metadata applies only to this requested relation, with no cross-analysis cache.
|
|
24
23
|
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned object and any qualified selector strings belong to the caller; H2 mode can retain the supplied array, and no handle, task or module-level collection is owned.
|
|
@@ -26,12 +25,11 @@ import { referenceLocation } from "../utilities/referenceLocation";
|
|
|
26
25
|
export function createLineageReference(
|
|
27
26
|
files: string[],
|
|
28
27
|
symbol: "file" | "h2",
|
|
29
|
-
pass: AuthoredPass | "revision" = "draft",
|
|
30
28
|
review: boolean = false,
|
|
31
29
|
): IEvidenceReference {
|
|
32
30
|
return {
|
|
33
31
|
type: "markdown",
|
|
34
|
-
...referenceLocation(files,
|
|
32
|
+
...referenceLocation(files, symbol),
|
|
35
33
|
symbol,
|
|
36
34
|
noEvidenceExclude: true,
|
|
37
35
|
uniqueEvidence: true,
|
|
@@ -22,14 +22,15 @@ import { layerFiles } from "./layerFiles";
|
|
|
22
22
|
* words can be asked whether this speaker could have said them. No item may be
|
|
23
23
|
* excluded, because each binds wherever its condition applies.
|
|
24
24
|
*
|
|
25
|
-
* The same layer axis runs under `naturalness/`,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* The same layer axis runs under `naturalness/`, the expression questions a
|
|
26
|
+
* script can fail while being content-complete. Scripts construction
|
|
27
|
+
* selects them beside its principles, so both families ask a unit about its
|
|
28
|
+
* own body in the same pass.
|
|
28
29
|
*
|
|
29
|
-
* @evidence contracts/development/implementation.md#principled-implementation Common, inherited narrative, realized-text and layer-specific files become non-excludable per-unit H2 checklists in the selected
|
|
30
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One layer axis is reused for both
|
|
31
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Required construction files stay selected when missing so native compilation diagnoses the broken tree; sparse
|
|
32
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose explains who can answer each scope, why literal-text questions apply only to realized layers, and the
|
|
30
|
+
* @evidence contracts/development/implementation.md#principled-implementation Common, inherited narrative, realized-text and layer-specific files become non-excludable per-unit H2 checklists in the selected principles or expression family; only declared optional family files are filtered by installation, probed in the shared skills tree that createContractDirectory resolves, where createSharedReference also roots the references.
|
|
31
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One layer axis is reused for both families, while family admission remains distinct from language modules and population obligations; the owning tree is decided by createContractDirectory, not rebuilt here.
|
|
32
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Required construction files stay selected when missing so native compilation diagnoses the broken tree; sparse expression files and older realized contracts are the explicit compatibility cases.
|
|
33
|
+
* @evidence contracts/development/common.md#meaningful-documentation The prose explains who can answer each scope, why literal-text questions apply only to realized layers, and which construction selects the expression family.
|
|
33
34
|
* @evidence contracts/development/implementation.md#efficient-algorithms At most four layer-file candidates require a bounded number of optional-file probes and fixed-size reference constructions; no manuscript traversal occurs.
|
|
34
35
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work layerFiles and createSharedReference centralize scope and address semantics; optional-file existence refreshes per configuration build rather than persisting an old contract population.
|
|
35
36
|
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Intermediate file lists and returned references have a fixed family bound; config owns the result and synchronous existence checks retain no handle or running task.
|
|
@@ -37,16 +38,14 @@ import { layerFiles } from "./layerFiles";
|
|
|
37
38
|
export function createPrincipleReferences(props: {
|
|
38
39
|
contracts: IContractLocation;
|
|
39
40
|
layer: AuthoredLayer;
|
|
40
|
-
|
|
41
|
+
family: "principles" | "naturalness";
|
|
41
42
|
}): IEvidenceReference[] {
|
|
42
|
-
const family: string =
|
|
43
|
-
props.gate === "naturalness" ? "naturalness" : "principles";
|
|
44
43
|
const installed: (file: string) => boolean = (file: string): boolean =>
|
|
45
44
|
fs.existsSync(
|
|
46
45
|
path.join(
|
|
47
46
|
createContractDirectory(props.contracts, "shared"),
|
|
48
47
|
"shared",
|
|
49
|
-
|
|
48
|
+
props.family,
|
|
50
49
|
file,
|
|
51
50
|
),
|
|
52
51
|
);
|
|
@@ -54,16 +53,16 @@ export function createPrincipleReferences(props: {
|
|
|
54
53
|
// one is a broken tree rather than an absent option and must still be
|
|
55
54
|
// selected for the compiler to say so. Only the genuinely optional documents
|
|
56
55
|
// are filtered: `realized.md`, which older trees predate, and the whole
|
|
57
|
-
//
|
|
56
|
+
// expression subtree, which is sparse by design.
|
|
58
57
|
const optional: (file: string) => boolean = (file: string): boolean =>
|
|
59
|
-
props.
|
|
58
|
+
props.family === "naturalness" || file === "realized.md";
|
|
60
59
|
return layerFiles(props.layer)
|
|
61
60
|
.filter((file: string): boolean => !optional(file) || installed(file))
|
|
62
61
|
.map(
|
|
63
62
|
(file: string): IEvidenceMarkdownReference =>
|
|
64
63
|
createSharedReference({
|
|
65
64
|
contracts: props.contracts,
|
|
66
|
-
file: `${family}/${file}`,
|
|
65
|
+
file: `${props.family}/${file}`,
|
|
67
66
|
checklist: true,
|
|
68
67
|
exclusion: false,
|
|
69
68
|
}),
|
|
@@ -2,32 +2,29 @@ import type { IEvidenceReference } from "@wrtnlabs/evidence";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
-
import type { AuthoredPass } from "../../AuthoredPass";
|
|
6
5
|
import { readSettingsFiles } from "../readSettingsFiles";
|
|
7
|
-
import {
|
|
6
|
+
import { BODY_ROOT } from "../utilities/BODY_ROOT";
|
|
8
7
|
import { referenceLocation } from "../utilities/referenceLocation";
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Creates one H2 reference per canon file of settings, in any supported layout, or of a short's brief.
|
|
12
11
|
* The outline is not canon and is never an inherited settings dependency.
|
|
13
12
|
*
|
|
14
|
-
* @evidence contracts/development/implementation.md#principled-implementation The
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation The body settings or brief directory, chosen by `canon`, is enumerated under readSettingsFiles layout validation, yielding one H2 reference per actual canon file; outline navigation is excluded from canon inheritance.
|
|
15
14
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure Filesystem layout discovery stays in readSettingsFiles while this helper adds layer-qualified native-reference addresses.
|
|
16
15
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Both flat legacy canon and numbered subject folders are real supported layouts; symbolic or invalid classified entries fail in the shared enumerator rather than being silently substituted.
|
|
17
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose states per-file settings targets, two layouts and the outline exclusion; the default
|
|
16
|
+
* @evidence contracts/development/common.md#meaningful-documentation The prose states per-file settings targets, two layouts and the outline exclusion; the default canon is settings.
|
|
18
17
|
* @evidence contracts/development/implementation.md#efficient-algorithms For e directory entries and f canon files, enumeration and sorting dominate O(e log e) comparisons with O(e + f) path storage; two mapping passes allocate one reference per file without reading document contents.
|
|
19
18
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work The shared enumerator and address builder own reusable layout/address rules, but filesystem enumeration repeats each build because installed canon membership may change.
|
|
20
19
|
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned f references belong to the config owner; directory arrays and path lists are transient, and synchronous enumeration leaves no owned descriptor or background task.
|
|
21
20
|
*/
|
|
22
21
|
export function createSettingReferences(
|
|
23
22
|
location: string,
|
|
24
|
-
pass: AuthoredPass = "draft",
|
|
25
23
|
canon: "settings" | "brief" = "settings",
|
|
26
24
|
): IEvidenceReference[] {
|
|
27
25
|
const settingsRoot: string = path.join(
|
|
28
26
|
location,
|
|
29
|
-
|
|
30
|
-
"body",
|
|
27
|
+
...BODY_ROOT.split("/"),
|
|
31
28
|
canon,
|
|
32
29
|
);
|
|
33
30
|
if (!fs.existsSync(settingsRoot)) return [];
|
|
@@ -40,7 +37,7 @@ export function createSettingReferences(
|
|
|
40
37
|
): { symbol: "h2"; root: string; files: string[]; type: "markdown" } =>
|
|
41
38
|
({
|
|
42
39
|
type: "markdown",
|
|
43
|
-
...referenceLocation([file]
|
|
40
|
+
...referenceLocation([file]),
|
|
44
41
|
symbol: "h2",
|
|
45
42
|
}) satisfies IEvidenceReference,
|
|
46
43
|
);
|
|
@@ -7,14 +7,14 @@ import { isCanonLayer } from "../isCanonLayer";
|
|
|
7
7
|
*
|
|
8
8
|
* Placement is decided by who can truthfully answer an item, so the axis is
|
|
9
9
|
* the same wherever it appears: everyone, then the layers that inherit a unit,
|
|
10
|
-
* then the layers holding literal text, then one layer.
|
|
11
|
-
* scopes reuse it, because the question of who
|
|
12
|
-
*
|
|
10
|
+
* then the layers holding literal text, then one layer. The principles and
|
|
11
|
+
* expression families and both scopes reuse it, because the question of who
|
|
12
|
+
* can answer does not depend on which family asks it.
|
|
13
13
|
*
|
|
14
14
|
* @evidence contracts/development/implementation.md#principled-implementation The fixed candidate order is common, optional inherited-narrative, optional literal-text and exact layer, matching the respondent populations declared by the four-layer pipeline.
|
|
15
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One shared axis serves discovery/principle/obligation selection without duplicating layer eligibility decisions across
|
|
15
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One shared axis serves discovery/principle/obligation selection without duplicating layer eligibility decisions across families or language scopes.
|
|
16
16
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Canon layers omit inherited narrative duties and only REALIZED_LAYERS receives literal-text duties, both explicit semantic differences of the supported pipeline.
|
|
17
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose explains narrowest-last order and why eligibility depends on the respondent rather than
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation The prose explains narrowest-last order and why eligibility depends on the respondent rather than the asking family.
|
|
18
18
|
* @evidence contracts/development/implementation.md#efficient-algorithms At most four filenames and one constant-time Set membership check are produced, giving constant work and space independent of manuscript length.
|
|
19
19
|
* @evidence contracts/development/implementation.md#reuse-equivalent-work REALIZED_LAYERS is the shared eligibility set, while the returned array is fresh so filtering or mutation by one family cannot alter another family selection.
|
|
20
20
|
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The at-most-four-element result is caller-owned and no cache or resource handle is retained.
|
|
@@ -5,7 +5,7 @@ import type { NarrativeScope } from "../../NarrativeScope";
|
|
|
5
5
|
* Captures indexes and misplaced files without widening an exact pilot slice.
|
|
6
6
|
*
|
|
7
7
|
* @evidence contracts/development/implementation.md#principled-implementation Topology captures all descendants of a layer so indexes and malformed paths remain visible, narrowing scripts/screenplay only to the exact declared pilot part; treatments stay flat at validation time.
|
|
8
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One selector helper separates broad topology capture from the
|
|
8
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One selector helper separates broad topology capture from the partition and film-folder authored-unit selector used by ordinary evidence.
|
|
9
9
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The first-part pilot is a declared production scope, so the selector retains that exact slice instead of widening to other parts.
|
|
10
10
|
* @evidence contracts/development/common.md#meaningful-documentation The comment explains why indexes and misplaced files are included while an exact pilot slice stays narrow.
|
|
11
11
|
* @evidence contracts/development/implementation.md#efficient-algorithms One conditional constructs one glob string; work and returned storage scale only with layer and optional part text lengths.
|