@descryy/runtime-orchestrator 0.2.1 → 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 (46) hide show
  1. package/LICENSE +6 -0
  2. package/dist/attach-to-running-jvm-process.d.ts +45 -98
  3. package/dist/attach-to-running-jvm-process.d.ts.map +1 -1
  4. package/dist/attach-to-running-jvm-process.js +206 -136
  5. package/dist/attach-to-running-jvm-process.js.map +1 -1
  6. package/dist/attach-to-running-node-process.d.ts +45 -103
  7. package/dist/attach-to-running-node-process.d.ts.map +1 -1
  8. package/dist/attach-to-running-node-process.js +90 -115
  9. package/dist/attach-to-running-node-process.js.map +1 -1
  10. package/dist/attach-to-running-process.d.ts +32 -70
  11. package/dist/attach-to-running-process.d.ts.map +1 -1
  12. package/dist/attach-to-running-process.js +26 -54
  13. package/dist/attach-to-running-process.js.map +1 -1
  14. package/dist/cdp-client.d.ts +8 -18
  15. package/dist/cdp-client.d.ts.map +1 -1
  16. package/dist/cdp-client.js +9 -22
  17. package/dist/cdp-client.js.map +1 -1
  18. package/dist/cgroup-partial-restriction.d.ts +42 -89
  19. package/dist/cgroup-partial-restriction.d.ts.map +1 -1
  20. package/dist/cgroup-partial-restriction.js +44 -91
  21. package/dist/cgroup-partial-restriction.js.map +1 -1
  22. package/dist/collector-version.d.ts +3 -8
  23. package/dist/collector-version.d.ts.map +1 -1
  24. package/dist/collector-version.js +3 -8
  25. package/dist/collector-version.js.map +1 -1
  26. package/dist/instrumented-execution.d.ts +30 -73
  27. package/dist/instrumented-execution.d.ts.map +1 -1
  28. package/dist/instrumented-execution.js +121 -251
  29. package/dist/instrumented-execution.js.map +1 -1
  30. package/dist/jvm-agent/build.d.ts +29 -53
  31. package/dist/jvm-agent/build.d.ts.map +1 -1
  32. package/dist/jvm-agent/build.js +34 -61
  33. package/dist/jvm-agent/build.js.map +1 -1
  34. package/dist/polling-output-source.d.ts +8 -19
  35. package/dist/polling-output-source.d.ts.map +1 -1
  36. package/dist/polling-output-source.js +14 -31
  37. package/dist/polling-output-source.js.map +1 -1
  38. package/dist/profile-backend-observation.d.ts +26 -53
  39. package/dist/profile-backend-observation.d.ts.map +1 -1
  40. package/dist/profile-backend-observation.js +26 -55
  41. package/dist/profile-backend-observation.js.map +1 -1
  42. package/dist/respawn-and-supervise.d.ts +39 -72
  43. package/dist/respawn-and-supervise.d.ts.map +1 -1
  44. package/dist/respawn-and-supervise.js +43 -84
  45. package/dist/respawn-and-supervise.js.map +1 -1
  46. package/package.json +14 -9
