Found while implementing #14094. Independent of that card's fix, which lands in packages/runtime; this one is the example app that still ships the pattern the fix supersedes.
Measured
examples/app-showcase/src/automation/jobs/sweep-project-health.ts holds its engine handle in a module-scope let host, filled by an exported bindShowcaseJobRuntime(ctx) that objectstack.config.ts calls from onEnable. When host is unset the handler logs no engine handle bound yet — skipping this run and returns.
That binding does not exist on the artifact path. objectstack build emits functions into a sibling runtime module exporting only { functions, meta }; the artifact JSON carries no onEnable, and mergeRuntimeModule (packages/runtime/src/load-artifact-bundle.ts) merges only functions. So on an artifact-served boot bindShowcaseJobRuntime is never called, host stays undefined, and showcase_health_sweep fires on schedule and recomputes nothing — reported as a clean run.
Why it is worth fixing now
A scheduled job is one of the capabilities the showcase exists to demonstrate end to end, and #4774 / #4888 already had to repair this same job once for being declared-but-inert. It is also the only shipped defineJob in the repo, so it is what an author copies.
Shape of the fix
Since #14094 the job handler's context carries ql and logger (JobHandlerContext, exported from @objectstack/runtime). Take both from the argument, delete bindShowcaseJobRuntime and its onEnable call, and keep effect: 'writes' on the functions entry. healthFor is already engine-free and its unit test is unaffected; the handler's own test needs the fake host swapped for a fake context.
Unassigned and untriaged.
Generated by Claude Code
Generated by Claude Code
Found while implementing #14094. Independent of that card's fix, which lands in
packages/runtime; this one is the example app that still ships the pattern the fix supersedes.Measured
examples/app-showcase/src/automation/jobs/sweep-project-health.tsholds its engine handle in a module-scopelet host, filled by an exportedbindShowcaseJobRuntime(ctx)thatobjectstack.config.tscalls fromonEnable. Whenhostis unset the handler logsno engine handle bound yet — skipping this runand returns.That binding does not exist on the artifact path.
objectstack buildemitsfunctionsinto a sibling runtime module exporting only{ functions, meta }; the artifact JSON carries noonEnable, andmergeRuntimeModule(packages/runtime/src/load-artifact-bundle.ts) merges onlyfunctions. So on an artifact-served bootbindShowcaseJobRuntimeis never called,hoststaysundefined, andshowcase_health_sweepfires on schedule and recomputes nothing — reported as a clean run.Why it is worth fixing now
A scheduled job is one of the capabilities the showcase exists to demonstrate end to end, and #4774 / #4888 already had to repair this same job once for being declared-but-inert. It is also the only shipped
defineJobin the repo, so it is what an author copies.Shape of the fix
Since #14094 the job handler's context carries
qlandlogger(JobHandlerContext, exported from@objectstack/runtime). Take both from the argument, deletebindShowcaseJobRuntimeand itsonEnablecall, and keepeffect: 'writes'on thefunctionsentry.healthForis already engine-free and its unit test is unaffected; the handler's own test needs the fake host swapped for a fake context.Unassigned and untriaged.
Generated by Claude Code
Generated by Claude Code