Repository navigation
fix(runtime): table and file mutations now stop at their logged deadline - #357
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. Removing the integration-only condition reuses the existing SpecNo merge-blocking intent findings. Mutations now use Verification: Summary: Standards 0 blockers; Spec 0 blockers. No blocking issue in either axis. |
|
Reviewed StandardsThe diff follows the Effect service spec, the wire-contract mirror, and the test house style. No hard violations, and no baseline smell worth acting on.
The new test copies the neighboring integration-timeout case. Copying the suite next to it is the house style. It checks status 504, code No CLI command, skill, or product doc described the old "logged but not enforced" behavior. The shell's existing 35-second abort in SpecIssue 317 is implemented as specified. I found no missing requirement, no extra behavior, and no wrong implementation. The issue says a mutation's File mutations use that path. The issue says this fiber timeout is one of three places a future hosted mutation must enforce the deadline, and that the fix for this issue is this timeout. The MethodOne
A table write interrupted this way rolls back through the existing transaction finalizer, and the pool cancels the in-flight statement. A file PUT interrupted during
The company database still sets YAGNIThis is the small change. The branch that timed out only integrations is gone. There is no new type, helper, config, or error. Both new doc sentences are the behavior change, and both files had to move because I would keep the one-line comment. It states the invariant this bug was: the number in the log is the number that stops the call. I would not add a second test that hangs Standards has 0 findings. Spec has 0 findings. Nothing on either axis to change. Reviewed by Grok 4.7 via Grok Build. |
|
Both reviews (Astra and Grok) are clean on Things raised in passing that I left alone:
Checks on |
3558237 to
3c35c41
Compare
…eadline Mutations logged PATCHY_RUNTIME_MUTATION_DEADLINE_MS as their deadline but only integration calls were wrapped in the timeout, so a mutation could keep running after its log row read as unknown. Every logged call now runs under the same timeoutOrElse, failing `timeout` (504) at the deadline its log records. Closes #317 Co-Authored-By: Claude Opus 5.5 <[email protected]>
7d84a29 to
13b39dd
Compare
…umn (#359) Stacked on #357 (branch fix/317-runtime-mutation-deadline). If a table had user columns named `ok` (set to `true`) and `rows`, `tables.insert`, `tables.get` and `tables.update` returned a 200 without the row's `id`, timestamps or other columns. The generated API client's `call` dropped them the same way on decode. The stored row was fine, but a tool couldn't use the returned id for its next update or delete. Closes #320. `RuntimeSuccess` in `packages/api` described `value` as a union of every operation's response. `RuntimeApi` encoded through that union after `Runtime.handler` had already encoded the value with its own operation's schema, and the client decoded through it. In both steps the Postgres `{ ok, rows }` struct matched first and dropped the row's other keys. `RuntimeSuccess`'s `value` is now `Schema.Json`, and the server and client both use that shared schema. Each operation is still validated in `Runtime.handler`, and the wire shape is unchanged. `docs/API.md` is regenerated, so `RuntimeSuccess.value` now renders as `unknown`. The endpoint description already lists what each operation returns. Tests: - New `RuntimeApi` test: real per-operation `Runtime.handler` codecs for `tables.insert`, `tables.get` and `tables.update` return the ticket's row. The test calls each one through a client built from the real `RuntimeGroup` and requires the decoded result to keep every column. It failed on the private-envelope commit with only `ok` and `rows` left after decode. - The boundary test used to rely on the union rejecting a raw `true` from a handler that skips `Runtime.handler`. It now returns `1n` and checks that a value that isn't JSON is still a 503 `source_unavailable`. - `pnpm typecheck` and `pnpm lint` are clean. In a full `pnpm test` at load average 8, 7 tests in 4 unrelated files failed: two were confirmed 5s timeouts, and I didn't check the others' reasons. None of the four files goes through this path, and together they pass when run alone (214/214). Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).
Stacked on #356 (branch fix/328-runtime-body-cap).
Table and file mutations logged a 30-second deadline but nothing enforced it. Only integration calls had a timeout, so a mutation could keep running after its own log row already read
unknown. Tier 2 will hold company-database transactions open for a hosted mutation, and that plan counts on this deadline being real.Every logged call now runs under the same
timeoutOrElse. The timeout uses thedeadlineMsthat goes into the runtime log, so a mutation pastPATCHY_RUNTIME_MUTATION_DEADLINE_MSfails withtimeout(504) and its log row recordsfailure/timeout. Behaviour change: a file PUT is logged before its body is read, so the upload itself now has to finish inside the 30-second (configurable) mutation deadline.docs/API.mdsays so. TheTimeoutmessage no longer says "integration".Tests:
Runtime.test.tscase: a never-returningtables.insertwith a 5 s configured deadline gets a 504timeoutat exactly 5,000 ms, its handler is interrupted, and the log row hasdeadlineMsanddurationMsof 5,000. On the unmodified code the call never returned.pending→unknown. Its old version advanced past the deadline first, which only worked because the deadline wasn't enforced.pnpm typecheckandpnpm lintare clean.pnpm test: 944/945. The one failure was a 5 s timeout inintegrations/src/postgres/Runtime.test.tswhile other test runs were loading the machine; it passes when run alone.Closes #317
Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).