Skip to content

service-automation: when one of two packages holding a flow name is disabled, the served package's trigger is never armed (boot) or is re-keyed and stopped (runtime withdraw) #33893

Closed

Description

@objectstack-fleet

domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

Found while building #33748 (PR #33890, dev report 6895152469). Measured on the engine with the real SchemaRegistry and flowNameResolver at 1e65a389. It was not measured through HTTP. Bug only: grade and state are left to triage's first touch.

维护者速读

  • 现象:两个包持有同名流程,其中一个包被停用后,仍在服务的那个包的触发器不再触发。开机时停用的情况下它根本没有被装上;运行中停用并撤回槽位时,它的槽位键被改掉,绑定也被停掉,之后不再恢复。
  • 影响:仍在服务的包的记录变更、定时等触发静默失效,日志里还有一条误导的警告。
  • 先看:AutomationEngine.activateFlowTrigger 的 loneSharedFlowKey / M1 拒绝守卫、FlowSlotTable.add/remove、resyncFlowsFromProtocol → withdrawFlowSlot。

Observed

  1. Boot disable of one of two holders of flow t. The boot pull registers only the served packages' flows. The served holder's lone slot is filed under the bare key t, and the M1 guard declines it with a false warning: "another package holds a flow named t whose body was refused". Its record-change trigger never dispatches.
  2. Runtime disable, then withdrawFlowSlot(disabled, t), after the disable door's metadata:reloaded announce runs resyncFlowsFromProtocol. The served slot's key moves from PACKAGE/t to t, and its binding is stopped and never re-armed.

Expected

Seam

ADR-0150 D3/D4 slot keying → FlowSlotTable.add/remove and AutomationEngine.activateFlowTrigger (loneSharedFlowKey, M1 guard) in packages/services/service-automation/src/engine.ts; resyncFlowsFromProtocol / withdrawFlowSlot. Lands after PR #33890 (same file).

Dedupe words: served holder trigger not armed, lone shared slot disabled holder, withdrawFlowSlot rekey bare, M1 decline disabled package.


Generated by Claude Code

