feat(coven): page one automation's run history - #333
Merged
Merged
Conversation
Add automations.runHistory(automationId, { limit, cursor, occurrenceId })
over coven.automations.run.history.v1 as an sdk-core Page, and
iterateRunHistory() on iteratePages. Cursors are validated to the spec's
256-character bound before transport I/O; pages that cross automations or
occurrences, break newest-first instant order, or misreport the cursor are
refused. The cursor, instant-order and byte-cap helpers move to a shared
automations-history module used by both history reads.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8 tasks
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the trimmed-ID byte validation and malformed iterator-filter validation issues.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds capability-gated, paginated automation run-history APIs with occurrence filtering, shared validation, transport limits, tests, and documentation.
Changes:
- Adds
runHistory()anditerateRunHistory(). - Shares cursor, ordering, and response-size validation.
- Updates transports, types, tests, README, API baseline, and changeset.
| File | Summary |
|---|---|
tests/coven-automations.spec.ts |
Run-history behavior and validation tests |
tests/coven-automations-platforms.spec.ts |
Unix/Windows size-cap tests |
packages/coven/src/index.ts |
Public type exports |
packages/coven/src/automations.ts |
Client history APIs |
packages/coven/src/automations-socket.ts |
History response limits |
packages/coven/src/automations-runs.ts |
Run-history types and decoding |
packages/coven/src/automations-occurrences.ts |
Shared validation integration |
packages/coven/src/automations-history.ts |
Shared history validation |
packages/coven/src/automations-definitions.ts |
Request and response handling |
packages/coven/README.md |
Consumer documentation |
api-baselines/coven.d.ts |
Public API baseline |
.changeset/coven-run-history.md |
Release notes |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+182
to
+183
| const identifier = (value: unknown): value is string => typeof value === 'string' && | ||
| value.trim().length > 0 && Buffer.byteLength(value) <= 4_096 && value.isWellFormed(); |
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. This is the SDK consumer of the producer's new
run.history.v1(OpenCoven/coven#1160, part of coven#1054).What
automations.runHistory(automationId, { limit?, cursor?, occurrenceId? })over the capability-gatedcoven.automations.run.history.v1.Page:{ automationId, occurrenceId?, data, cursor }.id, each with attempts and any cancellation, validated exactly likeruns().automations.iterateRunHistory(automationId, BoundedPageOptions, { occurrenceId? }), built oniteratePages.{ action, automationId, limit, occurrenceId?, cursor? }, with trimmed ids of at most 4096 bytes, well-formed Unicode, and a canonical cursor of at most 256 characters (the spec bound).occurrenceIdecho, or a run of another occurrence;hasMoreornextinconsistencies, or nocurrentecho.automations-history.ts, used by both history reads. Occurrence history's behavior is unchanged, and its page cursor type is now the named, structurally identicalCovenAutomationHistoryCursor.Verification
pnpm verifypassed: 3054 tests, contracts, package, coverage, stress and lint.Content-Length: 262145yieldsbody_limit.🤖 Generated with Claude Code