Skip to content

feat(serve): webhook routes that fire cron jobs (HMAC, idempotency, filters) #582

Closed

Description

@ajianaz

What problem does this solve?

Event-driven work (a PR gets a review, a monitor fires) should start a job immediately instead of polling, without opening an unauthenticated, injectable endpoint.

Proposed solution

POST /hooks/<route> on tole serve (no new server), per docs/automation-design.md §6, following Hermes' route model minus chat delivery:

  • Auth required: HMAC-SHA256 over <timestamp>.<body> with ±300 s window; GitHub X-Hub-Signature-256 compatibility; a route without a secret refuses to load; unauthenticated only on loopback.
  • Body cap before read, per-route rate limit, constant-time compare, idempotency by delivery id persisted as hook_seen (survives restarts).
  • events allowlist and declarative filters (equals/contains/in/regex/exists, all/any/not) run before any LLM work; non-matching → 200 ignored.
  • Action: fire an existing job (cron_job) with the rendered template as transient context; 202.
  • Payload is untrusted: narrow {dot.path} templates inside an untrusted-data fence; webhook runs are ReadOnly by default; wider tools only by manual config edit.
  • tole hook add|list|remove|test.
  • Later (not this issue): coalescing, script transforms.

Alternatives considered

A separate webhook server (more surface); delivering payloads straight into a session (no job/allowlist boundary).

Are you willing to contribute the implementation?

Yes, I can do it

Before submitting

  • I searched existing issues and didn't find a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions