Skip to content

feat(spec): RestrictionProfileSchema, the closed shape of what a target environment does not let metadata do - #31191

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-tafwfl
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-tafwfl

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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 版本。
  • 为什么改:cloud#3659 裁决 A,云端与本地只差一个限制档案;这是档案本身的契约,os validate --target(本卡第 2 项)和云端发布接口(cloud 卡 3)都读它。
  • 风险与回滚:纯新增的数据形状,无运行时读者、无门禁、无错误码,任何现有元数据不受影响。回滚即 revert。
  • 先看: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:

Key Shape Meaning
allowCode boolean, required metadata that carries code: object lifecycle hooks, named handler functions, code plugins
allowScheduledAutomation boolean, required flows of type: 'schedule' and scheduled background jobs
allowedFlowNodeTypes FlowNodeAction[], required the built-in node types a flow may use; the element IS FlowNodeAction from automation/flow.zod.ts (FLOW_BUILTIN_NODE_TYPES is the same list), so there is no second list
versions strict { spec, skills }, required the @objectstack/spec and @objectstack/skills versions the environment runs, each SEMVER_2_0_0_VERSION_PATTERN (reused from kernel/version-grammar.ts)
  • Closed at both levels with strictObject (.strict() plus a named surface and near-miss suggestions, e.g. codeAllowed → allowCode, specVersion → versions).
  • An absent profile means no restriction. The JSDoc states it: the open default is holding no profile, not a profile with everything on. Every dimension is required, so {} is refused rather than read as "everything allowed", and an environment cannot publish a restriction it did not spell out.
  • Data only: no gate, no error code, no runtime enforcement. Item 2 (os validate --target, packages/cli) and cloud card 3 are its readers.
  • Where it lives: src/system/, beside environment-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), and system/ is the domain for deployment and environment shapes. kernel/ holds the package manifest and plugin lifecycle, which describe an app, not an environment.
  • Regenerated: api-surface, export-origins, declaration-map, authorable-surface, json-schema.manifest, the strictness-ledger counts, and content/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-txt counts *.zod.ts modules).
  • type-alias-convention.pin.test.ts: RestrictionProfile has no default and no transform, so it is pinned isomorphic (Iso_system_restrictionProfile__RestrictionProfileSchema, 841 → 842) rather than given a RestrictionProfileParsed synonym.

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 issue code and path and that it is the only issue:

  • accepts a full profile, every built-in node type, and an empty node list; the node element is FlowNodeAction by identity; published from the system entry;
  • absent profile: .optional() accepts undefined; {} is refused with exactly the four invalid_type issues;
  • requires each of the four keys and versions.spec / versions.skills;
  • refuses an unknown key on the profile (unrecognized_keys, and the message names allowCode) and inside versions;
  • refuses node types approval, http_request, my_plugin_node, Decision (invalid_value at allowedFlowNodeTypes[1]);
  • refuses versions 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 blob fe21c2b8 = HEAD with git diff HEAD empty; the test imports the schema from src, so no dist/ is on the path):

Leg Mutation Result
node vocabulary .array(FlowNodeAction) → .array(z.string().min(1)) 5 failed / 22 passed (the identity case and the four node refusals)
version grammar the SemVer pattern import → /ABL2|./ 6 failed / 21 passed (the six version refusals)
closed shape top-level strictObject(…) → z.object(shape).passthrough() 1 failed / 26 passed (the unknown-key refusal)
required allowCode → .optional() 2 failed / 25 passed (requires allowCode, the {} case)

Acceptance notes

  • Plugin-registered node types (approval / approval_revise, declared as constants in automation/approval.zod.ts and executed by plugin-approvals) are not FlowNodeAction ids, 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.
  • Every dimension is required, which is the stricter of the two readings of "an absent profile means no restriction". The other reading (an omitted dimension means unrestricted) is raised in the report as well.

Verification

All on head 3a32985c (base 8ef4d309).

Gates: 104 derived, 104 run, all exit 0
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 104 families on this diff; each was run with its exit code captured before any pipe, and --ran reconciles: 104 derived famil(ies) accounted for — 104 run, 0 NOT-MEASURED.
  • First pass: 99 exit 0. Five re-run: check:llms-txt exit 1 was a real stale count (fixed in 3a32985c, then exit 0); check-plugin-teardown-shape.mjs --self-test exit 3 (shallow clone; after fetching 621a4876, exit 0); check:skill-examples, check:dual-build-cjs-loads, check:lean-entry-closure exit 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.
  • Full @objectstack/spec suite under os-verify-lock (VERDICT command-exit 0): Test Files 912 passed (912), Tests 27514 passed, 1 todo.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

Generated by Claude Code

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 7 changed file(s) yielded no anchor (packages/spec/api-surface/system.json, packages/spec/authorable-surface/system.json, packages/spec/declaration-map/system.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 7 changed file(s) yielded no anchor (packages/spec/api-surface/system.json, packages/spec/authorable-surface/system.json, packages/spec/declaration-map/system.json, …) — pages documenting those are invisible to this run
  • the SDK route bridge reached 63 of 226 client-bound route-ledger rows — the other 163 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 163: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 104 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 171 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 620b6e6d40c4ef11658a658e1d2c6ae3d4aeb7d6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f3b3237fe7e100d74a5816c47a058cd95f999459 — the merge of head 3a32985c1db030239bf69fa4ce972eb35b5f07c1 into base 620b6e6d40c4ef11658a658e1d2c6ae3d4aeb7d6, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK

Contract-review-claim: session_01FEkQ5mw7HFYn9o4LEGMQdK · head 3a32985 · 2026-11-07T16:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3a32985c1db030239bf69fa4ce972eb35b5f07c1
Local-runs: none
Scope: packages/spec/src/system/index.ts, packages/spec/src/system/restriction-profile.zod.ts + packages/spec/src/automation/flow.zod.ts (FlowNodeAction, FLOW_BUILTIN_NODE_TYPES, FLOW_STRUCTURAL_NODE_TYPES, FlowNodeSchema.type), packages/spec/src/automation/approval.zod.ts (APPROVAL_NODE_TYPE, APPROVAL_REVISE_NODE_TYPE), packages/spec/src/kernel/version-grammar.ts (SEMVER_2_0_0_VERSION_PATTERN), packages/spec/src/shared/strict-object.ts, packages/spec/src/shared/lazy-schema.ts, packages/spec/src/system/environment-artifact.zod.ts (the sibling the placement cites), packages/spec/src/system/job.zod.ts (the jobs schedule kinds the JSDoc cites), packages/spec/src/stack.zod.ts (hooks, functions, plugins), packages/skills/package.json (@objectstack/skills exists, 18.3.0), packages/spec/src/system/restriction-profile.test.ts and packages/spec/src/type-alias-convention.pin.test.ts (read as the first consumers of the shape). The remainder of the diff (changeset, the regenerated api-surface / authorable-surface / declaration-map / export-origins / json-schema.manifest / strictness-ledger counts / llms.txt and the generated content/docs/references/** pages) is the lane seat's ACCEPT at TIER_DEFAULT, as a standalone PR of those files; it was read, not reviewed.

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 origin/main...3a32985c (merge-base 8ef4d309); the check-runs on 3a32985c. Judged against the tree, not the PR body.

① Derived judgments

  1. New public exports from @objectstack/spec/system: RestrictionProfileSchema (const) and RestrictionProfile (type). src/system/index.ts re-exports ./restriction-profile.zod under the Provisioning and Deployment block, beside environment-artifact.zod; api-surface/system.json, declaration-map/system.json, export-origins/system.json each gain the two rows, each pointing at src/system/restriction-profile.zod.ts. Nothing else is re-exported (no constants, no helper), so the public surface grows by exactly those two names. Right. The subpath is the one the sibling envelope lives on; kernel/ holds what describes an app, and the ruling's subject is what an environment publishes about itself.
  2. Accept set of the new shape, read off the code: a strictObject with four required keys — allowCode: boolean, allowScheduledAutomation: boolean, allowedFlowNodeTypes: FlowNodeAction[] (the enum instance itself, not a copy; the test pins .shape.allowedFlowNodeTypes.element by identity), versions: strictObject({ spec, skills }) each a string matched against SEMVER_2_0_0_VERSION_PATTERN. Unknown keys refused at both levels with the named surface and curated aliases. {} is refused with four invalid_type issues; undefined is accepted only through the holder's own .optional(). No default, no transform, so z.input equals z.infer (the ADR-0122 pin 841 to 842 is the correct form; M203 was a free index on main). Right, and it matches the card's ask: the four dimensions the ruling names, the node list read from the spec's own registry and never restated, the two versions, and an absent profile meaning no restriction.
  3. The node vocabulary is FlowNodeAction, so allowedFlowNodeTypes cannot name a plugin-registered node type. On main, FlowNodeSchema.type is an open z.string() (ADR-0018) and approval / approval_revise are spec-declared constants executed by plugin-approvals, not FlowNodeAction ids; the PR's own test refuses approval. Right as the ruling is written (「allowed flow node types (a closed list read from the spec's own node registry, never restated)」) — the consequence for the reader is the open question handled in ③.
  4. Generated artefacts move together. json-schema.manifest/system.json gains system/RestrictionProfile (so cloud card 3 can consume a JSON Schema whose node enum is derived, not hand-typed); authorable-surface/system.json gains the four system/RestrictionProfile:* rows (consistent with system/DeployBundle:* already being there — the generator lists every strict authoring shape, so this is not a claim that an app author writes it); the strictness ledger system/ 395 to 397 counts the two new strictObject sites; llms.txt 39 to 40 and 220 to 221 counts the new *.zod.ts module; the docs reference pages count 212/1635 to 213/1636. The dev reports check:generated with all 14 artefacts up to date and Check Changeset, Spec property liveness, Lint · docs & code guards are green on the head. Right.
  5. No runtime, gate, error code or enforcement is added — packages/cli untouched, nothing in packages/spec reads the schema. Right: Prime Directive 2 (no business logic in spec) and the card's split (item 2 is packages/cli, domain:server) both hold.
  6. No ADR governs this surface. docs/adr/** on main names neither a restriction profile nor cloud#3659; the schema implements a cloud ruling quoted verbatim on the card, and the code comment cites objectstack-ai/cloud#3659 the way ai/agent.zod.ts and ai/build-progress.zod.ts cite theirs. The ruling text ends up in no runtime string (.describe() / history carry no tracker number). Right.

② Semver level

.changeset/31156-restriction-profile-schema.md: '@objectstack/spec': minor, with the two line-initial declarations Clause-②: yes (widening) and Metadata-protocol: added, both identical to the PR body's lines. The diff publishes two new exports from a released package and nothing is removed, renamed or tightened, so minor is the floor the Post-Task Checklist sets for a kind other than none and matches what the diff publishes. Metadata-protocol: added holds: the spec's own authorable-surface artefact gained four rows for the shape, and the card's claim (6709173446) dispatched with Metadata-protocol: added. (widening) is one arm of the closed pair and is the right one (a new schema, nothing narrowed). The Skills-docs: none line gives its reason (no author-written key, no reader this release); it is prose outside this scope. The card filed Clause-②: yes (a new spec schema); the PR's Clause-②: yes (widening) is the same declaration with its arm spelled. Clause-②: yes (widening) — level and kind judged right. No skip-changeset label, correctly (the diff publishes).

③ Boundary flags

Dev deviations (6710218086):

  • Commit trailers carry session_01FEkQ5mzXgjDYseUz8kmybe, a one-character slip of the thread's session_01FEkQ5nzXgjDYseUz8kmybe, not rewritten. Accepted. The branch is the thread's harness branch, not claude/issue-*, so Multi-agent discipline §3 forbids the --force-with-lease a rewrite needs; the trailer pair is model-free (Co-Authored-By: Claude, Claude-Session: https://claude.ai/code/session_…) and the PR body footer carries the correct session URL. The slip is a provenance blemish, not a contract matter.
  • pr_create sent no labels. Accepted: the order named none, the PR publishes so skip-changeset would be wrong, and Auto Label ran green.
  • Lint scoped to packages/spec. Accepted: Lint · ESLint and the other Lint contexts on the head are green, so the repo-wide verdict is CI's and it is in.

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 {} and any partial profile at parse, which is Prime Directive 12 (reject off-spec input at the producer, never a lenient ?? in a consumer). B would make a forgotten key silently permissive at the one place that is meant to restrict. The only producer is cloud card 3's control plane, which knows every value. The JSDoc states the rule and the test pins both halves (.optional() accepts undefined; {} yields exactly four invalid_type issues). No change requested.

Open question 2 — a flow node whose type is outside the built-in registry (plugin-registered, including the spec-declared approval / approval_revise) cannot be named by allowedFlowNodeTypes; how should item 2's reader treat it? Answered for this PR: A (ship as is); the reader rule is escalated to item 2's claim, with this record's reading of the tree attached: FlowNodeSchema.type is an open string by ADR-0018, so a profile built on the closed enum necessarily leaves plugin node types unnamed; B would copy two plugin-executed ids into the closed list and C adds authorable surface with no reader. The reader rule that follows contract-first is: a node type outside FlowNodeAction is governed by allowCode (it exists only because a code plugin registered its executor), and os validate --target says so by name. Item 2's claim must record which rule it implements; this is not a change to this PR.

Escalations raised by this review (both for item 2 and cloud card 3, neither a change to this diff — see ④):

  • FlowNodeAction contains start and end, which FLOW_STRUCTURAL_NODE_TYPES says are always legal regardless of registered executors. A profile that lists neither forbids every flow. Item 2's reader needs a stated rule (structural types always allowed, or the control plane always lists them).
  • FlowNodeAction contains script, whose only job is to call a function from defineStack({ functions }). A profile with allowCode: false and script in allowedFlowNodeTypes is self-contradictory; the schema admits it. Item 2 must say which dimension wins at the script node (the function it names is already refused under allowCode: false, so the flow fails either way, but the refusal should name one rule).

④ Design judgment

packages/spec/src/system/restriction-profile.zod.ts — judged against the ruling it implements (cloud#3659 A as quoted on the card: 「云端搭建唯一的区别是有一些限制,比如写代码是否允许,定时任务是否允许,流程允许使用到什程度」 and the card's four-dimension ask) and its first consumers (the PR's own test file, the ADR-0122 pin, the generated JSON Schema cloud card 3 will serve, and item 2's os validate --target).

  • Every claim the JSDoc makes was read in the live tree and holds: FlowNodeAction at automation/flow.zod.ts:45 with FLOW_BUILTIN_NODE_TYPES = FlowNodeAction.options (line 81), so "the same list" is literally true and a type the registry gains is allowable the release it lands; SEMVER_2_0_0_VERSION_PATTERN at kernel/version-grammar.ts is anchored, accepts prereleases (18.4.0-beta.1 in the test's fixture) and refuses v18.4.0, 18.4, latest, 18.04.0, ^18.4.0 — the test's six refusals are exactly that pattern's documented cells; flows of type: 'schedule' exist (flow.zod.ts:1162); jobs with cron / interval / once schedules exist (system/job.zod.ts); hooks, functions, plugins are the stack's code-carrying keys (stack.zod.ts:1194,1225,1344); @objectstack/skills is a real workspace package (18.3.0), so versions.skills names a version that exists.
  • Composition is the repo's standard one: lazySchema wrapping strictObject(options, shape).describe(…), the exact form in strict-object.ts's own example. strictObject records the declaration at construction, so the alias-integrity audit judges the aliases table: every alias key is one the shape rejects and every target (allowCode, allowScheduledAutomation, allowedFlowNodeTypes, versions; nested spec, skills) is one it accepts. The dev's full spec suite (912 files) ran green, which includes that audit, and Spec property liveness is green on the head. Through the lazySchema Proxy, .shape, .optional() and .safeParse all bind to the real instance, which is why the identity test on .shape.allowedFlowNodeTypes.element is sound rather than accidental.
  • Tried to break it: (a) allowedFlowNodeTypes: ['start', 'start'] parses — duplicates are not refused. A set spelled as an array with no uniqueness refinement; harmless to any reader (membership test), and the control plane is the only producer. Noted, no finding. (b) A profile may be internally inconsistent (allowCode: false + script; no start/end) — the schema is a shape and the ruling asks for four independent dimensions, so refusing cross-dimension contradictions here would put reader policy into spec, which Prime Directive 2 forbids; these are escalated in ③ to item 2, where the rule belongs. Should-fix, non-blocking, optional for this PR: one sentence in the allowedFlowNodeTypes docblock saying that start / end are structural and that a script node is also subject to allowCode, so the first reader does not have to rediscover it. (c) versions cannot express "unknown" or a range — correct: the ruling wants the versions the environment runs, and version-grammar.ts says a range is a different concept judged elsewhere. (d) No .min(1) on allowedFlowNodeTypes — an empty list meaning "no built-in node type" is the honest reading of a closed allow-list and is tested; a profile with everything on is spelled by listing every id, which the test also pins from FLOW_BUILTIN_NODE_TYPES. (e) strictObject on both levels means a future versions.runtime or versions.cli is a deliberate widening with a changeset, not a silent addition; that is the right default for a published contract.
  • Ablation evidence in the report (node vocabulary, version grammar, closed shape, required) each turned the expected assertions red and nothing else, each leg restored to blob fe21c2b8, which is the blob this diff carries for the file. The tests import from src, so no dist staleness could mask a leg.
  • No must-fix.

packages/spec/src/system/index.ts — judged against the entry-point discipline the sibling environment-artifact.zod.ts docblock states (one entry point per name, the dual-source trap) and against export-origins/system.json. The barrel adds one export * under the Provisioning and Deployment block, after environment-artifact.zod, with a two-line comment naming the ruling and the absent-means-unrestricted rule. RestrictionProfile / RestrictionProfileSchema collide with nothing on main (grep of packages/** finds no prior declaration; export-origins maps both names to the one file), and the test pins that the system entry re-exports the very same instance. No second entry declares or re-exports the name. No finding.

Check-runs on 3a32985c at the time of this record: every completed gate-carrying context is success — Governed Surface Queue Guard, Check Changeset, Check PR Size, Spec property liveness, Lint · ESLint, Lint · docs & code guards, Lint · CI, release & engine gates, Lint · PM dispatch-gates, Lint · scoped · (three), Type Check · source gates, Build Docs, Build UI Deps, Dogfood Regression Gate, PR-body guards, Check Documentation Links, Auto Label, filter, Plan Test Core shards; Lint UI, Dogfood Verify CLI, the dogfood shards and the opt-in harnesses are skipped by their own path filters. Still in_progress at this reading: Lint · repo & tooling gates, Type Check · workspace / debt ledger / consumer gates, Build Core, Test Core (1 to 8 of 8), Type Check UI, Test UI (1 to 16 of 16), Build & E2E UI, Live E2E UI. Their conclusions are the gate verdicts; this record does not wait on them and they are not pre-judged here. The seat lands only once every required context reads success (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate), and the PR is a draft that must be readied first. Nothing in this PR touches a governed surface, so no Tier H approval is owed; this record is the Clause-② contract review the card's claim (6709173446) owes before enqueue.

Implemented-by: claude/project-thread-tafwfl
Reviewed-by: session_01FEkQ5mw7HFYn9o4LEGMQdK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#1 · os-project-manager · session_01FEkQ5mw7HFYn9o4LEGMQdK

维护者速读

  • 改了什么:@objectstack/spec/system 新增 RestrictionProfileSchema 与 RestrictionProfile 类型,四个必填维度:是否允许代码、是否允许定时自动化、允许的内置流程节点类型(直接用 FlowNodeAction 枚举)、环境运行的 spec/skills 版本。
  • 为什么改:cloud#3659 裁决 A,云端与本地只差一个限制档案;这是 One authoring source (cloud#3659 A), 2/4: a RestrictionProfile schema in spec, and os validate --target checks metadata against an environment's profile #31156 第 1 项(spec 契约),第 2 项 os validate --target 归 server 车道。
  • 风险与回滚:纯新增数据形状,无读者、无门禁、无错误码,不影响现有元数据;回滚即 revert。
  • 先看:packages/spec/src/system/restriction-profile.zod.ts 与同目录测试。
  • 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/system/restriction-profile.test.ts。
  • 需要你做的:无,席位落地。
  • 席位意见:ACCEPT。Fable 契约复审 PASS(6710350208);dev 的两个 open question 一个按卡文已答(四维全必填),一个是第 2 项读者的规则,随交接带给 server 车道。

席位核对

Verdict: ACCEPT · head 3a32985c1db030239bf69fa4ce972eb35b5f07c1 · card #31156 item 1 · claim 6709173446 · report 6710218086

  1. Shape: draft, base main, body opens with Refs #31156 (item 1); no closing keyword anywhere in the body (grep for close/fix/resolve next to a number: zero hits), so the card stays open for item 2. 16 files, +383/-11, all inside the claimed surface; packages/cli/** untouched.
  2. Premise measured: no RestrictionProfile on main before this diff; the node list is FlowNodeAction itself (identity pinned in the test), not a second list.
  3. Gates: check-governed-merges --pr 31191: NOT governed, 394 changed lines (under 3000), so ordinary queue landing. Check-runs on this head are still running; the seat lands only when every check reads success or an expected skip.
  4. Accepted deviations: commit trailers carry a one-character session slip (mz for nz); the branch is a thread harness branch, so no history rewrite; the squash merge keeps the PR's own footer. pr_create sent no labels; Auto Label ran.
  5. Out of scope and where it went: open question 1 (all four dimensions required) is answered by the card's own text, an absent profile is the only spelling of "no restriction" (review ③). Open question 2 (plugin node types such as approval), and the review's two reader rules (start/end structural, script vs allowCode), plus its optional docblock should-fix, belong to item 2's reader and are carried in this seat's release of One authoring source (cloud#3659 A), 2/4: a RestrictionProfile schema in spec, and os validate --target checks metadata against an environment's profile #31156 to domain:server. Skills-docs: none — … holds: no app author writes this key and no reader ships this release.
  6. Landing: Clause-②: yes (widening) / Metadata-protocol: added, minor on @objectstack/spec, with the CONTRACT_REVIEW_TIER PASS 6710350208 on this head. Release sentences checked against the diff: the changeset's four key bullets and "The shape is strict at both levels and every key is required … {} is refused" match the schema and tests. After MERGED: release One authoring source (cloud#3659 A), 2/4: a RestrictionProfile schema in spec, and os validate --target checks metadata against an environment's profile #31156 back to pm:queue naming item 2 for domain:server with pm:retriage.

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 规则复核过的都授权」.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 7, 2026 17:23
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 7, 2026 17:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit d57be87 Nov 7, 2026
66 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-tafwfl branch November 7, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant