@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.
- package/LICENSE +6 -0
- package/dist/confirm-observed-caller.d.ts +27 -62
- package/dist/confirm-observed-caller.d.ts.map +1 -1
- package/dist/confirm-observed-caller.js +25 -60
- package/dist/confirm-observed-caller.js.map +1 -1
- package/dist/cross-service-call.d.ts +42 -104
- package/dist/cross-service-call.d.ts.map +1 -1
- package/dist/cross-service-call.js +42 -107
- package/dist/cross-service-call.js.map +1 -1
- package/dist/database-table.d.ts +8 -20
- package/dist/database-table.d.ts.map +1 -1
- package/dist/database-table.js +8 -20
- package/dist/database-table.js.map +1 -1
- package/dist/endpoint.d.ts +19 -43
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +20 -45
- package/dist/endpoint.js.map +1 -1
- package/dist/frontend-caller.d.ts +15 -37
- package/dist/frontend-caller.d.ts.map +1 -1
- package/dist/frontend-caller.js +15 -37
- package/dist/frontend-caller.js.map +1 -1
- package/dist/index.d.ts +5 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/log-endpoint.d.ts +14 -35
- package/dist/log-endpoint.d.ts.map +1 -1
- package/dist/log-endpoint.js +15 -41
- package/dist/log-endpoint.js.map +1 -1
- package/dist/observed-frontend-caller.d.ts +20 -44
- package/dist/observed-frontend-caller.d.ts.map +1 -1
- package/dist/observed-frontend-caller.js +21 -51
- package/dist/observed-frontend-caller.js.map +1 -1
- package/dist/symbol.d.ts +44 -124
- package/dist/symbol.d.ts.map +1 -1
- package/dist/symbol.js +48 -130
- package/dist/symbol.js.map +1 -1
- package/package.json +9 -4
package/LICENSE
ADDED
|
@@ -1,60 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* First production caller of `applyRuntimeObservations()` — §11B.3's R4 runtime confirmation,
|
|
3
|
+
* wired to a real observation source. `observed_edges` and `edge_corrections` have existed in the
|
|
4
|
+
* schema since the store was written; nothing read or wrote either one until this.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `@descryy/core` since it was built, and the two EARNED tables it writes
|
|
9
|
-
* (`observed_edges`, `edge_corrections`) have been in the store's schema since
|
|
10
|
-
* the store was first written — each with a comment explaining why they cannot
|
|
11
|
-
* be regenerated from source at any price. **Nothing read or wrote either one.**
|
|
12
|
-
* This is what makes the moat run.
|
|
6
|
+
* `resolveObservedFrontendCaller` does the hard half already — it resolves a captured stack to a
|
|
7
|
+
* FUNCTION and checks it against the endpoint's structural candidates. Its two observed outcomes
|
|
8
|
+
* map directly:
|
|
13
9
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `resolveObservedFrontendCaller` already does the hard half. It takes a real
|
|
17
|
-
* captured `fetch()` call-site stack, resolves its site of interest to a
|
|
18
|
-
* `FUNCTION` node, and checks that node against the structural candidate set the
|
|
19
|
-
* graph holds for the endpoint. Its two observed outcomes *are* two of §11B.3's
|
|
20
|
-
* three arrows, and needed only to be spoken in the vocabulary
|
|
21
|
-
* `applyRuntimeObservations` reads:
|
|
22
|
-
*
|
|
23
|
-
* | resolution outcome | arrow |
|
|
10
|
+
* | outcome | action |
|
|
24
11
|
* | --- | --- |
|
|
25
|
-
* | `observed` |
|
|
26
|
-
* | `structural-observed-conflict` |
|
|
27
|
-
*
|
|
28
|
-
* Everything else
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* wrong-direction failure rule 2 exists to prevent, arriving through the one
|
|
44
|
-
* mechanism designed to make the graph *more* trustworthy.
|
|
45
|
-
*
|
|
46
|
-
* The denial arrow is real and stays available; it belongs to a producer that
|
|
47
|
-
* can actually establish non-occurrence (an exhaustive call-graph trace over a
|
|
48
|
-
* fully exercised path), not to this one.
|
|
49
|
-
*
|
|
50
|
-
* ## What this does not do
|
|
51
|
-
*
|
|
52
|
-
* - **It does not judge a finding.** Resolution has no opinion on confidence
|
|
53
|
-
* (RT-027). Nothing here reads or writes a finding, hypothesis or category.
|
|
54
|
-
* - **It does not decide staleness.** An R4-vs-R4 disagreement is reported by
|
|
55
|
-
* the core function as `staleR4` and passed through untouched.
|
|
56
|
-
* - **It does not invent a node.** That refusal is core's, and its `refused`
|
|
57
|
-
* list is passed through rather than swallowed.
|
|
12
|
+
* | `observed` | edge already held below R4 — promote it |
|
|
13
|
+
* | `structural-observed-conflict` | real node the structural side never named — mint the edge at R4 |
|
|
14
|
+
*
|
|
15
|
+
* Everything else (no stack, unresolvable frame, ambiguous/missing symbol) produces no observation
|
|
16
|
+
* at all — not an empty one, none.
|
|
17
|
+
*
|
|
18
|
+
* **No denial arrow here, deliberately.** `applyRuntimeObservations` accepts `held: false` to demote
|
|
19
|
+
* an edge's confidence, but a frontend caller resolution can only establish that a call happened,
|
|
20
|
+
* never that one didn't — a page visit exercises one path, and an uncaptured stack for some other
|
|
21
|
+
* function is absence of evidence, not evidence of absence. Minting a denial from that would demote
|
|
22
|
+
* a correct edge on the strength of a route the run didn't take (rule 2). Denial belongs to a
|
|
23
|
+
* producer that can establish non-occurrence (an exhaustive call-graph trace over a fully exercised
|
|
24
|
+
* path).
|
|
25
|
+
*
|
|
26
|
+
* **Does not judge a finding** (RT-027) — no opinion on confidence, nothing here touches a
|
|
27
|
+
* finding/hypothesis/category. **Does not decide staleness** — an R4-vs-R4 disagreement passes
|
|
28
|
+
* through as core's own `staleR4`. **Does not invent a node** — core's `refused` list passes
|
|
29
|
+
* through untouched.
|
|
58
30
|
*/
|
|
59
31
|
import type { RuntimeEdgeObservation } from "@descryy/ir";
|
|
60
32
|
import { type RuntimeConfirmationResult, type SqlDriver } from "@descryy/core";
|
|
@@ -73,20 +45,13 @@ export interface ConfirmObservedCallerInput {
|
|
|
73
45
|
readonly repoRoot?: string;
|
|
74
46
|
}
|
|
75
47
|
export interface ConfirmObservedCallerOutcome {
|
|
76
|
-
/**
|
|
77
|
-
* The underlying resolution, unchanged and always present — including when it
|
|
78
|
-
* produced no observation. A caller that wants the structural answer still
|
|
79
|
-
* gets exactly what `resolveObservedFrontendCaller` would have returned.
|
|
80
|
-
*/
|
|
48
|
+
/** The underlying resolution, always present, even when it produced no observation. */
|
|
81
49
|
readonly resolution: ObservedFrontendCallerResolution;
|
|
82
50
|
/** What was sent to the graph. Empty when the resolution observed nothing. */
|
|
83
51
|
readonly observations: readonly RuntimeEdgeObservation[];
|
|
84
52
|
/** Core's own result, passed through whole — refusals and `staleR4` included. */
|
|
85
53
|
readonly confirmation: RuntimeConfirmationResult;
|
|
86
54
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Resolve one observed frontend call and, when it genuinely observed something,
|
|
89
|
-
* record it as R4 evidence against the graph.
|
|
90
|
-
*/
|
|
55
|
+
/** Resolve one observed frontend call and, when it genuinely observed something, record it as R4 evidence. */
|
|
91
56
|
export declare function confirmObservedFrontendCaller(driver: SqlDriver, input: ConfirmObservedCallerInput): ConfirmObservedCallerOutcome;
|
|
92
57
|
//# sourceMappingURL=confirm-observed-caller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-observed-caller.d.ts","sourceRoot":"","sources":["../src/confirm-observed-caller.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"confirm-observed-caller.d.ts","sourceRoot":"","sources":["../src/confirm-observed-caller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mIAAmI;IACnI,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,uFAAuF;IACvF,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;IACtD,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzD,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;CAClD;AAMD,8GAA8G;AAC9G,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,0BAA0B,GAChC,4BAA4B,CAsB9B"}
|
|
@@ -1,78 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* First production caller of `applyRuntimeObservations()` — §11B.3's R4 runtime confirmation,
|
|
3
|
+
* wired to a real observation source. `observed_edges` and `edge_corrections` have existed in the
|
|
4
|
+
* schema since the store was written; nothing read or wrote either one until this.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `@descryy/core` since it was built, and the two EARNED tables it writes
|
|
9
|
-
* (`observed_edges`, `edge_corrections`) have been in the store's schema since
|
|
10
|
-
* the store was first written — each with a comment explaining why they cannot
|
|
11
|
-
* be regenerated from source at any price. **Nothing read or wrote either one.**
|
|
12
|
-
* This is what makes the moat run.
|
|
6
|
+
* `resolveObservedFrontendCaller` does the hard half already — it resolves a captured stack to a
|
|
7
|
+
* FUNCTION and checks it against the endpoint's structural candidates. Its two observed outcomes
|
|
8
|
+
* map directly:
|
|
13
9
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `resolveObservedFrontendCaller` already does the hard half. It takes a real
|
|
17
|
-
* captured `fetch()` call-site stack, resolves its site of interest to a
|
|
18
|
-
* `FUNCTION` node, and checks that node against the structural candidate set the
|
|
19
|
-
* graph holds for the endpoint. Its two observed outcomes *are* two of §11B.3's
|
|
20
|
-
* three arrows, and needed only to be spoken in the vocabulary
|
|
21
|
-
* `applyRuntimeObservations` reads:
|
|
22
|
-
*
|
|
23
|
-
* | resolution outcome | arrow |
|
|
10
|
+
* | outcome | action |
|
|
24
11
|
* | --- | --- |
|
|
25
|
-
* | `observed` |
|
|
26
|
-
* | `structural-observed-conflict` |
|
|
27
|
-
*
|
|
28
|
-
* Everything else — no stack, an unresolvable frame, an ambiguous or missing
|
|
29
|
-
* symbol — produces **no observation at all**. Not an empty confirmation that
|
|
30
|
-
* looks like one; none.
|
|
31
|
-
*
|
|
32
|
-
* ## Why there is no denial arrow here, and why that is a decision
|
|
12
|
+
* | `observed` | edge already held below R4 — promote it |
|
|
13
|
+
* | `structural-observed-conflict` | real node the structural side never named — mint the edge at R4 |
|
|
33
14
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* **This producer never emits one, and must not.**
|
|
15
|
+
* Everything else (no stack, unresolvable frame, ambiguous/missing symbol) produces no observation
|
|
16
|
+
* at all — not an empty one, none.
|
|
37
17
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* not evidence of absence. Minting a denial from that would demote
|
|
42
|
-
* edge on the strength of a route the run
|
|
43
|
-
*
|
|
44
|
-
*
|
|
18
|
+
* **No denial arrow here, deliberately.** `applyRuntimeObservations` accepts `held: false` to demote
|
|
19
|
+
* an edge's confidence, but a frontend caller resolution can only establish that a call happened,
|
|
20
|
+
* never that one didn't — a page visit exercises one path, and an uncaptured stack for some other
|
|
21
|
+
* function is absence of evidence, not evidence of absence. Minting a denial from that would demote
|
|
22
|
+
* a correct edge on the strength of a route the run didn't take (rule 2). Denial belongs to a
|
|
23
|
+
* producer that can establish non-occurrence (an exhaustive call-graph trace over a fully exercised
|
|
24
|
+
* path).
|
|
45
25
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* ## What this does not do
|
|
51
|
-
*
|
|
52
|
-
* - **It does not judge a finding.** Resolution has no opinion on confidence
|
|
53
|
-
* (RT-027). Nothing here reads or writes a finding, hypothesis or category.
|
|
54
|
-
* - **It does not decide staleness.** An R4-vs-R4 disagreement is reported by
|
|
55
|
-
* the core function as `staleR4` and passed through untouched.
|
|
56
|
-
* - **It does not invent a node.** That refusal is core's, and its `refused`
|
|
57
|
-
* list is passed through rather than swallowed.
|
|
26
|
+
* **Does not judge a finding** (RT-027) — no opinion on confidence, nothing here touches a
|
|
27
|
+
* finding/hypothesis/category. **Does not decide staleness** — an R4-vs-R4 disagreement passes
|
|
28
|
+
* through as core's own `staleR4`. **Does not invent a node** — core's `refused` list passes
|
|
29
|
+
* through untouched.
|
|
58
30
|
*/
|
|
59
31
|
import { applyRuntimeObservations, } from "@descryy/core";
|
|
60
32
|
import { resolveObservedFrontendCaller, } from "./observed-frontend-caller.js";
|
|
61
33
|
const EMPTY = {
|
|
62
34
|
promoted: [], created: [], confirmed: [], contradictions: [], staleR4: [], refused: [],
|
|
63
35
|
};
|
|
64
|
-
/**
|
|
65
|
-
* Resolve one observed frontend call and, when it genuinely observed something,
|
|
66
|
-
* record it as R4 evidence against the graph.
|
|
67
|
-
*/
|
|
36
|
+
/** Resolve one observed frontend call and, when it genuinely observed something, record it as R4 evidence. */
|
|
68
37
|
export function confirmObservedFrontendCaller(driver, input) {
|
|
69
38
|
const resolution = resolveObservedFrontendCaller(driver, input.endpointNodeId, input.stackTrace, input.repo, input.repoRoot === undefined ? {} : { repoRoot: input.repoRoot });
|
|
70
39
|
const observations = observationsFor(resolution, input.endpointNodeId);
|
|
71
40
|
if (observations.length === 0) {
|
|
72
|
-
// Nothing observed. Deliberately not
|
|
73
|
-
// `adapter_runs` row would be minted for a run that witnessed nothing,
|
|
74
|
-
// which reads in the ledger exactly like a run that observed and found
|
|
75
|
-
// nothing to say. Those are different statements.
|
|
41
|
+
// Nothing observed. Deliberately not an empty-list call -- an `adapter_runs` row would then read like a run that observed and found nothing to say.
|
|
76
42
|
return { resolution, observations, confirmation: EMPTY };
|
|
77
43
|
}
|
|
78
44
|
const confirmation = applyRuntimeObservations(driver, {
|
|
@@ -110,8 +76,7 @@ function observationsFor(resolution, endpointNodeId) {
|
|
|
110
76
|
},
|
|
111
77
|
];
|
|
112
78
|
}
|
|
113
|
-
// Every other outcome is a refusal or a purely structural answer
|
|
114
|
-
// an observation, and neither becomes one by being written down.
|
|
79
|
+
// Every other outcome is a refusal or a purely structural answer -- neither is an observation.
|
|
115
80
|
return [];
|
|
116
81
|
}
|
|
117
82
|
//# sourceMappingURL=confirm-observed-caller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-observed-caller.js","sourceRoot":"","sources":["../src/confirm-observed-caller.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"confirm-observed-caller.js","sourceRoot":"","sources":["../src/confirm-observed-caller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EACL,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,6BAA6B,GAE9B,MAAM,+BAA+B,CAAC;AAwBvC,MAAM,KAAK,GAA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AC,IAAI,GAAG;oBACzE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,wCAAwC;oBAClF,qCAAqC;aACxC;SACF,CAAC;IACJ,CAAC;IAED,IAAI,UAAU,CAAC,OAAO,KAAK,8BAA8B,EAAE,CAAC;QAC1D,OAAO;YACL;gBACE,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE;gBAChC,EAAE,EAAE,cAAc;gBAClB,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,IAAI;gBACV,MAAM,EACJ,kDAAkD,UAAU,CAAC,YAAY,CAAC,IAAI,GAAG;oBACjF,IAAI,UAAU,CAAC,YAAY,CAAC,IAAI,IAAI,cAAc,wCAAwC;oBAC1F,iCAAiC,UAAU,CAAC,oBAAoB,CAAC,MAAM,cAAc;oBACrF,2FAA2F;aAC9F;SACF,CAAC;IACJ,CAAC;IAED,+FAA+F;IAC/F,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,90 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A caller in one process, a route in another, joined without a browser.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* evidence carrying a call-site stack came from exactly one place —
|
|
9
|
-
* `@descryhq-wq/runtime-browser`'s `fetch()` initiator capture — and every
|
|
10
|
-
* backend collector set `stackTrace: null`, `ExternalRequestCollector`
|
|
11
|
-
* included, *because the preload never captured one*. It does now
|
|
12
|
-
* (`fetch-instrumentation.ts`), and this file is what turns that capture
|
|
13
|
-
* into an edge.
|
|
4
|
+
* Closes the gap `observe-runtime` noted as unreachable: backend-only runs resolved both node kinds but
|
|
5
|
+
* wrote no edge, since `NETWORK_REQUEST` stacks only came from `runtime-browser`'s `fetch()` capture and
|
|
6
|
+
* every backend collector set `stackTrace: null`. `fetch-instrumentation.ts` now captures one
|
|
7
|
+
* backend-side too; this file turns it into an edge.
|
|
14
8
|
*
|
|
15
|
-
*
|
|
9
|
+
* **Two ends, neither inferred.** Caller: `EXTERNAL_REQUEST` evidence carrying the outbound stack,
|
|
10
|
+
* resolved to a `FUNCTION` via `resolveSymbolNode`. Callee: `NETWORK_REQUEST` evidence from
|
|
11
|
+
* `InboundProxy` at the other process, resolved to an `API_ENDPOINT` via `resolveEndpointNode`
|
|
12
|
+
* (workspace-scoped, DEC-054). Both come from the observation; nothing here pairs attributions that
|
|
13
|
+
* merely co-occur.
|
|
16
14
|
*
|
|
17
|
-
* **The
|
|
18
|
-
*
|
|
19
|
-
* the moment it called. Its site of interest (`primaryFrameLocation`, the
|
|
20
|
-
* identical rule every other stack-to-evidence join here already uses)
|
|
21
|
-
* resolves to a `FUNCTION` node via `resolveSymbolNode`.
|
|
15
|
+
* **The join, which is the precision question.** Two observations of one exchange must be shown to be
|
|
16
|
+
* the same exchange. Two joins accepted, each named in the result, never averaged:
|
|
22
17
|
*
|
|
23
|
-
*
|
|
24
|
-
* process* — `InboundProxy`'s own capture of a request arriving. Its
|
|
25
|
-
* `method`/`path` resolve to an `API_ENDPOINT` node via
|
|
26
|
-
* `resolveEndpointNode`. `API_ENDPOINT` is workspace-scoped, not repo-scoped
|
|
27
|
-
* (DEC-054, and `endpoint.ts`'s own header), so there is no "which repo's
|
|
28
|
-
* route" question to answer and no repo filter to invent.
|
|
29
|
-
*
|
|
30
|
-
* Both ends come from the observation. Nothing here pairs up attributions
|
|
31
|
-
* that merely co-occur in a run — the exact manufacture `observe-runtime`'s
|
|
32
|
-
* header rules out — because a pair of co-occurring observations is not a
|
|
33
|
-
* witnessed relationship.
|
|
34
|
-
*
|
|
35
|
-
* ## The join, which is the whole precision question
|
|
36
|
-
*
|
|
37
|
-
* Two observations of one HTTP exchange, from two processes, have to be
|
|
38
|
-
* shown to be the *same* exchange. Two joins are accepted and each one is
|
|
39
|
-
* named in the result, never averaged into a single confidence number:
|
|
40
|
-
*
|
|
41
|
-
* | join | what it rests on |
|
|
18
|
+
* | join | rests on |
|
|
42
19
|
* | --- | --- |
|
|
43
|
-
* | `correlation-id` | both observations carry the same non-null `traceId`
|
|
44
|
-
* | `run-owned-authority` | the outbound
|
|
45
|
-
*
|
|
46
|
-
* `correlation-id` is preferred
|
|
47
|
-
* `
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* a hostname this module recognises, it is matched against a `host:port`
|
|
60
|
-
* **the caller declares Descry allocated for that service in this run**
|
|
61
|
-
* (`observedAuthorities`). Declared, never inferred — the same discipline
|
|
62
|
-
* RT-032 already applies to service start order. A call that reached a port
|
|
63
|
-
* Descry itself bound for service B, answered successfully, and shows up in
|
|
64
|
-
* B's own independent inbound observation of the same method and path, is a
|
|
65
|
-
* call that reached that route.
|
|
66
|
-
*
|
|
67
|
-
* Both joins additionally require what `correlateBackendEvidence` requires:
|
|
68
|
-
* one `executionId`. Evidence from two runs is never joined on a bare
|
|
69
|
-
* identifier.
|
|
70
|
-
*
|
|
71
|
-
* ## What is refused, and why refusal is the point
|
|
72
|
-
*
|
|
73
|
-
* No stack, an unresolvable frame, an ambiguous symbol, an unresolvable or
|
|
74
|
-
* ambiguous endpoint, an outbound call that reached nothing, an authority
|
|
75
|
-
* nobody declared, no matching inbound observation — every one of these
|
|
76
|
-
* returns a named refusal with a reason and **no edge**. Rule 2, stated in
|
|
77
|
-
* the plan that asked for this file: *"a wrong cross-repo edge corrupts diff
|
|
78
|
-
* scoping, impact scores and root-cause traversal in every layer above it.
|
|
79
|
-
* If the join is uncertain, omit the edge and disclose."*
|
|
80
|
-
*
|
|
81
|
-
* ## What this does not do
|
|
82
|
-
*
|
|
83
|
-
* - **No denial arrow.** Identical reasoning to
|
|
84
|
-
* `confirm-observed-caller.ts`: a run establishes that a call happened and
|
|
85
|
-
* can never establish that one did not.
|
|
86
|
-
* - **It does not judge a finding** (RT-027), decide staleness, or invent a
|
|
87
|
-
* node — core's refusals pass through whole.
|
|
20
|
+
* | `correlation-id` | both observations carry the same non-null `traceId`/`requestId` in one execution |
|
|
21
|
+
* | `run-owned-authority` | the outbound authority is a listening post Descry itself bound for the named callee, independently confirmed by that callee's own observation of the same method+path |
|
|
22
|
+
*
|
|
23
|
+
* `correlation-id` is preferred — same rule as `correlateBackendEvidence`, reimplemented rather than
|
|
24
|
+
* imported (needs a join decision, not a fresh `Correlation` record; avoids an unpublished-scope dependency).
|
|
25
|
+
* `run-owned-authority` exists because `correlation-id` alone requires the app under test to propagate
|
|
26
|
+
* trace headers, which the UAT workspace did not — the authority is matched against a `host:port` the
|
|
27
|
+
* caller declares Descry allocated for that service (`observedAuthorities`), declared never inferred
|
|
28
|
+
* (RT-032's discipline). Both joins require one shared `executionId` — never joined across runs.
|
|
29
|
+
*
|
|
30
|
+
* **Refusal is the point.** No stack, unresolvable frame/symbol/endpoint, a call that reached nothing, an
|
|
31
|
+
* undeclared authority, no matching inbound — every one is a named refusal, no edge (rule 2: a wrong
|
|
32
|
+
* cross-repo edge corrupts diff scoping, impact and root-cause traversal above it).
|
|
33
|
+
*
|
|
34
|
+
* **No denial arrow** — same reasoning as `confirm-observed-caller.ts`: can establish a call happened,
|
|
35
|
+
* never that it didn't. Also doesn't judge a finding (RT-027), decide staleness, or invent a node.
|
|
88
36
|
*/
|
|
89
37
|
import type { IRNode, RuntimeEdgeObservation } from "@descryy/ir";
|
|
90
38
|
import { type RuntimeConfirmationResult, type SqlDriver } from "@descryy/core";
|
|
@@ -92,7 +40,7 @@ import { type Evidence } from "@descryy/runtime-contracts";
|
|
|
92
40
|
/** How the caller-side and callee-side observations were shown to be one exchange. Always named in the result; never collapsed into a number. */
|
|
93
41
|
export type CrossServiceJoin = {
|
|
94
42
|
readonly kind: "correlation-id";
|
|
95
|
-
/** Which id carried it
|
|
43
|
+
/** Which id carried it -- trace-id checked first, same order as correlateBackendEvidence. */
|
|
96
44
|
readonly idKind: "trace-id" | "request-id";
|
|
97
45
|
readonly id: string;
|
|
98
46
|
} | {
|
|
@@ -130,12 +78,9 @@ export interface ObservedCrossServiceCallInput {
|
|
|
130
78
|
/** `EXTERNAL_REQUEST` evidence from the **calling** process, with `stackTrace` set by `ExternalRequestCollector`'s parser. */
|
|
131
79
|
readonly outbound: Evidence;
|
|
132
80
|
/**
|
|
133
|
-
* Every inbound observation from this run's other
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* corresponds to this outbound call **is** the join, and a caller that had
|
|
137
|
-
* already chosen would be making the precision decision this module exists
|
|
138
|
-
* to make.
|
|
81
|
+
* Every inbound observation from this run's other processes (`InboundProxy`'s `NETWORK_REQUEST`
|
|
82
|
+
* items) — a list, not a pre-picked item: choosing which one matches this outbound call **is**
|
|
83
|
+
* the join this module exists to make.
|
|
139
84
|
*/
|
|
140
85
|
readonly inbound: readonly Evidence[];
|
|
141
86
|
/** The repository the calling process's source belongs to. `FUNCTION` is repo-scoped and there is no honest default (see `symbol.ts`). */
|
|
@@ -143,16 +88,10 @@ export interface ObservedCrossServiceCallInput {
|
|
|
143
88
|
/** The calling repository's absolute root, so an absolute frame path can be translated exactly rather than suffix-matched. */
|
|
144
89
|
readonly callerRepoRoot?: string;
|
|
145
90
|
/**
|
|
146
|
-
* `host:port`
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* this module recognised on its own would be a lookup table standing in
|
|
151
|
-
* for evidence.
|
|
152
|
-
*
|
|
153
|
-
* Omitted means the `run-owned-authority` join is simply unavailable and
|
|
154
|
-
* only `correlation-id` can join — a disclosed reduction in recall, not a
|
|
155
|
-
* silent one.
|
|
91
|
+
* `host:port` -> callee service name, for every listening post this run bound itself
|
|
92
|
+
* (`InstrumentedExecutionResult`'s `proxyPorts`). Declared by the caller, never discovered here —
|
|
93
|
+
* a recognised hostname would be a lookup table standing in for evidence. Omitted means only
|
|
94
|
+
* `correlation-id` can join — disclosed recall loss.
|
|
156
95
|
*/
|
|
157
96
|
readonly observedAuthorities?: Readonly<Record<string, string>>;
|
|
158
97
|
}
|
|
@@ -178,13 +117,12 @@ export interface ConfirmObservedCrossServiceCallOutcome {
|
|
|
178
117
|
}
|
|
179
118
|
/**
|
|
180
119
|
* Resolve one observed cross-service call and, when it genuinely observed
|
|
181
|
-
* something, record it as R4 evidence
|
|
120
|
+
* something, record it as R4 evidence.
|
|
182
121
|
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* far more often than its promotion case.
|
|
122
|
+
* Writes the `USES_API` edge a static adapter structurally cannot produce
|
|
123
|
+
* when the target URL is assembled at runtime (the fixture this was proven
|
|
124
|
+
* against builds it from an env var) — so this is `applyRuntimeObservations`'
|
|
125
|
+
* "recall gap closed" case far more often than its promotion case.
|
|
188
126
|
*/
|
|
189
127
|
export declare function confirmObservedCrossServiceCall(driver: SqlDriver, input: ConfirmObservedCrossServiceCallInput): ConfirmObservedCrossServiceCallOutcome;
|
|
190
128
|
//# sourceMappingURL=cross-service-call.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-service-call.d.ts","sourceRoot":"","sources":["../src/cross-service-call.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cross-service-call.d.ts","sourceRoot":"","sources":["../src/cross-service-call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwB,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAKjF,iJAAiJ;AACjJ,MAAM,MAAM,gBAAgB,GACxB;IACE,QAAQ,CAAC,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