@principal-ai/subsystems-core 0.51.4 → 0.51.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.
Files changed (144) hide show
  1. package/README.md +21 -6
  2. package/dist/audit/boundary.d.ts +104 -0
  3. package/dist/audit/boundary.d.ts.map +1 -0
  4. package/dist/audit/boundary.js +363 -0
  5. package/dist/audit/boundary.js.map +1 -0
  6. package/dist/audit/c4.d.ts +41 -0
  7. package/dist/audit/c4.d.ts.map +1 -0
  8. package/dist/audit/c4.js +41 -0
  9. package/dist/audit/c4.js.map +1 -0
  10. package/dist/audit/engine.d.ts +135 -0
  11. package/dist/audit/engine.d.ts.map +1 -0
  12. package/dist/audit/engine.js +828 -0
  13. package/dist/audit/engine.js.map +1 -0
  14. package/dist/audit/fixes.d.ts +80 -0
  15. package/dist/audit/fixes.d.ts.map +1 -0
  16. package/dist/audit/fixes.js +162 -0
  17. package/dist/audit/fixes.js.map +1 -0
  18. package/dist/audit/hash.d.ts +25 -0
  19. package/dist/audit/hash.d.ts.map +1 -0
  20. package/dist/audit/hash.js +53 -0
  21. package/dist/audit/hash.js.map +1 -0
  22. package/dist/audit/index.d.ts +11 -1
  23. package/dist/audit/index.d.ts.map +1 -1
  24. package/dist/audit/index.js +37 -3
  25. package/dist/audit/index.js.map +1 -1
  26. package/dist/audit/local-graphify.d.ts +75 -0
  27. package/dist/audit/local-graphify.d.ts.map +1 -0
  28. package/dist/audit/local-graphify.js +283 -0
  29. package/dist/audit/local-graphify.js.map +1 -0
  30. package/dist/audit/paths.d.ts +16 -0
  31. package/dist/audit/paths.d.ts.map +1 -0
  32. package/dist/audit/paths.js +31 -0
  33. package/dist/audit/paths.js.map +1 -0
  34. package/dist/audit/pure.d.ts +18 -0
  35. package/dist/audit/pure.d.ts.map +1 -0
  36. package/dist/audit/pure.js +50 -0
  37. package/dist/audit/pure.js.map +1 -0
  38. package/dist/audit/report-logic.d.ts +17 -0
  39. package/dist/audit/report-logic.d.ts.map +1 -0
  40. package/dist/audit/report-logic.js +206 -0
  41. package/dist/audit/report-logic.js.map +1 -0
  42. package/dist/audit/report.d.ts +136 -0
  43. package/dist/audit/report.d.ts.map +1 -0
  44. package/dist/audit/report.js +3 -0
  45. package/dist/audit/report.js.map +1 -0
  46. package/dist/audit/trail.d.ts +29 -0
  47. package/dist/audit/trail.d.ts.map +1 -0
  48. package/dist/audit/trail.js +59 -0
  49. package/dist/audit/trail.js.map +1 -0
  50. package/dist/audit/verification.d.ts +98 -0
  51. package/dist/audit/verification.d.ts.map +1 -0
  52. package/dist/audit/verification.js +11 -0
  53. package/dist/audit/verification.js.map +1 -0
  54. package/dist/audit/verify/component.d.ts +68 -0
  55. package/dist/audit/verify/component.d.ts.map +1 -0
  56. package/dist/audit/verify/component.js +500 -0
  57. package/dist/audit/verify/component.js.map +1 -0
  58. package/dist/audit/verify/declarations.d.ts +58 -0
  59. package/dist/audit/verify/declarations.d.ts.map +1 -0
  60. package/dist/audit/verify/declarations.js +227 -0
  61. package/dist/audit/verify/declarations.js.map +1 -0
  62. package/dist/audit/verify/grammar.d.ts +12 -0
  63. package/dist/audit/verify/grammar.d.ts.map +1 -0
  64. package/dist/audit/verify/grammar.js +57 -0
  65. package/dist/audit/verify/grammar.js.map +1 -0
  66. package/dist/audit/verify/index.d.ts +12 -0
  67. package/dist/audit/verify/index.d.ts.map +1 -0
  68. package/dist/audit/verify/index.js +31 -0
  69. package/dist/audit/verify/index.js.map +1 -0
  70. package/dist/audit/verify/parser.d.ts +19 -0
  71. package/dist/audit/verify/parser.d.ts.map +1 -0
  72. package/dist/audit/verify/parser.js +122 -0
  73. package/dist/audit/verify/parser.js.map +1 -0
  74. package/dist/audit/verify/span.d.ts +49 -0
  75. package/dist/audit/verify/span.d.ts.map +1 -0
  76. package/dist/audit/verify/span.js +377 -0
  77. package/dist/audit/verify/span.js.map +1 -0
  78. package/dist/graphify/anchor.d.ts +45 -0
  79. package/dist/graphify/anchor.d.ts.map +1 -0
  80. package/dist/graphify/anchor.js +179 -0
  81. package/dist/graphify/anchor.js.map +1 -0
  82. package/dist/graphify/consolidated.d.ts +259 -0
  83. package/dist/graphify/consolidated.d.ts.map +1 -0
  84. package/dist/graphify/consolidated.js +12 -0
  85. package/dist/graphify/consolidated.js.map +1 -0
  86. package/dist/graphify/construct.d.ts +41 -0
  87. package/dist/graphify/construct.d.ts.map +1 -0
  88. package/dist/graphify/construct.js +106 -0
  89. package/dist/graphify/construct.js.map +1 -0
  90. package/dist/graphify/ids.d.ts +19 -0
  91. package/dist/graphify/ids.d.ts.map +1 -0
  92. package/dist/graphify/ids.js +53 -0
  93. package/dist/graphify/ids.js.map +1 -0
  94. package/dist/graphify/index.d.ts +16 -0
  95. package/dist/graphify/index.d.ts.map +1 -0
  96. package/dist/graphify/index.js +32 -0
  97. package/dist/graphify/index.js.map +1 -0
  98. package/dist/graphify/resolve.d.ts +48 -0
  99. package/dist/graphify/resolve.d.ts.map +1 -0
  100. package/dist/graphify/resolve.js +89 -0
  101. package/dist/graphify/resolve.js.map +1 -0
  102. package/dist/graphify/signature.d.ts +87 -0
  103. package/dist/graphify/signature.d.ts.map +1 -0
  104. package/dist/graphify/signature.js +282 -0
  105. package/dist/graphify/signature.js.map +1 -0
  106. package/dist/graphify/types.d.ts +141 -0
  107. package/dist/graphify/types.d.ts.map +1 -0
  108. package/dist/graphify/types.js +9 -0
  109. package/dist/graphify/types.js.map +1 -0
  110. package/dist/index.d.ts +1 -1
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +3 -3
  113. package/dist/index.js.map +1 -1
  114. package/package.json +16 -2
  115. package/src/audit/boundary.ts +447 -0
  116. package/src/audit/c4.ts +70 -0
  117. package/src/audit/engine.ts +1058 -0
  118. package/src/audit/fixes.ts +192 -0
  119. package/src/audit/hash.ts +58 -0
  120. package/src/audit/index.ts +33 -8
  121. package/src/audit/local-graphify.test.ts +163 -0
  122. package/src/audit/local-graphify.ts +354 -0
  123. package/src/audit/paths.ts +25 -0
  124. package/src/audit/pure.ts +91 -0
  125. package/src/audit/report-logic.test.ts +145 -0
  126. package/src/audit/report-logic.ts +245 -0
  127. package/src/audit/report.ts +203 -0
  128. package/src/audit/trail.ts +77 -0
  129. package/src/audit/verification.ts +104 -0
  130. package/src/audit/verify/component.ts +760 -0
  131. package/src/audit/verify/declarations.ts +284 -0
  132. package/src/audit/verify/grammar.ts +57 -0
  133. package/src/audit/verify/index.ts +41 -0
  134. package/src/audit/verify/parser.ts +124 -0
  135. package/src/audit/verify/span.ts +478 -0
  136. package/src/graphify/anchor.ts +206 -0
  137. package/src/graphify/consolidated.ts +298 -0
  138. package/src/graphify/construct.ts +153 -0
  139. package/src/graphify/ids.ts +48 -0
  140. package/src/graphify/index.ts +16 -0
  141. package/src/graphify/resolve.ts +115 -0
  142. package/src/graphify/signature.ts +354 -0
  143. package/src/graphify/types.ts +164 -0
  144. package/src/index.ts +3 -3
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+ /**
3
+ * Local Graphify cache reader shared by audit hosts.
4
+ *
5
+ * A subsystem audit must use the graph for the *current* HEAD(+dirty) slot,
6
+ * not a stale fallback. This module owns the on-disk layout and git probe so a
7
+ * CLI host and Studio compute identical slot keys and fingerprints from the
8
+ * same `~/.principal/graphify-graphs` store.
9
+ *
10
+ * The transport stays swappable: this is a read-only local-cache provider. A
11
+ * host may supply `ensureCurrent` (Studio builds caches, an MCP daemon would
12
+ * build remotely); when omitted, missing slots are reported explicitly rather
13
+ * than fabricated.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.createLocalGraphifyAuditProvider = exports.LocalGraphifyCache = exports.cacheSlotKey = exports.sanitizePurlDirName = exports.localGraphifyStoreRoot = void 0;
17
+ const node_child_process_1 = require("node:child_process");
18
+ const node_crypto_1 = require("node:crypto");
19
+ const node_fs_1 = require("node:fs");
20
+ const node_os_1 = require("node:os");
21
+ const node_path_1 = require("node:path");
22
+ const graphify_provider_1 = require("./graphify-provider");
23
+ const paths_1 = require("./paths");
24
+ const GIT_STDOUT_MAX_BYTES = 32 * 1024 * 1024;
25
+ const UNTRACKED_HASH_MAX_BYTES = 1048576;
26
+ const GIT_PROBE_TTL_MS = 2000;
27
+ /** Absolute root of the graphify cache. `PRINCIPAL_GRAPHIFY_GRAPHS_HOME` overrides it. */
28
+ function localGraphifyStoreRoot() {
29
+ const override = process.env['PRINCIPAL_GRAPHIFY_GRAPHS_HOME']?.trim();
30
+ return override ? override : (0, node_path_1.join)((0, node_os_1.homedir)(), '.principal', 'graphify-graphs');
31
+ }
32
+ exports.localGraphifyStoreRoot = localGraphifyStoreRoot;
33
+ /** Filesystem-safe directory name for a purl repo key. */
34
+ function sanitizePurlDirName(purlKey) {
35
+ const stripped = purlKey.replace(/^pkg:/i, '');
36
+ const cleaned = stripped
37
+ .replace(/[^a-zA-Z0-9._-]+/g, '-')
38
+ .replace(/-+/g, '-')
39
+ .replace(/^-|-$/g, '')
40
+ .toLowerCase();
41
+ return cleaned || 'unknown';
42
+ }
43
+ exports.sanitizePurlDirName = sanitizePurlDirName;
44
+ /** Slot folder: clean `headSha`, or `headSha+dirtyHash` when dirty. */
45
+ function cacheSlotKey(headSha, dirtyHash) {
46
+ return dirtyHash ? `${headSha}+${dirtyHash}` : headSha;
47
+ }
48
+ exports.cacheSlotKey = cacheSlotKey;
49
+ function slotDir(storeRoot, purlKey, headSha, dirtyHash) {
50
+ return (0, node_path_1.join)(storeRoot, sanitizePurlDirName(purlKey), cacheSlotKey(headSha, dirtyHash));
51
+ }
52
+ function gitStdout(repoRoot, args) {
53
+ const proc = (0, node_child_process_1.spawnSync)('git', ['-C', repoRoot, ...args], {
54
+ encoding: 'utf8',
55
+ maxBuffer: GIT_STDOUT_MAX_BYTES,
56
+ stdio: ['ignore', 'pipe', 'ignore'],
57
+ });
58
+ if (proc.status !== 0)
59
+ return null;
60
+ return (proc.stdout ?? '').slice(0, GIT_STDOUT_MAX_BYTES);
61
+ }
62
+ function computeDirtyHash(status, diff, untrackedRaw, repoRoot) {
63
+ const hasher = (0, node_crypto_1.createHash)('sha256');
64
+ hasher.update('status\0');
65
+ hasher.update(status);
66
+ hasher.update('\0diff\0');
67
+ hasher.update(diff);
68
+ hasher.update('\0untracked\0');
69
+ if (untrackedRaw) {
70
+ const paths = untrackedRaw.split('\0').filter(Boolean);
71
+ paths.sort();
72
+ for (const rel of paths) {
73
+ hasher.update(rel);
74
+ hasher.update('\0');
75
+ const abs = (0, node_path_1.join)(repoRoot, rel);
76
+ try {
77
+ const st = (0, node_fs_1.statSync)(abs);
78
+ if (!st.isFile()) {
79
+ hasher.update(`dir:${st.size}\0`);
80
+ continue;
81
+ }
82
+ hasher.update(`size:${st.size}\0`);
83
+ if (st.size <= UNTRACKED_HASH_MAX_BYTES) {
84
+ hasher.update((0, node_fs_1.readFileSync)(abs));
85
+ }
86
+ else {
87
+ hasher.update(`mtime:${Math.floor(st.mtimeMs)}\0`);
88
+ }
89
+ }
90
+ catch {
91
+ hasher.update('missing\0');
92
+ }
93
+ hasher.update('\0');
94
+ }
95
+ }
96
+ return hasher.digest('hex').slice(0, 16);
97
+ }
98
+ /** A read-only view of the local graphify cache for one audit host. */
99
+ class LocalGraphifyCache {
100
+ constructor(config) {
101
+ this.config = config;
102
+ this.probes = new Map();
103
+ }
104
+ root() {
105
+ return this.config.storeRoot?.trim() || localGraphifyStoreRoot();
106
+ }
107
+ resolveRepoRoot(purl) {
108
+ return this.config.resolveRepoRoot(purl);
109
+ }
110
+ probe(repoRoot) {
111
+ const cached = this.probes.get(repoRoot);
112
+ if (cached && Date.now() - cached.at < GIT_PROBE_TTL_MS)
113
+ return cached;
114
+ const headSha = gitStdout(repoRoot, ['rev-parse', 'HEAD'])?.trim() || null;
115
+ const status = gitStdout(repoRoot, ['status', '--porcelain=v1']);
116
+ let dirtyHash = null;
117
+ if (headSha && status?.trim()) {
118
+ const diff = gitStdout(repoRoot, ['diff', 'HEAD', '--binary']) ?? '';
119
+ const untrackedRaw = gitStdout(repoRoot, [
120
+ 'ls-files',
121
+ '-z',
122
+ '--others',
123
+ '--exclude-standard',
124
+ ]) ?? '';
125
+ dirtyHash = computeDirtyHash(status, diff, untrackedRaw, repoRoot);
126
+ }
127
+ const probe = { at: Date.now(), headSha, dirtyHash };
128
+ this.probes.set(repoRoot, probe);
129
+ return probe;
130
+ }
131
+ /** Resolve the exact current-HEAD(+dirty) slot for a purl. */
132
+ async currentSlot(purl, options) {
133
+ const purlKey = (0, paths_1.purlRepoKey)(purl);
134
+ if (!purlKey)
135
+ return null;
136
+ const repoRoot = options?.repoRoot?.trim() || this.config.resolveRepoRoot(purlKey);
137
+ if (!repoRoot || !(0, node_fs_1.existsSync)(repoRoot))
138
+ return null;
139
+ const { headSha, dirtyHash } = this.probe(repoRoot);
140
+ if (!headSha)
141
+ return null;
142
+ const slotKey = cacheSlotKey(headSha, dirtyHash);
143
+ const dir = slotDir(this.root(), purlKey, headSha, dirtyHash);
144
+ const graphPath = (0, node_path_1.join)(dir, 'graph.json');
145
+ const metaPath = (0, node_path_1.join)(dir, 'meta.json');
146
+ let cached = null;
147
+ if ((0, node_fs_1.existsSync)(graphPath) && (0, node_fs_1.existsSync)(metaPath)) {
148
+ try {
149
+ const meta = JSON.parse((0, node_fs_1.readFileSync)(metaPath, 'utf8'));
150
+ cached = { path: graphPath, builtAt: meta.builtAt };
151
+ }
152
+ catch {
153
+ /* treat as missing */
154
+ }
155
+ }
156
+ return {
157
+ purlKey,
158
+ repoRoot,
159
+ headSha,
160
+ dirtyHash,
161
+ slotKey,
162
+ cached,
163
+ };
164
+ }
165
+ /** Fingerprint input: the current slot key + when that slot was built. */
166
+ async resolveGraphifySlot(purl, options) {
167
+ const slot = await this.currentSlot(purl, options);
168
+ if (!slot)
169
+ return null;
170
+ return { slotKey: slot.slotKey, builtAt: slot.cached?.builtAt };
171
+ }
172
+ async readiness(model, buildingPurls) {
173
+ const seen = new Set();
174
+ const statuses = [];
175
+ for (const component of model.components) {
176
+ const key = (0, paths_1.purlRepoKey)(component.purl);
177
+ if (!key || !(0, paths_1.isRepoPurl)(key) || seen.has(key))
178
+ continue;
179
+ seen.add(key);
180
+ const repoRoot = this.config.resolveRepoRoot(key) ?? undefined;
181
+ if (buildingPurls?.has(key)) {
182
+ statuses.push({ purl: key, status: 'building', repoRoot });
183
+ continue;
184
+ }
185
+ const slot = await this.currentSlot(key, { repoRoot });
186
+ if (!slot) {
187
+ statuses.push({ purl: key, status: 'unavailable' });
188
+ continue;
189
+ }
190
+ statuses.push({
191
+ purl: key,
192
+ status: slot.cached ? 'ready' : 'missing',
193
+ repoRoot: slot.repoRoot,
194
+ });
195
+ }
196
+ statuses.sort((a, b) => a.purl.localeCompare(b.purl));
197
+ const all = statuses.map((p) => p.status);
198
+ let status;
199
+ if (all.length === 0)
200
+ status = 'unavailable';
201
+ else if (all.includes('building'))
202
+ status = 'running';
203
+ else if (all.every((s) => s === 'ready'))
204
+ status = 'possible';
205
+ else if (all.includes('ready'))
206
+ status = 'partial';
207
+ else if (all.includes('missing'))
208
+ status = 'not_ready';
209
+ else
210
+ status = 'unavailable';
211
+ return { status, purls: statuses };
212
+ }
213
+ async loadGraph(purl, options) {
214
+ const slot = await this.currentSlot(purl, options);
215
+ if (!slot?.cached)
216
+ return null;
217
+ try {
218
+ const graph = JSON.parse((0, node_fs_1.readFileSync)(slot.cached.path, 'utf8'));
219
+ if (!Array.isArray(graph.nodes))
220
+ return null;
221
+ const edges = graph.links ?? graph.edges ?? [];
222
+ return {
223
+ nodes: graph.nodes,
224
+ edges: Array.isArray(edges) ? edges : [],
225
+ };
226
+ }
227
+ catch {
228
+ return null;
229
+ }
230
+ }
231
+ /** Read-only default: report missing current slots instead of building. */
232
+ async ensureCurrent(model) {
233
+ if (this.config.ensureCurrent) {
234
+ return this.config.ensureCurrent(model);
235
+ }
236
+ const ensured = [];
237
+ const failed = [];
238
+ const seen = new Set();
239
+ for (const component of model.components) {
240
+ const key = (0, paths_1.purlRepoKey)(component.purl);
241
+ if (!key || !(0, paths_1.isRepoPurl)(key) || seen.has(key))
242
+ continue;
243
+ seen.add(key);
244
+ const slot = await this.currentSlot(key);
245
+ if (slot?.cached) {
246
+ ensured.push(key);
247
+ }
248
+ else if (!slot) {
249
+ failed.push({
250
+ purl: key,
251
+ error: 'no local checkout for this purl — register the repo in Alexandria',
252
+ });
253
+ }
254
+ else {
255
+ failed.push({
256
+ purl: key,
257
+ error: `no graphify cache for the current HEAD(+dirty) slot ${slot.slotKey} — build it in Subsystems Studio or via an MCP Graphify provider`,
258
+ });
259
+ }
260
+ }
261
+ return { ensured, failed };
262
+ }
263
+ /** The GraphifyAuditProvider port, with per-pass snapshot caching. */
264
+ provider() {
265
+ return (0, graphify_provider_1.cacheGraphifyAuditProvider)({
266
+ ensureCurrent: (model) => this.ensureCurrent(model),
267
+ readiness: (model, building) => this.readiness(model, building),
268
+ resolveRepoRoot: (purl) => this.config.resolveRepoRoot(purl),
269
+ loadGraph: (purl, options) => this.loadGraph(purl, options),
270
+ });
271
+ }
272
+ }
273
+ exports.LocalGraphifyCache = LocalGraphifyCache;
274
+ /** Convenience factory: a cached provider + fingerprint resolver for one host. */
275
+ function createLocalGraphifyAuditProvider(config) {
276
+ const cache = new LocalGraphifyCache(config);
277
+ const provider = cache.provider();
278
+ return Object.assign(provider, {
279
+ resolveGraphifySlot: (purl, options) => cache.resolveGraphifySlot(purl, options),
280
+ });
281
+ }
282
+ exports.createLocalGraphifyAuditProvider = createLocalGraphifyAuditProvider;
283
+ //# sourceMappingURL=local-graphify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-graphify.js","sourceRoot":"","sources":["../../src/audit/local-graphify.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,2DAA8C;AAC9C,6CAAwC;AACxC,qCAA4D;AAC5D,qCAAiC;AACjC,yCAAgC;AAShC,2DAAgE;AAChE,mCAAiD;AAEjD,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA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,EAAE,GAAG;oBACT,KAAK,EAAE,uDAAuD,IAAI,CAAC,OAAO,kEAAkE;iBAC7I,CAAC,CAAA;aACH;SACF;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;IAC5B,CAAC;IAED,sEAAsE;IACtE,QAAQ;QACN,OAAO,IAAA,8CAA0B,EAAC;YAChC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YACnD,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC;YAC/D,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC;YAC5D,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;SAC5D,CAAC,CAAA;IACJ,CAAC;CACF;AAxLD,gDAwLC;AAED,kFAAkF;AAClF,SAAgB,gCAAgC,CAC9C,MAA2B;IAO3B,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;IACjC,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;QAC7B,mBAAmB,EAAE,CAAC,IAAY,EAAE,OAA+B,EAAE,EAAE,CACrE,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;KAC3C,CAAC,CAAA;AACJ,CAAC;AAdD,4EAcC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Purl helpers shared by the audit engine.
3
+ *
4
+ * A component's `file` is relative to its own repo, identified by the purl
5
+ * repo key (fragment stripped). These are pure string helpers so the engine
6
+ * can group claims by repository without depending on a viewer package.
7
+ */
8
+ /** Normalize a purl to its repo key: fragment and surrounding whitespace stripped. */
9
+ export declare function purlRepoKey(purl: string | undefined): string | undefined;
10
+ /**
11
+ * True when a purl identifies a code repo checkout a host can resolve
12
+ * locally. `external:` and other pseudo-purls are stable identities, not
13
+ * checkouts.
14
+ */
15
+ export declare function isRepoPurl(purl: string | undefined): boolean;
16
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/audit/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIxE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI5D"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * Purl helpers shared by the audit engine.
4
+ *
5
+ * A component's `file` is relative to its own repo, identified by the purl
6
+ * repo key (fragment stripped). These are pure string helpers so the engine
7
+ * can group claims by repository without depending on a viewer package.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.isRepoPurl = exports.purlRepoKey = void 0;
11
+ /** Normalize a purl to its repo key: fragment and surrounding whitespace stripped. */
12
+ function purlRepoKey(purl) {
13
+ if (!purl)
14
+ return undefined;
15
+ const base = purl.split('#')[0]?.trim();
16
+ return base || undefined;
17
+ }
18
+ exports.purlRepoKey = purlRepoKey;
19
+ /**
20
+ * True when a purl identifies a code repo checkout a host can resolve
21
+ * locally. `external:` and other pseudo-purls are stable identities, not
22
+ * checkouts.
23
+ */
24
+ function isRepoPurl(purl) {
25
+ const key = purlRepoKey(purl);
26
+ if (!key)
27
+ return false;
28
+ return /^pkg:github\//i.test(key);
29
+ }
30
+ exports.isRepoPurl = isRepoPurl;
31
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/audit/paths.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,sFAAsF;AACtF,SAAgB,WAAW,CAAC,IAAwB;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAA;IAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAA;IACvC,OAAO,IAAI,IAAI,SAAS,CAAA;AAC1B,CAAC;AAJD,kCAIC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAC,IAAwB;IACjD,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IAC7B,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAA;IACtB,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACnC,CAAC;AAJD,gCAIC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Browser-safe audit exports.
3
+ *
4
+ * The audit engine and source hashing are Node-only (filesystem, crypto). This
5
+ * barrel holds the pure policy, types, and report rules so the main package
6
+ * entry can re-export them without pulling Node built-ins into a browser
7
+ * bundle. Node consumers use `./audit` for the full surface.
8
+ */
9
+ export { cacheGraphifyAuditProvider, type GraphifyAuditModel, type GraphifyAuditEnsureResult, type GraphifyAuditPurlReadiness, type GraphifyAuditReadiness, type GraphifyAuditSnapshot, type GraphifyAuditProvider, } from './graphify-provider';
10
+ export type { AuditSpanFreshness, SubsystemModelAuditFindingKind, SubsystemModelAuditSeverity, SubsystemModelAuditFix, SubsystemModelAuditFixGroup, SubsystemModelAuditFinding, SubsystemModelAuditCheck, SubsystemModelAuditBoundaryCheck, SubsystemModelAuditReport, SubsystemVerificationLane, VerificationLaneStatus, SubsystemModelVerificationLayer, SubsystemModelVerification, } from './report';
11
+ export { auditBoundaryFields, auditProcessBacking, auditProcessVerification, dropUnbackedMissing, moduleAgreesWithFile, normalizeBoundaryPath, requiresProcess, type BoundaryAuditFinding, type BoundaryAuditResult, type BoundaryCheckKind, type BoundaryCheckVerdict, type BoundaryComponentCheck, } from './boundary';
12
+ export { verifyProcessBoundaries, type C4AuditElement, type C4AuditElementState, type C4ProcessBoundaryStatus, type C4ProcessVerification, } from './c4';
13
+ export { adoptGraphifyDeclarationRefFixFromVerify, adoptGraphifyFileFixFromVerify, adoptGraphifySignatureFixFromVerify, adoptTreeSitterSpanFixFromVerify, installedDependencyPackage, isAdoptableEmptyClaimedSignature, storeTypeStale, storeTypeUndeclared, verificationFailureDiagnostic, verificationUnavailableFinding, type InstalledDependency, } from './fixes';
14
+ export { isRepoPurl, purlRepoKey } from './paths';
15
+ export { auditFixGroups, auditIssueCount, auditHasIssues, auditHasPartialGaps, classifyAuditReport, isVerifiedConstructCheck, summarizeVerification, summarizeLanes, type SubsystemModelAuditVerdict, } from './report-logic';
16
+ export { callsSiteOutsideFrom, unconnectedComponentFindings } from './trail';
17
+ export type { AuditAnchorCandidate, AuditAnchorCheck, AuditComponentVerification, AuditConstructCheck, AuditDeclarationCheck, AuditFileCheck, AuditFileSuggestion, AuditSignatureCheck, AuditSignatureTypes, } from './verification';
18
+ //# sourceMappingURL=pure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pure.d.ts","sourceRoot":"","sources":["../../src/audit/pure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,kBAAkB,EAClB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,gCAAgC,EAChC,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,MAAM,CAAA;AACb,OAAO,EACL,wCAAwC,EACxC,8BAA8B,EAC9B,mCAAmC,EACnC,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,cAAc,EACd,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,KAAK,0BAA0B,GAChC,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAC5E,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * Browser-safe audit exports.
4
+ *
5
+ * The audit engine and source hashing are Node-only (filesystem, crypto). This
6
+ * barrel holds the pure policy, types, and report rules so the main package
7
+ * entry can re-export them without pulling Node built-ins into a browser
8
+ * bundle. Node consumers use `./audit` for the full surface.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.unconnectedComponentFindings = exports.callsSiteOutsideFrom = exports.summarizeLanes = exports.summarizeVerification = exports.isVerifiedConstructCheck = exports.classifyAuditReport = exports.auditHasPartialGaps = exports.auditHasIssues = exports.auditIssueCount = exports.auditFixGroups = exports.purlRepoKey = exports.isRepoPurl = exports.verificationUnavailableFinding = exports.verificationFailureDiagnostic = exports.storeTypeUndeclared = exports.storeTypeStale = exports.isAdoptableEmptyClaimedSignature = exports.installedDependencyPackage = exports.adoptTreeSitterSpanFixFromVerify = exports.adoptGraphifySignatureFixFromVerify = exports.adoptGraphifyFileFixFromVerify = exports.adoptGraphifyDeclarationRefFixFromVerify = exports.verifyProcessBoundaries = exports.requiresProcess = exports.normalizeBoundaryPath = exports.moduleAgreesWithFile = exports.dropUnbackedMissing = exports.auditProcessVerification = exports.auditProcessBacking = exports.auditBoundaryFields = exports.cacheGraphifyAuditProvider = void 0;
12
+ var graphify_provider_1 = require("./graphify-provider");
13
+ Object.defineProperty(exports, "cacheGraphifyAuditProvider", { enumerable: true, get: function () { return graphify_provider_1.cacheGraphifyAuditProvider; } });
14
+ var boundary_1 = require("./boundary");
15
+ Object.defineProperty(exports, "auditBoundaryFields", { enumerable: true, get: function () { return boundary_1.auditBoundaryFields; } });
16
+ Object.defineProperty(exports, "auditProcessBacking", { enumerable: true, get: function () { return boundary_1.auditProcessBacking; } });
17
+ Object.defineProperty(exports, "auditProcessVerification", { enumerable: true, get: function () { return boundary_1.auditProcessVerification; } });
18
+ Object.defineProperty(exports, "dropUnbackedMissing", { enumerable: true, get: function () { return boundary_1.dropUnbackedMissing; } });
19
+ Object.defineProperty(exports, "moduleAgreesWithFile", { enumerable: true, get: function () { return boundary_1.moduleAgreesWithFile; } });
20
+ Object.defineProperty(exports, "normalizeBoundaryPath", { enumerable: true, get: function () { return boundary_1.normalizeBoundaryPath; } });
21
+ Object.defineProperty(exports, "requiresProcess", { enumerable: true, get: function () { return boundary_1.requiresProcess; } });
22
+ var c4_1 = require("./c4");
23
+ Object.defineProperty(exports, "verifyProcessBoundaries", { enumerable: true, get: function () { return c4_1.verifyProcessBoundaries; } });
24
+ var fixes_1 = require("./fixes");
25
+ Object.defineProperty(exports, "adoptGraphifyDeclarationRefFixFromVerify", { enumerable: true, get: function () { return fixes_1.adoptGraphifyDeclarationRefFixFromVerify; } });
26
+ Object.defineProperty(exports, "adoptGraphifyFileFixFromVerify", { enumerable: true, get: function () { return fixes_1.adoptGraphifyFileFixFromVerify; } });
27
+ Object.defineProperty(exports, "adoptGraphifySignatureFixFromVerify", { enumerable: true, get: function () { return fixes_1.adoptGraphifySignatureFixFromVerify; } });
28
+ Object.defineProperty(exports, "adoptTreeSitterSpanFixFromVerify", { enumerable: true, get: function () { return fixes_1.adoptTreeSitterSpanFixFromVerify; } });
29
+ Object.defineProperty(exports, "installedDependencyPackage", { enumerable: true, get: function () { return fixes_1.installedDependencyPackage; } });
30
+ Object.defineProperty(exports, "isAdoptableEmptyClaimedSignature", { enumerable: true, get: function () { return fixes_1.isAdoptableEmptyClaimedSignature; } });
31
+ Object.defineProperty(exports, "storeTypeStale", { enumerable: true, get: function () { return fixes_1.storeTypeStale; } });
32
+ Object.defineProperty(exports, "storeTypeUndeclared", { enumerable: true, get: function () { return fixes_1.storeTypeUndeclared; } });
33
+ Object.defineProperty(exports, "verificationFailureDiagnostic", { enumerable: true, get: function () { return fixes_1.verificationFailureDiagnostic; } });
34
+ Object.defineProperty(exports, "verificationUnavailableFinding", { enumerable: true, get: function () { return fixes_1.verificationUnavailableFinding; } });
35
+ var paths_1 = require("./paths");
36
+ Object.defineProperty(exports, "isRepoPurl", { enumerable: true, get: function () { return paths_1.isRepoPurl; } });
37
+ Object.defineProperty(exports, "purlRepoKey", { enumerable: true, get: function () { return paths_1.purlRepoKey; } });
38
+ var report_logic_1 = require("./report-logic");
39
+ Object.defineProperty(exports, "auditFixGroups", { enumerable: true, get: function () { return report_logic_1.auditFixGroups; } });
40
+ Object.defineProperty(exports, "auditIssueCount", { enumerable: true, get: function () { return report_logic_1.auditIssueCount; } });
41
+ Object.defineProperty(exports, "auditHasIssues", { enumerable: true, get: function () { return report_logic_1.auditHasIssues; } });
42
+ Object.defineProperty(exports, "auditHasPartialGaps", { enumerable: true, get: function () { return report_logic_1.auditHasPartialGaps; } });
43
+ Object.defineProperty(exports, "classifyAuditReport", { enumerable: true, get: function () { return report_logic_1.classifyAuditReport; } });
44
+ Object.defineProperty(exports, "isVerifiedConstructCheck", { enumerable: true, get: function () { return report_logic_1.isVerifiedConstructCheck; } });
45
+ Object.defineProperty(exports, "summarizeVerification", { enumerable: true, get: function () { return report_logic_1.summarizeVerification; } });
46
+ Object.defineProperty(exports, "summarizeLanes", { enumerable: true, get: function () { return report_logic_1.summarizeLanes; } });
47
+ var trail_1 = require("./trail");
48
+ Object.defineProperty(exports, "callsSiteOutsideFrom", { enumerable: true, get: function () { return trail_1.callsSiteOutsideFrom; } });
49
+ Object.defineProperty(exports, "unconnectedComponentFindings", { enumerable: true, get: function () { return trail_1.unconnectedComponentFindings; } });
50
+ //# sourceMappingURL=pure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pure.js","sourceRoot":"","sources":["../../src/audit/pure.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,yDAQ4B;AAP1B,+HAAA,0BAA0B,OAAA;AAuB5B,uCAamB;AAZjB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AACnB,gHAAA,oBAAoB,OAAA;AACpB,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AAOjB,2BAMa;AALX,6GAAA,uBAAuB,OAAA;AAMzB,iCAYgB;AAXd,iIAAA,wCAAwC,OAAA;AACxC,uHAAA,8BAA8B,OAAA;AAC9B,4HAAA,mCAAmC,OAAA;AACnC,yHAAA,gCAAgC,OAAA;AAChC,mHAAA,0BAA0B,OAAA;AAC1B,yHAAA,gCAAgC,OAAA;AAChC,uGAAA,cAAc,OAAA;AACd,4GAAA,mBAAmB,OAAA;AACnB,sHAAA,6BAA6B,OAAA;AAC7B,uHAAA,8BAA8B,OAAA;AAGhC,iCAAiD;AAAxC,mGAAA,UAAU,OAAA;AAAE,oGAAA,WAAW,OAAA;AAChC,+CAUuB;AATrB,8GAAA,cAAc,OAAA;AACd,+GAAA,eAAe,OAAA;AACf,8GAAA,cAAc,OAAA;AACd,mHAAA,mBAAmB,OAAA;AACnB,mHAAA,mBAAmB,OAAA;AACnB,wHAAA,wBAAwB,OAAA;AACxB,qHAAA,qBAAqB,OAAA;AACrB,8GAAA,cAAc,OAAA;AAGhB,iCAA4E;AAAnE,6GAAA,oBAAoB,OAAA;AAAE,qHAAA,4BAA4B,OAAA"}
@@ -0,0 +1,17 @@
1
+ import type { SubsystemModelAuditFixGroup, SubsystemModelAuditReport, SubsystemModelAuditCheck, SubsystemModelVerification, SubsystemVerificationLane, VerificationLaneStatus } from './report';
2
+ export type SubsystemModelAuditVerdict = 'fully_verified' | 'partially_verified' | 'issues';
3
+ export declare function auditFixGroups(report: SubsystemModelAuditReport): SubsystemModelAuditFixGroup[];
4
+ export declare function auditIssueCount(report: SubsystemModelAuditReport): number;
5
+ export declare function auditHasIssues(report: SubsystemModelAuditReport): boolean;
6
+ /** Gaps that are not failures — some checks confirmed, some still need follow-up. */
7
+ export declare function auditHasPartialGaps(report: SubsystemModelAuditReport): boolean;
8
+ export declare function classifyAuditReport(report: SubsystemModelAuditReport): SubsystemModelAuditVerdict;
9
+ /** Fully verified construct claim: exact graph anchor, source, kind, signature, and span. */
10
+ export declare function isVerifiedConstructCheck(check: SubsystemModelAuditCheck): boolean;
11
+ /** Derive the claim-based verification ledger from an audit report. */
12
+ export declare function summarizeVerification(report: SubsystemModelAuditReport): SubsystemModelVerification;
13
+ /** Coarse verification status mapped onto the four model layers. */
14
+ export declare function summarizeLanes(report: SubsystemModelAuditReport, opts: {
15
+ hasTrails: boolean;
16
+ }): Record<SubsystemVerificationLane, VerificationLaneStatus>;
17
+ //# sourceMappingURL=report-logic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-logic.d.ts","sourceRoot":"","sources":["../../src/audit/report-logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EAExB,0BAA0B,EAE1B,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,0BAA0B,GAClC,gBAAgB,GAChB,oBAAoB,GACpB,QAAQ,CAAA;AAEZ,wBAAgB,cAAc,CAC5B,MAAM,EAAE,yBAAyB,GAChC,2BAA2B,EAAE,CAU/B;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAMzE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAIzE;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAQ9E;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,yBAAyB,GAChC,0BAA0B,CAI5B;AAED,6FAA6F;AAC7F,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAWT;AAwFD,uEAAuE;AACvE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,yBAAyB,GAChC,0BAA0B,CAkB5B;AAUD,oEAAoE;AACpE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAC3B,MAAM,CAAC,yBAAyB,EAAE,sBAAsB,CAAC,CA4C3D"}