Repository navigation
feat(distiller)!: run on a mail trigger instead of the unimplemented schedule trigger - #49
Merged
Merged
Conversation
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
commented
Sep 22, 2026
TheGreatAxios
left a comment
Contributor
Author
There was a problem hiding this comment.
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) onCreateResidentDistillerOpts, changing the workflow's trigger shape. Every prior breaking change to this package's public surface got an### Unreleased/ Breaking: entry (see the existingknowledge→memoryschema rename, theDATABASE_URLrename, 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 removedRESIDENT_DISTILLER_CRON_DEFAULTexport are mechanical and consistent across all four files.- README's new resident-distiller section and the
TenantEnvimport fix in the workflow-memory mount example both check out against the current API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@intx/workflow'sscheduletrigger is reserved with no schedulerbehind it: under 0.3.0
defineWorkflowaccepted it silently and theworkflow just never ran; 0.4.0 throws at
defineWorkflowinstead.corbits-memoryowns no clock, socreateResidentDistillernowdefines a
mailtrigger — the deployed run fires on the first inboundmail at a host-supplied address. Ticking (deciding when to mail that
address, e.g. via
@corbits/cron) is entirely the host's job.CreateResidentDistillerOptsdropscron(optional, defaulted) andadds
mailTo: string(required — the full mail address the runlistens at).
RESIDENT_DISTILLER_CRON_DEFAULTis removed with noreplacement (the address is host-specific).
@intx/*deps moved to0.4.0(each kept its existing caret range).mailToand showsa host-generic tick pattern (e.g.
@corbits/cron), plus a fix for apre-existing missing
TenantEnvimport in the workflow-memory mountexample, found while verifying every README
tsfence compiles.Test plan
bun run typecheck— cleanbun run test— 451 pass, 0 fail (baseline on main/0.3.0 was450/450; net +1 from the added "no cron field" assertion, no
tests removed)
tscode fence compiled against a scratch tsconfigmapping
@corbits/memory*tosrc; scratch files deleted afterFixes CL-8798.
Part of CL-8797.