@@ -1,57 +1,30 @@
1
1
  /**
2
- * Partial going-forward resource restriction for an already-running,
3
- * attached-to process, via cgroups v2 -- the second, narrower alternative
4
- * next to respawn-and-supervise (`respawn-and-supervise.ts`).
2
+ * Partial going-forward resource restriction for an already-running, attached-to
3
+ * process, via cgroups v2 narrower alternative to `respawn-and-supervise.ts`.
5
4
  *
6
- * **What this genuinely gets you, stated exactly, because the honest
7
- * boundary here is not the same shape as spawn-mode's.** Moving a live
8
- * pid's cgroup membership (writing it into a delegated cgroup's own
9
- * `cgroup.procs`, per the kernel's cgroups v2 unified hierarchy) applies
10
- * real, kernel-enforced resource limits -- `memory.max`, `cpu.max`,
11
- * `pids.max` -- to a process this runtime never spawned, without killing
12
- * or restarting it. That is real and this module proves it for real (see
13
- * the test suite). **It does NOT, and structurally cannot, give the moved
14
- * process any filesystem or network isolation.** Changing which mount or
15
- * network namespace an already-running process belongs to needs `setns()`
16
- * against a live pid -- a fundamentally different, far more invasive
17
- * operation than a cgroup move, not attempted here and out of scope for
18
- * this pass. Every value this module returns, and every place this
19
- * capability is described, says so: `CGROUP_PARTIAL_RESTRICTION_SCOPE`
20
- * below is the literal, load-bearing string every result carries, precisely
21
- * so nothing downstream can round it up to "sandboxed" or "isolated" --
22
- * words that would misrepresent this as equivalent to `sandbox.ts`'s real
23
- * spawn-time bwrap isolation.
5
+ * Moving a live pid into a delegated cgroup applies real kernel-enforced limits
6
+ * (`memory.max`, `cpu.max`, `pids.max`) without killing/restarting it. **It does
7
+ * NOT and cannot give filesystem or network isolation** that needs `setns()`
8
+ * against a live pid, out of scope here. `CGROUP_PARTIAL_RESTRICTION_SCOPE` is the
9
+ * literal string every result carries so nothing downstream rounds this up to
10
+ * "sandboxed"/"isolated" (which would misrepresent it as `sandbox.ts`'s real
11
+ * spawn-time bwrap isolation).
24
12
  *
25
- * **How the delegated cgroup is found -- measured on this host, not
26
- * assumed from cgroups v2 documentation.** A non-root user cannot write
27
- * anywhere under `/sys/fs/cgroup` by default; what makes any of this
28
- * possible at all is a systemd user session's own delegation
29
- * (`user@<uid>.service`, `Delegate=yes`), which typically extends through
30
- * `app.slice`/`session.slice`/`background.slice` beneath it. But
31
- * delegation is not uniform all the way down: cgroups v2's "no internal
32
- * processes" rule means a *leaf* cgroup that already directly holds a
33
- * process (a systemd `.scope`, including the very one this Node process
34
- * itself runs in) generally cannot have its `subtree_control` extended
35
- * further -- writing to it fails with `EBUSY`, measured directly against
36
- * this repo's own dev host while building this module. `findDelegatedCgroupAncestor`
37
- * therefore does not trust `cgroup.subtree_control` text or permission
38
- * bits alone; it walks up from this process's own `/proc/self/cgroup` path
39
- * and, at each ancestor, creates a real, temporary probe child directory
40
- * and checks whether the kernel actually gave it a `memory.max` file --
41
- * the only way to honestly know a given ancestor's delegation reaches that
42
- * far, empirically, the same "prove it against the real mechanism" standard
43
- * `sandbox.ts`'s own escape tests hold spawn-mode isolation to.
13
+ * Finding the delegated ancestor: a non-root user can only write under
14
+ * `/sys/fs/cgroup` where a systemd user session delegates it (`Delegate=yes`).
15
+ * Delegation isn't uniform all the way down a leaf cgroup already holding a
16
+ * process (e.g. this Node process's own scope) generally can't extend
17
+ * `subtree_control` further; writing fails `EBUSY` (measured on this repo's dev
18
+ * host). So `findDelegatedCgroupAncestor` doesn't trust subtree_control text or
19
+ * permission bits it walks up from `/proc/self/cgroup` and, at each ancestor,
20
+ * creates a real temporary probe child and checks whether the kernel actually gave
21
+ * it a `memory.max` file.
44
22
  */
45
23
  import { existsSync, mkdirSync, readFileSync, rmdirSync, writeFileSync } from "node:fs";
46
24
  import { dirname, join } from "node:path";
47
25
  import { isProcessAlive } from "./attach-to-running-process.js";
48
26
  const CGROUP_ROOT = "/sys/fs/cgroup";
