@automovie/evidence 0.3.3 → 0.3.4
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 +12 -2
- package/lib/IAutoMovieDevelopmentProps.d.ts +7 -4
- package/lib/IAutoMovieEvidenceConfigProps.d.ts +2 -2
- package/lib/createDevelopmentContractClaims.d.ts +8 -10
- package/lib/createDevelopmentContractClaims.js +31 -13
- package/lib/createDevelopmentContractClaims.js.map +1 -1
- package/lib/createEvidenceConfig.d.ts +5 -2
- package/lib/createEvidenceConfig.js +29 -3
- package/lib/createEvidenceConfig.js.map +1 -1
- package/lib/createResearchClaims.d.ts +2 -2
- package/lib/createResearchClaims.js +3 -3
- package/lib/createResearchClaims.js.map +1 -1
- package/lib/internal/STORY_CONTRACTS.d.ts +1 -1
- package/lib/internal/STORY_CONTRACTS.js +1 -1
- package/lib/internal/assertFilmCatalogLayout.d.ts +18 -0
- package/lib/internal/assertFilmCatalogLayout.js +49 -0
- package/lib/internal/assertFilmCatalogLayout.js.map +1 -0
- package/lib/internal/hasMatchingFile.d.ts +13 -0
- package/lib/internal/hasMatchingFile.js +28 -0
- package/lib/internal/hasMatchingFile.js.map +1 -0
- package/lib/narrative/NarrativeLayer.d.ts +2 -2
- package/lib/narrative/createPackageChecklistClaim.js +2 -4
- package/lib/narrative/createPackageChecklistClaim.js.map +1 -1
- package/lib/narrative/internal/claims/createInstructionCoverageClaim.d.ts +3 -3
- package/lib/narrative/internal/claims/createInstructionCoverageClaim.js +3 -3
- package/lib/narrative/internal/claims/createLayerClaims.d.ts +5 -5
- package/lib/narrative/internal/claims/createLayerClaims.js +5 -23
- package/lib/narrative/internal/claims/createLayerClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createOutlineClaims.js +3 -4
- package/lib/narrative/internal/claims/createOutlineClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createPopulationObligationClaims.d.ts +6 -7
- package/lib/narrative/internal/claims/createPopulationObligationClaims.js +12 -29
- package/lib/narrative/internal/claims/createPopulationObligationClaims.js.map +1 -1
- package/lib/narrative/internal/claims/createReviewClaims.js +3 -17
- 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 +1 -1
- package/lib/narrative/internal/claims/index.d.ts +0 -1
- package/lib/narrative/internal/claims/index.js +0 -1
- package/lib/narrative/internal/claims/index.js.map +1 -1
- package/lib/narrative/internal/collectProductionClaims.js +1 -4
- 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/references/createLanguagePrincipleReferences.d.ts +4 -7
- package/lib/narrative/internal/references/createLanguagePrincipleReferences.js +5 -7
- package/lib/narrative/internal/references/createLanguagePrincipleReferences.js.map +1 -1
- package/lib/narrative/internal/references/createPrincipleReferences.d.ts +6 -17
- package/lib/narrative/internal/references/createPrincipleReferences.js +10 -31
- package/lib/narrative/internal/references/createPrincipleReferences.js.map +1 -1
- package/lib/narrative/internal/references/createSharedReference.d.ts +3 -4
- package/lib/narrative/internal/references/createSharedReference.js +4 -5
- package/lib/narrative/internal/references/createSharedReference.js.map +1 -1
- package/lib/narrative/internal/references/layerFiles.d.ts +5 -6
- package/lib/narrative/internal/references/layerFiles.js +6 -8
- package/lib/narrative/internal/references/layerFiles.js.map +1 -1
- package/lib/narrative/internal/utilities/createContractRoot.d.ts +6 -10
- package/lib/narrative/internal/utilities/createContractRoot.js +6 -10
- package/lib/narrative/internal/utilities/createContractRoot.js.map +1 -1
- package/lib/narrative/internal/utilities/hasStoryContract.d.ts +17 -0
- package/lib/narrative/internal/utilities/hasStoryContract.js +28 -0
- package/lib/narrative/internal/utilities/hasStoryContract.js.map +1 -0
- package/package.json +1 -1
- package/src/IAutoMovieDevelopmentProps.ts +7 -4
- package/src/IAutoMovieEvidenceConfigProps.ts +2 -2
- package/src/createDevelopmentContractClaims.ts +31 -13
- package/src/createEvidenceConfig.ts +36 -3
- package/src/createResearchClaims.ts +3 -3
- package/src/internal/STORY_CONTRACTS.ts +1 -1
- package/src/internal/assertFilmCatalogLayout.ts +55 -0
- package/src/internal/hasMatchingFile.ts +29 -0
- package/src/narrative/NarrativeLayer.ts +2 -2
- package/src/narrative/createPackageChecklistClaim.ts +2 -4
- package/src/narrative/internal/claims/createInstructionCoverageClaim.ts +3 -3
- package/src/narrative/internal/claims/createLayerClaims.ts +5 -25
- package/src/narrative/internal/claims/createOutlineClaims.ts +3 -12
- package/src/narrative/internal/claims/createPopulationObligationClaims.ts +14 -46
- package/src/narrative/internal/claims/createReviewClaims.ts +3 -25
- package/src/narrative/internal/claims/createSettingCoverageClaim.ts +1 -1
- package/src/narrative/internal/claims/index.ts +0 -1
- package/src/narrative/internal/collectProductionClaims.ts +1 -4
- package/src/narrative/internal/index.ts +0 -1
- package/src/narrative/internal/references/createLanguagePrincipleReferences.ts +5 -8
- package/src/narrative/internal/references/createPrincipleReferences.ts +13 -38
- package/src/narrative/internal/references/createSharedReference.ts +4 -5
- package/src/narrative/internal/references/layerFiles.ts +6 -8
- package/src/narrative/internal/utilities/createContractRoot.ts +6 -10
- package/src/narrative/internal/utilities/hasStoryContract.ts +29 -0
- package/lib/narrative/internal/REALIZED_LAYERS.d.ts +0 -16
- package/lib/narrative/internal/REALIZED_LAYERS.js +0 -19
- package/lib/narrative/internal/REALIZED_LAYERS.js.map +0 -1
- package/lib/narrative/internal/claims/createExpressionObligationClaims.d.ts +0 -26
- package/lib/narrative/internal/claims/createExpressionObligationClaims.js +0 -93
- package/lib/narrative/internal/claims/createExpressionObligationClaims.js.map +0 -1
- package/src/narrative/internal/REALIZED_LAYERS.ts +0 -18
- package/src/narrative/internal/claims/createExpressionObligationClaims.ts +0 -125
|
@@ -5,14 +5,10 @@ import { createContractDirectory } from "./createContractDirectory";
|
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the reference root of the contract tree owning one family.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* root differs between owners: the shared tree's `contracts/story`, reached
|
|
13
|
-
* through `..` segments in a workspace, or the production's own
|
|
14
|
-
* `docs/contracts`, so every citation address is the same in a workspace and
|
|
15
|
-
* in a standalone production.
|
|
8
|
+
* Bundled references such as `principles/screenplay.md` start at the skills
|
|
9
|
+
* tree's `contracts/story`. Production-owned `language/...` and `work/...`
|
|
10
|
+
* references start at `docs/contracts`. Each citation works the same way in
|
|
11
|
+
* a workspace and in a standalone production.
|
|
16
12
|
*
|
|
17
13
|
* The same local Markdown bytes are both pre-draft instructions and later
|
|
18
14
|
* evidence targets. Config constructs the graph but owns no document mirror.
|
|
@@ -21,13 +17,13 @@ import { createContractDirectory } from "./createContractDirectory";
|
|
|
21
17
|
* @param scope The contract family the reference addresses.
|
|
22
18
|
* @returns The `/`-separated root relative to the production's configuration directory.
|
|
23
19
|
*
|
|
24
|
-
* @evidence contracts/development/implementation.md#principled-implementation createContractDirectory
|
|
20
|
+
* @evidence contracts/development/implementation.md#principled-implementation createContractDirectory selects the bundled or production-owned tree and createReferenceRoot expresses it relative to the production location where native Evidence resolves the reference.
|
|
25
21
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure Ownership and relative-root spelling each live with their own owner; this function only composes them for the shared, language and work reference factories.
|
|
26
22
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The installed shared and production trees are the layout contracts; no fallback remote root, retired location, fixture path or copied contract bytes are introduced.
|
|
27
23
|
* @evidence contracts/development/implementation.md#efficient-algorithms A fixed number of path operations, linear in the location and skills path lengths, without reading directories or file bytes.
|
|
28
24
|
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure path computation coordinates no work across requests.
|
|
29
25
|
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Only the returned string outlives the call.
|
|
30
|
-
* @evidence contracts/development/common.md#meaningful-documentation
|
|
26
|
+
* @evidence contracts/development/common.md#meaningful-documentation Gives bundled and local citation examples with their owning roots and explains which Markdown supplies the checklist.
|
|
31
27
|
*/
|
|
32
28
|
export function createContractRoot(
|
|
33
29
|
contracts: IContractLocation,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import type { IContractLocation } from "../../../internal/IContractLocation";
|
|
5
|
+
import { createContractDirectory } from "./createContractDirectory";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Checks whether an optional bundled checklist exists at its citation address.
|
|
9
|
+
*
|
|
10
|
+
* @param contracts The production and its configured skills tree.
|
|
11
|
+
* @param file A checklist path relative to `contracts/story`.
|
|
12
|
+
* @returns Whether the current installation supplies the checklist.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/development/implementation.md#principled-implementation Probes the file relative to the same bundled contract directory used by Markdown references.
|
|
15
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Joins the address to the directory and performs one existence check.
|
|
16
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Reads the configured tree directly so a similarly named local checklist cannot activate a bundled duty.
|
|
17
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Performs one filesystem probe with path-length work.
|
|
18
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work All optional bundled families share this probe and the existing owner-directory resolver.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources A synchronous existence check keeps no handle or cached installation state.
|
|
20
|
+
* @evidence contracts/development/common.md#meaningful-documentation Documents the path base, optionality and result.
|
|
21
|
+
*/
|
|
22
|
+
export function hasStoryContract(
|
|
23
|
+
contracts: IContractLocation,
|
|
24
|
+
file: string,
|
|
25
|
+
): boolean {
|
|
26
|
+
return fs.existsSync(
|
|
27
|
+
path.join(createContractDirectory(contracts, "shared"), file),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AuthoredLayer } from "../AuthoredLayer";
|
|
2
|
-
/**
|
|
3
|
-
* Layers that hold literal reader-facing text rather than a plan for it.
|
|
4
|
-
*
|
|
5
|
-
* A treatment fixes which exchange happens and leaves the words to the layers
|
|
6
|
-
* below, so a question about the words themselves can only be asked here.
|
|
7
|
-
*
|
|
8
|
-
* Principled implementation: The set names scripts and screenplay as the only layers holding literal expression rather than documentary plans.
|
|
9
|
-
* Clear and simple design: layerFiles reads this two-layer eligibility vocabulary for every contract family that asks about literal text.
|
|
10
|
-
* Prohibited implementation shortcuts: The literal layers express supported domain responsibility and do not depend on caller or fixture identities.
|
|
11
|
-
* Meaningful documentation: The prose states the ordering or expression-versus-plan distinction needed by consumers.
|
|
12
|
-
* Efficient algorithms: Initialization stores a fixed four-element array or two-element set; iteration is bounded by that vocabulary and set membership is expected constant time.
|
|
13
|
-
* Reuse equivalent work: The readonly-typed module collection is reused by consumers; it represents immutable domain vocabulary rather than input-dependent computed work.
|
|
14
|
-
* Bound retention and release resources: The module owns one fixed-size collection for its lifetime with no input-driven growth, handle or task.
|
|
15
|
-
*/
|
|
16
|
-
export declare const REALIZED_LAYERS: ReadonlySet<AuthoredLayer>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REALIZED_LAYERS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Layers that hold literal reader-facing text rather than a plan for it.
|
|
6
|
-
*
|
|
7
|
-
* A treatment fixes which exchange happens and leaves the words to the layers
|
|
8
|
-
* below, so a question about the words themselves can only be asked here.
|
|
9
|
-
*
|
|
10
|
-
* Principled implementation: The set names scripts and screenplay as the only layers holding literal expression rather than documentary plans.
|
|
11
|
-
* Clear and simple design: layerFiles reads this two-layer eligibility vocabulary for every contract family that asks about literal text.
|
|
12
|
-
* Prohibited implementation shortcuts: The literal layers express supported domain responsibility and do not depend on caller or fixture identities.
|
|
13
|
-
* Meaningful documentation: The prose states the ordering or expression-versus-plan distinction needed by consumers.
|
|
14
|
-
* Efficient algorithms: Initialization stores a fixed four-element array or two-element set; iteration is bounded by that vocabulary and set membership is expected constant time.
|
|
15
|
-
* Reuse equivalent work: The readonly-typed module collection is reused by consumers; it represents immutable domain vocabulary rather than input-dependent computed work.
|
|
16
|
-
* Bound retention and release resources: The module owns one fixed-size collection for its lifetime with no input-driven growth, handle or task.
|
|
17
|
-
*/
|
|
18
|
-
exports.REALIZED_LAYERS = new Set(["scripts", "screenplay"]);
|
|
19
|
-
//# sourceMappingURL=REALIZED_LAYERS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"REALIZED_LAYERS.js","sourceRoot":"","sources":["../../../src/narrative/internal/REALIZED_LAYERS.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;GAaG;AACU,QAAA,eAAe,GAC1B,IAAI,GAAG,CAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { IEvidenceClaim } from "@wrtnlabs/evidence";
|
|
2
|
-
import type { AuthoredLayer } from "../../AuthoredLayer";
|
|
3
|
-
import type { IProductionConfigProps } from "../../IProductionConfigProps";
|
|
4
|
-
/**
|
|
5
|
-
* Creates the scripts population expression claims.
|
|
6
|
-
*
|
|
7
|
-
* A population question about expression, such as which sentence frames recur
|
|
8
|
-
* or how endings converge, is about the language of the finished layer.
|
|
9
|
-
* Scripts settle that language in construction, so the script population
|
|
10
|
-
* answers once at file level under the scripts construction stage. The
|
|
11
|
-
* screenplay settles its speech in construction too, under its realized-speech
|
|
12
|
-
* principles, and owes no separate expression family.
|
|
13
|
-
*
|
|
14
|
-
* The contract files sit under `naturalness/obligations`, a folder the unit
|
|
15
|
-
* checklists never select, so a population duty cannot leak into a per-unit
|
|
16
|
-
* checklist. A package whose contract predates the folder has no such claim.
|
|
17
|
-
*
|
|
18
|
-
* @evidence contracts/development/implementation.md#principled-implementation Only scripts receive file-level expression obligation claims, under their construction stage; installed shared and language files are selected separately, each requiring exactly one respondent for every population item; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
|
|
19
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Expression population questions have their own file-level family under scripts construction without leaking whole-population duties into unit checklists.
|
|
20
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent optional obligation document produces no claim under the supported older-contract layout; every other layer finishes its language in its own construction questions.
|
|
21
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose identifies the scripts respondents, file-level population semantics, construction activation and optional older contract families.
|
|
22
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms layerFiles supplies at most four candidate documents per scope; a bounded number of synchronous existence probes and path constructions dominate, and returned claims/references are fixed in count.
|
|
23
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Both scopes reuse layerFiles and shared reference constructors; existence is refreshed for each config build because installed contract files can change between builds.
|
|
24
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only bounded claim arrays and reference objects survive under caller ownership; fs.existsSync calls retain no exposed descriptor and there is no process-wide family cache.
|
|
25
|
-
*/
|
|
26
|
-
export declare function createExpressionObligationClaims(props: IProductionConfigProps, layer: AuthoredLayer): IEvidenceClaim[];
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createExpressionObligationClaims = createExpressionObligationClaims;
|
|
7
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const constructionStage_1 = require("../constructionStage");
|
|
10
|
-
const createLocalContractReference_1 = require("../references/createLocalContractReference");
|
|
11
|
-
const createSharedReference_1 = require("../references/createSharedReference");
|
|
12
|
-
const layerFiles_1 = require("../references/layerFiles");
|
|
13
|
-
const BODY_ROOT_1 = require("../utilities/BODY_ROOT");
|
|
14
|
-
const createContractDirectory_1 = require("../utilities/createContractDirectory");
|
|
15
|
-
const createUnitFiles_1 = require("../utilities/createUnitFiles");
|
|
16
|
-
/**
|
|
17
|
-
* Creates the scripts population expression claims.
|
|
18
|
-
*
|
|
19
|
-
* A population question about expression, such as which sentence frames recur
|
|
20
|
-
* or how endings converge, is about the language of the finished layer.
|
|
21
|
-
* Scripts settle that language in construction, so the script population
|
|
22
|
-
* answers once at file level under the scripts construction stage. The
|
|
23
|
-
* screenplay settles its speech in construction too, under its realized-speech
|
|
24
|
-
* principles, and owes no separate expression family.
|
|
25
|
-
*
|
|
26
|
-
* The contract files sit under `naturalness/obligations`, a folder the unit
|
|
27
|
-
* checklists never select, so a population duty cannot leak into a per-unit
|
|
28
|
-
* checklist. A package whose contract predates the folder has no such claim.
|
|
29
|
-
*
|
|
30
|
-
* @evidence contracts/development/implementation.md#principled-implementation Only scripts receive file-level expression obligation claims, under their construction stage; installed shared and language files are selected separately, each requiring exactly one respondent for every population item; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
|
|
31
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Expression population questions have their own file-level family under scripts construction without leaking whole-population duties into unit checklists.
|
|
32
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent optional obligation document produces no claim under the supported older-contract layout; every other layer finishes its language in its own construction questions.
|
|
33
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose identifies the scripts respondents, file-level population semantics, construction activation and optional older contract families.
|
|
34
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms layerFiles supplies at most four candidate documents per scope; a bounded number of synchronous existence probes and path constructions dominate, and returned claims/references are fixed in count.
|
|
35
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Both scopes reuse layerFiles and shared reference constructors; existence is refreshed for each config build because installed contract files can change between builds.
|
|
36
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only bounded claim arrays and reference objects survive under caller ownership; fs.existsSync calls retain no exposed descriptor and there is no process-wide family cache.
|
|
37
|
-
*/
|
|
38
|
-
function createExpressionObligationClaims(props, layer) {
|
|
39
|
-
if (layer !== "scripts")
|
|
40
|
-
return [];
|
|
41
|
-
const disabled = (0, constructionStage_1.constructionStage)(props, layer) === "disabled";
|
|
42
|
-
const directory = "naturalness/obligations";
|
|
43
|
-
const shared = (0, layerFiles_1.layerFiles)(layer)
|
|
44
|
-
.filter((file) => exists(props, "shared", `${directory}/${file}`))
|
|
45
|
-
.map((file) => claim({
|
|
46
|
-
disabled,
|
|
47
|
-
layer,
|
|
48
|
-
scope: props.narrativeScope,
|
|
49
|
-
reference: (0, createSharedReference_1.createSharedReference)({
|
|
50
|
-
contracts: props,
|
|
51
|
-
file: `${directory}/${file}`,
|
|
52
|
-
checklist: false,
|
|
53
|
-
exclusion: false,
|
|
54
|
-
}),
|
|
55
|
-
}));
|
|
56
|
-
const language = (0, layerFiles_1.layerFiles)(layer).flatMap((file) => {
|
|
57
|
-
const reference = (0, createLocalContractReference_1.createLocalContractReference)({
|
|
58
|
-
location: props.location,
|
|
59
|
-
scope: "language",
|
|
60
|
-
file: `${directory}/${file}`,
|
|
61
|
-
checklist: false,
|
|
62
|
-
exclusion: false,
|
|
63
|
-
});
|
|
64
|
-
return reference === undefined
|
|
65
|
-
? []
|
|
66
|
-
: [
|
|
67
|
-
claim({
|
|
68
|
-
disabled,
|
|
69
|
-
layer,
|
|
70
|
-
scope: props.narrativeScope,
|
|
71
|
-
reference,
|
|
72
|
-
}),
|
|
73
|
-
];
|
|
74
|
-
});
|
|
75
|
-
return [...shared, ...language];
|
|
76
|
-
}
|
|
77
|
-
/** Creates one claim whose layer documents answer each item exactly once. */
|
|
78
|
-
function claim(props) {
|
|
79
|
-
return {
|
|
80
|
-
name: `${props.layer} documents answer each ${props.reference.files[0]} item once`,
|
|
81
|
-
type: "markdown",
|
|
82
|
-
root: BODY_ROOT_1.BODY_ROOT,
|
|
83
|
-
files: (0, createUnitFiles_1.createUnitFiles)(props.layer, props.scope),
|
|
84
|
-
symbol: "file",
|
|
85
|
-
disabled: props.disabled,
|
|
86
|
-
reference: { ...props.reference, uniqueEvidence: true },
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/** Reports whether one optional contract-family document is installed. */
|
|
90
|
-
function exists(contracts, scope, file) {
|
|
91
|
-
return node_fs_1.default.existsSync(node_path_1.default.join((0, createContractDirectory_1.createContractDirectory)(contracts, scope), scope, ...file.split("/")));
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=createExpressionObligationClaims.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createExpressionObligationClaims.js","sourceRoot":"","sources":["../../../../src/narrative/internal/claims/createExpressionObligationClaims.ts"],"names":[],"mappings":";;;;;;AAIA,sDAAyB;AACzB,0DAA6B;AAK7B,4DAAyD;AACzD,6FAA0F;AAC1F,+EAA4E;AAC5E,yDAAsD;AACtD,sDAAmD;AACnD,kFAA+E;AAC/E,kEAA+D;AAE/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,0CACE,KAA6B,EAC7B,KAAoB;IAEpB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAY,IAAA,qCAAiB,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,UAAU,CAAC;IACzE,MAAM,SAAS,GAAW,yBAAyB,CAAC;IAEpD,MAAM,MAAM,GAAqB,IAAA,uBAAU,EAAC,KAAK,CAAC;SAC/C,MAAM,CAAC,CAAC,IAAY,EAAW,EAAE,CAChC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,CAChD;SACA,GAAG,CACF,CAAC,IAAY,EAAkB,EAAE,CAC/B,KAAK,CAAC;QACJ,QAAQ;QACR,KAAK;QACL,KAAK,EAAE,KAAK,CAAC,cAAc;QAC3B,SAAS,EAAE,IAAA,6CAAqB,EAAC;YAC/B,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE;YAC5B,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,KAAK;SACjB,CAAC;KACH,CAAC,CACL,CAAC;IAEJ,MAAM,QAAQ,GAAqB,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC,OAAO,CAC1D,CAAC,IAAY,EAAoB,EAAE;QACjC,MAAM,SAAS,GACb,IAAA,2DAA4B,EAAC;YAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE;YAC5B,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QACL,OAAO,SAAS,KAAK,SAAS;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,KAAK,CAAC;oBACJ,QAAQ;oBACR,KAAK;oBACL,KAAK,EAAE,KAAK,CAAC,cAAc;oBAC3B,SAAS;iBACV,CAAC;aACH,CAAC;IACR,CAAC,CACF,CAAC;IAEF,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,6EAA6E;AAC7E,SAAS,KAAK,CAAC,KAKd;IACC,OAAO;QACL,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,0BAA0B,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY;QAClF,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,qBAAS;QACf,KAAK,EAAE,IAAA,iCAAe,EAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;QAChD,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE;KACxD,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,SAAS,MAAM,CACb,SAA4B,EAC5B,KAA4B,EAC5B,IAAY;IAEZ,OAAO,iBAAE,CAAC,UAAU,CAClB,mBAAI,CAAC,IAAI,CACP,IAAA,iDAAuB,EAAC,SAAS,EAAE,KAAK,CAAC,EACzC,KAAK,EACL,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CACnB,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AuthoredLayer } from "../AuthoredLayer";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Layers that hold literal reader-facing text rather than a plan for it.
|
|
5
|
-
*
|
|
6
|
-
* A treatment fixes which exchange happens and leaves the words to the layers
|
|
7
|
-
* below, so a question about the words themselves can only be asked here.
|
|
8
|
-
*
|
|
9
|
-
* Principled implementation: The set names scripts and screenplay as the only layers holding literal expression rather than documentary plans.
|
|
10
|
-
* Clear and simple design: layerFiles reads this two-layer eligibility vocabulary for every contract family that asks about literal text.
|
|
11
|
-
* Prohibited implementation shortcuts: The literal layers express supported domain responsibility and do not depend on caller or fixture identities.
|
|
12
|
-
* Meaningful documentation: The prose states the ordering or expression-versus-plan distinction needed by consumers.
|
|
13
|
-
* Efficient algorithms: Initialization stores a fixed four-element array or two-element set; iteration is bounded by that vocabulary and set membership is expected constant time.
|
|
14
|
-
* Reuse equivalent work: The readonly-typed module collection is reused by consumers; it represents immutable domain vocabulary rather than input-dependent computed work.
|
|
15
|
-
* Bound retention and release resources: The module owns one fixed-size collection for its lifetime with no input-driven growth, handle or task.
|
|
16
|
-
*/
|
|
17
|
-
export const REALIZED_LAYERS: ReadonlySet<AuthoredLayer> =
|
|
18
|
-
new Set<AuthoredLayer>(["scripts", "screenplay"]);
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IEvidenceClaim,
|
|
3
|
-
IEvidenceMarkdownReference,
|
|
4
|
-
} from "@wrtnlabs/evidence";
|
|
5
|
-
import fs from "node:fs";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
|
|
8
|
-
import type { IContractLocation } from "../../../internal/IContractLocation";
|
|
9
|
-
import type { AuthoredLayer } from "../../AuthoredLayer";
|
|
10
|
-
import type { IProductionConfigProps } from "../../IProductionConfigProps";
|
|
11
|
-
import { constructionStage } from "../constructionStage";
|
|
12
|
-
import { createLocalContractReference } from "../references/createLocalContractReference";
|
|
13
|
-
import { createSharedReference } from "../references/createSharedReference";
|
|
14
|
-
import { layerFiles } from "../references/layerFiles";
|
|
15
|
-
import { BODY_ROOT } from "../utilities/BODY_ROOT";
|
|
16
|
-
import { createContractDirectory } from "../utilities/createContractDirectory";
|
|
17
|
-
import { createUnitFiles } from "../utilities/createUnitFiles";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Creates the scripts population expression claims.
|
|
21
|
-
*
|
|
22
|
-
* A population question about expression, such as which sentence frames recur
|
|
23
|
-
* or how endings converge, is about the language of the finished layer.
|
|
24
|
-
* Scripts settle that language in construction, so the script population
|
|
25
|
-
* answers once at file level under the scripts construction stage. The
|
|
26
|
-
* screenplay settles its speech in construction too, under its realized-speech
|
|
27
|
-
* principles, and owes no separate expression family.
|
|
28
|
-
*
|
|
29
|
-
* The contract files sit under `naturalness/obligations`, a folder the unit
|
|
30
|
-
* checklists never select, so a population duty cannot leak into a per-unit
|
|
31
|
-
* checklist. A package whose contract predates the folder has no such claim.
|
|
32
|
-
*
|
|
33
|
-
* @evidence contracts/development/implementation.md#principled-implementation Only scripts receive file-level expression obligation claims, under their construction stage; installed shared and language files are selected separately, each requiring exactly one respondent for every population item; createContractDirectory probes shared documents in the shared skills tree and language documents in the production's own `docs/contracts`.
|
|
34
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Expression population questions have their own file-level family under scripts construction without leaking whole-population duties into unit checklists.
|
|
35
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An absent optional obligation document produces no claim under the supported older-contract layout; every other layer finishes its language in its own construction questions.
|
|
36
|
-
* @evidence contracts/development/common.md#meaningful-documentation The prose identifies the scripts respondents, file-level population semantics, construction activation and optional older contract families.
|
|
37
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms layerFiles supplies at most four candidate documents per scope; a bounded number of synchronous existence probes and path constructions dominate, and returned claims/references are fixed in count.
|
|
38
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Both scopes reuse layerFiles and shared reference constructors; existence is refreshed for each config build because installed contract files can change between builds.
|
|
39
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Only bounded claim arrays and reference objects survive under caller ownership; fs.existsSync calls retain no exposed descriptor and there is no process-wide family cache.
|
|
40
|
-
*/
|
|
41
|
-
export function createExpressionObligationClaims(
|
|
42
|
-
props: IProductionConfigProps,
|
|
43
|
-
layer: AuthoredLayer,
|
|
44
|
-
): IEvidenceClaim[] {
|
|
45
|
-
if (layer !== "scripts") return [];
|
|
46
|
-
const disabled: boolean = constructionStage(props, layer) === "disabled";
|
|
47
|
-
const directory: string = "naturalness/obligations";
|
|
48
|
-
|
|
49
|
-
const shared: IEvidenceClaim[] = layerFiles(layer)
|
|
50
|
-
.filter((file: string): boolean =>
|
|
51
|
-
exists(props, "shared", `${directory}/${file}`),
|
|
52
|
-
)
|
|
53
|
-
.map(
|
|
54
|
-
(file: string): IEvidenceClaim =>
|
|
55
|
-
claim({
|
|
56
|
-
disabled,
|
|
57
|
-
layer,
|
|
58
|
-
scope: props.narrativeScope,
|
|
59
|
-
reference: createSharedReference({
|
|
60
|
-
contracts: props,
|
|
61
|
-
file: `${directory}/${file}`,
|
|
62
|
-
checklist: false,
|
|
63
|
-
exclusion: false,
|
|
64
|
-
}),
|
|
65
|
-
}),
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
const language: IEvidenceClaim[] = layerFiles(layer).flatMap(
|
|
69
|
-
(file: string): IEvidenceClaim[] => {
|
|
70
|
-
const reference: IEvidenceMarkdownReference | undefined =
|
|
71
|
-
createLocalContractReference({
|
|
72
|
-
location: props.location,
|
|
73
|
-
scope: "language",
|
|
74
|
-
file: `${directory}/${file}`,
|
|
75
|
-
checklist: false,
|
|
76
|
-
exclusion: false,
|
|
77
|
-
});
|
|
78
|
-
return reference === undefined
|
|
79
|
-
? []
|
|
80
|
-
: [
|
|
81
|
-
claim({
|
|
82
|
-
disabled,
|
|
83
|
-
layer,
|
|
84
|
-
scope: props.narrativeScope,
|
|
85
|
-
reference,
|
|
86
|
-
}),
|
|
87
|
-
];
|
|
88
|
-
},
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
return [...shared, ...language];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** Creates one claim whose layer documents answer each item exactly once. */
|
|
95
|
-
function claim(props: {
|
|
96
|
-
disabled: boolean;
|
|
97
|
-
layer: AuthoredLayer;
|
|
98
|
-
reference: IEvidenceMarkdownReference;
|
|
99
|
-
scope: IProductionConfigProps["narrativeScope"];
|
|
100
|
-
}): IEvidenceClaim {
|
|
101
|
-
return {
|
|
102
|
-
name: `${props.layer} documents answer each ${props.reference.files[0]} item once`,
|
|
103
|
-
type: "markdown",
|
|
104
|
-
root: BODY_ROOT,
|
|
105
|
-
files: createUnitFiles(props.layer, props.scope),
|
|
106
|
-
symbol: "file",
|
|
107
|
-
disabled: props.disabled,
|
|
108
|
-
reference: { ...props.reference, uniqueEvidence: true },
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/** Reports whether one optional contract-family document is installed. */
|
|
113
|
-
function exists(
|
|
114
|
-
contracts: IContractLocation,
|
|
115
|
-
scope: "shared" | "language",
|
|
116
|
-
file: string,
|
|
117
|
-
): boolean {
|
|
118
|
-
return fs.existsSync(
|
|
119
|
-
path.join(
|
|
120
|
-
createContractDirectory(contracts, scope),
|
|
121
|
-
scope,
|
|
122
|
-
...file.split("/"),
|
|
123
|
-
),
|
|
124
|
-
);
|
|
125
|
-
}
|