@isaacriehm/cairn-state 0.22.5
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/alignment-pending.d.ts +28 -0
- package/dist/alignment-pending.js +83 -0
- package/dist/alignment-pending.js.map +1 -0
- package/dist/anchor-map.d.ts +14 -0
- package/dist/anchor-map.js +56 -0
- package/dist/anchor-map.js.map +1 -0
- package/dist/archive.d.ts +48 -0
- package/dist/archive.js +96 -0
- package/dist/archive.js.map +1 -0
- package/dist/cache.d.ts +48 -0
- package/dist/cache.js +241 -0
- package/dist/cache.js.map +1 -0
- package/dist/component-registry.d.ts +93 -0
- package/dist/component-registry.js +0 -0
- package/dist/component-registry.js.map +1 -0
- package/dist/components.d.ts +192 -0
- package/dist/components.js +603 -0
- package/dist/components.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +26 -0
- package/dist/config.js.map +1 -0
- package/dist/drift.d.ts +8 -0
- package/dist/drift.js +23 -0
- package/dist/drift.js.map +1 -0
- package/dist/file-candidates-map.d.ts +23 -0
- package/dist/file-candidates-map.js +76 -0
- package/dist/file-candidates-map.js.map +1 -0
- package/dist/frontmatter.d.ts +32 -0
- package/dist/frontmatter.js +77 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/fs.d.ts +36 -0
- package/dist/fs.js +47 -0
- package/dist/fs.js.map +1 -0
- package/dist/glob.d.ts +10 -0
- package/dist/glob.js +46 -0
- package/dist/glob.js.map +1 -0
- package/dist/home.d.ts +69 -0
- package/dist/home.js +168 -0
- package/dist/home.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/languages.d.ts +113 -0
- package/dist/languages.js +512 -0
- package/dist/languages.js.map +1 -0
- package/dist/ledgers.d.ts +14 -0
- package/dist/ledgers.js +105 -0
- package/dist/ledgers.js.map +1 -0
- package/dist/logger.d.ts +13 -0
- package/dist/logger.js +17 -0
- package/dist/logger.js.map +1 -0
- package/dist/manifest.d.ts +10 -0
- package/dist/manifest.js +84 -0
- package/dist/manifest.js.map +1 -0
- package/dist/missions.d.ts +119 -0
- package/dist/missions.js +414 -0
- package/dist/missions.js.map +1 -0
- package/dist/paths.d.ts +117 -0
- package/dist/paths.js +241 -0
- package/dist/paths.js.map +1 -0
- package/dist/quality-grades.d.ts +11 -0
- package/dist/quality-grades.js +100 -0
- package/dist/quality-grades.js.map +1 -0
- package/dist/rejected.d.ts +42 -0
- package/dist/rejected.js +100 -0
- package/dist/rejected.js.map +1 -0
- package/dist/schemas.d.ts +789 -0
- package/dist/schemas.js +506 -0
- package/dist/schemas.js.map +1 -0
- package/dist/scope-index.d.ts +96 -0
- package/dist/scope-index.js +299 -0
- package/dist/scope-index.js.map +1 -0
- package/dist/slug.d.ts +81 -0
- package/dist/slug.js +138 -0
- package/dist/slug.js.map +1 -0
- package/dist/sot-bindings.d.ts +14 -0
- package/dist/sot-bindings.js +79 -0
- package/dist/sot-bindings.js.map +1 -0
- package/dist/sot-cache.d.ts +18 -0
- package/dist/sot-cache.js +62 -0
- package/dist/sot-cache.js.map +1 -0
- package/dist/text.d.ts +27 -0
- package/dist/text.js +63 -0
- package/dist/text.js.map +1 -0
- package/dist/topic-index.d.ts +27 -0
- package/dist/topic-index.js +82 -0
- package/dist/topic-index.js.map +1 -0
- package/dist/walk.d.ts +7 -0
- package/dist/walk.js +34 -0
- package/dist/walk.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language profile table — the single source of truth for every per-language
|
|
3
|
+
* mechanical fact Cairn needs: which extensions belong to a language, what
|
|
4
|
+
* comment forms a `@cairn` registry header may live in, how to pull the
|
|
5
|
+
* top-level exported/public symbols out of a source file, whether a file
|
|
6
|
+
* "looks like a reusable UI unit", and which style/class attributes its
|
|
7
|
+
* markup uses.
|
|
8
|
+
*
|
|
9
|
+
* Why a data table and not branching code: Cairn runs INSIDE an LLM coding
|
|
10
|
+
* agent, so semantic classification ("is this a component?", "what category?")
|
|
11
|
+
* is the model's job (see `detect-components.ts`). The *mechanical* facts —
|
|
12
|
+
* comment syntax, extension→language, export grammar — are pure lookup data
|
|
13
|
+
* that should be easy to extend by adding a row, never a crash or a silent
|
|
14
|
+
* JS/React default when a language is missing.
|
|
15
|
+
*
|
|
16
|
+
* This table is consumed by:
|
|
17
|
+
* - the component store (collection + audit) — export extraction, header
|
|
18
|
+
* comment-form parsing, unit-shape + style-attr detection;
|
|
19
|
+
* - the source-comment SoT walker — extension→`CommentLang` bucket;
|
|
20
|
+
* - the Layer-A stub-pattern sensor — extension→sensor language tag.
|
|
21
|
+
*
|
|
22
|
+
* A miss (extension not in the table) means "unknown": the file is skipped by
|
|
23
|
+
* language-scoped features, never coerced into TypeScript.
|
|
24
|
+
*/
|
|
25
|
+
import { extname } from "node:path";
|
|
26
|
+
import { isPascalCase, stemOf } from "./text.js";
|
|
27
|
+
function collector() {
|
|
28
|
+
const names = [];
|
|
29
|
+
const push = (n) => {
|
|
30
|
+
if (n && !names.includes(n))
|
|
31
|
+
names.push(n);
|
|
32
|
+
};
|
|
33
|
+
return { names, push };
|
|
34
|
+
}
|
|
35
|
+
/** `export (default)? function/class/const/let/var` + `export { … }` lists. */
|
|
36
|
+
function jsExportSymbols(source) {
|
|
37
|
+
const { names, push } = collector();
|
|
38
|
+
for (const m of source.matchAll(/export\s+default\s+(?:async\s+)?(?:function|class)\s+([A-Za-z0-9_$]+)/g)) {
|
|
39
|
+
push(m[1]);
|
|
40
|
+
}
|
|
41
|
+
for (const m of source.matchAll(/export\s+(?:async\s+)?(?:function|class|const|let|var)\s+([A-Za-z0-9_$]+)/g)) {
|
|
42
|
+
push(m[1]);
|
|
43
|
+
}
|
|
44
|
+
for (const m of source.matchAll(/export\s+default\s+([A-Za-z0-9_$]+)\s*;/g)) {
|
|
45
|
+
push(m[1]);
|
|
46
|
+
}
|
|
47
|
+
for (const block of source.matchAll(/export\s*\{([^}]*)\}/g)) {
|
|
48
|
+
for (const spec of (block[1] ?? "").split(",")) {
|
|
49
|
+
const parts = spec.trim().split(/\s+as\s+/);
|
|
50
|
+
push((parts[parts.length - 1] ?? "").trim() || undefined);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return names;
|
|
54
|
+
}
|
|
55
|
+
/** Python: top-level `def` / `class` (no leading indentation = module scope). */
|
|
56
|
+
function pyExportSymbols(source) {
|
|
57
|
+
const { names, push } = collector();
|
|
58
|
+
for (const m of source.matchAll(/^(?:async[ \t]+)?def[ \t]+([A-Za-z_]\w*)/gm))
|
|
59
|
+
push(m[1]);
|
|
60
|
+
for (const m of source.matchAll(/^class[ \t]+([A-Za-z_]\w*)/gm))
|
|
61
|
+
push(m[1]);
|
|
62
|
+
return names;
|
|
63
|
+
}
|
|
64
|
+
/** Go: exported = capitalized. Funcs (incl. receivers), types, vars, consts. */
|
|
65
|
+
function goExportSymbols(source) {
|
|
66
|
+
const { names, push } = collector();
|
|
67
|
+
const pushCap = (n) => {
|
|
68
|
+
if (n && /^[A-Z]/.test(n))
|
|
69
|
+
push(n);
|
|
70
|
+
};
|
|
71
|
+
for (const m of source.matchAll(/^func[ \t]+([A-Za-z_]\w*)/gm))
|
|
72
|
+
pushCap(m[1]);
|
|
73
|
+
for (const m of source.matchAll(/^func[ \t]*\([^)]*\)[ \t]*([A-Za-z_]\w*)/gm))
|
|
74
|
+
pushCap(m[1]);
|
|
75
|
+
for (const m of source.matchAll(/^type[ \t]+([A-Za-z_]\w*)/gm))
|
|
76
|
+
pushCap(m[1]);
|
|
77
|
+
for (const m of source.matchAll(/^(?:var|const)[ \t]+([A-Za-z_]\w*)/gm))
|
|
78
|
+
pushCap(m[1]);
|
|
79
|
+
return names;
|
|
80
|
+
}
|
|
81
|
+
/** Rust: `pub` (incl. `pub(crate)`) fn/struct/enum/trait/const/static/mod/type. */
|
|
82
|
+
function rustExportSymbols(source) {
|
|
83
|
+
const { names, push } = collector();
|
|
84
|
+
for (const m of source.matchAll(/^[ \t]*pub(?:\([^)]*\))?[ \t]+(?:async[ \t]+)?(?:unsafe[ \t]+)?(?:fn|struct|enum|trait|const|static|mod|type)[ \t]+([A-Za-z_]\w*)/gm)) {
|
|
85
|
+
push(m[1]);
|
|
86
|
+
}
|
|
87
|
+
return names;
|
|
88
|
+
}
|
|
89
|
+
/** Java: public class/interface/enum/record (the registry-relevant types). */
|
|
90
|
+
function javaExportSymbols(source) {
|
|
91
|
+
const { names, push } = collector();
|
|
92
|
+
for (const m of source.matchAll(/\bpublic[ \t]+(?:final[ \t]+|abstract[ \t]+|sealed[ \t]+|static[ \t]+)*(?:class|interface|enum|record)[ \t]+([A-Za-z_]\w*)/g)) {
|
|
93
|
+
push(m[1]);
|
|
94
|
+
}
|
|
95
|
+
return names;
|
|
96
|
+
}
|
|
97
|
+
/** Kotlin: top-level decls (public is the default visibility) + @Composable. */
|
|
98
|
+
function kotlinExportSymbols(source) {
|
|
99
|
+
const { names, push } = collector();
|
|
100
|
+
for (const m of source.matchAll(/^[ \t]*(?:public[ \t]+|internal[ \t]+)?(?:open[ \t]+|abstract[ \t]+|sealed[ \t]+|data[ \t]+)*(?:class|interface|object|fun|val|var)[ \t]+([A-Za-z_]\w*)/gm)) {
|
|
101
|
+
push(m[1]);
|
|
102
|
+
}
|
|
103
|
+
return names;
|
|
104
|
+
}
|
|
105
|
+
/** C#: public class/interface/record/struct/enum. */
|
|
106
|
+
function csharpExportSymbols(source) {
|
|
107
|
+
const { names, push } = collector();
|
|
108
|
+
for (const m of source.matchAll(/\bpublic[ \t]+(?:partial[ \t]+|sealed[ \t]+|abstract[ \t]+|static[ \t]+)*(?:class|interface|record|struct|enum)[ \t]+([A-Za-z_]\w*)/g)) {
|
|
109
|
+
push(m[1]);
|
|
110
|
+
}
|
|
111
|
+
return names;
|
|
112
|
+
}
|
|
113
|
+
/** Swift: top-level func/class/struct/enum/protocol/actor declarations. */
|
|
114
|
+
function swiftExportSymbols(source) {
|
|
115
|
+
const { names, push } = collector();
|
|
116
|
+
for (const m of source.matchAll(/\b(?:public[ \t]+|open[ \t]+|internal[ \t]+)?(?:final[ \t]+)?(?:func|class|struct|enum|protocol|actor)[ \t]+([A-Za-z_]\w*)/g)) {
|
|
117
|
+
push(m[1]);
|
|
118
|
+
}
|
|
119
|
+
return names;
|
|
120
|
+
}
|
|
121
|
+
/** Dart: class/mixin/enum (Flutter widgets are classes). */
|
|
122
|
+
function dartExportSymbols(source) {
|
|
123
|
+
const { names, push } = collector();
|
|
124
|
+
for (const m of source.matchAll(/^[ \t]*(?:abstract[ \t]+)?(?:class|mixin|enum)[ \t]+([A-Za-z_]\w*)/gm)) {
|
|
125
|
+
push(m[1]);
|
|
126
|
+
}
|
|
127
|
+
return names;
|
|
128
|
+
}
|
|
129
|
+
/** Ruby: class/module/def. */
|
|
130
|
+
function rubyExportSymbols(source) {
|
|
131
|
+
const { names, push } = collector();
|
|
132
|
+
for (const m of source.matchAll(/^[ \t]*(?:class|module|def)[ \t]+([A-Za-z_]\w*)/gm))
|
|
133
|
+
push(m[1]);
|
|
134
|
+
return names;
|
|
135
|
+
}
|
|
136
|
+
/** PHP: class/interface/trait/function. */
|
|
137
|
+
function phpExportSymbols(source) {
|
|
138
|
+
const { names, push } = collector();
|
|
139
|
+
for (const m of source.matchAll(/\b(?:class|interface|trait|function)[ \t]+([A-Za-z_]\w*)/g)) {
|
|
140
|
+
push(m[1]);
|
|
141
|
+
}
|
|
142
|
+
return names;
|
|
143
|
+
}
|
|
144
|
+
/** Single-file-unit languages (Vue/Svelte/Astro/Razor): the export IS the file. */
|
|
145
|
+
function sfcExportSymbols(_source, basename) {
|
|
146
|
+
const stem = stemOf(basename);
|
|
147
|
+
return stem.length > 0 ? [stem] : [];
|
|
148
|
+
}
|
|
149
|
+
/** Languages with no meaningful export grammar yet → empty. */
|
|
150
|
+
function noExports() {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
/* -------------------------------------------------------------------------- */
|
|
154
|
+
/* Unit-shape + style-attr detectors */
|
|
155
|
+
/* -------------------------------------------------------------------------- */
|
|
156
|
+
/** JSX markup signal — a tag or a className attribute. */
|
|
157
|
+
const JSX_RE = /<[A-Za-z][^>]*\/?>|className\s*=/;
|
|
158
|
+
const CLASS_ATTR_JSX = /className\s*=\s*(?:"([^"]+)"|'([^']+)'|\{`([^`]+)`\})/g;
|
|
159
|
+
const CLASS_ATTR_HTML = /(?:^|\s)class\s*=\s*(?:"([^"]+)"|'([^']+)')/g;
|
|
160
|
+
const CLASS_BIND_VUE = /(?::class|\[class\]|class:)\s*=?\s*(?:"([^"]+)"|'([^']+)')/g;
|
|
161
|
+
const SWIFTUI_VIEW_RE = /\bstruct[ \t]+\w+[ \t]*:[ \t]*[^{]*\bView\b/;
|
|
162
|
+
const FLUTTER_WIDGET_RE = /\bclass[ \t]+\w+[ \t]+extends[ \t]+(?:StatelessWidget|StatefulWidget|\w*Widget)\b/;
|
|
163
|
+
const COMPOSE_RE = /@Composable\b[\s\S]{0,80}?\bfun[ \t]+[A-Z]\w*/;
|
|
164
|
+
/** React/JSX: PascalCase basename + a PascalCase export + JSX markup. */
|
|
165
|
+
function jsxUnitShaped(source, basename) {
|
|
166
|
+
if (!isPascalCase(stemOf(basename)))
|
|
167
|
+
return false;
|
|
168
|
+
if (!jsExportSymbols(source).some(isPascalCase))
|
|
169
|
+
return false;
|
|
170
|
+
return JSX_RE.test(source);
|
|
171
|
+
}
|
|
172
|
+
/* -------------------------------------------------------------------------- */
|
|
173
|
+
/* The profile table */
|
|
174
|
+
/* -------------------------------------------------------------------------- */
|
|
175
|
+
const CSTYLE_FORMS = ["block", "line"];
|
|
176
|
+
export const LANGUAGE_PROFILES = [
|
|
177
|
+
// ── JS/TS family ──────────────────────────────────────────────────────
|
|
178
|
+
{
|
|
179
|
+
id: "typescript",
|
|
180
|
+
extensions: [".ts", ".tsx", ".cts", ".mts"],
|
|
181
|
+
commentLang: "js",
|
|
182
|
+
commentForms: CSTYLE_FORMS,
|
|
183
|
+
exportSymbols: jsExportSymbols,
|
|
184
|
+
isUnitShaped: jsxUnitShaped,
|
|
185
|
+
styleAttrs: [CLASS_ATTR_JSX],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: "javascript",
|
|
189
|
+
extensions: [".js", ".jsx", ".cjs", ".mjs"],
|
|
190
|
+
commentLang: "js",
|
|
191
|
+
commentForms: CSTYLE_FORMS,
|
|
192
|
+
exportSymbols: jsExportSymbols,
|
|
193
|
+
isUnitShaped: jsxUnitShaped,
|
|
194
|
+
styleAttrs: [CLASS_ATTR_JSX],
|
|
195
|
+
},
|
|
196
|
+
// ── Single-file-component frameworks ──────────────────────────────────
|
|
197
|
+
{
|
|
198
|
+
id: "vue",
|
|
199
|
+
extensions: [".vue"],
|
|
200
|
+
commentLang: "js",
|
|
201
|
+
commentForms: ["html", "block", "line"],
|
|
202
|
+
exportSymbols: sfcExportSymbols,
|
|
203
|
+
isUnitShaped: () => true,
|
|
204
|
+
styleAttrs: [CLASS_ATTR_HTML, CLASS_BIND_VUE],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: "svelte",
|
|
208
|
+
extensions: [".svelte"],
|
|
209
|
+
commentLang: "js",
|
|
210
|
+
commentForms: ["html", "block", "line"],
|
|
211
|
+
exportSymbols: sfcExportSymbols,
|
|
212
|
+
isUnitShaped: () => true,
|
|
213
|
+
styleAttrs: [CLASS_ATTR_HTML, CLASS_BIND_VUE],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "astro",
|
|
217
|
+
extensions: [".astro"],
|
|
218
|
+
commentLang: "js",
|
|
219
|
+
commentForms: ["html", "block", "line"],
|
|
220
|
+
exportSymbols: sfcExportSymbols,
|
|
221
|
+
isUnitShaped: () => true,
|
|
222
|
+
styleAttrs: [CLASS_ATTR_HTML, CLASS_ATTR_JSX],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "razor",
|
|
226
|
+
extensions: [".razor", ".cshtml"],
|
|
227
|
+
commentLang: "cs",
|
|
228
|
+
commentForms: ["html", "block", "line"],
|
|
229
|
+
exportSymbols: sfcExportSymbols,
|
|
230
|
+
isUnitShaped: () => true,
|
|
231
|
+
styleAttrs: [CLASS_ATTR_HTML],
|
|
232
|
+
},
|
|
233
|
+
// ── Native UI ─────────────────────────────────────────────────────────
|
|
234
|
+
{
|
|
235
|
+
id: "swift",
|
|
236
|
+
extensions: [".swift"],
|
|
237
|
+
commentLang: "swift",
|
|
238
|
+
commentForms: CSTYLE_FORMS,
|
|
239
|
+
exportSymbols: swiftExportSymbols,
|
|
240
|
+
isUnitShaped: (source) => SWIFTUI_VIEW_RE.test(source),
|
|
241
|
+
styleAttrs: [],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: "dart",
|
|
245
|
+
extensions: [".dart"],
|
|
246
|
+
commentLang: "dart",
|
|
247
|
+
commentForms: CSTYLE_FORMS,
|
|
248
|
+
exportSymbols: dartExportSymbols,
|
|
249
|
+
isUnitShaped: (source) => FLUTTER_WIDGET_RE.test(source),
|
|
250
|
+
styleAttrs: [],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: "kotlin",
|
|
254
|
+
extensions: [".kt", ".kts"],
|
|
255
|
+
commentLang: "kt",
|
|
256
|
+
commentForms: CSTYLE_FORMS,
|
|
257
|
+
exportSymbols: kotlinExportSymbols,
|
|
258
|
+
isUnitShaped: (source) => COMPOSE_RE.test(source),
|
|
259
|
+
styleAttrs: [],
|
|
260
|
+
},
|
|
261
|
+
// ── Backend / general ─────────────────────────────────────────────────
|
|
262
|
+
{
|
|
263
|
+
id: "python",
|
|
264
|
+
extensions: [".py", ".pyi"],
|
|
265
|
+
commentLang: "py",
|
|
266
|
+
commentForms: ["hash", "docstring"],
|
|
267
|
+
exportSymbols: pyExportSymbols,
|
|
268
|
+
isUnitShaped: () => false,
|
|
269
|
+
styleAttrs: [],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: "go",
|
|
273
|
+
extensions: [".go"],
|
|
274
|
+
commentLang: "go",
|
|
275
|
+
commentForms: CSTYLE_FORMS,
|
|
276
|
+
exportSymbols: goExportSymbols,
|
|
277
|
+
isUnitShaped: () => false,
|
|
278
|
+
styleAttrs: [],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: "rust",
|
|
282
|
+
extensions: [".rs"],
|
|
283
|
+
commentLang: "rs",
|
|
284
|
+
commentForms: CSTYLE_FORMS,
|
|
285
|
+
exportSymbols: rustExportSymbols,
|
|
286
|
+
isUnitShaped: () => false,
|
|
287
|
+
styleAttrs: [],
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
id: "java",
|
|
291
|
+
extensions: [".java"],
|
|
292
|
+
commentLang: "java",
|
|
293
|
+
commentForms: CSTYLE_FORMS,
|
|
294
|
+
exportSymbols: javaExportSymbols,
|
|
295
|
+
isUnitShaped: () => false,
|
|
296
|
+
styleAttrs: [],
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "csharp",
|
|
300
|
+
extensions: [".cs"],
|
|
301
|
+
commentLang: "cs",
|
|
302
|
+
commentForms: CSTYLE_FORMS,
|
|
303
|
+
exportSymbols: csharpExportSymbols,
|
|
304
|
+
isUnitShaped: () => false,
|
|
305
|
+
styleAttrs: [],
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: "ruby",
|
|
309
|
+
extensions: [".rb"],
|
|
310
|
+
commentLang: "rb",
|
|
311
|
+
commentForms: ["hash", "block"],
|
|
312
|
+
exportSymbols: rubyExportSymbols,
|
|
313
|
+
isUnitShaped: () => false,
|
|
314
|
+
styleAttrs: [],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "php",
|
|
318
|
+
extensions: [".php"],
|
|
319
|
+
commentLang: "php",
|
|
320
|
+
commentForms: ["block", "line", "hash"],
|
|
321
|
+
exportSymbols: phpExportSymbols,
|
|
322
|
+
isUnitShaped: () => false,
|
|
323
|
+
styleAttrs: [CLASS_ATTR_HTML],
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: "elixir",
|
|
327
|
+
extensions: [".ex", ".exs"],
|
|
328
|
+
commentLang: "unknown",
|
|
329
|
+
commentForms: ["hash"],
|
|
330
|
+
exportSymbols: noExports,
|
|
331
|
+
isUnitShaped: () => false,
|
|
332
|
+
styleAttrs: [],
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "scala",
|
|
336
|
+
extensions: [".scala", ".sc"],
|
|
337
|
+
commentLang: "scala",
|
|
338
|
+
commentForms: CSTYLE_FORMS,
|
|
339
|
+
exportSymbols: noExports,
|
|
340
|
+
isUnitShaped: () => false,
|
|
341
|
+
styleAttrs: [],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "c",
|
|
345
|
+
extensions: [".c", ".cc", ".cpp", ".cxx", ".h", ".hpp"],
|
|
346
|
+
commentLang: "c",
|
|
347
|
+
commentForms: CSTYLE_FORMS,
|
|
348
|
+
exportSymbols: noExports,
|
|
349
|
+
isUnitShaped: () => false,
|
|
350
|
+
styleAttrs: [],
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
id: "shell",
|
|
354
|
+
extensions: [".sh", ".bash", ".zsh"],
|
|
355
|
+
commentLang: "sh",
|
|
356
|
+
commentForms: ["hash"],
|
|
357
|
+
exportSymbols: noExports,
|
|
358
|
+
isUnitShaped: () => false,
|
|
359
|
+
styleAttrs: [],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
id: "lua",
|
|
363
|
+
extensions: [".lua"],
|
|
364
|
+
commentLang: "lua",
|
|
365
|
+
commentForms: ["dash"],
|
|
366
|
+
exportSymbols: noExports,
|
|
367
|
+
isUnitShaped: () => false,
|
|
368
|
+
styleAttrs: [],
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
id: "sql",
|
|
372
|
+
extensions: [".sql"],
|
|
373
|
+
commentLang: "unknown",
|
|
374
|
+
commentForms: ["dash", "block"],
|
|
375
|
+
exportSymbols: noExports,
|
|
376
|
+
isUnitShaped: () => false,
|
|
377
|
+
styleAttrs: [],
|
|
378
|
+
},
|
|
379
|
+
];
|
|
380
|
+
/**
|
|
381
|
+
* Type-declaring keywords per language id — what introduces a named type that
|
|
382
|
+
* could collide with a unit name. Drives the audit's name-collision scan so
|
|
383
|
+
* it isn't TS-only (`interface`/`type`). Languages with no nominal types map
|
|
384
|
+
* to `[]` (the scan is skipped for them).
|
|
385
|
+
*/
|
|
386
|
+
const TYPE_DECL_KEYWORDS = {
|
|
387
|
+
typescript: ["interface", "type", "class", "enum"],
|
|
388
|
+
javascript: ["class"],
|
|
389
|
+
vue: ["interface", "type", "class", "enum"],
|
|
390
|
+
svelte: ["interface", "type", "class", "enum"],
|
|
391
|
+
astro: ["interface", "type", "class", "enum"],
|
|
392
|
+
razor: ["class", "interface", "record", "struct", "enum"],
|
|
393
|
+
swift: ["struct", "class", "protocol", "enum", "actor", "typealias"],
|
|
394
|
+
dart: ["class", "mixin", "enum", "typedef"],
|
|
395
|
+
kotlin: ["class", "interface", "object", "typealias"],
|
|
396
|
+
python: ["class"],
|
|
397
|
+
go: ["type"],
|
|
398
|
+
rust: ["struct", "enum", "trait", "type"],
|
|
399
|
+
java: ["class", "interface", "enum", "record"],
|
|
400
|
+
csharp: ["class", "interface", "record", "struct", "enum"],
|
|
401
|
+
ruby: ["class", "module"],
|
|
402
|
+
php: ["class", "interface", "trait"],
|
|
403
|
+
scala: ["class", "trait", "object"],
|
|
404
|
+
c: ["struct", "enum", "union", "typedef"],
|
|
405
|
+
elixir: ["defmodule", "defprotocol", "defstruct"],
|
|
406
|
+
};
|
|
407
|
+
/* -------------------------------------------------------------------------- */
|
|
408
|
+
/* Lookup index + public accessors */
|
|
409
|
+
/* -------------------------------------------------------------------------- */
|
|
410
|
+
const BY_EXT = new Map();
|
|
411
|
+
for (const p of LANGUAGE_PROFILES) {
|
|
412
|
+
for (const ext of p.extensions)
|
|
413
|
+
BY_EXT.set(ext, p);
|
|
414
|
+
}
|
|
415
|
+
const BY_ID = new Map();
|
|
416
|
+
for (const p of LANGUAGE_PROFILES)
|
|
417
|
+
BY_ID.set(p.id, p);
|
|
418
|
+
/** Profile for a bare extension (`.tsx`), case-insensitive. Null when unknown. */
|
|
419
|
+
export function profileForExtension(ext) {
|
|
420
|
+
return BY_EXT.get(ext.toLowerCase()) ?? null;
|
|
421
|
+
}
|
|
422
|
+
/** Profile for a file path. Null when the extension isn't in the table. */
|
|
423
|
+
export function profileForFile(path) {
|
|
424
|
+
return profileForExtension(extname(path));
|
|
425
|
+
}
|
|
426
|
+
/** Profile by canonical language id (`"vue"`). Null when unknown. */
|
|
427
|
+
export function profileForId(id) {
|
|
428
|
+
return BY_ID.get(id) ?? null;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Type-declaration keywords for a file's language (`struct`/`class`/`type`/…),
|
|
432
|
+
* or `[]` when the language has no nominal types or the extension is unknown.
|
|
433
|
+
* Single source for the audit's name-collision scan.
|
|
434
|
+
*/
|
|
435
|
+
export function typeDeclKeywordsForFile(path) {
|
|
436
|
+
const p = profileForFile(path);
|
|
437
|
+
return p ? (TYPE_DECL_KEYWORDS[p.id] ?? []) : [];
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Extensions where reusable UI units live, across web + native frameworks.
|
|
441
|
+
* Used as the component-store default when a config omits `extensions`, so an
|
|
442
|
+
* absent signal scans every UI file type rather than silently assuming React
|
|
443
|
+
* `.tsx`/`.jsx`. (Excludes `.ts`/`.js` — those hold logic, not components.)
|
|
444
|
+
*/
|
|
445
|
+
export const UI_EXTENSIONS = [
|
|
446
|
+
".tsx",
|
|
447
|
+
".jsx",
|
|
448
|
+
".vue",
|
|
449
|
+
".svelte",
|
|
450
|
+
".astro",
|
|
451
|
+
".razor",
|
|
452
|
+
".cshtml",
|
|
453
|
+
".swift",
|
|
454
|
+
".dart",
|
|
455
|
+
".kt",
|
|
456
|
+
".kts",
|
|
457
|
+
];
|
|
458
|
+
/**
|
|
459
|
+
* Whether `s` names a known language — a profile id. The open sensor-language
|
|
460
|
+
* registry: the stub-pattern catalog validates yaml `languages:` tags against
|
|
461
|
+
* this (plus its own `"all"`), so a typo is still rejected but any table
|
|
462
|
+
* language is accepted.
|
|
463
|
+
*/
|
|
464
|
+
export function isSensorLang(s) {
|
|
465
|
+
return typeof s === "string" && BY_ID.has(s);
|
|
466
|
+
}
|
|
467
|
+
/** Every extension the table knows about. */
|
|
468
|
+
export function knownExtensions() {
|
|
469
|
+
return [...BY_EXT.keys()];
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* The source-comment `CommentLang` bucket for a file, or `"unknown"` when the
|
|
473
|
+
* extension isn't in the table. Single source for the source-comment walker.
|
|
474
|
+
*/
|
|
475
|
+
export function commentLangForFile(path) {
|
|
476
|
+
return profileForFile(path)?.commentLang ?? "unknown";
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* The sensor language tag for a file — the profile `id`, or `undefined` when
|
|
480
|
+
* the extension isn't in the table. Single source for the Layer-A
|
|
481
|
+
* stub-pattern catalog (a tag with no patterns simply matches nothing).
|
|
482
|
+
*/
|
|
483
|
+
export function sensorLangForFile(path) {
|
|
484
|
+
return profileForFile(path)?.id;
|
|
485
|
+
}
|
|
486
|
+
/* -------------------------------------------------------------------------- */
|
|
487
|
+
/* Export extraction — profile-routed, language-agnostic */
|
|
488
|
+
/* -------------------------------------------------------------------------- */
|
|
489
|
+
/**
|
|
490
|
+
* Every top-level exported / public name in a source file, using the
|
|
491
|
+
* language profile for `basename`'s extension. Order-preserving, de-duplicated.
|
|
492
|
+
* Unknown extension → empty (caller treats as "no detectable exports").
|
|
493
|
+
*/
|
|
494
|
+
export function extractExportNames(source, basename) {
|
|
495
|
+
const profile = profileForFile(basename);
|
|
496
|
+
if (profile === null)
|
|
497
|
+
return [];
|
|
498
|
+
return profile.exportSymbols(source, basename);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Best-effort single exported name — the likely `@cairn` value, used as the
|
|
502
|
+
* annotator's hint and for display. Prefers a PascalCase declaration (the
|
|
503
|
+
* unit convention) over hooks / SCREAMING_CASE constants. Null when nothing
|
|
504
|
+
* is exported.
|
|
505
|
+
*/
|
|
506
|
+
export function extractExportName(source, basename) {
|
|
507
|
+
const names = extractExportNames(source, basename);
|
|
508
|
+
if (names.length === 0)
|
|
509
|
+
return null;
|
|
510
|
+
return names.find(isPascalCase) ?? names[0];
|
|
511
|
+
}
|
|
512
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAkDjD,SAAS,SAAS;IAChB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAW,CAAC,CAAC,EAAE,EAAE;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC;AAED,+EAA+E;AAC/E,SAAS,eAAe,CAAC,MAAc;IACrC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAC7B,wEAAwE,CACzE,EAAE,CAAC;QACF,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;IACD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AAED,6CAA6C;AAC7C,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,IAAI,SAAS,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAClC,CAAC;AAED,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAgB;IACjE,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,QAAgB;IAChE,MAAM,KAAK,GAAG,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,CAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DecisionLedgerEntry, type InvariantLedgerEntry } from "./schemas.js";
|
|
2
|
+
export interface LedgerOptions {
|
|
3
|
+
repoRoot: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function buildDecisionsLedger(opts: LedgerOptions): DecisionLedgerEntry[];
|
|
6
|
+
export declare function writeDecisionsLedger(opts: LedgerOptions): {
|
|
7
|
+
entries: DecisionLedgerEntry[];
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function buildInvariantsLedger(opts: LedgerOptions): InvariantLedgerEntry[];
|
|
11
|
+
export declare function writeInvariantsLedger(opts: LedgerOptions): {
|
|
12
|
+
entries: InvariantLedgerEntry[];
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
package/dist/ledgers.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
4
|
+
import { getLogger } from "./logger.js";
|
|
5
|
+
import { parseFrontmatter } from "./frontmatter.js";
|
|
6
|
+
import { decisionsDir, decisionsLedgerPath, invariantsDir, invariantsLedgerPath, } from "./paths.js";
|
|
7
|
+
import { DecisionFrontmatter, InvariantFrontmatter, } from "./schemas.js";
|
|
8
|
+
const log = getLogger();
|
|
9
|
+
export function buildDecisionsLedger(opts) {
|
|
10
|
+
const dir = decisionsDir(opts.repoRoot);
|
|
11
|
+
if (!existsSync(dir))
|
|
12
|
+
return [];
|
|
13
|
+
const entries = [];
|
|
14
|
+
for (const file of listMarkdown(dir)) {
|
|
15
|
+
const abs = join(dir, file);
|
|
16
|
+
const fm = parseFrontmatter(readFileSync(abs, "utf8")).frontmatter;
|
|
17
|
+
const parsed = DecisionFrontmatter.safeParse(fm);
|
|
18
|
+
if (!parsed.success) {
|
|
19
|
+
log.warn({ path: abs, error: parsed.error.message }, "decision frontmatter invalid; skipping");
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (parsed.data.status !== "accepted")
|
|
23
|
+
continue;
|
|
24
|
+
if (parsed.data.superseded_by)
|
|
25
|
+
continue;
|
|
26
|
+
entries.push({
|
|
27
|
+
id: parsed.data.id,
|
|
28
|
+
title: parsed.data.title,
|
|
29
|
+
status: parsed.data.status,
|
|
30
|
+
...(parsed.data.scope_globs !== undefined ? { scope_globs: parsed.data.scope_globs } : {}),
|
|
31
|
+
...(parsed.data.supersedes !== undefined ? { supersedes: parsed.data.supersedes } : {}),
|
|
32
|
+
...(parsed.data.superseded_by !== undefined
|
|
33
|
+
? { superseded_by: parsed.data.superseded_by }
|
|
34
|
+
: {}),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
entries.sort((a, b) => a.id.localeCompare(b.id));
|
|
38
|
+
return entries;
|
|
39
|
+
}
|
|
40
|
+
export function writeDecisionsLedger(opts) {
|
|
41
|
+
const entries = buildDecisionsLedger(opts);
|
|
42
|
+
const path = decisionsLedgerPath(opts.repoRoot);
|
|
43
|
+
mkdirSync(decisionsDir(opts.repoRoot), { recursive: true });
|
|
44
|
+
atomicWrite(path, stringifyYaml(entries));
|
|
45
|
+
log.debug({ path, count: entries.length }, "wrote decisions ledger");
|
|
46
|
+
return { entries, path };
|
|
47
|
+
}
|
|
48
|
+
export function buildInvariantsLedger(opts) {
|
|
49
|
+
const dir = invariantsDir(opts.repoRoot);
|
|
50
|
+
if (!existsSync(dir))
|
|
51
|
+
return [];
|
|
52
|
+
const entries = [];
|
|
53
|
+
for (const file of listMarkdown(dir)) {
|
|
54
|
+
const abs = join(dir, file);
|
|
55
|
+
const fm = parseFrontmatter(readFileSync(abs, "utf8")).frontmatter;
|
|
56
|
+
const parsed = InvariantFrontmatter.safeParse(fm);
|
|
57
|
+
if (!parsed.success) {
|
|
58
|
+
log.warn({ path: abs, error: parsed.error.message }, "invariant frontmatter invalid; skipping");
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const status = parsed.data.status ?? "active";
|
|
62
|
+
if (status !== "active")
|
|
63
|
+
continue;
|
|
64
|
+
entries.push({
|
|
65
|
+
id: parsed.data.id,
|
|
66
|
+
title: parsed.data.title,
|
|
67
|
+
status,
|
|
68
|
+
...(parsed.data.source_decision !== undefined
|
|
69
|
+
? { source_decision: parsed.data.source_decision }
|
|
70
|
+
: {}),
|
|
71
|
+
...(parsed.data.superseded_by !== undefined
|
|
72
|
+
? { superseded_by: parsed.data.superseded_by }
|
|
73
|
+
: {}),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
entries.sort((a, b) => a.id.localeCompare(b.id));
|
|
77
|
+
return entries;
|
|
78
|
+
}
|
|
79
|
+
export function writeInvariantsLedger(opts) {
|
|
80
|
+
const entries = buildInvariantsLedger(opts);
|
|
81
|
+
const path = invariantsLedgerPath(opts.repoRoot);
|
|
82
|
+
mkdirSync(invariantsDir(opts.repoRoot), { recursive: true });
|
|
83
|
+
atomicWrite(path, stringifyYaml(entries));
|
|
84
|
+
log.debug({ path, count: entries.length }, "wrote invariants ledger");
|
|
85
|
+
return { entries, path };
|
|
86
|
+
}
|
|
87
|
+
function atomicWrite(dest, content) {
|
|
88
|
+
const tmp = `${dest}.tmp`;
|
|
89
|
+
writeFileSync(tmp, content, "utf8");
|
|
90
|
+
renameSync(tmp, dest);
|
|
91
|
+
}
|
|
92
|
+
function listMarkdown(dir) {
|
|
93
|
+
let dirents;
|
|
94
|
+
try {
|
|
95
|
+
dirents = readdirSync(dir, { withFileTypes: true, encoding: "utf8" });
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
return dirents
|
|
101
|
+
.filter((d) => d.isFile() && d.name.endsWith(".md") && !d.name.startsWith("_"))
|
|
102
|
+
.map((d) => d.name)
|
|
103
|
+
.sort();
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=ledgers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledgers.js","sourceRoot":"","sources":["../src/ledgers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,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