@descryy/ir 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/dist/capabilities.d.ts +83 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +91 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/conformance/bind.d.ts +82 -0
- package/dist/conformance/bind.d.ts.map +1 -0
- package/dist/conformance/bind.js +157 -0
- package/dist/conformance/bind.js.map +1 -0
- package/dist/conformance/cli.d.ts +25 -0
- package/dist/conformance/cli.d.ts.map +1 -0
- package/dist/conformance/cli.js +137 -0
- package/dist/conformance/cli.js.map +1 -0
- package/dist/conformance/compare.d.ts +74 -0
- package/dist/conformance/compare.d.ts.map +1 -0
- package/dist/conformance/compare.js +140 -0
- package/dist/conformance/compare.js.map +1 -0
- package/dist/conformance/compose.d.ts +79 -0
- package/dist/conformance/compose.d.ts.map +1 -0
- package/dist/conformance/compose.js +167 -0
- package/dist/conformance/compose.js.map +1 -0
- package/dist/conformance/golden.d.ts +110 -0
- package/dist/conformance/golden.d.ts.map +1 -0
- package/dist/conformance/golden.js +252 -0
- package/dist/conformance/golden.js.map +1 -0
- package/dist/conformance/index.d.ts +26 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +18 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/conformance/manifest-check.d.ts +78 -0
- package/dist/conformance/manifest-check.d.ts.map +1 -0
- package/dist/conformance/manifest-check.js +149 -0
- package/dist/conformance/manifest-check.js.map +1 -0
- package/dist/conformance/manifest.d.ts +83 -0
- package/dist/conformance/manifest.d.ts.map +1 -0
- package/dist/conformance/manifest.js +158 -0
- package/dist/conformance/manifest.js.map +1 -0
- package/dist/conformance/report.d.ts +14 -0
- package/dist/conformance/report.d.ts.map +1 -0
- package/dist/conformance/report.js +87 -0
- package/dist/conformance/report.js.map +1 -0
- package/dist/conformance/run.d.ts +172 -0
- package/dist/conformance/run.d.ts.map +1 -0
- package/dist/conformance/run.js +626 -0
- package/dist/conformance/run.js.map +1 -0
- package/dist/contracts.d.ts +198 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +10 -0
- package/dist/contracts.js.map +1 -0
- package/dist/contradiction.d.ts +112 -0
- package/dist/contradiction.d.ts.map +1 -0
- package/dist/contradiction.js +97 -0
- package/dist/contradiction.js.map +1 -0
- package/dist/finding.d.ts +567 -0
- package/dist/finding.d.ts.map +1 -0
- package/dist/finding.js +491 -0
- package/dist/finding.js.map +1 -0
- package/dist/hypothesis.d.ts +130 -0
- package/dist/hypothesis.d.ts.map +1 -0
- package/dist/hypothesis.js +116 -0
- package/dist/hypothesis.js.map +1 -0
- package/dist/identity.d.ts +295 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +404 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/ir.d.ts +360 -0
- package/dist/ir.d.ts.map +1 -0
- package/dist/ir.js +76 -0
- package/dist/ir.js.map +1 -0
- package/dist/model-tables.d.ts +111 -0
- package/dist/model-tables.d.ts.map +1 -0
- package/dist/model-tables.js +103 -0
- package/dist/model-tables.js.map +1 -0
- package/dist/normalise.d.ts +114 -0
- package/dist/normalise.d.ts.map +1 -0
- package/dist/normalise.js +603 -0
- package/dist/normalise.js.map +1 -0
- package/dist/reliability.d.ts +89 -0
- package/dist/reliability.d.ts.map +1 -0
- package/dist/reliability.js +181 -0
- package/dist/reliability.js.map +1 -0
- package/dist/tool-surface.d.ts +131 -0
- package/dist/tool-surface.d.ts.map +1 -0
- package/dist/tool-surface.js +133 -0
- package/dist/tool-surface.js.map +1 -0
- package/dist/vocabulary.d.ts +73 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +150 -0
- package/dist/vocabulary.js.map +1 -0
- package/package.json +27 -0
package/dist/identity.js
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node and edge identity.
|
|
3
|
+
*
|
|
4
|
+
* The single most consequential property here is that a node ID survives a file
|
|
5
|
+
* move or rename. Incident links, `CHANGES_WITH` weights and every compounding
|
|
6
|
+
* asset in the product are keyed to node identity — path-derived IDs churn on
|
|
7
|
+
* rename and reset all of it silently, with nothing in the output to reveal that
|
|
8
|
+
* it happened.
|
|
9
|
+
*
|
|
10
|
+
* A node ID is `hash(scopeOf(kind), language, kind, qualifiedSymbolPath)`.
|
|
11
|
+
*
|
|
12
|
+
* Neither of the first two fields is decoration. **Scope** is per node type, so a
|
|
13
|
+
* caller in one repository and a route in another land on one `API_ENDPOINT`
|
|
14
|
+
* instead of two that never meet. **Language** keeps `models.Order` in two
|
|
15
|
+
* languages apart, which module-qualified paths alone do not — that is the
|
|
16
|
+
* ordinary layout of a polyglot monorepo, and a collision there merges two
|
|
17
|
+
* unrelated symbols and pools their edges without a word in the output.
|
|
18
|
+
*
|
|
19
|
+
* See DEC-054 (scope and language), DEC-004 (exclude file path) and DEC-011 (the
|
|
20
|
+
* per-type qualified symbol path table, and the schema tag).
|
|
21
|
+
*/
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
|
+
import { isFilelessNodeType, NODE_TYPES } from "./vocabulary.js";
|
|
24
|
+
/**
|
|
25
|
+
* Schema tag on every node ID. Costs three bytes and gives IR schema migration
|
|
26
|
+
* (§32 item 14 / DEC-017) a handle: a stored graph whose IDs carry a different
|
|
27
|
+
* tag is recognisably from a different identity scheme rather than silently
|
|
28
|
+
* mismatching.
|
|
29
|
+
*
|
|
30
|
+
* `n1:`/`e1:` were `hash(repo, kind, qsp)`. DEC-054 moved them to `n2:`/`e2:`,
|
|
31
|
+
* and that bump is the first real exercise of the mechanism — performed while
|
|
32
|
+
* there are zero stored graphs, because the alternative is discovering its bugs
|
|
33
|
+
* against half a million nodes and earned data that cannot be rebuilt.
|
|
34
|
+
*/
|
|
35
|
+
export const NODE_ID_PREFIX = "n2:";
|
|
36
|
+
export const EDGE_ID_PREFIX = "e2:";
|
|
37
|
+
/**
|
|
38
|
+
* The DEC-054 scope table.
|
|
39
|
+
*
|
|
40
|
+
* The rule it encodes, which should be derivable from the table without reading
|
|
41
|
+
* the decision: **a source artefact belongs to a repository, a contract belongs
|
|
42
|
+
* to a system, and earned knowledge belongs to whoever earned it.**
|
|
43
|
+
*
|
|
44
|
+
* `API_ROUTE` is repo-scoped and `API_ENDPOINT` is workspace-scoped, and that
|
|
45
|
+
* asymmetry is the entire contract mechanism:
|
|
46
|
+
*
|
|
47
|
+
* API_ROUTE ──SERVES_API──▶ API_ENDPOINT ◀──USES_API── caller
|
|
48
|
+
* (repo) (workspace)
|
|
49
|
+
*
|
|
50
|
+
* Widening `API_ROUTE` to match would collapse two services' handlers for one
|
|
51
|
+
* path into a single node and destroy the only question worth asking — *which
|
|
52
|
+
* service serves it* — while leaving the join count unchanged, so nothing in the
|
|
53
|
+
* output would reveal the loss.
|
|
54
|
+
*
|
|
55
|
+
* `MODEL` and `DTO` stay repo-scoped deliberately. Widening them would join a
|
|
56
|
+
* `Company` in one language to a `Company` in another on the strength of a
|
|
57
|
+
* shared word; §13.2's mechanism is shape comparison at R3, not identifiers. An
|
|
58
|
+
* endpoint template is safe to key on because both sides literally transmit it.
|
|
59
|
+
*
|
|
60
|
+
* `INCIDENT` and `FIX_PATTERN` are workspace *provisionally*. Global is the
|
|
61
|
+
* attractive answer and may yet be right, but they are the two types DEC-017
|
|
62
|
+
* says must survive a rebuild — so they are the only two where widening later is
|
|
63
|
+
* lossy, because the earned facts on a merged node cannot be re-derived apart.
|
|
64
|
+
* Widening is the safe direction to defer; un-merging is not a direction.
|
|
65
|
+
*/
|
|
66
|
+
export const NODE_SCOPE = {
|
|
67
|
+
FILE: "repo",
|
|
68
|
+
FUNCTION: "repo",
|
|
69
|
+
CLASS: "repo",
|
|
70
|
+
MODULE: "repo",
|
|
71
|
+
API_ROUTE: "repo",
|
|
72
|
+
MODEL: "repo",
|
|
73
|
+
DTO: "repo",
|
|
74
|
+
COMPONENT: "repo",
|
|
75
|
+
PAGE: "repo",
|
|
76
|
+
TEST_CASE: "repo",
|
|
77
|
+
API_ENDPOINT: "workspace",
|
|
78
|
+
DATABASE_TABLE: "workspace",
|
|
79
|
+
DATABASE_COLUMN: "workspace",
|
|
80
|
+
INCIDENT: "workspace",
|
|
81
|
+
FIX_PATTERN: "workspace",
|
|
82
|
+
};
|
|
83
|
+
/** Node types whose identity crosses a repository boundary. */
|
|
84
|
+
export const WORKSPACE_SCOPED_NODE_TYPES = NODE_TYPES.filter((type) => NODE_SCOPE[type] === "workspace");
|
|
85
|
+
/**
|
|
86
|
+
* A bare string used to be accepted here and normalised to `{ repo: scope }`.
|
|
87
|
+
*
|
|
88
|
+
* **DEC-321 measured what that convenience cost.** Six adapters passed
|
|
89
|
+
* `active.root.workspace ?? active.root.repo` — a bare string — and when a
|
|
90
|
+
* workspace was configured its name became the *repo* for every repo-scoped node
|
|
91
|
+
* type. Two unrelated classes in two services under one workspace hashed to the
|
|
92
|
+
* same id and pooled their edges, with no error and nothing to see. The loose
|
|
93
|
+
* type is what allowed the identical mistake six times, so it is gone.
|
|
94
|
+
*
|
|
95
|
+
* The refusal is at runtime as well as in the type: `descry-adapters` compiles
|
|
96
|
+
* separately and ships on its own cadence, so a type-only fix would leave every
|
|
97
|
+
* already-built adapter collapsing in silence. Rule 2 from the other side —
|
|
98
|
+
* refuse rather than guess which of the two the caller meant.
|
|
99
|
+
*/
|
|
100
|
+
function assertScope(scope) {
|
|
101
|
+
if (typeof scope !== "object" || scope === null) {
|
|
102
|
+
throw new TypeError(`scope must be an IdentityScope ({ repo, workspace? }), got ${JSON.stringify(scope)} — ` +
|
|
103
|
+
"a bare string silently made the workspace the repo (DEC-321)");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The scope string that actually enters the hash, per DEC-054's table.
|
|
108
|
+
*
|
|
109
|
+
* The value must be **byte-identical** across every repository in a workspace.
|
|
110
|
+
* `billing-platform` in one config and `billing_platform` in another yields a
|
|
111
|
+
* graph that is structurally perfect, internally consistent, and joins nothing —
|
|
112
|
+
* zero joins, zero errors, zero warnings. That is why the workspace id is
|
|
113
|
+
* declared once and validated at the boundary rather than restated per repo.
|
|
114
|
+
*/
|
|
115
|
+
export function scopeOf(kind, scope) {
|
|
116
|
+
assertScope(scope);
|
|
117
|
+
const { repo, workspace } = scope;
|
|
118
|
+
if (repo === "")
|
|
119
|
+
throw new TypeError("scopeOf: repo must not be empty");
|
|
120
|
+
if (NODE_SCOPE[kind] === "repo")
|
|
121
|
+
return repo;
|
|
122
|
+
if (workspace === undefined || workspace === "")
|
|
123
|
+
return repo;
|
|
124
|
+
return workspace;
|
|
125
|
+
}
|
|
126
|
+
/** First 128 bits of SHA-256, hex. Collision risk is not a practical concern at repo scale. */
|
|
127
|
+
function hash128(input) {
|
|
128
|
+
return createHash("sha256").update(input, "utf8").digest("hex").slice(0, 32);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Deterministic JSON: object keys sorted, arrays order-preserving.
|
|
132
|
+
*
|
|
133
|
+
* Two structurally equal values must serialise byte-identically regardless of
|
|
134
|
+
* key insertion order, or identity depends on the order an adapter happened to
|
|
135
|
+
* build its objects in.
|
|
136
|
+
*/
|
|
137
|
+
export function canonicalJson(value) {
|
|
138
|
+
if (value === null)
|
|
139
|
+
return "null";
|
|
140
|
+
const t = typeof value;
|
|
141
|
+
if (t === "number") {
|
|
142
|
+
if (!Number.isFinite(value)) {
|
|
143
|
+
throw new TypeError(`canonicalJson: non-finite number (${String(value)})`);
|
|
144
|
+
}
|
|
145
|
+
return JSON.stringify(value);
|
|
146
|
+
}
|
|
147
|
+
if (t === "string" || t === "boolean")
|
|
148
|
+
return JSON.stringify(value);
|
|
149
|
+
if (t === "undefined") {
|
|
150
|
+
throw new TypeError("canonicalJson: undefined is not serialisable");
|
|
151
|
+
}
|
|
152
|
+
if (t === "bigint" || t === "function" || t === "symbol") {
|
|
153
|
+
throw new TypeError(`canonicalJson: unsupported type ${t}`);
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(value)) {
|
|
156
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
157
|
+
}
|
|
158
|
+
const obj = value;
|
|
159
|
+
const keys = Object.keys(obj).sort();
|
|
160
|
+
const parts = [];
|
|
161
|
+
for (const k of keys) {
|
|
162
|
+
const v = obj[k];
|
|
163
|
+
if (v === undefined)
|
|
164
|
+
continue; // absent and explicitly-undefined are the same thing
|
|
165
|
+
parts.push(`${JSON.stringify(k)}:${canonicalJson(v)}`);
|
|
166
|
+
}
|
|
167
|
+
return `{${parts.join(",")}}`;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* `n2:` + hash(scopeOf(kind), language, kind, qualified symbol path).
|
|
171
|
+
*
|
|
172
|
+
* Note what is absent: file path, line number, and `attrs`. A function that moves
|
|
173
|
+
* between files is the same function; a node whose attributes change is the same
|
|
174
|
+
* node.
|
|
175
|
+
*
|
|
176
|
+
* `language` is required rather than defaulted. Defaulting it to `null` would let
|
|
177
|
+
* a forgotten argument produce an id that quietly fails to match the one the
|
|
178
|
+
* adapter computes — a missing join with nothing to see. An identity change is
|
|
179
|
+
* exactly the moment every call site should have to be looked at.
|
|
180
|
+
*
|
|
181
|
+
* **`language` is now part of identity, which makes it a vocabulary rather than a
|
|
182
|
+
* free string.** Two producers describing the same artefact as `typescript` and
|
|
183
|
+
* `tsx` emit different nodes for the same symbol and never merge. Before DEC-054
|
|
184
|
+
* the field was descriptive; it is load-bearing now.
|
|
185
|
+
*/
|
|
186
|
+
export function nodeId(scope, kind, qualifiedSymbolPath, language) {
|
|
187
|
+
if (qualifiedSymbolPath === "") {
|
|
188
|
+
throw new TypeError("nodeId: qualifiedSymbolPath must not be empty");
|
|
189
|
+
}
|
|
190
|
+
// A fileless type belongs to no source and therefore to no language (DEC-014),
|
|
191
|
+
// and the Normaliser *sets* `language: null` on an API_ENDPOINT regardless of
|
|
192
|
+
// what the adapter said. Left unguarded, an adapter that hashed with its own
|
|
193
|
+
// language would compute an id that disagrees with the node it produced — the
|
|
194
|
+
// failure would appear as a join that silently does not happen.
|
|
195
|
+
if (language !== null && isFilelessNodeType(kind)) {
|
|
196
|
+
throw new TypeError(`nodeId: ${kind} has no language and must be hashed with null, got ${JSON.stringify(language)}`);
|
|
197
|
+
}
|
|
198
|
+
return (NODE_ID_PREFIX +
|
|
199
|
+
hash128(canonicalJson([scopeOf(kind, scope), language, kind, qualifiedSymbolPath])));
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* `e2:` + hash(from, to, type). See DEC-012.
|
|
203
|
+
*
|
|
204
|
+
* Deliberately excludes `resolution`, `confidence` and `producedBy`: two adapters
|
|
205
|
+
* finding the same relationship produce the same edge, which is what makes the
|
|
206
|
+
* merge policy possible. In prior-art graphs 30% of edges were exact duplicates,
|
|
207
|
+
* so this is load-bearing rather than tidy.
|
|
208
|
+
*/
|
|
209
|
+
export function edgeId(from, to, type) {
|
|
210
|
+
return EDGE_ID_PREFIX + hash128(canonicalJson([from, to, type]));
|
|
211
|
+
}
|
|
212
|
+
const PROMPT_VERSION_PREFIX = "pv1:";
|
|
213
|
+
/**
|
|
214
|
+
* A stable identifier for one model-slot prompt's exact rendered text.
|
|
215
|
+
*
|
|
216
|
+
* `recording/writer.ts`'s `StartRunOptions.promptVersion` exists to carry
|
|
217
|
+
* this — `ai-layer-plan.md` §9 layer 4/layer 7's "invalidated by a prompt
|
|
218
|
+
* change" and "a golden that silently triples in cost after a prompt change
|
|
219
|
+
* is a regression" both need a real value here — and until now nothing
|
|
220
|
+
* computed one; that field's own doc reads *"No model layer exists yet, so
|
|
221
|
+
* always null today."* P25 (§11 Phase 5).
|
|
222
|
+
*
|
|
223
|
+
* Same hashing convention as {@link nodeId}/{@link edgeId} — first 128 bits
|
|
224
|
+
* of SHA-256, prefixed so a stored value is recognisably a prompt version
|
|
225
|
+
* rather than a node or edge id that happened to land in the same column.
|
|
226
|
+
* Hashes the **whole rendered prompt text**, not a caller-chosen label: a
|
|
227
|
+
* label is something a person remembers to update, a hash cannot be
|
|
228
|
+
* forgotten to change, and any difference — including whitespace — produces
|
|
229
|
+
* a different version, which is exactly the precision a looser comparison
|
|
230
|
+
* (trimmed, or blind to template placeholders) would miss.
|
|
231
|
+
*
|
|
232
|
+
* **Disclosed gap, same shape as every gate function before it in this
|
|
233
|
+
* plan:** `descry-desktop/packages/pipeline`'s model slots
|
|
234
|
+
* (`root-cause-analysis.ts`'s `NAME_LEVEL_SYSTEM_PROMPT` and its siblings)
|
|
235
|
+
* are this function's intended caller. None calls it yet — wiring it in, and
|
|
236
|
+
* republishing `@descryy/ir` so that repository can consume it, is
|
|
237
|
+
* follow-up work, not built here.
|
|
238
|
+
*/
|
|
239
|
+
export function promptVersion(promptText) {
|
|
240
|
+
return PROMPT_VERSION_PREFIX + hash128(promptText);
|
|
241
|
+
}
|
|
242
|
+
const FINDING_FINGERPRINT_PREFIX = "ff1:";
|
|
243
|
+
/**
|
|
244
|
+
* A stable identity for one *shape* of finding — the key a dismissal ledger
|
|
245
|
+
* stores, so dismissing a finding suppresses the same claim on a later run
|
|
246
|
+
* without suppressing a different one that merely reads similarly.
|
|
247
|
+
*
|
|
248
|
+
* Architecture §20.1's funnel has always had an `F2` filter — *"known false
|
|
249
|
+
* positives from the feedback store"* — and §21.3 calls that store *"the real
|
|
250
|
+
* learning loop, not a cosmetic feature."* Neither had an implementation, and
|
|
251
|
+
* neither could until a finding had an identity that survives a re-run. This
|
|
252
|
+
* is that identity.
|
|
253
|
+
*
|
|
254
|
+
* **What it is over, and why each part earns its place:**
|
|
255
|
+
*
|
|
256
|
+
* - `finding`, `scope` — the claim, and what was being checked.
|
|
257
|
+
* - `affectedComponents` — node ids, which are `hash(repo, kind, qualified
|
|
258
|
+
* symbol path)` and carry no file path, so a dismissal survives a rename.
|
|
259
|
+
* The identity rule doing exactly the work it exists for.
|
|
260
|
+
* - the graph path's edges — the structural route the claim rests on. Same
|
|
261
|
+
* words about the same component via a different path is a different claim.
|
|
262
|
+
* - **`resolutionLevel`, per §21.3 explicitly**: corrections are stored *"with
|
|
263
|
+
* the resolution level at which the finding was produced… A false positive
|
|
264
|
+
* generated at R1 and one generated at R3 have different causes and should
|
|
265
|
+
* not suppress each other blindly."*
|
|
266
|
+
*
|
|
267
|
+
* **Deliberately excluded:** `recommendedAction`, `evidence`,
|
|
268
|
+
* `verificationStatus` — prose and per-run detail. A model rewording its own
|
|
269
|
+
* advice must not resurrect a finding the developer already dismissed.
|
|
270
|
+
*
|
|
271
|
+
* Lives here rather than in the funnel that consumes it for the reason
|
|
272
|
+
* `DEC-NEXT-edge-id-prefix-split` was filed: an identity gets one
|
|
273
|
+
* implementation, in the module named for identity, or it drifts.
|
|
274
|
+
*/
|
|
275
|
+
export function findingFingerprint(finding) {
|
|
276
|
+
return (FINDING_FINGERPRINT_PREFIX +
|
|
277
|
+
hash128(canonicalJson([
|
|
278
|
+
finding.finding,
|
|
279
|
+
finding.scope,
|
|
280
|
+
[...finding.affectedComponents].sort(),
|
|
281
|
+
finding.graphPath.map((hop) => [hop.from, hop.to, hop.edgeType]),
|
|
282
|
+
Number(finding.resolutionLevel),
|
|
283
|
+
])));
|
|
284
|
+
}
|
|
285
|
+
// ---------------------------------------------------------------------------
|
|
286
|
+
// Qualified symbol paths — the DEC-011 table, encoded so adapters cannot drift.
|
|
287
|
+
// ---------------------------------------------------------------------------
|
|
288
|
+
/**
|
|
289
|
+
* Erase every parameter segment to the literal token `{param}`.
|
|
290
|
+
*
|
|
291
|
+
* `/orders/:id`, `/orders/{order_id}`, `/orders/<int:id>` and `/orders/[id]` all
|
|
292
|
+
* normalise to `/orders/{param}`. This is what makes one `API_ENDPOINT` node out
|
|
293
|
+
* of two adapters that never share a line of code — the cross-language join.
|
|
294
|
+
*
|
|
295
|
+
* Position is preserved by path structure, so distinct routes cannot collide:
|
|
296
|
+
* `/orders/{param}/items/{param}` stays distinct from `/orders/{param}`.
|
|
297
|
+
*
|
|
298
|
+
* See DEC-013. Base paths, router mounts and gateway rewrites remain open
|
|
299
|
+
* (architecture §32 item 16) — this handles the segment shape only.
|
|
300
|
+
*
|
|
301
|
+
* ## The query string is not part of the identity, and leaving it in broke joins
|
|
302
|
+
*
|
|
303
|
+
* **Found on real code, by a lane whose own gates could not see it.** A caller
|
|
304
|
+
* writes `GET /api/invoices?company_id={param}`; the route producer writes
|
|
305
|
+
* `GET /api/invoices`, because no routing framework declares a query in its
|
|
306
|
+
* path. With the query left in, the two hash to different endpoints and the
|
|
307
|
+
* join returns **nothing** — no error, no rejection, no ledger row. Five such
|
|
308
|
+
* calls ship today across two repositories.
|
|
309
|
+
*
|
|
310
|
+
* The defect survived a 100/100 precision draw with a 0/100 control on both
|
|
311
|
+
* sides, because the adjudicator compares an edge against the source text and
|
|
312
|
+
* the source really does write `?company_id=`. Every instrument was asking *did
|
|
313
|
+
* you read this call correctly* and none was asking *can this identity ever
|
|
314
|
+
* join* — the same shape as DEC-112, one layer down: the reader and its grader
|
|
315
|
+
* shared an assumption, so no amount of grading escaped it.
|
|
316
|
+
*
|
|
317
|
+
* **A query string cannot distinguish two endpoints here**, because only
|
|
318
|
+
* consumers write one. Two callers differing only by query are reaching the
|
|
319
|
+
* same route, so collapsing them is the correct merge rather than a lossy one.
|
|
320
|
+
* The residual limit is real and disclosed rather than modelled: an API that
|
|
321
|
+
* *routes* on a query parameter — `?action=create` dispatching separately from
|
|
322
|
+
* `?action=delete` — collapses to one endpoint here. No producer in this
|
|
323
|
+
* project emits such a route, and inventing identity for one nobody declares
|
|
324
|
+
* would be the guess this rule exists to prevent.
|
|
325
|
+
*/
|
|
326
|
+
export function normaliseEndpointPath(path) {
|
|
327
|
+
// Before anything else, and before the trailing-slash trim in particular:
|
|
328
|
+
// `/orders/?page=2` must reach the same identity as `/orders`, which it
|
|
329
|
+
// cannot if the slash is examined while a query is still attached.
|
|
330
|
+
const pathOnly = path.split(/[?#]/, 1)[0] ?? "";
|
|
331
|
+
const withLeadingSlash = pathOnly.startsWith("/") ? pathOnly : `/${pathOnly}`;
|
|
332
|
+
// A router-mount-path concatenation (`app.use('/api/', router)` +
|
|
333
|
+
// `router.get('/orders', ...)`) can produce a run of slashes in source
|
|
334
|
+
// text. Collapsed before the trailing-slash trim, for the same reason the
|
|
335
|
+
// query is stripped first: examining a slash while another slash-shaped
|
|
336
|
+
// artifact sits next to it reads the wrong boundary.
|
|
337
|
+
const collapsed = withLeadingSlash.replace(/\/+/g, "/");
|
|
338
|
+
const trimmed = collapsed.length > 1 && collapsed.endsWith("/") ? collapsed.slice(0, -1) : collapsed;
|
|
339
|
+
const segments = trimmed.split("/").map((seg) => {
|
|
340
|
+
if (seg === "")
|
|
341
|
+
return seg;
|
|
342
|
+
const isParam = seg.startsWith(":") || // Express, Rails :id
|
|
343
|
+
seg.startsWith("*") || // splat *rest
|
|
344
|
+
(seg.startsWith("{") && seg.endsWith("}")) || // OpenAPI, FastAPI {id} {id:guid}
|
|
345
|
+
(seg.startsWith("<") && seg.endsWith(">")) || // Flask <int:id>
|
|
346
|
+
(seg.startsWith("[") && seg.endsWith("]")); // Next.js [id] [...slug]
|
|
347
|
+
return isParam ? "{param}" : seg;
|
|
348
|
+
});
|
|
349
|
+
return segments.join("/") || "/";
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Qualified symbol path for an `API_ENDPOINT`: `METHOD /normalised/path`.
|
|
353
|
+
* This value IS the endpoint's identity, which is why normalisation must be
|
|
354
|
+
* applied before hashing rather than after.
|
|
355
|
+
*/
|
|
356
|
+
export function endpointQsp(method, path) {
|
|
357
|
+
return `${method.toUpperCase()} ${normaliseEndpointPath(path)}`;
|
|
358
|
+
}
|
|
359
|
+
/** Qualified symbol path for a `DATABASE_TABLE` or `DATABASE_COLUMN`. */
|
|
360
|
+
export function tableQsp(schema, table, column) {
|
|
361
|
+
const base = `${schema}.${table}`;
|
|
362
|
+
return column === undefined ? base : `${base}.${column}`;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Qualified symbol path for a `TEST_CASE`: `pkg::suite::case`.
|
|
366
|
+
*
|
|
367
|
+
* **The package root is part of it, exactly as it is for a code symbol.**
|
|
368
|
+
* `symbolQsp` has carried it since DEC-047, and this did not — so a test's
|
|
369
|
+
* qualifier was its module path *relative to its own package anchor*, with the
|
|
370
|
+
* anchor thrown away. Five Strapi packages each ship
|
|
371
|
+
* `admin/src/translations/tests/plural.test.ts` with the same titles, and all
|
|
372
|
+
* five hashed to one node: 42 cross-file collisions dropping 86 test cases on
|
|
373
|
+
* one repository, and 0 on either repository this was built against.
|
|
374
|
+
*
|
|
375
|
+
* `occurrence` distinguishes two cases a runner would report identically. Two
|
|
376
|
+
* `it("…")` calls with the same title in one describe block are legal and
|
|
377
|
+
* common — 57 pairs on Rocket.Chat, 30 on Strapi — and they are two different
|
|
378
|
+
* tests. Merging them loses one; numbering them keeps both. Only the second and
|
|
379
|
+
* later carry a suffix, so the common case is unchanged.
|
|
380
|
+
*/
|
|
381
|
+
export function testCaseQsp(pkg, suite, caseName, occurrence = 1) {
|
|
382
|
+
const title = [...suite, caseName].join("::");
|
|
383
|
+
return `${pkg}::${occurrence > 1 ? `${title}::#${occurrence}` : title}`;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Qualified symbol path for a code symbol: `pkg::Namespace.Symbol`.
|
|
387
|
+
* `pkg` is the module/package root, not a file path.
|
|
388
|
+
*/
|
|
389
|
+
export function symbolQsp(pkg, symbolPath) {
|
|
390
|
+
return `${pkg}::${symbolPath.join(".")}`;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Qualified symbol path for a `FILE`: the repo-relative path.
|
|
394
|
+
*
|
|
395
|
+
* This is the documented path-fallback in DEC-004. It is unavoidable — a file's
|
|
396
|
+
* only stable name IS its path — and it has a real consequence: `CHANGES_WITH`
|
|
397
|
+
* weights are file-to-file, so they churn on rename unless the rename-detection
|
|
398
|
+
* pass rewrites them. DEC-004's guarantee is total for symbols and partial for
|
|
399
|
+
* files, and that asymmetry is deliberate rather than overlooked.
|
|
400
|
+
*/
|
|
401
|
+
export function fileQsp(repoRelativePath) {
|
|
402
|
+
return repoRelativePath;
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAiB,MAAM,iBAAiB,CAAC;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAkBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,MAAM;IACb,GAAG,EAAE,MAAM;IACX,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,MAAM;IAEjB,YAAY,EAAE,WAAW;IACzB,cAAc,EAAE,WAAW;IAC3B,eAAe,EAAE,WAAW;IAE5B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,WAAW;CACiC,CAAC;AAI5D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAwB,UAAU,CAAC,MAAM,CAC/E,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,WAAW,CAC3C,CAAC;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AC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,GAAG,GAAG,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,UAA6B;IAClE,OAAO,GAAG,GAAG,KAAK,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,gBAAwB;IAC9C,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @descryy/ir — the Canonical IR boundary.
|
|
3
|
+
*
|
|
4
|
+
* Zero runtime dependencies, by design. Everything above this package is
|
|
5
|
+
* language-blind; everything below it is language-aware. `descry-adapters`
|
|
6
|
+
* depends on this package and nothing else in the engine, which makes the IR
|
|
7
|
+
* boundary a dependency-direction fact rather than a convention.
|
|
8
|
+
*/
|
|
9
|
+
export { NODE_TYPES, EDGE_TYPES, FILELESS_NODE_TYPES, TYPE_LIKE_NODE_TYPES, CALLABLE_NODE_TYPES, isNodeType, isEdgeType, isFilelessNodeType, isTypeLikeNodeType, isCallableNodeType, } from "./vocabulary.ts";
|
|
10
|
+
export type { NodeType, EdgeType } from "./vocabulary.ts";
|
|
11
|
+
export { RESOLUTION_LEVELS, UNRESOLVED_REF_CLASSES, SKIP_REASONS } from "./ir.ts";
|
|
12
|
+
export type { ResolutionLevel, Range, IRNode, IREdge, IRBatch, UnresolvedRef, UnresolvedRefClass, ConfirmedFact, CrossLanguageDeclaration, SkippedFile, SkipReason, } from "./ir.ts";
|
|
13
|
+
export { RELIABILITY_CLASSES, reliabilityCap, reliabilityNote } from "./reliability.ts";
|
|
14
|
+
export type { ReliabilityClass } from "./reliability.ts";
|
|
15
|
+
export { RESULT_STATES, TOOL_CLASSES, isResultState, isToolClass } from "./tool-surface.ts";
|
|
16
|
+
export type { ResultState, ToolClass } from "./tool-surface.ts";
|
|
17
|
+
export { ENVIRONMENT_LEVELS, EVIDENCE_CATEGORIES, FAULT_LAYER_CONFIDENCES, FAULT_LAYERS, FINDING_FIELDS, REPORT_CATEGORIES, RUNTIME_SIGNAL_TYPES, RederivationError, SIGNAL_TYPE_COUNTS, classifyFaultLayer, directMechanismEvidence, evidencePrecondition, faultLayerConfidence, humanAssertedOnPath, independentSignalTypes, minimumResolution, rederive, reportCategory, } from "./finding.ts";
|
|
18
|
+
export type { DerivationBrand, Derived, EnvironmentLevel, EvidenceCategory, FaultLayer, FaultLayerConfidence, Finding, FindingField, FindingRecord, G4Inputs, G4Result, GraphPathHop, ReportCategory, RuntimeEvidence, RuntimeSignalType, SignalTypeCount, UntestedScope, VerificationStatus, } from "./finding.ts";
|
|
19
|
+
export { detectGraphRuntimeContradiction, findGraphRuntimeContradictions, toGraphDefectRecord, } from "./contradiction.ts";
|
|
20
|
+
export type { GraphDefectRecord, GraphRuntimeContradiction, RuntimeEdgeObservation, } from "./contradiction.ts";
|
|
21
|
+
export { HYPOTHESIS_STATES, TERMINAL_HYPOTHESIS_STATES, UNCONFIRMED_REASONS, deriveHypothesisState, independentEvidenceSources, isTerminalHypothesisState, } from "./hypothesis.ts";
|
|
22
|
+
export type { HypothesisState, HypothesisStateInput, HypothesisStateResult, UnconfirmedReason, } from "./hypothesis.ts";
|
|
23
|
+
export { NODE_ID_PREFIX, EDGE_ID_PREFIX, NODE_SCOPE, WORKSPACE_SCOPED_NODE_TYPES, canonicalJson, nodeId, edgeId, promptVersion, findingFingerprint, scopeOf, normaliseEndpointPath, endpointQsp, tableQsp, testCaseQsp, symbolQsp, fileQsp, } from "./identity.ts";
|
|
24
|
+
export type { IdentityScope, ScopeKind } from "./identity.ts";
|
|
25
|
+
export { DEFAULT_MODEL_SCHEMA, databaseTableNodesFromModel } from "./model-tables.ts";
|
|
26
|
+
export type { ModelFieldShape, ModelTableShape, ModelTableOrigin } from "./model-tables.ts";
|
|
27
|
+
export { REJECTION_CODES, DEFAULT_CONFIDENCE_CEILINGS, normaliseBatch } from "./normalise.ts";
|
|
28
|
+
export type { RejectionCode, Rejection, Clamp, NormaliseResult, NormaliseOptions, } from "./normalise.ts";
|
|
29
|
+
export { ANY_TARGET, EDGE_TYPE_ALTERNATIVES, GoldenError, ManifestError, UNMAPPED_ATTR_NODE_TYPES, acceptedEdgeTypes, attrsSubset, bindRoles, conformanceCli, parseArgs, formatReport, formatSweepReport, goldenRoles, loadGolden, loadManifest, mapFieldNames, parseGolden, parseManifest, checkManifest, composeSources, patternRoles, runConformance, runConformanceSweep, samePath, } from "./conformance/index.ts";
|
|
30
|
+
export type { BindFailure, BindResult, ConformanceFinding, ComposedSource, CompositionConflict, ConformanceInput, ConformanceResult, CorpusManifest, FindingKind, Golden, GoldenEdge, GoldenForbiddenEdge, GoldenNode, GoldenPattern, ManifestCheck, ManifestFinding, PatternResult, PatternVerdict, RoleBinding, SweepInput, SweepResult, } from "./conformance/index.ts";
|
|
31
|
+
export type { RepoRoot, FileRef, AnalysisContext, DetectionResult, CapabilityMatrix, ParsedUnit, IRSource, LanguageAdapter, } from "./contracts.ts";
|
|
32
|
+
export { CLIENT_BASE_EXTRACTOR, CLIENT_CALL_EXTRACTOR, FRAMEWORK_CAPABILITIES, ORM_EXTRACTOR, ROUTE_EXTRACTOR, capabilityList, isFrameworkCapability, } from "./capabilities.ts";
|
|
33
|
+
export type { FrameworkCapability } from "./capabilities.ts";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB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Z,cAAc,EACd,mBAAmB,EACnB,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,QAAQ,EACR,OAAO,EACP,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @descryy/ir — the Canonical IR boundary.
|
|
3
|
+
*
|
|
4
|
+
* Zero runtime dependencies, by design. Everything above this package is
|
|
5
|
+
* language-blind; everything below it is language-aware. `descry-adapters`
|
|
6
|
+
* depends on this package and nothing else in the engine, which makes the IR
|
|
7
|
+
* boundary a dependency-direction fact rather than a convention.
|
|
8
|
+
*/
|
|
9
|
+
export { NODE_TYPES, EDGE_TYPES, FILELESS_NODE_TYPES, TYPE_LIKE_NODE_TYPES, CALLABLE_NODE_TYPES, isNodeType, isEdgeType, isFilelessNodeType, isTypeLikeNodeType, isCallableNodeType, } from "./vocabulary.js";
|
|
10
|
+
export { RESOLUTION_LEVELS, UNRESOLVED_REF_CLASSES, SKIP_REASONS } from "./ir.js";
|
|
11
|
+
export { RELIABILITY_CLASSES, reliabilityCap, reliabilityNote } from "./reliability.js";
|
|
12
|
+
export { RESULT_STATES, TOOL_CLASSES, isResultState, isToolClass } from "./tool-surface.js";
|
|
13
|
+
export { ENVIRONMENT_LEVELS, EVIDENCE_CATEGORIES, FAULT_LAYER_CONFIDENCES, FAULT_LAYERS, FINDING_FIELDS, REPORT_CATEGORIES, RUNTIME_SIGNAL_TYPES, RederivationError, SIGNAL_TYPE_COUNTS, classifyFaultLayer, directMechanismEvidence, evidencePrecondition, faultLayerConfidence, humanAssertedOnPath, independentSignalTypes, minimumResolution, rederive, reportCategory, } from "./finding.js";
|
|
14
|
+
export { detectGraphRuntimeContradiction, findGraphRuntimeContradictions, toGraphDefectRecord, } from "./contradiction.js";
|
|
15
|
+
export { HYPOTHESIS_STATES, TERMINAL_HYPOTHESIS_STATES, UNCONFIRMED_REASONS, deriveHypothesisState, independentEvidenceSources, isTerminalHypothesisState, } from "./hypothesis.js";
|
|
16
|
+
export { NODE_ID_PREFIX, EDGE_ID_PREFIX, NODE_SCOPE, WORKSPACE_SCOPED_NODE_TYPES, canonicalJson, nodeId, edgeId, promptVersion, findingFingerprint, scopeOf, normaliseEndpointPath, endpointQsp, tableQsp, testCaseQsp, symbolQsp, fileQsp, } from "./identity.js";
|
|
17
|
+
export { DEFAULT_MODEL_SCHEMA, databaseTableNodesFromModel } from "./model-tables.js";
|
|
18
|
+
export { REJECTION_CODES, DEFAULT_CONFIDENCE_CEILINGS, normaliseBatch } from "./normalise.js";
|
|
19
|
+
export { ANY_TARGET, EDGE_TYPE_ALTERNATIVES, GoldenError, ManifestError, UNMAPPED_ATTR_NODE_TYPES, acceptedEdgeTypes, attrsSubset, bindRoles, conformanceCli, parseArgs, formatReport, formatSweepReport, goldenRoles, loadGolden, loadManifest, mapFieldNames, parseGolden, parseManifest, checkManifest, composeSources, patternRoles, runConformance, runConformanceSweep, samePath, } from "./conformance/index.js";
|
|
20
|
+
export { CLIENT_BASE_EXTRACTOR, CLIENT_CALL_EXTRACTOR, FRAMEWORK_CAPABILITIES, ORM_EXTRACTOR, ROUTE_EXTRACTOR, capabilityList, isFrameworkCapability, } from "./capabilities.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAelF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG5F,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,QAAQ,EACR,cAAc,GACf,MAAM,cAAc,CAAC;AAsBtB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EACL,cAAc,EACd,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,aAAa,EACb,MAAM,EACN,MAAM,EACN,aAA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