feat(coven): page one automation's occurrence history - #331
Merged
Merged
Conversation
Add automations.occurrenceHistory(automationId, { limit, cursor }) over
coven.automations.occurrence.history.v1, returning an sdk-core Page, and
iterateOccurrenceHistory() on iteratePages. Cursors are validated before
transport I/O; pages that cross automations, break newest-first order,
repeat rows, misreport hasMore/next or fail to echo the requested cursor
are refused. History responses get their own 256 KiB cap.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Normalize the automation ID before byte-limit validation and update the README action list.
Review effort: Lite
Findings: None
What changed in this PR
Adds paginated occurrence-history reads and bounded iteration for Coven automations, with validation, transport limits, tests, documentation, and API updates.
Changes:
- Adds
occurrenceHistory()anditerateOccurrenceHistory(). - Adds cursor, ordering, identity, and response validation.
- Adds 256 KiB Unix/Windows transport support.
- Updates exports, tests, documentation, API declarations, and changeset.
| File | Description |
|---|---|
tests/coven-automations.spec.ts |
Tests history behavior and validation. |
tests/coven-automations-platforms.spec.ts |
Tests platform parity and byte caps. |
packages/coven/src/index.ts |
Exports history types. |
packages/coven/src/automations.ts |
Adds history APIs. |
packages/coven/src/automations-socket.ts |
Applies history response limits. |
packages/coven/src/automations-occurrences.ts |
Defines history types and page validation. |
packages/coven/src/automations-definitions.ts |
Adds request/response support and size validation. |
packages/coven/README.md |
Documents the new APIs and transport allowlist. |
api-baselines/coven.d.ts |
Updates public declarations. |
.changeset/coven-occurrence-history.md |
Records the minor release. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #80: the per-automation occurrence history read, which is the last Phase 1 read. The producer side is OpenCoven/coven#1158 (closes coven#1157).
What
automations.occurrenceHistory(automationId, { limit?, cursor? }, options?)coven.automations.occurrence.history.v1action.Page:{ automationId, data, cursor: { hasMore, current?, next? } }.scheduledForthenid.automations.iterateOccurrenceHistory(automationId, BoundedPageOptions)iteratePages, so it needsmaxPagesor a caller-ownedsignal.timeoutMsbounds the whole walk.definitionReadBytesnow allows nine actions. The history request is exactly{ action, automationId (trimmed, ≤4096 B, well-formed), limit 1–100, cursor? }, and the cursor must be canonical unpadded base64url of at most 512 characters, the same rulenormalizePageOptionsapplies.limitrows, or repeats a row;hasMorecomes without a freshnext, or on a short page;nextcomes withouthasMore, or the cursor has unknown fields;current, orcurrentappears on a first page.limitabove roughly 35.Verification
pnpm verifypassed (typecheck, 3033 tests, contracts, package, coverage, stress). Lint was fixed afterwards; lint, typecheck and the automations specs were re-run and are green.currentecho check fails 3 cases.Content-Length: 262145yieldsbody_limit.🤖 Generated with Claude Code