@dtmd/temper 0.0.4 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +10 -12
  2. package/bin/temper.js +52 -0
  3. package/dist/src/assembly.d.ts +32 -16
  4. package/dist/src/assembly.js +11 -10
  5. package/dist/src/builtins.d.ts +206 -41
  6. package/dist/src/builtins.js +258 -54
  7. package/dist/src/claude-code.d.ts +7 -9
  8. package/dist/src/claude-code.js +6 -8
  9. package/dist/src/contract.d.ts +47 -24
  10. package/dist/src/contract.js +35 -9
  11. package/dist/src/declarations.d.ts +42 -101
  12. package/dist/src/declarations.js +375 -47
  13. package/dist/src/emit.d.ts +56 -28
  14. package/dist/src/emit.js +177 -54
  15. package/dist/src/generated/AssemblyFactRow.d.ts +29 -0
  16. package/dist/src/generated/AssemblyFactRow.js +2 -0
  17. package/dist/src/generated/BoundRow.d.ts +14 -0
  18. package/dist/src/generated/BoundRow.js +2 -0
  19. package/dist/src/generated/CharsetRow.d.ts +15 -0
  20. package/dist/src/generated/CharsetRow.js +2 -0
  21. package/dist/src/generated/ClauseRow.d.ts +97 -0
  22. package/dist/src/generated/ClauseRow.js +1 -0
  23. package/dist/src/generated/CollectionAddressRow.d.ts +17 -0
  24. package/dist/src/generated/CollectionAddressRow.js +2 -0
  25. package/dist/src/generated/CollectionEntryRow.d.ts +23 -0
  26. package/dist/src/generated/CollectionEntryRow.js +2 -0
  27. package/dist/src/generated/CollectionEntryWire.d.ts +17 -0
  28. package/dist/src/generated/CollectionEntryWire.js +2 -0
  29. package/dist/src/generated/CountBoundRow.d.ts +13 -0
  30. package/dist/src/generated/CountBoundRow.js +2 -0
  31. package/dist/src/generated/Declarations.d.ts +89 -0
  32. package/dist/src/generated/Declarations.js +1 -0
  33. package/dist/src/generated/DegreeBoundRow.d.ts +15 -0
  34. package/dist/src/generated/DegreeBoundRow.js +1 -0
  35. package/dist/src/generated/EdgeBoundRow.d.ts +13 -0
  36. package/dist/src/generated/EdgeBoundRow.js +2 -0
  37. package/dist/src/generated/EmbeddedMember.d.ts +45 -0
  38. package/dist/src/generated/EmbeddedMember.js +1 -0
  39. package/dist/src/generated/EmbeddedMemberCollectionEntry.d.ts +21 -0
  40. package/dist/src/generated/EmbeddedMemberCollectionEntry.js +1 -0
  41. package/dist/src/generated/FeatureValue.d.ts +23 -0
  42. package/dist/src/generated/FeatureValue.js +1 -0
  43. package/dist/src/generated/Features.d.ts +82 -0
  44. package/dist/src/generated/Features.js +1 -0
  45. package/dist/src/generated/FencedBlock.d.ts +24 -0
  46. package/dist/src/generated/FencedBlock.js +2 -0
  47. package/dist/src/generated/IncludeRow.d.ts +18 -0
  48. package/dist/src/generated/IncludeRow.js +2 -0
  49. package/dist/src/generated/KindFactRow.d.ts +65 -0
  50. package/dist/src/generated/KindFactRow.js +1 -0
  51. package/dist/src/generated/LayoutRegionRow.d.ts +29 -0
  52. package/dist/src/generated/LayoutRegionRow.js +2 -0
  53. package/dist/src/generated/LayoutRow.d.ts +12 -0
  54. package/dist/src/generated/LayoutRow.js +1 -0
  55. package/dist/src/generated/MentionRow.d.ts +17 -0
  56. package/dist/src/generated/MentionRow.js +2 -0
  57. package/dist/src/generated/NestedMemberRow.d.ts +39 -0
  58. package/dist/src/generated/NestedMemberRow.js +1 -0
  59. package/dist/src/generated/Payload.d.ts +25 -0
  60. package/dist/src/generated/Payload.js +1 -0
  61. package/dist/src/generated/PayloadMember.d.ts +31 -0
  62. package/dist/src/generated/PayloadMember.js +2 -0
  63. package/dist/src/generated/RangeBoundRow.d.ts +15 -0
  64. package/dist/src/generated/RangeBoundRow.js +2 -0
  65. package/dist/src/generated/RegistrationRow.d.ts +35 -0
  66. package/dist/src/generated/RegistrationRow.js +2 -0
  67. package/dist/src/generated/RequirementRow.d.ts +40 -0
  68. package/dist/src/generated/RequirementRow.js +1 -0
  69. package/dist/src/generated/SatisfiesRow.d.ts +14 -0
  70. package/dist/src/generated/SatisfiesRow.js +2 -0
  71. package/dist/src/generated/Section.d.ts +21 -0
  72. package/dist/src/generated/Section.js +2 -0
  73. package/dist/src/generated/SectionContainsRow.d.ts +14 -0
  74. package/dist/src/generated/SectionContainsRow.js +2 -0
  75. package/dist/src/generated/SettingsRow.d.ts +25 -0
  76. package/dist/src/generated/SettingsRow.js +2 -0
  77. package/dist/src/generated/ValueType.d.ts +9 -0
  78. package/dist/src/generated/ValueType.js +2 -0
  79. package/dist/src/generated/index.d.ts +32 -0
  80. package/dist/src/generated/index.js +1 -0
  81. package/dist/src/index.d.ts +14 -18
  82. package/dist/src/index.js +10 -13
  83. package/dist/src/kind.d.ts +190 -43
  84. package/dist/src/kind.js +34 -30
  85. package/dist/src/needs.d.ts +8 -8
  86. package/dist/src/needs.js +7 -7
  87. package/dist/src/prose.d.ts +75 -28
  88. package/dist/src/prose.js +0 -0
  89. package/package.json +9 -1
  90. package/dist/src/genres.d.ts +0 -38
  91. package/dist/src/genres.js +0 -24