Activity

  1. added
    bug
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:A5 · p2 · 2026-11-15T13:45Z

    ⛔ Not a claim.

    When one of two packages holding the same flow name is disabled, the served package's trigger is never armed at boot, or is re-keyed and stopped at runtime, and a misleading warning is logged. Record-change and scheduled automation fails silently, but only with a same-name holder pair, so p2 (reach discount). A5 is service-automation, the same family as #33748 (PR #33890).

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 15, 2026
  4. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

    Claim: server area-lease mode (#33751 §2), area S6 lease A5, dispatched by seat domain:server#5 area thread · executed by an os-dev sub-agent (mode:subagent) · posted at 2026-11-15T13:47Z
    Session: session_01QsR2jUZKdq3PK2Sab53cT3
    Account: zhuangjianguo
    Branch: claude/area-A5b-33893
    Worktree: objectstack-issue-33893
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/services/service-automation/src/engine.ts (activateFlowTrigger / loneSharedFlowKey / M1 guard, withdrawFlowSlot, resyncFlowsFromProtocol), the flow slot table in service-automation, their tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default (no path-derived mandate; dispatch-gates --tier at 1e65a389), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack service-automation: the served holder of a two-holder flow name loses its trigger when the other holder is disabled (boot: never armed; runtime withdraw: key moved and binding stopped) | none | any deployment that disables one of two packages holding one flow name
    Thread-read: 6895252330
    Premise: holds
    Serial constraints cleared: PR #33890 (S6, #33748, open) edits the same file engine.ts; this card is built on top of its branch claude/area-A5b-33748 and opens after #33890 merges (stacked). PR #33721 does not touch this surface.


    Generated by Claude Code

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

    Pre-claim check (binding, area-rules.md) · recorded for the claim 6895272573 · 2026-11-15T13:55Z

    Pre-claim lane: server because packages/services/service-automation/src/engine.ts
    Pre-claim deps: PR #33890 (#33748, same file engine.ts, the card says "Lands after PR #33890") is OPEN, so this dep is not yet free.
    Prior rulings read: seat ruling 6884403301 on #33386, amendment 7 ("A disable is reversible and moves no key"), is the rule this card restores. Seat ruling B for the fold member #33905 was given after an independent Fable review. ADR-0150 D3/D4. No ⛔ line conflicts.

    Result: deps not free. No dev is dispatched until PR #33890 merges; the claim stands. Same for the fold member #33905.


    Generated by Claude Code

  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

    Pre-claim check, re-run under the 14:45Z rule (same-series cards may start on the prior card's branch; queue only on a real textual overlap) · for claims 6895272573 (#33893) and 6895319683 (#33905) · 2026-11-15T14:54Z

    Pre-claim lane: server because packages/services/service-automation/src/engine.ts
    Pre-claim deps: PR #33890 (#33748) passed review-c at head 560f410d and is armed (ACCEPT 6896413149). This fold is the same series and starts on its branch claude/area-A5b-33748 instead of waiting for the merge; the PR opens on main once #33890 merges. No other open PR edits engine.ts's flow slot surface.
    Prior rulings read: seat ruling 6884403301 on #33386, amendment 7 ("A disable is reversible and moves no key"); seat ruling B for #33905 (card body, after an independent Fable review); #28117 ruling A; ADR-0150 D3/D4; PR #33546. No ⛔ line conflicts.

    Result: passes. An os-dev sub-agent is dispatched now on claude/area-A5b-33893, one commit per card.


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3
    os-dev-report

    {
     "issue": 33893,
     "status": "done",
     "branch": "claude/area-A5b-33893",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34048",
     "head_sha": "75b2f32c18aafda5f7882b5762cf21bf8534f14a",
     "session": "session_01QsR2jUZKdq3PK2Sab53cT3",
     "premise_still_valid": true,
     "summary": "One draft PR (#34048), one commit per card, plus a merge of origin/main 7d42ba09 (PR #33890 squash-merged; its blobs were identical, so the diff against main is only the two card commits). #33905 (998cb968): the one predicate isDisabledHolderSlot now also judges the slot of a name one package holds. triggerRun skips it, saying so once per slot at info; a re-enable dispatches with no re-arm. resolveFlowKey (non-durable) and servedBareFlowKey treat a disabled sole holder as absent, so execute (subflow/map calls included), getFlow and toggleFlow answer as for an unheld flow, and the bare HTTP doors answer 404 like the namespaced address. Durable reads (slot/run keys, binding, flowDispatchHolder, credentials, history) are unmoved. Parked-run resume is NOT decided here. Package-less and no-resolver flows are CONTROLs, and PR #33890's single-holder CONTROL is flipped. #33893 (9d712d1d): FlowSlotTable takes a coHeldByDisabled predicate. add files the boot pull's served holder under PACKAGE/NAME. remove keeps the key when the disabled holder's slot is withdrawn. isShared reads a lone qualified slot as shared. M1 (loneSharedFlowKey and its refused-body warning) now needs two SERVED holders. An uninstall before the withdraw folds back to the bare key (CONTROL).",
     "tests": "Final head 75b2f32c, under os-verify-lock (VERDICT command-exit 0, held 3805s). install 0, build 0. @objectstack/service-automation: test 282 files / 4012 tests passed, typecheck 0. flow-slots-per-package.test.ts: 79/79, of which 15 new and 1 flipped. @objectstack/runtime narrowed to the automation domain: 48 files / 1034 passed, typecheck 0. Dependents: plugin-trigger-record-change 12/122, plugin-trigger-schedule 13/256, plugin-trigger-api 3/73, plugin-approvals 120/1652, all passed. Ablations via scripts/ablation-replace.mjs on src (the test imports src relatively, so there is no dist path); each landed (anchor 1 -> 0, blob changed) and was restored (blob == HEAD, git diff HEAD empty). A1 trigger gate shared-only: 1/79 red. A2 resolveFlowKey gate off: 2 red. A3 servedBareFlowKey gate off: 1 red. A4 add qualified keying off: 5 red. A5 remove keep-key off: 6 red. A6 M1 served narrowing off: 4 red. A7 isShared qualified-lone clause off: 1 red. The runtime door pin is not ablated (no runtime source changed); its moving half is A3.",
     "gates": "dispatch-gates --commands: 72 families, all exit 0. check:type-check-debt was re-run under the lock: exit 0, 0 raw tsc errors. dispatch-gates --ran --repo objectstack-ai/objectstack: '72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN', exit 0. Body gates with a synthetic event: check-changeset-no-major 0, check-adr-0087-registration 0 (33905 changeset not-required (no-migration-prescription)), check-empty-changeset 0, check-partof-closing-keyword 0. check-closing-keyword-parity --body exit 2, informational: 4 closing declarations, both Fixes intended. eslint on touched files: 0. merge-tree HEAD vs origin/main clean. Relay read-back: 12883 bytes sent, 12883 stored, identical. PR state: draft, open, mergeable true, mergeable_state blocked (checks pending). CI check-runs: in_progress at report time, not waited on.",
     "dogfood_battery": "75b2f32c · os-verify-lock VERDICT command-exit 0 · Test Files 467 passed | 3 skipped (470) · Tests 3959 passed | 42 skipped (4001) · no failures (the stderr 'Schema sync FAILED for showcase_invoice' lines are ordinary noise, not test failures)",
     "mcp_calls": "0",
     "api_writes": "2: (1) relay pr_create via POST /repos/objectstack-ai/objectstack/dispatches (fleet-write run 43740559132) -> PR #34048; (2) this os-dev-report comment on #33893 via scripts/pm/post-stamped.mjs. git pushes of claude/area-A5b-33893 are not REST writes.",
     "line_budget": "6 files, +432/-28: engine.ts +61/-16, flow-slots.ts +30/-8, flow-slots-per-package.test.ts +229/-4, automation-addressed-route.test.ts +72/-0, two changesets +15 and +25. No skills/**, docs/adr/**, .claude/** or workflow files touched.",
     "files_changed": [
      ".changeset/33893-served-holder-keeps-slot-key.md",
      ".changeset/33905-disabled-sole-holder-flow.md",
      "packages/runtime/src/domains/automation-addressed-route.test.ts",
      "packages/services/service-automation/src/engine.ts",
      "packages/services/service-automation/src/flow-slots-per-package.test.ts",
      "packages/services/service-automation/src/flow-slots.ts"
     ],
     "deviations": [
      "Pins are top-level describes in the shared harness files (flow-slots-per-package.test.ts, automation-addressed-route.test.ts), not new per-card files as the order's route suggested (AGENTS.md shared-harness rule, ruling record 6583487846).",
      "The changeset's FROM -> TO label was reworded to 'ran ... It now answers ...', because check-adr-0087-registration reads a FROM -> TO label as a migration prescription against no-migration-prescription. The PR body keeps the FROM -> TO table. Local commits were rewritten before the first push (force-push is barred).",
      "execute is gated for every caller, subflow/map calls included, as the shared-name rule already is (servedCaller). This is listed in the FROM -> TO table.",
      "The repo-wide pnpm lint was not run locally. dev-common lists it pre-push, but os-dev.md says repo-wide scans are CI-owned, and os-dev.md wins on conflict. eslint over the touched files exited 0.",
      "Not merged with origin/main a second time: main moved 22 commits after 75b2f32c, none touching the six files, and merge-tree is clean. Merging would have voided the final-head dogfood battery for no content change. The nearest sibling is #33970's packages/runtime/src/domains/automation.ts (channel-list save doors).",
      "PR #33890 merged mid-task. Per the coordinator, the branch merged origin/main 7d42ba09 (conflicts resolved with ours; main's blobs were identical to 560f410d) and the PR opened on main; built_awaiting_base was not used."
     ],
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "class: a · reach: engine boot pull over the ObjectQL registry (plugin.ts flow pull, around line 2704), with two SERVED packages shipping one flow name and the registry holding both before the pull · evidence: measured on the engine with this PR's sources. The first registered holder is declined as M1 behind the warning 'whose body was refused' (refusedBodyWarnings=1) and is re-armed only by the second holder's key move, though no body was refused. Predates this PR. Fixing it needs the refusal record, which that pull path does not write · dedupe words: boot pull refused body warning both served; M1 transient first holder; flow slot declined until second holder; whose body was refused false"
     ],
     "notes": "Parked-run resume for a disabled sole holder is NOT decided by this PR. Events fired while the package is disabled are dropped, not replayed on enable."
    }

    Generated by Claude Code

  9. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3
    os-dev-report

    Delta: fix round for PR #34048 (review 6898785695, contract record 6898771491)

    Head: b4d4a4a87fed1b4b7c7360f24fd1f61214eb63a2. It adds two normal commits on 75b2f32c, with no force-push.

    F1, fixed (7c193056). The fix is one keying rule. A lone slot kept under PACKAGE/NAME beside a disabled co-holder now folds back to the bare name once the registry no longer holds the name twice.

    • FlowSlotTable.settle makes the move. placeFlowSlot asks it when the uninstall's re-sync places the served holder's slot again, and the move goes through moveFlowRecords, the same move a withdrawal uses.
    • isShared is main's again: the slot count, or the registry holding the name twice. The qualified-lone clause is removed.
    • Pins: the disable → withdraw → uninstall order and the boot-disable → uninstall order. Each checks that:
      • the key is t and the trigger is armed under t;
      • inboundHookSlot('t') is undefined;
      • getFlowVersionHistory('t') returns 2 versions;
      • execute works, and unregisterFlow('t') removes the flow.
    • The FlowSlotTable unit test covers settle.
    • Ablation A8 (fold off): 2 of 80 red.
    • Pre-fix reproduction: the 75b2f32 sources with this test file give 3 red.
    • Window: between an uninstall and its re-sync, the bare entries find no flow. This was measured, and they do not refuse. The re-sync's registration folds the slot back.

    S1 (b4d4a4a8). The .changeset/33905-… file now names the moved write-door answers, as before/now rows: the clone taken-name probe, the rollback copy, carried-forward credentials and DELETE. The runtime door pin gains the clone door's source row (404 as its address, nothing registered).

    • Possible widening, for the seat to rule. I have not changed the declaration. When the clone door's new name is a disabled sole holder's flow name, the door goes from 409 to admitting the copy.
      • Engine half, measured: the probe sees null, the package-less registration lands the copy in the package's slot, and once the package is re-enabled its trigger runs the copy's body.
      • Not measured: the full door, including whether packagedBaseRefusal, tenantAuthoredWriteRefusal or the first-write pin refuses the clone first.
      • Clause-②: no (narrowing) is kept as written.
    • PR body: I have no write that edits a PR body (pr_create only), so the revised body, with the FROM → TO rows and the new verification, is prepared for the seat to post. The path is in the final report.

    Readings at b4d4a4a8 (under the lock, VERDICT command-exit 0):

    • @objectstack/service-automation: 4013/4013 tests, typecheck 0.
    • @objectstack/runtime (automation domain): 1035/1035 tests, typecheck 0.
    • Dependents: trigger-record-change 122, trigger-schedule 256, trigger-api 73, plugin-approvals 1652, all passed.
    • Dogfood: 467 files passed, 3 skipped. 3959 tests passed, 42 skipped. No failures.
    • dispatch-gates: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN.

    Loose end, for the area to file: the runtime doors that ask getFlow a durable question (the clone probe, registerAndSaveFlow's rollback copy, keepStoredFlowCredentials, the DELETE existence probe) should read over every holder. This is a change in packages/runtime/src/domains/automation.ts, which is outside this claim.

    security_findings: none · mcp_calls: 0


    Generated by Claude Code

  10. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3
    os-dev-report

    Delta: fix round 2 for PR #34048 (contract record 6900695384)

    Head: d6a464ce (ea75f64d fix, d6a464ce changeset wording), on b4d4a4a8. Pushed as normal commits.

    M1, fixed. The served holder now stays armed through a re-enable, in either re-sync order.

    • Decline: a lone slot under its qualified key takes the M1 decline only once another package's body of the name is recorded as refused. So the served holder registered first by the enable's re-sync is armed, with no refused-body warning.
    • Re-arm: when the co-holder's slot is added beside an incumbent already under its qualified key, no key moves. placeFlowSlot re-arms the incumbent where the move would have.
    • Late refusal: a refusal recorded later still declines the slot, and recordFlowRefusal now says the warning.
    • Pins (8): boot and runtime disable × each holder disabled × the served holder registered first and the returning holder registered first. Each asserts both bindings armed and dispatching, and no refused-body warning.
    • CONTROL: a really refused returning body declines the served holder once, with the warning; both are armed once the body registers.
    • Ablations: A9 (re-arm off) 1 of 91 red. A10 (decline without a recorded refusal) 5 red. A11 (late-refusal re-ask off) 1 red.
    • Pre-fix (the b4d4a4a8 sources with this test file): 7 red.

    S1, fixed. The fold back to the bare name (settleFlowName) now also runs the first time the engine fires the slot (triggerRun; that event runs where the slot lands) or reads its name (resolveFlowKey, bareFlowKey, servedBareFlowKey, inboundHookSlot).

    • Pins cover the stretch with no re-registration at all: first touched by the trigger, and first touched by a bare entry.
    • Ablations: A12 (trigger fold off) 1 red. A13 (hook fold off) 1 red.

    S2. The 33905 changeset now carries the ruling: the clone answer is the one the door gives once the re-sync has withdrawn the flow. Clause-②: no (narrowing) stands. The runtime durable-reads card is left to the area.

    M2. The prepared PR body is updated to d6a464ce, with the write-door rows, the fold in place of the isShared bullet, and the tests and verification. It is not posted: the area posts it.

    Readings at d6a464ce (lock VERDICT command-exit 0):

    • @objectstack/service-automation: 4024/4024 tests, typecheck 0.
    • @objectstack/runtime (automation domain): 1035/1035 tests, typecheck 0.
    • Dependents: trigger-record-change 122, trigger-schedule 256, trigger-api 73, plugin-approvals 1652, all passed.
    • Dogfood: 467 files passed, 3 skipped. 3959 tests passed, 42 skipped. No failures.
    • dispatch-gates: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN.

    security_findings: none · mcp_calls: 0


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpm:dispatchedpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions