Skip to content

[PLT-2917] feat: expose toolkit trigger declarations - #909

Draft
TheMostlyGreat wants to merge 20 commits into
mainfrom
codex/k3wq7n-trigger-declarations-rebased
Draft

TheMostlyGreat wants to merge 20 commits into
mainfrom
codex/k3wq7n-trigger-declarations-rebased

Conversation

@TheMostlyGreat

@TheMostlyGreat TheMostlyGreat commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add validated trigger declaration models to arcade-core
  • serve declarations from the authenticated GET /worker/triggers endpoint
  • discover <toolkit>.trigger_types.trigger_types automatically
  • carry declarations through ToolCatalog into the integrated MCP worker
  • preserve compatibility for toolkits and workers without trigger support

Verification

  • 150 focused core/catalog/worker tests pass
  • Ruff passes on changed files
  • MyPy passes on changed source files
  • clean Python 3.10 wheel smoke test exposes servicetitan.job.completed through /worker/triggers

Tracks the SDK/worker portion of Arcade monorepo ticket J95ZCA.


Note

Medium Risk
New worker API surface and load-time validation can block toolkit startup on bad trigger declarations or slug collisions across toolkits; auth behavior on /worker/triggers must match other worker routes.

Overview
Adds toolkit-declared trigger types end to end: a new TriggerType model in arcade-core (webhook/poll metadata, JSON Schema validation for config/payload, duplicate-slug checks at load time) plus optional auto-load from <package>.trigger_types.

ToolCatalog now merges trigger types when toolkits are registered, rejects duplicate slugs as ToolkitLoadError, and skips trigger accumulation when a toolkit is disabled via ARCADE_DISABLED_TOOLKITS (disabled-toolkit matching now uses toolkit.name instead of str(toolkit)).

arcade-serve exposes authenticated GET /worker/triggers (default empty list for workers that do not override get_trigger_types). The integrated MCP worker forwards catalog.trigger_types after startup. Package bumps: arcade-core 4.11.1 (+ jsonschema), arcade-serve 3.4.3, arcade-mcp-server 1.26.1.

Reviewed by Cursor Bugbot for commit 900c42b. Bugbot is set up for automated code reviews on this repo. Configure here.

TheMostlyGreat and others added 15 commits August 15, 2026 15:04
…validation naming the field (K3WQ7N)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s validation naming the slug (K3WQ7N)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…WQ7N GREEN)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…fails declaration validation (K3WQ7N)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion time (K3WQ7N GREEN)

Adds the reference jsonschema lib to arcade-core; validator_for +
check_schema rejects malformed schemas inside pydantic field validation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…with complete fields (K3WQ7N)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (K3WQ7N GREEN)

TriggerTypesComponent beside CatalogComponent; object envelope
{trigger_types: [...]} so the surface can grow, unlike the bare-array
/worker/tools response. register_trigger_types validates the combined
set across toolkits. Route-inventory test gains the new default route.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…[]} (K3WQ7N)

Behavior emerged with d997742's minimal GREEN; pinned here as a regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…401 (K3WQ7N)

Auth rides the route-default JWT middleware from d997742; pinned as a regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ort serve an empty envelope (K3WQ7N)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lope (K3WQ7N GREEN)

Non-abstract so existing third-party Worker implementations keep
working — the additive-capability pattern Router.add_mount already
establishes. No-trigger workers serve {trigger_types: []}.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.19048% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/arcade-core/arcade_core/toolkit.py 80.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
libs/arcade-core/arcade_core/catalog.py 91.66% <100.00%> (+0.47%) ⬆️
libs/arcade-core/arcade_core/triggers.py 100.00% <100.00%> (ø)
libs/arcade-mcp-server/arcade_mcp_server/worker.py 68.22% <100.00%> (+0.14%) ⬆️
libs/arcade-serve/arcade_serve/core/base.py 97.91% <100.00%> (+1.40%) ⬆️
libs/arcade-serve/arcade_serve/core/common.py 86.95% <100.00%> (+1.95%) ⬆️
libs/arcade-serve/arcade_serve/core/components.py 100.00% <100.00%> (ø)
libs/arcade-core/arcade_core/toolkit.py 65.02% <80.00%> (+1.18%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds validated toolkit trigger declarations and exposes them through the authenticated worker API while preserving compatibility with workers that do not support triggers.

  • Discovers and validates toolkit trigger declarations, including both configuration and payload schemas.
  • Aggregates declarations through ToolCatalog and registers them with the integrated MCP worker.
  • Adds GET /worker/triggers and an empty-envelope fallback for older worker implementations.
  • Bumps package versions and inter-library dependency floors to versions containing the new APIs.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
libs/arcade-core/arcade_core/triggers.py Defines trigger declaration models and validates both configuration and payload JSON schemas, completing the prior schema-validation fix.
libs/arcade-core/arcade_core/toolkit.py Discovers conventional toolkit trigger declaration modules and converts their entries into validated models.
libs/arcade-core/arcade_core/catalog.py Aggregates toolkit trigger declarations while rejecting duplicate slugs.
libs/arcade-serve/arcade_serve/core/base.py Registers validated trigger declarations and exposes them through the worker interface.
libs/arcade-serve/arcade_serve/core/components.py Adds the worker trigger-declaration endpoint component.
libs/arcade-mcp-server/arcade_mcp_server/worker.py Carries catalog trigger declarations into the integrated worker.
libs/arcade-mcp-server/pyproject.toml Raises dependency floors to package versions containing the trigger APIs, completing the prior compatibility fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Toolkit trigger_types.py] --> B[Toolkit discovery and validation]
    B --> C[ToolCatalog aggregation]
    C --> D[Integrated MCP worker registration]
    D --> E[Authenticated GET /worker/triggers]
    F[Worker without trigger support] --> G[Empty trigger_types envelope]
Loading

Reviews (2): Last reviewed commit: "style(triggers): format declaration load..." | Re-trigger Greptile

Comment thread libs/arcade-core/arcade_core/triggers.py Outdated
Comment thread libs/arcade-mcp-server/arcade_mcp_server/worker.py
Comment thread libs/arcade-core/arcade_core/toolkit.py
@TheMostlyGreat
TheMostlyGreat marked this pull request as draft August 15, 2026 23:17
@TheMostlyGreat TheMostlyGreat changed the title feat: expose toolkit trigger declarations [PLT-2917] feat: expose toolkit trigger declarations Aug 15, 2026
@TheMostlyGreat

Copy link
Copy Markdown
Contributor Author

Addressed all three review findings in 38c8d09: both JSON Schemas now validate at load time, trigger imports use the resolved package name, and all changed libraries have publishable patch versions with dependency floors matching the new APIs. Added regression coverage; 99 focused tests, Ruff, and mypy pass locally.

@TheMostlyGreat
TheMostlyGreat marked this pull request as ready for review August 22, 2026 01:43
Comment thread libs/arcade-core/arcade_core/catalog.py Outdated

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 30fe91c. Configure here.

Comment thread libs/arcade-core/arcade_core/catalog.py

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@TheMostlyGreat
TheMostlyGreat marked this pull request as draft September 6, 2026 05:39
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has had no activity for 14 days. It will be closed in 14 days if no further activity occurs. If this is still relevant, please leave a comment or remove the stale label.

@github-actions github-actions Bot added the stale label Sep 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant