Repository navigation
fix(runtime): an App member's flow and permission-set copies land in its App's customization package - #31837
Conversation
…so an App member's flow lands in its App's pair newSimilarTargetRefusal judged a target against the bare declared-dependency walk, while the save gate's write scope widens an App's pair by the App's members (packageDependencyClosure, ADR-0150 D3; ruling record 6691022506). The flow clone door's default landing for an App member therefore ensured APP.custom and then refused it 409 outside_closure. Both branches of the rule (the source's package and the objects a permission set grants on) now read packageDependencyClosure, and the flow door judges an already-installed derived pair before the ensure, so a refused landing creates nothing. Claude-Session: https://claude.ai/code/session_01ADHkmSnvbgyL646ChBK28N Co-authored-by: Claude <noreply@anthropic.com>
… targets stay refused Flow door: default landing on a single node and with the pair present, the legacy member pair, an explicit App pair, a pair that dropped its App dependency refused before the ensure, and two CONTROLs (a writable package declaring only the App; a standalone package). Permission-set door: an explicit App pair lands for a set granting on a member-owned object; the non-pair CONTROL stays 409. The multi-replica App-pair pin now asserts 200, and the permission-set rig's fake ensure declares the App, as the real door writes the pair. Claude-Session: https://claude.ai/code/session_01ADHkmSnvbgyL646ChBK28N Co-authored-by: Claude <noreply@anthropic.com>
…imilar doors Claude-Session: https://claude.ai/code/session_01ADHkmSnvbgyL646ChBK28N Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 28 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 2c00f6f976a48079e0cbfcdfd3067e4df73f9e29 && git checkout 2c00f6f976a48079e0cbfcdfd3067e4df73f9e29
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3487ccc12a6ad00dc75450f3f8b29a8a0630701d c7abcc64bf8a78c513e3b10328eeb40f8dee41df && git checkout -B drift-repro 3487ccc12a6ad00dc75450f3f8b29a8a0630701d && git merge --no-ff c7abcc64bf8a78c513e3b10328eeb40f8dee41df
node scripts/docs-audit/affected-docs.mjs --json 3487ccc12a6ad00dc75450f3f8b29a8a0630701d |
|
domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX Contract-review-claim: session_01ADHkmP8JJo4zF2sjTBRwnX · head d4f1efa · 2026-11-09T06:25Z |
|
domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX Contract reviewServed-tier: Inputs: card #31792 (body; claim 6732012750; triage 6732618138; dev report 6733733052), the seat's ruling (c) on the dev's Step 0 ( ① Derived judgments
② Semver level
③ Boundary flags
Findings: 1 must-fix (③.1) · 1 should-fix (③.6) · 1 nit (③.5) · 1 escalation to the seat (③.2) · 4 deviations accepted (③.4) · 2 forced edits accepted (③.3). Implemented-by: VERDICT: FAIL |
…save gate's closure, and pin a member dependency's flow landing in the App pair Text only in source: the new-similar-target header, the resolveCloneTarget comments and the changeset name the three arms the save gate's closure adds beyond the target's declared dependencies (an App pair's members and their declared closures, the objects those packages own, a residual owner's declared dependencies). One flow pin for the member-dependency arm. Claude-Session: https://claude.ai/code/session_01ADHkmSnvbgyL646ChBK28N Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX Contract-review-claim: session_01ADHkmP8JJo4zF2sjTBRwnX · head 93e4114 · 2026-11-09T07:03Z |
|
domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX Contract reviewServed-tier: This is a delta review of the round-2 fixes to my record on Inputs
What carries over from the prior record. The merge base is still ① Derived judgments
② Semver level
③ Boundary flags
Findings: 0 must-fix · 0 should-fix · 2 nits (③.4 left as the seat ruled, ③.6 the stale count) · 1 deviation accepted (③.5) · all prior findings closed. Implemented-by: VERDICT: PASS |
|
domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX ACCEPT · PR #31837 · #31792 · 2026-11-09T07:28ZHead-sha:
|
Requested by Steve · project thread
Fixes #31792
Claim 6732012750 (
domain:server#4, card-thread session_01ADHkmSnvbgyL646ChBK28N); seat ruling on Step 0: option (c) accepted. Ruling record 6691022506 (an App member's pair is its App's pair). Thread-read: contract review 6731976766 on PR #31751. Round 2: contract review 6733822347 (FAIL: ③.1 must-fix, ③.6 should-fix) and the seat's ruling 6733829954 (arms (i)–(iii) are inside (c); the rule is membership in the save gate's closure).Clause-②: yes (widening) — widened:
POST /api/v1/automation/:name/clonewith nopackagefor a flow shipped by a member of an installed App, and both clone doors (POST /api/v1/automation/:name/clone,POST /api/v1/security/permission-sets/:name/clone) naming that App's pairAPP.custominpackage, now answer200and land the copy there, where they answered409 RESOURCE_CONFLICT [new_similar_target_outside_closure]. The rule is now membership inpackageDependencyClosure(target), the save gate's write scope: the source's package, and for a permission set each object's owner, must be in it. Beyond the target's own declared dependencies that closure holds (i) for an App pair that declares its App, the App's members and each member's declared dependencies, transitively; (ii) for the permission-set objects check, the objects those packages own; (iii) for a target that declares a residual owner (ADR-0130 D4), that owner's declared dependencies. Every landing newly accepted is one the save into that target already accepted; nothing outside the save gate's closure is accepted. Measured on base (56cac5ebsource) and head: the 7 App-member landing pins and the judge-before-create pin are red on base and green on head. Nothing is narrowed: the CONTROLs (a writable package that declares only the App; the pre-existing outside-closure refusals) are green on both.Metadata-protocol: none
维护者速读
packages/runtime/src/domains/new-similar-target.ts(两处闭包读法);automation.ts的land先判再建;流程测试的新 describe。pnpm --filter @objectstack/runtime exec vitest run src/domains/automation-flow-clone-custom-package.test.ts src/domains/permission-set-clone.test.ts,预期 92 passed。What changes
Step 0 (readings: card-thread file
31792-step0.md, summarised here, measured on #31751's headb14cd22bwith its App-member rig):outside_closure, says "Nothing was written"APP.customcreatedAPP.custompresentoutside_closurepackage: APP.customoutside_closureoutside_closureAPP.customcreatedAPP.custom, granting on a member-owned objectThe save gate's write scope already reads
packageDependencyClosure(@objectstack/metadata-protocol, ADR-0150 D3), which widens an App's pair by its members (widenPairClosureToAppMembers);newSimilarTargetRefusalwas the one reader still on the bareresolvePackageClosurewalk, in both of its branches. Options weighed: (a) a pair arm on the closure branch (isPairOf) leaves the objects branch refusing the permission-set case; (b) judging againstappOf(source)has the same gap and would also accept any writable package that declares the App but not the member. (c) was ruled.packages/runtime/src/domains/new-similar-target.ts— the target's closure ispackageDependencyClosure(target, registry), asked once and read by both the source-package branch and the objects branch: the rule is membership in the save gate's closure. The header names what that closure holds beyond the bare declared walk, arms (i)–(iii) above. A writable package that declares only the App is no pair, so it gets no member widening and stays refused (CONTROL).packages/runtime/src/domains/automation.ts(resolveCloneTarget,land) — judge before create: the pair the ensure derives (pairOf(owner, installedManifestsOf(registry))), when already installed, is judged before the ensure is asked, so a refused landing creates nothing. An absent pair is created by the ensure writable and declaring its App; the save gate's closure of such a pair holds the App's members, the owner among them, so a creating ensure is never followed by a refusal (on a registry withgetAllPackages, as the realObjectQLregistry has; nit ③.5 left as ruled). feat(runtime)!: refuse runtime package changes when replicas are declared on the Redis driver #31751's multi-replica probe keeps its place first.packages/runtime/src/domains/permission-set-clone.ts— unchanged: its default landing never asks the closure rule (no ensure-then-judge order), and its explicit target is fixed through the shared rule..changeset/31792-new-similar-app-pair-closure.md—patchfor@objectstack/runtime, both declaration lines.Tests
In the existing harnesses, as new top-level
describes:automation-flow-clone-custom-package.test.ts, realObjectQL+ObjectStackProtocolImplementation): default landing with no pair → 200 intoAPP.custom, created, row bound there; with the pair present → 200, no package created; with only the legacy member pair → 200 intoAPP.custom; explicitpackage: APP.custom→ 200; arm (i): a flow of a package a member declares (neither the App nor a member, its own unit) with explicitpackage: APP.custom→ 200 into it; judge-before-create: an installedAPP.customthat dropped its App dependency → 409outside_closure, the ensure never called, nothing published, stored or registered, package list unchanged; CONTROL: a writable package declaring the App but not the member → 409outside_closure, nothing created; CONTROL: a standalone (non-App) package's flow → 200 into its own pair.permission-set-clone.test.ts): a member's set granting on a member-owned object, explicitpackage: APP.custom→ 200, saved there; CONTROL: the App-only writable package → 409outside_closure, no ensure, no save.APP.customon both. (2) The permission-set rig's fake ensure wroteAPP.customdeclaring the MEMBER, while the real door declares the App; it now declares the App, and the fake registry gainsgetAllPackages(read by the pair widening). The fixture also gains a member-owned object, a member set granting on it, and the App-only writable package. No other existing case changed.Acceptance notes
ObjectQL+ protocol rig above (the same registry, ensure door and save path a server composes).MEMBER.custominstalled, the default landing still goes toAPP.custom(where the ensure lands it,pairOf); namingMEMBER.customexplicitly was and stays admitted (it declares the member).outside_closuresentence ("declares no dependency on …") stays true for every target it can still refuse.Verification
Head
93e41148(fixb6543cc3, tests9215b614, changesetd4f1efa3, round-2 text and arm (i) pin93e41148), cut onorigin/main56cac5eb(after #31751 landed as41106b51);mainhas since moved 12 commits, none touching a file this PR changes or the closure and pair modules it reads.Suites (os-verify-lock, VERDICT command-exit 0 unless stated)
pnpm --filter @objectstack/runtime test: 565 files / 9155 passed, 19 skipped.pnpm --filter @objectstack/runtime typecheck: exit 0 (the first attempt reachedcheck:test-typecheckwith@objectstack/driver-tursounbuilt, which is outside theruntime^...build closure, so an untouched file reported TS2307; green after building it).pnpm --filter @objectstack/dogfood test(full battery, after thedogfood^...closure build): 441 passed, 3 skipped files / 3662 passed, 42 skipped tests.eslint --no-inline-config packages/runtime/src): exit 0.56cac5eb'sautomation.tsandnew-similar-target.ts(restored fromHEADafter;git diff HEADempty): 7 failed / 84 passed, the 7 being exactly the six App-member landing pins and the judge-before-create pin; every CONTROL green. Round 2 (93e41148): the arm (i) pin red on base too (the-t 'save gate'run: 7 red / 4 green, the 4 being the CONTROLs and unchanged cases it selects).Ablations (negative pins)
scripts/ablation-replace.mjson9215b614; the tests import the runtime fromsrc, so no rebuild leg. Each restored: blob == HEAD,git diff HEADempty.ABLATED_31792: the closure read without the pair widening (packageDependencyClosurehanded a registry with nogetAllPackages, i.e. the bare walk). 6 of 91 red: the five flow App-member landing pins and the permission-set explicitAPP.custompin. Every CONTROL green. Re-run on93e41148: 7 of 92 red, the arm (i) pin added.ABLATED_31792_ORDER: the judge-before-ensure guard removed. 1 of 91 red: the judge-before-create pin.ABLATED_31792_WIDEN: the forbidden widening put back (the target's closure always includes the source's package). 5 of 91 red: both new CONTROLs, the two pre-existing outside-closure refusals (flow and permission set), and the judge-before-create pin.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackond4f1efa3: 70 families, each run with stdin closed.--ranreconciliation: "70 derived famil(ies) accounted for — 70 run, 0 NOT-MEASURED". First pass: three exited 3 on prerequisites (check-plugin-teardown-shape --self-testneeded its pinned fixture commit fetched;check:dual-build-cjs-loadsandcheck:type-check-debtneeded unbuilt packages); each re-ran exit 0 after the prerequisite.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmSnvbgyL646ChBK28N