Skip to content

feat(core): add spawned trigger type (#377)#380

Merged
edspencer merged 1 commit into
mainfrom
feat/trigger-type-spawned
Jul 18, 2026
Merged

feat(core): add spawned trigger type (#377)#380
edspencer merged 1 commit into
mainfrom
feat/trigger-type-spawned

Conversation

@edspencer

Copy link
Copy Markdown
Owner

Summary

Closes #377 (E2). Adds an explicit spawned value to TriggerTypeSchema so a host (e.g. paddock) can persist run provenance for agent-spawned jobs as a first-class enum rather than inferring it. Additive and backward-compatible — no behaviour change for existing headless fleets.

scheduled vs schedule

The ticket asks for spawned and, if not already covered, a distinct scheduled. The existing enum already has schedule, which is exactly the "triggered by a schedule" provenance — so a separate scheduled would be redundant. Only spawned is added.

Changes

  • @herdctl/corespawned added to TriggerTypeSchema (and therefore the exported TriggerType).
  • @herdctl/web — the job-history trigger-type icon/label map (JobHistory.tsx) renders spawned with a Bot icon labelled "Spawned"; the client TriggerType union in types.ts gains the value.
  • tests — extend the TriggerTypeSchema enum test to cover spawned (plus the previously-untested discord/slack/web), and add a full-schema parse of a spawned job.
  • changeset — minor bump for @herdctl/core + @herdctl/web.

Verification

  • pnpm typecheck — all 11 packages pass (includes the web build).
  • vitest run on job-metadata-schema.test.ts — 40 tests pass.
  • biome check — clean.

Supports paddock#267 (provenance badges).

Extend TriggerTypeSchema with an explicit `spawned` value so a host can
persist run provenance for agent-spawned jobs as a first-class enum rather
than inferring it. Additive and backward-compatible.

- core: `spawned` added to TriggerTypeSchema / TriggerType. `schedule`
  already covers scheduled runs, so no separate `scheduled` value is added.
- web: job-history trigger-type map renders `spawned` with a Bot icon
  labelled "Spawned".
- test: extend the TriggerTypeSchema enum test + a full-schema parse of a
  spawned job.

Supports paddock#267 (provenance badges).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@edspencer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44a31358-fd24-4729-aa1e-1f1750877074

📥 Commits

Reviewing files that changed from the base of the PR and between c1f5ebf and 7e0208d.

📒 Files selected for processing (5)
  • .changeset/trigger-type-spawned-377.md
  • packages/core/src/state/__tests__/job-metadata-schema.test.ts
  • packages/core/src/state/schemas/job-metadata.ts
  • packages/web/src/client/src/components/jobs/JobHistory.tsx
  • packages/web/src/client/src/lib/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/trigger-type-spawned

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@edspencer

Copy link
Copy Markdown
Owner Author

Reviewed 5 changed files (7 hunks); 0 findings.

@edspencer edspencer left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Additive, backward-compatible addition of a spawned value to TriggerTypeSchema plus its web-client mirror. Straightforward and low-risk.

I verified:

  • packages/core/src/state/schemas/job-metadata.tsspawned correctly appended to the Zod enum; no consumers rely on exhaustive matching that would break.
  • packages/web/src/client/src/lib/types.ts — the hand-maintained TriggerType union is kept in sync with the new value.
  • packages/web/src/client/src/components/jobs/JobHistory.tsxBot icon imported and mapped; the existing ?? map.manual fallback means unmapped values already degrade gracefully.
  • Tests extend the enum parse test and add a full spawned-job parse; the changeset (minor bump for core + web) is present and accurate.

Nothing to flag — the "no separate scheduled" reasoning in the PR body is sound since schedule already encodes that provenance.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying herdctl with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e0208d
Status: ✅  Deploy successful!
Preview URL: https://df268805.herdctl.pages.dev
Branch Preview URL: https://feat-trigger-type-spawned.herdctl.pages.dev

View logs

@edspencer
edspencer merged commit 822fdfb into main Jul 18, 2026
8 checks passed
@edspencer
edspencer deleted the feat/trigger-type-spawned branch July 18, 2026 03:30
@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
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.

Add spawned / scheduled values to TriggerTypeSchema

1 participant