@automovie/evidence 0.2.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 +2 -2
- package/lib/IAutoMovieDevelopmentProps.d.ts +5 -5
- package/lib/createDevelopmentContractClaims.d.ts +9 -7
- package/lib/createDevelopmentContractClaims.js +9 -12
- package/lib/createDevelopmentContractClaims.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/package.json +4 -4
- package/src/IAutoMovieDevelopmentProps.ts +5 -5
- package/src/createDevelopmentContractClaims.ts +9 -12
- package/src/narrative/internal/readSettingsFiles.ts +14 -9
package/README.md
CHANGED
|
@@ -78,10 +78,10 @@ export default createEvidenceConfig({
|
|
|
78
78
|
| --- | --- | --- |
|
|
79
79
|
| `research` | Each study in `docs/research/` | `contracts/story/shared/principles/research.md` |
|
|
80
80
|
| `development.entities` | Exports under `src/entities/` | `contracts/development/entities.md` |
|
|
81
|
-
| `development.behaviors` | Exports under `src/laws/`, `src/interactions/` and `src/consequences/` | `contracts/development/behaviors.md
|
|
81
|
+
| `development.behaviors` | Exports under `src/laws/`, `src/interactions/` and `src/consequences/` | `contracts/development/behaviors.md` |
|
|
82
82
|
| `development.composition` | Exports under `src/composition/` | `contracts/development/composition.md`, citing the screenplay scene files, sections and beats they realize |
|
|
83
83
|
|
|
84
|
-
Every
|
|
84
|
+
Every screenplay section and beat must be realized by some scene, and every scene file by the film that orders it. Under `narrative: { mode: "none" }` with `development.composition`, every section of `docs/instructions/` must be realized by some composition or entity too, with no exclusion, because no narrative layer cites them. An option you leave out stays disabled.
|
|
85
85
|
|
|
86
86
|
### Your own claims
|
|
87
87
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* one checklist under `contracts/development/` of the shared skills tree, answered in
|
|
6
6
|
* their doc comments: entities in `src/entities/` answer `entities.md`, laws,
|
|
7
7
|
* interactions and consequences in `src/laws/`, `src/interactions/` and
|
|
8
|
-
* `src/consequences/` answer `behaviors.md
|
|
9
|
-
* and scenes and films in `src/composition/` answer `composition.md`, scenes
|
|
8
|
+
* `src/consequences/` answer `behaviors.md`, a law naming the study it
|
|
9
|
+
* follows in its answer, and scenes and films in `src/composition/` answer `composition.md`, scenes
|
|
10
10
|
* citing the screenplay scene file or the sections and beats of it they
|
|
11
11
|
* realize and films citing the scene files they order. An omitted stage stays
|
|
12
12
|
* `"disabled"`, so ordinary coding and narrative-only work owe none of them.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @evidence contracts/development/design.md#principled-representation One stage per contract mirrors the scaffold's development contracts, so a commission enables exactly the duties its code can establish.
|
|
15
15
|
* @evidence contracts/development/design.md#minimal-and-owned-surface Three optional fields with the narrative stage vocabulary; folders, populations and references belong to the claim factory.
|
|
16
16
|
* @evidence contracts/development/design.md#prohibited-design-shortcuts No stage is implied by file presence; an absent field is disabled.
|
|
17
|
-
* @evidence contracts/development/common.md#meaningful-documentation The comment names each stage's respondents,
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation The comment names each stage's respondents, the scene and film citations and the disabled default.
|
|
18
18
|
*/
|
|
19
19
|
export interface IAutoMovieDevelopmentProps {
|
|
20
20
|
/**
|
|
@@ -24,8 +24,8 @@ export interface IAutoMovieDevelopmentProps {
|
|
|
24
24
|
entities?: "disabled" | "evidence";
|
|
25
25
|
/**
|
|
26
26
|
* Functions and methods under `src/laws/`, `src/interactions/` and
|
|
27
|
-
* `src/consequences/` answer `contracts/development/behaviors.md
|
|
28
|
-
*
|
|
27
|
+
* `src/consequences/` answer `contracts/development/behaviors.md`. A law
|
|
28
|
+
* names the study it follows in its answer; no study citation is required.
|
|
29
29
|
*/
|
|
30
30
|
behaviors?: "disabled" | "evidence";
|
|
31
31
|
/**
|
|
@@ -9,19 +9,21 @@ import type { IAutoMovieDevelopmentProps } from "./IAutoMovieDevelopmentProps";
|
|
|
9
9
|
* tree at `props.skills`, by default the production's own `.agents/skills`.
|
|
10
10
|
* Entities answer with their types, classes, functions and methods, because an
|
|
11
11
|
* entity is a class whose methods are its capabilities. Behaviors (laws,
|
|
12
|
-
* interactions and consequences)
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* interactions and consequences) answer their checklist alone: most only
|
|
13
|
+
* compose installed actions and follow no study, and a study can serve the
|
|
14
|
+
* screenplay without any code, so neither direction of a study relation
|
|
15
|
+
* holds for every production. A law names the study it follows in its
|
|
16
|
+
* answer, which review judges.
|
|
15
17
|
* Scenes cite the screenplay scene file, or the sections and beats of it they
|
|
16
18
|
* realize, and every H2 section and H3 beat must be realized; films cite each
|
|
17
19
|
* scene file they order, and every scene file must belong to a film. With
|
|
18
20
|
* `instructions`, the composition and entities must also realize every
|
|
19
21
|
* instruction section, which no narrative layer then cites, with no
|
|
20
|
-
* exclusion. Entities answer their checklist alone, because their
|
|
21
|
-
* citations are judged by review rather than required for every
|
|
22
|
-
* heading.
|
|
22
|
+
* exclusion. Entities answer their checklist alone too, because their
|
|
23
|
+
* settings citations are judged by review rather than required for every
|
|
24
|
+
* settings heading.
|
|
23
25
|
*
|
|
24
|
-
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the
|
|
26
|
+
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the screenplay-section-and-beat-to-scene and scene-file-to-film relations mechanical, while entities and behaviors carry the checklist alone; `instructions` adds the instruction-to-code relation with the same coverage, no checklist and no exclusion, because a user requirement cannot be waived by its realizer.
|
|
25
27
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure One table maps each checklist population to its stage, folders, symbol kinds and cited population, and the one instruction relation, which has no checklist, follows it; disabled stages produce no claim, and the one props object carries the stages, the instruction switch and where the checklists are read.
|
|
26
28
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Source folders are the scaffold layout's documented locations, not fixture paths; nothing is inferred from file presence.
|
|
27
29
|
* @evidence contracts/development/common.md#meaningful-documentation The comment states each stage's respondents, the relation it enforces and which skills tree holds the checklists; the `skills` member states its form and default, and `instructions` when the code must realize every instruction section.
|
|
@@ -11,19 +11,21 @@ const SKILLS_ROOT_1 = require("./internal/SKILLS_ROOT");
|
|
|
11
11
|
* tree at `props.skills`, by default the production's own `.agents/skills`.
|
|
12
12
|
* Entities answer with their types, classes, functions and methods, because an
|
|
13
13
|
* entity is a class whose methods are its capabilities. Behaviors (laws,
|
|
14
|
-
* interactions and consequences)
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* interactions and consequences) answer their checklist alone: most only
|
|
15
|
+
* compose installed actions and follow no study, and a study can serve the
|
|
16
|
+
* screenplay without any code, so neither direction of a study relation
|
|
17
|
+
* holds for every production. A law names the study it follows in its
|
|
18
|
+
* answer, which review judges.
|
|
17
19
|
* Scenes cite the screenplay scene file, or the sections and beats of it they
|
|
18
20
|
* realize, and every H2 section and H3 beat must be realized; films cite each
|
|
19
21
|
* scene file they order, and every scene file must belong to a film. With
|
|
20
22
|
* `instructions`, the composition and entities must also realize every
|
|
21
23
|
* instruction section, which no narrative layer then cites, with no
|
|
22
|
-
* exclusion. Entities answer their checklist alone, because their
|
|
23
|
-
* citations are judged by review rather than required for every
|
|
24
|
-
* heading.
|
|
24
|
+
* exclusion. Entities answer their checklist alone too, because their
|
|
25
|
+
* settings citations are judged by review rather than required for every
|
|
26
|
+
* settings heading.
|
|
25
27
|
*
|
|
26
|
-
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the
|
|
28
|
+
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the screenplay-section-and-beat-to-scene and scene-file-to-film relations mechanical, while entities and behaviors carry the checklist alone; `instructions` adds the instruction-to-code relation with the same coverage, no checklist and no exclusion, because a user requirement cannot be waived by its realizer.
|
|
27
29
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure One table maps each checklist population to its stage, folders, symbol kinds and cited population, and the one instruction relation, which has no checklist, follows it; disabled stages produce no claim, and the one props object carries the stages, the instruction switch and where the checklists are read.
|
|
28
30
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Source folders are the scaffold layout's documented locations, not fixture paths; nothing is inferred from file presence.
|
|
29
31
|
* @evidence contracts/development/common.md#meaningful-documentation The comment states each stage's respondents, the relation it enforces and which skills tree holds the checklists; the `skills` member states its form and default, and `instructions` when the code must realize every instruction section.
|
|
@@ -49,11 +51,6 @@ function createDevelopmentContractClaims(props = {}) {
|
|
|
49
51
|
"src/consequences/**/*.ts",
|
|
50
52
|
],
|
|
51
53
|
symbol: ["function"],
|
|
52
|
-
cited: {
|
|
53
|
-
type: "markdown",
|
|
54
|
-
files: ["docs/research/**/*.md", "!docs/research/index.md"],
|
|
55
|
-
symbol: "file",
|
|
56
|
-
},
|
|
57
54
|
},
|
|
58
55
|
{
|
|
59
56
|
stage: "composition",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDevelopmentContractClaims.js","sourceRoot":"","sources":["../src/createDevelopmentContractClaims.ts"],"names":[],"mappings":";;;AAOA,wDAAqD;AAErD
|
|
1
|
+
{"version":3,"file":"createDevelopmentContractClaims.js","sourceRoot":"","sources":["../src/createDevelopmentContractClaims.ts"],"names":[],"mappings":";;;AAOA,wDAAqD;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,yCACE,KAAK,GAiBD,EAAE;IAEN,MAAM,UAAU,GAAa,CAAC,8BAA8B,CAAC,CAAC;IAC9D,MAAM,WAAW,GAMX;QACJ;YACE,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,CAAC,sBAAsB,CAAC;YAC/B,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;SAC7B;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YACD,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SACrE;KACF,CAAC,CACH,CAAC;IACJ,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU;QACjE,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,6CAA6C;YACnD,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,CAAC,yBAAyB,EAAE,sBAAsB,CAAC;YAC1D,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;YAC5B,SAAS,EAAE;gBACT,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,CAAC,wBAAwB,CAAC;gBACjC,MAAM,EAAE,IAAI;gBACZ,iBAAiB,EAAE,IAAI;aACxB;SACF,CAAC,CAAC;IACL,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The scaffold's layout is `docs/body/settings/<domain>/<subject>.md` with the
|
|
6
6
|
* domains `world`, `cast`, `crowds`, `props`, `sets`, `cinematography` and
|
|
7
|
-
* `sound`, read in that order and alphabetically within a domain.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `sound`, read in that order and alphabetically within a domain. Domain
|
|
8
|
+
* files use lower-kebab-case names and exclude the numbered `NNN-entry.md`
|
|
9
|
+
* form. Numbered `NNN-subject/NNN-entry.md` folders read in number order.
|
|
10
|
+
* One settings root uses one layout; `outline` is navigation, not canon.
|
|
10
11
|
*
|
|
11
|
-
* @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.
|
|
12
|
+
* @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.
|
|
12
13
|
* @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.
|
|
13
|
-
* @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.
|
|
14
|
+
* @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.
|
|
14
15
|
* @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.
|
|
15
16
|
* @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.
|
|
16
17
|
* @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.
|
|
@@ -13,13 +13,14 @@ const SETTINGS_DOMAINS_1 = require("./SETTINGS_DOMAINS");
|
|
|
13
13
|
*
|
|
14
14
|
* The scaffold's layout is `docs/body/settings/<domain>/<subject>.md` with the
|
|
15
15
|
* domains `world`, `cast`, `crowds`, `props`, `sets`, `cinematography` and
|
|
16
|
-
* `sound`, read in that order and alphabetically within a domain.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* `sound`, read in that order and alphabetically within a domain. Domain
|
|
17
|
+
* files use lower-kebab-case names and exclude the numbered `NNN-entry.md`
|
|
18
|
+
* form. Numbered `NNN-subject/NNN-entry.md` folders read in number order.
|
|
19
|
+
* One settings root uses one layout; `outline` is navigation, not canon.
|
|
19
20
|
*
|
|
20
|
-
* @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.
|
|
21
|
+
* @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.
|
|
21
22
|
* @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.
|
|
22
|
-
* @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.
|
|
23
|
+
* @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.
|
|
23
24
|
* @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.
|
|
24
25
|
* @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.
|
|
25
26
|
* @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.
|
|
@@ -78,20 +79,22 @@ function readSettingsFiles(root) {
|
|
|
78
79
|
const NUMBERED = /^[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
79
80
|
/** A numbered canon file name. */
|
|
80
81
|
const NUMBERED_FILE = /^[0-9]{3}-[a-z0-9]+(?:-[a-z0-9]+)*\.md$/u;
|
|
81
|
-
/**
|
|
82
|
+
/** Base domain filename grammar; list additionally excludes NUMBERED_FILE. */
|
|
82
83
|
const KEBAB_FILE = /^[a-z0-9]+(?:-[a-z0-9]+)*\.md$/u;
|
|
83
84
|
/** Code-unit order, independent of locale. */
|
|
84
85
|
function compare(left, right) {
|
|
85
86
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
86
87
|
}
|
|
87
|
-
/** The sorted Markdown files of one settings folder, refusing nesting, bad names and emptiness. */
|
|
88
|
+
/** The sorted Markdown files of one settings folder, keeping domain and numbered names disjoint and refusing nesting, bad names and emptiness. */
|
|
88
89
|
function list(root, folder, pattern) {
|
|
89
90
|
const names = [];
|
|
90
91
|
for (const entry of node_fs_1.default.readdirSync(node_path_1.default.join(root, folder), {
|
|
91
92
|
withFileTypes: true,
|
|
92
93
|
})) {
|
|
93
|
-
if (!entry.isFile() ||
|
|
94
|
-
|
|
94
|
+
if (!entry.isFile() ||
|
|
95
|
+
!pattern.test(entry.name) ||
|
|
96
|
+
(pattern === KEBAB_FILE && NUMBERED_FILE.test(entry.name)))
|
|
97
|
+
throw new Error(`${node_path_1.default.join(root, folder, entry.name)}: settings folders hold ${pattern === NUMBERED_FILE ? "numbered" : "unnumbered lower-kebab-case"} Markdown files only, without nesting.`);
|
|
95
98
|
names.push(entry.name);
|
|
96
99
|
}
|
|
97
100
|
if (!names.length)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readSettingsFiles.js","sourceRoot":"","sources":["../../../src/narrative/internal/readSettingsFiles.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DA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IAAI,EAAE,MAAM,CAAC,EAAE;QAC1D,aAAa,EAAE,IAAI;KACpB,CAAC,EAAE,CAAC;QACH,IACE,CAAC,KAAK,CAAC,MAAM,EAAE;YACf,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,CAAC,OAAO,KAAK,UAAU,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,IAAI,KAAK,CACb,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,2BAA2B,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,6BAA6B,wCAAwC,CAChL,CAAC;QACJ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,MAAM;QACf,MAAM,IAAI,KAAK,CACb,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,0CAA0C,CACrE,CAAC;IACJ,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automovie/evidence",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Evidence configuration and optional narrative lifecycle validation for AutoMovie productions",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.23.2"
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@wrtnlabs/evidence": "^0.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@ttsc/evidence": "^0.37.
|
|
45
|
-
"@ttsc/lint": "^0.37.
|
|
44
|
+
"@ttsc/evidence": "^0.37.1",
|
|
45
|
+
"@ttsc/lint": "^0.37.1",
|
|
46
46
|
"@types/node": "^22.19.17",
|
|
47
47
|
"rimraf": "^6.0.1",
|
|
48
|
-
"ttsc": "^0.37.
|
|
48
|
+
"ttsc": "^0.37.1",
|
|
49
49
|
"typescript": "^7.0.2"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* one checklist under `contracts/development/` of the shared skills tree, answered in
|
|
6
6
|
* their doc comments: entities in `src/entities/` answer `entities.md`, laws,
|
|
7
7
|
* interactions and consequences in `src/laws/`, `src/interactions/` and
|
|
8
|
-
* `src/consequences/` answer `behaviors.md
|
|
9
|
-
* and scenes and films in `src/composition/` answer `composition.md`, scenes
|
|
8
|
+
* `src/consequences/` answer `behaviors.md`, a law naming the study it
|
|
9
|
+
* follows in its answer, and scenes and films in `src/composition/` answer `composition.md`, scenes
|
|
10
10
|
* citing the screenplay scene file or the sections and beats of it they
|
|
11
11
|
* realize and films citing the scene files they order. An omitted stage stays
|
|
12
12
|
* `"disabled"`, so ordinary coding and narrative-only work owe none of them.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @evidence contracts/development/design.md#principled-representation One stage per contract mirrors the scaffold's development contracts, so a commission enables exactly the duties its code can establish.
|
|
15
15
|
* @evidence contracts/development/design.md#minimal-and-owned-surface Three optional fields with the narrative stage vocabulary; folders, populations and references belong to the claim factory.
|
|
16
16
|
* @evidence contracts/development/design.md#prohibited-design-shortcuts No stage is implied by file presence; an absent field is disabled.
|
|
17
|
-
* @evidence contracts/development/common.md#meaningful-documentation The comment names each stage's respondents,
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation The comment names each stage's respondents, the scene and film citations and the disabled default.
|
|
18
18
|
*/
|
|
19
19
|
export interface IAutoMovieDevelopmentProps {
|
|
20
20
|
/**
|
|
@@ -25,8 +25,8 @@ export interface IAutoMovieDevelopmentProps {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Functions and methods under `src/laws/`, `src/interactions/` and
|
|
28
|
-
* `src/consequences/` answer `contracts/development/behaviors.md
|
|
29
|
-
*
|
|
28
|
+
* `src/consequences/` answer `contracts/development/behaviors.md`. A law
|
|
29
|
+
* names the study it follows in its answer; no study citation is required.
|
|
30
30
|
*/
|
|
31
31
|
behaviors?: "disabled" | "evidence";
|
|
32
32
|
|
|
@@ -16,19 +16,21 @@ import { SKILLS_ROOT } from "./internal/SKILLS_ROOT";
|
|
|
16
16
|
* tree at `props.skills`, by default the production's own `.agents/skills`.
|
|
17
17
|
* Entities answer with their types, classes, functions and methods, because an
|
|
18
18
|
* entity is a class whose methods are its capabilities. Behaviors (laws,
|
|
19
|
-
* interactions and consequences)
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* interactions and consequences) answer their checklist alone: most only
|
|
20
|
+
* compose installed actions and follow no study, and a study can serve the
|
|
21
|
+
* screenplay without any code, so neither direction of a study relation
|
|
22
|
+
* holds for every production. A law names the study it follows in its
|
|
23
|
+
* answer, which review judges.
|
|
22
24
|
* Scenes cite the screenplay scene file, or the sections and beats of it they
|
|
23
25
|
* realize, and every H2 section and H3 beat must be realized; films cite each
|
|
24
26
|
* scene file they order, and every scene file must belong to a film. With
|
|
25
27
|
* `instructions`, the composition and entities must also realize every
|
|
26
28
|
* instruction section, which no narrative layer then cites, with no
|
|
27
|
-
* exclusion. Entities answer their checklist alone, because their
|
|
28
|
-
* citations are judged by review rather than required for every
|
|
29
|
-
* heading.
|
|
29
|
+
* exclusion. Entities answer their checklist alone too, because their
|
|
30
|
+
* settings citations are judged by review rather than required for every
|
|
31
|
+
* settings heading.
|
|
30
32
|
*
|
|
31
|
-
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the
|
|
33
|
+
* @evidence contracts/development/implementation.md#principled-implementation Native TypeScript claims carry the checklist, and a second Markdown reference uses native target coverage to make the screenplay-section-and-beat-to-scene and scene-file-to-film relations mechanical, while entities and behaviors carry the checklist alone; `instructions` adds the instruction-to-code relation with the same coverage, no checklist and no exclusion, because a user requirement cannot be waived by its realizer.
|
|
32
34
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure One table maps each checklist population to its stage, folders, symbol kinds and cited population, and the one instruction relation, which has no checklist, follows it; disabled stages produce no claim, and the one props object carries the stages, the instruction switch and where the checklists are read.
|
|
33
35
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Source folders are the scaffold layout's documented locations, not fixture paths; nothing is inferred from file presence.
|
|
34
36
|
* @evidence contracts/development/common.md#meaningful-documentation The comment states each stage's respondents, the relation it enforces and which skills tree holds the checklists; the `skills` member states its form and default, and `instructions` when the code must realize every instruction section.
|
|
@@ -79,11 +81,6 @@ export function createDevelopmentContractClaims(
|
|
|
79
81
|
"src/consequences/**/*.ts",
|
|
80
82
|
],
|
|
81
83
|
symbol: ["function"],
|
|
82
|
-
cited: {
|
|
83
|
-
type: "markdown",
|
|
84
|
-
files: ["docs/research/**/*.md", "!docs/research/index.md"],
|
|
85
|
-
symbol: "file",
|
|
86
|
-
},
|
|
87
84
|
},
|
|
88
85
|
{
|
|
89
86
|
stage: "composition",
|
|
@@ -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
|
}
|