@senpi/runtime 3.0.135 → 3.0.138
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/dist/actions/action-events.d.ts +7 -21
- package/dist/actions/action-events.d.ts.map +1 -1
- package/dist/actions/action-events.js +26 -54
- package/dist/actions/action-events.js.map +1 -1
- package/dist/actions/action-runtime-module.d.ts.map +1 -1
- package/dist/actions/action-runtime-module.js +7 -38
- package/dist/actions/action-runtime-module.js.map +1 -1
- package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
- package/dist/actions/close-position/close-position.action.js +15 -122
- package/dist/actions/close-position/close-position.action.js.map +1 -1
- package/dist/actions/decision-engine.d.ts.map +1 -1
- package/dist/actions/decision-engine.js +2 -15
- package/dist/actions/decision-engine.js.map +1 -1
- package/dist/actions/event-derivation.d.ts +2 -71
- package/dist/actions/event-derivation.d.ts.map +1 -1
- package/dist/actions/event-derivation.js +8 -251
- package/dist/actions/event-derivation.js.map +1 -1
- package/dist/actions/open-position/open-position.action.d.ts +2 -12
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +41 -141
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.d.ts +1 -2
- package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.js +17 -62
- package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
- package/dist/actions/store/types.d.ts +2 -9
- package/dist/actions/store/types.d.ts.map +1 -1
- package/dist/actions/store/types.js.map +1 -1
- package/dist/actions/types.d.ts +0 -13
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/actions/types.js +0 -13
- package/dist/actions/types.js.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +7 -4
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/constants/dsl/index.d.ts +0 -6
- package/dist/constants/dsl/index.d.ts.map +1 -1
- package/dist/constants/dsl/index.js +0 -6
- package/dist/constants/dsl/index.js.map +1 -1
- package/dist/dsl/engine-client/event-mapping.d.ts.map +1 -1
- package/dist/dsl/engine-client/event-mapping.js +0 -14
- package/dist/dsl/engine-client/event-mapping.js.map +1 -1
- package/dist/dsl/events/build-closed-event.d.ts +1 -16
- package/dist/dsl/events/build-closed-event.d.ts.map +1 -1
- package/dist/dsl/events/build-closed-event.js +0 -6
- package/dist/dsl/events/build-closed-event.js.map +1 -1
- package/dist/dsl/events/handlers.d.ts +0 -7
- package/dist/dsl/events/handlers.d.ts.map +1 -1
- package/dist/dsl/events/handlers.js +7 -37
- package/dist/dsl/events/handlers.js.map +1 -1
- package/dist/dsl/monitor/create-monitor.d.ts +2 -6
- package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
- package/dist/dsl/monitor/create-monitor.js +9 -82
- package/dist/dsl/monitor/create-monitor.js.map +1 -1
- package/dist/dsl/monitor/dsl-failure-events.d.ts +2 -45
- package/dist/dsl/monitor/dsl-failure-events.d.ts.map +1 -1
- package/dist/dsl/monitor/dsl-failure-events.js +3 -52
- package/dist/dsl/monitor/dsl-failure-events.js.map +1 -1
- package/dist/dsl/monitor/process-one-position.d.ts +0 -1
- package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
- package/dist/dsl/monitor/process-one-position.js +36 -159
- package/dist/dsl/monitor/process-one-position.js.map +1 -1
- package/dist/dsl/plugin/index.d.ts +2 -8
- package/dist/dsl/plugin/index.d.ts.map +1 -1
- package/dist/dsl/plugin/index.js +6 -8
- package/dist/dsl/plugin/index.js.map +1 -1
- package/dist/health/types.d.ts +0 -13
- package/dist/health/types.d.ts.map +1 -1
- package/dist/health/types.js +0 -12
- package/dist/health/types.js.map +1 -1
- package/dist/index.d.ts +4 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -271
- package/dist/index.js.map +1 -1
- package/dist/runtime/action-registry.d.ts.map +1 -1
- package/dist/runtime/action-registry.js +3 -4
- package/dist/runtime/action-registry.js.map +1 -1
- package/dist/runtime/domain-events.d.ts.map +1 -1
- package/dist/runtime/domain-events.js +0 -7
- package/dist/runtime/domain-events.js.map +1 -1
- package/dist/runtime/lifecycle-events.d.ts +3 -15
- package/dist/runtime/lifecycle-events.d.ts.map +1 -1
- package/dist/runtime/lifecycle-events.js +3 -17
- package/dist/runtime/lifecycle-events.js.map +1 -1
- package/dist/runtime/lifecycle-reaper.d.ts +6 -4
- package/dist/runtime/lifecycle-reaper.d.ts.map +1 -1
- package/dist/runtime/lifecycle-reaper.js +6 -4
- package/dist/runtime/lifecycle-reaper.js.map +1 -1
- package/dist/runtime/reconcile-run.d.ts +3 -13
- package/dist/runtime/reconcile-run.d.ts.map +1 -1
- package/dist/runtime/reconcile-run.js +3 -4
- package/dist/runtime/reconcile-run.js.map +1 -1
- package/dist/runtime/reconcile-state.d.ts +0 -8
- package/dist/runtime/reconcile-state.d.ts.map +1 -1
- package/dist/runtime/reconcile-state.js +1 -4
- package/dist/runtime/reconcile-state.js.map +1 -1
- package/dist/runtime/risk-guard.d.ts +20 -1
- package/dist/runtime/risk-guard.d.ts.map +1 -1
- package/dist/runtime/risk-guard.js +47 -6
- package/dist/runtime/risk-guard.js.map +1 -1
- package/dist/runtime/run.d.ts +0 -1
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/runtime-schema.js +3 -3
- package/dist/runtime/runtime-schema.js.map +1 -1
- package/dist/runtime/runtime.d.ts +3 -2
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +30 -37
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/strategy-lifecycle.d.ts +108 -2
- package/dist/runtime/strategy-lifecycle.d.ts.map +1 -1
- package/dist/runtime/strategy-lifecycle.js +325 -4
- package/dist/runtime/strategy-lifecycle.js.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.d.ts +0 -13
- package/dist/runtime/supervisor/long-running-supervisor.d.ts.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.js +0 -1
- package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -1
- package/dist/runtime/validate-dsl-position-tracking.d.ts.map +1 -1
- package/dist/runtime/validate-dsl-position-tracking.js +1 -2
- package/dist/runtime/validate-dsl-position-tracking.js.map +1 -1
- package/dist/runtime-api/handlers/ingest-signals.d.ts.map +1 -1
- package/dist/runtime-api/handlers/ingest-signals.js +0 -1
- package/dist/runtime-api/handlers/ingest-signals.js.map +1 -1
- package/dist/runtime-api/handlers/types.d.ts +0 -5
- package/dist/runtime-api/handlers/types.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-events.d.ts +1 -1
- package/dist/runtime-api/intake/intake-events.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-events.js +3 -9
- package/dist/runtime-api/intake/intake-events.js.map +1 -1
- package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-mount.js +19 -4
- package/dist/runtime-api/intake/intake-mount.js.map +1 -1
- package/dist/runtime-api/intake/process-error-post.d.ts +1 -6
- package/dist/runtime-api/intake/process-error-post.d.ts.map +1 -1
- package/dist/runtime-api/intake/process-error-post.js +1 -5
- package/dist/runtime-api/intake/process-error-post.js.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.d.ts +1 -7
- package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.js +0 -5
- package/dist/runtime-api/intake/process-signal-post.js.map +1 -1
- package/dist/runtime-api/intake/scaffold-error-router.js.map +1 -1
- package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -1
- package/dist/runtime-api/intake/scanner-launcher.js +0 -15
- package/dist/runtime-api/intake/scanner-launcher.js.map +1 -1
- package/dist/runtime-api/intake/types.d.ts +0 -55
- package/dist/runtime-api/intake/types.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.d.ts +0 -2
- package/dist/runtime-api/routes/signals.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.js +1 -5
- package/dist/runtime-api/routes/signals.js.map +1 -1
- package/dist/runtime-api/routes/signals.schema.d.ts +0 -43
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.schema.js +0 -43
- package/dist/runtime-api/routes/signals.schema.js.map +1 -1
- package/dist/runtime-api/server.d.ts +1 -7
- package/dist/runtime-api/server.d.ts.map +1 -1
- package/dist/runtime-api/server.js +0 -1
- package/dist/runtime-api/server.js.map +1 -1
- package/dist/scanners/engine/engine.d.ts +1 -22
- package/dist/scanners/engine/engine.d.ts.map +1 -1
- package/dist/scanners/engine/engine.js +11 -78
- package/dist/scanners/engine/engine.js.map +1 -1
- package/dist/scanners/engine/lifecycle.d.ts +1 -7
- package/dist/scanners/engine/lifecycle.d.ts.map +1 -1
- package/dist/scanners/events.d.ts +0 -4
- package/dist/scanners/events.d.ts.map +1 -1
- package/dist/scanners/events.js +0 -2
- package/dist/scanners/events.js.map +1 -1
- package/dist/scanners/external/scaffold/delivery.py +25 -194
- package/dist/scanners/external/scaffold/scaffold.py +31 -172
- package/dist/scanners/external/scaffold/senpi_mcp.py +8 -150
- package/dist/scanners/external-scanner-receiver.d.ts +0 -17
- package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
- package/dist/scanners/external-scanner-receiver.js +0 -8
- package/dist/scanners/external-scanner-receiver.js.map +1 -1
- package/dist/scanners/runtime-module.d.ts +0 -1
- package/dist/scanners/runtime-module.d.ts.map +1 -1
- package/dist/scanners/runtime-module.js +9 -66
- package/dist/scanners/runtime-module.js.map +1 -1
- package/dist/telemetry/attributes.d.ts +0 -20
- package/dist/telemetry/attributes.d.ts.map +1 -1
- package/dist/telemetry/attributes.js +0 -24
- package/dist/telemetry/attributes.js.map +1 -1
- package/dist/telemetry/event-builders.d.ts +6 -81
- package/dist/telemetry/event-builders.d.ts.map +1 -1
- package/dist/telemetry/event-builders.js +17 -141
- package/dist/telemetry/event-builders.js.map +1 -1
- package/dist/telemetry/event-store.d.ts +0 -6
- package/dist/telemetry/event-store.d.ts.map +1 -1
- package/dist/telemetry/event-store.js +8 -12
- package/dist/telemetry/event-store.js.map +1 -1
- package/dist/telemetry/metrics.d.ts +2 -14
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/metrics.js +4 -19
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/telemetry/spans/redact-pii.d.ts.map +1 -1
- package/dist/telemetry/spans/redact-pii.js +2 -18
- package/dist/telemetry/spans/redact-pii.js.map +1 -1
- package/dist/telemetry/tracing.d.ts +0 -9
- package/dist/telemetry/tracing.d.ts.map +1 -1
- package/dist/telemetry/tracing.js +0 -36
- package/dist/telemetry/tracing.js.map +1 -1
- package/dist/types/dsl/index.d.ts +0 -48
- package/dist/types/dsl/index.d.ts.map +1 -1
- package/dist/types/scanner.d.ts +0 -15
- package/dist/types/scanner.d.ts.map +1 -1
- package/dist/utils/event-catalog.d.ts +0 -202
- package/dist/utils/event-catalog.d.ts.map +1 -1
- package/dist/utils/event-catalog.js +0 -26
- package/dist/utils/event-catalog.js.map +1 -1
- package/dist/utils/logger.d.ts +1 -4
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/validate/recipe-checks.d.ts.map +1 -1
- package/dist/validate/recipe-checks.js +2 -2
- package/dist/validate/recipe-checks.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/actions/skipped-signal-results.d.ts +0 -25
- package/dist/actions/skipped-signal-results.d.ts.map +0 -1
- package/dist/actions/skipped-signal-results.js +0 -71
- package/dist/actions/skipped-signal-results.js.map +0 -1
- package/dist/runtime-api/intake/ingest-request.d.ts +0 -17
- package/dist/runtime-api/intake/ingest-request.d.ts.map +0 -1
- package/dist/runtime-api/intake/ingest-request.js +0 -34
- package/dist/runtime-api/intake/ingest-request.js.map +0 -1
- package/dist/runtime-api/intake/scaffold-tick-router.d.ts +0 -39
- package/dist/runtime-api/intake/scaffold-tick-router.d.ts.map +0 -1
- package/dist/runtime-api/intake/scaffold-tick-router.js +0 -122
- package/dist/runtime-api/intake/scaffold-tick-router.js.map +0 -1
- package/dist/scanners/external/scaffold/tick_facts.py +0 -130
- package/dist/scanners/external/scaffold/ulid.py +0 -58
- package/dist/telemetry/dsl-positions.d.ts +0 -111
- package/dist/telemetry/dsl-positions.d.ts.map +0 -1
- package/dist/telemetry/dsl-positions.js +0 -118
- package/dist/telemetry/dsl-positions.js.map +0 -1
- package/dist/telemetry/live-telemetry.d.ts +0 -257
- package/dist/telemetry/live-telemetry.d.ts.map +0 -1
- package/dist/telemetry/live-telemetry.js +0 -959
- package/dist/telemetry/live-telemetry.js.map +0 -1
- package/dist/telemetry/scanner-stats.d.ts +0 -143
- package/dist/telemetry/scanner-stats.d.ts.map +0 -1
- package/dist/telemetry/scanner-stats.js +0 -426
- package/dist/telemetry/scanner-stats.js.map +0 -1
- package/dist/telemetry/scanner-tick-feed.d.ts +0 -87
- package/dist/telemetry/scanner-tick-feed.d.ts.map +0 -1
- package/dist/telemetry/scanner-tick-feed.js +0 -48
- package/dist/telemetry/scanner-tick-feed.js.map +0 -1
- package/dist/telemetry/strategy-topology.d.ts +0 -99
- package/dist/telemetry/strategy-topology.d.ts.map +0 -1
- package/dist/telemetry/strategy-topology.js +0 -93
- package/dist/telemetry/strategy-topology.js.map +0 -1
- package/dist/telemetry/telemetry-publisher.d.ts +0 -83
- package/dist/telemetry/telemetry-publisher.d.ts.map +0 -1
- package/dist/telemetry/telemetry-publisher.js +0 -256
- package/dist/telemetry/telemetry-publisher.js.map +0 -1
- package/dist/telemetry/tick-frame.d.ts +0 -212
- package/dist/telemetry/tick-frame.d.ts.map +0 -1
- package/dist/telemetry/tick-frame.js +0 -421
- package/dist/telemetry/tick-frame.js.map +0 -1
- package/dist/telemetry/timeline-buffer.d.ts +0 -95
- package/dist/telemetry/timeline-buffer.d.ts.map +0 -1
- package/dist/telemetry/timeline-buffer.js +0 -237
- package/dist/telemetry/timeline-buffer.js.map +0 -1
- package/dist/utils/telemetry-required-log.d.ts +0 -60
- package/dist/utils/telemetry-required-log.d.ts.map +0 -1
- package/dist/utils/telemetry-required-log.js +0 -105
- package/dist/utils/telemetry-required-log.js.map +0 -1
- package/dist/utils/ulid.d.ts +0 -9
- package/dist/utils/ulid.d.ts.map +0 -1
- package/dist/utils/ulid.js +0 -43
- package/dist/utils/ulid.js.map +0 -1
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
run_scaffold(...) loads the author's entrypoint, finds and validates scan(),
|
|
4
4
|
builds the ScanContext, then drives the interval loop: time-box per tick, graceful
|
|
5
5
|
stop on SIGTERM/SIGINT, parent-death detection via ppid, transactional state via
|
|
6
|
-
ctx.state, candidates to sink.
|
|
7
|
-
tick's candidates and carried on every error the tick reports.
|
|
6
|
+
ctx.state, candidates to sink.
|
|
8
7
|
|
|
9
8
|
`path` is a scaffold concern only — it is put on sys.path before import and never
|
|
10
9
|
passed to scan(). scan() is called as scan(inputs, ctx) — 2-arg, sync, returning a
|
|
@@ -43,8 +42,6 @@ from .loop_primitives import (
|
|
|
43
42
|
log_event,
|
|
44
43
|
)
|
|
45
44
|
from .state_manager import StateManager
|
|
46
|
-
from .tick_facts import build_tick_facts, count_changed, project_state_row
|
|
47
|
-
from .ulid import new_ulid
|
|
48
45
|
|
|
49
46
|
|
|
50
47
|
def _read_call_timeout_seconds(senpi_mcp_mod: Any) -> float:
|
|
@@ -106,28 +103,6 @@ def _build_senpi_mcp() -> Any:
|
|
|
106
103
|
)
|
|
107
104
|
|
|
108
105
|
|
|
109
|
-
def _accepts_kwarg(fn: Any, name: str) -> bool:
|
|
110
|
-
"""Whether `fn` takes `name` as a keyword argument.
|
|
111
|
-
|
|
112
|
-
Read from the signature, once, rather than calling with the keyword and retrying on
|
|
113
|
-
TypeError: a sink that raises TypeError from its own body would then be called twice and
|
|
114
|
-
deliver the same candidates twice. A callable whose signature cannot be read keeps the
|
|
115
|
-
narrower call it has today.
|
|
116
|
-
"""
|
|
117
|
-
try:
|
|
118
|
-
params = list(inspect.signature(fn).parameters.values())
|
|
119
|
-
except (TypeError, ValueError):
|
|
120
|
-
return False
|
|
121
|
-
return any(
|
|
122
|
-
p.kind == inspect.Parameter.VAR_KEYWORD
|
|
123
|
-
or (
|
|
124
|
-
p.name == name
|
|
125
|
-
and p.kind in (inspect.Parameter.POSITIONAL_OR_KEYWORD, inspect.Parameter.KEYWORD_ONLY)
|
|
126
|
-
)
|
|
127
|
-
for p in params
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
|
|
131
106
|
def _call_scan(scan: Callable, inputs: dict, ctx: Any):
|
|
132
107
|
"""Call scan(inputs, ctx) — the v2 2-arg contract.
|
|
133
108
|
|
|
@@ -173,8 +148,7 @@ def run_scaffold(
|
|
|
173
148
|
state_history_max_count:
|
|
174
149
|
Bound on the persisted state series. 0/unset = history disabled
|
|
175
150
|
(ctx.state.append raises).
|
|
176
|
-
sink: Callable(candidates
|
|
177
|
-
that takes candidates only is called with candidates only. Default no-op.
|
|
151
|
+
sink: Callable(candidates) invoked after each clean tick. Default no-op.
|
|
178
152
|
max_ticks: Stop after this many ticks. None = unbounded. Used by tests and by a
|
|
179
153
|
validation run, which forces exactly one tick.
|
|
180
154
|
senpi_mcp: Data client to hand to scan(). Default: built from the launch environment.
|
|
@@ -261,24 +235,6 @@ def run_scaffold(
|
|
|
261
235
|
# The MCP boundary's per-tick failure tally, when the client exposes one. Duck-typed:
|
|
262
236
|
# an injected stub without it (a validation run) simply never reclassifies a tick.
|
|
263
237
|
mcp_tally = getattr(senpi_mcp, "tick_errors", None)
|
|
264
|
-
sink_takes_tick_id = sink is not None and _accepts_kwarg(sink, "tick_id")
|
|
265
|
-
# The per-tick observability facts ride the POST the sink already makes. A sink that
|
|
266
|
-
# predates them is called exactly as before, so an older sink is not broken by them.
|
|
267
|
-
sink_takes_tick = sink is not None and _accepts_kwarg(sink, "tick")
|
|
268
|
-
post_error_takes_tick = (
|
|
269
|
-
sink is not None
|
|
270
|
-
and hasattr(sink, "post_error")
|
|
271
|
-
and _accepts_kwarg(sink.post_error, "tick")
|
|
272
|
-
)
|
|
273
|
-
|
|
274
|
-
# Consecutive ticks that produced no candidate. 47 quiet ticks is information; the word
|
|
275
|
-
# "quiet" repeated 47 times is not, so the streak is counted here and sent as a number.
|
|
276
|
-
quiet_ticks = 0
|
|
277
|
-
# The previous tick's start, for the cadence lag. None on the first tick of a process:
|
|
278
|
-
# there is no gap to measure yet, and a 0 would claim the scanner was exactly on time.
|
|
279
|
-
prev_tick_started_at: Optional[float] = None
|
|
280
|
-
# The last projection reported, so `state_changed` says what MOVED rather than what exists.
|
|
281
|
-
prev_state_projection: Optional[dict] = None
|
|
282
238
|
|
|
283
239
|
try:
|
|
284
240
|
while not stop_event.is_set():
|
|
@@ -289,18 +245,7 @@ def run_scaffold(
|
|
|
289
245
|
break
|
|
290
246
|
|
|
291
247
|
tick_count += 1
|
|
292
|
-
# One id per tick, minted before any of the tick's work so every candidate and every
|
|
293
|
-
# error it reports names the same tick.
|
|
294
|
-
tick_id = new_ulid()
|
|
295
248
|
tick_started_at = time.time()
|
|
296
|
-
# Actual gap between tick starts, minus the cadence the scanner is configured for.
|
|
297
|
-
# A positive number is a scanner falling behind its own interval.
|
|
298
|
-
lag_ms = (
|
|
299
|
-
None
|
|
300
|
-
if prev_tick_started_at is None
|
|
301
|
-
else int(round((tick_started_at - prev_tick_started_at - interval) * 1000))
|
|
302
|
-
)
|
|
303
|
-
prev_tick_started_at = tick_started_at
|
|
304
249
|
tick_status = "ok"
|
|
305
250
|
tick_error = None
|
|
306
251
|
candidates: list = []
|
|
@@ -324,15 +269,10 @@ def run_scaffold(
|
|
|
324
269
|
)
|
|
325
270
|
# Carried on the error record, not only in this log line: the sink is what
|
|
326
271
|
# a caller reads, and "malformed" without the reason is not actionable.
|
|
327
|
-
tick_error = {
|
|
328
|
-
"type": "malformed",
|
|
329
|
-
"tick_id": tick_id,
|
|
330
|
-
"message": malformed_reason,
|
|
331
|
-
}
|
|
272
|
+
tick_error = {"type": "malformed", "message": malformed_reason}
|
|
332
273
|
log_event(
|
|
333
274
|
"scaffold_tick_malformed",
|
|
334
275
|
tick=tick_count,
|
|
335
|
-
tick_id=tick_id,
|
|
336
276
|
reason=malformed_reason,
|
|
337
277
|
)
|
|
338
278
|
else:
|
|
@@ -341,11 +281,10 @@ def run_scaffold(
|
|
|
341
281
|
except _TickTimeout as exc:
|
|
342
282
|
tick_status = "timeout"
|
|
343
283
|
candidates = []
|
|
344
|
-
tick_error = {"type": "timeout", "
|
|
284
|
+
tick_error = {"type": "timeout", "message": str(exc)}
|
|
345
285
|
log_event(
|
|
346
286
|
"scaffold_tick_timeout",
|
|
347
287
|
tick=tick_count,
|
|
348
|
-
tick_id=tick_id,
|
|
349
288
|
reason=str(exc),
|
|
350
289
|
)
|
|
351
290
|
except Exception as exc: # noqa: BLE001 — author bug must not crash scaffold
|
|
@@ -353,14 +292,12 @@ def run_scaffold(
|
|
|
353
292
|
candidates = []
|
|
354
293
|
tick_error = {
|
|
355
294
|
"type": "error",
|
|
356
|
-
"tick_id": tick_id,
|
|
357
295
|
"error_type": type(exc).__name__,
|
|
358
296
|
"message": str(exc),
|
|
359
297
|
}
|
|
360
298
|
log_event(
|
|
361
299
|
"scaffold_tick_error",
|
|
362
300
|
tick=tick_count,
|
|
363
|
-
tick_id=tick_id,
|
|
364
301
|
error_type=type(exc).__name__,
|
|
365
302
|
error=str(exc),
|
|
366
303
|
)
|
|
@@ -380,23 +317,15 @@ def run_scaffold(
|
|
|
380
317
|
mcp_error_count, mcp_failure = _classify_mcp_errors(mcp_tally, candidates)
|
|
381
318
|
if tick_status == "ok" and mcp_failure is not None:
|
|
382
319
|
tick_status = "mcp_error"
|
|
383
|
-
|
|
384
|
-
# `/errors` names the tick it came from, and the classifier is tick-agnostic.
|
|
385
|
-
tick_error = {**mcp_failure, "tick_id": tick_id}
|
|
320
|
+
tick_error = mcp_failure
|
|
386
321
|
log_event(
|
|
387
322
|
"scaffold_tick_mcp_error",
|
|
388
323
|
tick=tick_count,
|
|
389
|
-
tick_id=tick_id,
|
|
390
324
|
error_type=mcp_failure["error_type"],
|
|
391
325
|
error_count=mcp_error_count,
|
|
392
326
|
)
|
|
393
327
|
|
|
394
|
-
# The quiet streak counts ticks, not words: a tick that produced a
|
|
395
|
-
# candidate ends the streak whatever its status.
|
|
396
|
-
quiet_ticks = 0 if candidates else quiet_ticks + 1
|
|
397
|
-
|
|
398
328
|
# --- Clean tick: commit ctx.state, deliver candidates ---
|
|
399
|
-
persist_error = None
|
|
400
329
|
if tick_status == "ok":
|
|
401
330
|
# Transactional commit. A failed persist RAISES (StateManager
|
|
402
331
|
# enforces it) and does NOT advance the committed snapshot — so
|
|
@@ -412,100 +341,46 @@ def run_scaffold(
|
|
|
412
341
|
log_event(
|
|
413
342
|
"scaffold_state_persist_failed",
|
|
414
343
|
tick=tick_count,
|
|
415
|
-
tick_id=tick_id,
|
|
416
344
|
error_type=type(commit_exc).__name__,
|
|
417
345
|
error=str(commit_exc),
|
|
418
346
|
)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
# advanced) and report to /errors via the sink, when supported.
|
|
433
|
-
ctx.state.rollback()
|
|
434
|
-
committed = False
|
|
435
|
-
commit_outcome = "rolled_back"
|
|
436
|
-
|
|
437
|
-
# Read AFTER the commit/rollback above, so this is always the last
|
|
438
|
-
# COMMITTED row — stale by one tick on a failed tick, which is exactly
|
|
439
|
-
# when the last state the scanner agreed on is worth seeing.
|
|
440
|
-
state_row = ctx.state.last()
|
|
441
|
-
state_projection = project_state_row(state_row)
|
|
442
|
-
state_fields = len(state_row) if isinstance(state_row, dict) else None
|
|
443
|
-
state_changed = (
|
|
444
|
-
None
|
|
445
|
-
if state_fields is None
|
|
446
|
-
else count_changed(state_projection, prev_state_projection)
|
|
447
|
-
)
|
|
448
|
-
prev_state_projection = state_projection if state_fields is not None else None
|
|
449
|
-
|
|
450
|
-
tick_facts = build_tick_facts(
|
|
451
|
-
tick_id=tick_id,
|
|
452
|
-
status=tick_status,
|
|
453
|
-
candidate_count=len(candidates),
|
|
454
|
-
duration_ms=duration_ms,
|
|
455
|
-
commit=commit_outcome,
|
|
456
|
-
quiet_ticks=quiet_ticks,
|
|
457
|
-
lag_ms=lag_ms,
|
|
458
|
-
mcp_snapshot=mcp_tally.snapshot() if mcp_tally is not None else None,
|
|
459
|
-
call_snapshot=(
|
|
460
|
-
mcp_tally.call_snapshot()
|
|
461
|
-
if mcp_tally is not None and hasattr(mcp_tally, "call_snapshot")
|
|
462
|
-
else None
|
|
463
|
-
),
|
|
464
|
-
state_row=state_row,
|
|
465
|
-
state_fields=state_fields,
|
|
466
|
-
state_changed=state_changed,
|
|
467
|
-
)
|
|
468
|
-
|
|
469
|
-
# Exactly one POST carries this tick's facts: /signals on a clean tick,
|
|
470
|
-
# /errors on any tick that failed. Both already happen every tick, so the
|
|
471
|
-
# facts add no request of their own.
|
|
472
|
-
sink_can_post_error = sink is not None and hasattr(sink, "post_error")
|
|
473
|
-
facts_for_error = tick_facts if post_error_takes_tick else None
|
|
474
|
-
if tick_status == "ok":
|
|
475
|
-
if persist_error is not None and sink_can_post_error:
|
|
476
|
-
_post_error_safe(
|
|
477
|
-
sink, persist_error, tick_count, tick_id, facts_for_error
|
|
478
|
-
)
|
|
347
|
+
if sink is not None and hasattr(sink, "post_error"):
|
|
348
|
+
_post_error_safe(
|
|
349
|
+
sink,
|
|
350
|
+
{
|
|
351
|
+
"type": "state_persist_failed",
|
|
352
|
+
"tick": tick_count,
|
|
353
|
+
"message": (
|
|
354
|
+
"scanner state could not be persisted; "
|
|
355
|
+
"tick discarded, state not advanced"
|
|
356
|
+
),
|
|
357
|
+
},
|
|
358
|
+
tick_count,
|
|
359
|
+
)
|
|
479
360
|
|
|
480
361
|
if committed and sink is not None:
|
|
481
362
|
try:
|
|
482
|
-
|
|
483
|
-
if sink_takes_tick_id:
|
|
484
|
-
kwargs["tick_id"] = tick_id
|
|
485
|
-
if sink_takes_tick:
|
|
486
|
-
kwargs["tick"] = tick_facts
|
|
487
|
-
sink(candidates, **kwargs)
|
|
363
|
+
sink(candidates)
|
|
488
364
|
except Exception as sink_exc: # noqa: BLE001
|
|
489
365
|
log_event(
|
|
490
366
|
"scaffold_sink_error",
|
|
491
367
|
tick=tick_count,
|
|
492
|
-
tick_id=tick_id,
|
|
493
368
|
error_type=type(sink_exc).__name__,
|
|
494
369
|
error=str(sink_exc),
|
|
495
370
|
)
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
371
|
+
else:
|
|
372
|
+
# Non-ok tick (error / timeout / malformed): roll back the
|
|
373
|
+
# working buffer (discard the tick's mutations — state not
|
|
374
|
+
# advanced) and report to /errors via the sink, when supported.
|
|
375
|
+
ctx.state.rollback()
|
|
376
|
+
if sink is not None and hasattr(sink, "post_error"):
|
|
377
|
+
_post_error_safe(
|
|
378
|
+
sink, tick_error or {"type": tick_status}, tick_count
|
|
379
|
+
)
|
|
504
380
|
|
|
505
381
|
log_event(
|
|
506
382
|
"scaffold_tick_finished",
|
|
507
383
|
tick=tick_count,
|
|
508
|
-
tick_id=tick_id,
|
|
509
384
|
status=tick_status,
|
|
510
385
|
duration_ms=duration_ms,
|
|
511
386
|
candidate_count=len(candidates),
|
|
@@ -527,7 +402,6 @@ def run_scaffold(
|
|
|
527
402
|
log_event(
|
|
528
403
|
"scaffold_tick_timeout_late",
|
|
529
404
|
tick=tick_count,
|
|
530
|
-
tick_id=tick_id,
|
|
531
405
|
reason=str(late_exc),
|
|
532
406
|
)
|
|
533
407
|
|
|
@@ -580,29 +454,14 @@ def _classify_mcp_errors(mcp_tally: Any, candidates: list) -> tuple[int, Optiona
|
|
|
580
454
|
}
|
|
581
455
|
|
|
582
456
|
|
|
583
|
-
def _post_error_safe(
|
|
584
|
-
sink
|
|
585
|
-
error: dict,
|
|
586
|
-
tick_count: int,
|
|
587
|
-
tick_id: str,
|
|
588
|
-
tick: Optional[dict] = None,
|
|
589
|
-
) -> None:
|
|
590
|
-
"""Call sink.post_error(error), swallowing/logging any failure.
|
|
591
|
-
|
|
592
|
-
`tick` is passed only when the sink's signature accepts it — the caller checks
|
|
593
|
-
once at launch, so a sink that predates the per-tick facts keeps its one-argument
|
|
594
|
-
call rather than being handed a keyword it would raise on.
|
|
595
|
-
"""
|
|
457
|
+
def _post_error_safe(sink: Any, error: dict, tick_count: int) -> None:
|
|
458
|
+
"""Call sink.post_error(error), swallowing/logging any failure."""
|
|
596
459
|
try:
|
|
597
|
-
|
|
598
|
-
sink.post_error(error)
|
|
599
|
-
else:
|
|
600
|
-
sink.post_error(error, tick=tick)
|
|
460
|
+
sink.post_error(error)
|
|
601
461
|
except Exception as perr: # noqa: BLE001
|
|
602
462
|
log_event(
|
|
603
463
|
"scaffold_post_error_failed",
|
|
604
464
|
tick=tick_count,
|
|
605
|
-
tick_id=tick_id,
|
|
606
465
|
error_type=type(perr).__name__,
|
|
607
466
|
error=str(perr),
|
|
608
467
|
)
|
|
@@ -404,155 +404,28 @@ def _cast_market_numerics(name: str, payload: Any, args: Optional[dict] = None)
|
|
|
404
404
|
return payload
|
|
405
405
|
|
|
406
406
|
|
|
407
|
-
# Per-call detail kept for one tick. The counts and the total duration below are
|
|
408
|
-
# whole however many calls a tick makes; only this per-call list is cut, because
|
|
409
|
-
# a scanner that calls a tool in a loop would otherwise grow an unbounded list
|
|
410
|
-
# inside a process that must not grow.
|
|
411
|
-
MAX_TICK_CALL_RECORDS = 64
|
|
412
|
-
|
|
413
|
-
# Per-argument bounds for a recorded call. Arguments are author-supplied and
|
|
414
|
-
# reach a watching operator's screen, so what is kept is scalars only, capped.
|
|
415
|
-
MAX_TICK_CALL_ARG_KEYS = 16
|
|
416
|
-
MAX_TICK_CALL_ARG_CHARS = 1024
|
|
417
|
-
|
|
418
|
-
# A list of scalars is kept as well, because the assets a scanner priced arrive
|
|
419
|
-
# in that shape and are the most useful argument on the event. Both bounds apply
|
|
420
|
-
# to one list: at most this many elements, and no more rendered characters than a
|
|
421
|
-
# single string argument is allowed. MAX_TICK_CALL_ARG_CHARS is shared rather than
|
|
422
|
-
# doubled so one long list cannot cost more frame than one long string.
|
|
423
|
-
MAX_TICK_CALL_ARG_LIST_ITEMS = 16
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
def _is_arg_scalar(value: Any) -> bool:
|
|
427
|
-
"""Whether one value is a scalar this event carries: str, bool, or a finite number.
|
|
428
|
-
|
|
429
|
-
The int branch covers bool, which subclasses it, and comes before the float
|
|
430
|
-
branch on purpose: an int cannot be infinite, and `math.isfinite` on one too
|
|
431
|
-
large to convert to a float raises OverflowError.
|
|
432
|
-
"""
|
|
433
|
-
if isinstance(value, int):
|
|
434
|
-
return True
|
|
435
|
-
if isinstance(value, float):
|
|
436
|
-
return math.isfinite(value)
|
|
437
|
-
return isinstance(value, str)
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
def _record_arg_list(value: list) -> Optional[list]:
|
|
441
|
-
"""One list argument, bounded — or None when the list is not carried at all.
|
|
442
|
-
|
|
443
|
-
A single non-scalar element rejects the whole list. Filtering it out instead
|
|
444
|
-
would let an author's unbounded dict decide how much of a nested payload gets
|
|
445
|
-
rendered, which is the input this event refuses to take.
|
|
446
|
-
|
|
447
|
-
Elements dropped by either bound are replaced by a trailing count, so a
|
|
448
|
-
shortened list reads as shortened rather than as a shorter call. The marker is
|
|
449
|
-
a plain string element because the consumer expands dictionary indexes and
|
|
450
|
-
scalars, and a nested object would not survive it.
|
|
451
|
-
"""
|
|
452
|
-
if not all(_is_arg_scalar(item) for item in value):
|
|
453
|
-
return None
|
|
454
|
-
kept: list = []
|
|
455
|
-
chars = 0
|
|
456
|
-
for item in value[:MAX_TICK_CALL_ARG_LIST_ITEMS]:
|
|
457
|
-
rendered = len(item) if isinstance(item, str) else len(str(item))
|
|
458
|
-
if chars + rendered > MAX_TICK_CALL_ARG_CHARS:
|
|
459
|
-
break
|
|
460
|
-
chars += rendered
|
|
461
|
-
kept.append(item)
|
|
462
|
-
if len(kept) < len(value):
|
|
463
|
-
kept.append(f"+{len(value) - len(kept)} more")
|
|
464
|
-
return kept
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
def _record_args(args: Optional[dict]) -> dict:
|
|
468
|
-
"""The scalar arguments of one call, bounded — never the caller's own dict.
|
|
469
|
-
|
|
470
|
-
A reference would let authored code mutate what the tally already recorded,
|
|
471
|
-
and a deep copy would pay for a payload the wire is going to drop anyway. A
|
|
472
|
-
kept list is a new list for the same reason.
|
|
473
|
-
"""
|
|
474
|
-
if not isinstance(args, dict):
|
|
475
|
-
return {}
|
|
476
|
-
kept: dict = {}
|
|
477
|
-
for key in list(args.keys())[:MAX_TICK_CALL_ARG_KEYS]:
|
|
478
|
-
if not isinstance(key, str):
|
|
479
|
-
continue
|
|
480
|
-
value = args[key]
|
|
481
|
-
if isinstance(value, str):
|
|
482
|
-
kept[key] = value[:MAX_TICK_CALL_ARG_CHARS]
|
|
483
|
-
elif _is_arg_scalar(value):
|
|
484
|
-
# The same gate the list path applies, and for a harder reason here: an
|
|
485
|
-
# `inf` compares equal to itself, so a self-equality check lets it
|
|
486
|
-
# through, and json.dumps then writes the bare `Infinity` token. That
|
|
487
|
-
# token is not JSON, and the tick facts ride one POST body — a
|
|
488
|
-
# JavaScript JSON.parse on it throws and every other fact on the tick
|
|
489
|
-
# is lost with the one argument.
|
|
490
|
-
kept[key] = value
|
|
491
|
-
elif isinstance(value, list):
|
|
492
|
-
# An empty list is kept. Absent means unmeasured on this event, and a
|
|
493
|
-
# scanner that passed no elements did measure something: it asked for
|
|
494
|
-
# nothing. Dropping it would report the argument as never supplied.
|
|
495
|
-
rendered_list = _record_arg_list(value)
|
|
496
|
-
if rendered_list is not None:
|
|
497
|
-
kept[key] = rendered_list
|
|
498
|
-
return kept
|
|
499
|
-
|
|
500
|
-
|
|
501
407
|
class TickErrorTally:
|
|
502
|
-
"""Per-tick
|
|
503
|
-
|
|
504
|
-
Two tallies, one object, because both are read at the same moment and reset
|
|
505
|
-
at the same moment.
|
|
506
|
-
|
|
507
|
-
FAILURES. Authored scan() code routinely catches the MCP exception and
|
|
508
|
-
returns [], so the exception alone never reaches the scaffold — the tick
|
|
509
|
-
would finish `ok` with zero candidates while the scanner is blind. The client
|
|
510
|
-
records every failure here as it re-raises; the scaffold resets the tally at
|
|
511
|
-
tick start and reads it at tick end to decide whether a candidate-less tick
|
|
512
|
-
was really ok.
|
|
513
|
-
|
|
514
|
-
CALLS. Every call is recorded, succeeded or failed, with the time it took.
|
|
515
|
-
Failures alone say what broke but not what the tick actually did or where its
|
|
516
|
-
time went — a tick with no failures and one 9-second call is a slow venue, and
|
|
517
|
-
nothing else on the box can tell an operator that.
|
|
408
|
+
"""Per-tick count of MCP call failures, by error type.
|
|
518
409
|
|
|
410
|
+
Authored scan() code routinely catches the MCP exception and returns [], so
|
|
411
|
+
the exception alone never reaches the scaffold — the tick would finish `ok`
|
|
412
|
+
with zero candidates while the scanner is blind. The client records every
|
|
413
|
+
failure here as it re-raises; the scaffold resets the tally at tick start and
|
|
414
|
+
reads it at tick end to decide whether a candidate-less tick was really ok.
|
|
519
415
|
Thread-safe because call_tool may be driven from author threads.
|
|
520
416
|
"""
|
|
521
417
|
|
|
522
418
|
def __init__(self) -> None:
|
|
523
419
|
self._by_type: dict[str, int] = {}
|
|
524
|
-
self._calls: list[dict] = []
|
|
525
|
-
self._call_count = 0
|
|
526
|
-
self._total_ms = 0.0
|
|
527
420
|
self._lock = threading.Lock()
|
|
528
421
|
|
|
529
422
|
def record(self, error_type: str) -> None:
|
|
530
423
|
with self._lock:
|
|
531
424
|
self._by_type[error_type] = self._by_type.get(error_type, 0) + 1
|
|
532
425
|
|
|
533
|
-
def record_call(
|
|
534
|
-
self,
|
|
535
|
-
tool: str,
|
|
536
|
-
elapsed_ms: float,
|
|
537
|
-
args: Optional[dict] = None,
|
|
538
|
-
error_type: Optional[str] = None,
|
|
539
|
-
) -> None:
|
|
540
|
-
"""Record one completed call. Called on the success path and the failure path alike."""
|
|
541
|
-
entry = {"tool": tool, "ms": elapsed_ms, "args": _record_args(args)}
|
|
542
|
-
if error_type is not None:
|
|
543
|
-
entry["error_type"] = error_type
|
|
544
|
-
with self._lock:
|
|
545
|
-
self._call_count += 1
|
|
546
|
-
self._total_ms += elapsed_ms
|
|
547
|
-
if len(self._calls) < MAX_TICK_CALL_RECORDS:
|
|
548
|
-
self._calls.append(entry)
|
|
549
|
-
|
|
550
426
|
def reset(self) -> None:
|
|
551
427
|
with self._lock:
|
|
552
428
|
self._by_type = {}
|
|
553
|
-
self._calls = []
|
|
554
|
-
self._call_count = 0
|
|
555
|
-
self._total_ms = 0.0
|
|
556
429
|
|
|
557
430
|
def snapshot(self) -> dict[str, Any]:
|
|
558
431
|
"""{count, dominant_error_type, by_type}; count 0 / None when clean.
|
|
@@ -567,15 +440,6 @@ class TickErrorTally:
|
|
|
567
440
|
dominant = max(by_type, key=by_type.__getitem__) if by_type else None
|
|
568
441
|
return {"count": count, "dominant_error_type": dominant, "by_type": by_type}
|
|
569
442
|
|
|
570
|
-
def call_snapshot(self) -> dict[str, Any]:
|
|
571
|
-
"""{count, total_ms, calls}. `count` and `total_ms` are whole; `calls` may be cut."""
|
|
572
|
-
with self._lock:
|
|
573
|
-
return {
|
|
574
|
-
"count": self._call_count,
|
|
575
|
-
"total_ms": round(self._total_ms, 1),
|
|
576
|
-
"calls": [dict(call) for call in self._calls],
|
|
577
|
-
}
|
|
578
|
-
|
|
579
443
|
|
|
580
444
|
# --------------------------------------------------------------------------
|
|
581
445
|
# Transport-failure classification — which errors mean "the session is dead".
|
|
@@ -806,11 +670,7 @@ class SenpiMcpClient:
|
|
|
806
670
|
|
|
807
671
|
used = self._ensure_connected(name, deadline)
|
|
808
672
|
result = self._run(used.session.call_tool(name, arguments=args), name, deadline)
|
|
809
|
-
|
|
810
|
-
# Recorded after the unwrap, so a call that returned an `isError` result is
|
|
811
|
-
# counted on the failure path below and never twice.
|
|
812
|
-
self.tick_errors.record_call(name, round((time.monotonic() - started) * 1000, 1), args)
|
|
813
|
-
return value
|
|
673
|
+
return _cast_market_numerics(name, self._unwrap(name, result), args)
|
|
814
674
|
except Exception as exc:
|
|
815
675
|
# Catch every failure — mutation block, missing creds, the lazy
|
|
816
676
|
# `import mcp`, transport errors, timeouts, tool `isError` — tally
|
|
@@ -831,15 +691,13 @@ class SenpiMcpClient:
|
|
|
831
691
|
# counts under the SAME name, so the dominant type a blind tick
|
|
832
692
|
# reports to /errors matches the senpi_mcp_error lines beside it.
|
|
833
693
|
error_type = "TimeoutError" if timed_out else type(primary).__name__
|
|
834
|
-
elapsed_ms = round((time.monotonic() - started) * 1000, 1)
|
|
835
694
|
self.tick_errors.record(error_type)
|
|
836
|
-
self.tick_errors.record_call(name, elapsed_ms, args, error_type)
|
|
837
695
|
log_event(
|
|
838
696
|
"senpi_mcp_error",
|
|
839
697
|
tool=name,
|
|
840
698
|
error_type=error_type,
|
|
841
699
|
error=str(primary)[:500],
|
|
842
|
-
elapsed_ms=
|
|
700
|
+
elapsed_ms=round((time.monotonic() - started) * 1000, 1),
|
|
843
701
|
**({"leaf_count": len(leaves)} if len(leaves) > 1 else {}),
|
|
844
702
|
**({"timeout_seconds": self._call_timeout} if timed_out else {}),
|
|
845
703
|
**({"session_rebuilt": True} if rebuilt else {}),
|
|
@@ -18,17 +18,6 @@ export interface ExternalScannerIngestRequest {
|
|
|
18
18
|
* greppable across the intake→ingest hops. Never sizes/gates/routes a trade.
|
|
19
19
|
*/
|
|
20
20
|
signal_id?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Producer-minted id of the scan that produced this signal. Absent when the
|
|
23
|
-
* producer sends none — the ingest never mints one, so a missing id stays
|
|
24
|
-
* missing all the way to the event attribute.
|
|
25
|
-
*/
|
|
26
|
-
tick_id?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Intake-minted id of the acceptance row that admitted this signal. Answers a
|
|
29
|
-
* different question from `tick_id`: which acceptance, not which scan.
|
|
30
|
-
*/
|
|
31
|
-
correlationId?: string;
|
|
32
21
|
/** Asset for a single ingested signal. */
|
|
33
22
|
asset?: string;
|
|
34
23
|
/** Optional direction for a single ingested signal. */
|
|
@@ -69,12 +58,6 @@ export interface ExternalScannerIngestSignalItem {
|
|
|
69
58
|
signal_type?: string;
|
|
70
59
|
marginPct?: number;
|
|
71
60
|
leverage?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Producer-minted id of the scan that produced THIS item. One batch can mix ticks — a producer
|
|
74
|
-
* retry rides along with the current tick's signals — so the item's own id wins over the
|
|
75
|
-
* request-level one. Absent on both leaves the signal unnamed; the ingest never mints one.
|
|
76
|
-
*/
|
|
77
|
-
tick_id?: string;
|
|
78
61
|
data: Record<string, unknown>;
|
|
79
62
|
}
|
|
80
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-scanner-receiver.d.ts","sourceRoot":"","sources":["../../src/scanners/external-scanner-receiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA4B;IAC3C,uCAAuC;IACvC,OAAO,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"external-scanner-receiver.d.ts","sourceRoot":"","sources":["../../src/scanners/external-scanner-receiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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AS,GAAG,MAAM,CAAC,WAAW,CAAC,CAWlG"}
|
|
@@ -86,7 +86,6 @@ function prepareSingleSignalIngest(options) {
|
|
|
86
86
|
marginPct: request.marginPct,
|
|
87
87
|
leverage: request.leverage,
|
|
88
88
|
signalId: request.signal_id,
|
|
89
|
-
tickId: request.tick_id,
|
|
90
89
|
data: request.data,
|
|
91
90
|
defaultSignalType: options.defaultSignalType,
|
|
92
91
|
timestamp: options.timestamp,
|
|
@@ -141,9 +140,6 @@ function prepareBatchSignalIngest(options) {
|
|
|
141
140
|
signalType: item.signal_type,
|
|
142
141
|
marginPct: item.marginPct,
|
|
143
142
|
leverage: item.leverage,
|
|
144
|
-
// The item names the tick that produced IT; the request-level id is the fallback for a
|
|
145
|
-
// producer that sends one id for the whole POST.
|
|
146
|
-
tickId: typeof item.tick_id === "string" ? item.tick_id : request.tick_id,
|
|
147
143
|
data: item.data,
|
|
148
144
|
defaultSignalType: options.defaultSignalType,
|
|
149
145
|
timestamp: options.timestamp,
|
|
@@ -233,10 +229,6 @@ function buildNormalizedSignal(options) {
|
|
|
233
229
|
if (typeof options.signalId === "string" && options.signalId.length > 0) {
|
|
234
230
|
signal.signal_id = options.signalId;
|
|
235
231
|
}
|
|
236
|
-
// Same carry as signal_id: a blank would be an attribute that exists and says nothing.
|
|
237
|
-
if (typeof options.tickId === "string" && options.tickId.length > 0) {
|
|
238
|
-
signal.tick_id = options.tickId;
|
|
239
|
-
}
|
|
240
232
|
// Canonical per-signal sizing/leverage ride at the top level (not in meta),
|
|
241
233
|
// so the open action consumes them directly. Only in-range values are kept.
|
|
242
234
|
// marginPct is a percent of withdrawable (0–100].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-scanner-receiver.js","sourceRoot":"","sources":["../../src/scanners/external-scanner-receiver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"external-scanner-receiver.js","sourceRoot":"","sources":["../../src/scanners/external-scanner-receiver.ts"],"names":[],"mappings":"AA4F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