@descryy/runtime-adapter-rust 0.0.0 → 0.1.1

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 ADDED
@@ -0,0 +1,6 @@
1
+ Copyright (c) Descry
2
+
3
+ All rights reserved. This software is proprietary and confidential.
4
+ No license, express or implied, to reproduce, distribute, modify, or
5
+ create derivative works is granted except as explicitly agreed in
6
+ writing.
@@ -1,43 +1,24 @@
1
1
  /**
2
- * Rust panic and backtrace line shapes.
2
+ * Rust panic and backtrace line shapes. Verified against a real toolchain
3
+ * (rustc 1.91.1) by compiling and running a fixture.
3
4
  *
4
- * **Verified against a real toolchain** (`rustc 1.91.1`), by compiling and
5
- * running a fixture rather than transcribing the format:
5
+ * Unlike other runtimes here, the panic header itself carries a source
6
+ * location (line and column) — `panicked at thrower.rs:3:13`. Since
7
+ * `RUST_BACKTRACE` is off by default, that header is the only location in
8
+ * ordinary production output, so a parser requiring a backtrace would
9
+ * return nothing for the common case.
6
10
  *
7
- * ```
8
- * thread 'main' (468745) panicked at thrower.rs:3:13:
9
- * invoice 3 is corrupt
10
- * stack backtrace:
11
- * 0: __rustc::rust_begin_unwind
12
- * at /rustc/ed61e7d.../library/std/src/panicking.rs:698:5
13
- * 5: thrower::delete_invoice
14
- * at ./thrower.rs:3:13
15
- * 7: thrower::main
16
- * at ./thrower.rs:11:20
17
- * ```
11
+ * Two header shapes: the modern one (verified) and the pre-1.65 form with
12
+ * the message inside the header — `thread 'main' panicked at 'invoice 3
13
+ * is corrupt', src/main.rs:3:13` — handled from its documented shape (not
14
+ * verified here) since it's still common in deployed toolchains.
18
15
  *
19
- * Rust is unlike every other runtime here in one important way: **the panic
20
- * header itself carries a source location** — `panicked at thrower.rs:3:13`
21
- * — with a line *and a column*. That matters because `RUST_BACKTRACE` is
22
- * **off by default**, so in ordinary production output the header is the
23
- * only location there is. A parser that required a backtrace would return
24
- * nothing for the common case while the precise answer sat in line one.
25
- *
26
- * Two header shapes exist and both are supported. The modern one above was
27
- * verified here. The pre-1.65 form put the message inside the header —
28
- * `thread 'main' panicked at 'invoice 3 is corrupt', src/main.rs:3:13` —
29
- * and is supported from its documented shape, **not** verified on this
30
- * machine; it is still common in deployed toolchains, which is why it is
31
- * handled rather than refused.
32
- *
33
- * Frames are two lines: ` N: symbol`, then a deeply-indented
34
- * `at path:line:col`. The `at` line is **optional** — a build without debug
35
- * info prints the symbol alone, which is what separates
36
- * `debug-info-present` from `debug-info-stripped` here.
16
+ * Frames are two lines: ` N: symbol`, then an indented `at path:line:col`.
17
+ * The `at` line is optional — no debug info means the symbol alone, which
18
+ * separates `debug-info-present` from `debug-info-stripped`.
37
19
  */
