Repository navigation
feat(spec, service-automation): a packaged flow can ship switched off for an administrator to turn on (defaultActive) - #34793
Conversation
… (defaultActive: false) FlowSchema gains the optional `defaultActive`. With no activation-ledger row, a packaged flow declaring `false` is not armed and does not run; an administrator's toggle writes a row, which wins over the default across restarts and upgrades. The default is read at the consult point (the projection's `shipsOff` reader), never written as a row at install. A flow authored in the environment that declares the key is refused at registration; a clone drops it; an unmanaged install copies `false` as `status: 'obsolete'`. The ledger hydrate arms a flow a row switches on. ADR-0126 §4 carries an amendment note. Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb Co-authored-by: Claude <noreply@anthropic.com>
…or defaultActive Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb Co-authored-by: Claude <noreply@anthropic.com>
…ation refusal; preload lint in the unmanaged test Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 424fc9194a6c5a24b176d51c1ddfe79d59af447f && git checkout 424fc9194a6c5a24b176d51c1ddfe79d59af447f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 62fbbeb76760373c31d280a8900fd831ade7ec02 34181ed12496f3fd49db092367fc5015f31ae284 && git checkout -B drift-repro 62fbbeb76760373c31d280a8900fd831ade7ec02 && git merge --no-ff 34181ed12496f3fd49db092367fc5015f31ae284
node scripts/docs-audit/affected-docs.mjs --json 62fbbeb76760373c31d280a8900fd831ade7ec02
|
…utomation skill The card's Done-when asks for it in the automation skill, so it lands in the same PR: one paragraph under "A flow an installed package ships" and eval 24. The token ceiling of the skill moves by the measured addition (+89), with nothing to pay down; the changeset's Skills-docs line reads "updated here". Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb
…e` in the form ledger and the served-property count The flow form does not offer `defaultActive`: every flow the form saves is authored in the environment, where the engine refuses the key, and its meaning lives in its absence. A root ledger row says so. `/meta/types` serves flow 24 top-level properties, one more for the key. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head bef53a4 · 2026-11-17T11:25Z |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: The skill paragraph, the schema jsdoc and the ADR note teach who arms a packaged flow and through which gated door (an administrator, the activation switch, the ledger row that outranks the package's declaration), so the low-risk arm does not apply. The change itself moves toward less automatic arming: a packaged flow already ran on install with no admin step (ADR-0126 §4, absence of a row = active, unchanged on Read: card #34655 body and its ten comments, PR #34793 body, file list and net diff against merge-base Check-runs on the head: no failure. Concluded success: PR-body guards (both runs), Governed Surface Queue Guard, Spec property liveness, Check Changeset (first run), Check Documentation Links, Flag docs affected by code changes, Lint · ESLint, Lint · docs and code guards, Lint · repo and tooling gates, Lint · CI, release and engine gates, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Lint · scoped · slot lookup and corpus, Type Check · source gates, Type Check · debt ledger, Dogfood Regression Gate, Build UI Deps, both shard plans, filter, Check PR Size, Auto Label. PENDING, so not verdicts: Test Core 1/10 through 10/10, Test UI 1/16 through 16/16, Build Core, Build Docs, Build and E2E UI, Live E2E UI, Type Check · workspace, Type Check · consumer gates, Type Check UI, Lint · scoped · query-options erasure, and the second Check Changeset run. The two tests that were red on the earlier head (spec form reconciliation, metadata-protocol served-count) sit in the pending Test Core shards: this record does not vouch for them. ① Derived judgments
② Semver levelClause-②: yes (widening) — true to the diff: the strict parse refused the key before, a packaged flow carrying it registers now, and nothing that registered before is refused. No narrowing found in any hunk.
③ Boundary flags
④ Design judgmentpackages/spec/src/automation/flow.zod.ts against the seat ruling, the ADR note and its first consumer (the engine). docs/adr/0126 against §4 as written on Precedence, tried against the code:
skills/objectstack-automation/SKILL.md and its eval against the card's scenario and the spec it teaches. Implementing files, sentence by sentence. S1 (should-fix) — the new refusal sits outside the one registration-check list, so two published contract sentences and one changeset sentence are false for it. S2 (should-fix) — a declared N1 (nit) — Verdict basis: no finding fails the round. S1 and S2 are open on this head and each earns a delta review of its fix; the nits ride with those fixes or stay as accepted deviations. The pending check-runs named above are not covered. Implemented-by: VERDICT: PASS |
…eck list, and read the default off the package's own body Contract review on #34793 (S1, S2 and nits): - The refusal of `defaultActive` on a flow no package ships is now a member of the one registration check list (#23317), judged by name against the loader's set, so a dry run refuses such a draft and the stored pass lists such a row, as registration refuses it. A package arm for a name the loader's set does not hold is refused too. - The default is the package's: read off the loader's body for the slot's package (`setPackagedFlowDefaultSource`, the plugin's `packagedFlowDefaultReader` over the protocol's `shippedArtifactsOf`), so a declared `.custom` override does not change it in either direction. - The schema JSDoc, the ADR-0126 note and the changeset say which doors answer 400, what the metadata door does, the override rule, the two "on" rows that do not count, and the release floor; the hydrate docblock says an active row arms. Tests pin the dry run, the stored pass, the override both ways, the reader and a reinstall. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 5fe7b81 · 2026-11-17T12:00Z |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: The delta's jsdoc, ADR note and changeset teach who arms a packaged flow and what can and cannot move that default (an administrator's ledger row; never a DELTA record. Prior at-tier record: comment 6946901031 on head Check-runs on the head: no failure. Concluded success: PR-body guards (both runs), Check Changeset (both runs), Governed Surface Queue Guard, Spec property liveness, Check Documentation Links, Flag docs affected by code changes, Dogfood Regression Gate, Plan Test Core shards, Plan Test UI shards, filter, Check PR Size, Auto Label. PENDING, so not verdicts: Test Core 1/10 through 10/10, Build Core, Build Docs, Build UI Deps, Live E2E UI, Type Check · workspace, Type Check · consumer gates, Type Check · source gates, Type Check · debt ledger, Lint · ESLint, Lint · docs and code guards, Lint · repo and tooling gates, Lint · CI, release and engine gates, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Lint · scoped · slot lookup and corpus, Lint · scoped · query-options erasure. The Test UI shards had not been created yet. The 24 tests of ① Derived judgments
② Semver levelClause-②: yes (widening), still true: the delta narrows nothing relative to
③ Boundary flags
④ Design judgmentpackages/spec/src/automation/flow.zod.ts against the rulings and the engine. docs/adr/0126 against §4 on skills/objectstack-automation/SKILL.md and its eval: not in the delta; re-read against the new behaviour and still true sentence by sentence. The ratchet ceiling is unmoved by the delta. Implementing files. Precedence, re-tried on the changed reader:
S1: closed S3 (should-fix) — the by-name judgment refuses a packaged flow that declares N8 (nit) — the changeset does not name the two published additions ( Verdict basis: S1 and S2 are fixed as ruled and every changeset sentence the delta adds is true at this head. S3 is open on this head and earns a delta review of its fix; it fails closed, is confined to a name two packages hold, and withdraws nothing Implemented-by: VERDICT: PASS |
…e`; ask the loader's default once per armed body L2 delta on 5fe7b81 (S3, N8-N11): - S3: the registration check asks whether ANY package's loader set holds the name (`isShippedFlowName`: the one owner, else each package that may hold it, asked per package), so a co-held name's bodies register with the key on every re-sync, upgrade and third holder; dry run and the stored pass agree. The refusal stands only when no package ships the name. - N9: the package default reader is asked once per armed body (a WeakMap keyed by the body registerFlow armed), not on every isFlowEnabled. - N8: the changeset names setPackagedFlowDefaultSource and PackagedFlowDefaultSource and states the fail-open behaviour without a reader; the reader's duck-typed protocol read is pinned through the real protocol in the first-boot-pull integration harness. - N11: FlowSchema JSDoc sentence reworded. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmPTavMbXsRBw7f7fCb
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 1074c04 · 2026-11-17T12:28Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 first review (full) · REWORK, paper only · Head-sha: There is no earlier L1 record. The contract review passed twice: 6946901031 at
One finding, and it is paper. The code reads correct. Must-fixM1. Six paths fall outside half A's claimed surface, and the card has no amendment for them. Amendments 6944001902 and 6944184550 name:
The diff also moves these:
Each one is forced by an L2 fix, by the new key or by a gate. Please post one amendment on #34655 that names them with these reasons. The card thread is gone, so area o3-J posts it. A delta ACCEPT on this same head follows. Delta
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review (same head) · ACCEPT · Head-sha: Delta from L1 6949131778 (REWORK, paper only) on this same head. The code did not move. The one input that changed is the claim amendment 6949150059 on #34655.
Owed, for the seat: the L2 delta at CONTRACT_REVIEW_TIER for the |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: The delta's changeset and engine docblocks teach who arms a packaged flow and when a flow its package ships off runs anyway (the fail-open of an engine composed without a reader), and the skill paragraph, schema jsdoc and ADR note teach the administrator's switch. The low-risk arm does not apply. DELTA record. Prior at-tier records: 6946901031 on Check-runs on the head, latest attempt per check: all ① Derived judgments
② Semver levelClause-②: yes (widening), still true: the delta narrows nothing relative to
③ Boundary flags
④ Design judgmentpackages/spec/src/automation/flow.zod.ts against the rulings and the engine. The reworded paragraph reads as sentences and each is true: registration of an environment flow declaring the key is refused, a dry run of one is refused, the stored pass lists a stored one, a clone drops the key, an unmanaged install copies docs/adr/0126, skills/objectstack-automation/SKILL.md and its eval: not in the delta; re-read against the delta's behaviour. The skill paragraph and eval 24 stay true sentence by sentence (they claim survival of the administrator's choice, which a row decides before any default is read). The ADR note's "With no row the flow follows the declaration of the package's own body for the version installed now, so an upgrade that changes it moves only installations nobody switched" carries the same S4 exception. Implementing file in the delta, Tried on
S3: closed S4 (should-fix) — the N9 cache serves a stale default when a re-sync re-uses the armed body object, and one stock path does. The cache is keyed by the armed body and its docblock rests on "every re-registration (the
N12 (nit) — the PR body's Tests section heads Verdict basis: S3 is fixed as the prior record asked (the question is "does any package's loader set hold the name", asked per package, pinned through a re-registration and a third holder, with the forged-stamp control), and N8, N10 and N11 are fixed as written. N9's cost is fixed, and its fix opens S4: one stock path re-uses the armed body across a re-sync, and the cached default is then the previous version's. S4 is not a must-fix: it needs an override armed by a mutation that raised no reload, then a hot upgrade that flips the base's declaration, on an installation with no row, and a restart repairs it. It is open on this head, earns a delta review of its fix, and under the merge standard (only nits may stay open at landing) blocks landing. The nits ride with that fix or stay as accepted deviations. Implemented-by: VERDICT: PASS |
Brings #34654 (value-envelope refusal) and later main into half A before the L2 S4 fix round. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
… every re-sync L2 S4 on #34793: the package default cached per armed body outlived a change to the loader's set. The metadata:reloaded re-sync keeps a body the metadata-mutation sync armed from the same stored row (and one whose re-registration threw), and a declared override's stored body does not change with its base, so a hot upgrade that flipped the base's defaultActive left the previous version's default in force with no ledger row: on to off kept running, off to on stayed off. AutomationEngine.refreshPackagedFlowDefaults() replaces the cache and sends each held flow whose armed body is not the loader's own back through the arming gate when its enablement moved; the plugin calls it at every re-sync. The cache docblock says when the default is re-read. The same drop covers a body rollbackFlow puts back (L2 N13). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
…efusal; the changeset names refreshPackagedFlowDefaults N1 of the contract review on #34810 (half B), carried here as half A edits packages/spec: the toggle door's contract prose listed only the customer-authored 409. It now also names the 409 for switching ON a packaged flow whose own status disables it, and that switching it off is accepted. JSDoc only; no schema moves. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
Brings #34810 (half B: the status-disarmed switch-on refusal) into half A. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
…orable surface The automation API reference renders the module JSDoc edited for #34810's N1. The api surface regains GetMetaItemRequest:userTextLocales, which the merge of main deferred to the regeneration (merge=os-regen). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review · ACCEPT; landing waits on gates and Tier H · Head-sha: This reviews the delta from L1 6949212729 (same-head ACCEPT at
No new findings. L2 N14 stays the accepted deviation the seat recorded. Gates at this head: CI was still running when this was read (31 of 67 checks in progress, none failed). This ACCEPT does not stand in for green. Owed, for the seat:
This comment readies, queues and arms nothing. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: The changeset and engine docblocks teach who arms a packaged flow and when a flow its package ships off runs anyway (the fail-open of an engine composed without a reader), the two spec prose edits teach which toggle requests the door refuses, and the skill paragraph, schema jsdoc and ADR note teach the administrator's switch. The low-risk arm does not apply. DELTA record over 6949383615 on Check-runs on the head, all concluded, one attempt: 74 runs, 60 ① Derived judgments
② Semver levelClause-②: yes (widening), still true. The delta narrows nothing: it adds a method and comment lines.
③ Boundary flags
④ Design judgmentpackages/spec/src/contracts/automation-service.ts and packages/spec/src/api/automation-api.zod.ts against the code they describe ( packages/spec/src/automation/flow.zod.ts, docs/adr/0126, skills/objectstack-automation/SKILL.md and its eval: not in the delta; re-read against the delta's behaviour. The sentences the prior record marked with the S4 exception ("a later version of the package that changes it moves an installation nobody switched"; the ADR note's "an upgrade that changes it moves only installations nobody switched") now hold for an override-armed flow as well. The skill paragraph and eval 24 claim only that the administrator's choice survives, which a row decides before any default is read; " Implementing files in the delta, sentence by sentence.
Tried on the fix:
S4: closed N14 stays the accepted deviation the seat recorded. #34810's N1 (record 6952048597, the toggle contract prose) is answered by the two spec edits judged above. No must-fix, no should-fix. N15 (nit) — Verdict basis: S4 is closed by the cache-drop direction the prior record offered first. A stale packaged default can no longer survive a Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX Red read · PR #34793 · head
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG 席位记录 · 2026-11-17T18:24ZHead-sha: 维护者速读(终稿)
席位意见:建议批准。L2 一共四轮:
现在只剩 nit N14–N18,都不影响正确性。 席位核对
|
Requested by Yibo Wang · project thread
Fixes #34655
Clause-②: yes (widening) —
FlowSchemagains the optionaldefaultActiveboolean. Before, any flow declaring it was refused as an unknown key (strictObject); now a packaged flow that declares it registers. A flow authored in the environment that declares it is still refused, now by the engine with a sentence naming itsstatusas its switch. Nothing that registered before is refused.Metadata-protocol: added
Skills-docs: updated here — skills/objectstack-automation/SKILL.md (one paragraph under "A flow an installed package ships"), evals/flows-triggers-approvals.json (eval id 24)
维护者速读
defaultActive(紧挨status,可选,缺省为开)。打包 flow 写defaultActive: false后,新装时不挂触发器、不运行,/automation/_status报enabled:false;管理员用现有开关(toggle / Studio 的 Enabled)打开即写一行账本,这行优先于包默认,重启、升级、重装都保持。环境自写 flow 写这个键在注册时被拒(它的开关是 status);克隆去掉这个键;unmanaged 安装把false抄成status:'obsolete'。ADR-0126 §4 加修订注;automation skill 加一段说明和 eval 24。status:'obsolete'又会永久关死。metadata:reloaded重新读一次包默认。回滚即 revert 本 PR(已写defaultActive的包会回到「未知键被拒」)。packages/services/service-automation/src/engine.ts(shipsOff接线、refuseUnpackagedDefaultActive、refreshPackagedFlowDefaults)、packages/services/service-automation/src/flow-activation-projection.ts(无行时读包默认)、packages/services/service-automation/src/plugin.ts(resyncFlowsFromProtocol每次重同步调用刷新)。pnpm --filter @objectstack/service-automation exec vitest run src/flow-default-active-34655.test.ts,预期 34 条全过。What changes
A packaged flow can ship switched off, for an administrator to turn on.
packages/spec/src/automation/flow.zod.ts:FlowSchema.defaultActive,z.boolean().optional(), next tostatus, with no materialized default, so a flow that does not declare it parses exactly as before. The JSDoc anddescribesay what it is (the default of the packaged-flow switch), that a ledger row wins over it, thatstatusstays the author's, and that only a packaged flow may carry it.packages/services/service-automation/src/flow-activation-projection.ts:has(key)is now the row that decides for the flow (rowVerdict, the old body, answeringundefinedwhere it used to answerfalsefor "no row decides") or else the newshipsOffreader.offByDefault(key)names the "no row, shipped off" case for the refusal log.hasSharedbecamesharedRowVerdictthe same way.packages/services/service-automation/src/engine.ts: the projection'sshipsOffreader ispackagedFlowDefault(key) === false, the declaration of the PACKAGE's own body for the version installed now: the armed body when the loader's body is armed, else the loader's body for the slot's package (newsetPackagedFlowDefaultSource; seat ruling on L2 S2, option (a)), asked once per armed body and cached against it, soisFlowEnablednever reads the loader's set; the cache is replaced at everymetadata:reloadedre-sync byrefreshPackagedFlowDefaults()(new public method, L2 S4), which re-arms or disarms each held flow whose armed body is not the loader's own when its answer moved, because the re-sync does not re-register every body. So an upgrade that changes the declaration moves only an installation nobody switched, and a declared.customoverride does not move the default in either direction.refuseUnpackagedDefaultActiveis a member of the one registration check list (v18 stored preview:os migrate meta --storedstill leaves out two families the v18 doors refuse — page components binding the retired API data source, andregisterFlow's other refusals #23317), judged by name: does ANY package's loader set hold it (isShippedFlowName, the loader's own per-package answer, so a name two packages ship keeps the key):registerFlowthrows it (the automation write doors answerVALIDATION_FAILED/ 400,registerAndSaveFlow),dryRunrefuses the draft, and the stored pass (canonicalizeStoredFlow().todos) lists a stored row atflows[0].defaultActive. The metadata door (PUT /api/v1/meta/flow/:name) parses without registering, so it stores such a row; the engine refuses to arm it.describeDisabledFlow's log line names the shipped default when no row decides; theisFlowEnabledandhydrateFlowActivationsdocblocks say what the default and an active row now do.packages/services/service-automation/src/plugin.ts,flow-registration-checks.ts,index.ts:packagedFlowDefaultReader, over the protocol'sshippedArtifactsOfat question time (the readpackagedFlowReaderalready makes for a package's own question), attached at init besidesetPackagedFlowSource;resyncFlowsFromProtocolcallsrefreshPackagedFlowDefaults()after its loop (L2 S4); the check list gains the member;PackagedFlowDefaultSourceis exported besidePackagedFlowSource.packages/services/service-automation/src/flow-definitions.ts(hydrateFlowActivationsonly): a row switching a flow ON is now applied throughactivateFlowTrigger(idempotent, the same gate) and its callers re-judged. Without it, a host whose trigger was registered before the pull would keep a shipped-off flow unarmed after a restart even though an administrator switched it on. The stock boot order (trigger plugins atkernel:ready) armed it anyway.packages/runtime/src/flow-clone.ts:FLOW_CLONE_DROPPED_KEYSnamesdefaultActive. The copy is a writable package's flow, switched by itsstatus, which the clone already writesobsolete.packages/metadata-protocol/src/package-unmanaged-install.ts:copyUnmanagedFlowSwitch: an unmanaged install copiesdefaultActive: falseasstatus: 'obsolete'(a status that already disarms is kept) and drops the key;trueis dropped. A non-boolean is handed on for the save door to refuse.packages/spec/src/contracts/automation-service.ts(toggleFlowJSDoc) andpackages/spec/src/api/automation-api.zod.ts(module JSDoc; regeneratedcontent/docs/references/api/automation-api.mdx): N1 of the contract review on fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810 (record 6952048597), carried here at the seat's request because half A editspackages/spec. The toggle contract prose now names the 409 for switching ON a packaged flow whose ownstatusdisables it (landed with fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810, merged into this branch), and that switching such a flow off is accepted. Prose only: no schema,describe, export or error code moves.docs/adr/0126-packaged-metadata-customization-model.md: an amendment note under §4 and a Status-line entry. The amended sentence is not rewritten.skills/objectstack-automation/SKILL.md(the card's "Document it in the automation skill"): one paragraph under "A flow an installed package ships":defaultActive: falseships the flow unarmed (_statusenabled: false) until an administrator turns the switch on, that choice outlives restart / upgrade / reinstall,status: 'obsolete'disarms past the switch, and a flow authored in the deployment is refused the key.evals/flows-triggers-approvals.jsongains eval 24.scripts/check-skills-token-ratchet.mjs: the file's ceiling 6903 → 6992, the measured addition (+357 priced bytes, nothing removed), under the standing ruling 「A:先削重复,余额按实测提高」 (record 6513306068); no restatement of the switch, its default orstatusas a switch was found to pay down, as the ceiling's note says.packages/spec/liveness/flow.json(defaultActive: live), regeneratedauthorable-surface,content/docs/references/**,liveness/state-counts/flow.md;.changeset/34655-flow-default-active.md(minorspec and service-automation,patchruntime and metadata-protocol).Tests
packages/services/service-automation/src/flow-default-active-34655.test.ts(34): fresh install neither arms nor runs it (FLOW_DISABLED, the switched-off sentence,_statusenabled:false); the log line names the shipped default; toggle on writes{ active: true }, arms and runs; survives a restart in the stock boot order and on a host whose trigger was registered first; survives an uninstall (a boot without the package leaves the row) and a reinstall; survives an upgrade that changes the body; a flow switched back off stays off when the next version ships it on; with no row, an upgrade that changes the declaration moves the installation both ways; CONTROLtrueand absent ship on; anobsoleteflow a row switches on still does not arm; a packaged caller of a shipped-off subflow is held unarmed until the subflow is switched on;defaultActive: falseandtrueon an environment flow are refused with the exact sentence and nothing is filed (the code and status are the write door's, as for everyregisterFlowrefusal); CONTROL: the same environment flow without the key runs; the key is judged by name, so a package arm for a name the loader's set does not hold is refused and a name it holds keeps the key under any arm; a dry run of an environment draft with the key throws what registration throws; the stored pass lists such a row atflows[0].defaultActiveand none without it; a package that ships the flow off is not armed by an override that omits the key, and one that ships it on is not switched off by an override writingfalse(the administrator's switch works in both);packagedFlowDefaultReaderanswers the named package's own body and none for a missing body, a non-boolean, or no protocol. L2 S4 / N13 (six cases): on the engine,refreshPackagedFlowDefaults()moves a held override with no row both ways after the loader's answer flips, a CONTROL where a ledger row and a loader-armed body are not moved, and a bodyrollbackFlowputs back reads the set installed now; on the automation plugin (LiteKernel, a protocol stand-in serving the declared override in the base's slot, no ledger), an override armed by the metadata-mutation sync (no reload) is not re-registered by the nextmetadata:reloaded, and a hot upgrade flipping the base'sdefaultActivestill moves it: on to off stops it (unbound,FLOW_DISABLED), off to on starts it (bound, runs), with a CONTROL reload that leaves the declaration as it was and moves nothing.packages/spec/src/automation/flow-default-active-34655.test.ts(3): accepts both booleans, absent stays absent, a non-boolean is refused at the key.packages/runtime/src/flow-clone-default-active-34655.test.ts(2) andpackages/metadata-protocol/src/package-unmanaged-flow-switch-34655.test.ts(5).packages/spec/src/system/metadata-form-zod-reconciliation.test.tsgains a root ledger row forflow.defaultActive(the flow form saves only environment-authored flows, where the engine refuses the key, and its meaning lives in its absence, likeskill.mcpPrompt), andpackages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.tsmovesflow's served top-level count 23 → 24. No other existing test changed.Acceptance notes
isShippedFlowName). It asks the one owner first (the toggle door'sisPackagedFlow), then each package that may hold the name, per package (packagedFlowSlotOwner): the packages whose slots hold it now and the package the body names itself as. The stamp only picks which package to ask; a stamp naming a package that ships no such flow is still refused (pinned). A.customoverride is served at the base's name, which the loader's set holds (ADR-0146 D9.3), so it is not refused; the default it carries is not read (seat ruling, S2 option (a)).packages/core/src/utils/metadata-activation-store.ts, "deliberately has nodelete"), and nothing on the uninstall path writes the ledger (read). The engine half is now pinned: a boot without the package leaves the row and the reinstall arms the flow.defaultActive: falsewas copied asstatus: 'obsolete'. Accepted as is: the copy'sstatussays it, and listing it is new answer surface outside the card.setPackagedFlowDefaultSourcereads the default only off an armed package body, so while a.customoverride is armed a flow its package ships off runs (fail-open). Such an engine cannot see the package's body, and an unknown default treated as on is how every packaged flow behaved before this key. The automation plugin always attaches the reader; the changeset says so.packagedFlowDefaultReaderreaches the protocol'sshippedArtifactsOfby duck type, aspackagedFlowReaderalready does. It is now pinned through the real protocol: the first-boot-pull integration harness (ObjectKernel + ObjectQLPlugin + SqlDriver + AutomationServicePlugin) boots a base shippingdefaultActive: falsewith a stored override that omits the key; the reader answersfalsefor the base and nothing for the pair, the override is armed and reportedenabled: false, and a record change fires nothing.main, as is fix(lint,service-automation)!: a flow value envelope is typed for the date-text verdicts, so timestamp() over a date field is refused at os validate and registerFlow #34654; this PR does not touchtoggleFloworpackages/runtime/src/domains/automation.ts.mainstays inside the claimed surface plus claim amendment 6953980143 (the two spec JSDoc paths for fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810's N1).1074c040, seat 3 fix round (no code change):Test Core (2/10)failed one case,packages/spec/scripts/build-schemas-check-mode.anchor.test.ts"still fails offline on a deletion the anchor records and this build cannot account for", withHook timed out in 10000msin itsbeforeEach(line 69: fixture file writes plusgit add/commit/rev-parse/update-refin the sandbox). Judged a flake: the same hook passed for the file's other 14 cases in that run; the file's inputs (packages/spec/authorable-surface/**,authorable-surface.base.json,packages/spec/scripts/**, rootscripts/**) are byte-identical to5fe7b810, whose Test Core shards were all green, and1074c040touched only a JSDoc comment inpackages/spec. The failed jobs of run 44082971653 are re-run once; a second failure is real.Verification
Head
34181ed124: this round (below) on top of208c272ef1(a merge oforigin/mainc4c0794, then the regenerated automation API reference), the automation-skill commit and the two existing-test updates (bef53a4790, CI all green), then the contract-review rework (5fe7b810c4) and its delta (1074c040a7).L2 delta 6949383615 fix round (S4, N12, N13) and #34810's N1, on 34181ed
96a99d06d8merge oforigin/main(fix(lint,service-automation)!: a flow value envelope is typed for the date-text verdicts, so timestamp() over a date field is refused at os validate and registerFlow #34654);05656d74f1the S4 fix and its pins;536d5a1c12the spec prose (fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810 N1) and the changeset sentence;198cdf7bf6merge oforigin/main(fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810 landed);34181ed124the regenerated automation API reference, andauthorable-surface/api.jsonregenerated after the merge (the driver had deferred it; it differs frommain's only by this PR's ownapi/CreateFlowRequest:defaultActiverow).AutomationEngine.refreshPackagedFlowDefaults(); the plugin'sresyncFlowsFromProtocolcalls it after its loop on everymetadata:reloaded. ThepackagedFlowDefaultsandpackagedFlowDefaultdocblocks say when the default is read again. The changeset names the method as public API, since a host composing the engine itself must call it after the installed packages change.scripts/ablation-replace.mjs, anchorthis.engine.refreshPackagedFlowDefaults();inplugin.tsdeleted, x1 to x0, blob02ab3709to1e49c39b): 2 failed / 32 passed. The two flip pins fail (expected true to be falseon to off,expected false to be trueoff to on); the CONTROL reload stays green. Restored: blob equals HEAD (02ab3709),git diff HEADempty. The test imports./plugin.jsfrom source, so no build is involved.service-automation:tsc --noEmitandcheck:test-typecheckexit 0; full suiteTest Files 288 passed (288),Tests 4174 passed (4174)at198cdf7bf6(4167 at536d5a1c12, before fix(automation)!: switching on a packaged flow that its own status disarms is refused, and the toggle door answers the engine state #34810 merged).flow-default-active-34655.test.ts34/34.flow-clone-default-active-34655,automation-flow-clone,automation-toggle-caller,automation-addressed-route,automation-toggle-deny-message,automation-toggle-unknown-flow): 6 files, 111/111. Spectypecheckexit 0; speccheck:generated14/14 andcheck:docsexit 0 at34181ed124(the specdistwas built after the merge;gen:docsregeneratedautomation-api.mdx).dispatch-gates --commandsat198cdf7bf6: 149 families, each run with its exit code captured before any pipe;--ran: 149 accounted for, 146 run, 3 NOT-MEASURED. NOT MEASURED (declared narrowing, CI runs them):check:skill-examplesandcheck:dual-build-cjs-loads(exit 3, they need built packages outside the closure: client, client-react and 30 more),check:type-check-debt(exit 3, its closure build never got the shared verify lock behind a long dogfood run). This round changed no skill file and no package's typecheck wiring.check:docsandcheck:generatedfirst exited 1 (the reference page above), and both exit 0 after the regeneration.check-nul-bytesexit 0.overlap-checkat34181ed124: clean againstorigin/main46991d0 and the two open PRs that share files.34181ed124: in progress when this was written.Contract review delta (record 6947617913 on 5fe7b81)
isShippedFlowName), not whether it has one owner. Pinned: both holders, a re-sync / hot upgrade re-registration and a third holder register with the key,trueandfalse; a dry run and the stored pass agree; CONTROL: a name no package ships is still refused, whatever package the body names itself as.AutomationEngine.setPackagedFlowDefaultSourceandPackagedFlowDefaultSourceas public additions and states the fail-open behaviour without a reader, with the reason; the duck-typed protocol read is pinned through the real protocol (Acceptance notes).packagedFlowDefaults, aWeakMapkeyed by the bodyregisterFlowarmed); a re-registration (themetadata:reloadedre-sync after an upgrade re-registers the winner) asks again. Pinned: one call across repeated state reads and runs, one more after a re-registration.FlowSchemaJSDoc sentence reads as sentences.git diff HEADempty): the check asks the one owner only → 2 failed / 26 passed (the co-held registrations, the dry run and stored pass); the cache read removed → 1 failed / 27 passed (the once-per-body pin); the reader reading a key the body does not carry → the real-protocol pin fails.service-automationfull suite:Test Files 288 passed (288),Tests 4135 passed (4135).tsc --noEmitexit 0. Speccheck:generated14/14 after a spec build. 20 affected gates (ADR anchors and links, docblock and scripts symbol anchors, liveness, test-source alias, issue citations, the changeset gates, docs transcript and corpus claim drift, engine double contract, optional error sink, undeclared dep imports, type-check coverage, startup registry, doc authoring, skill examples): all exit 0.Contract review rework (record 6946901031 on bef53a4)
refuseUnpackagedDefaultActiveis a member ofregistrationChecks, judged by name;dryRunrefuses an environment draft with the key and the stored pass lists a stored row, both pinned. The changeset names which doors answer 400 and what the metadata door does.packagedFlowDefault+packagedFlowDefaultReader; the JSDoc and the ADR note say so; both directions pinned.git diff HEADempty): the list member removed → 5 failed / 19 passed (both environment refusals, the by-name refusal, the dry run, the stored pass); the default read off the armed body whatever its arm → 3 failed / 21 passed (both override directions and the by-name CONTROL).service-automationfull suite: 276 files passed; 12 failed to collect because the specdistwas rebuilt mid-run, and re-run alone: 12 files, 110 tests passed.tsc --noEmitexit 0. Speccheck:generated14/14 after a spec build. 23 affected gates (ADR anchors and links, docblock and scripts symbol anchors, liveness, error-code provenance, test-source alias, issue citations, the changeset gates, docs transcript drift, engine double contract, undeclared dep imports, …): all exit 0.Since 208c272 (the skill paragraph, the form ledger row, the served-property count)
Test Core (2/8)(specmetadata-form-zod-reconciliation.test.ts:flow.(root): accepted by the Zod but unauthorable in the form … expected [ 'defaultActive' ] to deeply equal []) andTest Core (6/8)(metadata-protocolprotocol.meta-types-degenerate-derivation.test.ts:flowserved24, pinned23). Both are the new key, accounted for in the next commit: the reconciliation file 76/76, the derivation file 18/18; the full metadata-protocol suite had that one failure and23060 passedbefore the fix.PR-body guardswas red oncheck:closing-target-claim(the card's claim named half B's branch); the seat posted a claim naming this branch.check-skills-token-ratchetwith--self-test,check:skill-docs,check:skill-examples,check:skill-refs,check:skill-identifier-liveness,check:skill-links,check:skill-compatibility,check:skill-frame-sync,check:issue-citations, the changeset gates, …): all exit 0.check:skill-examplesfirst exited 3 on a stale specdist, then 0 after building spec (347 prose examples type-check). Record appended to the gates file below.Premise on origin/main f6f5b50
FlowSchemadeclares onlystatus(flow.zod.ts,status: z.enum(['draft', 'active', 'obsolete', 'invalid'])); no default-active key anywhere inpackages/spec/src.isFlowEnabledcomposesflowStatusDisabledandflowLedgerDisabled.has(name), and the projection answeredfalse(on) with no row.toggleFlowwritesactive: enabledand the projection keeps the holder's row in either state. Read in code; the card's fresh-install reading is hotcrm's, on 18.5.0.Packages
pnpm --filter @objectstack/service-automation exec vitest run --maxWorkers=3(at eb5a27d plus the engine edits):Test Files 288 passed (288),Tests 4121 passed (4121);typecheckexit 0.src/flow-default-active-34655.test.ts34/34 at the final head;src/flow-declared-override-first-boot-pull.integration.test.ts28/28 (one new real-protocol pin).src/automation/flow-default-active-34655.test.ts3/3; runtimesrc/flow-clone-default-active-34655.test.ts+src/domains/automation-flow-clone.test.ts24/24; metadata-protocolsrc/package-unmanaged-flow-switch-34655.test.ts+src/package-unmanaged-install.test.ts103/103.check:generatedexit 0 at the final head (14/14);check:test-typecheckOK (needsNODE_OPTIONS=--max-old-space-size=8192in this container, else tsc runs out of heap).Ablations (scripts/ablation-replace.mjs, each restored, git diff HEAD empty)
shipsOffreader answersfalse→ 5 failed / 10 passed (fresh install, the log line, the upgrade both ways, the subflow caller, the package-arm CONTROL).refuseUnpackagedDefaultActivecall removed → 2 failed / 13 passed (both environment refusals).activateFlowTriggerremoved → 1 failed / 14 passed (restart on a host whose trigger registered first).defaultActivekept on a clone → 1 failed / 1 passed.copyUnmanagedFlowSwitchnot applied → 2 failed / 3 passed.Log:
/mnt/project-files/objectstack-seat2/34655A-ablation.log.Gates
node scripts/pm/dispatch-gates.mjs --commands: 122 families, each run with its exit captured before any pipe;--ran:122 derived famil(ies) accounted for — 122 run, 0 NOT-MEASURED. First pass:check-plugin-teardown-shape --self-test,check:skill-examplesandcheck:dual-build-cjs-loadsexit 3 (shallow clone; unbuilt packages), re-run aftergit fetch --unshallowand a build: exit 0.check:error-code-provenanceexit 1 on the first draft'sVALIDATION_FAILEDstamp in service-automation andcheck:test-source-aliasexit 1 on the new unmanaged test: fixed (the refusal is a plain registrationError; the test preloads lint), both exit 0. Record:/mnt/project-files/objectstack-seat2/34655A-gates-ran.txt.git merge-tree against the in-flight neighbours
git merge-tree --write-tree --name-onlyof 208c272 with:claude/issue-34655-toggle-status-disarmed0c7fc78: exit 0, tree 2c70fc9a8273, no conflicted path. On the merged tree (a--no-commitmerge, then aborted),flow-default-active-34655,toggle-door-packaged-only,flow-activation-ledgerandflow-activation-late-trigger: 4 files, 94/94 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
Claim note (seat 3, o3-J): #34793's branch is named on its own
Claim:line on #34655 (half-A claim after takeover 6948719649), which the closing-target guard reads.