@senpi/runtime 1.1.0-dev.runtime-phase-2.20260612105612 → 1.1.0-dev.runtime-phase-2.20260617180011

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 (75) hide show
  1. package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
  2. package/dist/actions/close-position/close-position.action.js +55 -13
  3. package/dist/actions/close-position/close-position.action.js.map +1 -1
  4. package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
  5. package/dist/actions/open-position/open-position.action.js +66 -15
  6. package/dist/actions/open-position/open-position.action.js.map +1 -1
  7. package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
  8. package/dist/actions/position-tracker/position-tracker.action.js +10 -1
  9. package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
  10. package/dist/actions/tracking-helpers.d.ts +16 -1
  11. package/dist/actions/tracking-helpers.d.ts.map +1 -1
  12. package/dist/actions/tracking-helpers.js +55 -9
  13. package/dist/actions/tracking-helpers.js.map +1 -1
  14. package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
  15. package/dist/dsl/monitor/create-monitor.js +30 -0
  16. package/dist/dsl/monitor/create-monitor.js.map +1 -1
  17. package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
  18. package/dist/dsl/monitor/process-one-position.js +114 -0
  19. package/dist/dsl/monitor/process-one-position.js.map +1 -1
  20. package/dist/recording/emitter.d.ts +7 -1
  21. package/dist/recording/emitter.d.ts.map +1 -1
  22. package/dist/recording/index.d.ts +1 -1
  23. package/dist/recording/index.d.ts.map +1 -1
  24. package/dist/recording/index.js.map +1 -1
  25. package/dist/recording/noop-emitter.d.ts +6 -0
  26. package/dist/recording/noop-emitter.d.ts.map +1 -1
  27. package/dist/recording/noop-emitter.js +6 -0
  28. package/dist/recording/noop-emitter.js.map +1 -1
  29. package/dist/recording/otel/constants.d.ts +45 -3
  30. package/dist/recording/otel/constants.d.ts.map +1 -1
  31. package/dist/recording/otel/constants.js +79 -3
  32. package/dist/recording/otel/constants.js.map +1 -1
  33. package/dist/recording/otel/ids.d.ts +11 -0
  34. package/dist/recording/otel/ids.d.ts.map +1 -1
  35. package/dist/recording/otel/ids.js +26 -1
  36. package/dist/recording/otel/ids.js.map +1 -1
  37. package/dist/recording/otel/index.d.ts +1 -1
  38. package/dist/recording/otel/index.d.ts.map +1 -1
  39. package/dist/recording/otel/index.js +1 -1
  40. package/dist/recording/otel/index.js.map +1 -1
  41. package/dist/recording/otel/mappers.d.ts +60 -2
  42. package/dist/recording/otel/mappers.d.ts.map +1 -1
  43. package/dist/recording/otel/mappers.js +384 -43
  44. package/dist/recording/otel/mappers.js.map +1 -1
  45. package/dist/recording/otel/otel-emitter.d.ts +7 -1
  46. package/dist/recording/otel/otel-emitter.d.ts.map +1 -1
  47. package/dist/recording/otel/otel-emitter.js +26 -2
  48. package/dist/recording/otel/otel-emitter.js.map +1 -1
  49. package/dist/recording/otel/redaction.d.ts +22 -6
  50. package/dist/recording/otel/redaction.d.ts.map +1 -1
  51. package/dist/recording/otel/redaction.js +54 -6
  52. package/dist/recording/otel/redaction.js.map +1 -1
  53. package/dist/recording/records.d.ts +227 -3
  54. package/dist/recording/records.d.ts.map +1 -1
  55. package/dist/recording/wiring/record-builders.d.ts +59 -26
  56. package/dist/recording/wiring/record-builders.d.ts.map +1 -1
  57. package/dist/recording/wiring/record-builders.js +309 -61
  58. package/dist/recording/wiring/record-builders.js.map +1 -1
  59. package/dist/recording/wiring/subscriber.d.ts.map +1 -1
  60. package/dist/recording/wiring/subscriber.js +59 -57
  61. package/dist/recording/wiring/subscriber.js.map +1 -1
  62. package/dist/runtime/load-runtime-config.d.ts.map +1 -1
  63. package/dist/runtime/load-runtime-config.js +2 -3
  64. package/dist/runtime/load-runtime-config.js.map +1 -1
  65. package/dist/runtime/runtime.d.ts.map +1 -1
  66. package/dist/runtime/runtime.js +7 -1
  67. package/dist/runtime/runtime.js.map +1 -1
  68. package/dist/scanners/implementations/momentum.d.ts.map +1 -1
  69. package/dist/scanners/implementations/momentum.js +16 -0
  70. package/dist/scanners/implementations/momentum.js.map +1 -1
  71. package/dist/tracking/position-id-registry.d.ts +9 -0
  72. package/dist/tracking/position-id-registry.d.ts.map +1 -1
  73. package/dist/tracking/position-id-registry.js +10 -4
  74. package/dist/tracking/position-id-registry.js.map +1 -1
  75. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { DslTransitionRecord, PositionLifecycleRecord, RuntimeErrorRecord, RuntimeLifecycleRecord, RuntimeStateRecord, ScannerRunRecord, SignalEvaluatedRecord } from "./records.js";
