@descryy/runtime-graph-correlator 0.3.0 → 0.4.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.
Files changed (38) hide show
  1. package/LICENSE +6 -0
  2. package/dist/confirm-observed-caller.d.ts +27 -62
  3. package/dist/confirm-observed-caller.d.ts.map +1 -1
  4. package/dist/confirm-observed-caller.js +25 -60
  5. package/dist/confirm-observed-caller.js.map +1 -1
  6. package/dist/cross-service-call.d.ts +42 -104
  7. package/dist/cross-service-call.d.ts.map +1 -1
  8. package/dist/cross-service-call.js +42 -107
  9. package/dist/cross-service-call.js.map +1 -1
  10. package/dist/database-table.d.ts +8 -20
  11. package/dist/database-table.d.ts.map +1 -1
  12. package/dist/database-table.js +8 -20
  13. package/dist/database-table.js.map +1 -1
  14. package/dist/endpoint.d.ts +19 -43
  15. package/dist/endpoint.d.ts.map +1 -1
  16. package/dist/endpoint.js +20 -45
  17. package/dist/endpoint.js.map +1 -1
  18. package/dist/frontend-caller.d.ts +15 -37
  19. package/dist/frontend-caller.d.ts.map +1 -1
  20. package/dist/frontend-caller.js +15 -37
  21. package/dist/frontend-caller.js.map +1 -1
  22. package/dist/index.d.ts +5 -9
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +5 -9
  25. package/dist/index.js.map +1 -1
  26. package/dist/log-endpoint.d.ts +14 -35
  27. package/dist/log-endpoint.d.ts.map +1 -1
  28. package/dist/log-endpoint.js +15 -41
  29. package/dist/log-endpoint.js.map +1 -1
  30. package/dist/observed-frontend-caller.d.ts +20 -44
  31. package/dist/observed-frontend-caller.d.ts.map +1 -1
  32. package/dist/observed-frontend-caller.js +21 -51
  33. package/dist/observed-frontend-caller.js.map +1 -1
  34. package/dist/symbol.d.ts +44 -124
  35. package/dist/symbol.d.ts.map +1 -1
  36. package/dist/symbol.js +48 -130
  37. package/dist/symbol.js.map +1 -1
  38. package/package.json +9 -4
@@ -1,49 +1,27 @@
1
1
  /**
2
- * The **first leg** of the path the product requires:
3
- * `Frontend FUNCTION → API_ENDPOINT → API_ROUTE → Backend FUNCTION`.
2
+ * First leg of the path: Frontend FUNCTION -> API_ENDPOINT -> API_ROUTE -> Backend FUNCTION
3
+ * (RUNTIME-CHECKLIST.md §11 covered only the last three). `adapter-typescript` already emits
4
+ * `USES_API` from caller to endpoint, read from source — nothing correlated it until this.
4
5
  *
5
- * `RUNTIME-CHECKLIST.md` §11 states that path and its own boxes covered
6
- * only the last three legs — the audit added a box for the first and marked
7
- * it absent. The graph has had the edge all along: `adapter-typescript`
8
- * emits `USES_API` from a frontend function to the endpoint it calls, read
9
- * from source. Nothing correlated it.
6
+ * **Structural claim, not an observation.** `USES_API` says this function contains a call to that
7
+ * endpoint, not that it issued the request just observed. When several components call one
8
+ * endpoint, the graph names all of them and the browser saw one; nothing in a `NETWORK_REQUEST`
9
+ * says which (Playwright's initiator chain could narrow it; the network collector doesn't capture
10
+ * it today — disclosed gap, §6).
10
11
  *
11
- * ---
12
- *
13
- * **This is a structural claim, and calling it anything else would be the
14
- * central lie this project exists not to tell.**
15
- *
16
- * `USES_API` says *this function contains a call to that endpoint*. It does
17
- * **not** say this function issued the request that was just observed. When
18
- * three components call one endpoint, the graph names all three and the
19
- * browser saw one — and nothing in a `NETWORK_REQUEST` says which. Playwright
20
- * exposes an initiator chain that could narrow it; the network collector
21
- * does not capture it today (§6 records that as a gap), and until it does,
22
- * *which* caller ran is not something this repo knows.
23
- *
24
- * So the outcome vocabulary says so at the type level: a single caller is
25
- * `sole-structural-caller`, never `resolved`. A reader who sees `resolved`
26
- * elsewhere in this package is looking at an observation; here they are
27
- * looking at the only candidate the code admits, which is a different and
28
- * weaker fact even when it happens to be right.
29
- *
30
- * **Consequence for reliability, per the architecture's resolution cap:** a
31
- * finding whose path rests on this leg is capped by the `USES_API` edge's
32
- * own resolution, exactly as any other structural hop is. Extending the
33
- * path does not upgrade the evidence.
12
+ * So a single caller is `sole-structural-caller`, never `resolved` — a weaker fact than an
13
+ * observation even when it happens to be right. A finding resting on this leg is capped by
14
+ * `USES_API`'s own resolution level; extending the path doesn't upgrade the evidence.
34
15
  */
