@mmnto/totem 2.12.3 → 2.14.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.
Files changed (50) hide show
  1. package/dist/artifacts/legs.d.ts +36 -0
  2. package/dist/artifacts/legs.d.ts.map +1 -1
  3. package/dist/artifacts/legs.js +72 -0
  4. package/dist/artifacts/legs.js.map +1 -1
  5. package/dist/artifacts/legs.test.js +60 -1
  6. package/dist/artifacts/legs.test.js.map +1 -1
  7. package/dist/cli-resolve.d.ts +116 -0
  8. package/dist/cli-resolve.d.ts.map +1 -0
  9. package/dist/cli-resolve.js +248 -0
  10. package/dist/cli-resolve.js.map +1 -0
  11. package/dist/cli-resolve.test.d.ts +2 -0
  12. package/dist/cli-resolve.test.d.ts.map +1 -0
  13. package/dist/cli-resolve.test.js +328 -0
  14. package/dist/cli-resolve.test.js.map +1 -0
  15. package/dist/config-schema.d.ts +34 -0
  16. package/dist/config-schema.d.ts.map +1 -1
  17. package/dist/config-schema.js +20 -0
  18. package/dist/config-schema.js.map +1 -1
  19. package/dist/config-schema.test.js +55 -0
  20. package/dist/config-schema.test.js.map +1 -1
  21. package/dist/errors.d.ts +39 -1
  22. package/dist/errors.d.ts.map +1 -1
  23. package/dist/errors.js +42 -0
  24. package/dist/errors.js.map +1 -1
  25. package/dist/index.d.ts +8 -5
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +4 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/ingest/pipeline.js +3 -1
  30. package/dist/ingest/pipeline.js.map +1 -1
  31. package/dist/ingest/pipeline.test.js +23 -0
  32. package/dist/ingest/pipeline.test.js.map +1 -1
  33. package/dist/ledger.d.ts +4 -4
  34. package/dist/spine/authored-rule.d.ts +225 -4
  35. package/dist/spine/authored-rule.d.ts.map +1 -1
  36. package/dist/spine/authored-rule.js +147 -10
  37. package/dist/spine/authored-rule.js.map +1 -1
  38. package/dist/spine/authored-rule.test.js +196 -2
  39. package/dist/spine/authored-rule.test.js.map +1 -1
  40. package/dist/spine/authoring-ledger.d.ts +90 -1
  41. package/dist/spine/authoring-ledger.d.ts.map +1 -1
  42. package/dist/spine/authoring-ledger.test.js +3 -3
  43. package/dist/spine/authoring-ledger.test.js.map +1 -1
  44. package/dist/store/lance-store.d.ts +43 -7
  45. package/dist/store/lance-store.d.ts.map +1 -1
  46. package/dist/store/lance-store.js +70 -13
  47. package/dist/store/lance-store.js.map +1 -1
  48. package/dist/store/lance-store.test.js +92 -2
  49. package/dist/store/lance-store.test.js.map +1 -1
  50. package/package.json +5 -1