49
- /**
50
- * The literal, load-bearing scope string. Every `CgroupMoveResult` carries
51
- * this exact value under `scope` -- never restated by hand elsewhere, so a
52
- * caller (or a future capability-report string, or a decisions-inbox entry)
53
- * that quotes `.scope` can never accidentally drift from this wording.
54
- */
27
+ /** Literal scope string every `CgroupMoveResult` carries under `scope` — never restated by hand, so quotes of it can't drift. */
55
28
  export const CGROUP_PARTIAL_RESTRICTION_SCOPE = "partial -- resource limits only, no filesystem or network isolation";
56
29
  function ownUnifiedCgroupPath() {
57
30
  let content;
@@ -62,10 +35,7 @@ function ownUnifiedCgroupPath() {
62
35
  return null;
63
36
  }
64
37
  for (const line of content.trim().split("\n")) {
65
- // cgroups v2 unified-hierarchy lines read "0::<path>" -- hierarchy id 0,
66
- // no named controllers (that's a v1 concept), then the path. A host
67
- // still running v1 controllers alongside v2 has other numbered lines
68
- // here too; only the "0::" one is this module's concern.
38
+ // unified-hierarchy lines read "0::<path>"; only the "0::" line matters here
69
39
  const firstColon = line.indexOf(":");
70
40
  const secondColon = line.indexOf(":", firstColon + 1);
71
41
  if (firstColon === -1 || secondColon === -1)
@@ -77,13 +47,10 @@ function ownUnifiedCgroupPath() {
77
47
  return null;
78
48
  }
79
49
  /**
80
- * Real, empirical probe -- not a permission-bit read. See this module's own
81
- * doc for why: a directory can be `mkdir`-able yet still produce a child
82
- * with no `memory.max` at all, when the controller was never actually
83
- * enabled in that parent's own `cgroup.subtree_control` (this process's own
84
- * leaf scope is exactly this shape, measured directly). The only honest
85
- * test is creating a real probe child and checking what the kernel actually
86
- * gave it.
50
+ * Real empirical probe, not a permission-bit read a directory can be
51
+ * `mkdir`-able yet its child still lack `memory.max` if the controller was never
52
+ * enabled in `subtree_control` (this process's own leaf scope is exactly this
53
+ * shape, measured directly).
87
54
  */
88
55
  function probeControllableChild(candidateDir) {
89
56
  const probe = join(candidateDir, `.descry-cgroup-probe-${String(process.pid)}-${String(Date.now())}-${String(Math.random()).slice(2, 8)}`);
@@ -98,18 +65,15 @@ function probeControllableChild(candidateDir) {
98
65
  rmdirSync(probe);
99
66
  }
100
67
  catch {
101
- // Best-effort cleanup of our own just-created probe directory -- not
102
- // this module's problem if something else raced to touch it first.
68
+ // best-effort cleanup; not our problem if something raced to touch it first
103
69
  }
104
70
  return controllable;
105
71
  }
106
72
  /**
107
- * Walks up from this process's own cgroup toward `/sys/fs/cgroup`, returning
108
- * the deepest (most specific) ancestor directory whose children genuinely
109
- * get a real `memory.max` -- i.e. the actual delegation boundary, not
110
- * merely a directory this uid happens to own. `null` when cgroups v2 is not
111
- * mounted, this process's own cgroup path cannot be determined, or no
112
- * ancestor all the way to the root passes the probe (no delegation at all).
73
+ * Walks up from this process's cgroup toward `/sys/fs/cgroup`, returning the
74
+ * deepest ancestor whose children genuinely get a real `memory.max` — the actual
75
+ * delegation boundary. `null` if cgroups v2 isn't mounted, own path can't be
76
+ * determined, or no ancestor passes the probe.
113
77
  */
114
78
  export function findDelegatedCgroupAncestor() {
115
79
  if (process.platform !== "linux")
@@ -120,10 +84,7 @@ export function findDelegatedCgroupAncestor() {
120
84
  if (ownPath === null)
121
85
  return null;
122
86
  let dir = join(CGROUP_ROOT, ownPath.replace(/^\/+/, ""));
123
- // Walk strictly upward, never testing CGROUP_ROOT itself -- writing
124
- // limits at the true root would apply host-wide and is root-only on
125
- // every real system anyway, so it is deliberately excluded rather than
126
- // reached as a fallback.
87
+ // never test CGROUP_ROOT itself: root-wide limits are root-only anyway
127
88
  while (dir !== CGROUP_ROOT && dirname(dir) !== dir) {
128
89
  if (existsSync(dir) && probeControllableChild(dir))
129
90
  return dir;
@@ -150,16 +111,13 @@ export function cgroupV2Capability() {
150
111
  return { availability: "available", reason: null };
151
112
  }
152
113
  /**
153
- * Moves `options.pid` -- an already-running process this runtime did not
154
- * spawn -- into a newly created, resource-limited cgroup. Throws (does not
155
- * silently proceed) when the target is not alive, when `cgroupV2Capability()`
156
- * reports unavailable, or when a declared limit's controller file does not
157
- * actually exist under the delegated ancestor found for it.
114
+ * Moves `options.pid` (a process this runtime did not spawn) into a newly created,
115
+ * resource-limited cgroup. Throws if the target isn't alive, `cgroupV2Capability()`
116
+ * is unavailable, or a declared limit's controller file doesn't exist.
158
117
  *
159
- * Limits are written to the new cgroup BEFORE the pid is moved into it, so
160
- * a process is never observed inside a cgroup with a half-applied limit
161
- * set; if any write fails, the created (still-empty) cgroup is removed and
162
- * the error is rethrown rather than left as an orphaned, unlimited group.
118
+ * Limits are written before the pid is moved in, so a process is never observed
119
+ * with a half-applied limit set; on any write failure the still-empty cgroup is
120
+ * removed and the error rethrown, never left orphaned.
163
121
  */
164
122
  export function moveProcessIntoRestrictedCgroup(options) {
165
123
  if (!isProcessAlive(options.pid)) {
@@ -171,8 +129,7 @@ export function moveProcessIntoRestrictedCgroup(options) {
171
129
  }
172
130
  const ancestor = findDelegatedCgroupAncestor();
173
131
  if (ancestor === null) {
174
- // Unreachable given capability.availability === "available" above, but
175
- // narrows the type honestly rather than a non-null assertion.
132
+ // unreachable given availability check above; narrows the type honestly
176
133
  throw new Error("moveProcessIntoRestrictedCgroup: no delegated cgroup ancestor found despite capability reporting available -- internal inconsistency.");
177
134
  }
178
135
  const cgroupPath = join(ancestor, `descry-restrict-${options.nameHint ?? String(options.pid)}-${String(Date.now())}`);
@@ -184,17 +141,14 @@ export function moveProcessIntoRestrictedCgroup(options) {
184
141
  }
185
142
  if (options.limits.memoryMaxBytes !== undefined) {
186
143
  writeFileSync(join(cgroupPath, "memory.max"), String(options.limits.memoryMaxBytes));
187
- // See CgroupResourceLimits.memoryMaxBytes's own comment: without this,
188
- // a host with swap available reclaims into swap instead of killing,
189
- // and memory.max stops being a real limit. Best-effort -- a host with
190
- // no memory.swap.max file at all (swap accounting compiled out, or no
191
- // swap controller delegated) still gets a real memory.max, just
192
- // without this hardening; not a reason to refuse the whole call.
144
+ // see memoryMaxBytes doc: without this, swap makes memory.max a soft limit.
145
+ // best-effort -- no memory.swap.max file (swap accounting disabled/not
146
+ // delegated) still gets a real memory.max, just without this hardening
193
147
  try {
194
148
  writeFileSync(join(cgroupPath, "memory.swap.max"), "0");
195
149
  }
196
150
  catch {
197
- // Disclosed above, not silently pretended to have succeeded.
151
+ // disclosed above, not pretended to have succeeded
198
152
  }
199
153
  }
200
154
  if (options.limits.maxProcesses !== undefined) {
@@ -203,7 +157,7 @@ export function moveProcessIntoRestrictedCgroup(options) {
203
157
  if (options.limits.cpuMax !== undefined) {
204
158
  writeFileSync(join(cgroupPath, "cpu.max"), options.limits.cpuMax);
205
159
  }
206
- // Moved last, only once every requested limit is confirmed written.
160
+ // moved last, only once every requested limit is confirmed written
207
161
  writeFileSync(join(cgroupPath, "cgroup.procs"), String(options.pid));
208
162
  }
209
163
  catch (error) {
@@ -211,9 +165,8 @@ export function moveProcessIntoRestrictedCgroup(options) {
211
165
  rmdirSync(cgroupPath);
212
166
  }
213
167
  catch {
214
- // Best-effort -- if the pid was already moved in before the failure,
215
- // the directory is non-empty and cannot be removed; nothing more this
216
- // catch can honestly do about that.
168
+ // best-effort: if the pid was already moved in, the dir is non-empty
169
+ // and can't be removed
217
170
  }
218
171
  throw new Error(`moveProcessIntoRestrictedCgroup: failed to apply limits or move pid ${String(options.pid)} into ${cgroupPath}: ${error instanceof Error ? error.message : String(error)}`);
219
172
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cgroup-partial-restriction.js","sourceRoot":"","sources":["../src/cgroup-partial-restriction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,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ACxB,CAAC;QAAC,MAAM,CAAC;YACP,qEAAqE;YACrE,uBAAuB;QACzB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,uEAAuE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,UAAU,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC3K,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU;QACV,KAAK,EAAE,gCAAgC;QACvC,aAAa,EAAE,OAAO,CAAC,MAAM;QAC7B,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC;gBACH,SAAS,CAAC,UAAU,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,12 +1,7 @@
1
1
  /**
2
- * `Evidence.collectorVersion`'s source for evidence the orchestrator itself
3
- * emits directly (e.g. `COLLECTOR_ERROR` for a collector that never got
4
- * past `start()`, so no collector-owned code ever ran to attribute the row
5
- * to): this package's own `package.json` "version", read from the artifact
6
- * itself rather than hand-duplicated into a second string that can drift
7
- * from what actually shipped. Same idea as `nodeVersion` elsewhere in this
8
- * repo (`process.version`, always known, never probed) applied to a
9
- * package instead of the Node runtime.
2
+ * `Evidence.collectorVersion` for orchestrator-emitted evidence (e.g. `COLLECTOR_ERROR`
3
+ * before any collector ran). Reads `package.json` directly so it can't drift from
4
+ * what shipped, same approach as `nodeVersion`'s use of `process.version`.
10
5
  */
11
6
  export declare const COLLECTOR_VERSION: string;
12
7
  //# sourceMappingURL=collector-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,eAAO,MAAM,iBAAiB,EAAE,MAA6E,CAAC"}
1
+ {"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,iBAAiB,EAAE,MAA6E,CAAC"}
@@ -1,12 +1,7 @@
1
1
  /**
2
- * `Evidence.collectorVersion`'s source for evidence the orchestrator itself
3
- * emits directly (e.g. `COLLECTOR_ERROR` for a collector that never got
4
- * past `start()`, so no collector-owned code ever ran to attribute the row
5
- * to): this package's own `package.json` "version", read from the artifact
6
- * itself rather than hand-duplicated into a second string that can drift
7
- * from what actually shipped. Same idea as `nodeVersion` elsewhere in this
8
- * repo (`process.version`, always known, never probed) applied to a
9
- * package instead of the Node runtime.
2
+ * `Evidence.collectorVersion` for orchestrator-emitted evidence (e.g. `COLLECTOR_ERROR`
3
+ * before any collector ran). Reads `package.json` directly so it can't drift from
4
+ * what shipped, same approach as `nodeVersion`'s use of `process.version`.
10
5
  */
11
6
  import { createRequire } from "node:module";
12
7
  const require = createRequire(import.meta.url);
@@ -1 +1 @@
1
- {"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAkC,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAkC,CAAC,OAAO,CAAC"}
@@ -1,30 +1,14 @@
1
1
  /**
2
- * **The assembly nothing else performed.**
2
+ * The assembly wiring the runtime's pieces together in production code (previously
3
+ * only connected ad hoc by tests). Runs an `ExecutionController` over a `services`
4
+ * configuration; wraps each spawned process in a live `ProcessOutputSource`
5
+ * (polls the buffer, yields each line once); builds a `CollectorContext` with a
6
+ * real `resolveSourceRoot` closed over the execution's own processes; starts,
7
+ * drains and stops the adapter's collectors; writes every emitted item through
8
+ * `EvidenceStore` so redaction runs (plan §28).
3
9
  *
4
- * Every piece of the runtime existed and none of them were wired together
5
- * in production code: the controller spawned services, `RuntimeAdapter`
6
- * could build collectors, `resolveServiceRootForOrigin` could map an origin
7
- * to a source root, and `EvidenceStore` could persist. Only tests ever
8
- * connected them, each in its own way, which meant the thing the product
9
- * actually does had no single implementation to be right or wrong.
10
- *
11
- * This module is that implementation. It:
12
- *
13
- * 1. runs an `ExecutionController` over a `services` configuration;
14
- * 2. wraps each spawned process in a **live** `ProcessOutputSource` that
15
- * polls the accumulated buffer and yields each line exactly once;
16
- * 3. builds a `CollectorContext` carrying a real `resolveSourceRoot`,
17
- * closed over the execution's own processes — the channel RT-033 added
18
- * and RT-029 built the lookup for, which until now nothing populated;
19
- * 4. starts the adapter's collectors, drains them, stops them;
20
- * 5. writes every emitted item through `EvidenceStore`, so redaction runs
21
- * rather than being assumed (plan §28).
22
- *
23
- * **What it deliberately does not do.** It does not decide whether a
24
- * finding exists, does not correlate to graph nodes, and does not drive a
25
- * browser. Those are separate stages with separate contracts, and folding
26
- * them in here would make the one place that assembles the runtime also the
27
- * place that judges it.
10
+ * Deliberately does not decide whether a finding exists, correlate to graph
11
+ * nodes, or drive a browser separate stages, separate contracts.
28
12
  */
29
13
  import type { Evidence, Execution, ExecutionConfiguration, ProcessHandle, ServiceRootLookup } from "@descryy/runtime-contracts";
30
14
  import type { RuntimeAdapter, OutboundHttpLaunch } from "@descryy/runtime-backend-observation";
@@ -46,38 +30,23 @@ export interface InstrumentedExecutionInput {
46
30
  */
47
31
  readonly observeForMs: number;
48
32
  /**
49
- * **Opt-in, per service name** (a key into `execution.configuration.services`):
50
- * front that service with `InboundProxy` (RT-192, DEC-271) onceand
51
- * only once its OWN readiness has already succeeded. This module never
52
- * re-asks the question; it reads the answer `controller.run()` already
53
- * produced (`ExecutionController.serviceStartResults`), the same
54
- * "readiness confirmed on the app's real port FIRST, proxy started AFTER"
55
- * sequencing `cross-service-trace.test.ts` performs by hand.
33
+ * Opt-in, per service name: front that service with `InboundProxy` (RT-192,
34
+ * DEC-271) once its own readiness has already succeededreads the answer
35
+ * `controller.run()` already produced (`serviceStartResults`), never re-asks.
36
+ * Absent or unnamed service: unchanged behaviour, no proxy.
56
37
  *
57
- * Absent, or a service not named here, is today's behaviour, unchanged:
58
- * no proxy, traffic observed only through whatever collectors `adapter`
59
- * itself supplies.
60
- *
61
- * **This does not close any per-language "HTTP observation" checklist
62
- * row.** Every one of those rows uses a self-initiated fixture — the app
63
- * calls itself via the exact `PORT` it bound — which has no separate
64
- * public port for a proxy to sit in front of. This flag makes
65
- * `InboundProxy` available for a *future externally-driven* scenario
66
- * (the shape RT-196/`cross-service-trace.test.ts` already proved by
67
- * hand); it does not retroactively make any current fixture
68
- * externally-driven.
38
+ * Does not close any per-language "HTTP observation" checklist row those use
39
+ * self-initiated fixtures with no separate public port for a proxy to front.
40
+ * This only makes `InboundProxy` available for a future externally-driven
41
+ * scenario.
69
42
  */
70
43
  readonly frontWithInboundProxy?: Readonly<Record<string, boolean>>;
71
44
  /**
72
- * Fires once every collector for this run including any `InboundProxy`
73
- * `frontWithInboundProxy` started has started, and before the
74
- * observation window's sleep begins. Exists so a caller (chiefly a test)
75
- * can drive real traffic through a just-started proxy while it and the
76
- * service it fronts are still alive; `InstrumentedExecutionResult` itself
77
- * is only returned after the whole run has already stopped every
78
- * process, which is too late for that. A throwing callback is not caught
79
- * here, matching `RunOptions.onProcessLifecycleEvent`'s own "must not
80
- * hang, may not silently swallow its own failure" rule.
45
+ * Fires once every collector (including any fronting proxy) has started, before
46
+ * the observation window's sleep. Lets a caller drive real traffic through a
47
+ * just-started proxy while it's still alive `InstrumentedExecutionResult` is
48
+ * only returned after the run has stopped everything, too late for that. A
49
+ * throwing callback is not caught here.
81
50
  */
82
51
  readonly onReady?: (info: {
83
52
  readonly execution: Execution;
@@ -98,19 +67,11 @@ export interface InstrumentedExecutionResult {
98
67
  /**
99
68
  * What the declared whole-execution budget actually did to this run.
100
69
  *
101
- * `ExecutionConfiguration.timeoutMs` is published to callers as the
102
- * whole-execution budget, and before this it bounded only how long a
103
- * *service* was allowed to live: `ExecutionController` armed a timer that
104
- * killed the processes, and this function then slept the full
105
- * `observeForMs` anyway, drained collectors and returned. Measured, not
106
- * theoretical — a 1500ms budget with a 12000ms window returned after
107
- * 12288ms with zero evidence, because the services had been dead for the
108
- * last 10.8s of a window nothing shortened.
109
- *
110
- * Reported as a struct rather than left implicit in the elapsed time so a
111
- * caller can say *which* of the two it got: a full window that found
112
- * nothing, or a window cut short before it could. Those are the same two
113
- * claims the five report categories exist to keep apart, one layer down.
70
+ * `timeoutMs` used to bound only the service, not the observation window: a
71
+ * 1500ms budget with a 12000ms window measurably returned after 12288ms with
72
+ * zero evidence, since services had been dead for the last 10.8s. Reported as a
73
+ * struct so a caller can tell a full window that found nothing from one cut
74
+ * short before it could.
114
75
  */
115
76
  readonly budget: ExecutionBudgetOutcome;
116
77
  }
@@ -129,13 +90,9 @@ export interface ExecutionBudgetOutcome {
129
90
  }
130
91
  /**
131
92
  * Builds the origin → source-root lookup a collector reads through
132
- * `CollectorContext.resolveSourceRoot`.
133
- *
134
- * This is the piece that had been missing at both ends: RT-029 wrote the
135
- * lookup and nothing called it; RT-033 added the channel and nothing filled
136
- * it. It closes over the execution's *own* processes, which is what makes
137
- * the port→service join possible at all — under ephemeral ports the
138
- * configuration cannot know the port, so only the running process can say.
93
+ * `CollectorContext.resolveSourceRoot`. Closes over the execution's own
94
+ * processes, which is what makes the port→service join possible at all — under
95
+ * ephemeral ports only the running process knows its own port.
139
96
  */
140
97
  export declare function createSourceRootResolver(processes: readonly ProcessHandle[], configuration: ExecutionConfiguration): (origin: string) => ServiceRootLookup;
141
98
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"instrumented-execution.d.ts","sourceRoot":"","sources":["../src/instrumented-execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,EAEV,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAuB,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAGpH,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAGhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKhE,MAAM,WAAW,0BAA0B;IACzC,oIAAoI;IACpI,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,qIAAqI;IACrI,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnE;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;QAC9B,mHAAmH;QACnH,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,M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