@granular-software/fractory 0.0.0-stage → 0.1.25
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 +4 -0
- package/README.md +28 -2
- package/dist/activity-volume.d.ts +18 -0
- package/dist/activity-volume.js +94 -0
- package/dist/annotations.d.ts +122 -0
- package/dist/annotations.js +304 -0
- package/dist/benchmark-cli.d.ts +1 -0
- package/dist/benchmark-cli.js +95 -0
- package/dist/benchmark-worker.d.ts +2 -0
- package/dist/benchmark-worker.js +22 -0
- package/dist/benchmarks.d.ts +19 -0
- package/dist/benchmarks.js +414 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +63 -0
- package/dist/block-cli.d.ts +1 -0
- package/dist/block-cli.js +88 -0
- package/dist/block-documents.d.ts +35 -0
- package/dist/block-documents.js +84 -0
- package/dist/change-impact.d.ts +55 -0
- package/dist/change-impact.js +223 -0
- package/dist/check-source.d.ts +2 -0
- package/dist/check-source.js +66 -0
- package/dist/checks-model.d.ts +64 -0
- package/dist/checks-model.js +36 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +359 -0
- package/dist/code-model.d.ts +38 -0
- package/dist/code-model.js +94 -0
- package/dist/code-store.d.ts +9 -0
- package/dist/code-store.js +79 -0
- package/dist/compare-artifact.d.ts +6 -0
- package/dist/compare-artifact.js +277 -0
- package/dist/compare.d.ts +81 -0
- package/dist/compare.js +291 -0
- package/dist/compiler.d.ts +10 -0
- package/dist/compiler.js +1240 -0
- package/dist/compose.d.ts +9 -0
- package/dist/compose.js +72 -0
- package/dist/core.d.ts +87 -0
- package/dist/core.js +207 -0
- package/dist/coverage-cli.d.ts +1 -0
- package/dist/coverage-cli.js +42 -0
- package/dist/declaration-sources.d.ts +3 -0
- package/dist/declaration-sources.js +51 -0
- package/dist/declared-graph.d.ts +3 -0
- package/dist/declared-graph.js +67 -0
- package/dist/display-name.d.ts +2 -0
- package/dist/display-name.js +8 -0
- package/dist/error-heat.d.ts +58 -0
- package/dist/error-heat.js +96 -0
- package/dist/evidence.d.ts +3 -0
- package/dist/evidence.js +68 -0
- package/dist/factory-graph.d.ts +7 -0
- package/dist/factory-graph.js +389 -0
- package/dist/factory-model.d.ts +111 -0
- package/dist/factory-model.js +1 -0
- package/dist/git-code.d.ts +47 -0
- package/dist/git-code.js +352 -0
- package/dist/git-refs.d.ts +4 -0
- package/dist/git-refs.js +37 -0
- package/dist/history-activity.d.ts +4 -0
- package/dist/history-activity.js +129 -0
- package/dist/history-churn.d.ts +36 -0
- package/dist/history-churn.js +302 -0
- package/dist/history-git.d.ts +21 -0
- package/dist/history-git.js +125 -0
- package/dist/history-ledger.d.ts +43 -0
- package/dist/history-ledger.js +450 -0
- package/dist/history-ownership.d.ts +10 -0
- package/dist/history-ownership.js +75 -0
- package/dist/history-source.d.ts +13 -0
- package/dist/history-source.js +100 -0
- package/dist/integrations-cli.d.ts +2 -0
- package/dist/integrations-cli.js +159 -0
- package/dist/interface-map.d.ts +15 -0
- package/dist/interface-map.js +125 -0
- package/dist/issue-cache.d.ts +9 -0
- package/dist/issue-cache.js +68 -0
- package/dist/issue-cli.d.ts +1 -0
- package/dist/issue-cli.js +89 -0
- package/dist/issue-links.d.ts +15 -0
- package/dist/issue-links.js +125 -0
- package/dist/linear-issues.d.ts +19 -0
- package/dist/linear-issues.js +124 -0
- package/dist/local-runtime.d.ts +8 -0
- package/dist/local-runtime.js +59 -0
- package/dist/map-activity.d.ts +73 -0
- package/dist/map-activity.js +234 -0
- package/dist/map-model.d.ts +5 -0
- package/dist/map-model.js +166 -0
- package/dist/map-quality.d.ts +20 -0
- package/dist/map-quality.js +61 -0
- package/dist/mapping-coverage.d.ts +87 -0
- package/dist/mapping-coverage.js +404 -0
- package/dist/model.d.ts +186 -0
- package/dist/model.js +66 -0
- package/dist/operation-benchmark-worker.d.ts +2 -0
- package/dist/operation-benchmark-worker.js +60 -0
- package/dist/operation-benchmark.d.ts +29 -0
- package/dist/operation-benchmark.js +1 -0
- package/dist/otel-metrics.d.ts +21 -0
- package/dist/otel-metrics.js +146 -0
- package/dist/performance-model.d.ts +185 -0
- package/dist/performance-model.js +396 -0
- package/dist/product-map.d.ts +71 -0
- package/dist/product-map.js +197 -0
- package/dist/provider-access.cjs +207 -0
- package/dist/provider-access.d.cts +14 -0
- package/dist/public-boundaries.d.ts +13 -0
- package/dist/public-boundaries.js +115 -0
- package/dist/reports-cli.d.ts +1 -0
- package/dist/reports-cli.js +111 -0
- package/dist/reports-model.d.ts +27 -0
- package/dist/reports-model.js +39 -0
- package/dist/reports.d.ts +23 -0
- package/dist/reports.js +223 -0
- package/dist/repository-map.d.ts +22 -0
- package/dist/repository-map.js +153 -0
- package/dist/resource-cache.d.ts +17 -0
- package/dist/resource-cache.js +65 -0
- package/dist/review-cli.d.ts +19 -0
- package/dist/review-cli.js +224 -0
- package/dist/review.d.ts +48 -0
- package/dist/review.js +289 -0
- package/dist/runtime-metrics.d.ts +26 -0
- package/dist/runtime-metrics.js +290 -0
- package/dist/scope.d.ts +14 -0
- package/dist/scope.js +168 -0
- package/dist/sentry-activity.d.ts +39 -0
- package/dist/sentry-activity.js +174 -0
- package/dist/sentry.d.ts +130 -0
- package/dist/sentry.js +369 -0
- package/dist/service-release.d.ts +16 -0
- package/dist/service-release.js +14 -0
- package/dist/setup-cli.d.ts +2 -0
- package/dist/setup-cli.js +52 -0
- package/dist/setup-kit.cjs +163 -0
- package/dist/setup-kit.d.cts +32 -0
- package/dist/source-index.d.ts +37 -0
- package/dist/source-index.js +170 -0
- package/dist/source-review-git.d.ts +7 -0
- package/dist/source-review-git.js +105 -0
- package/dist/source-review.d.ts +18 -0
- package/dist/source-review.js +573 -0
- package/dist/telemetry.d.ts +17 -0
- package/dist/telemetry.js +51 -0
- package/dist/time-window.d.ts +9 -0
- package/dist/time-window.js +35 -0
- package/dist/trace-evidence.d.ts +23 -0
- package/dist/trace-evidence.js +55 -0
- package/dist/trace-model.d.ts +26 -0
- package/dist/trace-model.js +1 -0
- package/dist/tracing.d.ts +44 -0
- package/dist/tracing.js +123 -0
- package/dist/work-check.d.ts +18 -0
- package/dist/work-check.js +115 -0
- package/dist/work-cli.d.ts +1 -0
- package/dist/work-cli.js +176 -0
- package/dist/work-context.d.ts +59 -0
- package/dist/work-context.js +594 -0
- package/dist/work-intents.d.ts +6 -0
- package/dist/work-intents.js +140 -0
- package/dist/work-items.d.ts +58 -0
- package/dist/work-items.js +86 -0
- package/dist/work-lock-check.d.ts +12 -0
- package/dist/work-lock-check.js +339 -0
- package/dist/work-locks.d.ts +10 -0
- package/dist/work-locks.js +98 -0
- package/dist/work-model.d.ts +119 -0
- package/dist/work-model.js +310 -0
- package/dist/work-review-git.d.ts +8 -0
- package/dist/work-review-git.js +111 -0
- package/dist/work-review.d.ts +26 -0
- package/dist/work-review.js +426 -0
- package/dist/work-switcher-model.d.ts +43 -0
- package/dist/work-switcher-model.js +79 -0
- package/dist/work-switcher.d.ts +6 -0
- package/dist/work-switcher.js +171 -0
- package/dist/working-cli.d.ts +1 -0
- package/dist/working-cli.js +33 -0
- package/dist/working-code.d.ts +74 -0
- package/dist/working-code.js +421 -0
- package/dist/workspace-notes.d.ts +71 -0
- package/dist/workspace-notes.js +177 -0
- package/dist/workspace-tests.d.ts +21 -0
- package/dist/workspace-tests.js +573 -0
- package/package.json +547 -4
- package/src/activity-volume.ts +149 -0
- package/src/annotations.ts +485 -0
- package/src/benchmark-cli.ts +118 -0
- package/src/benchmark-worker.ts +22 -0
- package/src/benchmarks.ts +493 -0
- package/src/bin.ts +54 -0
- package/src/block-cli.ts +106 -0
- package/src/block-documents.ts +117 -0
- package/src/change-impact.ts +280 -0
- package/src/check-source.ts +82 -0
- package/src/checks-model.ts +108 -0
- package/src/cli.ts +440 -0
- package/src/code-model.ts +159 -0
- package/src/code-store.ts +98 -0
- package/src/compare-artifact.ts +314 -0
- package/src/compare.ts +440 -0
- package/src/compiler.ts +1512 -0
- package/src/compose.ts +94 -0
- package/src/core.ts +361 -0
- package/src/coverage-cli.ts +52 -0
- package/src/declaration-sources.ts +69 -0
- package/src/declared-graph.ts +75 -0
- package/src/display-name.ts +8 -0
- package/src/error-heat.ts +161 -0
- package/src/evidence.ts +94 -0
- package/src/factory-graph.ts +462 -0
- package/src/factory-model.ts +82 -0
- package/src/git-code.ts +461 -0
- package/src/git-refs.ts +43 -0
- package/src/history-activity.ts +146 -0
- package/src/history-churn.ts +416 -0
- package/src/history-git.ts +163 -0
- package/src/history-ledger.ts +636 -0
- package/src/history-ownership.ts +116 -0
- package/src/history-source.ts +117 -0
- package/src/integrations-cli.ts +187 -0
- package/src/interface-map.ts +166 -0
- package/src/issue-cache.ts +96 -0
- package/src/issue-cli.ts +137 -0
- package/src/issue-links.ts +153 -0
- package/src/linear-issues.ts +154 -0
- package/src/local-runtime.ts +70 -0
- package/src/map-activity.ts +309 -0
- package/src/map-model.ts +213 -0
- package/src/map-quality.ts +66 -0
- package/src/mapping-coverage.ts +570 -0
- package/src/model.ts +228 -0
- package/src/operation-benchmark-worker.ts +60 -0
- package/src/operation-benchmark.ts +28 -0
- package/src/otel-metrics.ts +176 -0
- package/src/performance-model.ts +575 -0
- package/src/product-map.ts +271 -0
- package/src/provider-access.cjs +207 -0
- package/src/provider-access.d.cts +14 -0
- package/src/public-boundaries.ts +143 -0
- package/src/reports-cli.ts +125 -0
- package/src/reports-model.ts +73 -0
- package/src/reports.ts +276 -0
- package/src/repository-map.ts +191 -0
- package/src/resource-cache.ts +76 -0
- package/src/review-cli.ts +256 -0
- package/src/review.ts +376 -0
- package/src/runtime-metrics.ts +386 -0
- package/src/scope.ts +192 -0
- package/src/sentry-activity.ts +234 -0
- package/src/sentry.ts +545 -0
- package/src/service-release.ts +18 -0
- package/src/setup-cli.ts +58 -0
- package/src/setup-kit.cjs +163 -0
- package/src/setup-kit.d.cts +32 -0
- package/src/source-index.ts +208 -0
- package/src/source-review-git.ts +131 -0
- package/src/source-review.ts +736 -0
- package/src/telemetry.ts +68 -0
- package/src/time-window.ts +51 -0
- package/src/trace-evidence.ts +80 -0
- package/src/trace-model.ts +26 -0
- package/src/tracing.ts +165 -0
- package/src/work-check.ts +149 -0
- package/src/work-cli.ts +229 -0
- package/src/work-context.ts +753 -0
- package/src/work-intents.ts +196 -0
- package/src/work-items.ts +151 -0
- package/src/work-lock-check.ts +549 -0
- package/src/work-locks.ts +108 -0
- package/src/work-model.ts +466 -0
- package/src/work-review-git.ts +130 -0
- package/src/work-review.ts +573 -0
- package/src/work-switcher-model.ts +121 -0
- package/src/work-switcher.ts +191 -0
- package/src/working-cli.ts +38 -0
- package/src/working-code.ts +582 -0
- package/src/workspace-notes.ts +203 -0
- package/src/workspace-tests.ts +654 -0
- package/toolkit/GUIDE.md +354 -0
- package/toolkit/SKILL.md +142 -0
- package/toolkit/bin/fractory +2 -0
- package/toolkit/build.json +1 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { captureRepositoryCommit, readRepositoryMap } from "./repository-map.js";
|
|
2
|
+
import { runWorking } from "./working-cli.js";
|
|
3
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
4
|
+
import { dirname, resolve, join } from "node:path";
|
|
5
|
+
import { relatedTests } from "./model.js";
|
|
6
|
+
import { mapQuality } from "./map-quality.js";
|
|
7
|
+
import { logicalMap } from "./map-model.js";
|
|
8
|
+
import { annotatedFiles, compileFactory, factoryGraph } from "./compiler.js";
|
|
9
|
+
import { captureCode, codeChanges, changedPaths, codeHistory, loadCode, resolveCommit, saveCode, } from "./git-code.js";
|
|
10
|
+
import { locateCode } from "./code-model.js";
|
|
11
|
+
import { compareFactory, comparisonReport } from "./compare.js";
|
|
12
|
+
import { resolveComparisonRef, comparisonMergeBase } from "./git-code.js";
|
|
13
|
+
import { eventCommit, matchSentryEvent, SentryReader, } from "./sentry.js";
|
|
14
|
+
function historicalCode(root, store, ref, definitionFile) {
|
|
15
|
+
const commit = resolveCommit(root, ref);
|
|
16
|
+
const saved = loadCode(store, commit);
|
|
17
|
+
if (saved)
|
|
18
|
+
return saved;
|
|
19
|
+
const snapshot = captureRepositoryCommit(root, commit, definitionFile);
|
|
20
|
+
saveCode(store, snapshot, false);
|
|
21
|
+
return snapshot;
|
|
22
|
+
}
|
|
23
|
+
function repoRoot(path) {
|
|
24
|
+
let root = resolve(path);
|
|
25
|
+
while (!existsSync(join(root, ".git"))) {
|
|
26
|
+
const parent = dirname(root);
|
|
27
|
+
if (parent === root)
|
|
28
|
+
throw new Error("Run inside a Git repository, or supply --root");
|
|
29
|
+
root = parent;
|
|
30
|
+
}
|
|
31
|
+
return root;
|
|
32
|
+
}
|
|
33
|
+
export function run(args) {
|
|
34
|
+
const option = (name) => {
|
|
35
|
+
const i = args.indexOf(name);
|
|
36
|
+
if (i < 0)
|
|
37
|
+
return;
|
|
38
|
+
const value = args[i + 1];
|
|
39
|
+
if (!value || value.startsWith("--"))
|
|
40
|
+
throw new Error(`${name} needs a value`);
|
|
41
|
+
return value;
|
|
42
|
+
};
|
|
43
|
+
let definitionFile = option("--definition");
|
|
44
|
+
const root = definitionFile ||
|
|
45
|
+
args[0] === "compile" ||
|
|
46
|
+
args[0] === "help" ||
|
|
47
|
+
args.includes("--help")
|
|
48
|
+
? resolve(option("--root") || process.cwd())
|
|
49
|
+
: repoRoot(option("--root") || process.cwd());
|
|
50
|
+
const command = args[0] || "inspect", json = args.includes("--json");
|
|
51
|
+
if (!definitionFile && existsSync(join(root, "fractory.json")))
|
|
52
|
+
definitionFile = "fractory.json";
|
|
53
|
+
if (!definitionFile &&
|
|
54
|
+
command !== "compile" &&
|
|
55
|
+
command !== "help" &&
|
|
56
|
+
!args.includes("--help") &&
|
|
57
|
+
!readRepositoryMap(root))
|
|
58
|
+
throw Error("This repository has no Fractory map yet. Run fractory setup, annotate its real code, then compile fractory.json.");
|
|
59
|
+
if (command === "compare" && !args.includes("--help")) {
|
|
60
|
+
const base = option("--base") || "HEAD~1", head = option("--head") || "HEAD";
|
|
61
|
+
const baseCommit = resolveComparisonRef(root, base), headCommit = resolveComparisonRef(root, head);
|
|
62
|
+
const from = args.includes("--pr")
|
|
63
|
+
? comparisonMergeBase(root, baseCommit, headCommit)
|
|
64
|
+
: baseCommit;
|
|
65
|
+
const store = resolve(root, option("--store") || ".fractal");
|
|
66
|
+
if (args.includes("--footprint")) {
|
|
67
|
+
const graph = definitionFile
|
|
68
|
+
? JSON.parse(readFileSync(resolve(root, definitionFile), "utf8"))
|
|
69
|
+
: readRepositoryMap(root);
|
|
70
|
+
const value = {
|
|
71
|
+
schema: "fractal.footprint.v1",
|
|
72
|
+
graph: logicalMap(graph),
|
|
73
|
+
mappingRevision: definitionFile ? undefined : headCommit,
|
|
74
|
+
base: from,
|
|
75
|
+
head: headCommit,
|
|
76
|
+
title: option("--title"),
|
|
77
|
+
url: option("--url"),
|
|
78
|
+
files: changedPaths(root, from, headCommit),
|
|
79
|
+
};
|
|
80
|
+
const output = option("--write");
|
|
81
|
+
if (output) {
|
|
82
|
+
const path = resolve(root, output);
|
|
83
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
84
|
+
writeFileSync(path, JSON.stringify(value));
|
|
85
|
+
}
|
|
86
|
+
return JSON.stringify({
|
|
87
|
+
basis: definitionFile ? "current-map" : "head-source",
|
|
88
|
+
base: from,
|
|
89
|
+
head: headCommit,
|
|
90
|
+
files: value.files.length,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const before = historicalCode(root, store, from, definitionFile), after = historicalCode(root, store, headCommit, definitionFile);
|
|
94
|
+
const value = {
|
|
95
|
+
...compareFactory(before, after, codeChanges(root, before, after)),
|
|
96
|
+
...(option("--title")
|
|
97
|
+
? { context: { title: option("--title"), url: option("--url") } }
|
|
98
|
+
: {}),
|
|
99
|
+
range: {
|
|
100
|
+
base: baseCommit,
|
|
101
|
+
head: headCommit,
|
|
102
|
+
mode: args.includes("--pr") ? "pr" : "commits",
|
|
103
|
+
...(args.includes("--pr") ? { mergeBase: from } : {}),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
for (const [flag, content] of [
|
|
107
|
+
["--write", JSON.stringify(value, null, 2) + "\n"],
|
|
108
|
+
["--report", comparisonReport(value)],
|
|
109
|
+
]) {
|
|
110
|
+
const output = option(flag);
|
|
111
|
+
if (output) {
|
|
112
|
+
const file = resolve(root, output);
|
|
113
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
114
|
+
writeFileSync(file, content);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return JSON.stringify({
|
|
118
|
+
before: value.before.commit,
|
|
119
|
+
after: value.after.commit,
|
|
120
|
+
...value.summary,
|
|
121
|
+
}, null, 2);
|
|
122
|
+
}
|
|
123
|
+
if (command === "compile") {
|
|
124
|
+
const files = annotatedFiles(root, option("--include")?.split(","));
|
|
125
|
+
const model = compileFactory({
|
|
126
|
+
root,
|
|
127
|
+
files,
|
|
128
|
+
sdkSource: process.env.FRACTORY_SDK_SOURCE,
|
|
129
|
+
});
|
|
130
|
+
if (model.diagnostics.length)
|
|
131
|
+
throw new Error(model.diagnostics
|
|
132
|
+
.map((d) => `${d.file}:${d.line}: ${d.message}`)
|
|
133
|
+
.join("\n"));
|
|
134
|
+
if (!model.blocks.length)
|
|
135
|
+
throw Error("No Fractory declarations found. Annotate existing code with Block, Interface, Method or Process; use --include for source folders outside apps, packages or src.");
|
|
136
|
+
const value = args.includes("--graph") ? factoryGraph(model) : model;
|
|
137
|
+
const output = JSON.stringify(value, null, 2) + "\n";
|
|
138
|
+
if (args.includes("--check")) {
|
|
139
|
+
if (!option("--write"))
|
|
140
|
+
throw Error("compile --check needs --write PATH naming the saved compiler output");
|
|
141
|
+
const file = resolve(root, option("--write"));
|
|
142
|
+
if (!existsSync(file) ||
|
|
143
|
+
JSON.stringify(JSON.parse(readFileSync(file, "utf8"))) !==
|
|
144
|
+
JSON.stringify(value))
|
|
145
|
+
throw Error("The factory map is stale. Regenerate it with the same compile command without --check.");
|
|
146
|
+
return `Factory map matches source: ${files.length} annotated files.`;
|
|
147
|
+
}
|
|
148
|
+
if (option("--write")) {
|
|
149
|
+
const file = resolve(root, option("--write"));
|
|
150
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
151
|
+
writeFileSync(file, output);
|
|
152
|
+
}
|
|
153
|
+
return output;
|
|
154
|
+
}
|
|
155
|
+
if (command === "help" || args.includes("--help"))
|
|
156
|
+
return "Fractory\n\n fractory setup [--install-skill]\n fractory doctor\n fractory guide\n fractory open [--block ID]\n fractory compile --include src --graph --write fractory.json [--check]\n fractory inspect [element-id] --json\n fractory check\n fractory quality --json\n fractory coverage --missing --json\n fractory block BLOCK_ID --docs\n fractory tests --block BLOCK_ID [--source | --run] [--file PATH]\n fractory reports [list|create|show|read|unread] --help\n fractory benchmark --block BLOCK_ID [--file PATH] [--run] [--baseline RUN_ID]\n fractory snapshot\n fractory locate --file PATH --line N\n fractory history [element-id]\n fractory working --json\n fractory work [list|create|show|plan|intent|handoff|check|review|pr|open] --help\n fractory changes --from SHA --to SHA\n fractory review [--pr NUMBER | --base REF --head REF] --open\n fractory compare --base REF --head REF [--pr] [--footprint] [--write comparison.json]\n fractory sentry --project slug --event event-id\n\nRun from the selected Git repository, or supply --root PATH. A root fractory.json is detected automatically; --definition PATH selects another generated definition. Setup and provider connections are described in fractory guide. Tests execute only with --run. Compile reads source without importing application code.";
|
|
157
|
+
if (![
|
|
158
|
+
"inspect",
|
|
159
|
+
"scan",
|
|
160
|
+
"check",
|
|
161
|
+
"quality",
|
|
162
|
+
"tests",
|
|
163
|
+
"snapshot",
|
|
164
|
+
"history",
|
|
165
|
+
"changes",
|
|
166
|
+
"locate",
|
|
167
|
+
"sentry",
|
|
168
|
+
].includes(command))
|
|
169
|
+
throw new Error(`Unknown command: ${command}`);
|
|
170
|
+
const provided = definitionFile
|
|
171
|
+
? JSON.parse(readFileSync(resolve(root, definitionFile), "utf8"))
|
|
172
|
+
: undefined;
|
|
173
|
+
if (provided &&
|
|
174
|
+
(provided.schema !== "fractal.definition.v1" ||
|
|
175
|
+
!Array.isArray(provided.elements) ||
|
|
176
|
+
!provided.elements.some((node) => node.id === provided.id) ||
|
|
177
|
+
!Array.isArray(provided.connections) ||
|
|
178
|
+
!Array.isArray(provided.tests) ||
|
|
179
|
+
!Array.isArray(provided.failures) ||
|
|
180
|
+
!Array.isArray(provided.gaps)))
|
|
181
|
+
throw new Error("Expected a Fractal definition graph");
|
|
182
|
+
let graph = provided || readRepositoryMap(root);
|
|
183
|
+
if (!graph)
|
|
184
|
+
throw Error("No Fractory map in this repository. Run fractory setup.");
|
|
185
|
+
if (command === "quality") {
|
|
186
|
+
const report = mapQuality(graph);
|
|
187
|
+
return json
|
|
188
|
+
? JSON.stringify(report, null, 2)
|
|
189
|
+
: [
|
|
190
|
+
...report.areas.map((area) => `${area.connected ? "✓" : "?"} ${area.label} · ${area.parts} parts`),
|
|
191
|
+
"",
|
|
192
|
+
`${report.problems.length} structural problems · ${report.missingPurpose.length} missing descriptions · ${report.noMappedInteractions.length} parts with no mapped interactions`,
|
|
193
|
+
"No mapped interactions is an evidence gap, not proof that code is unused. Use --json for identities.",
|
|
194
|
+
].join("\n");
|
|
195
|
+
}
|
|
196
|
+
if (command === "check") {
|
|
197
|
+
const problems = mapQuality(graph).problems;
|
|
198
|
+
if (problems.length)
|
|
199
|
+
throw Error(`Invalid factory map: ${JSON.stringify(problems)}`);
|
|
200
|
+
return "Factory map structure is valid. Use compile --graph --write fractory.json --check to verify source freshness.";
|
|
201
|
+
}
|
|
202
|
+
const id = args[1] && !args[1].startsWith("--") ? args[1] : graph.id;
|
|
203
|
+
if (["snapshot", "history", "changes", "locate", "sentry"].includes(command)) {
|
|
204
|
+
const store = resolve(root, option("--store") || ".fractal");
|
|
205
|
+
let result;
|
|
206
|
+
if (command === "snapshot") {
|
|
207
|
+
const imported = option("--import");
|
|
208
|
+
const commit = option("--commit");
|
|
209
|
+
const snapshot = commit
|
|
210
|
+
? historicalCode(root, store, commit, definitionFile)
|
|
211
|
+
: imported
|
|
212
|
+
? loadCode(resolve(root, imported))
|
|
213
|
+
: captureCode(root, graph, join(store, "index"));
|
|
214
|
+
if (!snapshot)
|
|
215
|
+
throw new Error("No valid current snapshot in the imported artifact directory");
|
|
216
|
+
saveCode(store, snapshot, !imported && !commit);
|
|
217
|
+
result = {
|
|
218
|
+
snapshot: snapshot.id,
|
|
219
|
+
commit: snapshot.commit,
|
|
220
|
+
baseCommit: snapshot.baseCommit,
|
|
221
|
+
files: Object.keys(snapshot.files).length,
|
|
222
|
+
gaps: snapshot.gaps.length,
|
|
223
|
+
store,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
else if (command === "changes") {
|
|
227
|
+
const from = option("--from"), to = option("--to");
|
|
228
|
+
if (!from || !to)
|
|
229
|
+
throw new Error("changes requires --from and --to");
|
|
230
|
+
const before = historicalCode(root, store, from, definitionFile), after = historicalCode(root, store, to, definitionFile);
|
|
231
|
+
if (!before || !after)
|
|
232
|
+
throw new Error("Capture factory snapshots at both commits first; historical ownership is never inferred from current source");
|
|
233
|
+
result = codeChanges(root, before, after);
|
|
234
|
+
}
|
|
235
|
+
else if (command === "sentry") {
|
|
236
|
+
let event;
|
|
237
|
+
const file = option("--event-file");
|
|
238
|
+
if (file)
|
|
239
|
+
event = JSON.parse(readFileSync(resolve(root, file), "utf8"));
|
|
240
|
+
else
|
|
241
|
+
throw new Error("Network Sentry reads use runSentry; use --event-file with the synchronous CLI API");
|
|
242
|
+
const commit = eventCommit(event);
|
|
243
|
+
let snapshot;
|
|
244
|
+
try {
|
|
245
|
+
if (commit)
|
|
246
|
+
snapshot = historicalCode(root, store, commit, definitionFile);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
/* No historical definition available. */
|
|
250
|
+
}
|
|
251
|
+
result = matchSentryEvent(event, snapshot);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
const commit = option("--commit");
|
|
255
|
+
const snapshot = commit
|
|
256
|
+
? historicalCode(root, store, commit, definitionFile)
|
|
257
|
+
: loadCode(store) || captureCode(root, graph);
|
|
258
|
+
if (command === "history")
|
|
259
|
+
result = codeHistory(root, snapshot, id);
|
|
260
|
+
else {
|
|
261
|
+
const file = option("--file"), line = Number(option("--line"));
|
|
262
|
+
if (!file || !line)
|
|
263
|
+
throw new Error("locate requires --file and --line");
|
|
264
|
+
result = locateCode(snapshot, file, line);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return JSON.stringify(result, null, 2);
|
|
268
|
+
}
|
|
269
|
+
if (command === "scan") {
|
|
270
|
+
const output = option("--write");
|
|
271
|
+
if (output) {
|
|
272
|
+
const path = resolve(root, output);
|
|
273
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
274
|
+
writeFileSync(path, JSON.stringify(graph, null, 2) + "\n");
|
|
275
|
+
}
|
|
276
|
+
return json
|
|
277
|
+
? JSON.stringify(graph, null, 2)
|
|
278
|
+
: `${graph.scope}\nDefinition ${graph.revision}\n${graph.elements.length} elements · ${graph.connections.length} relationships · ${graph.tests.length} tests not run\n${graph.gaps.length} source gaps${output ? `\nWrote ${output}` : ""}`;
|
|
279
|
+
}
|
|
280
|
+
graph = logicalMap(graph);
|
|
281
|
+
const selectedId = graph.aliases?.[id] || id;
|
|
282
|
+
const element = graph.elements.find((n) => n.id === selectedId || n.source?.symbol === id || n.contract?.id === id);
|
|
283
|
+
if (!element)
|
|
284
|
+
throw new Error(`Unknown element: ${id}`);
|
|
285
|
+
if (command === "tests") {
|
|
286
|
+
if (!args.includes("--plan"))
|
|
287
|
+
throw new Error("Only test planning is supported. Use the repository runner to execute the selected tests.");
|
|
288
|
+
const tests = relatedTests(graph, element.id);
|
|
289
|
+
const associations = [...new Set(tests.map((test) => test.association))];
|
|
290
|
+
return json
|
|
291
|
+
? JSON.stringify({
|
|
292
|
+
definition: graph.revision,
|
|
293
|
+
association: associations.length === 1 ? associations[0] : "mixed",
|
|
294
|
+
executed: false,
|
|
295
|
+
tests,
|
|
296
|
+
}, null, 2)
|
|
297
|
+
: `TEST PLAN ${element.label}\nAssociation: explicit attachments, contract references or source imports; not execution coverage\n\n${tests.map((t) => `○ ${t.name}\n ${t.source.file}:${t.source.line}`).join("\n")}\n\n${tests.length} selected · 0 executed`;
|
|
298
|
+
}
|
|
299
|
+
const result = {
|
|
300
|
+
definition: graph.revision,
|
|
301
|
+
element,
|
|
302
|
+
inside: graph.elements.filter((n) => n.parent === element.id),
|
|
303
|
+
connections: graph.connections.filter((e) => e.source === element.id || e.target === element.id),
|
|
304
|
+
tests: relatedTests(graph, element.id),
|
|
305
|
+
gaps: graph.gaps.filter((g) => g.source.file === element.source?.file),
|
|
306
|
+
};
|
|
307
|
+
return json
|
|
308
|
+
? JSON.stringify(result, null, 2)
|
|
309
|
+
: `${element.kind.toUpperCase()} ${element.label}\n${element.id}\n${element.description || ""}\n${element.source ? `${element.source.file}:${element.source.line}\n` : ""}\nINSIDE\n${result.inside.map((n) => ` ${n.kind.padEnd(11)} ${n.label}\n ${n.id}`).join("\n")}\n\n${result.connections.length} direct relationships · ${result.tests.length} related tests (not run)`;
|
|
310
|
+
}
|
|
311
|
+
export async function runSentry(args) {
|
|
312
|
+
const option = (name) => {
|
|
313
|
+
const i = args.indexOf(name);
|
|
314
|
+
return i < 0 ? undefined : args[i + 1];
|
|
315
|
+
};
|
|
316
|
+
const token = process.env.FRACTAL_SENTRY_TOKEN || process.env.SENTRY_AUTH_TOKEN, org = process.env.FRACTAL_SENTRY_ORG || process.env.SENTRY_ORG, project = option("--project");
|
|
317
|
+
if (!token || !org || !project)
|
|
318
|
+
throw new Error("Set a server-side SENTRY_AUTH_TOKEN and FRACTAL_SENTRY_ORG, and supply --project");
|
|
319
|
+
const reader = new SentryReader({
|
|
320
|
+
token,
|
|
321
|
+
org,
|
|
322
|
+
projects: [project],
|
|
323
|
+
baseUrl: process.env.SENTRY_BASE_URL,
|
|
324
|
+
});
|
|
325
|
+
const eventId = option("--event"), issue = option("--issue");
|
|
326
|
+
const data = eventId
|
|
327
|
+
? await reader.event(project, eventId)
|
|
328
|
+
: issue
|
|
329
|
+
? await reader.issueEvent(project, issue)
|
|
330
|
+
: await reader.issues(project);
|
|
331
|
+
if (Array.isArray(data))
|
|
332
|
+
return JSON.stringify(data, null, 2);
|
|
333
|
+
const commit = eventCommit(data), root = resolve(option("--root") || process.cwd());
|
|
334
|
+
let snapshot;
|
|
335
|
+
try {
|
|
336
|
+
if (commit)
|
|
337
|
+
snapshot = historicalCode(root, resolve(root, option("--store") || ".fractal"), commit, option("--definition"));
|
|
338
|
+
}
|
|
339
|
+
catch {
|
|
340
|
+
/* No historical definition available. */
|
|
341
|
+
}
|
|
342
|
+
return JSON.stringify(matchSentryEvent(data, snapshot), null, 2);
|
|
343
|
+
}
|
|
344
|
+
if (import.meta.main) {
|
|
345
|
+
try {
|
|
346
|
+
const args = process.argv.slice(2);
|
|
347
|
+
console.log(args[0] === "working" && !args.includes("--help")
|
|
348
|
+
? await runWorking(args)
|
|
349
|
+
: args[0] === "sentry" &&
|
|
350
|
+
!args.includes("--event-file") &&
|
|
351
|
+
!args.includes("--help")
|
|
352
|
+
? await runSentry(args)
|
|
353
|
+
: run(args));
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
console.error(`fractory: ${error instanceof Error ? error.message : String(error)}`);
|
|
357
|
+
process.exitCode = 1;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DefinitionGraph } from "./model.js";
|
|
2
|
+
/** Portable build artifact. No Git executable or TypeScript parser is needed to read it. */
|
|
3
|
+
export interface CodeSnapshot {
|
|
4
|
+
schema: "fractal.code.v1";
|
|
5
|
+
id: string;
|
|
6
|
+
/** Only populated for a clean checkout. Never label working changes as HEAD. */
|
|
7
|
+
commit: string | null;
|
|
8
|
+
baseCommit: string;
|
|
9
|
+
capturedAt: string;
|
|
10
|
+
graph: DefinitionGraph;
|
|
11
|
+
files: Record<string, {
|
|
12
|
+
digest: string;
|
|
13
|
+
ranges: {
|
|
14
|
+
elementId: string;
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
basis: "syntax" | "anchor" | "file";
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
gaps: {
|
|
21
|
+
elementId: string;
|
|
22
|
+
file: string;
|
|
23
|
+
reason: string;
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
export type CodeMatch = {
|
|
27
|
+
status: "matched" | "ambiguous" | "unmapped" | "version_unavailable";
|
|
28
|
+
elementIds: string[];
|
|
29
|
+
file?: string;
|
|
30
|
+
line?: number;
|
|
31
|
+
reason?: string;
|
|
32
|
+
};
|
|
33
|
+
/** A full commit identity is deliberate: a release label or short SHA is not proof. */
|
|
34
|
+
export declare function commitFromRelease(release: string | undefined): string | undefined;
|
|
35
|
+
/** Source maps may add a build root. Require a unique complete repository path suffix. */
|
|
36
|
+
export declare function sourcePath(path: string, files: CodeSnapshot["files"]): string | undefined;
|
|
37
|
+
export declare function locateCode(snapshot: CodeSnapshot, path: string, line: number): CodeMatch;
|
|
38
|
+
export declare function blockFiles(snapshot: CodeSnapshot, id: string): string[];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** A full commit identity is deliberate: a release label or short SHA is not proof. */
|
|
2
|
+
export function commitFromRelease(release) {
|
|
3
|
+
return release
|
|
4
|
+
?.match(/(?:^|[@+])([a-f0-9]{40}|[a-f0-9]{64})$/i)?.[1]
|
|
5
|
+
.toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
/** Source maps may add a build root. Require a unique complete repository path suffix. */
|
|
8
|
+
export function sourcePath(path, files) {
|
|
9
|
+
const clean = path.replace(/\\/g, "/").replace(/[?#].*$/, "");
|
|
10
|
+
const candidates = Object.keys(files).filter((file) => clean === file || clean.endsWith(`/${file}`));
|
|
11
|
+
return candidates.length === 1 ? candidates[0] : undefined;
|
|
12
|
+
}
|
|
13
|
+
export function locateCode(snapshot, path, line) {
|
|
14
|
+
const file = sourcePath(path, snapshot.files);
|
|
15
|
+
if (!file || !Number.isSafeInteger(line) || line < 1)
|
|
16
|
+
return {
|
|
17
|
+
status: "unmapped",
|
|
18
|
+
elementIds: [],
|
|
19
|
+
reason: "No indexed source location",
|
|
20
|
+
};
|
|
21
|
+
const matching = snapshot.files[file].ranges.filter((r) => r.start <= line && r.end >= line);
|
|
22
|
+
// Module membership is a fallback. A real declaration at this line always
|
|
23
|
+
// wins, even when that declaration belongs to another logical branch.
|
|
24
|
+
const precise = matching.filter((range) => range.basis !== "file");
|
|
25
|
+
const covering = precise.length ? precise : matching;
|
|
26
|
+
// A parent may describe the same syntax span as its child; ownership belongs to the child.
|
|
27
|
+
const byId = new Map(snapshot.graph.elements.map((node) => [node.id, node]));
|
|
28
|
+
// Declared executable boundaries supersede overlapping bootstrap review ownership.
|
|
29
|
+
// Keep reviewed evidence visible in the map without assigning the same frame twice.
|
|
30
|
+
const authoritative = covering.some((range) => {
|
|
31
|
+
const node = byId.get(range.elementId);
|
|
32
|
+
return (node?.provenance === "declared" &&
|
|
33
|
+
(node.kind === "method" || node.kind === "process"));
|
|
34
|
+
});
|
|
35
|
+
const candidates = (authoritative
|
|
36
|
+
? covering.filter((range) => byId.get(range.elementId)?.provenance === "declared")
|
|
37
|
+
: covering).map((range) => ({
|
|
38
|
+
...range,
|
|
39
|
+
elementId: byId.get(range.elementId)?.implementationBlock || range.elementId,
|
|
40
|
+
}));
|
|
41
|
+
const ancestorOf = (ancestor, child) => {
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
let parent = byId.get(child)?.parent;
|
|
44
|
+
while (parent && !seen.has(parent)) {
|
|
45
|
+
if (parent === ancestor)
|
|
46
|
+
return true;
|
|
47
|
+
seen.add(parent);
|
|
48
|
+
parent = byId.get(parent)?.parent;
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
const owners = [
|
|
53
|
+
...new Set(candidates
|
|
54
|
+
.filter((r) => !candidates.some((other) => other.elementId !== r.elementId &&
|
|
55
|
+
ancestorOf(r.elementId, other.elementId)))
|
|
56
|
+
.map((r) => r.elementId)),
|
|
57
|
+
];
|
|
58
|
+
return {
|
|
59
|
+
status: owners.length === 1
|
|
60
|
+
? "matched"
|
|
61
|
+
: owners.length
|
|
62
|
+
? "ambiguous"
|
|
63
|
+
: "unmapped",
|
|
64
|
+
elementIds: owners,
|
|
65
|
+
file,
|
|
66
|
+
line,
|
|
67
|
+
...(owners.length === 1 && !precise.length && covering.length
|
|
68
|
+
? {
|
|
69
|
+
reason: "Block source ownership; no finer declaration mapped at this line",
|
|
70
|
+
}
|
|
71
|
+
: {}),
|
|
72
|
+
...(owners.length !== 1
|
|
73
|
+
? {
|
|
74
|
+
reason: owners.length
|
|
75
|
+
? "Several blocks share this source span"
|
|
76
|
+
: "Outside mapped source spans",
|
|
77
|
+
}
|
|
78
|
+
: {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function blockFiles(snapshot, id) {
|
|
82
|
+
const ids = new Set([id]);
|
|
83
|
+
for (let changed = true; changed;) {
|
|
84
|
+
changed = false;
|
|
85
|
+
for (const node of snapshot.graph.elements)
|
|
86
|
+
if (node.parent && ids.has(node.parent) && !ids.has(node.id)) {
|
|
87
|
+
ids.add(node.id);
|
|
88
|
+
changed = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return Object.entries(snapshot.files)
|
|
92
|
+
.filter(([, file]) => file.ranges.some((r) => ids.has(r.elementId)))
|
|
93
|
+
.map(([file]) => file);
|
|
94
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CodeSnapshot } from "./code-model.js";
|
|
2
|
+
/** Each commit points to one immutable artifact. Git already stores the actual code/history. */
|
|
3
|
+
export declare function saveCode(directory: string, snapshot: CodeSnapshot, makeCurrent?: boolean): void;
|
|
4
|
+
export declare function codeTimeline(directory: string): {
|
|
5
|
+
commit: string;
|
|
6
|
+
id: string;
|
|
7
|
+
capturedAt: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare function loadCode(directory: string, commit?: string): CodeSnapshot | undefined;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { existsSync, readFileSync, mkdirSync, writeFileSync, renameSync, } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/** Each commit points to one immutable artifact. Git already stores the actual code/history. */
|
|
4
|
+
export function saveCode(directory, snapshot, makeCurrent = true) {
|
|
5
|
+
if (!/^[a-f0-9]{64}$/.test(snapshot.id) ||
|
|
6
|
+
!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(snapshot.baseCommit) ||
|
|
7
|
+
(snapshot.commit &&
|
|
8
|
+
(!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(snapshot.commit) ||
|
|
9
|
+
snapshot.graph.codeRevision !== snapshot.commit)))
|
|
10
|
+
throw new Error("Invalid snapshot identity");
|
|
11
|
+
mkdirSync(join(directory, "objects"), { recursive: true });
|
|
12
|
+
mkdirSync(join(directory, "commits"), { recursive: true });
|
|
13
|
+
const file = join(directory, "objects", `${snapshot.id}.json`);
|
|
14
|
+
if (!existsSync(file))
|
|
15
|
+
writeFileSync(file, JSON.stringify(snapshot));
|
|
16
|
+
if (snapshot.commit) {
|
|
17
|
+
const ref = join(directory, "commits", snapshot.commit);
|
|
18
|
+
if (existsSync(ref) && readFileSync(ref, "utf8").trim() !== snapshot.id)
|
|
19
|
+
throw new Error("This commit already has a different factory snapshot; preserve the original artifact");
|
|
20
|
+
writeFileSync(ref, snapshot.id);
|
|
21
|
+
const entries = codeTimeline(directory);
|
|
22
|
+
if (!entries.some((entry) => entry.commit === snapshot.commit)) {
|
|
23
|
+
entries.unshift({
|
|
24
|
+
commit: snapshot.commit,
|
|
25
|
+
id: snapshot.id,
|
|
26
|
+
capturedAt: snapshot.capturedAt,
|
|
27
|
+
});
|
|
28
|
+
const timeline = join(directory, `timeline.${process.pid}.tmp`);
|
|
29
|
+
writeFileSync(timeline, JSON.stringify(entries));
|
|
30
|
+
renameSync(timeline, join(directory, "timeline.json"));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (makeCurrent) {
|
|
34
|
+
const temporary = join(directory, `current.${process.pid}.tmp`);
|
|
35
|
+
writeFileSync(temporary, JSON.stringify({ id: snapshot.id }));
|
|
36
|
+
renameSync(temporary, join(directory, "current.json"));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function codeTimeline(directory) {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(readFileSync(join(directory, "timeline.json"), "utf8"));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
const current = loadCode(directory);
|
|
45
|
+
return current?.commit
|
|
46
|
+
? [
|
|
47
|
+
{
|
|
48
|
+
commit: current.commit,
|
|
49
|
+
id: current.id,
|
|
50
|
+
capturedAt: current.capturedAt,
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
: [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function loadCode(directory, commit) {
|
|
57
|
+
if (commit && !/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(commit))
|
|
58
|
+
return;
|
|
59
|
+
try {
|
|
60
|
+
const id = commit
|
|
61
|
+
? readFileSync(join(directory, "commits", commit), "utf8").trim()
|
|
62
|
+
: JSON.parse(readFileSync(join(directory, "current.json"), "utf8"))
|
|
63
|
+
.id;
|
|
64
|
+
if (id && !/^[a-f0-9]{64}$/.test(id))
|
|
65
|
+
return;
|
|
66
|
+
if (!id)
|
|
67
|
+
return;
|
|
68
|
+
const value = JSON.parse(readFileSync(join(directory, "objects", `${id}.json`), "utf8"));
|
|
69
|
+
if (value.schema !== "fractal.code.v1" ||
|
|
70
|
+
value.id !== id ||
|
|
71
|
+
(value.commit && value.graph.codeRevision !== value.commit) ||
|
|
72
|
+
(commit && value.commit !== commit))
|
|
73
|
+
return;
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FactoryComparison } from "./compare.js";
|
|
2
|
+
import type { FactoryFootprint } from "./review.js";
|
|
3
|
+
/** CI reports contain data only. Strip unknown fields and never execute imported code. */
|
|
4
|
+
export declare function readComparisonReport(value: unknown): FactoryComparison;
|
|
5
|
+
/** File-only reports never pretend to contain a historical factory. Reuse the graph safety checks. */
|
|
6
|
+
export declare function readFootprintReport(value: unknown): FactoryFootprint;
|