Repository navigation
feat(spec): RestrictionProfileSchema, the closed shape of what a target environment does not let metadata do - #31191
Conversation
…et environment does not let metadata do A target environment publishes this profile as data; an absent profile means no restriction. Code, scheduled automation, the built-in flow node types (read from FlowNodeAction) and the spec/skills versions, all required, strict at both levels. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mzXgjDYseUz8kmybe
…ort moves Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mzXgjDYseUz8kmybe
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mzXgjDYseUz8kmybe
📓 Docs Drift Check5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 171 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 f3b3237fe7e100d74a5816c47a058cd95f999459 && git checkout f3b3237fe7e100d74a5816c47a058cd95f999459
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 620b6e6d40c4ef11658a658e1d2c6ae3d4aeb7d6 3a32985c1db030239bf69fa4ce972eb35b5f07c1 && git checkout -B drift-repro 620b6e6d40c4ef11658a658e1d2c6ae3d4aeb7d6 && git merge --no-ff 3a32985c1db030239bf69fa4ce972eb35b5f07c1
node scripts/docs-audit/affected-docs.mjs --json 620b6e6d40c4ef11658a658e1d2c6ae3d4aeb7d6 |
|
domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK Contract-review-claim: session_01FEkQ5mw7HFYn9o4LEGMQdK · head 3a32985 · 2026-11-07T16:55Z |
|
domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK Contract reviewServed-tier: Inputs read: card #31156 body and every comment (6709115357, 6709148921, 6709173446, 6710218086 with its two open_questions); PR #31191 body, file list (16 files, +383/-11, head repo is the base repo, draft) and the net diff ① Derived judgments
② Semver level
③ Boundary flagsDev deviations (6710218086):
Open question 1 — all four dimensions required (A, shipped) versus each optional with absent = unrestricted (B). Answered: A. The card rules one thing, that an ABSENT profile means no restriction; A keeps exactly one spelling of "no restriction" (hold no profile) and refuses Open question 2 — a flow node whose type is outside the built-in registry (plugin-registered, including the spec-declared Escalations raised by this review (both for item 2 and cloud card 3, neither a change to this diff — see ④):
④ Design judgment
Check-runs on Implemented-by: VERDICT: PASS |
|
domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK 维护者速读
席位核对Verdict: ACCEPT · head
Ruling-ref: the maintainer, 2026-11-07T16:00Z: 「你有 fable ,车道契约复审可以自己做」 (the lane seat runs the contract review); 2026-11-07T16:59Z: 「你应该使用 pm-dispatch 技能审核和落地pr」; standing landing authorisation 2026-10-25T11:35Z: 「按照 pm-dispatch 规则复核过的都授权」. |
Requested by Leehom · project thread
Refs #31156 (item 1)
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the profile is data a target environment publishes, not a key an app author writes into a stack, and no reader ships in this release; authors meet it through
os validate --target(item 2 of the card), whose refusals will name each rule.维护者速读
@objectstack/spec/system新增RestrictionProfileSchema(及RestrictionProfile类型),描述目标环境不允许元数据做什么:是否允许代码(钩子、函数、代码插件)、是否允许定时自动化、允许哪些内置流程节点类型、环境运行的 spec 与 skills 版本。os validate --target(本卡第 2 项)和云端发布接口(cloud 卡 3)都读它。packages/spec/src/system/restriction-profile.zod.ts(四个必填维度,节点类型直接用FlowNodeAction枚举);packages/spec/src/system/restriction-profile.test.ts;.changeset/31156-restriction-profile-schema.md。pnpm --filter @objectstack/spec exec vitest run src/system/restriction-profile.test.ts,预期Tests 27 passed (27)。What changes
packages/spec/src/system/restriction-profile.zod.ts(new), exported from@objectstack/spec/system:allowCodeboolean, requiredallowScheduledAutomationboolean, requiredtype: 'schedule'and scheduled backgroundjobsallowedFlowNodeTypesFlowNodeAction[], requiredFlowNodeActionfromautomation/flow.zod.ts(FLOW_BUILTIN_NODE_TYPESis the same list), so there is no second listversions{ spec, skills }, required@objectstack/specand@objectstack/skillsversions the environment runs, eachSEMVER_2_0_0_VERSION_PATTERN(reused fromkernel/version-grammar.ts)strictObject(.strict()plus a named surface and near-miss suggestions, e.g.codeAllowed→allowCode,specVersion→versions).{}is refused rather than read as "everything allowed", and an environment cannot publish a restriction it did not spell out.os validate --target,packages/cli) and cloud card 3 are its readers.src/system/, besideenvironment-artifact.zod.ts, the envelope a target environment serves to the runtime. The profile is the same kind of thing (something an environment publishes about itself), andsystem/is the domain for deployment and environment shapes.kernel/holds the package manifest and plugin lifecycle, which describe an app, not an environment.api-surface,export-origins,declaration-map,authorable-surface,json-schema.manifest, the strictness-ledger counts, andcontent/docs/references/system/restriction-profile.mdx(+ index rows).packages/spec/llms.txt: the system domain count 39 → 40 and the total 220 → 221 (check:llms-txtcounts*.zod.tsmodules).type-alias-convention.pin.test.ts:RestrictionProfilehas no default and no transform, so it is pinned isomorphic (Iso_system_restrictionProfile__RestrictionProfileSchema, 841 → 842) rather than given aRestrictionProfileParsedsynonym.Why
objectstack-ai/cloud#3659, ruling A: one source of metadata-authoring knowledge for every build channel, where a hosted environment differs from local only by a restriction profile. The maintainer, verbatim: 「云端搭建唯一的区别是有一些限制,比如写代码是否允许,定时任务是否允许,流程允许使用到什程度」. This PR is the profile's shape; item 2 and cloud card 3 build on it.
Tests
packages/spec/src/system/restriction-profile.test.ts, 27 cases. Every refusal asserts the issuecodeandpathand that it is the only issue:FlowNodeActionby identity; published from the system entry;.optional()acceptsundefined;{}is refused with exactly the fourinvalid_typeissues;versions.spec/versions.skills;unrecognized_keys, and the message namesallowCode) and insideversions;approval,http_request,my_plugin_node,Decision(invalid_valueatallowedFlowNodeTypes[1]);18,18.4,v18.4.0,^18.4.0,latest,18.04.0(invalid_format); refuses non-boolean flags.Ablations (
scripts/ablation-replace.mjs, each anchor hit once; each leg restored to blobfe21c2b8= HEAD withgit diff HEADempty; the test imports the schema fromsrc, so nodist/is on the path):.array(FlowNodeAction)→.array(z.string().min(1))/ABL2|./strictObject(…)→z.object(shape).passthrough()allowCode→.optional()requires allowCode, the{}case)Acceptance notes
approval/approval_revise, declared as constants inautomation/approval.zod.tsand executed byplugin-approvals) are notFlowNodeActionids, so a profile cannot name them. That follows the ruling (the list is read from the spec's node registry). How a reader treats a node type outside the built-in registry is a question for item 2's reader, raised in the report.Verification
All on head
3a32985c(base8ef4d309).Gates: 104 derived, 104 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 104 families on this diff; each was run with its exit code captured before any pipe, and--ranreconciles:104 derived famil(ies) accounted for — 104 run, 0 NOT-MEASURED.check:llms-txtexit 1 was a real stale count (fixed in3a32985c, then exit 0);check-plugin-teardown-shape.mjs --self-testexit 3 (shallow clone; after fetching621a4876, exit 0);check:skill-examples,check:dual-build-cjs-loads,check:lean-entry-closureexit 3, prerequisite only (after building the objectql and client-react closures, exit 0).pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date.pnpm --filter @objectstack/spec typecheck: exit 0 (check:test-typecheck: OK, 52 files / 240 errors held, unchanged).eslint packages/spec --no-inline-config: exit 0.Tests
vitest run src/system/restriction-profile.test.ts: 27 passed.@objectstack/specsuite underos-verify-lock(VERDICT command-exit 0): Test Files 912 passed (912), Tests 27514 passed, 1 todo.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code