|
| 1 | +--- |
| 2 | +"@objectstack/service-automation": patch |
| 3 | +--- |
| 4 | + |
| 5 | +docs(automation): `sys_automation_run` says why `failed` has no column of its own, and `summary_json` names it (#15606) |
| 6 | + |
| 7 | +`FlowRunSummary` carries five run-level totals. Four of them — |
| 8 | +`selected_count`, `acted_count`, `skipped_count`, `unmeasured_count` — have a |
| 9 | +column on `sys_automation_run`; `failed` rides inside the `summary_json` blob. |
| 10 | +That asymmetry was filed as a finding and ruled on (decision batch #76, |
| 11 | +2026-09-07) rather than closed by adding a fifth column, and this change is the |
| 12 | +ruling: the reasoning now ships in the schema instead of living only on the |
| 13 | +card. |
| 14 | + |
| 15 | +The four are columns because ONE filter expression needs them in ONE row — |
| 16 | +`selected_count > 0 AND acted_count = 0`, qualified by `unmeasured_count` — and |
| 17 | +a `WHERE` clause cannot reach into a JSON blob for an operand, so every operand |
| 18 | +of that expression has to be a column or the expression cannot be written at |
| 19 | +all. `failed` is not one of its operands: it would be its own predicate |
| 20 | +(`failed_count > 0`), nobody alerts on it today, and a caller that wants it has |
| 21 | +already fetched `summary_json`. |
| 22 | + |
| 23 | +What a consumer sees change: |
| 24 | + |
| 25 | +- `summary_json`'s `description` now names `failed` as the field to read |
| 26 | + lost-row counts from, states that the run-level totals live in the blob |
| 27 | + alongside the per-node breakdown, and repeats the `unmeasured`/`failed` |
| 28 | + convention that an absent count means "not tracked", never zero. ⚠️ This is |
| 29 | + why the change carries a changeset and NOT `skip-changeset`, and it was |
| 30 | + MEASURED rather than assumed from "it's only prose": `SysAutomationRun` is |
| 31 | + re-exported from `src/index.ts`, `package.json` publishes `files: ["dist"]`, |
| 32 | + and after `pnpm --filter @objectstack/service-automation build` the new |
| 33 | + description text is present in BOTH published entry points — one hit each in |
| 34 | + `dist/index.js` and `dist/index.cjs`. `skip-changeset` is for a diff that |
| 35 | + publishes nothing from any released package; this one changes bytes inside a |
| 36 | + released package's shipped bundle, so it does not qualify. (`description` is |
| 37 | + also what the authorable `help` / `helpText` keys alias onto in |
| 38 | + `packages/spec/src/data/object.zod.ts` — documentation a consumer surface can |
| 39 | + render, not an internal note.) |
| 40 | +- The comment above `selected_count` — the paragraph that explains why the |
| 41 | + four are columns, and therefore the paragraph a reader is in when they |
| 42 | + notice the fifth is not — now carries the verdict for `failed` and the one |
| 43 | + condition that re-opens it: the first real need to ALERT on "which runs lost |
| 44 | + rows this week" is the card that adds `failed_count`, mirroring |
| 45 | + `unmeasured_count` (null on rows written before the column existed, never |
| 46 | + `0`) — one column on an ADR-0103 engine-owned object, a human-floor change. |
| 47 | +- `ObjectStoreSuspendedRunStore`'s terminal-row write, where a fifth |
| 48 | + `record.summary?.failed ?? null` line would go, points at that verdict so the |
| 49 | + question is not re-derived from the write site either. |
| 50 | + |
| 51 | +No schema shape moves: no field is added, removed or renamed, no type or |
| 52 | +`required` flag changes, and the accepted set of every object and payload is |
| 53 | +byte-for-byte what it was. `sys-automation-run-failed-count-verdict.test.ts` |
| 54 | +pins both halves — that there is still no `failed_count` (or any other |
| 55 | +`fail`-named) column, and that `summary_json`'s description still names |
| 56 | +`failed` — so the explanation cannot rot into a claim the schema no longer |
| 57 | +supports. |
0 commit comments