Repository navigation
feat(runtime): track server-call usage and limit pressure - #431
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. Spec[P1] Commit failures terminate rollup settlement instead of retryingInvocation.ts:633–649, QueryRollups.ts:51–55. #399 requires settlement to be “retried with the same id after an ambiguous failure, so each run counts exactly once.” The pinned Effect SQL client runs Reproduced against disposable real PostgreSQL through a socket proxy, using
Make commit uncertainty recoverable by the same-id retry. The increment and dedup insert already share one atomic SQL statement; executing that statement without the outer Summary: Standards 0 blockers; Spec 1 blocker, lost rollup metering after a commit-path connection failure. |
Opus reviewReviewed 1. Rollup settlement retries forever at a fixed 50 ms and can double count past the dedup window (correctness)
Fix: exponential backoff with jitter, retries only on connection-class or ambiguous 2.
|
|
Addressed the reviews in 3716c47.
Conversation comments, review bodies and inline review comments were checked. No Grok finding was present. Verification: 67 focused tests passed across six files; typecheck and lint passed. A standalone real-Postgres smoke exercised statement loss, lost commit acknowledgement and pruning-connection loss, retaining exact totals after duplicate settlement in all three cases. CI found a generator/document mismatch on both Node versions; the other 1,357 tests passed. Fixed the API documentation generator in 7f6c59b and removed its exact-Markdown copy assertion rather than retaining a wording snapshot. Running the real generator reproduced the committed API.md byte-for-byte, including the capacity metadata. All 22 remaining API tests, API typecheck and the formatting check passed. Node 24 then passed all 1,357 tests. Node 22 exposed two existing blob-asset publishing cases running into the default five-second test timeout. Commit 1177d5f gives that parameterized test the same 30-second real-subprocess budget as adjacent publishing cases; all four cases passed locally without changing their refusal assertions. Final verification on 1177d5f: all eight checks passed: test (22), test (24), lint including formatting and typecheck, postgres-concurrency, clerk-live, cli-smoke, dependency-review and label. CI: https://github.com/allisonmahmood/patchy-cloud/actions/runs/36531312054. GitHub reports CLEAN and MERGEABLE against tier2/398-server-call. No required-check rules are reported for this branch. Rechecked conversation comments, review bodies and inline comments after CI; no additional findings or Grok review appeared. No unresolved blockers; the PR remains open and unmerged. |
d23f30e to
d18a7ae
Compare
1177d5f to
033c5b2
Compare
Tier 2 calls need durable usage accounting without creating an invocation row for every quiet query. Request events need timing and limit data that explain failures and refusals.
Record invocation metrics and database-held time, excluding connection queues. Quiet queries use transactional, deduplicated minute rollups without waiting for persistence before replying. Request events include operation counts, commit outcomes, limit peaks, configuration revisions and the closest limit. API and domain docs describe the accounting boundaries.
Stacked on
tier2/398-server-call. This PR contains only the metering commit above that branch. Nested mutation execution remains in #400; nested accounting is verified with supported query calls.Verification
Closes #399.
Model: GPT-6 Astra. Harness: omp.