38
20
  export interface RawRustFrame {
39
21
  readonly functionName: string;
40
- /** Null when the frame printed no `at` line — a build with no debug info. Never fabricated. */
41
22
  readonly file: string | null;
42
23
  readonly line: number | null;
43
24
  readonly column: number | null;
@@ -64,16 +45,11 @@ export declare function parseRustFrameLocation(line: string): {
64
45
  column: number;
65
46
  } | null;
66
47
  /**
67
- * A stateful `LineClassifier`, for RT-035's reason.
68
- *
69
- * Rust's specific hazard is ` 0: something` — a numbered list item is an
70
- * ordinary thing to print, and a stateless rule accepting it would turn any
71
- * enumerated log output into a stack-trace block. A numbered symbol line
72
- * therefore only counts as block content **after `stack backtrace:`**.
73
- *
74
- * The panic message line, which follows the header and is arbitrary text,
75
- * is accepted as block content only in the single position where Rust puts
76
- * it: immediately after a modern header.
48
+ * Stateful line classifier (RT-035). ` 0: something` looks like an
49
+ * ordinary numbered list item, so a symbol line only counts as block
50
+ * content after `stack backtrace:`. The panic message line (arbitrary
51
+ * text) is accepted only in the one position Rust puts it: right after a
52
+ * modern header.
77
53
  */
78
54
  export declare function createRustLineClassifier(): {
79
55
  isHeader(line: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"rust-frame-parsing.d.ts","sourceRoot":"","sources":["../src/rust-frame-parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQ1G;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC,CA8BA"}
@@ -1,39 +1,21 @@
1
1
  /**
2
- * Rust panic and backtrace line shapes.
2
+ * Rust panic and backtrace line shapes. Verified against a real toolchain
3
+ * (rustc 1.91.1) by compiling and running a fixture.
3
4
  *
4
- * **Verified against a real toolchain** (`rustc 1.91.1`), by compiling and
5
- * running a fixture rather than transcribing the format:
5
+ * Unlike other runtimes here, the panic header itself carries a source
6
+ * location (line and column) — `panicked at thrower.rs:3:13`. Since
7
+ * `RUST_BACKTRACE` is off by default, that header is the only location in
8
+ * ordinary production output, so a parser requiring a backtrace would
9
+ * return nothing for the common case.
6
10
  *
7
- * ```
8
- * thread 'main' (468745) panicked at thrower.rs:3:13:
9
- * invoice 3 is corrupt
10
- * stack backtrace:
11
- * 0: __rustc::rust_begin_unwind
12
- * at /rustc/ed61e7d.../library/std/src/panicking.rs:698:5
13
- * 5: thrower::delete_invoice
14
- * at ./thrower.rs:3:13
15
- * 7: thrower::main
16
- * at ./thrower.rs:11:20
17
- * ```
11
+ * Two header shapes: the modern one (verified) and the pre-1.65 form with
12
+ * the message inside the header — `thread 'main' panicked at 'invoice 3
13
+ * is corrupt', src/main.rs:3:13` — handled from its documented shape (not
14
+ * verified here) since it's still common in deployed toolchains.
18
15
  *
19
- * Rust is unlike every other runtime here in one important way: **the panic
20
- * header itself carries a source location** — `panicked at thrower.rs:3:13`
21
- * — with a line *and a column*. That matters because `RUST_BACKTRACE` is
22
- * **off by default**, so in ordinary production output the header is the
23
- * only location there is. A parser that required a backtrace would return
24
- * nothing for the common case while the precise answer sat in line one.
25
- *
26
- * Two header shapes exist and both are supported. The modern one above was
27
- * verified here. The pre-1.65 form put the message inside the header —
28
- * `thread 'main' panicked at 'invoice 3 is corrupt', src/main.rs:3:13` —
29
- * and is supported from its documented shape, **not** verified on this
30
- * machine; it is still common in deployed toolchains, which is why it is
31
- * handled rather than refused.
32
- *
33
- * Frames are two lines: ` N: symbol`, then a deeply-indented
34
- * `at path:line:col`. The `at` line is **optional** — a build without debug
35
- * info prints the symbol alone, which is what separates
36
- * `debug-info-present` from `debug-info-stripped` here.
16
+ * Frames are two lines: ` N: symbol`, then an indented `at path:line:col`.
17
+ * The `at` line is optional — no debug info means the symbol alone, which
18
+ * separates `debug-info-present` from `debug-info-stripped`.
37
19
  */
38
20
  /** Modern (verified): `thread 'main' (468745) panicked at thrower.rs:3:13:` — the thread id in parens is optional. */
39
21
  const HEADER_MODERN = /^thread '(?<thread>[^']*)'(?:\s+\(\d+\))?\s+panicked at (?<file>.+?):(?<line>\d+):(?<col>\d+):\s*$/;
@@ -100,16 +82,11 @@ export function parseRustFrameLocation(line) {
100
82
  };
101
83
  }
102
84
  /**
103
- * A stateful `LineClassifier`, for RT-035's reason.
104
- *
105
- * Rust's specific hazard is ` 0: something` — a numbered list item is an
106
- * ordinary thing to print, and a stateless rule accepting it would turn any
107
- * enumerated log output into a stack-trace block. A numbered symbol line
108
- * therefore only counts as block content **after `stack backtrace:`**.
109
- *
110
- * The panic message line, which follows the header and is arbitrary text,
111
- * is accepted as block content only in the single position where Rust puts
112
- * it: immediately after a modern header.
85
+ * Stateful line classifier (RT-035). ` 0: something` looks like an
86
+ * ordinary numbered list item, so a symbol line only counts as block
87
+ * content after `stack backtrace:`. The panic message line (arbitrary
88
+ * text) is accepted only in the one position Rust puts it: right after a
89
+ * modern header.
113
90
  */
