@spikedpunch/align-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/baseline/fingerprint.d.ts +19 -0
- package/dist/baseline/fingerprint.d.ts.map +1 -0
- package/dist/baseline/fingerprint.js +0 -0
- package/dist/baseline/fingerprint.js.map +1 -0
- package/dist/baseline/store.d.ts +81 -0
- package/dist/baseline/store.d.ts.map +1 -0
- package/dist/baseline/store.js +111 -0
- package/dist/baseline/store.js.map +1 -0
- package/dist/build/diff.d.ts +22 -0
- package/dist/build/diff.d.ts.map +1 -0
- package/dist/build/diff.js +61 -0
- package/dist/build/diff.js.map +1 -0
- package/dist/build/export-ir.d.ts +11 -0
- package/dist/build/export-ir.d.ts.map +1 -0
- package/dist/build/export-ir.js +4 -0
- package/dist/build/export-ir.js.map +1 -0
- package/dist/build/ground.d.ts +32 -0
- package/dist/build/ground.d.ts.map +1 -0
- package/dist/build/ground.js +162 -0
- package/dist/build/ground.js.map +1 -0
- package/dist/build/hash.d.ts +10 -0
- package/dist/build/hash.d.ts.map +1 -0
- package/dist/build/hash.js +13 -0
- package/dist/build/hash.js.map +1 -0
- package/dist/build/impact.d.ts +20 -0
- package/dist/build/impact.d.ts.map +1 -0
- package/dist/build/impact.js +15 -0
- package/dist/build/impact.js.map +1 -0
- package/dist/build/index.d.ts +14 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +14 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/merge.d.ts +27 -0
- package/dist/build/merge.d.ts.map +1 -0
- package/dist/build/merge.js +85 -0
- package/dist/build/merge.js.map +1 -0
- package/dist/build/propose.d.ts +16 -0
- package/dist/build/propose.d.ts.map +1 -0
- package/dist/build/propose.js +126 -0
- package/dist/build/propose.js.map +1 -0
- package/dist/build/provenance.d.ts +19 -0
- package/dist/build/provenance.d.ts.map +1 -0
- package/dist/build/provenance.js +23 -0
- package/dist/build/provenance.js.map +1 -0
- package/dist/build/schema.d.ts +1825 -0
- package/dist/build/schema.d.ts.map +1 -0
- package/dist/build/schema.js +128 -0
- package/dist/build/schema.js.map +1 -0
- package/dist/build/sections.d.ts +30 -0
- package/dist/build/sections.d.ts.map +1 -0
- package/dist/build/sections.js +58 -0
- package/dist/build/sections.js.map +1 -0
- package/dist/build/tier1.d.ts +24 -0
- package/dist/build/tier1.d.ts.map +1 -0
- package/dist/build/tier1.js +68 -0
- package/dist/build/tier1.js.map +1 -0
- package/dist/build/tier2.d.ts +42 -0
- package/dist/build/tier2.d.ts.map +1 -0
- package/dist/build/tier2.js +187 -0
- package/dist/build/tier2.js.map +1 -0
- package/dist/build/types.d.ts +42 -0
- package/dist/build/types.d.ts.map +1 -0
- package/dist/build/types.js +2 -0
- package/dist/build/types.js.map +1 -0
- package/dist/components/glob.d.ts +10 -0
- package/dist/components/glob.d.ts.map +1 -0
- package/dist/components/glob.js +52 -0
- package/dist/components/glob.js.map +1 -0
- package/dist/components/registry.d.ts +51 -0
- package/dist/components/registry.d.ts.map +1 -0
- package/dist/components/registry.js +121 -0
- package/dist/components/registry.js.map +1 -0
- package/dist/dsl/factories.d.ts +86 -0
- package/dist/dsl/factories.d.ts.map +1 -0
- package/dist/dsl/factories.js +145 -0
- package/dist/dsl/factories.js.map +1 -0
- package/dist/dsl/index.d.ts +46 -0
- package/dist/dsl/index.d.ts.map +1 -0
- package/dist/dsl/index.js +67 -0
- package/dist/dsl/index.js.map +1 -0
- package/dist/dsl/reserved-names.typecheck.d.ts +2 -0
- package/dist/dsl/reserved-names.typecheck.d.ts.map +1 -0
- package/dist/dsl/reserved-names.typecheck.js +16 -0
- package/dist/dsl/reserved-names.typecheck.js.map +1 -0
- package/dist/dsl/verb-manifest.d.ts +12 -0
- package/dist/dsl/verb-manifest.d.ts.map +1 -0
- package/dist/dsl/verb-manifest.js +101 -0
- package/dist/dsl/verb-manifest.js.map +1 -0
- package/dist/fix/apply.d.ts +67 -0
- package/dist/fix/apply.d.ts.map +1 -0
- package/dist/fix/apply.js +163 -0
- package/dist/fix/apply.js.map +1 -0
- package/dist/fix/index.d.ts +3 -0
- package/dist/fix/index.d.ts.map +1 -0
- package/dist/fix/index.js +3 -0
- package/dist/fix/index.js.map +1 -0
- package/dist/fix/schema.d.ts +180 -0
- package/dist/fix/schema.d.ts.map +1 -0
- package/dist/fix/schema.js +41 -0
- package/dist/fix/schema.js.map +1 -0
- package/dist/gates/advisories.d.ts +11 -0
- package/dist/gates/advisories.d.ts.map +1 -0
- package/dist/gates/advisories.js +27 -0
- package/dist/gates/advisories.js.map +1 -0
- package/dist/gates/types.d.ts +36 -0
- package/dist/gates/types.d.ts.map +1 -0
- package/dist/gates/types.js +8 -0
- package/dist/gates/types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +51 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +304 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/payload/builder.d.ts +49 -0
- package/dist/payload/builder.d.ts.map +1 -0
- package/dist/payload/builder.js +61 -0
- package/dist/payload/builder.js.map +1 -0
- package/dist/payload/mermaid.d.ts +22 -0
- package/dist/payload/mermaid.d.ts.map +1 -0
- package/dist/payload/mermaid.js +89 -0
- package/dist/payload/mermaid.js.map +1 -0
- package/dist/plugin/registry.d.ts +24 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/registry.js +24 -0
- package/dist/plugin/registry.js.map +1 -0
- package/dist/rules/component-refs.d.ts +26 -0
- package/dist/rules/component-refs.d.ts.map +1 -0
- package/dist/rules/component-refs.js +81 -0
- package/dist/rules/component-refs.js.map +1 -0
- package/dist/rules/evaluators.d.ts +50 -0
- package/dist/rules/evaluators.d.ts.map +1 -0
- package/dist/rules/evaluators.js +236 -0
- package/dist/rules/evaluators.js.map +1 -0
- package/dist/rules/host-rules.d.ts +109 -0
- package/dist/rules/host-rules.d.ts.map +1 -0
- package/dist/rules/host-rules.js +152 -0
- package/dist/rules/host-rules.js.map +1 -0
- package/dist/rules/index.d.ts +7 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +7 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/manifest-evaluators.d.ts +32 -0
- package/dist/rules/manifest-evaluators.d.ts.map +1 -0
- package/dist/rules/manifest-evaluators.js +124 -0
- package/dist/rules/manifest-evaluators.js.map +1 -0
- package/dist/rules/rule-category.d.ts +13 -0
- package/dist/rules/rule-category.d.ts.map +1 -0
- package/dist/rules/rule-category.js +27 -0
- package/dist/rules/rule-category.js.map +1 -0
- package/dist/rules/tarjan.d.ts +9 -0
- package/dist/rules/tarjan.d.ts.map +1 -0
- package/dist/rules/tarjan.js +102 -0
- package/dist/rules/tarjan.js.map +1 -0
- package/dist/scanner.d.ts +12 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +2 -0
- package/dist/scanner.js.map +1 -0
- package/dist/telemetry/diff.d.ts +27 -0
- package/dist/telemetry/diff.d.ts.map +1 -0
- package/dist/telemetry/diff.js +54 -0
- package/dist/telemetry/diff.js.map +1 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +4 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/serialize.d.ts +10 -0
- package/dist/telemetry/serialize.d.ts.map +1 -0
- package/dist/telemetry/serialize.js +11 -0
- package/dist/telemetry/serialize.js.map +1 -0
- package/dist/telemetry/types.d.ts +138 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/types.js +3 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/types/branded.d.ts +26 -0
- package/dist/types/branded.d.ts.map +1 -0
- package/dist/types/branded.js +24 -0
- package/dist/types/branded.js.map +1 -0
- package/dist/types/graph.d.ts +46 -0
- package/dist/types/graph.d.ts.map +1 -0
- package/dist/types/graph.js +2 -0
- package/dist/types/graph.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/ir.d.ts +1747 -0
- package/dist/types/ir.d.ts.map +1 -0
- package/dist/types/ir.js +120 -0
- package/dist/types/ir.js.map +1 -0
- package/dist/types/manifest.d.ts +58 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +2 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/violation.d.ts +94 -0
- package/dist/types/violation.d.ts.map +1 -0
- package/dist/types/violation.js +56 -0
- package/dist/types/violation.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `security.manifest.*` evaluators (ADR 013) — pure functions over a `ManifestInventory`, the
|
|
3
|
+
* disjoint sibling of `evaluators.ts`'s graph-based `RuleEvaluator` family. Same discipline: no
|
|
4
|
+
* I/O, no mutation, fully testable with plain data (CODING_BEST_PRACTICES.md §14).
|
|
5
|
+
*/
|
|
6
|
+
import { toRuleId } from '../types/branded.js';
|
|
7
|
+
import { computeFingerprint } from '../baseline/fingerprint.js';
|
|
8
|
+
import { becauseField } from './evaluators.js';
|
|
9
|
+
/** git/http(s)/file/link — not registry, not `workspace:`, not an `npm:` alias (an alias still
|
|
10
|
+
* resolves through the registry under a different name, so it correctly never matches here). Same
|
|
11
|
+
* pattern spike/MANIFEST_PROBE_REPORT.md Rule 1 verified 3/3 real, 0 false positives against n8n. */
|
|
12
|
+
function classifySourceType(specifier) {
|
|
13
|
+
if (/^https?:\/\//.test(specifier))
|
|
14
|
+
return 'http';
|
|
15
|
+
if (/^(git\+|git:|github:|gitlab:|bitbucket:)/.test(specifier))
|
|
16
|
+
return 'git';
|
|
17
|
+
if (/^file:/.test(specifier))
|
|
18
|
+
return 'file';
|
|
19
|
+
if (/^link:/.test(specifier))
|
|
20
|
+
return 'link';
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function snippetFor(manifest, dep) {
|
|
24
|
+
if (dep.line === undefined) {
|
|
25
|
+
return { range: { startLine: 1, endLine: 1 }, snippet: `"${dep.name}": "${dep.specifier}"` };
|
|
26
|
+
}
|
|
27
|
+
const rawLine = manifest.raw.split('\n')[dep.line - 1];
|
|
28
|
+
return {
|
|
29
|
+
range: { startLine: dep.line, endLine: dep.line },
|
|
30
|
+
snippet: rawLine !== undefined ? rawLine.trim() : `"${dep.name}": "${dep.specifier}"`,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `security.manifest.source-hygiene` (ADR 013, probe Rule 1): any dependency specifier resolving
|
|
35
|
+
* to git/http(s)/file/link, not registry/workspace protocol. Fingerprint keyed on
|
|
36
|
+
* (manifest file, dep name) only — never the specifier value or a line number — so a git-ref bump
|
|
37
|
+
* or manifest reformatting doesn't reset baseline consent (ADR 013's name-level doctrine, mirrored
|
|
38
|
+
* from `security.manifest.new-dependency`); the current specifier is still reported as a
|
|
39
|
+
* structured field so a reviewer sees exactly what changed.
|
|
40
|
+
*/
|
|
41
|
+
export const evaluateSourceHygiene = (rule, inventory) => {
|
|
42
|
+
const violations = [];
|
|
43
|
+
for (const manifest of inventory.manifests) {
|
|
44
|
+
for (const dep of manifest.dependencies) {
|
|
45
|
+
const sourceType = classifySourceType(dep.specifier);
|
|
46
|
+
if (sourceType === undefined)
|
|
47
|
+
continue;
|
|
48
|
+
const id = computeFingerprint(['manifest-source-hygiene', rule.id, manifest.file, dep.name]);
|
|
49
|
+
const { range, snippet } = snippetFor(manifest, dep);
|
|
50
|
+
violations.push({
|
|
51
|
+
id,
|
|
52
|
+
ruleId: toRuleId(rule.id),
|
|
53
|
+
category: 'security',
|
|
54
|
+
severity: 'error',
|
|
55
|
+
file: manifest.file,
|
|
56
|
+
range,
|
|
57
|
+
snippet,
|
|
58
|
+
fixHint: { code: 'manual-review' },
|
|
59
|
+
...becauseField(rule.provenance.because),
|
|
60
|
+
kind: 'manifest-source-hygiene',
|
|
61
|
+
depName: dep.name,
|
|
62
|
+
specifier: dep.specifier,
|
|
63
|
+
sourceType,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return violations;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* `security.manifest.new-dependency` (ADR 013, probe Rule 7): a stateless, fingerprint-driven
|
|
71
|
+
* re-expression of the probe's git-diff mechanism through align's existing baseline-consent
|
|
72
|
+
* machinery (ADR 006), not a git-history diff itself — this evaluator flags EVERY current
|
|
73
|
+
* runtime/dev dependency as a fingerprinted candidate on every run; baseline consent (`align
|
|
74
|
+
* init`/`baseline accept`) is what turns "all of today's deps" into "nothing," so only a
|
|
75
|
+
* genuinely new dependency (new name, not previously baselined) ever shows red. Name-level only
|
|
76
|
+
* (`optionalDependencies`/`peerDependencies` excluded) — version-level gating is a documented
|
|
77
|
+
* follow-up (ADR 013), not built here: it would fire on every routine version bump / renovate PR.
|
|
78
|
+
*/
|
|
79
|
+
export const evaluateNewDependency = (rule, inventory) => {
|
|
80
|
+
const violations = [];
|
|
81
|
+
for (const manifest of inventory.manifests) {
|
|
82
|
+
for (const dep of manifest.dependencies) {
|
|
83
|
+
if (dep.field !== 'dependencies' && dep.field !== 'devDependencies')
|
|
84
|
+
continue;
|
|
85
|
+
const id = computeFingerprint(['manifest-new-dependency', rule.id, manifest.file, dep.name]);
|
|
86
|
+
const { range, snippet } = snippetFor(manifest, dep);
|
|
87
|
+
violations.push({
|
|
88
|
+
id,
|
|
89
|
+
ruleId: toRuleId(rule.id),
|
|
90
|
+
category: 'security',
|
|
91
|
+
severity: 'error',
|
|
92
|
+
file: manifest.file,
|
|
93
|
+
range,
|
|
94
|
+
snippet,
|
|
95
|
+
fixHint: { code: 'manual-review' },
|
|
96
|
+
...becauseField(rule.provenance.because),
|
|
97
|
+
kind: 'manifest-new-dependency',
|
|
98
|
+
depName: dep.name,
|
|
99
|
+
specifier: dep.specifier,
|
|
100
|
+
depField: dep.field,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return violations;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Exhaustive dispatcher for the manifest scan domain — the sibling of `evaluators.ts`'s
|
|
108
|
+
* `evaluateRule`, over the disjoint `SecurityManifestRule` union instead of the full `RuleIR`
|
|
109
|
+
* union. `GateOrchestrator`'s `security` gate is the only real caller (`ruleCategoryOf` partitions
|
|
110
|
+
* `RulesetIR.rules` before this ever runs, `rules/rule-category.ts`).
|
|
111
|
+
*/
|
|
112
|
+
export function evaluateManifestRule(rule, inventory) {
|
|
113
|
+
switch (rule.kind) {
|
|
114
|
+
case 'security.manifest.source-hygiene':
|
|
115
|
+
return evaluateSourceHygiene(rule, inventory);
|
|
116
|
+
case 'security.manifest.new-dependency':
|
|
117
|
+
return evaluateNewDependency(rule, inventory);
|
|
118
|
+
default: {
|
|
119
|
+
const exhaustive = rule;
|
|
120
|
+
throw new Error(`unhandled manifest rule kind: ${JSON.stringify(exhaustive)}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=manifest-evaluators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-evaluators.js","sourceRoot":"","sources":["../../src/rules/manifest-evaluators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C;;qGAEqG;AACrG,SAAS,kBAAkB,CAAC,SAAiB;IAC3C,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,MAAM,CAAC;IAClD,IA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+
import type { Category } from '../types/violation.js';
|
|
2
|
+
import type { RuleIR } from '../types/ir.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which gate a `RuleIR` belongs to (ADR 013): the orchestrator uses this to partition
|
|
5
|
+
* `RulesetIR.rules` before evaluation, since `arch.*`/`custom.host` rules evaluate against the
|
|
6
|
+
* TypeScript-scanned `DependencyGraph` (`rules/evaluators.ts`'s `evaluateRule`) while
|
|
7
|
+
* `security.manifest.*` rules evaluate against a `ManifestInventory`
|
|
8
|
+
* (`rules/manifest-evaluators.ts`'s `evaluateManifestRule`) — two disjoint scan domains that must
|
|
9
|
+
* never be evaluated through each other's dispatcher. Exhaustive switch, same discipline as
|
|
10
|
+
* `evaluateRule`/`componentRefsOf` — a new `RuleIR` kind without a case here is a compile error.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ruleCategoryOf(rule: RuleIR): Category;
|
|
13
|
+
//# sourceMappingURL=rule-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-category.d.ts","sourceRoot":"","sources":["../../src/rules/rule-category.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAgBrD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which gate a `RuleIR` belongs to (ADR 013): the orchestrator uses this to partition
|
|
3
|
+
* `RulesetIR.rules` before evaluation, since `arch.*`/`custom.host` rules evaluate against the
|
|
4
|
+
* TypeScript-scanned `DependencyGraph` (`rules/evaluators.ts`'s `evaluateRule`) while
|
|
5
|
+
* `security.manifest.*` rules evaluate against a `ManifestInventory`
|
|
6
|
+
* (`rules/manifest-evaluators.ts`'s `evaluateManifestRule`) — two disjoint scan domains that must
|
|
7
|
+
* never be evaluated through each other's dispatcher. Exhaustive switch, same discipline as
|
|
8
|
+
* `evaluateRule`/`componentRefsOf` — a new `RuleIR` kind without a case here is a compile error.
|
|
9
|
+
*/
|
|
10
|
+
export function ruleCategoryOf(rule) {
|
|
11
|
+
switch (rule.kind) {
|
|
12
|
+
case 'arch.no-dependency':
|
|
13
|
+
case 'arch.no-cycles':
|
|
14
|
+
case 'arch.layers':
|
|
15
|
+
case 'arch.metric':
|
|
16
|
+
case 'custom.host':
|
|
17
|
+
return 'architecture';
|
|
18
|
+
case 'security.manifest.source-hygiene':
|
|
19
|
+
case 'security.manifest.new-dependency':
|
|
20
|
+
return 'security';
|
|
21
|
+
default: {
|
|
22
|
+
const exhaustive = rule;
|
|
23
|
+
throw new Error(`unhandled rule kind: ${JSON.stringify(exhaustive)}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=rule-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-category.js","sourceRoot":"","sources":["../../src/rules/rule-category.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,oBAAoB,CAAC;QAC1B,KAAK,gBAAgB,CAAC;QACtB,KAAK,aAAa,CAAC;QACnB,KAAK,aAAa,CAAC;QACnB,KAAK,aAAa;YAChB,OAAO,cAAc,CAAC;QACxB,KAAK,kCAAkC,CAAC;QACxC,KAAK,kCAAkC;YACrC,OAAO,UAAU,CAAC;QACpB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,UAAU,GAAU,IAAI,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Iterative Tarjan strongly-connected-components — ported from spike/src/rules.ts (proven
|
|
3
|
+
* algorithm; recursive Tarjan blows the call stack on large graphs, hence the explicit frame
|
|
4
|
+
* stack). Pure function: adjacency in, SCC groups out, no I/O.
|
|
5
|
+
*/
|
|
6
|
+
export declare function tarjanScc<T>(adjacency: ReadonlyMap<T, readonly T[]>): T[][];
|
|
7
|
+
/** Walk within the SCC from its first node until it revisits it, yielding one concrete cycle. */
|
|
8
|
+
export declare function extractCycleChainNodes<T>(scc: readonly T[], adjacency: ReadonlyMap<T, readonly T[]>): T[];
|
|
9
|
+
//# sourceMappingURL=tarjan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tarjan.d.ts","sourceRoot":"","sources":["../../src/rules/tarjan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAiE3E;AAED,iGAAiG;AACjG,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CA4BzG"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Iterative Tarjan strongly-connected-components — ported from spike/src/rules.ts (proven
|
|
3
|
+
* algorithm; recursive Tarjan blows the call stack on large graphs, hence the explicit frame
|
|
4
|
+
* stack). Pure function: adjacency in, SCC groups out, no I/O.
|
|
5
|
+
*/
|
|
6
|
+
export function tarjanScc(adjacency) {
|
|
7
|
+
let index = 0;
|
|
8
|
+
const nodeIndex = new Map();
|
|
9
|
+
const lowLink = new Map();
|
|
10
|
+
const onStack = new Set();
|
|
11
|
+
const stack = [];
|
|
12
|
+
const sccs = [];
|
|
13
|
+
for (const root of adjacency.keys()) {
|
|
14
|
+
if (nodeIndex.has(root))
|
|
15
|
+
continue;
|
|
16
|
+
const frames = [{ node: root, childIdx: 0 }];
|
|
17
|
+
nodeIndex.set(root, index);
|
|
18
|
+
lowLink.set(root, index);
|
|
19
|
+
index += 1;
|
|
20
|
+
stack.push(root);
|
|
21
|
+
onStack.add(root);
|
|
22
|
+
while (frames.length > 0) {
|
|
23
|
+
const frame = frames[frames.length - 1];
|
|
24
|
+
if (frame === undefined)
|
|
25
|
+
break;
|
|
26
|
+
const neighbors = adjacency.get(frame.node) ?? [];
|
|
27
|
+
if (frame.childIdx < neighbors.length) {
|
|
28
|
+
const next = neighbors[frame.childIdx];
|
|
29
|
+
frame.childIdx += 1;
|
|
30
|
+
if (next === undefined)
|
|
31
|
+
continue;
|
|
32
|
+
if (!nodeIndex.has(next)) {
|
|
33
|
+
nodeIndex.set(next, index);
|
|
34
|
+
lowLink.set(next, index);
|
|
35
|
+
index += 1;
|
|
36
|
+
stack.push(next);
|
|
37
|
+
onStack.add(next);
|
|
38
|
+
frames.push({ node: next, childIdx: 0 });
|
|
39
|
+
}
|
|
40
|
+
else if (onStack.has(next)) {
|
|
41
|
+
const nl = lowLink.get(frame.node) ?? 0;
|
|
42
|
+
lowLink.set(frame.node, Math.min(nl, nodeIndex.get(next) ?? 0));
|
|
43
|
+
}
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
frames.pop();
|
|
47
|
+
const parent = frames[frames.length - 1];
|
|
48
|
+
if (parent !== undefined) {
|
|
49
|
+
const pl = lowLink.get(parent.node) ?? 0;
|
|
50
|
+
lowLink.set(parent.node, Math.min(pl, lowLink.get(frame.node) ?? 0));
|
|
51
|
+
}
|
|
52
|
+
if (lowLink.get(frame.node) === nodeIndex.get(frame.node)) {
|
|
53
|
+
const scc = [];
|
|
54
|
+
for (;;) {
|
|
55
|
+
const popped = stack.pop();
|
|
56
|
+
if (popped === undefined)
|
|
57
|
+
break;
|
|
58
|
+
onStack.delete(popped);
|
|
59
|
+
scc.push(popped);
|
|
60
|
+
if (popped === frame.node)
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
sccs.push(scc);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return sccs;
|
|
68
|
+
}
|
|
69
|
+
/** Walk within the SCC from its first node until it revisits it, yielding one concrete cycle. */
|
|
70
|
+
export function extractCycleChainNodes(scc, adjacency) {
|
|
71
|
+
const inScc = new Set(scc);
|
|
72
|
+
const start = scc[0];
|
|
73
|
+
if (start === undefined)
|
|
74
|
+
return [];
|
|
75
|
+
if (scc.length === 1) {
|
|
76
|
+
// A single-node SCC is only a cycle at all if it has a self-edge (checked by the caller);
|
|
77
|
+
// the general walk below can never "revisit" a start node it never left, so this is a
|
|
78
|
+
// required special case, not an optimization.
|
|
79
|
+
const neighbors = adjacency.get(start) ?? [];
|
|
80
|
+
return neighbors.includes(start) ? [start, start] : [start];
|
|
81
|
+
}
|
|
82
|
+
const chain = [start];
|
|
83
|
+
const seen = new Set([start]);
|
|
84
|
+
let current = start;
|
|
85
|
+
for (let i = 0; i < scc.length + 1; i += 1) {
|
|
86
|
+
const neighbors = adjacency.get(current) ?? [];
|
|
87
|
+
if (current !== start && neighbors.includes(start)) {
|
|
88
|
+
chain.push(start); // prefer closing the loop over wandering the SCC
|
|
89
|
+
return chain;
|
|
90
|
+
}
|
|
91
|
+
const next = neighbors.find((n) => inScc.has(n) && !seen.has(n));
|
|
92
|
+
if (next === undefined)
|
|
93
|
+
break;
|
|
94
|
+
chain.push(next);
|
|
95
|
+
if (next === start)
|
|
96
|
+
return chain;
|
|
97
|
+
seen.add(next);
|
|
98
|
+
current = next;
|
|
99
|
+
}
|
|
100
|
+
return chain; // partial chain (still informative) if a tidy loop was not found
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=tarjan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AC,KAAK,CAAC,CAAC;IAC3B,MAAM,IAAI,GAAG,IAAI,GAAG,CAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAiB,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC7D,IAAI,OAAO,KAAK,KAAK,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,iDAAiD;YACpE,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,IAAI,IAAI,KAAK,SAAS;YAAE,MAAM;QAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO,KAAK,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,iEAAiE;AACjF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentDefinitionIR } from './types/ir.js';
|
|
2
|
+
import type { ComponentName } from './types/branded.js';
|
|
3
|
+
import type { DependencyGraph } from './types/graph.js';
|
|
4
|
+
export interface ScanInput {
|
|
5
|
+
readonly rootDir: string;
|
|
6
|
+
readonly components: Readonly<Record<ComponentName, ComponentDefinitionIR>>;
|
|
7
|
+
readonly excludes: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export interface Scanner {
|
|
10
|
+
scan(input: ScanInput): Promise<DependencyGraph>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,OAAO;IAGtB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAClD"}
|
package/dist/scanner.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Violation } from '../types/violation.js';
|
|
2
|
+
import type { TelemetryStateEntry } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* `violation-appeared` / `violation-resolved` (IMPLEMENTATION_PLAN.md telemetry spec) are computed
|
|
5
|
+
* by diffing the current check's violation-fingerprint set against the previous check's set — this
|
|
6
|
+
* is that diff, pure and framework-free (no file I/O; the CLI reads/writes
|
|
7
|
+
* `.align/telemetry-state.json` and calls this with both sides already loaded).
|
|
8
|
+
*
|
|
9
|
+
* Only the fields needed to *name* a transition travel with each entry (ruleId/file/component) —
|
|
10
|
+
* paths + rule ids only, never file contents (the same discipline every other violation-facing
|
|
11
|
+
* payload in this codebase already follows, ADR 007).
|
|
12
|
+
*/
|
|
13
|
+
export declare function componentOfViolation(v: Violation): string | undefined;
|
|
14
|
+
export declare function telemetryStateEntryOf(v: Violation): TelemetryStateEntry;
|
|
15
|
+
export interface ViolationStateDiff {
|
|
16
|
+
readonly appeared: readonly TelemetryStateEntry[];
|
|
17
|
+
readonly resolved: readonly TelemetryStateEntry[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `previous`/`current` are both `TelemetryStateEntry[]` (not raw `Violation[]`) so this stays a
|
|
21
|
+
* pure comparison over the persisted, minimal shape — `telemetryStateEntryOf` above is the one
|
|
22
|
+
* place a `Violation` gets narrowed down to it. Diffed by `fingerprint` only (ADR 006: stable
|
|
23
|
+
* under unrelated edits — a violation with the same fingerprint is the same violation even if its
|
|
24
|
+
* line number shifted).
|
|
25
|
+
*/
|
|
26
|
+
export declare function diffViolationState(previous: readonly TelemetryStateEntry[], current: readonly TelemetryStateEntry[]): ViolationStateDiff;
|
|
27
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/telemetry/diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAkBrE;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG,mBAAmB,CAQvE;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACnD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,EAAE,OAAO,EAAE,SAAS,mBAAmB,EAAE,GAAG,kBAAkB,CAOxI"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `violation-appeared` / `violation-resolved` (IMPLEMENTATION_PLAN.md telemetry spec) are computed
|
|
3
|
+
* by diffing the current check's violation-fingerprint set against the previous check's set — this
|
|
4
|
+
* is that diff, pure and framework-free (no file I/O; the CLI reads/writes
|
|
5
|
+
* `.align/telemetry-state.json` and calls this with both sides already loaded).
|
|
6
|
+
*
|
|
7
|
+
* Only the fields needed to *name* a transition travel with each entry (ruleId/file/component) —
|
|
8
|
+
* paths + rule ids only, never file contents (the same discipline every other violation-facing
|
|
9
|
+
* payload in this codebase already follows, ADR 007).
|
|
10
|
+
*/
|
|
11
|
+
export function componentOfViolation(v) {
|
|
12
|
+
switch (v.kind) {
|
|
13
|
+
case 'no-dependency':
|
|
14
|
+
return v.fromComponent;
|
|
15
|
+
case 'layers':
|
|
16
|
+
return v.fromLayer;
|
|
17
|
+
case 'metric':
|
|
18
|
+
return v.component;
|
|
19
|
+
case 'no-cycles':
|
|
20
|
+
case 'custom':
|
|
21
|
+
case 'manifest-source-hygiene':
|
|
22
|
+
case 'manifest-new-dependency':
|
|
23
|
+
return undefined;
|
|
24
|
+
default: {
|
|
25
|
+
const exhaustive = v;
|
|
26
|
+
throw new Error(`unhandled violation kind: ${JSON.stringify(exhaustive)}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function telemetryStateEntryOf(v) {
|
|
31
|
+
const component = componentOfViolation(v);
|
|
32
|
+
return {
|
|
33
|
+
fingerprint: v.id,
|
|
34
|
+
ruleId: v.ruleId,
|
|
35
|
+
file: v.file,
|
|
36
|
+
...(component !== undefined ? { component } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* `previous`/`current` are both `TelemetryStateEntry[]` (not raw `Violation[]`) so this stays a
|
|
41
|
+
* pure comparison over the persisted, minimal shape — `telemetryStateEntryOf` above is the one
|
|
42
|
+
* place a `Violation` gets narrowed down to it. Diffed by `fingerprint` only (ADR 006: stable
|
|
43
|
+
* under unrelated edits — a violation with the same fingerprint is the same violation even if its
|
|
44
|
+
* line number shifted).
|
|
45
|
+
*/
|
|
46
|
+
export function diffViolationState(previous, current) {
|
|
47
|
+
const previousIds = new Set(previous.map((e) => e.fingerprint));
|
|
48
|
+
const currentIds = new Set(current.map((e) => e.fingerprint));
|
|
49
|
+
return {
|
|
50
|
+
appeared: current.filter((e) => !previousIds.has(e.fingerprint)),
|
|
51
|
+
resolved: previous.filter((e) => !currentIds.has(e.fingerprint)),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/telemetry/diff.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAY;IAC/C,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,eAAe;YAClB,OAAO,CAAC,CAAC,aAAa,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,SAAS,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,SAAS,CAAC;QACrB,KAAK,WAAW,CAAC;QACjB,KAAK,QAAQ,CAAC;QACd,KAAK,yBAAyB,CAAC;QAC/B,KAAK,yBAAyB;YAC5B,OAAO,SAAS,CAAC;QACnB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,UAAU,GAAU,CAAC,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAA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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/telemetry/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TelemetryEnvelope } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pure `event -> single JSON line string` serializer (IMPLEMENTATION_PLAN.md telemetry spec: "Emitter
|
|
4
|
+
* = pure core module (event->line); I/O + file write in CLI"). `JSON.stringify` with no `space`
|
|
5
|
+
* argument never emits an embedded newline, so the result is always exactly one JSONL line — the
|
|
6
|
+
* CLI (`packages/cli/src/telemetry/`) is the only place that appends the trailing `\n` and writes
|
|
7
|
+
* bytes to disk.
|
|
8
|
+
*/
|
|
9
|
+
export declare function serializeTelemetryEvent(envelope: TelemetryEnvelope): string;
|
|
10
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/telemetry/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE3E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure `event -> single JSON line string` serializer (IMPLEMENTATION_PLAN.md telemetry spec: "Emitter
|
|
3
|
+
* = pure core module (event->line); I/O + file write in CLI"). `JSON.stringify` with no `space`
|
|
4
|
+
* argument never emits an embedded newline, so the result is always exactly one JSONL line — the
|
|
5
|
+
* CLI (`packages/cli/src/telemetry/`) is the only place that appends the trailing `\n` and writes
|
|
6
|
+
* bytes to disk.
|
|
7
|
+
*/
|
|
8
|
+
export function serializeTelemetryEvent(envelope) {
|
|
9
|
+
return JSON.stringify(envelope);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=serialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/telemetry/serialize.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry / 360-feedback loop (IMPLEMENTATION_PLAN.md Design Reserve "Telemetry / 360-feedback
|
|
3
|
+
* loop", ADR 015). Event type definitions only — this file has zero `node:fs` / `Date.now()` /
|
|
4
|
+
* network primitives, matching every other file under `packages/core/src` (ARCHITECTURE.md §5:
|
|
5
|
+
* core stays framework-free, the CLI is the imperative shell that does I/O).
|
|
6
|
+
*
|
|
7
|
+
* LOCAL-FILE-ONLY, NEVER NETWORK (align's own untrusted-mode/security ethos, ADR 001/014): these
|
|
8
|
+
* types describe the shape of one JSON line appended to `.align/telemetry.jsonl` by the CLI. This
|
|
9
|
+
* module never imports anything that could reach a socket — enforced by
|
|
10
|
+
* `test/telemetry/network-abstinence.test.ts`, which asserts no network primitive is imported
|
|
11
|
+
* anywhere under `packages/core/src/telemetry` or `packages/cli/src/telemetry`.
|
|
12
|
+
*/
|
|
13
|
+
import type { GateKind, GateStatus } from '../gates/types.js';
|
|
14
|
+
export declare const TELEMETRY_SCHEMA_VERSION: 1;
|
|
15
|
+
export type TelemetrySchemaVersion = typeof TELEMETRY_SCHEMA_VERSION;
|
|
16
|
+
/** `align check` only ever does a full fresh scan today (ADR 005: rescan-on-check, no caching) —
|
|
17
|
+
* 'changed'/'files' are reserved discriminants for a future scoped-check mode (same "reserve
|
|
18
|
+
* pending evidence" doctrine as `GATE_KINDS`'s `types`/`lint`/`format` and `FixHint`'s reserved
|
|
19
|
+
* codes), not fabricated data. The CLI always emits 'all' in v1. */
|
|
20
|
+
export type CheckScope = 'all' | 'changed' | 'files';
|
|
21
|
+
export interface GateSummary {
|
|
22
|
+
readonly gate: GateKind;
|
|
23
|
+
readonly status: GateStatus;
|
|
24
|
+
/** Count of new, post-baseline violations this gate reported this run (`GateResult.violations.length`). */
|
|
25
|
+
readonly newCount: number;
|
|
26
|
+
readonly baselinedCount: number;
|
|
27
|
+
readonly passCount: number;
|
|
28
|
+
}
|
|
29
|
+
export interface AdvisoryCount {
|
|
30
|
+
readonly kind: string;
|
|
31
|
+
readonly count: number;
|
|
32
|
+
}
|
|
33
|
+
export interface CheckEvent {
|
|
34
|
+
readonly kind: 'check';
|
|
35
|
+
readonly verdict: 'green' | 'red' | 'error';
|
|
36
|
+
readonly gates: readonly GateSummary[];
|
|
37
|
+
readonly wallMs: number;
|
|
38
|
+
readonly scope: CheckScope;
|
|
39
|
+
readonly ungroundedComponentCount: number;
|
|
40
|
+
readonly advisoryCounts: readonly AdvisoryCount[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Emitted by diffing the current check's violation-fingerprint set against the previous check's
|
|
44
|
+
* set (`.align/telemetry-state.json`, `diffViolationState` below) — never computed from a single
|
|
45
|
+
* check in isolation. `violationFingerprint` is the same stable `Violation.id` ADR 006 already
|
|
46
|
+
* defines (snippet-hash, stable under unrelated edits), so `appeared -> resolved` pairs sharing a
|
|
47
|
+
* fingerprint are exactly the time-to-green signal the summarizer command correlates.
|
|
48
|
+
*/
|
|
49
|
+
export interface ViolationTransitionEvent {
|
|
50
|
+
readonly kind: 'violation-appeared' | 'violation-resolved';
|
|
51
|
+
readonly ruleId: string;
|
|
52
|
+
readonly component?: string;
|
|
53
|
+
readonly file: string;
|
|
54
|
+
readonly violationFingerprint: string;
|
|
55
|
+
}
|
|
56
|
+
export interface BaselineEvent {
|
|
57
|
+
readonly kind: 'baseline';
|
|
58
|
+
readonly action: 'accept' | 'prune';
|
|
59
|
+
/** The `--rule <ruleId>` scope, when the action was scoped; absent for a repo-wide accept/prune. */
|
|
60
|
+
readonly ruleScope?: string;
|
|
61
|
+
readonly counts: {
|
|
62
|
+
readonly accepted?: number;
|
|
63
|
+
readonly removed?: number;
|
|
64
|
+
readonly moved?: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface BuildImpactDelta {
|
|
68
|
+
readonly newViolations: number;
|
|
69
|
+
readonly maskedBaselined: number;
|
|
70
|
+
}
|
|
71
|
+
export interface BuildEvent {
|
|
72
|
+
readonly kind: 'build';
|
|
73
|
+
readonly doc: string;
|
|
74
|
+
readonly structuralChanges: number;
|
|
75
|
+
readonly provenanceOnlyChanges: number;
|
|
76
|
+
readonly impactDelta: BuildImpactDelta;
|
|
77
|
+
}
|
|
78
|
+
/** `unknown-host-rule` / `ungrounded-fail` are reserved discriminants (same reserve-pending-
|
|
79
|
+
* evidence doctrine as `CheckScope` above): today's guard-step failures (unregistered
|
|
80
|
+
* `custom.host` predicate, a component matching zero files) surface as an architecture-gate
|
|
81
|
+
* `error` and are reported as `'gate-error'`; a future pass may want to distinguish them by cause
|
|
82
|
+
* without inventing a value no code path emits yet. */
|
|
83
|
+
export type TelemetryErrorKind = 'gate-error' | 'exception' | 'untrusted-refusal' | 'unknown-host-rule' | 'ungrounded-fail' | 'unknown';
|
|
84
|
+
export interface ErrorEvent {
|
|
85
|
+
readonly kind: 'error';
|
|
86
|
+
readonly errorKind: TelemetryErrorKind;
|
|
87
|
+
/** SHORT message only — no secrets, no file contents (IMPLEMENTATION_PLAN.md's telemetry spec,
|
|
88
|
+
* ADR 007's payload-discipline doctrine applied to this surface too). */
|
|
89
|
+
readonly message: string;
|
|
90
|
+
readonly command: string;
|
|
91
|
+
}
|
|
92
|
+
export interface AgentUsage {
|
|
93
|
+
readonly inputTokens: number;
|
|
94
|
+
readonly outputTokens: number;
|
|
95
|
+
}
|
|
96
|
+
export interface AgentEvent {
|
|
97
|
+
readonly kind: 'agent';
|
|
98
|
+
readonly attempts: number;
|
|
99
|
+
readonly converged: boolean;
|
|
100
|
+
readonly iterations: number;
|
|
101
|
+
readonly escalated: boolean;
|
|
102
|
+
readonly escalationReason?: string;
|
|
103
|
+
/** Only present when `@anthropic-ai/sdk`'s response actually surfaced `usage` — never
|
|
104
|
+
* fabricated (IMPLEMENTATION_PLAN.md: "if absent, omit the field, don't fabricate", closing the
|
|
105
|
+
* Kimi-flagged observability gap). */
|
|
106
|
+
readonly usage?: AgentUsage;
|
|
107
|
+
}
|
|
108
|
+
export type TelemetryEvent = CheckEvent | ViolationTransitionEvent | BaselineEvent | BuildEvent | ErrorEvent | AgentEvent;
|
|
109
|
+
/**
|
|
110
|
+
* The envelope every event carries (the cross-session-comparability refinement,
|
|
111
|
+
* IMPLEMENTATION_PLAN.md's telemetry spec) — `ts` and `sessionId` are injected, never computed in
|
|
112
|
+
* core (no `Date.now()`/`crypto.randomUUID()` here; the CLI, the imperative shell, supplies both).
|
|
113
|
+
*/
|
|
114
|
+
export interface TelemetryEnvelope<E extends TelemetryEvent = TelemetryEvent> {
|
|
115
|
+
readonly schemaVersion: TelemetrySchemaVersion;
|
|
116
|
+
readonly sessionId: string;
|
|
117
|
+
readonly alignVersion: string;
|
|
118
|
+
/** Content hash of the loaded `RulesetIR` (reuses `sha256Hex`, `build/hash.ts`) — absent when no
|
|
119
|
+
* ruleset was ever loaded for this event (e.g. an `--untrusted` refusal before the IR artifact
|
|
120
|
+
* was even read). */
|
|
121
|
+
readonly rulesetIrHash?: string;
|
|
122
|
+
readonly ts: number;
|
|
123
|
+
readonly command: string;
|
|
124
|
+
readonly event: E;
|
|
125
|
+
}
|
|
126
|
+
/** One entry in `.align/telemetry-state.json` — the minimal fields `diffViolationState` needs to
|
|
127
|
+
* name a transition without re-reading the file the violation lives in. */
|
|
128
|
+
export interface TelemetryStateEntry {
|
|
129
|
+
readonly fingerprint: string;
|
|
130
|
+
readonly ruleId: string;
|
|
131
|
+
readonly file: string;
|
|
132
|
+
readonly component?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface TelemetryState {
|
|
135
|
+
readonly violations: readonly TelemetryStateEntry[];
|
|
136
|
+
}
|
|
137
|
+
export declare const EMPTY_TELEMETRY_STATE: TelemetryState;
|
|
138
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,wBAAwB,EAAG,CAAU,CAAC;AACnD,MAAM,MAAM,sBAAsB,GAAG,OAAO,wBAAwB,CAAC;AAErE;;;oEAGoE;AACpE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,2GAA2G;IAC3G,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAA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