package/dist/ledger.d.ts CHANGED
@@ -164,7 +164,7 @@ export declare const LedgerEventSchema: z.ZodEffects<z.ZodObject<{
164
164
  qbd_correlation_id: z.ZodOptional<z.ZodString>;
165
165
  }, "strip", z.ZodTypeAny, {
166
166
  type: "suppress" | "override" | "corpus_query" | "derive_action" | "exemption" | "mcp_call" | "tool_call_first_significant" | "hook_fire" | "session_start" | "compile_run" | "claim_discipline_finding" | "compile_cache_decision";
167
- source: "lint" | "shield" | "bot";
167
+ source: "shield" | "lint" | "bot";
168
168
  timestamp: string;
169
169
  justification: string;
170
170
  ruleId?: string | undefined;
@@ -180,7 +180,7 @@ export declare const LedgerEventSchema: z.ZodEffects<z.ZodObject<{
180
180
  qbd_correlation_id?: string | undefined;
181
181
  }, {
182
182
  type: "suppress" | "override" | "corpus_query" | "derive_action" | "exemption" | "mcp_call" | "tool_call_first_significant" | "hook_fire" | "session_start" | "compile_run" | "claim_discipline_finding" | "compile_cache_decision";
183
- source: "lint" | "shield" | "bot";
183
+ source: "shield" | "lint" | "bot";
184
184
  timestamp: string;
185
185
  ruleId?: string | undefined;
186
186
  immutable?: boolean | undefined;
@@ -196,7 +196,7 @@ export declare const LedgerEventSchema: z.ZodEffects<z.ZodObject<{
196
196
  qbd_correlation_id?: string | undefined;
197
197
  }>, {
198
198
  type: "suppress" | "override" | "corpus_query" | "derive_action" | "exemption" | "mcp_call" | "tool_call_first_significant" | "hook_fire" | "session_start" | "compile_run" | "claim_discipline_finding" | "compile_cache_decision";
199
- source: "lint" | "shield" | "bot";
199
+ source: "shield" | "lint" | "bot";
200
200
  timestamp: string;
201
201
  justification: string;
202
202
  ruleId?: string | undefined;
@@ -212,7 +212,7 @@ export declare const LedgerEventSchema: z.ZodEffects<z.ZodObject<{
212
212
  qbd_correlation_id?: string | undefined;
213
213
  }, {
214
214
  type: "suppress" | "override" | "corpus_query" | "derive_action" | "exemption" | "mcp_call" | "tool_call_first_significant" | "hook_fire" | "session_start" | "compile_run" | "claim_discipline_finding" | "compile_cache_decision";
215
- source: "lint" | "shield" | "bot";
215
+ source: "shield" | "lint" | "bot";
216
216
  timestamp: string;
217
217
  ruleId?: string | undefined;
218
218
  immutable?: boolean | undefined;
@@ -4,6 +4,23 @@ import type { ClassifierLedger } from './ledgers.js';
4
4
  /** The matcher engines an authored rule may declare (mirrors `CompiledRule.engine`). */
5
5
  export declare const DeclaredEngineSchema: z.ZodEnum<["regex", "ast", "ast-grep"]>;
6
6
  export type DeclaredEngine = z.infer<typeof DeclaredEngineSchema>;
7
+ /**
8
+ * The prose extensions a prose-tagged whitelist row admits — the extension WITHOUT the dot.
9
+ *
10
+ * The four the Gate 5 batch-1 class review names for the held scope clause (mmnto-ai/totem#2988,
11
+ * Q6): one data constant, read by the scope conjunct below (`isProseGlob`) and by the CLI's
12
+ * owner-form set-id test, which digests it — so a change here moves that pinned id. Disclosed
13
+ * residue, ruled with the four: `txt` also reaches build inputs (`requirements.txt`,
14
+ * `CMakeLists.txt`) whose `#` comments are a no-grammar comment seam, and `mdx` carries ESM and
15
+ * JSX — looser than "reaches no source file" read strictly.
16
+ */
17
+ export declare const PROSE_EXTENSIONS: readonly ["md", "mdx", "rst", "txt"];
18
+ /**
19
+ * A whitelist row's scope tag (mmnto-ai/totem#2988): `'prose'` admits prose globs only. The
20
+ * literal's one home: `WhitelistScope` (the `WhitelistEntry.scope` type) is inferred from it.
21
+ */
22
+ declare const WhitelistScopeSchema: z.ZodLiteral<"prose">;
23
+ export type WhitelistScope = z.infer<typeof WhitelistScopeSchema>;
7
24
  /**
8
25
  * ADR-112 §3 — the result of the INDEPENDENT structural-eligibility check.
9
26
  * Produced by `evaluateStructuralEligibility` (NOT by the author): only
@@ -11,6 +28,11 @@ export type DeclaredEngine = z.infer<typeof DeclaredEngineSchema>;
11
28
  * `classifierDisposition: 'structural'`. `judgedBy` records who/what judged it
12
29
  * (ledger-recorded, never the author), so a human cannot smuggle a behavioral
13
30
  * policy past ADR-091's gate by hand-asserting "structural" (FM(d)).
31
+ *
32
+ * `.strict()` since mmnto-ai/totem#2988: a reader of this version fails LOUD on a field it does
33
+ * not know, where the pre-change (non-strict) schema stripped it silently — the mixed-version
34
+ * gap, in which an older reader drops a newer recorded verdict without a word. The result rides
35
+ * inside the authoring-ledger row, whose own schema is strict for the same reason.
14
36
  */
15
37
  export declare const StructEligResultSchema: z.ZodObject<{
16
38
  decidable: z.ZodBoolean;
@@ -26,14 +48,91 @@ export declare const StructEligResultSchema: z.ZodObject<{
26
48
  */
27
49
  basis: z.ZodEffects<z.ZodString, string, string>;
28
50
  judgedBy: z.ZodEffects<z.ZodString, string, string>;
29
- }, "strip", z.ZodTypeAny, {
51
+ /**
52
+ * The scope conjunct's recorded verdict (mmnto-ai/totem#2988, P2). Present iff the pair
53
+ * matched EXACTLY ONE whitelist row AND that row carries a scope tag; absent otherwise, so an
54
+ * untagged row's result keeps exactly the three keys above and its ledger material hash is
55
+ * byte-identical to the pre-change one. Recorded on BOTH outcomes because ADR-112 §3 requires
56
+ * the check that judged to record who judged and why — an admitted entry carries the
57
+ * conjunct's outcome, a refused one its cause. An optional field rather than a `basis` suffix
58
+ * because `whitelist:.+` is not injective (a class literally named with the suffix would
59
+ * collide) and the ADR's basis form is `whitelist:<class>`. This schema does not tie
60
+ * `decidable` to the conjunct: a hand-written `decidable: true` beside an unsatisfied
61
+ * conjunct parses. The check never produces one (an unsatisfied conjunct is `decidable:
62
+ * false`, in `evaluateStructuralEligibility`), and the cert path re-derives each entry
63
+ * rather than trusting its recorded row.
64
+ */
65
+ scopeConjunct: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
66
+ scope: z.ZodLiteral<"prose">;
67
+ satisfied: z.ZodLiteral<true>;
68
+ }, "strict", z.ZodTypeAny, {
69
+ scope: "prose";
70
+ satisfied: true;
71
+ }, {
72
+ scope: "prose";
73
+ satisfied: true;
74
+ }>, z.ZodObject<{
75
+ scope: z.ZodLiteral<"prose">;
76
+ satisfied: z.ZodLiteral<false>;
77
+ cause: z.ZodLiteral<"non-prose-glob">;
78
+ glob: z.ZodString;
79
+ }, "strict", z.ZodTypeAny, {
80
+ scope: "prose";
81
+ cause: "non-prose-glob";
82
+ glob: string;
83
+ satisfied: false;
84
+ }, {
85
+ scope: "prose";
86
+ cause: "non-prose-glob";
87
+ glob: string;
88
+ satisfied: false;
89
+ }>, z.ZodObject<{
90
+ scope: z.ZodLiteral<"prose">;
91
+ satisfied: z.ZodLiteral<false>;
92
+ cause: z.ZodLiteral<"no-globs">;
93
+ }, "strict", z.ZodTypeAny, {
94
+ scope: "prose";
95
+ cause: "no-globs";
96
+ satisfied: false;
97
+ }, {
98
+ scope: "prose";
99
+ cause: "no-globs";
100
+ satisfied: false;
101
+ }>]>>;
102
+ }, "strict", z.ZodTypeAny, {
30
103
  decidable: boolean;
31
104
  judgedBy: string;
32
105
  basis: string;
106
+ scopeConjunct?: {
107
+ scope: "prose";
108
+ satisfied: true;
109
+ } | {
110
+ scope: "prose";
111
+ cause: "non-prose-glob";
112
+ glob: string;
113
+ satisfied: false;
114
+ } | {
115
+ scope: "prose";
116
+ cause: "no-globs";
117
+ satisfied: false;
118
+ } | undefined;
33
119
  }, {
34
120
  decidable: boolean;
35
121
  judgedBy: string;
36
122
  basis: string;
123
+ scopeConjunct?: {
124
+ scope: "prose";
125
+ satisfied: true;
126
+ } | {
127
+ scope: "prose";
128
+ cause: "non-prose-glob";
129
+ glob: string;
130
+ satisfied: false;
131
+ } | {
132
+ scope: "prose";
133
+ cause: "no-globs";
134
+ satisfied: false;
135
+ } | undefined;
37
136
  }>;
38
137
  export type StructEligResult = z.infer<typeof StructEligResultSchema>;
39
138
  /** ADR-112 §3/§7 — accelerant-lineage marker. A mined hint that informed a human is recorded, never erased. */
@@ -369,14 +468,91 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
369
468
  */
370
469
  basis: z.ZodEffects<z.ZodString, string, string>;
371
470
  judgedBy: z.ZodEffects<z.ZodString, string, string>;
372
- }, "strip", z.ZodTypeAny, {
471
+ /**
472
+ * The scope conjunct's recorded verdict (mmnto-ai/totem#2988, P2). Present iff the pair
473
+ * matched EXACTLY ONE whitelist row AND that row carries a scope tag; absent otherwise, so an
474
+ * untagged row's result keeps exactly the three keys above and its ledger material hash is
475
+ * byte-identical to the pre-change one. Recorded on BOTH outcomes because ADR-112 §3 requires
476
+ * the check that judged to record who judged and why — an admitted entry carries the
477
+ * conjunct's outcome, a refused one its cause. An optional field rather than a `basis` suffix
478
+ * because `whitelist:.+` is not injective (a class literally named with the suffix would
479
+ * collide) and the ADR's basis form is `whitelist:<class>`. This schema does not tie
480
+ * `decidable` to the conjunct: a hand-written `decidable: true` beside an unsatisfied
481
+ * conjunct parses. The check never produces one (an unsatisfied conjunct is `decidable:
482
+ * false`, in `evaluateStructuralEligibility`), and the cert path re-derives each entry
483
+ * rather than trusting its recorded row.
484
+ */
485
+ scopeConjunct: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
486
+ scope: z.ZodLiteral<"prose">;
487
+ satisfied: z.ZodLiteral<true>;
488
+ }, "strict", z.ZodTypeAny, {
489
+ scope: "prose";
490
+ satisfied: true;
491
+ }, {
492
+ scope: "prose";
493
+ satisfied: true;
494
+ }>, z.ZodObject<{
495
+ scope: z.ZodLiteral<"prose">;
496
+ satisfied: z.ZodLiteral<false>;
497
+ cause: z.ZodLiteral<"non-prose-glob">;
498
+ glob: z.ZodString;
499
+ }, "strict", z.ZodTypeAny, {
500
+ scope: "prose";
501
+ cause: "non-prose-glob";
502
+ glob: string;
503
+ satisfied: false;
504
+ }, {
505
+ scope: "prose";
506
+ cause: "non-prose-glob";
507
+ glob: string;
508
+ satisfied: false;
509
+ }>, z.ZodObject<{
510
+ scope: z.ZodLiteral<"prose">;
511
+ satisfied: z.ZodLiteral<false>;
512
+ cause: z.ZodLiteral<"no-globs">;
513
+ }, "strict", z.ZodTypeAny, {
514
+ scope: "prose";
515
+ cause: "no-globs";
516
+ satisfied: false;
517
+ }, {
518
+ scope: "prose";
519
+ cause: "no-globs";
520
+ satisfied: false;
521
+ }>]>>;
522
+ }, "strict", z.ZodTypeAny, {
373
523
  decidable: boolean;
374
524
  judgedBy: string;
375
525
  basis: string;
526
+ scopeConjunct?: {
527
+ scope: "prose";
528
+ satisfied: true;
529
+ } | {
530
+ scope: "prose";
531
+ cause: "non-prose-glob";
532
+ glob: string;
533
+ satisfied: false;
534
+ } | {
535
+ scope: "prose";
536
+ cause: "no-globs";
537
+ satisfied: false;
538
+ } | undefined;
376
539
  }, {
377
540
  decidable: boolean;
378
541
  judgedBy: string;
379
542
  basis: string;
543
+ scopeConjunct?: {
544
+ scope: "prose";
545
+ satisfied: true;
546
+ } | {
547
+ scope: "prose";
548
+ cause: "non-prose-glob";
549
+ glob: string;
550
+ satisfied: false;
551
+ } | {
552
+ scope: "prose";
553
+ cause: "no-globs";
554
+ satisfied: false;
555
+ } | undefined;
380
556
  }>;
381
557
  origin: z.ZodUnion<[z.ZodObject<{
382
558
  kind: z.ZodLiteral<"from-scratch">;
@@ -882,6 +1058,19 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
882
1058
  decidable: boolean;
883
1059
  judgedBy: string;
884
1060
  basis: string;
1061
+ scopeConjunct?: {
1062
+ scope: "prose";
1063
+ satisfied: true;
1064
+ } | {
1065
+ scope: "prose";
1066
+ cause: "non-prose-glob";
1067
+ glob: string;
1068
+ satisfied: false;
1069
+ } | {
1070
+ scope: "prose";
1071
+ cause: "no-globs";
1072
+ satisfied: false;
1073
+ } | undefined;
885
1074
  };
886
1075
  authoringLedgerRef: string;
887
1076
  declaredEngine: "regex" | "ast" | "ast-grep";
@@ -985,6 +1174,19 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
985
1174
  decidable: boolean;
986
1175
  judgedBy: string;
987
1176
  basis: string;
1177
+ scopeConjunct?: {
1178
+ scope: "prose";
1179
+ satisfied: true;
1180
+ } | {
1181
+ scope: "prose";
1182
+ cause: "non-prose-glob";
1183
+ glob: string;
1184
+ satisfied: false;
1185
+ } | {
1186
+ scope: "prose";
1187
+ cause: "no-globs";
1188
+ satisfied: false;
1189
+ } | undefined;
988
1190
  };
989
1191
  authoringLedgerRef: string;
990
1192
  declaredEngine: "regex" | "ast" | "ast-grep";
@@ -1568,24 +1770,43 @@ export type AuthoredRulesFile = z.infer<typeof AuthoredRulesFileSchema>;
1568
1770
  * in the CLI registry (slice B); the registry lists ONLY pairs the engine can
1569
1771
  * actually represent, so "exactly one match" subsumes ADR-112 §3's "AND the
1570
1772
  * engine can represent that class" condition.
1773
+ *
1774
+ * `scope` (mmnto-ai/totem#2988, P2): a row tagged `'prose'` is decidable only for a record
1775
+ * whose every declared `fileGlobs` entry is a prose glob (`isProseGlob`); the conjunct is the
1776
+ * predicate's, mechanical, and recorded in its result. Written only in the CLI table, read only
1777
+ * by the predicate. Absent on an untagged row, which judges on the pair alone as before.
1571
1778
  */
1572
1779
  export interface WhitelistEntry {
1573
1780
  engine: DeclaredEngine;
1574
1781
  structuralClass: string;
1782
+ scope?: WhitelistScope;
1575
1783
  }
1784
+ export declare function isProseGlob(glob: string): boolean;
1576
1785
  /**
1577
1786
  * ADR-112 §3 — the INDEPENDENT structural-eligibility check. A CLOSED registry
1578
1787
  * predicate, NOT prose: `decidable` is true iff EXACTLY ONE whitelist entry
1579
- * matches `(declaredEngine, structuralClass)`. Unknown class, unsupported
1580
- * engine, or multiple matches → `decidable: false` (NO default-to-structural).
1788
+ * matches `(declaredEngine, structuralClass)` AND, when that entry carries a
1789
+ * scope tag, the scope conjunct holds over the record's declared `fileGlobs`.
1790
+ * Unknown class, unsupported engine, or multiple matches → `decidable: false`
1791
+ * (NO default-to-structural), with no `scopeConjunct` recorded.
1581
1792
  * The author supplies `declaredEngine` + `structuralClass`; this check OWNS the
1582
1793
  * verdict — any author-supplied disposition is irrelevant here (FM(d)).
1794
+ *
1795
+ * The ADR-112 §3 check has a THIRD input for a tagged row (mmnto-ai/totem#2988, P2): the
1796
+ * record's declared `fileGlobs`. For a row tagged `'prose'`, absent or empty globs fail closed
1797
+ * (`cause: 'no-globs'`), the first non-prose glob in array order refuses (`cause:
1798
+ * 'non-prose-glob'`, the glob byte-verbatim), and otherwise the entry is decidable; the verdict
1799
+ * is recorded in `scopeConjunct` on BOTH outcomes, so the check that judged is the check that
1800
+ * records why. An untagged row's result is byte-identical to the pre-change one — exactly
1801
+ * `decidable`, `basis`, `judgedBy` — whether or not globs were passed. `basis` is always
1802
+ * `whitelist:<class>`.
1583
1803
  * Deterministic + pure (no IO, no LLM) — the same input always yields the same
1584
1804
  * verdict (Tenet-15).
1585
1805
  */
1586
1806
  export declare function evaluateStructuralEligibility(input: {
1587
1807
  declaredEngine: DeclaredEngine;
1588
1808
  structuralClass: string;
1809
+ fileGlobs?: readonly string[];
1589
1810
  }, whitelist: readonly WhitelistEntry[], judgedBy: string): StructEligResult;
1590
1811
  /**
1591
1812
  * ADR-112 §8 — mint a stable, deterministic authored rule-id. The seed is
@@ -1 +1 @@
1
- {"version":3,"file":"authored-rule.d.ts","sourceRoot":"","sources":["../../src/spine/authored-rule.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,y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AAM,GACf,gBAAgB,CA4BlB;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,MAAM,CAcR;AAID;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,mBAAmB,CA6CzF"}
@@ -17,7 +17,7 @@
17
17
  import { createHash } from 'node:crypto';
18
18
  import { z } from 'zod';
19
19
  import { AUTHORED_RULE_ID_HEX_LEN, AUTHORED_RULE_ID_RE, AuthoredNegativeFixtureSchema, AuthoredProvenanceRecordSchema, isIso8601CalendarDate, SHA256_HEX_RE, } from '../compiler-schema.js';
20
- import { ParsedRuleRecordSchema } from './rule-record.js';
20
+ import { checkGlobDialect, ParsedRuleRecordSchema } from './rule-record.js';
21
21
  /** The matcher engines an authored rule may declare (mirrors `CompiledRule.engine`). */
22
22
  export const DeclaredEngineSchema = z.enum(['regex', 'ast', 'ast-grep']);
23
23
  // The §3 eligibility-basis forms: `whitelist:<class>` (the cert-#1 deterministic basis,
@@ -25,6 +25,61 @@ export const DeclaredEngineSchema = z.enum(['regex', 'ast', 'ast-grep']);
25
25
  // `draft-classifier+stage4`. Pins `basis` to the contract so a free-form/typo'd value
26
26
  // can't validate (strategy item 2, #2259).
27
27
  const ELIGIBILITY_BASIS_RE = /^(?:whitelist:.+|capability-check|draft-classifier\+stage4)$/;
28
+ /**
29
+ * The prose extensions a prose-tagged whitelist row admits — the extension WITHOUT the dot.
30
+ *
31
+ * The four the Gate 5 batch-1 class review names for the held scope clause (mmnto-ai/totem#2988,
32
+ * Q6): one data constant, read by the scope conjunct below (`isProseGlob`) and by the CLI's
33
+ * owner-form set-id test, which digests it — so a change here moves that pinned id. Disclosed
34
+ * residue, ruled with the four: `txt` also reaches build inputs (`requirements.txt`,
35
+ * `CMakeLists.txt`) whose `#` comments are a no-grammar comment seam, and `mdx` carries ESM and
36
+ * JSX — looser than "reaches no source file" read strictly.
37
+ */
38
+ export const PROSE_EXTENSIONS = Object.freeze(['md', 'mdx', 'rst', 'txt']);
39
+ /**
40
+ * A whitelist row's scope tag (mmnto-ai/totem#2988): `'prose'` admits prose globs only. The
41
+ * literal's one home: `WhitelistScope` (the `WhitelistEntry.scope` type) is inferred from it.
42
+ */
43
+ const WhitelistScopeSchema = z.literal('prose');
44
+ /**
45
+ * ADR-112 §3 — the recorded verdict of the scope conjunct a scope-tagged whitelist row adds to
46
+ * the check (mmnto-ai/totem#2988, P2). Exactly three shapes, each closed, so an inconsistent one
47
+ * (a `satisfied: false` with no cause, a `glob` on `no-globs`, a `cause` on `satisfied: true`) is
48
+ * unrepresentable:
49
+ *
50
+ * - `{ scope: 'prose', satisfied: true }` — every declared glob is a prose glob;
51
+ * - `{ scope: 'prose', satisfied: false, cause: 'non-prose-glob', glob }` — `glob` is the FIRST
52
+ * declared glob (array order) that is not, byte-verbatim. Any string, the empty one
53
+ * included: a caller of the public predicate can pass a glob outside the V1 dialect (`''`,
54
+ * or a glob with surrounding whitespace), which is not a prose glob, and the refusal must be
55
+ * recordable exactly as passed;
56
+ * - `{ scope: 'prose', satisfied: false, cause: 'no-globs' }` — no globs were supplied (fail
57
+ * closed: the predicate is a public export, and the parse-time `fileGlobs.min(1)` guards only
58
+ * the intake path).
59
+ */
60
+ const ScopeConjunctSchema = z.union([
61
+ z
62
+ .object({
63
+ scope: WhitelistScopeSchema,
64
+ satisfied: z.literal(true),
65
+ })
66
+ .strict(),
67
+ z
68
+ .object({
69
+ scope: WhitelistScopeSchema,
70
+ satisfied: z.literal(false),
71
+ cause: z.literal('non-prose-glob'),
72
+ glob: z.string(),
73
+ })
74
+ .strict(),
75
+ z
76
+ .object({
77
+ scope: WhitelistScopeSchema,
78
+ satisfied: z.literal(false),
79
+ cause: z.literal('no-globs'),
80
+ })
81
+ .strict(),
82
+ ]);
28
83
  /**
29
84
  * ADR-112 §3 — the result of the INDEPENDENT structural-eligibility check.
30
85
  * Produced by `evaluateStructuralEligibility` (NOT by the author): only
@@ -32,8 +87,14 @@ const ELIGIBILITY_BASIS_RE = /^(?:whitelist:.+|capability-check|draft-classifier
32
87
  * `classifierDisposition: 'structural'`. `judgedBy` records who/what judged it
33
88
  * (ledger-recorded, never the author), so a human cannot smuggle a behavioral
34
89
  * policy past ADR-091's gate by hand-asserting "structural" (FM(d)).
90
+ *
91
+ * `.strict()` since mmnto-ai/totem#2988: a reader of this version fails LOUD on a field it does
92
+ * not know, where the pre-change (non-strict) schema stripped it silently — the mixed-version
93
+ * gap, in which an older reader drops a newer recorded verdict without a word. The result rides
94
+ * inside the authoring-ledger row, whose own schema is strict for the same reason.
35
95
  */
36
- export const StructEligResultSchema = z.object({
96
+ export const StructEligResultSchema = z
97
+ .object({
37
98
  decidable: z.boolean(),
38
99
  /**
39
100
  * `whitelist:<class>` for the cert-#1 static-whitelist basis; the
@@ -51,7 +112,23 @@ export const StructEligResultSchema = z.object({
51
112
  judgedBy: z.string().refine((s) => s.trim().length > 0, {
52
113
  message: 'judgedBy must name the check/agent that judged eligibility (never the author)',
53
114
  }),
54
- });
115
+ /**
116
+ * The scope conjunct's recorded verdict (mmnto-ai/totem#2988, P2). Present iff the pair
117
+ * matched EXACTLY ONE whitelist row AND that row carries a scope tag; absent otherwise, so an
118
+ * untagged row's result keeps exactly the three keys above and its ledger material hash is
119
+ * byte-identical to the pre-change one. Recorded on BOTH outcomes because ADR-112 §3 requires
120
+ * the check that judged to record who judged and why — an admitted entry carries the
121
+ * conjunct's outcome, a refused one its cause. An optional field rather than a `basis` suffix
122
+ * because `whitelist:.+` is not injective (a class literally named with the suffix would
123
+ * collide) and the ADR's basis form is `whitelist:<class>`. This schema does not tie
124
+ * `decidable` to the conjunct: a hand-written `decidable: true` beside an unsatisfied
125
+ * conjunct parses. The check never produces one (an unsatisfied conjunct is `decidable:
126
+ * false`, in `evaluateStructuralEligibility`), and the cert path re-derives each entry
127
+ * rather than trusting its recorded row.
128
+ */
129
+ scopeConjunct: ScopeConjunctSchema.optional(),
130
+ })
131
+ .strict();
55
132
  /** ADR-112 §3/§7 — accelerant-lineage marker. A mined hint that informed a human is recorded, never erased. */
56
133
  export const AuthoredOriginSchema = z.union([
57
134
  z.object({ kind: z.literal('from-scratch') }),
@@ -320,23 +397,83 @@ export const AuthoredRulesFileSchema = z
320
397
  }),
321
398
  })
322
399
  .strict();
400
+ /** The wildcard-only last segments that name no extension at all (`docs/**`, `*`). */
401
+ const WILDCARD_ONLY_SEGMENTS = new Set(['**', '*']);
402
+ // mmnto-ai/totem#2988 — is `glob` a PROSE glob? First, a glob OUTSIDE the V1 dialect
403
+ // (`checkGlobDialect`, § Design 7) is not: the intake's record parse already refuses one, but
404
+ // this test is reachable through the public `evaluateStructuralEligibility`, whose caller could
405
+ // otherwise pass `!**/*.md` (negation under
406
+ // the legacy matcher), ` **/*.md` (surrounding whitespace) or `''` and read them as prose. Then
407
+ // the test is on the glob's LAST path segment (the text after the last `/`, the whole glob when
408
+ // there is none), byte-verbatim as the V1 dialect keeps it. NOT prose when that segment is `**`
409
+ // or `*`, has no `.`, or its final extension (the text after the LAST `.`, lower-cased) is not
410
+ // in `PROSE_EXTENSIONS`. So `**/*.md`, `docs/**/*.TXT` and `README.md` are prose; `**/Makefile`
411
+ // (no extension), `**/*.md.ts` (a compound suffix whose final extension is `ts`),
412
+ // `**/package.json`, `docs/**`, `**/*.md*` (final extension `md*`), `*.txt.` (an empty final
413
+ // extension) and every dialect-illegal glob (`''`, ` **/*.md`, `!**/*.md`, `/docs/*.md`,
414
+ // `docs//*.md`, …) are not. Only `fileGlobs` are judged: `excludeGlobs` only narrow a scope and
415
+ // are not an input. Pure and deterministic; the algorithm is in no set-id digest
416
+ // (precedent-consistent — the pair predicate's code is not either). Line comments, not a doc
417
+ // block: the globs above would close one.
418
+ export function isProseGlob(glob) {
419
+ if (checkGlobDialect(glob) !== null)
420
+ return false;
421
+ const segment = glob.slice(glob.lastIndexOf('/') + 1);
422
+ if (WILDCARD_ONLY_SEGMENTS.has(segment))
423
+ return false;
424
+ const dot = segment.lastIndexOf('.');
425
+ if (dot === -1)
426
+ return false;
427
+ const extension = segment.slice(dot + 1).toLowerCase();
428
+ return PROSE_EXTENSIONS.some((e) => e === extension);
429
+ }
323
430
  /**
324
431
  * ADR-112 §3 — the INDEPENDENT structural-eligibility check. A CLOSED registry
325
432
  * predicate, NOT prose: `decidable` is true iff EXACTLY ONE whitelist entry
326
- * matches `(declaredEngine, structuralClass)`. Unknown class, unsupported
327
- * engine, or multiple matches → `decidable: false` (NO default-to-structural).
433
+ * matches `(declaredEngine, structuralClass)` AND, when that entry carries a
434
+ * scope tag, the scope conjunct holds over the record's declared `fileGlobs`.
435
+ * Unknown class, unsupported engine, or multiple matches → `decidable: false`
436
+ * (NO default-to-structural), with no `scopeConjunct` recorded.
328
437
  * The author supplies `declaredEngine` + `structuralClass`; this check OWNS the
329
438
  * verdict — any author-supplied disposition is irrelevant here (FM(d)).
439
+ *
440
+ * The ADR-112 §3 check has a THIRD input for a tagged row (mmnto-ai/totem#2988, P2): the
441
+ * record's declared `fileGlobs`. For a row tagged `'prose'`, absent or empty globs fail closed
442
+ * (`cause: 'no-globs'`), the first non-prose glob in array order refuses (`cause:
443
+ * 'non-prose-glob'`, the glob byte-verbatim), and otherwise the entry is decidable; the verdict
444
+ * is recorded in `scopeConjunct` on BOTH outcomes, so the check that judged is the check that
445
+ * records why. An untagged row's result is byte-identical to the pre-change one — exactly
446
+ * `decidable`, `basis`, `judgedBy` — whether or not globs were passed. `basis` is always
447
+ * `whitelist:<class>`.
330
448
  * Deterministic + pure (no IO, no LLM) — the same input always yields the same
331
449
  * verdict (Tenet-15).
332
450
  */
333
451
  export function evaluateStructuralEligibility(input, whitelist, judgedBy) {
334
452
  const matches = whitelist.filter((e) => e.engine === input.declaredEngine && e.structuralClass === input.structuralClass);
335
- return {
336
- decidable: matches.length === 1,
337
- basis: `whitelist:${input.structuralClass}`,
338
- judgedBy,
339
- };
453
+ const basis = `whitelist:${input.structuralClass}`;
454
+ const row = matches.length === 1 ? matches[0] : undefined;
455
+ if (row === undefined || row.scope === undefined) {
456
+ return { decidable: row !== undefined, basis, judgedBy };
457
+ }
458
+ const globs = input.fileGlobs ?? [];
459
+ if (globs.length === 0) {
460
+ return {
461
+ decidable: false,
462
+ basis,
463
+ judgedBy,
464
+ scopeConjunct: { scope: row.scope, satisfied: false, cause: 'no-globs' },
465
+ };
466
+ }
467
+ const failing = globs.find((g) => !isProseGlob(g));
468
+ if (failing !== undefined) {
469
+ return {
470
+ decidable: false,
471
+ basis,
472
+ judgedBy,
473
+ scopeConjunct: { scope: row.scope, satisfied: false, cause: 'non-prose-glob', glob: failing },
474
+ };
475
+ }
476
+ return { decidable: true, basis, judgedBy, scopeConjunct: { scope: row.scope, satisfied: true } };
340
477
  }
341
478
  // ── Stable rule-id mint (ADR-112 §8) ──────────────────────────────────────────
342
479
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"authored-rule.js","sourceRoot":"","sources":["../../src/spine/authored-rule.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,6EAA6E;AAC7E,mEAAmE;AACnE,oEAAoE;AACpE,EAAE;AACF,8EAA8E;AAC9E,wEAAwE;AACxE,6EAA6E;AAC7E,iFAAiF;AACjF,wEAAwE;AACxE,oFAAoF;AACpF,2EAA2E;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACr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