Skip to content

Commit bf70dbf

Browse files
committed
docs(runtime): correct three untrue claims this branch wrote down
Round 2 on #15890, after review. Comment prose only — no executable line moves, the pin and its ablation are untouched and settled. 1. HISTORY. The previous commit on this branch wrote, of `ListRunsRequestSchema`, in `domains/automation.ts`: "has always declared it — as `ExecutionStatus.optional()`, the enum itself rather than a copy of its members" and in `query-param.ts`: "bounds it to `ExecutionStatus` itself — the enum, never a copy of its members" Both are FALSE of history, and — the whole lesson — the sentence the first one replaced was accurate. `ListRunsRequestSchema` declared `status` as an inline `z.enum(['pending', 'running', 'paused', 'completed', 'failed', 'cancelled', 'timed_out', 'retrying']).optional()` from the schema's introduction (`5e685a7d6f7`, 2026-02-21) until #7359 replaced that copy with `ExecutionStatus.optional()` — landed as `cf7c69421a7` (2026-08-11), in the same commit that made this boundary read the parameter. So "always" and "never" are both wrong: it was a copy of eight members for most of its life. Verified by `git show 5e685a7:packages/spec/src/api/automation-api.zod.ts`, `git show cf7c694^:` on the same path, and `git log -S` on that literal — which names exactly two commits, the introduction and #7359. Repairing the stale COUNT had introduced a falsehood about HISTORY, in a card whose entire subject is untrue claims about this vocabulary. Both sites now say what the line declares today AND when it started saying it. No count of the LIVE enum is minted; "eight" is a property of a deleted literal, frozen by `cf7c69421a7`, and it is what makes the sentence explain itself. 2. `TERMINAL_RUN_STATUSES`. The previous commit called it "a documented narrower subset" Measured in `plugin-approvals/src/approval-service.ts`, it is `{completed, failed, cancelled, timed_out}` — a set its own header calls "A CLOSED set, deliberately", whose dead-run sweep treats every other answer, an unknown status included, as ALIVE so an unrecognised state can never cost someone a live approval. That is a fail-safe default, not a narrowing anyone documented relative to `ExecutionStatus`. It was closed before `refused` existed, and `refused` — "Terminal, never resumed" — is not in it, so once lane 2 (#15788) makes a run reach that status, its still-pending approval reads as alive to that sweep. A reader of this vocabulary that has not learned the new member, owned by the `refused` lanes, not by this card. Corrected in the PR body; no tree text carried the wrong wording. 3. "#16414 landed hours ago" (previous commit and PR body). #16414 landed `0ea5f9d9f79` at 2026-09-06T21:22:02Z; the commit that said "hours" was authored 22:50:48Z the same day — 89 minutes by those two stamps, 66 by the review's anchor. Two anchors, two numbers, and the elapsed time was never load-bearing: the citation of #16414 stays, the time reference is dropped rather than replaced by a third number. Also corrected in the PR body, not in the tree: "No `dist` is on the resolved path" was true of the two ablation legs and false of the suite. Measured on a fresh worktree with nothing built — `pnpm --filter @objectstack/runtime exec vitest run src/domains/automation-runs-query-validation.test.ts` cannot collect the file at all: "Failed to resolve entry for package @objectstack/observability". `http-dispatcher.ts`, which the suite imports, imports that package; `packages/runtime/vitest.config.ts` has no alias entry for it; its `exports` map serves `./dist/index.js`. The two legs stay source-resolved and `ablation-dist-preflight` still does not apply to them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
1 parent 0887423 commit bf70dbf

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

packages/runtime/src/domains/automation.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,14 @@ export async function handleAutomationRequest(deps: DomainHandlerDeps, path: str
17961796
//
17971797
// [#7359] `status` is the THIRD declared parameter, and until
17981798
// now the only one this handler never read. `ListRunsRequestSchema`
1799-
// has always declared it — as `ExecutionStatus.optional()`, the
1800-
// enum itself rather than a copy of its members, so what the
1801-
// wire bounds the filter to is read from that vocabulary rather
1802-
// than restated here — but it had no slot on
1799+
// declares it as `ExecutionStatus.optional()` — the enum itself
1800+
// rather than a copy of its members — so what the wire bounds
1801+
// the filter to is read from that vocabulary rather than
1802+
// restated here. It has NOT always been spelled that way: from
1803+
// the schema's introduction until #7359 that line was an inline
1804+
// `z.enum([...]).optional()` copy of eight members, and #7359
1805+
// replaced the copy with the enum in the same change that made
1806+
// this boundary read the parameter. But `status` had no slot on
18031807
// `IAutomationService.listRuns` and was never built into this
18041808
// object, so `?status=failed` was dropped here, silently, and
18051809
// the caller was answered 200 with EVERY run of the flow capped

packages/runtime/src/query-param.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ export function parseIntegerParam(
177177
/**
178178
* A CLOSED-SET parameter — a filter whose declared values are an enum on the
179179
* wire (`?status=failed` on `GET /api/automation/:name/runs`, whose
180-
* `ListRunsRequestSchema` bounds it to `ExecutionStatus` itself — the enum,
181-
* never a copy of its members, so the bound is whatever that vocabulary
182-
* declares rather than a count fixed on the day this line was written).
180+
* `ListRunsRequestSchema` bounds it to `ExecutionStatus` itself — the enum
181+
* rather than a copy of its members, so the bound is whatever that vocabulary
182+
* declares rather than a count fixed on the day this line was written. #7359
183+
* put that spelling there, replacing an inline `z.enum([...])` copy of eight
184+
* members; until then the wire's bound WAS exactly such a fixed count).
183185
*
184186
* Written for #7359, which is the third shape in this module's family and the
185187
* one that fails widest. The other two are coercions that invent a value; this

0 commit comments

Comments
 (0)