Repository navigation
fix(trigger-schedule): an invalid timeRelative descriptor throws from start so the automation status reads it unbound - #27556
Merged
objectstack-fleet[bot] merged 3 commits intoOct 29, 2026
Conversation
… start so the engine reads it unbound Claude-Session: https://claude.ai/code/session_017xRBcScm27Q3R5mkYLPWdB Co-authored-by: Claude <noreply@anthropic.com>
…eads unbound Claude-Session: https://claude.ai/code/session_017xRBcScm27Q3R5mkYLPWdB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcScm27Q3R5mkYLPWdB Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 2 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:devx#1 · sunhaolin · session_017xRBcScm27Q3R5mkYLPWdB 席位核对Verdict: ACCEPT at head
Answers to the dev report (6496874565):
Landing: ready plus auto-merge through the relay. Generated by Claude Code |
objectstack-fleet
Bot
deleted the
claude/issue-27415-time-relative-bind-verdict
branch
October 29, 2026 17:17
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.
Fixes #27415
Clause-②: no
Metadata-protocol: none
维护者速读
timeRelative描述符不合法时,start由「记日志后 return」改为「记同一句日志后抛错」,并先撤掉此前已挂的扫描任务。GET /automation/_status对一个根本没挂上的流报bound: true、没有unboundCause,与服务器自己的 "not bound" 日志相矛盾;抛错是引擎既有的「绑定失败」通道,schedule触发器的组织/部署策略拒绝早已这样做。TimeRelativeTrigger.start的宿主在非法描述符上会收到异常(引擎自身已 catch)。回滚即还原本 PR 一个 commit。packages/triggers/trigger-schedule/src/time-relative-trigger.ts(start里!parsed.success分支,风险在 throw 前的this.stop)、src/time-relative-bind-status-e2e.test.ts(真引擎状态行的 pin)。pnpm --filter @objectstack/trigger-schedule exec vitest run src/time-relative-bind-status-e2e.test.ts,预期 1 passed:非法描述符的流读bound: false+unboundCause: binding_failure,合法的流读bound: true。What changes
TimeRelativeTrigger.startrefused an invalidconfig.timeRelativedescriptor (bothwithinDaysandoffsetDays, an unknown key,schedulenested inside the descriptor) by logging[time-relative] flow 'NAME' has no valid timeRelative descriptor — not boundand returning.FlowTrigger.startreturnsvoid, so the engine'sactivateFlowTriggerread that return as a successful arm and recorded the flow inboundFlowTriggers. The status row (getFlowRuntimeStates(), served byGET /api/v1/automation/_status) then readbound: truewith nounboundCause.The refusal now throws the same sentence it logs. This is the path the trigger's own organization and deployment-policy refusals already take (
refuseMissingOrganization/refuseScheduledWorkDisabledinschedule-trigger.ts; the "Why it throws, and does not merely log and return" docblock there describes the mechanism). The engine's existing catch never marks the flow bound, so the row readsbound: falsewithunboundCause: 'binding_failure', and the boot binding audit lists it. Before throwing, the branch callsthis.stop(flowName), as the organization refusal does, so a re-bind with a broken descriptor cannot leave the sweep from an earlier valid bind armed. Thewarnline text is byte-identical to before, and the level stayswarn: a trigger that is not armed is a functional degradation, and the status row now reports it.No engine change and no
FlowTriggerinterface change.packages/services/service-automation/**is untouched.One
patchchangeset for@objectstack/trigger-schedule.Tests
src/time-relative-trigger.test.ts: the existing "invalid descriptor" case now asserts the throw. A new block covers three invalid shapes (both modes, an unknown key,schedulenested in the descriptor). For each:startthrows a message naming the flow, arms no job, and logs the refusal once. Also new: a re-bind with a broken descriptor drops the previously armed sweep, and a control where a valid descriptor does not throw and arms its sweep.src/time-relative-bind-status-e2e.test.ts(new): the realTimeRelativeTriggerregistered on the realAutomationEngine. An invalid-descriptor flow readsbound: false,triggerType: 'time_relative',unboundCause: 'binding_failure', with no sweep armed. The valid control flow readsbound: true, has nounboundCausekey, and its sweep is armed. The engine-only twin of this pin (engine.test.ts, "ON: a genuine bind failure reads as one on the status row too") lives inservice-automation, which is outside this PR's surface. This package already devDepends on that engine, so the pin lives here.Package test + typecheck at da85763
tsc --listFilescounts 11 of the package's*.test.tsfiles in the program, including the new e2e file.Ablation (one-shot): the throw replaced by the old return
node scripts/ablation-replace.mjs --file packages/triggers/trigger-schedule/src/time-relative-trigger.ts --anchor 'throw new Error(sentence);' --replacement 'return;'landed (anchor 1 to 0, blob 520bd258c30a to cf719226888f). Both suites then went red:Restore leg: blob after restore 520bd258c30a equals the HEAD blob, and
git diff HEADis empty. The trigger is imported by relative path, so the mutation reached the run without a rebuild. The engine resolves throughdist/, but its source is unchanged in this diff.Local gates (derived by dispatch-gates --commands)
57 derived families were run locally, and
--ranreconciled 57 of 57. 54 exited 0.check:nul-bytes,check:cross-package-test-inputs,check:test-source-aliasandcheck:engine-double-contractwere re-run at da85763 and all exited 0. NOT MEASURED locally, left to CI:check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET. It needs every package'sdist/.check:query-options-erasure: hit the 300 s local timeout. It is a repo-wide ESLint scan.check:type-check-debt: hit the 300 s local timeout during the whole-repo tsc walk.The derivation warned that its tree was 7 commits behind origin/main. The 2 stale files are
scripts/gen-sdui-reference.mjsandscripts/pm/dispatch-gates.self-test.mjs. Neither reads this diff's paths.Acceptance notes
scheduletrigger's own descriptor refusal has the same log-and-return shape:[schedule] flow 'NAME' has no recognizable schedule descriptor — not boundinScheduleTrigger.start(schedule-trigger.ts). Under this PR's reasoning that flow also readsbound: true. That file is outside this PR's surface, so the seat has the finding to route.Verification
Run the two-minute check above. Or, as on the card: boot the showcase with
OS_AUTOMATION_SCHEDULED_WORK_ENABLED=1andOS_ALLOW_UNLINTED_METADATA_WRITES=1,PUTa time_relative flow whose descriptor carries bothwithinDaysandoffsetDays, then readGET /api/v1/automation/_status. Expectbound: falsewithunboundCause: "binding_failure". This live-boot path was not run in this PR, and the e2e pin above covers the same engine row.Generated by Claude Code