package/dist/src/kind.js CHANGED
@@ -1,23 +1,25 @@
1
1
  /**
2
- * Kinds — the engine room (`specs/architecture/15-kinds.md`, "A kind is a
3
- * constructor plus five facts"). A kind is a plain typed surface — an interface
4
- * `T` and a constructor `kind<T>()` — plus five facts of runtime residue: label,
5
- * locus, layout, registration, and edge fields. `tsc` is the keystroke wall; every
6
- * type erases at the seam, and what a kind leaves behind is those five facts,
7
- * riding the lock as rows. Identity travels by import, never by string — a `kind`
8
- * reference is the imported value (`15-kinds.md`, the built-ins-are-a-module
9
- * Decision).
2
+ * Kinds — the engine room. A kind is a plain typed surface — an interface
3
+ * `T` and a constructor `kind<T>()` — plus six facts of runtime residue: label,
4
+ * locus, layout, registration, edge fields, and content. A registration kind (a hook,
5
+ * an MCP server) extends the content fact with a fields-only `shape` and a
6
+ * `collectionAddress` naming the host manifest it surfaces in. `tsc` is the keystroke
7
+ * wall; every type erases at the seam, and what a kind leaves behind rides the lock as
8
+ * rows. Identity travels by import, never by string — a `kind` reference is the imported
9
+ * value.
10
10
  */
11
11
  /** The framework keys of a member init — everything else is a typed field (flat). */
12
12
  const FRAMEWORK_KEYS = new Set(["name", "prose", "satisfies", "requires", "needs"]);