1
+ import type { DecisionMadeRecord, DslCloseAttemptRecord, DslTickRecord, DslTransitionRecord, OrderEventRecord, PositionLifecycleRecord, RuntimeErrorRecord, RuntimeLifecycleRecord, RuntimeStateRecord, ScannerRunRecord, ScannerSummaryRecord, SignalEvaluatedRecord, SignalOutcomeRecord } from "./records.js";
2
2
  /**
3
3
  * The recording seam the runtime speaks to — one method per record type. Producers pass records;
4
4
  * they never construct transport-specific objects.
@@ -14,8 +14,14 @@ export interface RecordingEmitter {
14
14
  recordSignalEvaluated(record: SignalEvaluatedRecord): void;
15
15
  recordPositionLifecycle(record: PositionLifecycleRecord): void;
16
16
  recordDslTransition(record: DslTransitionRecord): void;
17
+ recordDslTick(record: DslTickRecord): void;
17
18
  recordError(record: RuntimeErrorRecord): void;
18
19
  recordRuntimeLifecycle(record: RuntimeLifecycleRecord): void;
19
20
  recordRuntimeState(record: RuntimeStateRecord): void;
21
+ recordDecisionMade(record: DecisionMadeRecord): void;
22
+ recordSignalOutcome(record: SignalOutcomeRecord): void;
23
+ recordScannerSummary(record: ScannerSummaryRecord): void;
24
+ recordDslCloseAttempt(record: DslCloseAttemptRecord): void;
25
+ recordOrderEvent(record: OrderEventRecord): void;
20
26
  }
21
27
  //# sourceMappingURL=emitter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/recording/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjD,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3D,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC/D,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvD,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC9C,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7D,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACtD"}
1
+ {"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/recording/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjD,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3D,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC/D,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3C,WAAW,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC9C,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7D,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAErD,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACrD,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvD,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACzD,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3D,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAClD"}
@@ -4,7 +4,7 @@
4
4
  * envelope, and the default {@link NoopEmitter}. Nothing here knows about spans, attributes, wire
5
5
  * formats, or transport — those live behind the adapter and transport layers.
6
6
  */
7
- export type { DecisionMode, DslTierSummary, DslTransitionKind, DslTransitionRecord, PositionLifecycleEvent, PositionLifecycleRecord, RecordingRecord, RuntimeErrorRecord, RuntimeLifecyclePhase, RuntimeLifecycleRecord, RuntimeStatePhase, RuntimeStateRecord, ScannerRunOutcome, ScannerRunRecord, SignalDecision, SignalEvaluatedRecord, SignalEvaluation, SignalOutcome, SignalOutcomeResult, SignalSummary, TradeDirection, } from "./records.js";
7
+ export type { DecisionActionIntent, DecisionMadeRecord, DecisionMode, DslCloseAttemptRecord, DslTickRecord, DslTickUnit, DslTierSummary, DslTransitionKind, DslTransitionRecord, OrderEventKind, OrderEventRecord, PositionLifecycleEvent, PositionLifecycleRecord, RecordingRecord, RuntimeErrorRecord, RuntimeLifecyclePhase, RuntimeLifecycleRecord, RuntimeStatePhase, RuntimeStateRecord, ScannerRunOutcome, ScannerRunRecord, ScannerSummaryRecord, SignalDecision, SignalEvaluatedRecord, SignalEvaluation, SignalOutcome, SignalOutcomeDisposition, SignalOutcomeRecord, SignalOutcomeResult, SignalSummary, TradeDirection, } from "./records.js";
8
8
  export type { IdentityEnvelope } from "./identity.js";
9
9
  export type { RecordingEmitter } from "./emitter.js";
10
10
  export { NoopEmitter, noopEmitter } from "./noop-emitter.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recording/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recording/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recording/index.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recording/index.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -8,9 +8,15 @@ export declare class NoopEmitter implements RecordingEmitter {
8
8
  recordSignalEvaluated(): void;
9
9
  recordPositionLifecycle(): void;
10
10
  recordDslTransition(): void;
11
+ recordDslTick(): void;
11
12
  recordError(): void;
12
13
  recordRuntimeLifecycle(): void;
13
14
  recordRuntimeState(): void;
15
+ recordDecisionMade(): void;
16
+ recordSignalOutcome(): void;
17
+ recordScannerSummary(): void;
18
+ recordDslCloseAttempt(): void;
19
+ recordOrderEvent(): void;
14
20
  }
15
21
  /** Shared inert instance — the NoopEmitter is stateless, so one instance suffices. */
16
22
  export declare const noopEmitter: RecordingEmitter;
