circle-ir 4.17.0 → 4.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/advisories.d.ts +186 -0
- package/dist/analysis/advisories.d.ts.map +1 -0
- package/dist/analysis/advisories.js +391 -0
- package/dist/analysis/advisories.js.map +1 -0
- package/dist/analysis/comment-lines.d.ts +14 -0
- package/dist/analysis/comment-lines.d.ts.map +1 -0
- package/dist/analysis/comment-lines.js +34 -0
- package/dist/analysis/comment-lines.js.map +1 -0
- package/dist/analysis/config-loader.d.ts.map +1 -1
- package/dist/analysis/config-loader.js +59 -5
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/constant-caller-gate.d.ts +2 -2
- package/dist/analysis/constant-caller-gate.d.ts.map +1 -1
- package/dist/analysis/constant-caller-gate.js +205 -29
- package/dist/analysis/constant-caller-gate.js.map +1 -1
- package/dist/analysis/constant-propagation/propagator.d.ts +4 -0
- package/dist/analysis/constant-propagation/propagator.d.ts.map +1 -1
- package/dist/analysis/constant-propagation/propagator.js +99 -0
- package/dist/analysis/constant-propagation/propagator.js.map +1 -1
- package/dist/analysis/entry-point-detection.d.ts.map +1 -1
- package/dist/analysis/entry-point-detection.js +72 -0
- package/dist/analysis/entry-point-detection.js.map +1 -1
- package/dist/analysis/interprocedural.d.ts.map +1 -1
- package/dist/analysis/interprocedural.js +75 -8
- package/dist/analysis/interprocedural.js.map +1 -1
- package/dist/analysis/maven-declared.d.ts +72 -0
- package/dist/analysis/maven-declared.d.ts.map +1 -0
- package/dist/analysis/maven-declared.js +216 -0
- package/dist/analysis/maven-declared.js.map +1 -0
- package/dist/analysis/maven-version.d.ts +28 -0
- package/dist/analysis/maven-version.d.ts.map +1 -0
- package/dist/analysis/maven-version.js +172 -0
- package/dist/analysis/maven-version.js.map +1 -0
- package/dist/analysis/passes/constant-propagation-pass.d.ts.map +1 -1
- package/dist/analysis/passes/constant-propagation-pass.js +29 -1
- package/dist/analysis/passes/constant-propagation-pass.js.map +1 -1
- package/dist/analysis/passes/cross-file-pass.d.ts.map +1 -1
- package/dist/analysis/passes/cross-file-pass.js +81 -1
- package/dist/analysis/passes/cross-file-pass.js.map +1 -1
- package/dist/analysis/passes/csharp-sanitizer-credit.d.ts +7 -0
- package/dist/analysis/passes/csharp-sanitizer-credit.d.ts.map +1 -1
- package/dist/analysis/passes/csharp-sanitizer-credit.js +44 -1
- package/dist/analysis/passes/csharp-sanitizer-credit.js.map +1 -1
- package/dist/analysis/passes/insecure-cookie-pass.d.ts +2 -0
- package/dist/analysis/passes/insecure-cookie-pass.d.ts.map +1 -1
- package/dist/analysis/passes/insecure-cookie-pass.js +25 -3
- package/dist/analysis/passes/insecure-cookie-pass.js.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.d.ts +11 -14
- package/dist/analysis/passes/interprocedural-pass.d.ts.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.js +562 -0
- package/dist/analysis/passes/interprocedural-pass.js.map +1 -1
- package/dist/analysis/passes/language-sources-pass.d.ts +18 -1
- package/dist/analysis/passes/language-sources-pass.d.ts.map +1 -1
- package/dist/analysis/passes/language-sources-pass.js +1057 -14
- package/dist/analysis/passes/language-sources-pass.js.map +1 -1
- package/dist/analysis/passes/param-source-flow-gate-pass.d.ts.map +1 -1
- package/dist/analysis/passes/param-source-flow-gate-pass.js +66 -3
- package/dist/analysis/passes/param-source-flow-gate-pass.js.map +1 -1
- package/dist/analysis/passes/sink-filter-pass.d.ts +44 -2
- package/dist/analysis/passes/sink-filter-pass.d.ts.map +1 -1
- package/dist/analysis/passes/sink-filter-pass.js +690 -12
- package/dist/analysis/passes/sink-filter-pass.js.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.d.ts.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.js +133 -10
- package/dist/analysis/passes/taint-propagation-pass.js.map +1 -1
- package/dist/analysis/passes/tls-verify-disabled-pass.d.ts +18 -0
- package/dist/analysis/passes/tls-verify-disabled-pass.d.ts.map +1 -1
- package/dist/analysis/passes/tls-verify-disabled-pass.js +161 -0
- package/dist/analysis/passes/tls-verify-disabled-pass.js.map +1 -1
- package/dist/analysis/passes/weak-random-pass.d.ts +6 -0
- package/dist/analysis/passes/weak-random-pass.d.ts.map +1 -1
- package/dist/analysis/passes/weak-random-pass.js +29 -0
- package/dist/analysis/passes/weak-random-pass.js.map +1 -1
- package/dist/analysis/promote-cross-file-flows.d.ts +17 -0
- package/dist/analysis/promote-cross-file-flows.d.ts.map +1 -0
- package/dist/analysis/promote-cross-file-flows.js +32 -0
- package/dist/analysis/promote-cross-file-flows.js.map +1 -0
- package/dist/analysis/sbom.d.ts +100 -0
- package/dist/analysis/sbom.d.ts.map +1 -1
- package/dist/analysis/sbom.js +514 -3
- package/dist/analysis/sbom.js.map +1 -1
- package/dist/analysis/semver-version.d.ts +30 -0
- package/dist/analysis/semver-version.d.ts.map +1 -0
- package/dist/analysis/semver-version.js +76 -0
- package/dist/analysis/semver-version.js.map +1 -0
- package/dist/analysis/taint-matcher.d.ts +5 -0
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +225 -4
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analyzer.d.ts +57 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +69 -6
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +2936 -291
- package/dist/core/circle-ir-core.cjs +634 -203
- package/dist/core/circle-ir-core.js +634 -203
- package/dist/core/extractors/dfg.js +205 -2
- package/dist/core/extractors/dfg.js.map +1 -1
- package/dist/core/extractors/ts-declaration-detail.d.ts +39 -0
- package/dist/core/extractors/ts-declaration-detail.d.ts.map +1 -0
- package/dist/core/extractors/ts-declaration-detail.js +266 -0
- package/dist/core/extractors/ts-declaration-detail.js.map +1 -0
- package/dist/graph/analysis-pass.d.ts +4 -1
- package/dist/graph/analysis-pass.d.ts.map +1 -1
- package/dist/graph/analysis-pass.js +4 -1
- package/dist/graph/analysis-pass.js.map +1 -1
- package/dist/graph-facts/dead-code.d.ts +62 -0
- package/dist/graph-facts/dead-code.d.ts.map +1 -0
- package/dist/graph-facts/dead-code.js +90 -0
- package/dist/graph-facts/dead-code.js.map +1 -0
- package/dist/graph-facts/dependency-calls.d.ts +86 -0
- package/dist/graph-facts/dependency-calls.d.ts.map +1 -0
- package/dist/graph-facts/dependency-calls.js +93 -0
- package/dist/graph-facts/dependency-calls.js.map +1 -0
- package/dist/graph-facts/index.d.ts +10 -0
- package/dist/graph-facts/index.d.ts.map +1 -0
- package/dist/graph-facts/index.js +10 -0
- package/dist/graph-facts/index.js.map +1 -0
- package/dist/graph-facts/maven-packages.d.ts +42 -0
- package/dist/graph-facts/maven-packages.d.ts.map +1 -0
- package/dist/graph-facts/maven-packages.js +133 -0
- package/dist/graph-facts/maven-packages.js.map +1 -0
- package/dist/graph-facts/reach.d.ts +203 -0
- package/dist/graph-facts/reach.d.ts.map +1 -0
- package/dist/graph-facts/reach.js +219 -0
- package/dist/graph-facts/reach.js.map +1 -0
- package/dist/graph-facts/removal-reach.d.ts +73 -0
- package/dist/graph-facts/removal-reach.d.ts.map +1 -0
- package/dist/graph-facts/removal-reach.js +64 -0
- package/dist/graph-facts/removal-reach.js.map +1 -0
- package/dist/index.d.ts +21 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/navigation/go-graph.d.ts +68 -0
- package/dist/navigation/go-graph.d.ts.map +1 -0
- package/dist/navigation/go-graph.js +753 -0
- package/dist/navigation/go-graph.js.map +1 -0
- package/dist/navigation/index.d.ts +7 -1
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +6 -0
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/java-entry-tables.d.ts +43 -0
- package/dist/navigation/java-entry-tables.d.ts.map +1 -0
- package/dist/navigation/java-entry-tables.js +56 -0
- package/dist/navigation/java-entry-tables.js.map +1 -0
- package/dist/navigation/java-graph.d.ts +64 -0
- package/dist/navigation/java-graph.d.ts.map +1 -0
- package/dist/navigation/java-graph.js +466 -0
- package/dist/navigation/java-graph.js.map +1 -0
- package/dist/navigation/navigation-index.d.ts +51 -1
- package/dist/navigation/navigation-index.d.ts.map +1 -1
- package/dist/navigation/navigation-index.js +72 -0
- package/dist/navigation/navigation-index.js.map +1 -1
- package/dist/navigation/python-graph.d.ts +73 -0
- package/dist/navigation/python-graph.d.ts.map +1 -0
- package/dist/navigation/python-graph.js +867 -0
- package/dist/navigation/python-graph.js.map +1 -0
- package/dist/navigation/ts-call-edges.d.ts +193 -0
- package/dist/navigation/ts-call-edges.d.ts.map +1 -0
- package/dist/navigation/ts-call-edges.js +2089 -0
- package/dist/navigation/ts-call-edges.js.map +1 -0
- package/dist/navigation/ts-entry-tables.d.ts +88 -0
- package/dist/navigation/ts-entry-tables.d.ts.map +1 -0
- package/dist/navigation/ts-entry-tables.js +50 -0
- package/dist/navigation/ts-entry-tables.js.map +1 -0
- package/dist/path-set/branches.d.ts +52 -0
- package/dist/path-set/branches.d.ts.map +1 -0
- package/dist/path-set/branches.js +124 -0
- package/dist/path-set/branches.js.map +1 -0
- package/dist/path-set/finding-diff.d.ts +63 -0
- package/dist/path-set/finding-diff.d.ts.map +1 -0
- package/dist/path-set/finding-diff.js +150 -0
- package/dist/path-set/finding-diff.js.map +1 -0
- package/dist/path-set/index.d.ts +18 -0
- package/dist/path-set/index.d.ts.map +1 -0
- package/dist/path-set/index.js +12 -0
- package/dist/path-set/index.js.map +1 -0
- package/dist/path-set/line-diff.d.ts +19 -0
- package/dist/path-set/line-diff.d.ts.map +1 -0
- package/dist/path-set/line-diff.js +98 -0
- package/dist/path-set/line-diff.js.map +1 -0
- package/dist/path-set/path-set.d.ts +88 -0
- package/dist/path-set/path-set.d.ts.map +1 -0
- package/dist/path-set/path-set.js +716 -0
- package/dist/path-set/path-set.js.map +1 -0
- package/dist/path-set/templates.d.ts +42 -0
- package/dist/path-set/templates.d.ts.map +1 -0
- package/dist/path-set/templates.js +119 -0
- package/dist/path-set/templates.js.map +1 -0
- package/dist/path-set/types.d.ts +195 -0
- package/dist/path-set/types.d.ts.map +1 -0
- package/dist/path-set/types.js +8 -0
- package/dist/path-set/types.js.map +1 -0
- package/dist/remedy-class/index.d.ts +12 -0
- package/dist/remedy-class/index.d.ts.map +1 -0
- package/dist/remedy-class/index.js +9 -0
- package/dist/remedy-class/index.js.map +1 -0
- package/dist/remedy-class/match.d.ts +165 -0
- package/dist/remedy-class/match.d.ts.map +1 -0
- package/dist/remedy-class/match.js +705 -0
- package/dist/remedy-class/match.js.map +1 -0
- package/dist/remedy-class/output-context.d.ts +25 -0
- package/dist/remedy-class/output-context.d.ts.map +1 -0
- package/dist/remedy-class/output-context.js +150 -0
- package/dist/remedy-class/output-context.js.map +1 -0
- package/dist/remedy-class/sha256.d.ts +18 -0
- package/dist/remedy-class/sha256.d.ts.map +1 -0
- package/dist/remedy-class/sha256.js +89 -0
- package/dist/remedy-class/sha256.js.map +1 -0
- package/dist/remedy-class/table.d.ts +130 -0
- package/dist/remedy-class/table.d.ts.map +1 -0
- package/dist/remedy-class/table.js +457 -0
- package/dist/remedy-class/table.js.map +1 -0
- package/dist/resolution/cross-file.d.ts +9 -0
- package/dist/resolution/cross-file.d.ts.map +1 -1
- package/dist/resolution/cross-file.js +60 -5
- package/dist/resolution/cross-file.js.map +1 -1
- package/dist/stable-ids/builder.d.ts +20 -0
- package/dist/stable-ids/builder.d.ts.map +1 -0
- package/dist/stable-ids/builder.js +65 -0
- package/dist/stable-ids/builder.js.map +1 -0
- package/dist/stable-ids/diff.d.ts +18 -0
- package/dist/stable-ids/diff.d.ts.map +1 -0
- package/dist/stable-ids/diff.js +37 -0
- package/dist/stable-ids/diff.js.map +1 -0
- package/dist/stable-ids/go.d.ts +28 -0
- package/dist/stable-ids/go.d.ts.map +1 -0
- package/dist/stable-ids/go.js +160 -0
- package/dist/stable-ids/go.js.map +1 -0
- package/dist/stable-ids/hash.d.ts +22 -0
- package/dist/stable-ids/hash.d.ts.map +1 -0
- package/dist/stable-ids/hash.js +167 -0
- package/dist/stable-ids/hash.js.map +1 -0
- package/dist/stable-ids/index.d.ts +30 -0
- package/dist/stable-ids/index.d.ts.map +1 -0
- package/dist/stable-ids/index.js +59 -0
- package/dist/stable-ids/index.js.map +1 -0
- package/dist/stable-ids/java.d.ts +28 -0
- package/dist/stable-ids/java.d.ts.map +1 -0
- package/dist/stable-ids/java.js +224 -0
- package/dist/stable-ids/java.js.map +1 -0
- package/dist/stable-ids/moves.d.ts +87 -0
- package/dist/stable-ids/moves.d.ts.map +1 -0
- package/dist/stable-ids/moves.js +222 -0
- package/dist/stable-ids/moves.js.map +1 -0
- package/dist/stable-ids/nodes.d.ts +32 -0
- package/dist/stable-ids/nodes.d.ts.map +1 -0
- package/dist/stable-ids/nodes.js +92 -0
- package/dist/stable-ids/nodes.js.map +1 -0
- package/dist/stable-ids/normalize.d.ts +35 -0
- package/dist/stable-ids/normalize.d.ts.map +1 -0
- package/dist/stable-ids/normalize.js +174 -0
- package/dist/stable-ids/normalize.js.map +1 -0
- package/dist/stable-ids/parse-errors.d.ts +24 -0
- package/dist/stable-ids/parse-errors.d.ts.map +1 -0
- package/dist/stable-ids/parse-errors.js +46 -0
- package/dist/stable-ids/parse-errors.js.map +1 -0
- package/dist/stable-ids/python.d.ts +27 -0
- package/dist/stable-ids/python.d.ts.map +1 -0
- package/dist/stable-ids/python.js +212 -0
- package/dist/stable-ids/python.js.map +1 -0
- package/dist/stable-ids/ts-parse-errors.d.ts +27 -0
- package/dist/stable-ids/ts-parse-errors.d.ts.map +1 -0
- package/dist/stable-ids/ts-parse-errors.js +75 -0
- package/dist/stable-ids/ts-parse-errors.js.map +1 -0
- package/dist/stable-ids/types.d.ts +106 -0
- package/dist/stable-ids/types.d.ts.map +1 -0
- package/dist/stable-ids/types.js +16 -0
- package/dist/stable-ids/types.js.map +1 -0
- package/dist/stable-ids/typescript.d.ts +30 -0
- package/dist/stable-ids/typescript.d.ts.map +1 -0
- package/dist/stable-ids/typescript.js +362 -0
- package/dist/stable-ids/typescript.js.map +1 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +35 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remedy-class matcher: for every sink of a path that a version pair closed,
|
|
3
|
+
* report which row of a caller-supplied `safe-construct-table@0.1` the fixed
|
|
4
|
+
* code matches, or that none does, or that the matcher could not observe a
|
|
5
|
+
* row. Facts only: `class` and `remedyClass` are copied from the table, and
|
|
6
|
+
* nothing here judges whether a fix is adequate.
|
|
7
|
+
*
|
|
8
|
+
* Steps are looked for in the same declaration at the fix version as the
|
|
9
|
+
* baseline sink, on the IR circle-ir already produces: calls (receiver,
|
|
10
|
+
* receiver type, arguments, imports), DFG defs, uses and def-to-def chains,
|
|
11
|
+
* and the fix version's taint sources.
|
|
12
|
+
*
|
|
13
|
+
* Observed: `call` (type, methods, arg, ctor, static), `arg-is: tainted |
|
|
14
|
+
* untainted | from-allowlist`, `arg-literal-in`, `role: sink-replacement |
|
|
15
|
+
* binder | sanitizer | guard | normalizer`, `on`, `name` / `order`, `any`,
|
|
16
|
+
* `all`, `missing`, `sink-removed`. A guard needs branch facts
|
|
17
|
+
* (`deriveBranchFacts`) for the fix version's files. Not observed:
|
|
18
|
+
* `template` and `receiver-from` on a step. A row that needs a step it
|
|
19
|
+
* cannot observe **abstains**; it is never reported as unmatched.
|
|
20
|
+
*
|
|
21
|
+
* Pure: IR in, values out. Browser and Node compatible.
|
|
22
|
+
*/
|
|
23
|
+
import { type BranchFact } from '../path-set/branches.js';
|
|
24
|
+
import type { TemplateFact } from '../path-set/templates.js';
|
|
25
|
+
import { type OutputContext } from './output-context.js';
|
|
26
|
+
import type { DeclRef, PathChange, PathSetDiff } from '../path-set/types.js';
|
|
27
|
+
import type { StableIdFile } from '../stable-ids/types.js';
|
|
28
|
+
import type { ProjectAnalysis } from '../types/index.js';
|
|
29
|
+
import type { ConstructClass, LoadTableResult, TableProblem } from './table.js';
|
|
30
|
+
/** How a call's type was matched to a table type, strongest first. */
|
|
31
|
+
/** `template`: the sink hands its value to a view, and the label comes from the template construct that renders it. */
|
|
32
|
+
export type TypeMatch = 'fqn' | 'import' | 'simple-name' | 'unresolved' | 'any' | 'template';
|
|
33
|
+
export interface StepObservation {
|
|
34
|
+
/** Location of the step in the row, e.g. `/match/all/1`. */
|
|
35
|
+
path: string;
|
|
36
|
+
holds: boolean;
|
|
37
|
+
/** Where the step held (the first witness call), at the fix version. */
|
|
38
|
+
at?: {
|
|
39
|
+
file: string;
|
|
40
|
+
line: number;
|
|
41
|
+
};
|
|
42
|
+
typeMatch?: TypeMatch;
|
|
43
|
+
}
|
|
44
|
+
export interface MatchedRow {
|
|
45
|
+
id: string;
|
|
46
|
+
class: ConstructClass;
|
|
47
|
+
remedyClass: string;
|
|
48
|
+
context?: string;
|
|
49
|
+
steps: StepObservation[];
|
|
50
|
+
}
|
|
51
|
+
export type RemedyMatch = string | 'multiple' | 'unrecognized' | 'abstained';
|
|
52
|
+
export type RemedyReason = 'sink-not-in-table' | 'no-row-holds' | 'step-outside-declaration' | 'declaration-not-found';
|
|
53
|
+
export interface RemedySinkObservation {
|
|
54
|
+
/** `<path key>:sink` */
|
|
55
|
+
anchor: string;
|
|
56
|
+
pathKey: string;
|
|
57
|
+
/**
|
|
58
|
+
* `unchanged`: the path is still open in code at the fix version — observed
|
|
59
|
+
* under `scope: 'all'`, or when `templateChanged` (the fix is in the view).
|
|
60
|
+
*/
|
|
61
|
+
change: Extract<PathChange, 'removed' | 'sanitized' | 'guarded' | 'unchanged'>;
|
|
62
|
+
/** The baseline sink. */
|
|
63
|
+
sink: {
|
|
64
|
+
/** Table sink id, or `unlisted` when no table sink has its call shape. */
|
|
65
|
+
tableSink: string;
|
|
66
|
+
tableSinkMatch?: TypeMatch;
|
|
67
|
+
/** `call`: the sink call itself; `receiver-def`: the call that made its receiver (a constructor). */
|
|
68
|
+
via?: 'call' | 'receiver-def' | 'template';
|
|
69
|
+
/**
|
|
70
|
+
* Only with `outputContext: true`: where in the HTML document the value lands
|
|
71
|
+
* at the fix version, read from the markup written before it; `unknown` when
|
|
72
|
+
* not read or not one context.
|
|
73
|
+
*/
|
|
74
|
+
outputContext?: OutputContext;
|
|
75
|
+
file: string;
|
|
76
|
+
line: number;
|
|
77
|
+
decl: DeclRef;
|
|
78
|
+
};
|
|
79
|
+
/** The view this path hands to renders it differently at the fix version. */
|
|
80
|
+
templateChanged?: true;
|
|
81
|
+
match: RemedyMatch;
|
|
82
|
+
/** Copied from the table, and only when exactly one row matched. */
|
|
83
|
+
class?: ConstructClass;
|
|
84
|
+
/** Every matched row, in table order. */
|
|
85
|
+
rows: MatchedRow[];
|
|
86
|
+
/**
|
|
87
|
+
* Only with `outputContext: true`: rows whose match held but whose `context`
|
|
88
|
+
* is not the observed output context. They are not in `rows`.
|
|
89
|
+
*/
|
|
90
|
+
contextExcludedRows?: {
|
|
91
|
+
id: string;
|
|
92
|
+
context: string;
|
|
93
|
+
}[];
|
|
94
|
+
/** Applicable rows the matcher could not observe, with why. */
|
|
95
|
+
abstainedRows: {
|
|
96
|
+
id: string;
|
|
97
|
+
reason: string;
|
|
98
|
+
}[];
|
|
99
|
+
reason?: RemedyReason;
|
|
100
|
+
/** Taint seeds used for `arg-is` at the fix version. */
|
|
101
|
+
taintSeeds: 'sources' | 'sources+parameters';
|
|
102
|
+
table: {
|
|
103
|
+
format: string;
|
|
104
|
+
cwe: number;
|
|
105
|
+
language: string;
|
|
106
|
+
version: string;
|
|
107
|
+
digest: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export interface RemedyClassResult {
|
|
111
|
+
table: RemedySinkObservation['table'];
|
|
112
|
+
/** Sorted by anchor. */
|
|
113
|
+
sinks: RemedySinkObservation[];
|
|
114
|
+
}
|
|
115
|
+
/** Thrown when the table was refused by the reader: no observation exists on a refused table. */
|
|
116
|
+
export declare class TableRefused extends Error {
|
|
117
|
+
readonly problems: TableProblem[];
|
|
118
|
+
readonly digest: string;
|
|
119
|
+
constructor(digest: string, problems: TableProblem[]);
|
|
120
|
+
}
|
|
121
|
+
export interface RemedyClassOptions {
|
|
122
|
+
/** `ids@0.1` per file at each version, as given to `pathSetDiff`. */
|
|
123
|
+
stableIds?: {
|
|
124
|
+
before?: Record<string, StableIdFile>;
|
|
125
|
+
after?: Record<string, StableIdFile>;
|
|
126
|
+
};
|
|
127
|
+
/** Branch facts per file at the fix version (`deriveBranchFacts`); guard steps need them. */
|
|
128
|
+
branches?: {
|
|
129
|
+
after?: Record<string, BranchFact[]>;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Template facts per template file at each version (`deriveTemplateFacts`).
|
|
133
|
+
* With them, a sink that hands its value to a view is labelled by the table's
|
|
134
|
+
* template sinks and `template` steps are evaluated; without them those rows
|
|
135
|
+
* abstain (`template-not-read`).
|
|
136
|
+
*/
|
|
137
|
+
templates?: {
|
|
138
|
+
before?: Record<string, TemplateFact[]>;
|
|
139
|
+
after?: Record<string, TemplateFact[]>;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* `closed` (default): sinks of paths the fix closed (`removed`, `sanitized`,
|
|
143
|
+
* `guarded`), and of paths whose view now renders them differently
|
|
144
|
+
* (`templateChanged`). `all`: also sinks of paths still open at the fix version
|
|
145
|
+
* (`unchanged`), so a fix that left the path open can be described by the row
|
|
146
|
+
* it used (a weak construct). An open path's observation is a description,
|
|
147
|
+
* not a closed sink.
|
|
148
|
+
*/
|
|
149
|
+
scope?: 'closed' | 'all';
|
|
150
|
+
/**
|
|
151
|
+
* Observe the output context at writer sinks (`sink.outputContext`) and hold
|
|
152
|
+
* a row with a `context` only where it is that context; rows that held in
|
|
153
|
+
* another context go to `contextExcludedRows`. Off by default: without it the
|
|
154
|
+
* result is exactly what it was.
|
|
155
|
+
*/
|
|
156
|
+
outputContext?: boolean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Observe, for every sink of a path `diff` reports `removed` or `sanitized`,
|
|
160
|
+
* which row of `table` the fix version matches.
|
|
161
|
+
*
|
|
162
|
+
* `table` is the reader's result; a refused table throws `TableRefused`.
|
|
163
|
+
*/
|
|
164
|
+
export declare function remedyClassOf(diff: PathSetDiff, before: ProjectAnalysis, after: ProjectAnalysis, loaded: LoadTableResult, options?: RemedyClassOptions): RemedyClassResult;
|
|
165
|
+
//# sourceMappingURL=match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/remedy-class/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAmD,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAY,MAAM,sBAAsB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAA8B,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,KAAK,EACV,cAAc,EAEd,eAAe,EAIf,YAAY,EACb,MAAM,YAAY,CAAC;AAMpB,sEAAsE;AACtE,uHAAuH;AACvH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC;AAE7F,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CA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