Skip to content

Commit 48ca87a

Browse files
committed
fix(service-automation): stop splicing uncontrolled thrown text into engine.ts log messages (13 residual seams + 1 self-authored), re-grade run-history persist to error (#6499)
The 13 seams #6499 lists — datasource (persistSuspendedRun, listRuns, getRun, recordLog), plugin-supplied (releaseSuspension, unregisterTrigger, activateFlowTrigger, deactivateFlowTrigger), and engine-internal (resolveRunContext, expandDeclaredLookups, refuseInvalidScreenInput, bubbleToParent x2) — now log a single-line consequence-stating message and hand the cause to the logger's structured slot (describeThrownForLog), the #6299 / PR #6498 pattern. The 14th site (validateFlowExpressions' advisory pass) had the opposite cause — a self-authored newline — and gets the same shape: message one line, the author's expression source in the meta slot. Per-site #4632 verdicts (each pinned by test, since check:durability-log-level grades none of these): recordTerminal's fire-and-forget catch is RAISED warn -> error (terminal history row failed to land while the run reads healthy; the approvals sweeps then misread the hole); persistSuspendedRun stays error (#4460); all other sites stay warn (functional degradations that claim no persistence). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01USNUyHEr7uaU6MoEWXitei
1 parent 4afdd3e commit 48ca87a

5 files changed

Lines changed: 900 additions & 30 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
"@objectstack/service-automation": patch
3+
---
4+
5+
fix(service-automation): the 13 residual `engine.ts` seams stop splicing uncontrolled thrown text into log messages, plus the one self-authored multi-line message; run-history persist failure is re-graded `error` (#6499)
6+
7+
#6299 / PR #6498 fixed three `engine.ts` seams and closed with "this file is now
8+
clean"; #6499 is the corrective record: 13 more logger calls in the same file
9+
still interpolated a thrown value's `.message` — a datasource driver's, a
10+
plugin's (trigger / node-executor), or, second-hand via the
11+
`AutomationResult.error` envelope, a failing node's — into the log MESSAGE.
12+
`ObjectLogger.write()` adds one `<ts> <LEVEL>` head per call, so a cause
13+
carrying newlines turned ONE record into several physical lines of which only
14+
the first is greppable, and `serve`'s boot-quiet window drops the headless
15+
continuations outright on the stdout (warn) path. All 13 now log a single-line
16+
message stating the site's own consequence and hand the cause to the logger's
17+
structured slot (`describeThrownForLog`).
18+
19+
A 14th site with the opposite cause is fixed alongside, argued on its own
20+
terms: `validateFlowExpressions`' advisory schema pass authored a literal
21+
`\n source: …` continuation into a message we control, with the flow
22+
author's (newline-tolerant CEL) expression as the second line. The message now
23+
stays one line; the expression source rides the structured slot (`source`).
24+
25+
The level was judged per seam (#4632), not batch-copied:
26+
27+
- **`recordLog`'s fire-and-forget `store.recordTerminal` → RAISED to `error`.**
28+
The write half of the run-history claim: a TERMINAL run's history row failed
29+
to land while the run completed and every caller reads healthy — nothing
30+
retries it, nothing upstream is told. After the next restart the run is
31+
invisible to the Runs surfaces, `inspectStrandedRequests` (#3456) reads
32+
"no suspension + no terminal row" as a STRANDED approval, and
33+
`releasePendingForTerminalRuns` (#4469) reads "no terminal row" as
34+
still-alive, so a finished run's leftover pending approvals are never
35+
auto-released.
36+
- **`persistSuspendedRun` stays `error`** (#4460's raise; #4420 is this exact
37+
seam's accident) — no re-grade, message and slot fixed only.
38+
- **Everything else stays `warn`** (functional): `listRuns` / `getRun`
39+
(observability reads degrading to ring buffer / null — each record now says
40+
the caller cannot tell the degraded answer from a real one), the four
41+
plugin-supplied seams (`releaseSuspension`, `unregisterTrigger`,
42+
`activateFlowTrigger`, `deactivateFlowTrigger`), the grants resolver, lookup
43+
expansion, the screen `visibleWhen` probe, and both `bubbleToParent`
44+
branches. Nothing these degrade claims to be persisted.
45+
46+
Operator-visible: one record moves from stdout/`WARN` to stderr/`ERROR`
47+
(run-history persist failure), and the reworded messages keep their original
48+
lead phrases (`run-history read failed`, `durable run lookup failed`,
49+
`Failed to bind flow`, `could not resolve grants`, …) so existing greps still
50+
match; alert rules keyed on the trailing `: <error text>` splice need the
51+
structured `error` / `source` / `visibleWhen` fields instead.

0 commit comments

Comments
 (0)