@@ -1 +1 @@
1
- {"version":3,"file":"noop-emitter.d.ts","sourceRoot":"","sources":["../../src/recording/noop-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;GAGG;AACH,qBAAa,WAAY,YAAW,gBAAgB;IAClD,gBAAgB,IAAI,IAAI;IACxB,qBAAqB,IAAI,IAAI;IAC7B,uBAAuB,IAAI,IAAI;IAC/B,mBAAmB,IAAI,IAAI;IAC3B,WAAW,IAAI,IAAI;IACnB,sBAAsB,IAAI,IAAI;IAC9B,kBAAkB,IAAI,IAAI;CAC3B;AAED,sFAAsF;AACtF,eAAO,MAAM,WAAW,EAAE,gBAAoC,CAAC"}
1
+ {"version":3,"file":"noop-emitter.d.ts","sourceRoot":"","sources":["../../src/recording/noop-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;GAGG;AACH,qBAAa,WAAY,YAAW,gBAAgB;IAClD,gBAAgB,IAAI,IAAI;IACxB,qBAAqB,IAAI,IAAI;IAC7B,uBAAuB,IAAI,IAAI;IAC/B,mBAAmB,IAAI,IAAI;IAC3B,aAAa,IAAI,IAAI;IACrB,WAAW,IAAI,IAAI;IACnB,sBAAsB,IAAI,IAAI;IAC9B,kBAAkB,IAAI,IAAI;IAC1B,kBAAkB,IAAI,IAAI;IAC1B,mBAAmB,IAAI,IAAI;IAC3B,oBAAoB,IAAI,IAAI;IAC5B,qBAAqB,IAAI,IAAI;IAC7B,gBAAgB,IAAI,IAAI;CACzB;AAED,sFAAsF;AACtF,eAAO,MAAM,WAAW,EAAE,gBAAoC,CAAC"}
@@ -7,9 +7,15 @@ export class NoopEmitter {
7
7
  recordSignalEvaluated() { }
8
8
  recordPositionLifecycle() { }
9
9
  recordDslTransition() { }
10
+ recordDslTick() { }
10
11
  recordError() { }
11
12
  recordRuntimeLifecycle() { }
12
13
  recordRuntimeState() { }
14
+ recordDecisionMade() { }
15
+ recordSignalOutcome() { }
16
+ recordScannerSummary() { }
17
+ recordDslCloseAttempt() { }
18
+ recordOrderEvent() { }
13
19
  }
14
20
  /** Shared inert instance — the NoopEmitter is stateless, so one instance suffices. */
15
21
  export const noopEmitter = new NoopEmitter();
@@ -1 +1 @@
1
- {"version":3,"file":"noop-emitter.js","sourceRoot":"","sources":["../../src/recording/noop-emitter.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,WAAW;IACtB,gBAAgB,KAAU,CAAC;IAC3B,qBAAqB,KAAU,CAAC;IAChC,uBAAuB,KAAU,CAAC;IAClC,mBAAmB,KAAU,CAAC;IAC9B,WAAW,KAAU,CAAC;IACtB,sBAAsB,KAAU,CAAC;IACjC,kBAAkB,KAAU,CAAC;CAC9B;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAqB,IAAI,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"noop-emitter.js","sourceRoot":"","sources":["../../src/recording/noop-emitter.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,WAAW;IACtB,gBAAgB,KAAU,CAAC;IAC3B,qBAAqB,KAAU,CAAC;IAChC,uBAAuB,KAAU,CAAC;IAClC,mBAAmB,KAAU,CAAC;IAC9B,aAAa,KAAU,CAAC;IACxB,WAAW,KAAU,CAAC;IACtB,sBAAsB,KAAU,CAAC;IACjC,kBAAkB,KAAU,CAAC;IAC7B,kBAAkB,KAAU,CAAC;IAC7B,mBAAmB,KAAU,CAAC;IAC9B,oBAAoB,KAAU,CAAC;IAC/B,qBAAqB,KAAU,CAAC;IAChC,gBAAgB,KAAU,CAAC;CAC5B;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAqB,IAAI,WAAW,EAAE,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * changing a name or a severity breaks saved queries downstream, so they live in one pinned place.
5
5
  */
6
6
  import type { SpanKind } from "../transport/index.js";
7
- import type { RecordingRecord } from "../records.js";
7
+ import type { RecordingRecord, ScannerRunRecord } from "../records.js";
8
8
  /** One constant pair for this emitter. `ScopeVersion` is injectable on the emitter for the
9
9
  * real package version (Task 4 wiring); this is the default. */
10
10
  export declare const SCOPE_NAME = "senpi.recording";
@@ -15,9 +15,36 @@ export declare const SPAN_NAME: {
15
15
  readonly signalPass: "signal.evaluation_pass";
16
16
  /** One child span per evaluated signal within a pass. */
17
17
  readonly signalEvaluation: "signal.evaluation";
18
+ /** The pass's decision phase (LLM/rule), child of the pass root; carries the `decision.*` attrs. */
19
+ readonly llmDecision: "llm.decision";
20
+ /** Root span of a DSL monitor tick — the third work loop. */
21
+ readonly dslTick: "dsl.tick";
22
+ /** The tick's batched price-fetch window, intra-record child of the tick root. */
23
+ readonly dslPrices: "dsl.prices";
24
+ /** One position's processing window within a tick, child of the tick root. */
25
+ readonly dslPosition: "dsl.position";
26
+ /** A venue `closePosition` call within a position's processing, child of `dsl.position`. */
27
+ readonly dslCloseAttempt: "dsl.close_attempt";
28
+ /** A venue `editPosition` SL-sync call within a position's processing, child of `dsl.position`. */
29
+ readonly dslSlUpdate: "dsl.sl_update";
18
30
  };
19
31
  /** OTEL-idiomatic span event recording an error on a span. */
20
32
  export declare const EXCEPTION_EVENT_NAME = "exception";
33
+ /**
34
+ * The pinned `{domain}.{event}` EventName catalog for the Task 8 self-learning log. The whole
35
+ * catalog is stable up front, so it lives here in one place even though the `order.*` /
36
+ * `scanner.summary` RECORDS and mappers land in later commits (those names are intentionally
37
+ * unreferenced for now — the catalog is the contract, not the implementation order).
38
+ */
39
+ export declare const LOG_EVENT_NAME: {
40
+ readonly decisionMade: "decision.made";
41
+ readonly signalOutcome: "signal.outcome";
42
+ readonly orderPlaced: "order.placed";
43
+ readonly orderFilled: "order.filled";
44
+ readonly orderFailed: "order.failed";
45
+ readonly scannerSummary: "scanner.summary";
46
+ readonly dslCloseAttempt: "dsl.close_attempt";
47
+ };
21
48
  /** OTEL SeverityNumber/SeverityText pairs. */
22
49
  export interface Severity {
23
50
  readonly number: number;
@@ -39,7 +66,8 @@ export declare const SEVERITY: {
39
66
  };
40
67
  /**
41
68
  * Per-record/outcome severity map (deliberately not constant). Errors → ERROR; a self-pause is a
42
- * WARN-worthy operational event; every other discrete event is INFO.
69
+ * WARN-worthy operational event; every other discrete event is INFO — including the skipped
70
+ * scanner run ("didn't run" is normal cadence, not a warning).
43
71
  */
44
72
  export declare function severityFor(record: RecordingRecord): Severity;
45
73
  /**
@@ -48,6 +76,13 @@ export declare function severityFor(record: RecordingRecord): Severity;
48
76
  * `runtime_state.paused` are all directly filterable.
49
77
  */
50
78
  export declare function eventNameFor(record: RecordingRecord): string;
79
+ /**
80
+ * The single authority for the {@link ROUTING} exception: a `scanner_run` with
81
+ * `outcome === "skipped"` (engine statuses skipped/disabled/halted) routes to a log
82
+ * (`scanner_run.skipped`), not a span. Used by both the emitter's dispatch and
83
+ * {@link eventNameFor} so the predicate can never drift between them.
84
+ */
85
+ export declare function isSkippedScannerRun(record: ScannerRunRecord): boolean;
51
86
  export type RecordRoute = {
52
87
  readonly kind: "trace";
53
88
  readonly spanKind: SpanKind;
@@ -55,11 +90,18 @@ export type RecordRoute = {
55
90
  readonly kind: "log";
56
91
  };
57
92
  /**
58
- * Declarative trace-vs-log routing for all 7 record types. Heuristic: durationful *work units* are
93
+ * Declarative trace-vs-log routing for all 8 record types. Heuristic: durationful *work units* are
59
94
  * spans; discrete events and errors are logs. The two point-in-time domain events
60
95
  * (`position_lifecycle`, `runtime_lifecycle`) are logs, not zero-duration spans — they carry no
61
96
  * duration, and logs are the natural home for point-in-time events, which keeps the trace view
62
97
  * exclusively work units. (Severity for log routes comes from {@link severityFor}.)
98
+ *
99
+ * One outcome-conditional exception (the table keys on record *type*): `scanner_run` with
100
+ * `outcome === "skipped"` (engine statuses skipped/disabled/halted) routes to a **log**
101
+ * (`scanner_run.skipped`, INFO) — "didn't run" is a discrete fact, not work, and the builder
102
+ * synthesizes `startedAt = endedAt` for it, so a span would be a zero-duration fabrication.
103
+ * `complete`/`error` runs stay spans. The emitter dispatches the exception
104
+ * (`OtelEmitter.recordScannerRun`); the entry below carries the trace route for the runs that ran.
63
105
  */
64
106
  export declare const ROUTING: {
65
107
  readonly [K in RecordingRecord["type"]]: RecordRoute;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CA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GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW;CAelE,CAAC;AAGX,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,kFAAkF;AAClF,eAAO,MAAM,aAAa,eAAe,CAAC;AAG1C,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,4CAA4C;AAC5C,eAAO,MAAM,eAAe,sBAAiB,CAAC;AAC9C,mGAAmG;AACnG,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,QAAQ,CAAC"}
@@ -15,9 +15,37 @@ export const SPAN_NAME = {
15
15
  signalPass: "signal.evaluation_pass",
16
16
  /** One child span per evaluated signal within a pass. */
17
17
  signalEvaluation: "signal.evaluation",
18
+ /** The pass's decision phase (LLM/rule), child of the pass root; carries the `decision.*` attrs. */
19
+ llmDecision: "llm.decision",
20
+ /** Root span of a DSL monitor tick — the third work loop. */
21
+ dslTick: "dsl.tick",
22
+ /** The tick's batched price-fetch window, intra-record child of the tick root. */
23
+ dslPrices: "dsl.prices",
24
+ /** One position's processing window within a tick, child of the tick root. */
25
+ dslPosition: "dsl.position",
26
+ /** A venue `closePosition` call within a position's processing, child of `dsl.position`. */
27
+ dslCloseAttempt: "dsl.close_attempt",
28
+ /** A venue `editPosition` SL-sync call within a position's processing, child of `dsl.position`. */
29
+ dslSlUpdate: "dsl.sl_update",
18
30
  };
19
31
  /** OTEL-idiomatic span event recording an error on a span. */
20
32
  export const EXCEPTION_EVENT_NAME = "exception";
33
+ // ── Log event names (the self-learning event log, Task 8) ─────────────────────
34
+ /**
35
+ * The pinned `{domain}.{event}` EventName catalog for the Task 8 self-learning log. The whole
36
+ * catalog is stable up front, so it lives here in one place even though the `order.*` /
37
+ * `scanner.summary` RECORDS and mappers land in later commits (those names are intentionally
38
+ * unreferenced for now — the catalog is the contract, not the implementation order).
39
+ */
40
+ export const LOG_EVENT_NAME = {
41
+ decisionMade: "decision.made",
42
+ signalOutcome: "signal.outcome",
43
+ orderPlaced: "order.placed",
44
+ orderFilled: "order.filled",
45
+ orderFailed: "order.failed",
46
+ scannerSummary: "scanner.summary",
47
+ dslCloseAttempt: "dsl.close_attempt",
48
+ };
21
49
  export const SEVERITY = {
22
50
  INFO: { number: 9, text: "INFO" },
23
51
  WARN: { number: 13, text: "WARN" },
@@ -25,7 +53,8 @@ export const SEVERITY = {
25
53
  };
26
54
  /**
27
55
  * Per-record/outcome severity map (deliberately not constant). Errors → ERROR; a self-pause is a
28
- * WARN-worthy operational event; every other discrete event is INFO.
56
+ * WARN-worthy operational event; every other discrete event is INFO — including the skipped
57
+ * scanner run ("didn't run" is normal cadence, not a warning).
29
58
  */
30
59
  export function severityFor(record) {
31
60
  switch (record.type) {
@@ -33,6 +62,12 @@ export function severityFor(record) {
33
62
  return SEVERITY.ERROR;
34
63
  case "runtime_state":
35
64
  return record.phase === "paused" ? SEVERITY.WARN : SEVERITY.INFO;
65
+ case "signal_outcome":
66
+ return record.result === "error" ? SEVERITY.ERROR : SEVERITY.INFO;
67
+ case "dsl_close_attempt":
68
+ return record.result === "error" ? SEVERITY.ERROR : SEVERITY.INFO;
69
+ case "order_event":
70
+ return record.event === "failed" ? SEVERITY.ERROR : SEVERITY.INFO;
36
71
  default:
37
72
  return SEVERITY.INFO;
38
73
  }
@@ -45,6 +80,10 @@ export function severityFor(record) {
45
80
  */
46
81
  export function eventNameFor(record) {
47
82
  switch (record.type) {
83
+ case "scanner_run":
84
+ // Only the skip is log-routed (the {@link ROUTING} exception); `complete`/`error` runs are
85
+ // trace-routed and keep the defensive fallback.
86
+ return isSkippedScannerRun(record) ? "scanner_run.skipped" : record.type;
48
87
  case "position_lifecycle":
49
88
  return `position_lifecycle.${record.event}`;
50
89
  case "dsl_transition":
@@ -55,26 +94,63 @@ export function eventNameFor(record) {
55
94
  return `runtime_state.${record.phase}`;
56
95
  case "runtime_error":
57
96
  return "runtime_error";
97
+ case "decision_made":
98
+ return LOG_EVENT_NAME.decisionMade;
99
+ case "signal_outcome":
100
+ return LOG_EVENT_NAME.signalOutcome;
101
+ case "scanner_summary":
102
+ return LOG_EVENT_NAME.scannerSummary;
103
+ case "dsl_close_attempt":
104
+ return LOG_EVENT_NAME.dslCloseAttempt;
105
+ case "order_event":
106
+ return record.event === "placed"
107
+ ? LOG_EVENT_NAME.orderPlaced
108
+ : record.event === "filled"
109
+ ? LOG_EVENT_NAME.orderFilled
110
+ : LOG_EVENT_NAME.orderFailed;
58
111
  default:
59
112
  // Trace-routed records do not carry an EventName; defensive fallback only.
60
113
  return record.type;
61
114
  }
62
115
  }
63
116
  /**
64
- * Declarative trace-vs-log routing for all 7 record types. Heuristic: durationful *work units* are
117
+ * The single authority for the {@link ROUTING} exception: a `scanner_run` with
118
+ * `outcome === "skipped"` (engine statuses skipped/disabled/halted) routes to a log
119
+ * (`scanner_run.skipped`), not a span. Used by both the emitter's dispatch and
120
+ * {@link eventNameFor} so the predicate can never drift between them.
121
+ */
122
+ export function isSkippedScannerRun(record) {
123
+ return record.outcome === "skipped";
124
+ }
125
+ /**
126
+ * Declarative trace-vs-log routing for all 8 record types. Heuristic: durationful *work units* are
65
127
  * spans; discrete events and errors are logs. The two point-in-time domain events
66
128
  * (`position_lifecycle`, `runtime_lifecycle`) are logs, not zero-duration spans — they carry no
67
129
  * duration, and logs are the natural home for point-in-time events, which keeps the trace view
68
130
  * exclusively work units. (Severity for log routes comes from {@link severityFor}.)
131
+ *
132
+ * One outcome-conditional exception (the table keys on record *type*): `scanner_run` with
133
+ * `outcome === "skipped"` (engine statuses skipped/disabled/halted) routes to a **log**
134
+ * (`scanner_run.skipped`, INFO) — "didn't run" is a discrete fact, not work, and the builder
135
+ * synthesizes `startedAt = endedAt` for it, so a span would be a zero-duration fabrication.
136
+ * `complete`/`error` runs stay spans. The emitter dispatches the exception
137
+ * (`OtelEmitter.recordScannerRun`); the entry below carries the trace route for the runs that ran.
69
138
  */
70
139
  export const ROUTING = {
71
- scanner_run: { kind: "trace", spanKind: "Internal" },
140
+ scanner_run: { kind: "trace", spanKind: "Internal" }, // skipped → log (see exception above)
72
141
  signal_evaluated: { kind: "trace", spanKind: "Internal" },
73
142
  position_lifecycle: { kind: "log" },
74
143
  dsl_transition: { kind: "log" },
144
+ dsl_tick: { kind: "trace", spanKind: "Internal" },
75
145
  runtime_error: { kind: "log" },
76
146
  runtime_lifecycle: { kind: "log" },
77
147
  runtime_state: { kind: "log" },
148
+ // Task 8 self-learning event log — discrete derived events, all logs.
149
+ decision_made: { kind: "log" },
150
+ signal_outcome: { kind: "log" },
151
+ scanner_summary: { kind: "log" },
152
+ dsl_close_attempt: { kind: "log" },
153
+ order_event: { kind: "log" },
78
154
  };
79
155
  // ── Wire defaults ─────────────────────────────────────────────────────────────
80
156
  /** `1` = sampled. `0` reads as "dropped" to OTEL consumers, so always emit `1`. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/recording/otel/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,gFAAgF;AAChF;iEACiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAErC,gFAAgF;AAChF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,aAAa;IACzB,6CAA6C;IAC7C,UAAU,EAAE,wBAAwB;IACpC,yDAAyD;IACzD,gBAAgB,EAAE,mBAAmB;CAC7B,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAQhD,MAAM,CAAC,MAAM,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FAAiF;AACjF,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,kFAAkF;AAClF,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAE1C,gFAAgF;AAChF,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AACzC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAC9C,mGAAmG;AACnG,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,sGAAsG;AACtG,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AACtC,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC"}
@@ -11,4 +11,15 @@ export interface IdGenerator {
11
11
  }
12
12
  /** Production generator: cryptographically-random lowercase-hex ids. */
13
13
  export declare const cryptoIdGenerator: IdGenerator;
14
+ /**
15
+ * Deterministic 32-hex-char TraceId from a seed (e.g. the telemetry-owned scan run id), so
16
+ * records sharing the seed land in one trace with no context propagation — the mapper stays pure
17
+ * and golden tests stay deterministic. Never all-zero.
18
+ */
19
+ export declare function deterministicTraceId(seed: string): string;
20
+ /**
21
+ * Deterministic 16-hex-char SpanId from a seed. Domain-separated (`"span:" + seed`) so it is not
22
+ * a prefix of {@link deterministicTraceId}'s output for the same seed. Never all-zero.
23
+ */
24
+ export declare function deterministicSpanId(seed: string): string;
14
25
  //# sourceMappingURL=ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,OAAO,IAAI,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,IAAI,MAAM,CAAC;CAClB;AAED,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAC"}
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,OAAO,IAAI,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,IAAI,MAAM,CAAC;CAClB;AAED,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAC;AAYF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -3,10 +3,35 @@
3
3
  * them. Injecting the generator keeps the row functions pure *given their deps*, so golden
4
4
  * `record → row` tests pass a deterministic stub. No uuid lib, no `@opentelemetry/*`.
5
5
  */
6
- import { randomBytes } from "node:crypto";
6
+ import { createHash, randomBytes } from "node:crypto";
7
7
  /** Production generator: cryptographically-random lowercase-hex ids. */
8
8
  export const cryptoIdGenerator = {
9
9
  traceId: () => randomBytes(16).toString("hex"),
10
10
  spanId: () => randomBytes(8).toString("hex"),
11
11
  };
12
+ /**
13
+ * Lowercase-hex prefix of `sha256(seed)`. The server treats all-zero ids as invalid, so on the
14
+ * astronomically-rare all-zero hash slice the last byte is set to 0x01.
15
+ */
16
+ function hashId(seed, bytes) {
17
+ const slice = createHash("sha256").update(seed).digest().subarray(0, bytes);
18
+ if (slice.every((b) => b === 0))
19
+ slice[bytes - 1] = 0x01;
20
+ return slice.toString("hex");
21
+ }
22
+ /**
23
+ * Deterministic 32-hex-char TraceId from a seed (e.g. the telemetry-owned scan run id), so
24
+ * records sharing the seed land in one trace with no context propagation — the mapper stays pure
25
+ * and golden tests stay deterministic. Never all-zero.
26
+ */
27
+ export function deterministicTraceId(seed) {
28
+ return hashId(seed, 16);
29
+ }
30
+ /**
31
+ * Deterministic 16-hex-char SpanId from a seed. Domain-separated (`"span:" + seed`) so it is not
32
+ * a prefix of {@link deterministicTraceId}'s output for the same seed. Never all-zero.
33
+ */
34
+ export function deterministicSpanId(seed) {
35
+ return hashId("span:" + seed, 8);
36
+ }
12
37
  //# sourceMappingURL=ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/recording/otel/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC9C,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;CAC7C,CAAC"}
1
+ {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/recording/otel/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAStD,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC9C,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;CAC7C,CAAC;AAEF;;;GAGG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,KAAa;IACzC,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5E,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAAE,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IACzD,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;AACnC,CAAC"}
@@ -8,6 +8,6 @@ export { cryptoIdGenerator } from "./ids.js";
8
8
  export type { IdGenerator } from "./ids.js";
9
9
  export { SCOPE_NAME, SCOPE_VERSION, SPAN_NAME, SEVERITY, ROUTING, severityFor, eventNameFor, } from "./constants.js";
10
10
  export type { Severity, RecordRoute } from "./constants.js";
11
- export { buildResource, mapScannerRun, mapSignalEvaluated, mapPositionLifecycle, mapDslTransition, mapRuntimeError, mapRuntimeLifecycle, mapRuntimeState, } from "./mappers.js";
11
+ export { buildResource, mapScannerRun, mapScannerRunSkipped, mapSignalEvaluated, mapPositionLifecycle, mapDslTransition, mapDslTick, mapRuntimeError, mapRuntimeLifecycle, mapRuntimeState, } from "./mappers.js";
12
12
  export type { MapperDeps, Resource } from "./mappers.js";
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC"}
@@ -5,5 +5,5 @@
5
5
  export { OtelEmitter } from "./otel-emitter.js";
6
6
  export { cryptoIdGenerator } from "./ids.js";
7
7
  export { SCOPE_NAME, SCOPE_VERSION, SPAN_NAME, SEVERITY, ROUTING, severityFor, eventNameFor, } from "./constants.js";
8
- export { buildResource, mapScannerRun, mapSignalEvaluated, mapPositionLifecycle, mapDslTransition, mapRuntimeError, mapRuntimeLifecycle, mapRuntimeState, } from "./mappers.js";
8
+ export { buildResource, mapScannerRun, mapScannerRunSkipped, mapSignalEvaluated, mapPositionLifecycle, mapDslTransition, mapDslTick, mapRuntimeError, mapRuntimeLifecycle, mapRuntimeState, } from "./mappers.js";
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recording/otel/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/recording/otel/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,cAAc,CAAC"}
@@ -6,9 +6,9 @@
6
6
  * Per-record key maps and the trace-vs-log routing are pinned in {@link ./constants} and appended
7
7
  * to the Task 2 brief. Order within a row: redact (typed-field) → flatten → cap.
8
8
  */
9
- import type { DslTransitionRecord, IdentityEnvelope, PositionLifecycleRecord, RuntimeErrorRecord, RuntimeLifecycleRecord, RuntimeStateRecord, ScannerRunRecord, SignalEvaluatedRecord } from "../index.js";
9
+ import type { DecisionMadeRecord, DslCloseAttemptRecord, DslTickRecord, DslTransitionRecord, IdentityEnvelope, OrderEventRecord, PositionLifecycleRecord, RuntimeErrorRecord, RuntimeLifecycleRecord, RuntimeStateRecord, ScannerRunRecord, ScannerSummaryRecord, SignalEvaluatedRecord, SignalOutcomeRecord } from "../index.js";
10
10
  import type { LogRow, TraceRow } from "../transport/index.js";
11
- import type { IdGenerator } from "./ids.js";
11
+ import { type IdGenerator } from "./ids.js";
12
12
  /**
13
13
  * Deps that make the row functions pure: identity envelope, the memoized resource (identity is
14
14
  * immutable for the emitter's lifetime, so it is built once — see {@link buildResource}), the id
@@ -32,10 +32,68 @@ export interface Resource {
32
32
  * edge can never silently empty the ownership/keying field.
33
33
  */
34
34
  export declare function buildResource(identity: IdentityEnvelope): Resource;
35
+ /** A run that actually ran (`complete`/`error`) → one span. Skips go to {@link mapScannerRunSkipped}. */
35
36
  export declare function mapScannerRun(record: ScannerRunRecord, deps: MapperDeps): TraceRow[];
37
+ /**
38
+ * The {@link ROUTING} exception: a skipped run (`outcome === "skipped"` — engine statuses
39
+ * skipped/disabled/halted) is a discrete "didn't run" fact, not work, so it becomes an INFO log
40
+ * (`scanner_run.skipped`) instead of a zero-duration span. Same `scanner.*` attrs as the span
41
+ * (counts are simply absent on skip payloads); `Timestamp` from `endedAt` (the builder synthesizes
42
+ * `startedAt = endedAt` for skips — only the end is observed).
43
+ */
44
+ export declare function mapScannerRunSkipped(record: ScannerRunRecord, deps: MapperDeps): LogRow[];
36
45
  export declare function mapSignalEvaluated(record: SignalEvaluatedRecord, deps: MapperDeps): TraceRow[];
37
46
  export declare function mapPositionLifecycle(record: PositionLifecycleRecord, deps: MapperDeps): LogRow[];
38
47
  export declare function mapDslTransition(record: DslTransitionRecord, deps: MapperDeps): LogRow[];
48
+ /**
49
+ * Maps one DSL-tick work unit to its span. No buffering or pairing: each record maps
50
+ * independently, and the deterministic ids derived from `bootId:tickId` (and
51
+ * `bootId:tickId:positionKey`) thread the units into one trace — root `dsl.tick`, `dsl.position`
52
+ * children, and `dsl.close_attempt`/`dsl.sl_update` under their position. `tick.id` rides every
53
+ * span (the cross-store join key); `position.id` rides the position-grain spans. A child unit
54
+ * missing its `positionKey` (defensive) parents to the tick root so the row still joins the trace.
55
+ */
56
+ export declare function mapDslTick(record: DslTickRecord, deps: MapperDeps): TraceRow[];
57
+ /**
58
+ * The pass's judgment as a discrete log. Attributes are the queryable scalars; the **Body is the
59
+ * LLM reasoning prose, uncapped** (the catalog calls for full reasoning — no per-value cap applied
60
+ * to it) and routed through {@link redactBody}, which passes a flat string through verbatim (a
61
+ * string has no keys to scrub) while still keeping the redaction seam over both Bodies. When
62
+ * reasoning is absent, a short templated Body stands in. Market-context keys are reserved and
63
+ * absent in 8a (see the brief's impl notes).
64
+ */
65
+ export declare function mapDecisionMade(record: DecisionMadeRecord, deps: MapperDeps): LogRow[];
66
+ /**
67
+ * One considered signal's disposition as a discrete log. Attributes are the queryable raw-signal
68
+ * scalars, factors, disposition, and sizing; the **Body is the raw scanner evidence**
69
+ * (`JSON.stringify(redactBody(rawSignal))`) — the variable-shaped payload whose arbitrary scanner
70
+ * `meta` Task 2 dropped from attributes and Task 8 keeps here, scrubbed by key name. Empty Body when
71
+ * there is no rawSignal.
72
+ */
73
+ export declare function mapSignalOutcome(record: SignalOutcomeRecord, deps: MapperDeps): LogRow[];
74
+ /**
75
+ * One scan's funnel roll-up as a discrete log — ONE row, never one per drop. Attributes are the
76
+ * queryable aggregate surface (counts, per-reason counts via `putBag`, the survivors' assets as a
77
+ * single JSON array). The **Body is the dropped-candidate array**
78
+ * (`JSON.stringify(redactBody(droppedCandidates))`) — variable-shaped scanner data, scrubbed by
79
+ * key name, read only after the row is selected. Empty Body when nothing was dropped.
80
+ */
81
+ export declare function mapScannerSummary(record: ScannerSummaryRecord, deps: MapperDeps): LogRow[];
82
+ /**
83
+ * One DSL exit attempt as a discrete log (the second consumer of `tracking.dsl_close_attempt`,
84
+ * alongside the tick trace). No Body — the attempt is fully described by its scalars. No
85
+ * `error_name`: only `String(e)` is available at the producer emit site.
86
+ */
87
+ export declare function mapDslCloseAttempt(record: DslCloseAttemptRecord, deps: MapperDeps): LogRow[];
88
+ /**
89
+ * One order-execution event as a discrete log under the `order.*` namespace — the execution
90
+ * granularity `position_lifecycle` can't carry. Null/undefined attrs are omitted by the builder, so
91
+ * each event subtype naturally carries only its own fields (placed: order/size; filled: fill; failed:
92
+ * reason/error_name). `position.id` is the cross-flow join key (coexists with `outcome.order_id` /
93
+ * `position.order_id`; 8b coalesces). **Body** = the venue raw response on `failed`
94
+ * (`JSON.stringify(redactBody(error))`); `placed`/`filled` carry no Body (short templated message).
95
+ */
96
+ export declare function mapOrderEvent(record: OrderEventRecord, deps: MapperDeps): LogRow[];
39
97
  export declare function mapRuntimeError(record: RuntimeErrorRecord, deps: MapperDeps): LogRow[];
40
98
  export declare function mapRuntimeLifecycle(record: RuntimeLifecycleRecord, deps: MapperDeps): LogRow[];
41
99
  export declare function mapRuntimeState(record: RuntimeStateRecord, deps: MapperDeps): LogRow[];
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../src/recording/otel/mappers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,MAAM,EAIN,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAW/B,OAA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