@descryy/runtime-remote-log-ingestion 0.2.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/correlator.d.ts +25 -40
- package/dist/correlator.d.ts.map +1 -1
- package/dist/correlator.js +23 -39
- package/dist/correlator.js.map +1 -1
- package/dist/file-log-adapter.d.ts +13 -19
- package/dist/file-log-adapter.d.ts.map +1 -1
- package/dist/file-log-adapter.js +13 -19
- package/dist/file-log-adapter.js.map +1 -1
- package/dist/log-line.d.ts +19 -28
- package/dist/log-line.d.ts.map +1 -1
- package/dist/log-line.js +19 -28
- package/dist/log-line.js.map +1 -1
- package/dist/log-source-config.d.ts +20 -33
- package/dist/log-source-config.d.ts.map +1 -1
- package/dist/log-source-config.js +7 -13
- package/dist/log-source-config.js.map +1 -1
- package/package.json +9 -4
package/LICENSE
ADDED
package/dist/correlator.d.ts
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Correlation between a captured browser/proxy request and an ingested
|
|
3
|
-
* remote log line (DEC-271's remote side). Follows the same pattern
|
|
4
|
-
* `backend-observation/correlator.ts`'s `correlateBackendEvidence
|
|
5
|
-
*
|
|
6
|
-
* on its own -- rather than inventing a second correlation shape.
|
|
3
|
+
* remote log line (DEC-271's remote side). Follows the same pattern as
|
|
4
|
+
* `backend-observation/correlator.ts`'s `correlateBackendEvidence`: prefer
|
|
5
|
+
* a real shared identifier, never fall back to timing alone.
|
|
7
6
|
*
|
|
8
7
|
* Reuses `@descryy/runtime-contracts`' `Correlation`/`createCorrelation`
|
|
9
|
-
* directly
|
|
10
|
-
*
|
|
11
|
-
* same way (`isStructuralCorrelation` -- true for `trace-id`/`request-id`,
|
|
12
|
-
* false for `timing-context-fallback`) and a reader who already knows that
|
|
13
|
-
* contract does not have to learn a second one for the remote case.
|
|
8
|
+
* directly -- same `CorrelationMethod` union and `isConfirmed` derivation
|
|
9
|
+
* (`isStructuralCorrelation`) as everywhere else in this repo.
|
|
14
10
|
*/
|
|
15
11
|
import type { Correlation } from "@descryy/runtime-contracts";
|
|
16
12
|
import type { IngestedLogLine } from "./log-line.ts";
|
|
17
13
|
/**
|
|
18
|
-
* A captured browser/proxy request, reduced to
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* -- this module never generates one, mirroring
|
|
25
|
-
* `correlateBackendEvidence`'s use of pre-existing `evidenceId`s rather
|
|
26
|
-
* than minting its own.
|
|
14
|
+
* A captured browser/proxy request, reduced to what correlation needs.
|
|
15
|
+
* `timestamp`/`path` are always present; `traceId`/`requestId` are null
|
|
16
|
+
* unless the capturing side found real headers (W3C `traceparent`, see
|
|
17
|
+
* `external-service-observation/header-correlation.ts`). `id` is
|
|
18
|
+
* caller-assigned (typically an `Evidence.evidenceId`) -- this module never
|
|
19
|
+
* mints its own, mirroring `correlateBackendEvidence`.
|
|
27
20
|
*/
|
|
28
21
|
export interface CapturedRequestRef {
|
|
29
22
|
readonly id: string;
|
|
@@ -35,33 +28,25 @@ export interface CapturedRequestRef {
|
|
|
35
28
|
}
|
|
36
29
|
export interface CorrelateOptions {
|
|
37
30
|
/**
|
|
38
|
-
* Widest gap between
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* request landing and its log line appearing, narrow enough not to pair
|
|
42
|
-
* unrelated activity in a busy log.
|
|
31
|
+
* Widest gap between request and line timestamp still considered a
|
|
32
|
+
* timestamp+path match, in ms. Default 5000 -- generous for real
|
|
33
|
+
* network/log-flush latency, narrow enough not to pair unrelated activity.
|
|
43
34
|
*/
|
|
44
35
|
readonly windowMs?: number;
|
|
45
36
|
}
|
|
46
37
|
/**
|
|
47
|
-
* Best-effort correlation
|
|
48
|
-
*
|
|
38
|
+
* Best-effort correlation, DEC-271's preference order:
|
|
39
|
+
* 1. shared trace id (`"trace-id"`, confidence 1) -- same rule as
|
|
40
|
+
* `correlateBackendEvidence`'s local case.
|
|
41
|
+
* 2. shared request id (`"request-id"`, confidence 1).
|
|
42
|
+
* 3. request timestamp within `windowMs` of the line's AND request's
|
|
43
|
+
* `path` found in the line's redacted text (`"timing-context-fallback"`,
|
|
44
|
+
* confidence `TIMESTAMP_PATH_CONFIDENCE`, `isConfirmed: false`). Both
|
|
45
|
+
* signals required -- timestamp proximity alone is never evidence
|
|
46
|
+
* (DEC-271).
|
|
49
47
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* 2. a shared request id (`method: "request-id"`, confidence 1).
|
|
53
|
-
* 3. the request's timestamp within `windowMs` of the line's **and** the
|
|
54
|
-
* request's `path` appearing in the line's (already-redacted) text --
|
|
55
|
-
* `method: "timing-context-fallback"`, confidence
|
|
56
|
-
* `TIMESTAMP_PATH_CONFIDENCE`, `isConfirmed: false`. Both signals are
|
|
57
|
-
* required together; timestamp proximity alone is not treated as
|
|
58
|
-
* evidence of anything, per DEC-271's warning against inferring from
|
|
59
|
-
* timing on its own.
|
|
60
|
-
*
|
|
61
|
-
* Returns `null` -- DEC-271's "not observable here" for this one
|
|
62
|
-
* request/line pair -- when none of the above hold: no shared identifier,
|
|
63
|
-
* and either the line carries no parseable timestamp or the path/window
|
|
64
|
-
* test fails. Never fabricates a match to fill the gap.
|
|
48
|
+
* Returns `null` ("not observable here") when none hold. Never fabricates
|
|
49
|
+
* a match.
|
|
65
50
|
*/
|
|
66
51
|
export declare function correlateLogLine(request: CapturedRequestRef, line: IngestedLogLine, options?: CorrelateOptions): Correlation | null;
|
|
67
52
|
//# sourceMappingURL=correlator.d.ts.map
|
package/dist/correlator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlator.d.ts","sourceRoot":"","sources":["../src/correlator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"correlator.d.ts","sourceRoot":"","sources":["../src/correlator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,GAAG,IAAI,CAoCvI"}
|
package/dist/correlator.js
CHANGED
|
@@ -1,53 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Correlation between a captured browser/proxy request and an ingested
|
|
3
|
-
* remote log line (DEC-271's remote side). Follows the same pattern
|
|
4
|
-
* `backend-observation/correlator.ts`'s `correlateBackendEvidence
|
|
5
|
-
*
|
|
6
|
-
* on its own -- rather than inventing a second correlation shape.
|
|
3
|
+
* remote log line (DEC-271's remote side). Follows the same pattern as
|
|
4
|
+
* `backend-observation/correlator.ts`'s `correlateBackendEvidence`: prefer
|
|
5
|
+
* a real shared identifier, never fall back to timing alone.
|
|
7
6
|
*
|
|
8
7
|
* Reuses `@descryy/runtime-contracts`' `Correlation`/`createCorrelation`
|
|
9
|
-
* directly
|
|
10
|
-
*
|
|
11
|
-
* same way (`isStructuralCorrelation` -- true for `trace-id`/`request-id`,
|
|
12
|
-
* false for `timing-context-fallback`) and a reader who already knows that
|
|
13
|
-
* contract does not have to learn a second one for the remote case.
|
|
8
|
+
* directly -- same `CorrelationMethod` union and `isConfirmed` derivation
|
|
9
|
+
* (`isStructuralCorrelation`) as everywhere else in this repo.
|
|
14
10
|
*/
|
|
15
11
|
import { randomUUID } from "node:crypto";
|
|
16
12
|
import { createCorrelation } from "@descryy/runtime-contracts";
|
|
17
13
|
const DEFAULT_WINDOW_MS = 5000;
|
|
18
14
|
/**
|
|
19
|
-
* Confidence
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* than implying a false gradation within it. The structural distinction
|
|
26
|
-
* from a confirmed match (`isConfirmed: false`, via `isStructuralCorrelation`)
|
|
27
|
-
* is what actually matters; this number exists only so two
|
|
28
|
-
* `Correlation`s are never rendered as equally certain by a reader who
|
|
29
|
-
* looks at `confidence` alone.
|
|
15
|
+
* Confidence for every `"timing-context-fallback"` match. Fixed, not
|
|
16
|
+
* scaled by timestamp closeness -- DEC-271 wants an honest tier, not
|
|
17
|
+
* manufactured precision: there's no identifier, just two weak cues (a
|
|
18
|
+
* clock and a substring search). The real distinction is `isConfirmed:
|
|
19
|
+
* false`; this number only keeps two `Correlation`s from reading as
|
|
20
|
+
* equally certain via `confidence` alone.
|
|
30
21
|
*/
|
|
31
22
|
const TIMESTAMP_PATH_CONFIDENCE = 0.4;
|
|
32
23
|
/**
|
|
33
|
-
* Best-effort correlation
|
|
34
|
-
*
|
|
24
|
+
* Best-effort correlation, DEC-271's preference order:
|
|
25
|
+
* 1. shared trace id (`"trace-id"`, confidence 1) -- same rule as
|
|
26
|
+
* `correlateBackendEvidence`'s local case.
|
|
27
|
+
* 2. shared request id (`"request-id"`, confidence 1).
|
|
28
|
+
* 3. request timestamp within `windowMs` of the line's AND request's
|
|
29
|
+
* `path` found in the line's redacted text (`"timing-context-fallback"`,
|
|
30
|
+
* confidence `TIMESTAMP_PATH_CONFIDENCE`, `isConfirmed: false`). Both
|
|
31
|
+
* signals required -- timestamp proximity alone is never evidence
|
|
32
|
+
* (DEC-271).
|
|
35
33
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* 2. a shared request id (`method: "request-id"`, confidence 1).
|
|
39
|
-
* 3. the request's timestamp within `windowMs` of the line's **and** the
|
|
40
|
-
* request's `path` appearing in the line's (already-redacted) text --
|
|
41
|
-
* `method: "timing-context-fallback"`, confidence
|
|
42
|
-
* `TIMESTAMP_PATH_CONFIDENCE`, `isConfirmed: false`. Both signals are
|
|
43
|
-
* required together; timestamp proximity alone is not treated as
|
|
44
|
-
* evidence of anything, per DEC-271's warning against inferring from
|
|
45
|
-
* timing on its own.
|
|
46
|
-
*
|
|
47
|
-
* Returns `null` -- DEC-271's "not observable here" for this one
|
|
48
|
-
* request/line pair -- when none of the above hold: no shared identifier,
|
|
49
|
-
* and either the line carries no parseable timestamp or the path/window
|
|
50
|
-
* test fails. Never fabricates a match to fill the gap.
|
|
34
|
+
* Returns `null` ("not observable here") when none hold. Never fabricates
|
|
35
|
+
* a match.
|
|
51
36
|
*/
|
|
52
37
|
export function correlateLogLine(request, line, options = {}) {
|
|
53
38
|
if (request.traceId !== null && request.traceId === line.traceId) {
|
|
@@ -68,8 +53,7 @@ export function correlateLogLine(request, line, options = {}) {
|
|
|
68
53
|
evidenceIds: [request.id, line.lineId],
|
|
69
54
|
});
|
|
70
55
|
}
|
|
71
|
-
// No clock
|
|
72
|
-
// match at all. Claiming one would be a guess this module refuses.
|
|
56
|
+
// No clock to window against -- no match, not a weaker one.
|
|
73
57
|
if (line.timestamp === null)
|
|
74
58
|
return null;
|
|
75
59
|
const windowMs = options.windowMs ?? DEFAULT_WINDOW_MS;
|
package/dist/correlator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlator.js","sourceRoot":"","sources":["../src/correlator.ts"],"names":[],"mappings":"AAAA
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,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACrG,IAAI,OAAO,GAAG,QAAQ;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAElD,OAAO,iBAAiB,CAAC;QACvB,aAAa,EAAE,UAAU,EAAE;QAC3B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,yBAAyB;QACjC,UAAU,EAAE,yBAAyB;QACrC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;KACvC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Concrete adapter #1 for DEC-271's remote side: a log
|
|
2
|
+
* Concrete adapter #1 for DEC-271's remote side: a log file the user
|
|
3
3
|
* points us at.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* only in where the lines come from -- not built this pass.
|
|
5
|
+
* Chosen over a command-stdout adapter (`RemoteLogLocation`'s other option)
|
|
6
|
+
* as the simpler case to build correctly this pass: deterministic content
|
|
7
|
+
* on disk, no child-process lifecycle, no stdout encoding/buffering
|
|
8
|
+
* question. A command adapter is the natural next one -- reuses
|
|
9
|
+
* `buildIngestedLogLine` unchanged, differs only in line source -- not
|
|
10
|
+
* built this pass.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* partial, per this repo's "honest degradation" rule: a caller that needs
|
|
16
|
-
* live tailing does not get it from this function today.
|
|
12
|
+
* One-shot, not a continuous tail: reads the file's contents as of the
|
|
13
|
+
* call, doesn't follow appended writes (honest-degradation disclosure).
|
|
17
14
|
*/
|
|
18
15
|
import type { RedactionPolicy } from "@descryy/runtime-evidence-store";
|
|
19
16
|
import { type IngestedLogLine } from "./log-line.ts";
|
|
@@ -29,14 +26,11 @@ export interface FileLogAdapterOptions {
|
|
|
29
26
|
readonly redactionPolicy?: RedactionPolicy;
|
|
30
27
|
}
|
|
31
28
|
/**
|
|
32
|
-
* Reads `config.location.path
|
|
33
|
-
*
|
|
34
|
-
* `redact()` by the time it is returned -- see `log-line.ts`.
|
|
29
|
+
* Reads `config.location.path`, one `IngestedLogLine` per non-empty line,
|
|
30
|
+
* in file order, already through `redact()` (see `log-line.ts`).
|
|
35
31
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* this source, surfaced as a rejection a caller must handle, not a silent
|
|
39
|
-
* empty result indistinguishable from an empty log.
|
|
32
|
+
* Throws with path + underlying error on read failure (missing, denied)
|
|
33
|
+
* rather than a silent empty result indistinguishable from an empty log.
|
|
40
34
|
*/
|
|
41
35
|
export declare function ingestFileLog(options: FileLogAdapterOptions): Promise<readonly IngestedLogLine[]>;
|
|
42
36
|
//# sourceMappingURL=file-log-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-log-adapter.d.ts","sourceRoot":"","sources":["../src/file-log-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"file-log-adapter.d.ts","sourceRoot":"","sources":["../src/file-log-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAcvG"}
|
package/dist/file-log-adapter.js
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Concrete adapter #1 for DEC-271's remote side: a log
|
|
2
|
+
* Concrete adapter #1 for DEC-271's remote side: a log file the user
|
|
3
3
|
* points us at.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* only in where the lines come from -- not built this pass.
|
|
5
|
+
* Chosen over a command-stdout adapter (`RemoteLogLocation`'s other option)
|
|
6
|
+
* as the simpler case to build correctly this pass: deterministic content
|
|
7
|
+
* on disk, no child-process lifecycle, no stdout encoding/buffering
|
|
8
|
+
* question. A command adapter is the natural next one -- reuses
|
|
9
|
+
* `buildIngestedLogLine` unchanged, differs only in line source -- not
|
|
10
|
+
* built this pass.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* partial, per this repo's "honest degradation" rule: a caller that needs
|
|
16
|
-
* live tailing does not get it from this function today.
|
|
12
|
+
* One-shot, not a continuous tail: reads the file's contents as of the
|
|
13
|
+
* call, doesn't follow appended writes (honest-degradation disclosure).
|
|
17
14
|
*/
|
|
18
15
|
import { readFile } from "node:fs/promises";
|
|
19
16
|
import { buildIngestedLogLine } from "./log-line.js";
|
|
20
17
|
/**
|
|
21
|
-
* Reads `config.location.path
|
|
22
|
-
*
|
|
23
|
-
* `redact()` by the time it is returned -- see `log-line.ts`.
|
|
18
|
+
* Reads `config.location.path`, one `IngestedLogLine` per non-empty line,
|
|
19
|
+
* in file order, already through `redact()` (see `log-line.ts`).
|
|
24
20
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* this source, surfaced as a rejection a caller must handle, not a silent
|
|
28
|
-
* empty result indistinguishable from an empty log.
|
|
21
|
+
* Throws with path + underlying error on read failure (missing, denied)
|
|
22
|
+
* rather than a silent empty result indistinguishable from an empty log.
|
|
29
23
|
*/
|
|
30
24
|
export async function ingestFileLog(options) {
|
|
31
25
|
const { config, redactionPolicy } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-log-adapter.js","sourceRoot":"","sources":["../src/file-log-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"file-log-adapter.js","sourceRoot":"","sources":["../src/file-log-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAwB,MAAM,eAAe,CAAC;AAY3E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA8B;IAChE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAC5C,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,MAAM,EAAE,CAAC,CAAC;IACxG,CAAC;IAED,OAAO,OAAO;SACX,KAAK,CAAC,OAAO,CAAC;SACd,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/log-line.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One ingested log line, redacted before it
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* One ingested log line, redacted before it's ever handed back (DEC-271:
|
|
3
|
+
* "log content is redacted before it reaches the model, not just before
|
|
4
|
+
* display -- the exposure is the read, not the render").
|
|
5
5
|
*
|
|
6
6
|
* Reuses `@descryy/runtime-evidence-store`'s `redact()` rather than
|
|
7
|
-
* reimplementing key-name/body/PII/command scanning
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* convention (`raw
|
|
11
|
-
*
|
|
12
|
-
* `{ raw: line }` before redaction, so a JSON-shaped line gets `redact()`'s
|
|
13
|
-
* full key-name + text-scan treatment (parsed, walked, redacted key by
|
|
14
|
-
* key), and a plain-text line gets its text scanned for emails, card
|
|
15
|
-
* numbers and long tokens -- the same two paths `redactBodyString` already
|
|
16
|
-
* implements, not a new one.
|
|
7
|
+
* reimplementing key-name/body/PII/command scanning, same discipline
|
|
8
|
+
* `database-observation`/`browser` collectors follow. Every line is
|
|
9
|
+
* wrapped as `{ raw: line }` before redaction, reusing `redact()`'s
|
|
10
|
+
* body-bearing-key convention (`raw`) -- JSON lines get key-by-key
|
|
11
|
+
* redaction, plain-text lines get scanned for emails/card numbers/tokens.
|
|
17
12
|
*/
|
|
18
13
|
import type { RedactionStatus } from "@descryy/runtime-contracts";
|
|
19
14
|
import { type RedactionPolicy } from "@descryy/runtime-evidence-store";
|
|
@@ -29,23 +24,19 @@ export interface IngestedLogLine {
|
|
|
29
24
|
readonly redactionStatus: RedactionStatus;
|
|
30
25
|
}
|
|
31
26
|
/**
|
|
32
|
-
* Builds one `IngestedLogLine` from
|
|
33
|
-
*
|
|
27
|
+
* Builds one `IngestedLogLine` from raw text plus the user's
|
|
28
|
+
* `RemoteLogSourceConfig`.
|
|
34
29
|
*
|
|
35
|
-
* Identifier extraction always runs against the
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* may already read `[REDACTED]` where the id was.
|
|
30
|
+
* Identifier extraction always runs against the pre-redaction text -- a
|
|
31
|
+
* trace/request id is metadata, not payload, same distinction
|
|
32
|
+
* `Evidence.traceId`/`requestId` draw by living outside `Evidence.payload`
|
|
33
|
+
* and `redact()`'s reach. Extracting after redaction risks reading an id
|
|
34
|
+
* out of a line already showing `[REDACTED]` where it was.
|
|
41
35
|
*
|
|
42
|
-
* Priority
|
|
43
|
-
*
|
|
44
|
-
* `
|
|
45
|
-
*
|
|
46
|
-
* when present; and the user's declared `traceIdField`, when it names a
|
|
47
|
-
* real value on this line, wins over both -- it is the one signal the user
|
|
48
|
-
* actually told us about rather than one this module inferred.
|
|
36
|
+
* Priority (DEC-271 "ask, don't guess"): `extractCorrelationIds`'s generic
|
|
37
|
+
* heuristic runs first as baseline; a JSON line's own `requestId`/
|
|
38
|
+
* `request_id` field overrides it; the user's declared `traceIdField`,
|
|
39
|
+
* when it names a real value, wins over both.
|
|
49
40
|
*/
|
|
50
41
|
export declare function buildIngestedLogLine(rawLine: string, config: Pick<RemoteLogSourceConfig, "format" | "traceIdField">, redactionPolicy?: RedactionPolicy): IngestedLogLine;
|
|
51
42
|
//# sourceMappingURL=log-line.d.ts.map
|
package/dist/log-line.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-line.d.ts","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"log-line.d.ts","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8HAA8H;IAC9H,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8GAA8G;IAC9G,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC3C;AAkCD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,GAAG,cAAc,CAAC,EAC9D,eAAe,GAAE,eAAoB,GACpC,eAAe,CAoCjB"}
|
package/dist/log-line.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One ingested log line, redacted before it
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* One ingested log line, redacted before it's ever handed back (DEC-271:
|
|
3
|
+
* "log content is redacted before it reaches the model, not just before
|
|
4
|
+
* display -- the exposure is the read, not the render").
|
|
5
5
|
*
|
|
6
6
|
* Reuses `@descryy/runtime-evidence-store`'s `redact()` rather than
|
|
7
|
-
* reimplementing key-name/body/PII/command scanning
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* convention (`raw
|
|
11
|
-
*
|
|
12
|
-
* `{ raw: line }` before redaction, so a JSON-shaped line gets `redact()`'s
|
|
13
|
-
* full key-name + text-scan treatment (parsed, walked, redacted key by
|
|
14
|
-
* key), and a plain-text line gets its text scanned for emails, card
|
|
15
|
-
* numbers and long tokens -- the same two paths `redactBodyString` already
|
|
16
|
-
* implements, not a new one.
|
|
7
|
+
* reimplementing key-name/body/PII/command scanning, same discipline
|
|
8
|
+
* `database-observation`/`browser` collectors follow. Every line is
|
|
9
|
+
* wrapped as `{ raw: line }` before redaction, reusing `redact()`'s
|
|
10
|
+
* body-bearing-key convention (`raw`) -- JSON lines get key-by-key
|
|
11
|
+
* redaction, plain-text lines get scanned for emails/card numbers/tokens.
|
|
17
12
|
*/
|
|
18
13
|
import { randomUUID } from "node:crypto";
|
|
19
14
|
import { redact } from "@descryy/runtime-evidence-store";
|
|
@@ -47,23 +42,19 @@ function namedFieldFromText(text, field) {
|
|
|
47
42
|
return pattern.exec(text)?.[1] ?? null;
|
|
48
43
|
}
|
|
49
44
|
/**
|
|
50
|
-
* Builds one `IngestedLogLine` from
|
|
51
|
-
*
|
|
45
|
+
* Builds one `IngestedLogLine` from raw text plus the user's
|
|
46
|
+
* `RemoteLogSourceConfig`.
|
|
52
47
|
*
|
|
53
|
-
* Identifier extraction always runs against the
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* may already read `[REDACTED]` where the id was.
|
|
48
|
+
* Identifier extraction always runs against the pre-redaction text -- a
|
|
49
|
+
* trace/request id is metadata, not payload, same distinction
|
|
50
|
+
* `Evidence.traceId`/`requestId` draw by living outside `Evidence.payload`
|
|
51
|
+
* and `redact()`'s reach. Extracting after redaction risks reading an id
|
|
52
|
+
* out of a line already showing `[REDACTED]` where it was.
|
|
59
53
|
*
|
|
60
|
-
* Priority
|
|
61
|
-
*
|
|
62
|
-
* `
|
|
63
|
-
*
|
|
64
|
-
* when present; and the user's declared `traceIdField`, when it names a
|
|
65
|
-
* real value on this line, wins over both -- it is the one signal the user
|
|
66
|
-
* actually told us about rather than one this module inferred.
|
|
54
|
+
* Priority (DEC-271 "ask, don't guess"): `extractCorrelationIds`'s generic
|
|
55
|
+
* heuristic runs first as baseline; a JSON line's own `requestId`/
|
|
56
|
+
* `request_id` field overrides it; the user's declared `traceIdField`,
|
|
57
|
+
* when it names a real value, wins over both.
|
|
67
58
|
*/
|
|
68
59
|
export function buildIngestedLogLine(rawLine, config, redactionPolicy = {}) {
|
|
69
60
|
const parsedRecord = config.format === "json-lines" ? tryParseJsonObject(rawLine) : null;
|
package/dist/log-line.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-line.js","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"log-line.js","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAwB,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAe7E,MAAM,aAAa,GAAG,6EAA6E,CAAC;AAEpG,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACpD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC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2B,CAAC,GAAG,CAAC;IAErD,OAAO;QACL,MAAM,EAAE,UAAU,EAAE;QACpB,SAAS;QACT,GAAG,EAAE,WAAW;QAChB,OAAO;QACP,SAAS;QACT,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The "ask, don't guess" input contract for remote log ingestion (DEC-271).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* is heterogeneous by nature (Datadog, CloudWatch, plain stdout, full
|
|
10
|
-
* OpenTelemetry, or nothing at all). So setup has to ask: where are the
|
|
11
|
-
* logs, what shape are they in, and is there a field that already carries a
|
|
12
|
-
* trace/request id.
|
|
4
|
+
* Local/booted execution injects its own proxy, nothing to ask. Remote
|
|
5
|
+
* environments (DEC-266) aren't owned by Descry, so the only mechanism is
|
|
6
|
+
* ingesting whatever the target already has -- heterogeneous by nature
|
|
7
|
+
* (Datadog, CloudWatch, stdout, OpenTelemetry, or nothing), so setup must
|
|
8
|
+
* ask: where are the logs, what shape, is there a trace/request id field.
|
|
13
9
|
*
|
|
14
|
-
* This file defines
|
|
15
|
-
*
|
|
16
|
-
* here. The logic that consumes it lives in the adapters
|
|
17
|
-
* (`file-log-adapter.ts` today) and in `correlator.ts`.
|
|
10
|
+
* This file defines the shape only -- filled in by whatever asks the user
|
|
11
|
+
* (CLI prompt, UI form), never inferred here. Consumers: `file-log-adapter.ts`, `correlator.ts`.
|
|
18
12
|
*/
|
|
19
13
|
/**
|
|
20
|
-
* What the user says they have. `file
|
|
21
|
-
* ("here's our log file" / "here's how we tail it")
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* see `file-log-adapter.ts`'s own doc comment for why it was chosen over
|
|
25
|
-
* `command`, and why `url` isn't built at all yet.
|
|
14
|
+
* What the user says they have. `file`/`command` are both plausible
|
|
15
|
+
* ("here's our log file" / "here's how we tail it"); `url` covers a
|
|
16
|
+
* log-query API or signed export link. Only `file` has a concrete adapter
|
|
17
|
+
* this pass -- see `file-log-adapter.ts` for why.
|
|
26
18
|
*/
|
|
27
19
|
export type RemoteLogLocation = {
|
|
28
20
|
readonly kind: "file";
|
|
@@ -37,11 +29,10 @@ export type RemoteLogLocation = {
|
|
|
37
29
|
};
|
|
38
30
|
export declare const REMOTE_LOG_FORMATS: readonly ["plain-text", "json-lines"];
|
|
39
31
|
/**
|
|
40
|
-
* The two shapes this pass
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* rather than accepting a value it would silently mishandle.
|
|
32
|
+
* The two shapes this pass parses. Not a claim these are the only shapes a
|
|
33
|
+
* real target uses (e.g. "Heroku router format") -- narrowed to what
|
|
34
|
+
* `buildIngestedLogLine` actually handles, rather than silently mishandling
|
|
35
|
+
* an unsupported one.
|
|
45
36
|
*/
|
|
46
37
|
export type RemoteLogFormat = (typeof REMOTE_LOG_FORMATS)[number];
|
|
47
38
|
export interface RemoteLogSourceConfig {
|
|
@@ -49,16 +40,12 @@ export interface RemoteLogSourceConfig {
|
|
|
49
40
|
readonly format: RemoteLogFormat;
|
|
50
41
|
/**
|
|
51
42
|
* The field the user says already carries a trace/request id -- a JSON
|
|
52
|
-
* key for `"json-lines"`,
|
|
43
|
+
* key for `"json-lines"`, a `name=`/`name:` field for `"plain-text"`.
|
|
53
44
|
*
|
|
54
|
-
* `null`/absent
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `Correlation.method`/`confidence` on the result, never silently
|
|
59
|
-
* promoted to look as certain as a field the user actually named. This is
|
|
60
|
-
* the same "ask rather than guess" principle DEC-266 applies to target
|
|
61
|
-
* URLs, applied here to trace identity.
|
|
45
|
+
* `null`/absent falls back first to `extractCorrelationIds`'s generic
|
|
46
|
+
* heuristic, then to a timestamp+path window -- both weaker, both
|
|
47
|
+
* disclosed via `Correlation.method`/`confidence`, never promoted to
|
|
48
|
+
* look as certain as a declared field (DEC-266's "ask, don't guess").
|
|
62
49
|
*/
|
|
63
50
|
readonly traceIdField?: string | null;
|
|
64
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-source-config.d.ts","sourceRoot":"","sources":["../src/log-source-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"log-source-config.d.ts","sourceRoot":"","sources":["../src/log-source-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACzF;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD,eAAO,MAAM,kBAAkB,uCAAwC,CAAC;AACxE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The "ask, don't guess" input contract for remote log ingestion (DEC-271).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* is heterogeneous by nature (Datadog, CloudWatch, plain stdout, full
|
|
10
|
-
* OpenTelemetry, or nothing at all). So setup has to ask: where are the
|
|
11
|
-
* logs, what shape are they in, and is there a field that already carries a
|
|
12
|
-
* trace/request id.
|
|
4
|
+
* Local/booted execution injects its own proxy, nothing to ask. Remote
|
|
5
|
+
* environments (DEC-266) aren't owned by Descry, so the only mechanism is
|
|
6
|
+
* ingesting whatever the target already has -- heterogeneous by nature
|
|
7
|
+
* (Datadog, CloudWatch, stdout, OpenTelemetry, or nothing), so setup must
|
|
8
|
+
* ask: where are the logs, what shape, is there a trace/request id field.
|
|
13
9
|
*
|
|
14
|
-
* This file defines
|
|
15
|
-
*
|
|
16
|
-
* here. The logic that consumes it lives in the adapters
|
|
17
|
-
* (`file-log-adapter.ts` today) and in `correlator.ts`.
|
|
10
|
+
* This file defines the shape only -- filled in by whatever asks the user
|
|
11
|
+
* (CLI prompt, UI form), never inferred here. Consumers: `file-log-adapter.ts`, `correlator.ts`.
|
|
18
12
|
*/
|
|
19
13
|
export const REMOTE_LOG_FORMATS = ["plain-text", "json-lines"];
|
|
20
14
|
//# sourceMappingURL=log-source-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-source-config.js","sourceRoot":"","sources":["../src/log-source-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"log-source-config.js","sourceRoot":"","sources":["../src/log-source-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,YAAY,CAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descryy/runtime-remote-log-ingestion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Remote-environment log ingestion (DEC-271): for staging/preview/production, where Descry cannot inject a proxy into infra it doesn't own, ingest whatever the target already has -- logs, and trace ids if a field is declared -- and correlate best-effort against a captured browser/proxy request, with confidence disclosed rather than assumed.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/descryhq-wq/descry-runtime.git",
|
|
10
|
+
"directory": "packages/remote-log-ingestion"
|
|
11
|
+
},
|
|
7
12
|
"engines": {
|
|
8
13
|
"node": ">=22.5"
|
|
9
14
|
},
|
|
@@ -24,8 +29,8 @@
|
|
|
24
29
|
"build": "tsc -b"
|
|
25
30
|
},
|
|
26
31
|
"dependencies": {
|
|
27
|
-
"@descryy/runtime-contracts": "0.
|
|
28
|
-
"@descryy/runtime-backend-observation": "0.
|
|
29
|
-
"@descryy/runtime-evidence-store": "0.
|
|
32
|
+
"@descryy/runtime-contracts": "0.3.0",
|
|
33
|
+
"@descryy/runtime-backend-observation": "0.3.0",
|
|
34
|
+
"@descryy/runtime-evidence-store": "0.4.0"
|
|
30
35
|
}
|
|
31
36
|
}
|