@dtmd/temper 0.0.20 → 0.0.21

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.
@@ -23,6 +23,42 @@ export function hostAddress(kind, name) {
23
23
  export function nestedAddress(host, kind, key) {
24
24
  return `${host}/${kind}/${key}`;
25
25
  }
26
+ /**
27
+ * Whether `spelling` is exactly **one segment** of this grammar — non-empty, and carrying
28
+ * none of the `/` {@link segment} cuts an address at.
29
+ *
30
+ * The predicate every writer's caller judges a key by, because {@link nestedAddress} is
31
+ * infallible and the reader beneath it is not. A key carrying a `/` shifts every segment
32
+ * below it by one: `nestedAddress("spec:alpha", "decision", "authority/rejected")` spells
33
+ * the very address the member keyed `authority` spells for its `rejected` leaf, and every
34
+ * reader tries leaf grain first — so the member's own identity answers its sibling's leaf.
35
+ * An empty key spells an address {@link segment} admits at no grain at all.
36
+ * `specs/model/representation.md` ("member") makes both a malformed lock rather than a
37
+ * precedence rule: resolution is total, and coincident addresses are refused.
38
+ *
39
+ * The engine's `is_one_segment` is the same predicate at the seam's other end.
40
+ */
41
+ export function isOneSegment(spelling) {
42
+ return spelling !== "" && !spelling.includes("/");
43
+ }
44
+ /**
45
+ * Whether `spelling` may be joined onto a member's name as a **qualifier** — the text a
46
+ * name carries after its own `:` to tell two members apart that share a collection key (a
47
+ * hook's matcher: `PostToolUse:Edit|Write`).
48
+ *
49
+ * The bar is {@link isOneSegment}'s, less its non-emptiness: a qualifier joins a non-empty
50
+ * key, so the joined name is non-empty whatever the qualifier is, and an **empty**
51
+ * qualifier is a real authored spelling — a group whose `matcher` is `""` is its own group
52
+ * on the wire, and a matcher is carried verbatim, never normalized. What it may not carry
53
+ * is the `/` {@link segment} cuts an address at: the joined name is the first segment of
54
+ * every address beneath the member, so a `/` in it shifts every segment below by one and
55
+ * the member's own handler answers to an address naming no member at all.
56
+ *
57
+ * The engine's `is_name_qualifier` is the same predicate at the seam's other end.
58
+ */
59
+ export function isNameQualifier(spelling) {
60
+ return !spelling.includes("/");
61
+ }
26
62
  /**
27
63
  * Spell one leaf's address beneath a nested member. `member` is carried verbatim, so a
28
64
  * writer holding the bare member id spells the short form the lock already commits
@@ -61,6 +97,13 @@ export function edgeLookupKey(address, to) {
61
97
  * ({@link parseNestedAddress}, {@link parseLeafAddress}) and no host address at all. The
62
98
  * refusal lives here rather than at each caller, so a reader that asks "is this a host
63
99
  * address?" never has to re-spell the separator to get the answer right.
100
+ *
101
+ * A name carrying a colon is not hypothetical: a hook's name is its lifecycle event, then
102
+ * `:` and its matcher's authored bytes (`hook:PostToolUse:Edit|Write`), because the
103
+ * matcher group — not the event — is the member. The grammar is unchanged by it: the
104
+ * split is at the first colon, so the kind comes off and the rest stays one name, and the
105
+ * qualifier joined onto it is judged by {@link isNameQualifier} rather than given a third
106
+ * segment.
64
107
  */
65
108
  export function parseHostAddress(address) {
66
109
  if (address.includes("/"))
@@ -48,10 +48,10 @@ export interface Include {
48
48
  /** A `` text`…` `` interpolation — a mention (moves no content) or an include (moves content). */
49
49
  export type Reference = Mentionable | Include;
50
50
  /**
51
- * The resolution universe a mention is checked against at emit: the addresses that
52
- * resolve here and now ({@link mentionable}), and the kinds whose members the program
53
- * declares but does not compose ({@link deferrableKinds}) — a mention naming one of
54
- * those defers to `check` rather than refusing at emit.
51
+ * The resolution universe an authored reference is checked against at emit: the addresses
52
+ * that resolve here and now ({@link mentionable}), and the kinds whose members the program
53
+ * declares but does not compose ({@link deferrableKinds}) — a reference naming one of those
54
+ * defers to `check` rather than refusing at emit.
55
55
  */
56
56
  export interface MentionScope {
57
57
  /** Every address a mention may resolve against in the program's own universe. */
@@ -60,12 +60,17 @@ export interface MentionScope {
60
60
  readonly deferrableKinds: ReadonlySet<string>;
61
61
  }
62
62
  /**
63
- * Whether a mention's unresolved address **defers to the gate** rather than refusing at
64
- * emit: a host address ({@link parseHostAddress}) whose kind is one the program declares
65
- * at a discovery locus (an `at`-locus kind) may name a member discovered on disk, so
66
- * `check` owns the verdict. Anything the grammar's reader answers `undefined` for — a
67
- * segmented embedded address, a bare requirement name, a name-less `kind:` — names no
68
- * discoverable member, and stays a dangling refusal however deferrable its head reads.
63
+ * Whether an unresolved address **defers to the gate** rather than refusing at emit: a
64
+ * host address ({@link parseHostAddress}) whose kind is one the program declares at a
65
+ * discovery locus (an `at`-locus kind) may name a member discovered on disk, so `check`
66
+ * owns the verdict. Anything the grammar's reader answers `undefined` for — a segmented
67
+ * embedded address, a bare requirement name, a name-less `kind:` — names no discoverable
68
+ * member, and stays a dangling refusal however deferrable its head reads.
69
+ *
70
+ * The predicate reads an address, never the reference that carries it: refusal reaches
71
+ * exactly as far as the program's own universe (`pipeline.md`, "Emit", the "Refusing"
72
+ * bullet), so a mention ({@link checkMentions}) and an embedded value's edge target
73
+ * (`emit.ts`'s `edgeTargetFacts`) draw the same boundary at the same place.
69
74
  */
70
75
  export declare function defersToGate(address: string, deferrableKinds: ReadonlySet<string>): boolean;
71
76
  /**
package/dist/src/prose.js CHANGED
@@ -23,12 +23,17 @@ export function mentionOf(member) {
23
23
  return { address: hostAddress(member.kind, member.name), display: member.name };
24
24
  }
25
25
  /**
26
- * Whether a mention's unresolved address **defers to the gate** rather than refusing at
27
- * emit: a host address ({@link parseHostAddress}) whose kind is one the program declares
28
- * at a discovery locus (an `at`-locus kind) may name a member discovered on disk, so
29
- * `check` owns the verdict. Anything the grammar's reader answers `undefined` for — a
30
- * segmented embedded address, a bare requirement name, a name-less `kind:` — names no
31
- * discoverable member, and stays a dangling refusal however deferrable its head reads.
26
+ * Whether an unresolved address **defers to the gate** rather than refusing at emit: a
27
+ * host address ({@link parseHostAddress}) whose kind is one the program declares at a
28
+ * discovery locus (an `at`-locus kind) may name a member discovered on disk, so `check`
29
+ * owns the verdict. Anything the grammar's reader answers `undefined` for — a segmented
30
+ * embedded address, a bare requirement name, a name-less `kind:` — names no discoverable
31
+ * member, and stays a dangling refusal however deferrable its head reads.
32
+ *
33
+ * The predicate reads an address, never the reference that carries it: refusal reaches
34
+ * exactly as far as the program's own universe (`pipeline.md`, "Emit", the "Refusing"
35
+ * bullet), so a mention ({@link checkMentions}) and an embedded value's edge target
36
+ * (`emit.ts`'s `edgeTargetFacts`) draw the same boundary at the same place.
32
37
  */
33
38
  export function defersToGate(address, deferrableKinds) {
34
39
  const host = parseHostAddress(address);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtmd/temper",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
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": {
@@ -52,7 +52,7 @@
52
52
  "temper": "bin/temper.js"
53
53
  },
54
54
  "optionalDependencies": {
55
- "@dtmd/temper-linux-x64": "0.0.20",
56
- "@dtmd/temper-win32-x64": "0.0.20"
55
+ "@dtmd/temper-linux-x64": "0.0.21",
56
+ "@dtmd/temper-win32-x64": "0.0.21"
57
57
  }
58
58
  }