Run the universe-bible describe/render actions as on-demand scheduled tasks - #6394
Merged
Conversation
…#6376) The two programmatic Quota Burn actions — filling blank universe bible sheets and rendering the entries that have no image — were reachable only from a burn plan. They are now ordinary on-demand scheduled tasks: they appear in CoS → Schedule with their own settings and a Run Now button, and Quota Burn dispatches the same handler rather than a private executor. The implementations move to server/services/scheduledHandlers/, and quotaBurnJobs' JOB_MODULES points at them, so there is one implementation instead of a quota-only copy that drifts. Passing the burning family is what pins the provider / render backend to the subscription being drained; a manual run has no family and resolves like any other scheduled task — the task's own pin, else the install's active provider and the universe-bible render-target ladder. Both ship enabled with no interval and no cron, so they are never clock-due and a fresh install spends nothing until someone presses Run. The side-effect-free probe and its opaque probe→run context handoff are preserved: probing writes nothing, enqueues nothing, and calls no provider, and a run without probe context still does its own scan.
atomantic
force-pushed
the
claim/issue-6376
branch
from
September 6, 2026 15:20
f1d4021 to
3b1e1c7
Compare
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
server/services/scheduledHandlers/;quotaBurnJobs'JOB_MODULESpoints at them, so there is one implementation, not a quota-only copy that drifts.JOB_MODULESitself stays (retiring it is Migrate legacy Quota Burn prompt plans to scheduled-task references and retire JOB_MODULES #6381).familyis the discriminator: present ⇒ the provider / render backend is pinned to the subscription being drained (a family that can't be pinned is refused, never redirected); absent ⇒ an ordinary run resolves like any other scheduled task (the task's own pin, else the install's active provider and the universe-bible render-target ladder).resolveDescribeProvider/resolveRenderModenow return{ value, reason }so "nothing pinned" can't collapse into "refuse to spend".ON_DEMAND, with no interval and no cron — never clock-due, so a fresh install spends nothing until someone presses Run. ShippedtaskMetadataparams mirror the Quota Burn catalog row (guarded by a parity test) and are allow-listed insanitizeTaskMetadata.contexthandoff are preserved: probing writes nothing, enqueues nothing, and calls no provider; a run withcontext: undefinedstill does its own scan.docs/QUOTA-BURN.mdupdated for the moved paths and the "add a new programmatic action as a scheduled handler" guidance.Test plan
cd server && npm test— 2012 files / 39,990 tests pass, including the import-scoping budget.cd client && npm test— 870 files / 10,585 tests pass.taskSchedule.test.js— both types are enabledON_DEMANDwith no cadence, never due however much time has passed, refuse a managed-app target, and carry no prompt template.taskScheduleRegistry.programmatic.test.js— the type list matches the handler registry,JOB_MODULESresolves to the same module object, shipped params match the burn catalog and survive sanitization, and out-of-contract params are dropped.scheduledHandlers/universeBible{Describe,Images}.test.js— carried over unchanged, plus probe→run context reuse (asserted by counting the universe walk), a run with no context, a probe that writes/enqueues/prompts nothing, and the no-family scheduled path.cosTaskGenerator.programmaticOnDemand.test.js— the manual path runs the handler once with the task's saved settings andforce: true, clears without running when the type is disabled or Improve is off, reports its outcome, leaves agent types alone, and skips when the sibling engine already claimed the request.RunTaskButton/PromptEditor/useOnDemandTaskToastclient cases for the three UI surfaces.Closes #6376