Skip to content

feat(distiller)!: run on a mail trigger instead of the unimplemented schedule trigger - #49

Merged
TheGreatAxios merged 5 commits into
mainfrom
cl-8798-distiller-mail-trigger
Sep 22, 2026
Merged

TheGreatAxios merged 5 commits into
mainfrom
cl-8798-distiller-mail-trigger

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

@intx/workflow's schedule trigger is reserved with no scheduler
behind it: under 0.3.0 defineWorkflow accepted it silently and the
workflow just never ran; 0.4.0 throws at defineWorkflow instead.
corbits-memory owns no clock, so createResidentDistiller now
defines a mail trigger — the deployed run fires on the first inbound
mail at a host-supplied address. Ticking (deciding when to mail that
address, e.g. via @corbits/cron) is entirely the host's job.

  • CreateResidentDistillerOpts drops cron (optional, defaulted) and
    adds mailTo: string (required — the full mail address the run
    listens at). RESIDENT_DISTILLER_CRON_DEFAULT is removed with no
    replacement (the address is host-specific).
  • @intx/* deps moved to 0.4.0 (each kept its existing caret range).
  • README: new resident-distiller section documents mailTo and shows
    a host-generic tick pattern (e.g. @corbits/cron), plus a fix for a
    pre-existing missing TenantEnv import in the workflow-memory mount
    example, found while verifying every README ts fence compiles.

Test plan

  • bun run typecheck — clean
  • bun run test — 451 pass, 0 fail (baseline on main/0.3.0 was
    450/450; net +1 from the added "no cron field" assertion, no
    tests removed)
  • Every README ts code fence compiled against a scratch tsconfig
    mapping @corbits/memory* to src; scratch files deleted after

Fixes CL-8798.
Part of CL-8797.

createResidentDistiller should address itself via a mail trigger
(type: "mail", to: <address>) instead of the reserved, unimplemented
schedule/cron trigger. Red until the implementation catches up.
Keeps each dependency's existing caret range style.
…schedule trigger (CL-8798)

@intx/workflow's schedule trigger is reserved with no scheduler behind
it — under 0.3.0 defineWorkflow accepted it silently and the workflow
never ran; 0.4.0 now throws at defineWorkflow. corbits-memory owns no
clock, so createResidentDistiller now defines a mail trigger instead:
the deployed run fires on the first inbound mail at the address the
host supplies. Ticking (deciding when to mail that address, e.g. via
@corbits/cron) is entirely the host's responsibility.

BREAKING CHANGE: CreateResidentDistillerOpts drops `cron` (optional,
defaulted to every 5 minutes) and adds `mailTo` (required, the full
mail address the workflow's run listens at). The resulting
WorkflowDefinition's trigger is `{ type: "mail", to }` instead of
`{ type: "schedule", cron }`. RESIDENT_DISTILLER_CRON_DEFAULT is
removed; there is no replacement default since the address is
host-specific (domain unknown to this package).
Add a resident-distiller section with the new mailTo option and a
host-generic example of ticking it (e.g. a @corbits/cron schedule
whose delivery mails the distiller's address). Also fixes a missing
TenantEnv import in the pre-existing workflow-memory mount example
(caught while verifying every README ts fence compiles).

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review · Request changes

createResidentDistiller now defines a mail trigger instead of the unimplemented schedule trigger; CreateResidentDistillerOpts.cron is replaced by a required mailTo, and ticking the deployed workflow becomes the host's job.

Confirmed against node_modules/@intx/workflow/dist/definition/triggers.d.ts: ScheduleTrigger is documented RESERVED/NOT IMPLEMENTED in 0.4.0 and MailTrigger is the real mechanism — the change matches the underlying library exactly. bun run typecheck and bun run test are clean (451/451). No dangling references to the removed RESIDENT_DISTILLER_CRON_DEFAULT remain in src or docs.

Findings

  • CHANGELOG.md — the PR removes a public option (cron) and adds a required one (mailTo) on CreateResidentDistillerOpts, changing the workflow's trigger shape. Every prior breaking change to this package's public surface got an ### Unreleased / Breaking: entry (see the existing knowledge→memory schema rename, the DATABASE_URL rename, the grant-action renames). This PR's breaking change to the distiller options isn't recorded anywhere in the changelog.

Notes

  • src/distiller/workflow.ts, constants.ts, index.ts, src/index.ts: the schedule→mail swap and the removed RESIDENT_DISTILLER_CRON_DEFAULT export are mechanical and consistent across all four files.
  • README's new resident-distiller section and the TenantEnv import fix in the workflow-memory mount example both check out against the current API.

@TheGreatAxios
TheGreatAxios merged commit ee59ac5 into main Sep 22, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-8798-distiller-mail-trigger branch September 22, 2026 05:58
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.

1 participant