@mmnto/totem 1.118.1 → 1.119.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/dist/artifacts/admission.d.ts +12 -12
- package/dist/artifacts/verdict.d.ts +16 -16
- package/dist/compile-manifest.d.ts +89 -0
- package/dist/compile-manifest.d.ts.map +1 -1
- package/dist/compile-manifest.js +180 -31
- package/dist/compile-manifest.js.map +1 -1
- package/dist/compile-manifest.test.js +169 -1
- package/dist/compile-manifest.test.js.map +1 -1
- package/dist/compiler-schema.d.ts +1067 -0
- package/dist/compiler-schema.d.ts.map +1 -1
- package/dist/compiler-schema.js +204 -1
- package/dist/compiler-schema.js.map +1 -1
- package/dist/compiler-schema.test.js +92 -0
- package/dist/compiler-schema.test.js.map +1 -1
- package/dist/compiler.d.ts +2 -6
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +6 -17
- package/dist/compiler.js.map +1 -1
- package/dist/freeze.d.ts +3 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +12 -12
- package/dist/regex-safety/apply-rules-bounded.d.ts +11 -0
- package/dist/regex-safety/apply-rules-bounded.d.ts.map +1 -1
- package/dist/regex-safety/apply-rules-bounded.js +59 -5
- package/dist/regex-safety/apply-rules-bounded.js.map +1 -1
- package/dist/regex-validation.d.ts +7 -0
- package/dist/regex-validation.d.ts.map +1 -0
- package/dist/regex-validation.js +32 -0
- package/dist/regex-validation.js.map +1 -0
- package/dist/rule-engine.d.ts +11 -1
- package/dist/rule-engine.d.ts.map +1 -1
- package/dist/rule-engine.js +125 -18
- package/dist/rule-engine.js.map +1 -1
- package/dist/spine/authored-rule.d.ts +669 -245
- package/dist/spine/authored-rule.d.ts.map +1 -1
- package/dist/spine/authored-rule.js +113 -27
- package/dist/spine/authored-rule.js.map +1 -1
- package/dist/spine/authored-rule.test.js +170 -4
- package/dist/spine/authored-rule.test.js.map +1 -1
- package/dist/spine/authoring-ledger.d.ts +69 -10
- package/dist/spine/authoring-ledger.d.ts.map +1 -1
- package/dist/spine/authoring-ledger.js +46 -25
- package/dist/spine/authoring-ledger.js.map +1 -1
- package/dist/spine/authoring-ledger.test.js +20 -7
- package/dist/spine/authoring-ledger.test.js.map +1 -1
- package/dist/spine/candidate-rule.d.ts +18 -1
- package/dist/spine/candidate-rule.d.ts.map +1 -1
- package/dist/spine/candidate-rule.js.map +1 -1
- package/dist/spine/cert-corpus-seed.d.ts +8 -8
- package/dist/spine/compile.d.ts +4 -1
- package/dist/spine/compile.d.ts.map +1 -1
- package/dist/spine/compile.js +50 -3
- package/dist/spine/compile.js.map +1 -1
- package/dist/spine/compile.test.js +189 -23
- package/dist/spine/compile.test.js.map +1 -1
- package/dist/spine/frozen-split.d.ts +18 -18
- package/dist/spine/ledgers.d.ts +24 -24
- package/dist/spine/lf-normalize.d.ts +9 -0
- package/dist/spine/lf-normalize.d.ts.map +1 -0
- package/dist/spine/lf-normalize.js +38 -0
- package/dist/spine/lf-normalize.js.map +1 -0
- package/dist/spine/preimage-differential.d.ts +3 -1
- package/dist/spine/preimage-differential.d.ts.map +1 -1
- package/dist/spine/preimage-differential.js +9 -6
- package/dist/spine/preimage-differential.js.map +1 -1
- package/dist/spine/preimage-differential.test.js +59 -0
- package/dist/spine/preimage-differential.test.js.map +1 -1
- package/dist/spine/record-exemplars.fixture.d.ts +5 -0
- package/dist/spine/record-exemplars.fixture.d.ts.map +1 -0
- package/dist/spine/record-exemplars.fixture.js +61 -0
- package/dist/spine/record-exemplars.fixture.js.map +1 -0
- package/dist/spine/record-lower.d.ts +90 -0
- package/dist/spine/record-lower.d.ts.map +1 -0
- package/dist/spine/record-lower.js +418 -0
- package/dist/spine/record-lower.js.map +1 -0
- package/dist/spine/record-lower.test.d.ts +2 -0
- package/dist/spine/record-lower.test.d.ts.map +1 -0
- package/dist/spine/record-lower.test.js +562 -0
- package/dist/spine/record-lower.test.js.map +1 -0
- package/dist/spine/record-runtime.d.ts +215 -0
- package/dist/spine/record-runtime.d.ts.map +1 -0
- package/dist/spine/record-runtime.js +330 -0
- package/dist/spine/record-runtime.js.map +1 -0
- package/dist/spine/record-runtime.test.d.ts +2 -0
- package/dist/spine/record-runtime.test.d.ts.map +1 -0
- package/dist/spine/record-runtime.test.js +814 -0
- package/dist/spine/record-runtime.test.js.map +1 -0
- package/dist/spine/rule-record.d.ts +864 -0
- package/dist/spine/rule-record.d.ts.map +1 -0
- package/dist/spine/rule-record.js +781 -0
- package/dist/spine/rule-record.js.map +1 -0
- package/dist/spine/rule-record.test.d.ts +2 -0
- package/dist/spine/rule-record.test.d.ts.map +1 -0
- package/dist/spine/rule-record.test.js +1262 -0
- package/dist/spine/rule-record.test.js.map +1 -0
- package/dist/spine/windtunnel-firing.d.ts.map +1 -1
- package/dist/spine/windtunnel-firing.js +28 -1
- package/dist/spine/windtunnel-firing.js.map +1 -1
- package/dist/spine/windtunnel-lock.d.ts +10 -10
- package/dist/stage4-verifier.d.ts.map +1 -1
- package/dist/stage4-verifier.js +61 -17
- package/dist/stage4-verifier.js.map +1 -1
- package/dist/sys/glob.d.ts +30 -0
- package/dist/sys/glob.d.ts.map +1 -1
- package/dist/sys/glob.js +62 -1
- package/dist/sys/glob.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
// ─── Prop 310 V1 record grammar — the LOWERING (slice 2 of the V1 build) ──────
|
|
2
|
+
//
|
|
3
|
+
// Slice 1 (`rule-record.ts`) turns record bytes into a validated
|
|
4
|
+
// `ParsedRuleRecord`. This module turns that value into a `CompiledRule`. It is
|
|
5
|
+
// the § Design 1 seam replacement for records: the record path does NOT go
|
|
6
|
+
// through `extractManualPattern` or `CompileInputCandidate.dslSource`, because
|
|
7
|
+
// the record is ALREADY parsed — re-serializing it into lesson markdown just to
|
|
8
|
+
// re-parse it would reintroduce the incumbent grammar this proposal supersedes.
|
|
9
|
+
// What is reused is the VALIDATORS (`validateRegex`, `validateAstGrepPattern`)
|
|
10
|
+
// and the field builder (`engineFields`), never the parser and never the frozen
|
|
11
|
+
// `LessonInput` actuator.
|
|
12
|
+
//
|
|
13
|
+
// § Design 12 (R2) is this slice's charter: **every construct the parser admits
|
|
14
|
+
// either lands on the compiled record or fails compile LOUD.** No construct is
|
|
15
|
+
// accepted at parse and dropped at compile. That obligation is enforced
|
|
16
|
+
// mechanically here, not by inspection — see § "Total lowering, mechanically".
|
|
17
|
+
//
|
|
18
|
+
// ── OPERATOR RULING 2026-08-21 (tree-form) ───────────────────────────────────
|
|
19
|
+
//
|
|
20
|
+
// `target.rule` is the ast-grep RULE TREE, not a whole NapiConfig — the
|
|
21
|
+
// exemplar-faithful reading of § Design 4's "NapiConfig subset" (its exemplar
|
|
22
|
+
// shows `rule: {kind: catch_clause, not: {...}}`, a rule tree, with `language`
|
|
23
|
+
// living one level up at `target.language`).
|
|
24
|
+
//
|
|
25
|
+
// - LOWERING DERIVES the NapiConfig wrapper: `{rule: <tree>, language: <napi
|
|
26
|
+
// language derived from the resolved `target.language`>}`. The record
|
|
27
|
+
// therefore never carries a duplicate language home (§ Design 3's no-mirror
|
|
28
|
+
// discipline; Tenet 20) and no language COLLISION between the payload
|
|
29
|
+
// interior and `target.language` is representable.
|
|
30
|
+
// - `constraints` / `utils` are INEXPRESSIBLE at V1 (censused: zero of the 19
|
|
31
|
+
// compound corpus rules use them). Demand becomes a typed `construct-gap` at
|
|
32
|
+
// the R14 trial plus a grammar version bump giving each its own SIBLING home
|
|
33
|
+
// under `target:` — never a silent smuggle inside the rule tree, which is
|
|
34
|
+
// why the tree gate below names them explicitly instead of leaving them to
|
|
35
|
+
// napi's generic unknown-field error.
|
|
36
|
+
//
|
|
37
|
+
// Grounds of record: the spec-normative exemplar (§ Design 14's normativity
|
|
38
|
+
// flip), language-collision avoidance, and zero corpus cost.
|
|
39
|
+
//
|
|
40
|
+
// ── Identity ─────────────────────────────────────────────────────────────────
|
|
41
|
+
//
|
|
42
|
+
// Identity is an INPUT, never minted here (§ Design 3 / R17): the ADR-112 §8
|
|
43
|
+
// producer mints `ruleId` at the intake seam and slice 3 threads it in. This
|
|
44
|
+
// function asserts it is well-formed and makes it the compiled identity
|
|
45
|
+
// (`lessonHash ← ruleId`, the §8/§9 `firingLabelId ← ruleId` unification), and
|
|
46
|
+
// NEVER hashes `dslSource` — there is no `dslSource` on this path, and a
|
|
47
|
+
// content-derived id would orphan the rule's ground-truth labels on every
|
|
48
|
+
// matcher edit.
|
|
49
|
+
//
|
|
50
|
+
// ── Freeze boundary ──────────────────────────────────────────────────────────
|
|
51
|
+
//
|
|
52
|
+
// `sanitizeFileGlobs` is NEVER called here. The record's globs were validated at
|
|
53
|
+
// parse against § Design 7's strict dialect and are carried BYTE-VERBATIM:
|
|
54
|
+
// brace expansion and shallow-glob promotion are exactly the silent transforms
|
|
55
|
+
// the grammar kills (§ Design 7's conformance-scope paragraph), while the
|
|
56
|
+
// sanitizer's tolerant behaviour for the FROZEN legacy lesson corpus is
|
|
57
|
+
// untouched — the freeze covers that path and nothing regenerates it.
|
|
58
|
+
import { extensionToLanguage, registeredExtensions } from '../ast-classifier.js';
|
|
59
|
+
import { extensionToLang, TRAILING_EXT_RE } from '../ast-grep-query.js';
|
|
60
|
+
import { validateAstGrepPattern } from '../compile-lesson.js';
|
|
61
|
+
import { engineFields, validateRegex } from '../compiler.js';
|
|
62
|
+
import { CompiledRuleSchema } from '../compiler-schema.js';
|
|
63
|
+
import { AUTHORED_RULE_ID_RE } from './authored-rule.js';
|
|
64
|
+
/**
|
|
65
|
+
* Resolve `target.language` against the registry, using `extensionToLanguage` as
|
|
66
|
+
* the authority verbatim (§ Design 6). Deterministic: `registeredExtensions()`
|
|
67
|
+
* returns a sorted snapshot, so the representative extension for a language with
|
|
68
|
+
* several (`.ts`/`.mts`/`.cts` → `typescript`) is always the same one — and every
|
|
69
|
+
* extension of one language maps to the same napi grammar anyway, so the pick
|
|
70
|
+
* cannot change the validation verdict, only the diagnostic.
|
|
71
|
+
*
|
|
72
|
+
* An unresolvable language FAILS LOUD (§ Design 6 / § Failure modes: "Unresolvable
|
|
73
|
+
* `language:` at compile — hard error"). It is surfaced as a `rejected` outcome
|
|
74
|
+
* rather than a throw, matching the incumbent's treatment of every other
|
|
75
|
+
* authored-content validation failure: `rejected` is a counted, reported,
|
|
76
|
+
* NON-silent state, while throws are reserved for producer-contract violations
|
|
77
|
+
* (a malformed id, a payload/type divergence) — see `compileRuleRecord`.
|
|
78
|
+
*/
|
|
79
|
+
export function resolveRecordLanguage(language) {
|
|
80
|
+
const extensions = registeredExtensions();
|
|
81
|
+
const extension = extensions.find((ext) => extensionToLanguage(ext) === language);
|
|
82
|
+
if (extension === undefined) {
|
|
83
|
+
const known = [...new Set(extensions.map((ext) => extensionToLanguage(ext)))]
|
|
84
|
+
.filter((lang) => lang !== undefined)
|
|
85
|
+
.sort();
|
|
86
|
+
return {
|
|
87
|
+
resolved: false,
|
|
88
|
+
reason: `Prop 310 § Design 6: target.language '${language}' is not registered — the resolution authority is the Map-backed extensionToLanguage registry (built-ins + pack contributions), never a spec-frozen enum. Registered languages: ${known.join(', ') || '(none)'}. Install the pack that provides this language, or correct the record.`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { resolved: true, language, extension };
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The glob list handed to `validateAstGrepPattern` so it resolves to EXACTLY the
|
|
95
|
+
* declared language.
|
|
96
|
+
*
|
|
97
|
+
* The shipped validator's language input is a glob list (`resolveAstGrepLangs`
|
|
98
|
+
* derives Langs from trailing extensions), so pinning it to one grammar means
|
|
99
|
+
* handing it one glob carrying one registered extension. These globs are a
|
|
100
|
+
* VALIDATOR PROBE and nothing else — they are never the record's globs, never
|
|
101
|
+
* reach the compiled rule, and never touch `sanitizeFileGlobs`.
|
|
102
|
+
*
|
|
103
|
+
* The coupling to `resolveAstGrepLangs`' derivation is pinned by a conformance
|
|
104
|
+
* test (`record-lower.test.ts`: the probe resolves to exactly one Lang, and that
|
|
105
|
+
* Lang equals `extensionToLang(extension)`), so a change to the shipped
|
|
106
|
+
* derivation fails loud here instead of silently un-pinning the record path.
|
|
107
|
+
*/
|
|
108
|
+
export function languageProbeGlobs(extension) {
|
|
109
|
+
return [`**/*${extension}`];
|
|
110
|
+
}
|
|
111
|
+
// ── The language⇄glob consistency floor ──────────────────────────────────────
|
|
112
|
+
//
|
|
113
|
+
// OPERATOR-CONSISTENT RULING (falsification round, 2026-08-21): for a
|
|
114
|
+
// `type: ast-grep` record, EVERY `target.scope.fileGlobs` entry must end in a
|
|
115
|
+
// registered extension that resolves — via `extensionToLanguage`, the same
|
|
116
|
+
// § Design 6 authority — to the DECLARED `target.language`. Otherwise the record
|
|
117
|
+
// is rejected.
|
|
118
|
+
//
|
|
119
|
+
// Grounds. § Design 6 fixes ONE declared language per record and the options
|
|
120
|
+
// table spells out the consequence: "a multi-language ast-grep rule is N
|
|
121
|
+
// records". Without this floor a record could declare `language: typescript`
|
|
122
|
+
// and scope itself to `**\/*.js`, and the runtime — which dispatches ast-grep by
|
|
123
|
+
// FILE EXTENSION, not by the rule's compiled `language` — would then evaluate it
|
|
124
|
+
// under a grammar it was never validated against. The review demonstrated both
|
|
125
|
+
// halves of that gap: a compound payload fails inertly per file (a silent
|
|
126
|
+
// non-firing rule), and a flat pattern FIRES under the wrong grammar. Neither is
|
|
127
|
+
// visible to the author. With the floor, validated-as-declared and
|
|
128
|
+
// evaluated-by-extension agree BY CONSTRUCTION, so the runtime needs no
|
|
129
|
+
// language gate of its own.
|
|
130
|
+
//
|
|
131
|
+
// Scope of the floor, precisely:
|
|
132
|
+
// - `fileGlobs` only. `excludeGlobs` entries are EXEMPT: they only ever narrow
|
|
133
|
+
// an already-consistent positive scope, so an exclusion written against a
|
|
134
|
+
// different extension can widen nothing.
|
|
135
|
+
// - `type: regex` records are UNCHECKED — a regex payload has no grammar
|
|
136
|
+
// binding at all (`target.language` is forbidden there, § Design 4), and the
|
|
137
|
+
// match is textual, so the same globs are legitimate.
|
|
138
|
+
// - An EXTENSION-LESS glob (`packages/**`) rejects under the same rule: a
|
|
139
|
+
// scope that cannot be pinned to a language cannot be validated as it will
|
|
140
|
+
// be evaluated, and silently admitting it would reopen the gap for every
|
|
141
|
+
// file the directory happens to contain.
|
|
142
|
+
/**
|
|
143
|
+
* Check the § Design 6 one-declared-language rule against a record's positive
|
|
144
|
+
* globs. Returns `null` when the scope is consistent, or the rejection reason.
|
|
145
|
+
* ast-grep targets only — the caller does not invoke it for regex.
|
|
146
|
+
*/
|
|
147
|
+
export function checkLanguageGlobConsistency(language, fileGlobs) {
|
|
148
|
+
const advice = `§ Design 6 fixes ONE declared language per record — "a multi-language ast-grep rule is N records". Split the rule per language, or correct the glob. (The runtime dispatches ast-grep by FILE EXTENSION, so a scope the declared language does not cover would be evaluated under a grammar the payload was never validated against.)`;
|
|
149
|
+
for (const glob of fileGlobs) {
|
|
150
|
+
const match = TRAILING_EXT_RE.exec(glob);
|
|
151
|
+
if (match === null) {
|
|
152
|
+
return `Prop 310 § Design 6: target.scope.fileGlobs entry '${glob}' carries no file extension, so its scope cannot be pinned to the declared language '${language}'. ${advice}`;
|
|
153
|
+
}
|
|
154
|
+
const extension = `.${match[1].toLowerCase()}`;
|
|
155
|
+
const globLanguage = extensionToLanguage(extension);
|
|
156
|
+
if (globLanguage === undefined) {
|
|
157
|
+
return `Prop 310 § Design 6: target.scope.fileGlobs entry '${glob}' targets extension '${extension}', which is not registered, so it cannot be confirmed to match the declared language '${language}'. ${advice}`;
|
|
158
|
+
}
|
|
159
|
+
if (globLanguage !== language) {
|
|
160
|
+
return `Prop 310 § Design 6: target.scope.fileGlobs entry '${glob}' targets language '${globLanguage}' but the record declares '${language}'. ${advice}`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
// ── The tree-form gate (operator ruling 2026-08-21) ──────────────────────────
|
|
166
|
+
/**
|
|
167
|
+
* NapiConfig siblings of `rule` that V1 cannot express. Named explicitly so the
|
|
168
|
+
* author is told the truth — a typed construct-gap awaiting a version bump with
|
|
169
|
+
* its own sibling home under `target:` — instead of napi's generic
|
|
170
|
+
* "unknown field" error, which would read as a typo in the rule tree.
|
|
171
|
+
*/
|
|
172
|
+
export const V1_INEXPRESSIBLE_NAPI_KEYS = ['constraints', 'utils'];
|
|
173
|
+
const RECORD_KEY_LOWERING = {
|
|
174
|
+
schemaVersion: 'consumed-at-parse',
|
|
175
|
+
severity: 'compiled',
|
|
176
|
+
message: 'compiled',
|
|
177
|
+
recoveryHint: 'compiled',
|
|
178
|
+
target: 'compiled',
|
|
179
|
+
examples: 'compiled',
|
|
180
|
+
requires: 'compiled',
|
|
181
|
+
curation: 'compiled',
|
|
182
|
+
verification_shadow: 'compiled',
|
|
183
|
+
};
|
|
184
|
+
const TARGET_KEY_LOWERING = {
|
|
185
|
+
// `type` lowers to `engine` — and is re-derived INDEPENDENTLY from the payload's
|
|
186
|
+
// compilation path for the § Design 3 engine-binding assert.
|
|
187
|
+
type: 'compiled',
|
|
188
|
+
language: 'compiled',
|
|
189
|
+
pattern: 'compiled',
|
|
190
|
+
rule: 'compiled',
|
|
191
|
+
scope: 'compiled',
|
|
192
|
+
};
|
|
193
|
+
const SCOPE_KEY_LOWERING = {
|
|
194
|
+
fileGlobs: 'compiled',
|
|
195
|
+
excludeGlobs: 'compiled',
|
|
196
|
+
};
|
|
197
|
+
function assertKeysDispositioned(value, table, at) {
|
|
198
|
+
for (const key of Object.keys(value)) {
|
|
199
|
+
// `Object.hasOwn`, not `table[key] === undefined`: a key named `constructor`
|
|
200
|
+
// or `toString` would otherwise resolve up the prototype chain and read as
|
|
201
|
+
// "dispositioned". Slice 1's prototype floor already rejects those at parse,
|
|
202
|
+
// so nothing reaching here through `parseRuleRecord` can carry one — this is
|
|
203
|
+
// defence in depth for a hand-constructed `ParsedRuleRecord`, which is
|
|
204
|
+
// exactly the caller class this whole assertion exists for.
|
|
205
|
+
if (!Object.hasOwn(table, key)) {
|
|
206
|
+
throw new Error(`[Totem Error] compileRuleRecord: record key '${at}${key}' has no defined lowering — Prop 310 § Design 12 forbids accepting a construct at parse and dropping it at compile. Give it a compiled home (and a disposition in record-lower.ts) or reject it at parse.`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** § Design 12 — the runtime half of the total-lowering proof (see above). */
|
|
211
|
+
function assertTotalLowering(record) {
|
|
212
|
+
assertKeysDispositioned(record, RECORD_KEY_LOWERING, '');
|
|
213
|
+
assertKeysDispositioned(record.target, TARGET_KEY_LOWERING, 'target.');
|
|
214
|
+
assertKeysDispositioned(record.target.scope, SCOPE_KEY_LOWERING, 'target.scope.');
|
|
215
|
+
}
|
|
216
|
+
// ── The compiled engine, re-derived from the payload ─────────────────────────
|
|
217
|
+
/**
|
|
218
|
+
* Derive the engine from the fields `engineFields` actually produced. This is
|
|
219
|
+
* the INDEPENDENT second side of the § Design 3 engine-binding assert: one side
|
|
220
|
+
* is the record's `target.type` (via `derivedEngine`), the other is the payload's
|
|
221
|
+
* actual compilation path. § Design 3 is explicit that the derivation must not
|
|
222
|
+
* make the shipped assert tautological, and it does not — a payload routed
|
|
223
|
+
* through the wrong `engineFields` branch diverges here and fails loud.
|
|
224
|
+
*/
|
|
225
|
+
function engineFromCompiledFields(fields) {
|
|
226
|
+
const hasAstGrep = (typeof fields.astGrepPattern === 'string' && fields.astGrepPattern.length > 0) ||
|
|
227
|
+
fields.astGrepYamlRule !== undefined;
|
|
228
|
+
if (hasAstGrep)
|
|
229
|
+
return 'ast-grep';
|
|
230
|
+
if (fields.pattern.length > 0)
|
|
231
|
+
return 'regex';
|
|
232
|
+
return 'unknown';
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* A stable, deterministic diagnostic label for a record-compiled rule.
|
|
236
|
+
*
|
|
237
|
+
* `CompiledRule.lessonHeading` is a required diagnostic field on a schema built
|
|
238
|
+
* for lesson-compiled rules; the record grammar has no heading construct and
|
|
239
|
+
* § Design 4's key space is closed against inventing one. Deriving the label
|
|
240
|
+
* from the identity mirrors the shipped authored-path idiom
|
|
241
|
+
* (`compile.ts: candidateHeading`) and deliberately does NOT copy `message` —
|
|
242
|
+
* two homes for the author's one sentence is Tenet 20's prohibited mirror, and
|
|
243
|
+
* a heading that drifts from the message would be worse than a generic one.
|
|
244
|
+
*/
|
|
245
|
+
function recordHeading(ruleId) {
|
|
246
|
+
return `Prop 310 rule record (${ruleId})`;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Lower a parsed Prop 310 record into a `CompiledRule`.
|
|
250
|
+
*
|
|
251
|
+
* PURE (no IO). Returns a `CompileOutcome`:
|
|
252
|
+
* - `{kind: 'compiled'}` — the record lowered totally.
|
|
253
|
+
* - `{kind: 'rejected', reason}` — an authored-content gate failed (bad regex
|
|
254
|
+
* in the target or in `requires`, an unresolvable `language`, a malformed
|
|
255
|
+
* ast-grep tree, a V1-inexpressible NapiConfig key). Loud and counted, never
|
|
256
|
+
* silent; the reason names the governing § so the author is sent to the spec.
|
|
257
|
+
*
|
|
258
|
+
* THROWS on a producer-contract violation — a missing/malformed `ruleId`, a key
|
|
259
|
+
* with no defined lowering, or an engine-binding divergence. These are bugs in
|
|
260
|
+
* the code that CALLED this function, not defects in the author's record, and
|
|
261
|
+
* they carry the incumbent's fail-loud idiom (`compile.ts: compileCandidate`)
|
|
262
|
+
* verbatim: assert up front, before any validation work, so a violation can
|
|
263
|
+
* never be masked by a coincidental `rejected` outcome.
|
|
264
|
+
*/
|
|
265
|
+
export function compileRuleRecord(parsed, opts) {
|
|
266
|
+
// ── Identity precondition, asserted UP FRONT (ADR-112 §8/§9) ──
|
|
267
|
+
if (!AUTHORED_RULE_ID_RE.test(opts.ruleId)) {
|
|
268
|
+
throw new Error(`[Totem Error] compileRuleRecord: malformed ruleId '${opts.ruleId}' — identity is minted by the ADR-112 §8 producer at the intake seam and threaded in (16 hex + optional -<n> suffix, ADR-112 §3/§8). The record grammar makes 'ruleId' INEXPRESSIBLE in-record (Prop 310 § Design 3/R17), so a malformed value here is a producer/threading bug; enthroning it would orphan the rule's controls.positive[].targetRuleId.`);
|
|
269
|
+
}
|
|
270
|
+
const record = parsed.record;
|
|
271
|
+
// ── § Design 12 — no construct is accepted at parse and dropped at compile ──
|
|
272
|
+
assertTotalLowering(record);
|
|
273
|
+
const target = record.target;
|
|
274
|
+
// ── Engine gates (§ Design 12: fail loud, never accept-then-drop) ──
|
|
275
|
+
//
|
|
276
|
+
// `requires.pattern` is gated on EVERY engine, not just regex: § Design 8 makes
|
|
277
|
+
// it "a safe-regex2-gated regex evaluated textually … independent of
|
|
278
|
+
// `target.type`", so an ast-grep rule's requirement is subject to the same
|
|
279
|
+
// ReDoS gate as a regex rule's target. Gated BEFORE the target payload so the
|
|
280
|
+
// author gets the first defect in a fixed, deterministic order.
|
|
281
|
+
if (record.requires !== undefined) {
|
|
282
|
+
const v = validateRegex(record.requires.pattern);
|
|
283
|
+
if (!v.valid) {
|
|
284
|
+
return {
|
|
285
|
+
kind: 'rejected',
|
|
286
|
+
reason: `Prop 310 § Design 8: requires.pattern is not a usable regex (${v.reason ?? 'invalid regex pattern'}) — the requirement is a safe-regex2-gated regex evaluated textually at the declared scope, independent of target.type.`,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
// RULING (falsification round, 2026-08-21): `requires.scope: line` is
|
|
290
|
+
// REJECTED on an ast-grep target. An ast-grep match is a SPAN, not a line,
|
|
291
|
+
// so "the line containing L" has no engine-defined answer: the runtime reads
|
|
292
|
+
// the span's START line, which makes the verdict depend on how the author
|
|
293
|
+
// wrapped their source — the review measured a rule firing once when its
|
|
294
|
+
// subject was split across lines and not at all when it was written on one.
|
|
295
|
+
// A formatting-dependent verdict is not a semantic. § Design 8 already
|
|
296
|
+
// reserves `block` — the span's natural unit — as unimplemented pending a
|
|
297
|
+
// language adapter's boundary definition, so the honest V1 answer is to
|
|
298
|
+
// reject the combination rather than ship a line reading that only
|
|
299
|
+
// coincidentally agrees with the author's intent. `file` scope stays valid
|
|
300
|
+
// on ast-grep (whole-file text is unambiguous), and `line` stays valid on
|
|
301
|
+
// regex targets (a regex match IS line-local by construction).
|
|
302
|
+
if (record.target.type === 'ast-grep' && record.requires.scope === 'line') {
|
|
303
|
+
return {
|
|
304
|
+
kind: 'rejected',
|
|
305
|
+
reason: "Prop 310 § Design 8: `requires.scope: line` is not available on an `ast-grep` target — an ast-grep match is a SPAN, and reading it as its start line makes the verdict depend on source formatting rather than on the rule. Use `scope: file` (unambiguous on any engine), move the requirement into the payload's own `not:`/`has:` combinators (§ Design 8: node-scoped absence stays payload-owned), or wait for the reserved `block` unit, which is the span's natural scope and is unimplemented at V1.",
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
let payloadFields;
|
|
310
|
+
let resolvedLanguage;
|
|
311
|
+
if (target.type === 'regex') {
|
|
312
|
+
// The record grammar guarantees `pattern` present and `rule`/`language` absent
|
|
313
|
+
// for `type: regex`; the non-null assertion is the schema's contract, not an
|
|
314
|
+
// assumption (`RuleTargetSchema.superRefine`).
|
|
315
|
+
const pattern = target.pattern;
|
|
316
|
+
const v = validateRegex(pattern);
|
|
317
|
+
if (!v.valid) {
|
|
318
|
+
return {
|
|
319
|
+
kind: 'rejected',
|
|
320
|
+
reason: `Prop 310 § Design 6: target.pattern is not a usable regex (${v.reason ?? 'invalid regex pattern'}).`,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
payloadFields = engineFields('regex', pattern);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
// ── ast-grep: resolve the language FIRST, then validate under exactly it ──
|
|
327
|
+
const resolution = resolveRecordLanguage(target.language);
|
|
328
|
+
if (!resolution.resolved)
|
|
329
|
+
return { kind: 'rejected', reason: resolution.reason };
|
|
330
|
+
resolvedLanguage = resolution.language;
|
|
331
|
+
// The language⇄glob consistency floor, BEFORE the payload gate: a scope that
|
|
332
|
+
// will be evaluated under a different grammar than the payload is validated
|
|
333
|
+
// under is a defect in the record, and the author should be told that rather
|
|
334
|
+
// than being handed a payload error for a payload that is fine.
|
|
335
|
+
const inconsistent = checkLanguageGlobConsistency(resolution.language, target.scope.fileGlobs);
|
|
336
|
+
if (inconsistent !== null)
|
|
337
|
+
return { kind: 'rejected', reason: inconsistent };
|
|
338
|
+
const probeGlobs = languageProbeGlobs(resolution.extension);
|
|
339
|
+
if (target.rule !== undefined) {
|
|
340
|
+
const inexpressible = V1_INEXPRESSIBLE_NAPI_KEYS.find((key) => key in target.rule);
|
|
341
|
+
if (inexpressible !== undefined) {
|
|
342
|
+
return {
|
|
343
|
+
kind: 'rejected',
|
|
344
|
+
reason: `Prop 310 § Design 4 (operator ruling 2026-08-21, tree-form): 'target.rule' is the ast-grep RULE TREE, and '${inexpressible}' is a NapiConfig SIBLING of the rule — inexpressible at V1 (zero of the 19 compound corpus rules use it). Demand is typed as a construct-gap at the § Design 15 trial and lands by grammar version bump with its own home under 'target:', never smuggled inside the tree.`,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
// The tree-form ruling's derivation: the record carries the TREE, the
|
|
348
|
+
// lowering builds the wrapper. `language` is derived from the resolved
|
|
349
|
+
// `target.language`, so the record never carries a duplicate language home.
|
|
350
|
+
const napiConfig = {
|
|
351
|
+
rule: target.rule,
|
|
352
|
+
language: extensionToLang(resolution.extension),
|
|
353
|
+
};
|
|
354
|
+
const v = validateAstGrepPattern(napiConfig, probeGlobs);
|
|
355
|
+
if (!v.valid) {
|
|
356
|
+
return {
|
|
357
|
+
kind: 'rejected',
|
|
358
|
+
reason: `Prop 310 § Design 6: target.rule failed ast-grep validation under the declared language '${resolvedLanguage}' (${v.reason ?? 'invalid ast-grep rule'}). V1 validates under exactly the declared grammar — the shipped try-each-glob-derived-Lang cross-grammar acceptance does not apply on the record path.`,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
payloadFields = engineFields('ast-grep', napiConfig);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
const pattern = target.pattern;
|
|
365
|
+
const v = validateAstGrepPattern(pattern, probeGlobs);
|
|
366
|
+
if (!v.valid) {
|
|
367
|
+
return {
|
|
368
|
+
kind: 'rejected',
|
|
369
|
+
reason: `Prop 310 § Design 6: target.pattern failed ast-grep validation under the declared language '${resolvedLanguage}' (${v.reason ?? 'invalid ast-grep pattern'}). V1 validates under exactly the declared grammar — the shipped try-each-glob-derived-Lang cross-grammar acceptance does not apply on the record path.`,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
payloadFields = engineFields('ast-grep', pattern);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
// ── § Design 3 engine binding, asserted on two INDEPENDENTLY-derived sides ──
|
|
376
|
+
const payloadEngine = engineFromCompiledFields(payloadFields);
|
|
377
|
+
if (payloadEngine !== parsed.derivedEngine) {
|
|
378
|
+
throw new Error(`[Totem Error] compileRuleRecord: record declared target.type '${parsed.derivedEngine}' but its payload compiled as '${payloadEngine}' — the two sides originate differently (the record's target.type vs the payload's actual compilation path), so this divergence is a lowering bug, not an authoring one (Prop 310 § Design 3, ADR-112 §3).`);
|
|
379
|
+
}
|
|
380
|
+
const heading = recordHeading(opts.ruleId);
|
|
381
|
+
const rule = CompiledRuleSchema.parse({
|
|
382
|
+
// ADR-112 §8/§9 id-unification: the compiled identity IS the minted ruleId.
|
|
383
|
+
lessonHash: opts.ruleId,
|
|
384
|
+
lessonHeading: heading,
|
|
385
|
+
message: record.message,
|
|
386
|
+
engine: parsed.derivedEngine,
|
|
387
|
+
...payloadFields,
|
|
388
|
+
// § Design 7 — VERBATIM. `sanitizeFileGlobs` never runs on this path: the
|
|
389
|
+
// strict dialect already validated these at parse, and expansion/promotion
|
|
390
|
+
// are the silent transforms the grammar exists to kill.
|
|
391
|
+
fileGlobs: [...record.target.scope.fileGlobs],
|
|
392
|
+
...(record.target.scope.excludeGlobs !== undefined
|
|
393
|
+
? { excludeGlobs: [...record.target.scope.excludeGlobs] }
|
|
394
|
+
: {}),
|
|
395
|
+
severity: record.severity,
|
|
396
|
+
...(record.recoveryHint !== undefined ? { recoveryHint: record.recoveryHint } : {}),
|
|
397
|
+
examples: record.examples.map((example) => ({ bad: example.bad, good: example.good })),
|
|
398
|
+
...(record.requires !== undefined
|
|
399
|
+
? { requires: { pattern: record.requires.pattern, scope: record.requires.scope } }
|
|
400
|
+
: {}),
|
|
401
|
+
...(record.curation !== undefined ? { curation: { ...record.curation } } : {}),
|
|
402
|
+
// § Design 9 / Amendment R4 — carried VERBATIM, never evaluated at V1. The
|
|
403
|
+
// record key's named snake_case exception is renamed exactly here, once.
|
|
404
|
+
...(record.verification_shadow !== undefined
|
|
405
|
+
? { verificationShadow: { ...record.verification_shadow } }
|
|
406
|
+
: {}),
|
|
407
|
+
...(resolvedLanguage !== undefined ? { language: resolvedLanguage } : {}),
|
|
408
|
+
compiledAt: opts.now,
|
|
409
|
+
createdAt: opts.now,
|
|
410
|
+
// Yellow / sensor-only, exactly as the authored path (§ Design "State-surface
|
|
411
|
+
// backing": every rule minted from this grammar enters unverified, ADR-112
|
|
412
|
+
// §1). `legitimacy`/`ruleClass` stay ABSENT — the sense→enforce crossing is
|
|
413
|
+
// priced by the Amendment's proof-required ruling, never by this lowering.
|
|
414
|
+
unverified: true,
|
|
415
|
+
});
|
|
416
|
+
return { kind: 'compiled', rule };
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=record-lower.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-lower.js","sourceRoot":"","sources":["../../src/spine/record-lower.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,iEAAiE;AACjE,gFAAgF;AAChF,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AA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