13
13
  /**
14
- * Build the ordered projected-frontmatter fields for a member: nothing for a
15
- * frontmatterless kind (memory declares no `format`), else the identity field
16
- * (when the kind writes its name into frontmatter) followed by the typed fields
17
- * in the author's declared order.
14
+ * Build the ordered projected fields for a member: nothing for a frontmatterless
15
+ * body-bearing kind (memory declares no `format` and is not fields-only), else the
16
+ * identity field (when the kind writes its name into frontmatter) followed by the
17
+ * typed fields in the author's declared order. A fields-only registration kind (a
18
+ * hook, an MCP server) carries its typed fields though it declares no `format` —
19
+ * the fields are the whole member, folded into a manifest entry, never a header.
18
20
  */
19
21
  function orderedFields(facts, init) {
20
- if (facts.format === undefined)
22
+ if (facts.format === undefined && facts.shape !== "fields")
21
23
  return [];
22
24
  const typed = [];
23
25
  for (const [key, value] of Object.entries(init)) {
@@ -28,11 +30,13 @@ function orderedFields(facts, init) {
28
30
  return [...head, ...typed];
29
31
  }
30
32
  /**
31
- * Define a kind (`15-kinds.md`). Returns a constructor over the kind's typed
33
+ * Define a kind. Returns a constructor over the kind's typed
32
34
  * fields `T`; every type erases at the seam, so what the returned member carries
33
- * into emit is the five facts plus flat field data.
35
+ * into emit is the six facts plus flat field data. `options.render`, when given,
36
+ * rides alongside `facts`/`key` on the returned constructor — never on the member
37
+ * it builds, since it is erased before a member reaches emit.
34
38
  */
35
- export function kind(facts) {
39
+ export function kind(facts, options = {}) {
36
40
  const construct = (init) => ({
37
41
  kind: facts.name,
38
42
  facts,
@@ -43,21 +47,21 @@ export function kind(facts) {
43
47
  requires: init.requires ?? {},
44
48
  needs: init.needs ?? [],
45
49
  });
46
- return Object.assign(construct, { facts, key: facts.name });
50
+ return Object.assign(construct, { facts, key: facts.name, render: options.render });
47
51
  }
48
52
  /**
49
- * Define a **genre** — a kind whose locus is `genre(within hosts)`: its members
50
- * live as typed fenced blocks inside host documents instead of at their own
51
- * paths (`15-kinds.md`, "A genre is a kind at the block locus"). Registration
52
- * inherits through the host, so a genre carries no world edge of its own.
53
+ * Compose an embedded member's value for `blocks()` — the shape any project's own
54
+ * child kind uses. `kind` names the child kind: a bare string, or the child kind's
55
+ * own `KindDefinition` — passing the definition carries its `render` hook (when
56
+ * declared) through to emit, with no other change to the composed value's shape.
53
57
  */
54
- export function genre(facts) {
55
- return kind({
56
- name: facts.name,
57
- provider: facts.provider,
58
- locus: { kind: "genre", withinHosts: facts.withinHosts },
59
- unitShape: "file",
60
- registration: { via: "always" },
61
- edgeFields: facts.edgeFields,
62
- });
58
+ export function embeddedMemberValue(init) {
59
+ const [kindName, render] = typeof init.kind === "string" ? [init.kind, undefined] : [init.kind.key, init.kind.render];
60
+ return {
61
+ kind: kindName,
62
+ key: init.key,
63
+ leaves: init.leaves,
64
+ collections: init.collections ?? {},
65
+ ...(render !== undefined ? { render } : {}),
66
+ };
63
67
  }
@@ -1,31 +1,31 @@
1
1
  /**
2
- * Needs — the capabilities a member's behavior uses, declared as typed values
3
- * (`specs/architecture/20-surface.md`, "The member"; "Emit — total"). Emit derives
2
+ * Needs — the capabilities a member's behavior uses, declared as typed values.
3
+ * Emit derives
4
4
  * the settings permission list from their union, so a permission is never authored
5
5
  * twice: `permissions.allow` is the union of the members' declared `needs`, and a
6
- * permission with no member is visible as exactly that (the derived-list Decision).
6
+ * permission with no member is visible as exactly that.
7
7
  */
8
8
  /** A declared capability — its `permission` is the entry it derives in the union. */
9
9
  export interface Capability {
10
10
  /**
11
11
  * The permission-list entry this capability derives. The union of every
12
12
  * member's needs is the settings `permissions.allow` — the fold hooks and MCP
13
- * members ride into once those kinds land (`20-surface.md`, "Emit — total").
13
+ * members ride into once those kinds land.
14
14
  */
15
15
  readonly permission: string;
16
16
  }
17
17
  /**
18
18
  * A shell-command capability. Its derived permission is the Claude Code allow
19
19
  * entry `Bash(<command>)` (code.claude.com/docs/en/settings, retrieved
20
- * 2026-07-04) — the port scene's `bash("git diff")` (`20-surface.md`).
20
+ * 2026-07-04) — e.g. `bash("git diff")`.
21
21
  */
22
22
  export declare function bash(command: string): Capability;
23
23
  /** Any capability whose permission entry the author states verbatim. */
24
24
  export declare function capability(permission: string): Capability;
25
25
  /**
26
26
  * The derived permission list — the union of every capability's entry, deduped
27
- * and sorted so the derived artifact is byte-stable across runs (law 5). The
28
- * permission is derived here, never authored (`20-surface.md`, the derived-list
29
- * Decision).
27
+ * and sorted so the derived artifact is byte-stable across runs.
28
+ * The
29
+ * permission is derived here, never authored.
30
30
  */
31
31
  export declare function permissionUnion(needs: readonly Capability[]): string[];
package/dist/src/needs.js CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Needs — the capabilities a member's behavior uses, declared as typed values
3
- * (`specs/architecture/20-surface.md`, "The member"; "Emit — total"). Emit derives
2
+ * Needs — the capabilities a member's behavior uses, declared as typed values.
3
+ * Emit derives
4
4
  * the settings permission list from their union, so a permission is never authored
5
5
  * twice: `permissions.allow` is the union of the members' declared `needs`, and a
6
- * permission with no member is visible as exactly that (the derived-list Decision).
6
+ * permission with no member is visible as exactly that.
7
7
  */
8
8
  /**
9
9
  * A shell-command capability. Its derived permission is the Claude Code allow
10
10
  * entry `Bash(<command>)` (code.claude.com/docs/en/settings, retrieved
11
- * 2026-07-04) — the port scene's `bash("git diff")` (`20-surface.md`).
11
+ * 2026-07-04) — e.g. `bash("git diff")`.
12
12
  */
13
13
  export function bash(command) {
14
14
  return { permission: `Bash(${command})` };
@@ -19,9 +19,9 @@ export function capability(permission) {
19
19
  }
20
20
  /**
21
21
  * The derived permission list — the union of every capability's entry, deduped
22
- * and sorted so the derived artifact is byte-stable across runs (law 5). The
23
- * permission is derived here, never authored (`20-surface.md`, the derived-list
24
- * Decision).
22
+ * and sorted so the derived artifact is byte-stable across runs.
23
+ * The
24
+ * permission is derived here, never authored.
25
25
  */
26
26
  export function permissionUnion(needs) {
27
27
  return [...new Set(needs.map((need) => need.permission))].sort();
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Prose — three constructors, one field type (`specs/architecture/20-surface.md`,
3
- * "Prose — three constructors, one field type"). A member's words are data the
2
+ * Prose — three constructors, one field type. A member's words are data the
4
3
  * member declares: `file()` for a document that keeps its medium, `` text`…` ``
5
- * for short inline prose, `blocks()` for fully composed genre values. Whatever
4
+ * for short inline prose, `blocks()` for fully composed embedded-member values. Whatever
6
5
  * the constructor, the words land byte-identical to their authored text (law 5).
7
- * Interpolations in `` text`…` `` are **mentions** — declared one-way edges,
8
- * authored per word, resolution-checked at emit, never mined (law 8).
6
+ * Interpolations in `` text`…` `` are references, two intents apart: a **mention**
7
+ * (a {@link Mentionable}) is a declared one-way edge that moves no content, and an
8
+ * **include** (an {@link Include}) pulls the target file's bytes into the host's emitted
9
+ * projection. Both are authored per word and resolution-checked at emit, never mined
10
+ * (law 8).
9
11
  */
10
- import type { GenreValue } from "./genres.js";
12
+ import type { EmbeddedMemberValue } from "./kind.js";
11
13
  /** A declared value a mention may name — the target of the one-way citation edge. */
12
14
  export interface Mentionable {
13
15
  /** The mention's rendered form and graph edge target (`kind:name` or a leaf address). */
@@ -21,14 +23,32 @@ export interface Mention {
21
23
  readonly target: Mentionable;
22
24
  }
23
25
  /**
24
- * `file(path)` — the document keeps its medium: markdown in a markdown file,
25
- * full tooling, forever legal (posture 1, `15-kinds.md`). Resolved and read in
26
- * byte-for-byte at emit.
26
+ * An include the author interpolates into `` text`…` `` — it moves content, not a
27
+ * citation: at emit the engine pulls the target file's bytes into the host's projection
28
+ * at this slot and fingerprints the dependency. The path resolves against the stating
29
+ * module ({@link moduleUrl}), never the workspace — the same anchor {@link file} takes.
30
+ */
31
+ export interface Include {
32
+ readonly kind: "include";
33
+ /** Path to the include target, resolved against {@link moduleUrl}. */
34
+ readonly path: string;
35
+ /** The declaring module's own `import.meta.url` — what {@link path} resolves against. */
36
+ readonly moduleUrl: string;
37
+ }
38
+ /** A `` text`…` `` interpolation — a mention (moves no content) or an include (moves content). */
39
+ export type Reference = Mentionable | Include;
40
+ /**
41
+ * `file(moduleUrl, path)` — the document keeps its medium: markdown in a
42
+ * markdown file, full tooling, forever legal (posture 1, `15-kinds.md`).
43
+ * Resolved and read in byte-for-byte at emit, relative to the declaring
44
+ * module, never the process cwd.
27
45
  */
28
46
  export interface File {
29
47
  readonly kind: "file";
30
- /** Module-relative path to the authored document. */
48
+ /** Path to the authored document, resolved against {@link moduleUrl}. */
31
49
  readonly path: string;
50
+ /** The declaring module's own `import.meta.url` — what {@link path} resolves against. */
51
+ readonly moduleUrl: string;
32
52
  }
33
53
  /**
34
54
  * `` text`…` `` — short prose inline, dedented, byte-deterministic; the
@@ -37,38 +57,54 @@ export interface File {
37
57
  */
38
58
  export interface Text {
39
59
  readonly kind: "text";
40
- /** The dedented authored text with one {@link MENTION_SLOT} per mention, in order. */
60
+ /**
61
+ * The dedented authored text with one {@link MENTION_SLOT} per mention and one
62
+ * {@link INCLUDE_SLOT} per include, each in authored order.
63
+ */
41
64
  readonly template: string;
42
65
  readonly mentions: readonly Mention[];
66
+ /** The includes riding beside the text, in authored order — one per {@link INCLUDE_SLOT}. */
67
+ readonly includes: readonly Include[];
43
68
  }
44
69
  /**
45
- * `blocks(…)` — fully composed genre values (posture 3): typed collections whose
46
- * emitted document is pure render, byte-identical to the same values authored as
47
- * fences (posture 2). The shared fence format is `(genre-fence-format)`, deferred
48
- * until its first consumer lands (`15-kinds.md`), so a `blocks()` body composes
49
- * now and renders when the pilot does — emit refuses to project one until then,
50
- * never guessing a format.
70
+ * `blocks(…)` — fully composed embedded-member values (posture 3): typed
71
+ * collections rendered to `member.<kind> <key>` TOML fences, byte-identical to
72
+ * the same values authored as fences directly (posture 2) and read back by the
73
+ * engine's fold (`src/extract.rs` `parse_embedded_info`/`parse_embedded_member`).
51
74
  */
52
75
  export interface Blocks {
53
76
  readonly kind: "blocks";
54
- readonly values: readonly GenreValue[];
77
+ readonly values: readonly EmbeddedMemberValue[];
55
78
  }
56
79
  /** A member's prose — one of the three constructors, one field type. */
57
80
  export type Prose = File | Text | Blocks;
58
- /** Declare a document whose medium is preserved — read in whole at emit (posture 1). */
59
- export declare function file(path: string): File;
60
81
  /**
61
- * The inline dedenting prose constructor. Interpolate only {@link Mentionable}
62
- * values — each interpolation is a mention, opt-in per word; plain prose with
63
- * zero mentions is fully legal forever (the opt-in Decision, `20-surface.md`).
82
+ * Declare a document whose medium is preserved — read in whole at emit
83
+ * (posture 1). `moduleUrl` is the declaring module's own `import.meta.url`,
84
+ * so `path` resolves relative to that module, never the process cwd:
85
+ * `file(import.meta.url, "./long.md")`.
86
+ */
87
+ export declare function file(moduleUrl: string, path: string): File;
88
+ /**
89
+ * The inline dedenting prose constructor. Interpolate {@link Reference} values — a
90
+ * {@link Mentionable} is a mention (moves no content), an {@link Include} pulls the
91
+ * target's bytes in; either is opt-in per word, and plain prose with zero references is
92
+ * fully legal forever (the opt-in Decision, `20-surface.md`).
64
93
  *
65
94
  * # Throws
66
- * If an authored chunk contains {@link MENTION_SLOT} — the marker must be the
67
- * tool's alone, so a stray NUL is a loud authoring error, not a silent mis-split.
95
+ * If an authored chunk carries {@link MENTION_SLOT} or {@link INCLUDE_SLOT} — the markers
96
+ * are the tool's alone, so a stray one is a loud authoring error, not a silent mis-split.
68
97
  */
69
- export declare function text(strings: TemplateStringsArray, ...targets: Mentionable[]): Text;
70
- /** Compose fully-typed genre values into a member's body (posture 3). */
71
- export declare function blocks(...values: GenreValue[]): Blocks;
98
+ export declare function text(strings: TemplateStringsArray, ...targets: Reference[]): Text;
99
+ /**
100
+ * Declare an include target — its bytes are pulled into the host's projection at emit,
101
+ * a dependency the lock fingerprints. `moduleUrl` is the declaring module's own
102
+ * `import.meta.url`, so `path` resolves relative to that module, never the process cwd:
103
+ * `include(import.meta.url, "./fragment.md")`.
104
+ */
105
+ export declare function include(moduleUrl: string, path: string): Include;
106
+ /** Compose fully-typed embedded-member values into a member's body (posture 3). */
107
+ export declare function blocks(...values: EmbeddedMemberValue[]): Blocks;
72
108
  /**
73
109
  * Render an inline body to its final text — the display rule applied: each
74
110
  * mention slot becomes its target's display form, the surrounding words
@@ -76,3 +112,14 @@ export declare function blocks(...values: GenreValue[]): Blocks;
76
112
  * construction, so the walk consumes every slot.
77
113
  */
78
114
  export declare function renderText(prose: Text): string;
115
+ /**
116
+ * Resolve a leaf's authored value to its stored/rendered string: a bare string
117
+ * is unchanged; a `Text` leaf is mention-resolution-checked against
118
+ * `mentionable` (loud on a dangling address) and rendered by {@link renderText}
119
+ * — the same rule a member-level `Text` body resolves by. `context` prefixes
120
+ * the dangling-mention error so it names the leaf, not just the mention.
121
+ *
122
+ * # Throws
123
+ * If a mention names no declared value.
124
+ */
125
+ export declare function resolveLeaf(value: string | Text, mentionable: ReadonlySet<string>, context: string): string;
package/dist/src/prose.js CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtmd/temper",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "description": "The temper authoring face — the six-noun model as typed modules: harness(), kind<T>(), clause values, needs, and file()/text/blocks(). Emit compiles to the declaration rows the engine reads, a byte-faithful projection, and the lock.",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "files": [
34
34
  "dist/src",
35
+ "bin",
35
36
  "README.md"
36
37
  ],
37
38
  "publishConfig": {
@@ -46,5 +47,12 @@
46
47
  "devDependencies": {
47
48
  "@types/node": "^22.0.0",
48
49
  "typescript": "^5.6.0"
50
+ },
51
+ "bin": {
52
+ "temper": "bin/temper.js"
53
+ },
54
+ "optionalDependencies": {
55
+ "@dtmd/temper-linux-x64": "0.0.7",
56
+ "@dtmd/temper-win32-x64": "0.0.7"
49
57
  }
50
58
  }
@@ -1,38 +0,0 @@
1
- /**
2
- * Genre values — prose that declares its own anatomy (`specs/architecture/15-kinds.md`,
3
- * "A genre is a kind at the block locus"; ratified `specs/intent/00-intent.md`, the
4
- * genre Decision). A genre value's meaning-carrying fields are prose leaves —
5
- * authored strings, law-5 protected one by one — plus keyed sibling collections.
6
- * This constructor carries the **shape only**: any predicate over a genre value
7
- * is a clause some module ships, never here (`15-kinds.md`, the genre Decision).
8
- * There is no prescribed genre ontology — a corpus that argues differently
9
- * declares its own genres with the same machinery (`15-kinds.md`, "a genre is
10
- * a full kind, and genre checks are data, never engine").
11
- *
12
- * `genreValue()` is the posture-3 spelling — a fully composed value passed to
13
- * `blocks()` (`20-surface.md`). The byte-identical posture-2 fence render awaits
14
- * `(genre-fence-format)`, deferred until its first consumer lands.
15
- */
16
- /**
17
- * A genre value serialized whole: leaves are authored strings keyed by field
18
- * name; sibling collections are keyed at every level (`rejected."baked-projection"`),
19
- * never positional — leaf addresses are structural and keyed (`20-surface.md`,
20
- * the leaf-address Decision).
21
- */
22
- export interface GenreValue {
23
- /** The genre name — a project's own, never a built-in prescribed ontology. */
24
- readonly genre: string;
25
- /** The value's key — the identity a leaf address carries (`surface-authority`). */
26
- readonly key: string;
27
- /** Prose leaves: authored strings, law-5 protected one by one. */
28
- readonly leaves: Readonly<Record<string, string>>;
29
- /** Keyed sibling collections: collection → entry key → field → authored string. */
30
- readonly collections: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, string>>>>>>;
31
- }
32
- /** A project's own genre — the same machinery, an author-declared shape. */
33
- export declare function genreValue(init: {
34
- genre: string;
35
- key: string;
36
- leaves: Readonly<Record<string, string>>;
37
- collections?: GenreValue["collections"];
38
- }): GenreValue;
@@ -1,24 +0,0 @@
1
- /**
2
- * Genre values — prose that declares its own anatomy (`specs/architecture/15-kinds.md`,
3
- * "A genre is a kind at the block locus"; ratified `specs/intent/00-intent.md`, the
4
- * genre Decision). A genre value's meaning-carrying fields are prose leaves —
5
- * authored strings, law-5 protected one by one — plus keyed sibling collections.
6
- * This constructor carries the **shape only**: any predicate over a genre value
7
- * is a clause some module ships, never here (`15-kinds.md`, the genre Decision).
8
- * There is no prescribed genre ontology — a corpus that argues differently
9
- * declares its own genres with the same machinery (`15-kinds.md`, "a genre is
10
- * a full kind, and genre checks are data, never engine").
11
- *
12
- * `genreValue()` is the posture-3 spelling — a fully composed value passed to
13
- * `blocks()` (`20-surface.md`). The byte-identical posture-2 fence render awaits
14
- * `(genre-fence-format)`, deferred until its first consumer lands.
15
- */
16
- /** A project's own genre — the same machinery, an author-declared shape. */
17
- export function genreValue(init) {
18
- return {
19
- genre: init.genre,
20
- key: init.key,
21
- leaves: init.leaves,
22
- collections: init.collections ?? {},
23
- };
24
- }