35
16
  import { incoming } from "@descryy/core";
36
17
  import { getNode } from "@descryy/core";
37
18
  /**
38
19
  * Every frontend function the graph says calls this endpoint.
39
20
  *
40
- * Ambiguity is returned to the caller rather than ranked, the same way
41
- * `resolveSymbolNode` and `resolveEndpointNode` refuse it. There is a
42
- * tempting heuristic here — prefer the caller in the file the browser most
43
- * recently loaded, or the one whose line number is nearest the event — and
44
- * both are timing and locality standing in for causality, which §27's own
45
- * rule forbids in one sentence: *similarity must never be treated as
46
- * causality*.
21
+ * Ambiguity is returned, not ranked — same as `resolveSymbolNode` and
22
+ * `resolveEndpointNode`. Preferring the most-recently-loaded file or the
23
+ * nearest line would be timing/locality standing in for causality, which
24
+ * §27 forbids.
47
25
  */
48
26
  export function resolveFrontendCallers(driver, endpointNodeId) {
49
27
  const edges = incoming(driver, endpointNodeId, { types: ["USES_API"] });
@@ -1 +1 @@
1
- {"version":3,"file":"frontend-caller.js","sourceRoot":"","sources":["../src/frontend-caller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAUxC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,cAAsB;IAC9E,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAExE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IA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AO,EAAE,wBAAwB;QACjC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAE;QACjB,MAAM,EACJ,IAAI,OAAO,CAAC,CAAC,CAAE,CAAC,IAAI,oFAAoF;YACxG,0GAA0G;YAC1G,gCAAgC;KACnC,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,9 @@
1
1
  /**
2
- * The graph correlator: resolves runtime evidence to descry-core graph
3
- * nodes. Deliberately does not re-wrap graph-path building — `traceApi`
4
- * (`@descryy/core`) already answers "how does this reach that" end to end,
5
- * `direction: "both"` already crosses the `API_ENDPOINT` join with no extra
6
- * option needed (DEC-228 traced this directly; `crossApiEndpoint` is only
7
- * for `impactOf`'s single-direction walk). A caller resolves both ends here,
8
- * then calls `traceApi` from `@descryy/core` directly — adding a wrapper
9
- * around a function that already does the whole job would be an
10
- * abstraction with nothing behind it.
2
+ * Resolves runtime evidence to descry-core graph nodes. Deliberately does not
3
+ * re-wrap graph-path building — `traceApi` (`@descryy/core`) already answers
4
+ * "how does this reach that" via `direction: "both"` (DEC-228; `crossApiEndpoint`
5
+ * is only for `impactOf`'s single-direction walk). Callers resolve both ends
6
+ * here, then call `traceApi` directly.
11
7
  */
12
8
  export { resolveEndpointNode, resolveEndpointNodesByPath, type EndpointResolution } from "./endpoint.ts";
13
9
  export { resolveSymbolNode, resolveSymbolAcrossRepos, resolveContainingModule, resolveTestCaseNode, type SymbolResolution, type CrossRepoSymbolResolution, type ModuleResolution, type TestCaseResolution, } from "./symbol.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,yB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EAAE,KAAK,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACrH,OAAO,EAAE,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,oCAAoC,EACzC,KAAK,sCAAsC,GAC5C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -1,13 +1,9 @@
1
1
  /**
2
- * The graph correlator: resolves runtime evidence to descry-core graph
3
- * nodes. Deliberately does not re-wrap graph-path building — `traceApi`
4
- * (`@descryy/core`) already answers "how does this reach that" end to end,
5
- * `direction: "both"` already crosses the `API_ENDPOINT` join with no extra
6
- * option needed (DEC-228 traced this directly; `crossApiEndpoint` is only
7
- * for `impactOf`'s single-direction walk). A caller resolves both ends here,
8
- * then calls `traceApi` from `@descryy/core` directly — adding a wrapper
9
- * around a function that already does the whole job would be an
10
- * abstraction with nothing behind it.
2
+ * Resolves runtime evidence to descry-core graph nodes. Deliberately does not
3
+ * re-wrap graph-path building — `traceApi` (`@descryy/core`) already answers
4
+ * "how does this reach that" via `direction: "both"` (DEC-228; `crossApiEndpoint`
5
+ * is only for `impactOf`'s single-direction walk). Callers resolve both ends
6
+ * here, then call `traceApi` directly.
11
7
  */
12
8
  export { resolveEndpointNode, resolveEndpointNodesByPath } from "./endpoint.js";
13
9
  export { resolveSymbolNode, resolveSymbolAcrossRepos, resolveContainingModule, resolveTestCaseNode, } from "./symbol.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAA2B,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GAKpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAiC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAyC,MAAM,+BAA+B,CAAC;AACrH,OAAO,EAAE,wBAAwB,EAAgC,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAMhC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,GAG9B,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAA2B,MAAM,eAAe,CAAC;AACzG,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GAKpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAiC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAyC,MAAM,+BAA+B,CAAC;AACrH,OAAO,EAAE,wBAAwB,EAAgC,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAMhC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,GAG9B,MAAM,8BAA8B,CAAC"}
@@ -1,35 +1,16 @@
1
1
  /**
2
- * Resolving the API endpoint a **backend log line names in its own text** to
3
- * an `API_ENDPOINT` node.
2
+ * Resolves the API endpoint a backend log line names in its own text to an `API_ENDPOINT` node.
4
3
  *
5
- * **Why this exists.** RT-044's measurement, re-run after RT-045, left
6
- * `confirmed` blocked by one precisely-named thing: four evidence items
7
- * share the real request id, but three of them are the same source
8
- * (`browser-network`) and the fourth — the backend exception — resolves to
9
- * the *function* that threw, via its stack. So no node has two independent
10
- * sources in one request, and the top report category is unreachable in
11
- * principle rather than merely unmet.
4
+ * RT-044/RT-045: `confirmed` was blocked because no evidence item had two independent sources for
5
+ * one request — three matched `browser-network`, the fourth (backend exception) resolved to the
6
+ * function via its stack. A backend log line naming the same method+path+request-id as an observed
7
+ * browser request is a second, independent observation of that request from the other side of the
8
+ * wire, closing that gap.
12
9
  *
13
- * The backend's own header line, measured from the real fixture, is:
14
- *
15
- * ```
16
- * [broken-invoices] DELETE /api/invoices/3 failed [request-id=...]: TypeError: ...
17
- * ```
18
- *
19
- * It names the endpoint. A browser saying "I sent DELETE /api/invoices/3"
20
- * and a backend saying "I failed DELETE /api/invoices/3" are **two
21
- * independent observations of one request from opposite sides of the wire**,
22
- * joined by an id the backend itself echoed. That is corroboration in the
23
- * exact sense the gate means, and missing it was a gap in resolution, not a
24
- * property of the evidence.
25
- *
26
- * **What this deliberately does not do.** It does not scan for a bare path.
27
- * A log line mentioning `/api/invoices/3` with no method is not a statement
28
- * that *this* endpoint was exercised — `GET` and `DELETE` on one path are
29
- * different endpoints, and `endpoint.ts` already refuses a method mismatch
30
- * for exactly that reason. Requiring an explicit HTTP method in the text is
31
- * what keeps this from becoming a substring search that resolves whatever
32
- * happens to look familiar (RT-031's identity-proxy class, applied to prose).
10
+ * **Does not scan for a bare path** — `/api/invoices/3` with no method isn't a statement that this
11
+ * endpoint ran (`GET` and `DELETE` on one path are different endpoints, per `endpoint.ts`'s own
12
+ * method-mismatch refusal). Requiring an explicit method keeps this from becoming a substring
13
+ * search (RT-031's identity-proxy class, applied to prose).
33
14
  */
34
15
  import type { SqlDriver } from "@descryy/core";
35
16
  export interface LogEndpointMention {
@@ -55,13 +36,11 @@ export type LogEndpointResolution = {
55
36
  readonly mentions: readonly LogEndpointMention[];
56
37
  };
57
38
  /**
58
- * The endpoint a log line names, when it names exactly one that resolves.
39
+ * The endpoint a log line names, when exactly one resolves.
59
40
  *
60
- * **Two mentions resolving to two different endpoints is refused, not
61
- * ranked.** A line naming several routes (a proxy summary, a batch report)
62
- * genuinely does not identify one, and picking the first would be a
63
- * heuristic standing in for evidence. `endpoint.ts` refuses ambiguity to the
64
- * caller and this inherits that rather than deciding differently.
41
+ * Two mentions resolving to different endpoints is refused, not ranked —
42
+ * picking the first would be a heuristic standing in for evidence, same as
43
+ * `endpoint.ts`'s own ambiguity refusal.
65
44
  */
66
45
  export declare function resolveEndpointFromLogText(driver: SqlDriver, text: string): LogEndpointResolution;
67
46
  //# sourceMappingURL=log-endpoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log-endpoint.d.ts","sourceRoot":"","sources":["../src/log-endpoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAY/C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,gKAAgK;AAChK,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,kBAAkB,EAAE,CAchF;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAC/F;IAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,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M,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,CAAC;AAEjH;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,qBAAqB,CA8BjG"}
@@ -1,43 +1,19 @@
1
1
  /**
2
- * Resolving the API endpoint a **backend log line names in its own text** to
3
- * an `API_ENDPOINT` node.
2
+ * Resolves the API endpoint a backend log line names in its own text to an `API_ENDPOINT` node.
4
3
  *
5
- * **Why this exists.** RT-044's measurement, re-run after RT-045, left
6
- * `confirmed` blocked by one precisely-named thing: four evidence items
7
- * share the real request id, but three of them are the same source
8
- * (`browser-network`) and the fourth — the backend exception — resolves to
9
- * the *function* that threw, via its stack. So no node has two independent
10
- * sources in one request, and the top report category is unreachable in
11
- * principle rather than merely unmet.
4
+ * RT-044/RT-045: `confirmed` was blocked because no evidence item had two independent sources for
5
+ * one request — three matched `browser-network`, the fourth (backend exception) resolved to the
6
+ * function via its stack. A backend log line naming the same method+path+request-id as an observed
7
+ * browser request is a second, independent observation of that request from the other side of the
8
+ * wire, closing that gap.
12
9
  *
13
- * The backend's own header line, measured from the real fixture, is:
14
- *
15
- * ```
16
- * [broken-invoices] DELETE /api/invoices/3 failed [request-id=...]: TypeError: ...
17
- * ```
18
- *
19
- * It names the endpoint. A browser saying "I sent DELETE /api/invoices/3"
20
- * and a backend saying "I failed DELETE /api/invoices/3" are **two
21
- * independent observations of one request from opposite sides of the wire**,
22
- * joined by an id the backend itself echoed. That is corroboration in the
23
- * exact sense the gate means, and missing it was a gap in resolution, not a
24
- * property of the evidence.
25
- *
26
- * **What this deliberately does not do.** It does not scan for a bare path.
27
- * A log line mentioning `/api/invoices/3` with no method is not a statement
28
- * that *this* endpoint was exercised — `GET` and `DELETE` on one path are
29
- * different endpoints, and `endpoint.ts` already refuses a method mismatch
30
- * for exactly that reason. Requiring an explicit HTTP method in the text is
31
- * what keeps this from becoming a substring search that resolves whatever
32
- * happens to look familiar (RT-031's identity-proxy class, applied to prose).
10
+ * **Does not scan for a bare path** — `/api/invoices/3` with no method isn't a statement that this
11
+ * endpoint ran (`GET` and `DELETE` on one path are different endpoints, per `endpoint.ts`'s own
12
+ * method-mismatch refusal). Requiring an explicit method keeps this from becoming a substring
13
+ * search (RT-031's identity-proxy class, applied to prose).
33
14
  */
34
15
  import { resolveEndpointNode } from "./endpoint.js";
35
- /**
36
- * `DELETE /api/invoices/3` anywhere in a line, method uppercase and
37
- * standalone. The trailing character class stops at whitespace and at the
38
- * punctuation that ordinarily follows a path in prose (`failed:`, `(404)`,
39
- * `"..."`), so a real path is captured without swallowing the sentence.
40
- */
16
+ /** Matches `DELETE /api/invoices/3`-style pairs, method uppercase. Stops at whitespace/punctuation that follows a path in prose (`failed:`, `(404)`) so it doesn't swallow the sentence. */
41
17
  const METHOD_AND_PATH = /\b(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\/[^\s"'(),;]*)/g;
42
18
  /** Every `METHOD /path` pair the text states, in order, deduplicated. Empty when the text names none — the common and correct case for an ordinary log line. */
43
19
  export function findEndpointMentions(text) {
@@ -58,13 +34,11 @@ export function findEndpointMentions(text) {
58
34
  return mentions;
59
35
  }
60
36
  /**
61
- * The endpoint a log line names, when it names exactly one that resolves.
37
+ * The endpoint a log line names, when exactly one resolves.
62
38
  *
63
- * **Two mentions resolving to two different endpoints is refused, not
64
- * ranked.** A line naming several routes (a proxy summary, a batch report)
65
- * genuinely does not identify one, and picking the first would be a
66
- * heuristic standing in for evidence. `endpoint.ts` refuses ambiguity to the
67
- * caller and this inherits that rather than deciding differently.
39
+ * Two mentions resolving to different endpoints is refused, not ranked —
40
+ * picking the first would be a heuristic standing in for evidence, same as
41
+ * `endpoint.ts`'s own ambiguity refusal.
68
42
  */
69
43
  export function resolveEndpointFromLogText(driver, text) {
70
44
  const mentions = findEndpointMentions(text);
@@ -1 +1 @@
1
- {"version":3,"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,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAuB,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACjG,IAAI,UAAU,CAAC,OAAO,KAAK,UAAU;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;YACL,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,kBAAkB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,4DAA4D;YAC7I,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,IAAI,aAAa,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,kBAAkB,aAAa,CAAC,IAAI,iKAAiK;YAC7M,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAE,CAAC,OAAO,EAAE,CAAC;AAC7F,CAAC"}
@@ -1,68 +1,44 @@
1
1
  /**
2
- * The **observed** half of `frontend-caller.ts`'s deliberately structural
3
- * answer — closing the gap that file's own doc comment names: "Playwright
4
- * exposes an initiator chain that could narrow it; the network collector
5
- * does not capture it today."
2
+ * The observed half of `frontend-caller.ts`'s structural answer — closes the gap of not knowing
3
+ * which structural candidate issued the request. `frontend-initiator-capture.ts` captures a real
4
+ * call-site stack for a `fetch()` and attaches it to the request's `NETWORK_REQUEST` evidence; this
5
+ * resolves that stack to a `FUNCTION` via `resolveSymbolNode` and checks it against
6
+ * `resolveFrontendCallers`'s candidates.
6
7
  *
7
- * `@descryy/runtime-browser`'s `frontend-initiator-capture.ts` now captures
8
- * a real call-site stack for a `fetch()` request and attaches it to that
9
- * request's `NETWORK_REQUEST` evidence. This file is what joins that stack
10
- * to the graph: it resolves the stack's own site of interest
11
- * (`primaryFrameLocation`, the identical rule every other stack-to-evidence
12
- * join in this codebase already uses) to a `FUNCTION` node via
13
- * `resolveSymbolNode`, and checks it against `resolveFrontendCallers`'s own
14
- * structural candidate set for the endpoint in question.
8
+ * **Additive, not a replacement.** Adds two outcomes on top of `resolveFrontendCallers`'s own:
9
+ * `observed` (stack matches a named candidate) and `structural-observed-conflict` (stack resolves
10
+ * to a real node the structural side didn't name). Everything else returns exactly what
11
+ * `resolveFrontendCallers` alone would.
15
12
  *
16
- * **Additive, not a replacement.** `resolveFrontendCallers` is untouched —
17
- * every existing caller of it keeps exactly the outcomes it already had.
18
- * This function calls it internally and only ever *adds* two outcomes on
19
- * top: `observed`, when the stack resolves to a node the structural side
20
- * already named as a candidate, and `structural-observed-conflict`, when it
21
- * resolves to a real node the structural side did not name at all. Outside
22
- * both — no stack, an unresolvable frame, an ambiguous or missing symbol —
23
- * this returns exactly what `resolveFrontendCallers` alone would have, so
24
- * every existing refusal discipline (`sole-structural-caller`, `ambiguous`,
25
- * `not-found`) stands unchanged.
26
- *
27
- * **A disagreement is reported, never adjudicated.** When the resolved node
28
- * is real but not among the structural candidates, that is the graph and
29
- * the observation disagreeing — possibly because `USES_API` extraction
30
- * missed a real call site (a dynamic call, a wrapper the adapter does not
31
- * recognise), possibly because the resolved frame is itself wrong in some
32
- * way this function cannot see. Both are worth a reader's attention;
33
- * neither is silently preferred over the other. This is evidence detail
34
- * within whichever of this project's five report categories the caller's
35
- * own claim already lands in — not a sixth category, and not decided here.
13
+ * **Disagreement is reported, never adjudicated** — could mean `USES_API` missed a call site, or
14
+ * the resolved frame is wrong; neither is preferred. Evidence detail within whichever report
15
+ * category the claim already lands in, not a sixth category.
36
16
  */
37
17
  import type { IRNode } from "@descryy/ir";
38
18
  import type { SqlDriver } from "@descryy/core";
39
19
  import { type StackTrace } from "@descryy/runtime-contracts";
40
20
  import { type FrontendCallerResolution } from "./frontend-caller.ts";
41
21
  export type ObservedFrontendCallerResolution = FrontendCallerResolution | {
42
- /** A real captured call-site stack resolved to a node the structural side already named for this endpoint. The genuinely observed answer, not the sole candidate the source admits. */
22
+ /** Stack resolved to a node the structural side already named -- genuinely observed, not just the sole candidate. */
43
23
  readonly outcome: "observed";
44
24
  readonly node: IRNode;
45
- /** Every structural candidate this observation was checked against, for audit — including when it is a single-element `sole-structural-caller` list. */
25
+ /** Every structural candidate checked against, for audit. */
46
26
  readonly structuralCandidates: readonly IRNode[];
47
27
  readonly reason: string;
48
28
  } | {
49
- /** A real captured call-site stack resolved to a real node, and that node is NOT among the structural candidates (possibly none at all) for this endpoint. */
29
+ /** Stack resolved to a real node NOT among the structural candidates for this endpoint. */
50
30
  readonly outcome: "structural-observed-conflict";
51
31
  readonly structuralCandidates: readonly IRNode[];
52
32
  readonly observedNode: IRNode;
53
33
  readonly reason: string;
54
34
  };
55
35
  /**
56
- * `stackTrace` is exactly `NETWORK_REQUEST.stackTrace` off the observed
57
- * request that hit `endpointNodeId` — `null` whenever the collector could
58
- * not attach one (no parser wired, header stripped in transit, nothing
59
- * buffered for the id), which this function treats identically to "no
60
- * observation was ever attempted": the structural answer, unchanged.
36
+ * `stackTrace` is `NETWORK_REQUEST.stackTrace` off the request that hit
37
+ * `endpointNodeId` — `null` when the collector couldn't attach one, treated
38
+ * identically to "no observation attempted" (structural answer, unchanged).
61
39
  *
62
- * `repo`/`repoRoot` are `resolveSymbolNode`'s own — the frontend repository
63
- * the observed stack's frames are expected to belong to, since `FUNCTION`
64
- * is repo-scoped and there is no honest default for it (see `symbol.ts`'s
65
- * own doc comment).
40
+ * `repo`/`repoRoot` are `resolveSymbolNode`'s own: `FUNCTION` is repo-scoped
41
+ * with no honest default (see `symbol.ts`).
66
42
  */
67
43
  export declare function resolveObservedFrontendCaller(driver: SqlDriver, endpointNodeId: string, stackTrace: StackTrace | null, repo: string, options?: {
68
44
  readonly repoRoot?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"observed-frontend-caller.d.ts","sourceRoot":"","sources":["../src/observed-frontend-caller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EAA0B,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAG7F,MAAM,MAAM,gCAAgC,GACxC,wBAAwB,GACxB;IACE,uLAAuL;IACvL,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wJAAwJ;IACxJ,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,GACD;IACE,8JAA8J;IAC9J,QAAQ,CAAC,OAAO,EAAE,8BAA8B,CAAC;IACjD,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAQN;;;;;;;;;;;GAWG;AACH,wBAAgB,6B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AAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,gCAAgC,CAkDlC"}
@@ -1,38 +1,18 @@
1
1
  /**
2
- * The **observed** half of `frontend-caller.ts`'s deliberately structural
3
- * answer — closing the gap that file's own doc comment names: "Playwright
4
- * exposes an initiator chain that could narrow it; the network collector
5
- * does not capture it today."
2
+ * The observed half of `frontend-caller.ts`'s structural answer — closes the gap of not knowing
3
+ * which structural candidate issued the request. `frontend-initiator-capture.ts` captures a real
4
+ * call-site stack for a `fetch()` and attaches it to the request's `NETWORK_REQUEST` evidence; this
5
+ * resolves that stack to a `FUNCTION` via `resolveSymbolNode` and checks it against
6
+ * `resolveFrontendCallers`'s candidates.
6
7
  *
7
- * `@descryy/runtime-browser`'s `frontend-initiator-capture.ts` now captures
8
- * a real call-site stack for a `fetch()` request and attaches it to that
9
- * request's `NETWORK_REQUEST` evidence. This file is what joins that stack
10
- * to the graph: it resolves the stack's own site of interest
11
- * (`primaryFrameLocation`, the identical rule every other stack-to-evidence
12
- * join in this codebase already uses) to a `FUNCTION` node via
13
- * `resolveSymbolNode`, and checks it against `resolveFrontendCallers`'s own
14
- * structural candidate set for the endpoint in question.
8
+ * **Additive, not a replacement.** Adds two outcomes on top of `resolveFrontendCallers`'s own:
9
+ * `observed` (stack matches a named candidate) and `structural-observed-conflict` (stack resolves
10
+ * to a real node the structural side didn't name). Everything else returns exactly what
11
+ * `resolveFrontendCallers` alone would.
15
12
  *
16
- * **Additive, not a replacement.** `resolveFrontendCallers` is untouched —
17
- * every existing caller of it keeps exactly the outcomes it already had.
18
- * This function calls it internally and only ever *adds* two outcomes on
19
- * top: `observed`, when the stack resolves to a node the structural side
20
- * already named as a candidate, and `structural-observed-conflict`, when it
21
- * resolves to a real node the structural side did not name at all. Outside
22
- * both — no stack, an unresolvable frame, an ambiguous or missing symbol —
23
- * this returns exactly what `resolveFrontendCallers` alone would have, so
24
- * every existing refusal discipline (`sole-structural-caller`, `ambiguous`,
25
- * `not-found`) stands unchanged.
26
- *
27
- * **A disagreement is reported, never adjudicated.** When the resolved node
28
- * is real but not among the structural candidates, that is the graph and
29
- * the observation disagreeing — possibly because `USES_API` extraction
30
- * missed a real call site (a dynamic call, a wrapper the adapter does not
31
- * recognise), possibly because the resolved frame is itself wrong in some
32
- * way this function cannot see. Both are worth a reader's attention;
33
- * neither is silently preferred over the other. This is evidence detail
34
- * within whichever of this project's five report categories the caller's
35
- * own claim already lands in — not a sixth category, and not decided here.
13
+ * **Disagreement is reported, never adjudicated** — could mean `USES_API` missed a call site, or
14
+ * the resolved frame is wrong; neither is preferred. Evidence detail within whichever report
15
+ * category the claim already lands in, not a sixth category.
36
16
  */
37
17
  import { primaryFrameLocation } from "@descryy/runtime-contracts";
38
18
  import { resolveFrontendCallers } from "./frontend-caller.js";
@@ -45,36 +25,26 @@ function structuralCandidatesOf(structural) {
45
25
  return [];
46
26
  }
47
27
  /**
48
- * `stackTrace` is exactly `NETWORK_REQUEST.stackTrace` off the observed
49
- * request that hit `endpointNodeId` — `null` whenever the collector could
50
- * not attach one (no parser wired, header stripped in transit, nothing
51
- * buffered for the id), which this function treats identically to "no
52
- * observation was ever attempted": the structural answer, unchanged.
28
+ * `stackTrace` is `NETWORK_REQUEST.stackTrace` off the request that hit
29
+ * `endpointNodeId` — `null` when the collector couldn't attach one, treated
30
+ * identically to "no observation attempted" (structural answer, unchanged).
53
31
  *
54
- * `repo`/`repoRoot` are `resolveSymbolNode`'s own — the frontend repository
55
- * the observed stack's frames are expected to belong to, since `FUNCTION`
56
- * is repo-scoped and there is no honest default for it (see `symbol.ts`'s
57
- * own doc comment).
32
+ * `repo`/`repoRoot` are `resolveSymbolNode`'s own: `FUNCTION` is repo-scoped
33
+ * with no honest default (see `symbol.ts`).
58
34
  */
59
35
  export function resolveObservedFrontendCaller(driver, endpointNodeId, stackTrace, repo, options = {}) {
60
36
  const structural = resolveFrontendCallers(driver, endpointNodeId);
61
37
  const location = primaryFrameLocation(stackTrace);
62
- // No stack, an empty stack, or one whose site of interest names nothing
63
- // (a native/anonymous frame, or one this parser could not symbolicate at
64
- // all) -- resolveSymbolNode has no name to search for either way, so the
65
- // observation adds nothing usable. Same "no id, no functionName" fallback
66
- // `resolveInitiatorStack` on the collector side already degrades to.
38
+ // No stack, empty stack, or a frame naming nothing (native/anonymous/unparsed) --
39
+ // resolveSymbolNode has no name to search for. Same fallback resolveInitiatorStack uses.
67
40
  if (location === null || location.file === null || location.functionName === null) {
68
41
  return structural;
69
42
  }
70
43
  const resolved = resolveSymbolNode(driver, location.line === null
71
44
  ? { file: location.file, symbolName: location.functionName }
72
45
  : { file: location.file, symbolName: location.functionName, line: location.line }, repo, options);
73
- // Unresolved, ambiguous, or a line that does not fall inside the matched
74
- // node's range: none of those is "the observed function", so none of
75
- // them can upgrade or conflict with the structural claim. The existing
76
- // structural-only outcome stands -- this function never invents a
77
- // caller resolveSymbolNode itself refused to name.
46
+ // Unresolved, ambiguous, or outside the matched node's range: none of those
47
+ // is "the observed function" -- never invent a caller resolveSymbolNode refused to name.
78
48
  if (resolved.outcome !== "resolved") {
79
49
  return structural;
80
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"observed-frontend-caller.js","sourceRoot":"","sources":["../src/observed-frontend-caller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,OAAO,EAAE,oBAAoB,EAAmB,MAAM,4BAA4B,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAiC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAoBhD,SAAS,sBAAsB,CAAC,UAAoC;IAClE,IAAI,UAAU,CAAC,OAAO,KAAK,wBAAwB;QAAE,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,UAAU,CAAC,OAAO,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,UAAU,CAAC;IACrE,OAAO,EAAE,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