114
91
  export function createRustLineClassifier() {
115
92
  let justSawHeader = false;
@@ -125,8 +102,7 @@ export function createRustLineClassifier() {
125
102
  },
126
103
  isFrame(line) {
127
104
  if (justSawHeader) {
128
- // The message line, or — for a legacy header, which carries its own
129
- // message — whatever comes next. Either way exactly one line.
105
+ // message line (or, for legacy headers, whatever comes next) — exactly one line
130
106
  justSawHeader = false;
131
107
  return true;
132
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rust-frame-parsing.js","sourceRoot":"","sources":["../src/rust-frame-parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAUH,sHAAsH;AACtH,MAAM,aAAa,GAAG,oGAAoG,CAAC;AAC3H,sGAAsG;AACtG,MAAM,aAAa,GAAG,wGAAwG,CAAC;AAE/H,MAAM,eAAe,GAAG,0BAA0B,CAAC;AACnD,qFAAqF;AACrF,MAAM,YAAY,GAAG,2CAA2C,CAAC;AACjE,yEAAyE;AACzE,MAAM,cAAc,GAAG,oDAAoD,CAAC;AAC5E,oFAAoF;AACpF,MAAM,IAAI,GAAG,UAAU,CAAC;AAWxB,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;YACrC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;YACjC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACnC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC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CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KACpC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB;IAItC,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,OAAO;QACL,QAAQ,CAAC,IAAY;YACnB,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,aAAa,GAAG,IAAI,CAAC;gBACrB,WAAW,GAAG,KAAK,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,CAAC,IAAY;YAClB,IAAI,aAAa,EAAE,CAAC;gBAClB,gFAAgF;gBAChF,aAAa,GAAG,KAAK,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,WAAW,GAAG,IAAI,CAAC;gBACnB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,cAAc,CAAC,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC;YACtC,IAAI,WAAW,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC/F,WAAW,GAAG,KAAK,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,22 +1,17 @@
1
1
  /**
2
- * The concrete `RuntimeAdapter` for Rust.
2
+ * Concrete `RuntimeAdapter` for Rust.
3
3
  *
4
- * **Reliability is decided per frame, from whether the frame printed an
5
- * `at` line at all.** A Rust backtrace in a debug build prints
6
- * `symbol` followed by `at path:line:col`; a build without debug info
7
- * prints the symbol alone. That is the same binary distinction the JVM
8
- * makes between a class with and without a `LineNumberTable`, so it takes
9
- * the same two values: `debug-info-present` when a location came back,
10
- * `debug-info-stripped` when the symbol is all there is.
4
+ * Reliability is per-frame, from whether the frame printed an `at` line: a
5
+ * debug build prints `symbol` then `at path:line:col`, a build with no
6
+ * debug info prints the symbol alone — same distinction the JVM makes for
7
+ * a class with/without a `LineNumberTable`, so it takes the same two
8
+ * values: `debug-info-present` / `debug-info-stripped`.
11
9
  *
12
- * **Not handled, and named rather than left to be discovered:**
13
- * `-C split-debuginfo=packed` puts DWARF in a separate `.dwp` file, which
14
- * *is* a side artifact and would deserve the `side-artifact-*` values. The
15
- * default on Linux embeds it, that is what was verified here, and inferring
16
- * which mode a binary was built in from its text output is not possible —
17
- * so a split-debuginfo build is currently classified as though it were
18
- * embedded. It reports `debug-info-stripped` for frames whose location is
19
- * missing, which is true but understates why.
10
+ * Not handled: `-C split-debuginfo=packed` puts DWARF in a separate `.dwp`
11
+ * file (a real side artifact, deserving `side-artifact-*`). The default on
12
+ * Linux embeds it (verified here), and a split-debuginfo build can't be
13
+ * distinguished from text output alone, so it's misclassified as
14
+ * `debug-info-stripped` — true but understates why.
20
15
  */
21
16
  import type { RuntimeAdapter } from "@descryy/runtime-backend-observation";
22
17
  import type { SourceLocationResolver } from "@descryy/runtime-backend-observation";
@@ -1 +1 @@
1
- {"version":3,"file":"rust-runtime-adapter.d.ts","sourceRoot":"","sources":["../src/rust-runtime-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,sCAAsC,CAAC;AAGhG,OAAO,KAAK,EAAoB,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAKrG,wBAAgB,gCAAgC,IAAI,sBAAsB,CAezE;AAED,MAAM,WAAW,yBAAyB;IACxC,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,yBAA8B,GAAG,cAAc,CAgBhG"}
1
+ {"version":3,"file":"rust-runtime-adapter.d.ts","sourceRoot":"","sources":["../src/rust-runtime-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,sCAAsC,CAAC;AAGhG,OAAO,KAAK,EAAoB,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAKrG,wBAAgB,gCAAgC,IAAI,sBAAsB,CAazE;AAED,MAAM,WAAW,yBAAyB;IACxC,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,yBAA8B,GAAG,cAAc,CAgBhG"}
@@ -1,22 +1,17 @@
1
1
  /**
2
- * The concrete `RuntimeAdapter` for Rust.
2
+ * Concrete `RuntimeAdapter` for Rust.
3
3
  *
4
- * **Reliability is decided per frame, from whether the frame printed an
5
- * `at` line at all.** A Rust backtrace in a debug build prints
6
- * `symbol` followed by `at path:line:col`; a build without debug info
7
- * prints the symbol alone. That is the same binary distinction the JVM
8
- * makes between a class with and without a `LineNumberTable`, so it takes
9
- * the same two values: `debug-info-present` when a location came back,
10
- * `debug-info-stripped` when the symbol is all there is.
4
+ * Reliability is per-frame, from whether the frame printed an `at` line: a
5
+ * debug build prints `symbol` then `at path:line:col`, a build with no
6
+ * debug info prints the symbol alone — same distinction the JVM makes for
7
+ * a class with/without a `LineNumberTable`, so it takes the same two
8
+ * values: `debug-info-present` / `debug-info-stripped`.
11
9
  *
12
- * **Not handled, and named rather than left to be discovered:**
13
- * `-C split-debuginfo=packed` puts DWARF in a separate `.dwp` file, which
14
- * *is* a side artifact and would deserve the `side-artifact-*` values. The
15
- * default on Linux embeds it, that is what was verified here, and inferring
16
- * which mode a binary was built in from its text output is not possible —
17
- * so a split-debuginfo build is currently classified as though it were
18
- * embedded. It reports `debug-info-stripped` for frames whose location is
19
- * missing, which is true but understates why.
10
+ * Not handled: `-C split-debuginfo=packed` puts DWARF in a separate `.dwp`
11
+ * file (a real side artifact, deserving `side-artifact-*`). The default on
12
+ * Linux embeds it (verified here), and a split-debuginfo build can't be
13
+ * distinguished from text output alone, so it's misclassified as
14
+ * `debug-info-stripped` — true but understates why.
20
15
  */
21
16
  import { createLogCollector } from "@descryy/runtime-backend-observation";
22
17
  import { createRustLineClassifier } from "./rust-frame-parsing.js";
@@ -27,9 +22,7 @@ export function createRustSourceLocationResolver() {
27
22
  return Promise.resolve({
28
23
  file: frame.file,
29
24
  line: frame.line,
30
- // Rust is the only runtime here besides V8 that prints a real
31
- // column, and it prints one in the panic header too.
32
- column: frame.column,
25
+ column: frame.column, // Rust is the only runtime here besides V8 that prints a real column
33
26
  functionName: frame.functionName,
34
27
  reliability: frame.line === null ? "debug-info-stripped" : "debug-info-present",
35
28
  resolvedVia: null,
@@ -1 +1 @@
1
- {"version":3,"file":"rust-runtime-adapter.js","sourceRoot":"","sources":["../src/rust-runtime-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,OAAO,CAAC,KAAuB;YAC7B,OAAO,OAAO,CAAC,OAAO,CAAC;gBACrB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,8DAA8D;gBAC9D,qDAAqD;gBACrD,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,WAAW,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,oBAAoB;gBAC/E,WAA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KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,oBAAoB;gBAC/E,WAAW,EAAE,IAAI;aAClB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAOD,MAAM,UAAU,wBAAwB,CAAC,UAAqC,EAAE;IAC9E,MAAM,sBAAsB,GAAG,gCAAgC,EAAE,CAAC;IAClE,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;IAE5E,SAAS,uBAAuB,CAAC,OAAuC;QACtE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC5B,kBAAkB,CAAC;YACjB,MAAM;YACN,UAAU,EAAE,wBAAwB,EAAE;YACtC,gBAAgB;YAChB,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvE,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC;AACjG,CAAC"}
@@ -1,77 +1,27 @@
1
1
  /**
2
2
  * Composes Rust's line recognition with a `SourceLocationResolver`.
3
3
  *
4
- * **A panic with no backtrace still yields a location, and that is the
5
- * common case.** `RUST_BACKTRACE` is off by default, so ordinary production
6
- * output is three lines: the header, the message, and a note suggesting you
7
- * turn the backtrace on. The header carries `file:line:column` for the
8
- * panic site itself — more precise than most runtimes manage *with* a
9
- * backtrace. Returning null there would discard the best location Rust ever
10
- * prints, so a header-only panic produces a single-frame trace whose
11
- * `functionName` is null: the position is known, the function is not, and
12
- * neither is invented.
13
- *
14
- * When a backtrace is present, its frames replace that single frame — they
15
- * include the panic site and add the chain above it.
16
- *
17
- * **`std` and `core` frames are kept.** They are real frames and the top of
18
- * every Rust backtrace is several of them (`rust_begin_unwind`,
19
- * `panic_fmt`, `expect_failed`). Filtering them would be a readability
20
- * judgment applied to evidence, and the frame list is not the place for it
21
- * — a consumer that wants only application frames can filter on the paths,
22
- * which are preserved exactly.
23
- *
24
- * **But the frames above the panic site are rooted out, and Rust itself
25
- * says where that is.** Measured on a live threaded server (RT-121):
26
- *
27
- * ```
28
- * thread '<unnamed>' (531538) panicked at server.rs:10:31:
29
- * invoice has no customer
30
- * stack backtrace:
31
- * 0: __rustc::rust_begin_unwind
32
- * …
33
- * 4: core::option::Option<T>::expect
34
- * 5: server::read_customer_name
35
- * at ./server.rs:10:31 <- the header's own location
36
- * 6: server::delete_invoice
37
- * ```
38
- *
39
- * `frames[0]` becomes `Evidence.sourceLocation` for every language
40
- * (`collector.ts`), so untouched this reports
41
- * `library/std/src/panicking.rs:698` — inside the Rust standard library —
42
- * for every panic.
43
- *
44
- * **And the runtime turns the backtrace on itself.** `RUST_BACKTRACE` is
45
- * off in ordinary Rust, but `withDefaultProcessEnv` sets it to `1` for
46
- * every process the controller spawns — a deliberate, separately-reasoned
47
- * decision (a panic with no backtrace is a collector-absence masquerading
48
- * as application success). So the backtrace shape is not the unusual case
49
- * here; inside Descry it is the *only* case, unless a caller opts out
50
- * explicitly. Which means without this rooting, the more diagnostics the
51
- * platform asks Rust for, the worse the location it reports: the header-only
52
- * path below yields the exact panic site, and the enriched path yields
53
- * `panicking.rs`. That was measured (RT-121), after being predicted
54
- * backwards — this comment first claimed the header-only shape was the
55
- * production default *for the managed path*, which the controller had
56
- * already made false.
57
- *
58
- * This is **not** the std/core filter the paragraph above refuses, and
59
- * since RT-083 it does not even look like one: **every frame stays in
60
- * `frames`** and `primaryFrameIndex` points at the failure site. The
61
- * decision above — *"std and core frames are kept; filtering them would be
62
- * a readability judgment applied to evidence"* — is honoured rather than
63
- * superseded. An earlier version of this parser sliced the list, and the
64
- * contract gaining a field for the distinction is what made that
65
- * unnecessary.
66
- *
67
- * The join is exact, on a position the runtime printed itself: the header's
68
- * `file:line:column`, matched against a frame's own `at` location, column
69
- * included. No name is inspected, no path is classified as "library" or
70
- * "application", and a backtrace with no matching frame leaves the index at
71
- * `0` rather than guessing — which is why `core::option::Option<T>::expect`
72
- * being a `core` frame is irrelevant. It happens to sit above the declared
73
- * panic site; a `core` frame *below* it would be pointed at just the same
74
- * if that is where the header said the panic was.
4
+ * A panic with no backtrace still yields a location — the common case,
5
+ * since `RUST_BACKTRACE` is off by default. The header carries
6
+ * `file:line:column` for the panic site itself, so a header-only panic
7
+ * produces a single-frame trace with `functionName: null` rather than
8
+ * discarding the location. When a backtrace is present, its frames
9
+ * replace that frame.
10
+ *
11
+ * `std`/`core` frames are kept — they're real frames, and the top of every
12
+ * backtrace is several of them. Filtering is a consumer's readability
13
+ * judgment on paths, not something the evidence itself should do.
14
+ *
15
+ * `primaryFrameIndex` is rooted at the panic site by joining the header's
16
+ * `file:line:column` against a frame's own `at` location (column
17
+ * included, measured on a live server, RT-121) — untouched, `frames[0]`
18
+ * would report `library/std/src/panicking.rs:698` for every panic, since
19
+ * `withDefaultProcessEnv` sets `RUST_BACKTRACE=1` for every spawned
20
+ * process (a panic with no backtrace is collector-absence masquerading as
21
+ * success), making the enriched backtrace the only case Descry sees. No
22
+ * name is inspected and no path classified as "library"/"application" —
23
+ * a backtrace with no matching frame leaves the index at `0`. Every frame
24
+ * stays in `frames` (RT-083); this roots the index, it doesn't filter.
75
25
  */
76
26
  import type { SourceLocationResolver, StackTraceParser } from "@descryy/runtime-backend-observation";
77
27
  export declare function createRustStackTraceParser(resolver: SourceLocationResolver): StackTraceParser;
@@ -1 +1 @@
1
- {"version":3,"file":"rust-stack-trace-parser.d.ts","sourceRoot":"","sources":["../src/rust-stack-trace-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AA+BrG,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,gBAAgB,CAgF7F"}
1
+ {"version":3,"file":"rust-stack-trace-parser.d.ts","sourceRoot":"","sources":["../src/rust-stack-trace-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAyBrG,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,gBAAgB,CA+D7F"}
@@ -1,91 +1,35 @@
1
1
  /**
2
2
  * Composes Rust's line recognition with a `SourceLocationResolver`.
3
3
  *
4
- * **A panic with no backtrace still yields a location, and that is the
5
- * common case.** `RUST_BACKTRACE` is off by default, so ordinary production
6
- * output is three lines: the header, the message, and a note suggesting you
7
- * turn the backtrace on. The header carries `file:line:column` for the
8
- * panic site itself — more precise than most runtimes manage *with* a
9
- * backtrace. Returning null there would discard the best location Rust ever
10
- * prints, so a header-only panic produces a single-frame trace whose
11
- * `functionName` is null: the position is known, the function is not, and
12
- * neither is invented.
4
+ * A panic with no backtrace still yields a location — the common case,
5
+ * since `RUST_BACKTRACE` is off by default. The header carries
6
+ * `file:line:column` for the panic site itself, so a header-only panic
7
+ * produces a single-frame trace with `functionName: null` rather than
8
+ * discarding the location. When a backtrace is present, its frames
9
+ * replace that frame.
13
10
  *
14
- * When a backtrace is present, its frames replace that single frame — they
15
- * include the panic site and add the chain above it.
11
+ * `std`/`core` frames are kept — they're real frames, and the top of every
12
+ * backtrace is several of them. Filtering is a consumer's readability
13
+ * judgment on paths, not something the evidence itself should do.
16
14
  *
17
- * **`std` and `core` frames are kept.** They are real frames and the top of
18
- * every Rust backtrace is several of them (`rust_begin_unwind`,
19
- * `panic_fmt`, `expect_failed`). Filtering them would be a readability
20
- * judgment applied to evidence, and the frame list is not the place for it
21
- * — a consumer that wants only application frames can filter on the paths,
22
- * which are preserved exactly.
23
- *
24
- * **But the frames above the panic site are rooted out, and Rust itself
25
- * says where that is.** Measured on a live threaded server (RT-121):
26
- *
27
- * ```
28
- * thread '<unnamed>' (531538) panicked at server.rs:10:31:
29
- * invoice has no customer
30
- * stack backtrace:
31
- * 0: __rustc::rust_begin_unwind
32
- * …
33
- * 4: core::option::Option<T>::expect
34
- * 5: server::read_customer_name
35
- * at ./server.rs:10:31 <- the header's own location
36
- * 6: server::delete_invoice
37
- * ```
38
- *
39
- * `frames[0]` becomes `Evidence.sourceLocation` for every language
40
- * (`collector.ts`), so untouched this reports
41
- * `library/std/src/panicking.rs:698` — inside the Rust standard library —
42
- * for every panic.
43
- *
44
- * **And the runtime turns the backtrace on itself.** `RUST_BACKTRACE` is
45
- * off in ordinary Rust, but `withDefaultProcessEnv` sets it to `1` for
46
- * every process the controller spawns — a deliberate, separately-reasoned
47
- * decision (a panic with no backtrace is a collector-absence masquerading
48
- * as application success). So the backtrace shape is not the unusual case
49
- * here; inside Descry it is the *only* case, unless a caller opts out
50
- * explicitly. Which means without this rooting, the more diagnostics the
51
- * platform asks Rust for, the worse the location it reports: the header-only
52
- * path below yields the exact panic site, and the enriched path yields
53
- * `panicking.rs`. That was measured (RT-121), after being predicted
54
- * backwards — this comment first claimed the header-only shape was the
55
- * production default *for the managed path*, which the controller had
56
- * already made false.
57
- *
58
- * This is **not** the std/core filter the paragraph above refuses, and
59
- * since RT-083 it does not even look like one: **every frame stays in
60
- * `frames`** and `primaryFrameIndex` points at the failure site. The
61
- * decision above — *"std and core frames are kept; filtering them would be
62
- * a readability judgment applied to evidence"* — is honoured rather than
63
- * superseded. An earlier version of this parser sliced the list, and the
64
- * contract gaining a field for the distinction is what made that
65
- * unnecessary.
66
- *
67
- * The join is exact, on a position the runtime printed itself: the header's
68
- * `file:line:column`, matched against a frame's own `at` location, column
69
- * included. No name is inspected, no path is classified as "library" or
70
- * "application", and a backtrace with no matching frame leaves the index at
71
- * `0` rather than guessing — which is why `core::option::Option<T>::expect`
72
- * being a `core` frame is irrelevant. It happens to sit above the declared
73
- * panic site; a `core` frame *below* it would be pointed at just the same
74
- * if that is where the header said the panic was.
15
+ * `primaryFrameIndex` is rooted at the panic site by joining the header's
16
+ * `file:line:column` against a frame's own `at` location (column
17
+ * included, measured on a live server, RT-121) — untouched, `frames[0]`
18
+ * would report `library/std/src/panicking.rs:698` for every panic, since
19
+ * `withDefaultProcessEnv` sets `RUST_BACKTRACE=1` for every spawned
20
+ * process (a panic with no backtrace is collector-absence masquerading as
21
+ * success), making the enriched backtrace the only case Descry sees. No
22
+ * name is inspected and no path classified as "library"/"application" —
23
+ * a backtrace with no matching frame leaves the index at `0`. Every frame
24
+ * stays in `frames` (RT-083); this roots the index, it doesn't filter.
75
25
  */
76
26
  import { isRustBacktraceStartLine, parseRustFrameLocation, parseRustFrameSymbol, parseRustPanicHeader, } from "./rust-frame-parsing.js";
77
27
  /**
78
- * Whether a backtrace frame's own `at` location is the position the panic
79
- * header declared.
80
- *
81
- * Line and column must match exactly — a column is precise enough that two
82
- * distinct frames sharing one is not a case worth hedging against. The file
83
- * comparison is a suffix test in either direction because the two are
84
- * printed by different code paths and disagree on prefix: the header says
85
- * `server.rs:10:31` where the frame says `at ./server.rs:10:31` (measured),
86
- * and under cargo both are relative to different roots. Requiring string
87
- * equality would silently never match, which is the failure mode that reads
88
- * as "this rule does nothing" while every test still passes.
28
+ * Whether a backtrace frame's `at` location is the position the panic
29
+ * header declared. Line/column must match exactly. File comparison is a
30
+ * suffix test in either direction: the header says `server.rs:10:31`
31
+ * where the frame says `at ./server.rs:10:31` (measured) — different
32
+ * roots under cargo — so exact string equality would silently never match.
89
33
  */
90
34
  function isDeclaredPanicSite(header, location) {
91
35
  if (location === null)
@@ -105,7 +49,7 @@ export function createRustStackTraceParser(resolver) {
105
49
  if (header === null && backtraceStart === -1)
106
50
  return null;
107
51
  const frames = [];
108
- /** Index of the frame at the header's own declared position, or -1 if the backtrace never names it. */
52
+ // index of the frame at the header's declared position, or -1 if the backtrace never names it
109
53
  let declaredPanicSite = -1;
110
54
  if (backtraceStart !== -1) {
111
55
  for (let i = backtraceStart + 1; i < lines.length; i++) {
@@ -115,10 +59,7 @@ export function createRustStackTraceParser(resolver) {
115
59
  const symbol = parseRustFrameSymbol(symbolLine);
116
60
  if (symbol === null)
117
61
  continue;
118
- // The `at` line is optional: a build without debug info prints
119
- // the symbol alone. Looking ahead one line and accepting its
120
- // absence is what makes debug-info-stripped observable rather
121
- // than a fabricated location.
62
+ // `at` line optional (no debug info -> symbol alone); absence here is what makes debug-info-stripped observable
122
63
  const next = lines[i + 1];
123
64
  const location = next === undefined ? null : parseRustFrameLocation(next);
124
65
  const resolved = await resolver.resolve({
@@ -128,9 +69,7 @@ export function createRustStackTraceParser(resolver) {
128
69
  functionName: symbol,
129
70
  });
130
71
  frames.push({ location: resolved, raw: location === null ? symbolLine : `${symbolLine}\n${next}` });
131
- // First match only: a recursive panic site would repeat the
132
- // position further down, and the outermost repetition is not
133
- // where execution was.
72
+ // first match only: a recursive panic site repeats the position further down
134
73
  if (declaredPanicSite === -1 && header !== null && isDeclaredPanicSite(header, location)) {
135
74
  declaredPanicSite = frames.length - 1;
136
75
  }
@@ -141,34 +80,22 @@ export function createRustStackTraceParser(resolver) {
141
80
  if (frames.length === 0) {
142
81
  if (header === null)
143
82
  return null;
144
- // Header-only panic: the position is real, the function is not
145
- // known, and `functionName: null` says so rather than guessing.
83
+ // header-only panic: position real, function unknown
146
84
  const resolved = await resolver.resolve({
147
85
  file: header.file,
148
86
  line: header.line,
149
87
  column: header.column,
150
88
  functionName: null,
151
89
  });
152
- // One frame, and it IS the panic site — the header said so.
90
+ // one frame, and it is the panic site — the header said so
153
91
  return { fidelity: "synchronous", frames: [{ location: resolved, raw: rawText.split(/\r\n|\r|\n/)[0] ?? "" }], primaryFrameIndex: 0 };
154
92
  }
155
- // Points at the position the header declared, when the backtrace
156
- // names it. `declaredPanicSite === -1` means it did not — an inlined
157
- // frame, a `RUST_BACKTRACE=full` layout, a header this parser read
158
- // from a different panic — and the index stays `0`, because the
159
- // alternative is choosing a site on no evidence.
93
+ // points at the header-declared position when the backtrace names it; stays 0 otherwise (no evidence to guess from)
160
94
  const primaryFrameIndex = declaredPanicSite > 0 ? declaredPanicSite : 0;
161
- // Rust prints most-recent-first (index 0 is the innermost frame),
162
- // like V8 and the JVM and unlike CPython — read off the real
163
- // backtrace, where `delete_invoice` precedes `handler` precedes
164
- // `main`. No reversal.
165
- //
166
- // Fidelity is `synchronous`: a Rust backtrace walks the real thread
167
- // stack. An async task's stack genuinely ends at the executor's poll
168
- // rather than at the logical `.await`er, but nothing in the text says
169
- // so — detecting it would need runtime task correlation, and claiming
170
- // fragmentation without evidence is the guess this project refuses.
171
- // A disclosed under-report, consistent with Kotlin's marker rule.
95
+ // most-recent-first, no reversal. fidelity "synchronous": an async
96
+ // task's stack ends at the executor's poll, not the logical .awaiter,
97
+ // but nothing in the text says so -- disclosed under-report (Kotlin's
98
+ // marker rule) rather than a fragmentation guess.
172
99
  return { fidelity: "synchronous", frames, primaryFrameIndex };
173
100
  },
174
101
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rust-stack-trace-parser.js","sourceRoot":"","sources":["../src/rust-stack-trace-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAKH,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,SAAS,mBAAmB,CAAC,MAAuB,EAAE,QAA+D;IACnH,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;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AAC,IAAI;oBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;gBACH,2DAA2D;gBAC3D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;YACxI,CAAC;YAED,oHAAoH;YACpH,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;YAExE,mEAAmE;YACnE,sEAAsE;YACtE,sEAAsE;YACtE,kDAAkD;YAClD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@descryy/runtime-adapter-rust",
3
- "version": "0.0.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Runtime adapter (rust).",
6
6
  "license": "UNLICENSED",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/descryhq-wq/descry-runtime.git",
10
+ "directory": "packages/adapter-rust"
11
+ },
7
12
  "engines": {
8
13
  "node": ">=22.5"
9
14
  },
@@ -24,7 +29,7 @@
24
29
  "build": "tsc -b"
25
30
  },
26
31
  "dependencies": {
27
- "@descryy/runtime-contracts": "*",
28
- "@descryy/runtime-backend-observation": "*"
32
+ "@descryy/runtime-contracts": "0.3.1",
33
+ "@descryy/runtime-backend-observation": "0.3.1"
29
34
  }
30
35
  }