Skip to content

feat(coven): read one automation run by id and filter occurrences by automation - #330

Merged
BunsDev merged 2 commits into
mainfrom
feat/coven-get-run-occurrence-filter
Sep 27, 2026
Merged

BunsDev merged 2 commits into
mainfrom
feat/coven-get-run-occurrence-filter

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 27, 2026

Copy link
Copy Markdown
Member

Part of #80 (Phase 1: getRun(runId) and occurrences(automationId, …)).

The producer landed in OpenCoven/coven#1156 at 552d827e0decebfc96181d31c5504113ac5e5c6f (closes coven#1155):

  • coven.automations.run.get.v1 { id } returns { run } with its attempts, read from one snapshot. It uses the same projection as occurrence.get.v1's runs, and returns { run: null } when the run is absent.
  • coven.automations.occurrence.list.v1 accepts an optional automationId. It is applied inside each view's query, so limit bounds that automation's rows. For eligible, it is applied inside the scheduler's own eligibility query.

SDK

  • automations.getRun(runId, operationOptions?) calls the exact advertised action. It validates the run with the same rules as an occurrence detail's nested runs:

    • exact run id, and the existing runsPayload checks;
    • at most ten attempts;
    • occurrenceId, revision, nullable digest, authority profile and timeout;
    • no cancellation projection.

    The occurrence-run field checks are now one shared function, so getOccurrence and getRun cannot drift.

  • automations.occurrences({ view, limit?, automationId? }) sends the trimmed filter.

    • The SDK refuses a filtered page that names any other automation.
    • An empty, blank or non-string filter is rejected before capability or transport I/O.
    • The allowlist in definitionReadBytes admits the new action and the optional field and nothing else.
  • Older producers. Both reads are capability-gated. A producer that does not advertise run.get.v1 yields capability_unsupported, never a fallback to another action.

  • Also: the README section is updated, CovenAutomationRunResult is exported, the packed API baseline is updated (exactly these additions), and a minor Changeset for @opencoven/coven-client is included.

Tests

tests/coven-automations.spec.ts covers:

  • the filtered request, with the trimmed filter sent;
  • refusal of a mixed page when filtered, while the same page is accepted unfiltered;
  • five malformed filters rejected before transport;
  • getRun success and explicit absence;
  • eight malformed-run cases: another id, no automation, no occurrence, bad revision, non-string digest or profile, a cancellation projection, and too many attempts;
  • no read when the action is not advertised.

Mutation check: disabling the filtered-page check fails its test.

Validation: full pnpm verify passes, 3003 passed and 2 skipped.

This does not change the frozen cd10a3f candidate, and it does not authorize publication.

🤖 Generated with Claude Code

…automation

Add automations.getRun(runId) over the capability-gated
coven.automations.run.get.v1 producer action, returning one run with its
attempts or { run: null }, validated with the same rules as an occurrence
detail's runs. Add an optional automationId to automations.occurrences();
the producer applies it inside each view's query, and the SDK refuses a
filtered page naming any other automation and rejects a malformed filter
before transport I/O. Both need a producer that advertises them
(OpenCoven/coven#1155); older producers yield capability_unsupported.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 27, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Transport parity coverage and the README action allowlist still need updating.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds capability-gated run lookup and per-automation occurrence filtering to the Coven SDK.

Changes:

  • Adds getRun() with validation and absence handling.
  • Adds trimmed automationId filtering and response checks.
  • Updates exports, documentation, API baseline, tests, and Changeset.
File Summary
tests/​coven-automations.spec.ts Tests filtering, run reads, validation, and capability gating.
packages/​coven/​src/​index.ts Exports the new run result type.
packages/​coven/​src/​automations.ts Implements client operations; moderate review note (1 vote) requests transport parity coverage.
packages/​coven/​src/​automations-occurrences.ts Adds filtering and shared run validation.
packages/​coven/​src/​automations-definitions.ts Updates request encoding and response decoding.
packages/​coven/​README.md Documents the new APIs; nit review note (2 votes) requests updating the action allowlist and count.
api-baselines/​coven.d.ts Updates the public API baseline.
.changeset/​coven-get-run-occurrence-filter.md Records the package release change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/coven/README.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@BunsDev
BunsDev merged commit e22d0b0 into main Sep 27, 2026
8 checks passed
@BunsDev
BunsDev deleted the feat/coven-get-run-occurrence-filter branch September 27, 2026 09:11
BunsDev added a commit that referenced this pull request Oct 3, 2026
The README still called the lock the unchanged historical pin that does
not certify coven#991/#999; it now names the v0.4.7 release producer,
whose contract includes them. The roadmap records the rebinding and
corrects two statements this program has since overtaken: individual
run lookup and per-automation history landed in SDK #330, #331 and
#333, and Coven persists rich definitions (coven#1185) that SDK #336
sends.

Refs #80

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BunsDev added a commit that referenced this pull request Oct 3, 2026
…ucer (#337)

* test(coven): pin the Automations v1 canary to the v0.4.7 release producer

The exact-artifact canary was still bound to Coven 8a796807, a
pre-release CI artifact with the 17-file contract (content 3c145eb9),
while every release since v0.4.4 ships content ef266d16 (19 files).
Coven's release runbook requires the SDK canary to consume the released
archive and its recorded SHA-256.

The lock, the exact-runtime CI reproduction and the pinned test values
now name the producer of the released v0.4.7 bundle: source c93a8a93,
CI run 37077748408 job 111071346442, artifact 11257472104, bundle
fcb084bd (byte-identical to the GitHub release asset and to a local
reproduction from the tag), manifest 976c9b70, content ef266d16. The
canary already supports the 19-file contract, so no SDK source changes.

Refs #80

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs: describe the rebound Automations pin instead of the historical one

The README still called the lock the unchanged historical pin that does
not certify coven#991/#999; it now names the v0.4.7 release producer,
whose contract includes them. The roadmap records the rebinding and
corrects two statements this program has since overtaken: individual
run lookup and per-automation history landed in SDK #330, #331 and
#333, and Coven persists rich definitions (coven#1185) that SDK #336
sends.

Refs #80

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants