Repository navigation
feat(security, create-objectstack): an AI-built app with its own capabilities and no connector plugins installs as an unmanaged copy - #35261
Conversation
…ns until the app declares a connector A plugin is code, and an unmanaged install copies metadata alone, so the scaffold's three default connector executors made every AI-built app uninstallable as a marketplace trial template. The template README and the two docs pages say how to add a provider when the app first needs one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
…an app's capabilities, renamed with the copy The capability metadata type is runtime-creatable and stays overlay-closed: a platform capability name, or a name another holder declares, is refused at the save door, and the unmanaged copy renames a capability the package prefixes with its namespace, with every grant and requirement of it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
…ot refusal for an environment-held capability, add changesets The capability and install-mode pages describe an environment-authored capability, the two names the save door refuses, and how an unmanaged copy renames capabilities. Comments that still called capability code-only now say what holds. The cold-boot refusal battery runs for capability beside permission and position. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
📓 Docs Drift CheckThis PR changes 7 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 5 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 190 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 63b83e038893a78f41c0273dc39d6e7d1a888db8 && git checkout 63b83e038893a78f41c0273dc39d6e7d1a888db8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6f36818f032edd8d9cff7aaf65f762374b62e070 f23d461514ae4fa3a64f863afbe8db32cd070d24 && git checkout -B drift-repro 6f36818f032edd8d9cff7aaf65f762374b62e070 && git merge --no-ff f23d461514ae4fa3a64f863afbe8db32cd070d24
node scripts/docs-audit/affected-docs.mjs --json 6f36818f032edd8d9cff7aaf65f762374b62e070
|
…aller's bound, and both door tests pay the lint load at collection The stub engine's `find` filters on every scalar condition and applies `limit` after the filter, so `check:objectql-double-limit` can seat and judge it. The two test files that reach the dynamic `@objectstack/lint` import through the save path import it at module top, per `check:test-source-alias`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
… items so its collision case compiles Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
… console language A capability is now runtime-creatable, so a publish can carry one. The pending-changes count table gains its row, and every locale pack gains the `preview.changes.typeCount.capability` count family, in the plural slots that pack already uses for positions and in the word it already uses for a capability. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
…ses a token at the everyone anchor ADR-0090 D5 excuses an app's own declared capability from the high-privilege check on an `everyone` binding. The declared list was read from the whole registry, which since capabilities became runtime-creatable also holds environment saves with no `_packageId`. Such a declaration now excuses nothing; an app's shipped capabilities and an unmanaged copy's (stamped with the copy package) still count. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract-review-claim: session_01JQwxbXuXMUwP5Bbmq6UZRJ · head e6bae72 · 2026-11-19T04:34Z |
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract reviewServed-tier: PR #35261 for card #35157. Read: the card body and every comment (record 6999763503 rules item 1, option A), the PR body, its 47-file list and the net diff against the merge-base with ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. S1 to S3 below each earn a delta review; four nits follow. What held against an attempt to break it:
S1 (should-fix) —
S2 (should-fix) —
S3 (should-fix) —
Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
… one name everywhere; the anchor bound is stated as it holds; the overlay remedy lists capability rows Contract review 7000301544 on #35261, S1-S3: - The rename engine rewrites a capability in hasCapability('<name>') predicates, keeps the object-name pass out of systemPermissions/requiredPermissions, and at duplicatePackage (source stays installed) refuses a capability it cannot rename and every item naming it. - declared-capability-context states the bound that holds (maintainer ruling 7000639892) and applies the provenance test to the metadata-service fallback too. - os migrate security-catalog-overlays lists and deletes capability rows, through the repository as the environment's runtime-created item. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract-review-claim: session_01JQwxbXuXMUwP5Bbmq6UZRJ · head 688ca4f · 2026-11-19T05:29Z |
…in's first loads at module top Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract-review-claim: session_01JQwxbXuXMUwP5Bbmq6UZRJ · head 706dbee · 2026-11-19T05:40Z |
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract reviewServed-tier: Delta review of PR #35261 for card #35157 (record 7000301544: PASS on the previous head, S1 to S3 open, nits N1 to N4). Read: the two commits between that head and this one (11 files; the second commit adds three import lines to one test file), ruling record 7000639892 on the card, the card and PR threads as they stand, and the check-runs on this head and on the intermediate commit. The hits file and the two save-door files are byte-identical to what record 7000301544 judged, and its judgment of them carries. The tree is judged, not the PR body, which is unchanged and still reads "awaits the maintainer's ruling". The check-runs on this head were still running when this record was rendered (29 created: 5 success, 6 skipped, 18 running, none red; no lint, type-check or test lane had reported), so the derived gate families are not yet answered on it. On the intermediate commit the push of this head cancelled the test and type-check lanes; of the lanes that finished there, one gate was red, the Test-source alias gate, over the CLI integration test that commit edited. It prescribed three module-top imports, and the second commit adds exactly those three. This record judges the design of the delta and rests on no local run; the required contexts still have to turn green on the head that lands. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. S1, S2 and S3 are closed on this head. S4 is new in this delta and earns a delta review. N1, N3 and N4 stand; N2 is fixed; N5 and N6 are new. S1: closed.
S2: closed.
S3: closed.
S4 (should-fix) —
Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
… declare follows a renamed object as before Contract review 7000870325, S4: only names the package declares skip the object-name pass in systemPermissions, requiredPermissions and hasCapability arguments. N5: the metadata-service fallback also reads packageId / package. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ
|
coordinator#1 · os-warren · session_01JQwxbXuXMUwP5Bbmq6UZRJ Contract-review-claim: session_01JQwxbXuXMUwP5Bbmq6UZRJ · head fce0fd9 · 2026-11-19T05:44Z |
|
repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE Contract reviewServed-tier: DELTA review of PR #35261 for card #35157, from What carries, by blob id. Between ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. S4 is closed. S5 is new in this delta and earns a delta review of its fix. N1, N3, N4 and N6 stand; N7 to N9 are new. The hits file, S1: closed. It stays closed on this head: a declared name is renamed by the capability rename in the declaration, the two keys and the quoted argument, and the duplicate door's refusal is untouched. S2: its closure on record 7000870325 was judged on a filter that read S3: closed. Its files are byte-identical. S4: closed.
S5 (should-fix) —
Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
…capability's row binding alone Contract review 7005578464, S5: the provenance test reads `_packageId` and nothing else, on the registry list and on the metadata-service fallback. `packageId` is an author-written key an environment save keeps, and the metadata service states no package key of its own (it serves the body as stored), so neither list reads it. N5 returns to the accepted deviation it was. Pins: an environment-saved body naming a package under `packageId` (or `package`) excuses nothing, on both paths. N7: the three comments in the rename engine state the rule the code has. Docs: an undeclared token spelled with a renamed object's name follows the object; a capability saved with no package is not excused whatever its own `packageId` names. Claude-Session: https://claude.ai/code/session_01Q4EjjNq58cmHeqckjZkTFE Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE Contract reviewServed-tier: DELTA review of PR #35261 for card #35157, from What moved between the two heads: five files and nothing else. What carries, by blob id. Byte-identical between ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. The hits file, S5: closed.
S4: closed. The engine's code is unchanged from the head that closed it. S1 and S3: closed, as on record 7005578464. S2: closed again; its filter reads Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE 席位核对ACCEPT · head
|
|
repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE Landing · 2026-11-19T11:48Z · ACCEPT (seat) and CONTRACT_REVIEW_TIER PASS 7006384113 on head
State: ready + auto-merge. |
Requested by Warren · project thread
Part of #35157 (item 1 is ruled option A, record 6999763503, maintainer: 「同意」; the
everyone-anchor bound is ruled 「接受现有边界」, record 7000639892. The ADR-0126 amendment note stays a separate governed PR after this merges).Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — no skill teaches capability as code-only, the scaffold's plugin list, or unmanaged install; the docs pages are updated here (
content/docs/permissions/capabilities.mdx,content/docs/deployment/install-modes.mdx,content/docs/getting-started/your-first-project.mdx,content/docs/automation/connectors.mdx)维护者速读
_packageId)的声明被豁免,没有包的保存不豁免,正文里写的packageId也不算。回滚:回退本 PR 的 capability 部分即可。packages/metadata-protocol/src/protocol-save-door-refusals.ts(平台名与占用名的拒绝)、packages/metadata-protocol/src/package-namespace-rename.ts(副本改名与引用改写)、packages/spec/src/kernel/metadata-plugin.zod.ts(类型登记从 code-only 改为可运行时创建)pnpm --filter @objectstack/objectql exec vitest run src/protocol-unmanaged-import-rename-battery.test.ts,预期 12 个用例全过。其中三个演示副本动作只对副本权限集持有者放行,对只持有源权限集的人拒绝。What changes
Item 1: a package-declared capability is copied by an unmanaged install (option A, ruled in record 6999763503).
packages/spec/src/kernel/metadata-plugin.zod.ts: thecapabilityregistry entry isallowRuntimeCreate: true. Overlays stay closed (supportsOverlay: false,allowEnvironmentOverlay: false). The body is still judged byCapabilityDeclarationSchema.packages/metadata-protocol/src/protocol-save-door-refusals.tsandprotocol-save.ts: the save door refuses two capability names with422 NAMESPACE_CONFLICT:PLATFORM_CAPABILITIES). The registry answers its bare slot first, so an environment item under that name would shadow the platform's definition;packages/objectql/src/security-catalog-namespace.ts:ENVIRONMENT_HELD_SECURITY_CATALOG_TYPESaddscapability, so a package shipping a capability name the environment authored refuses the boot, as positions and permission sets do.packages/metadata-protocol/src/package-namespace-rename.ts: when the copy takes a new namespace, a capability named<ns>.xor<ns>_xis renamed into it.systemPermissions(list or per-operation map) andrequiredPermissionsare rewritten with it. An unprefixed capability keeps its name. A renamed name another package's capability holds refuses the install, naming both.Item 2: the scaffold stops writing connector plugins (the install contract is unchanged).
packages/create-objectstack/src/templates/blank/*:objectstack.config.tslists noplugins:, andpackage.jsondrops the three connector packages. The README and the config comment show how to add a provider when an app declares a connector.Docs. The capability and install-mode pages describe environment-authored capabilities, the two refused names, the rename in an unmanaged copy and the new refusal row. The getting-started and connectors pages match the scaffold.
Tests
packages/objectql/src/protocol-unmanaged-import-rename-battery.test.ts: an app with a capability-gated action installs unmanaged under a new namespace. The rows are renamed. The security catalog resolves the copy's capability withscope: 'org'. The copied action passes a holder of the copy's set and refuses a non-holder and a holder of only the source's set.packages/spec/src/stack-unmanaged-install-mode.test.ts: an app that gates an action on its own capability, with the scaffold's default (no) plugins, validates withinstallModes: ['unmanaged'].packages/metadata-protocol/src/protocol.capability-write-door.test.ts: a garbage body gets422. Valid saves pass, including the plural spelling.manage_usersgetsNAMESPACE_CONFLICT, and so does a package-held name. A permission-catalog holder of the same spelling does not block (control). A re-save of the environment's own item passes./meta/typesreportsallowRuntimeCreate: true.packages/metadata-protocol/src/package-namespace-rename.test.ts: five rename cases (dot and underscore prefixes, unprefixed kept, both reference keys, collision refusal).packages/objectql/src/protocol-boot-hydration-scoped.test.ts: the cold-boot environment-holder refusal runs forcapabilitybesidepermissionandposition.protocol.code-only-types,protocol.recovery-doors-emit-mutationandprotocol.packaged-base-refusaldropcapability.packages/plugins/plugin-security/src/builtin-capabilities.test.ts: an environment-saved capability body carryingpackageId(no row binding) excuses nothing at theeveryoneanchor, on the registry list and on the metadata-service fallback (packageIdorpackage).Acceptance notes
everyone-anchor bound stands as ruled in record 7000639892, option 「接受现有边界」: 「平台权限和别的应用已声明的权限点照旧一律挡住;只有没人声明过的名字,管理员能在可编辑的应用里声明一次。本次只把说明写准。」 The anchor excuses a declaration bound to a package (_packageId, the row's binding as the server states it) and nothing else: a capability saved with no package excuses nothing, whatever package its ownpackageIdnames (contract review 7005578464, S5). No stricter refusal is built; refusing a body whosepackageIddisagrees with its row's binding is outside this card.Verification
Local runs (updated as they finish)
@objectstack/metadata-protocolfull suite: 23,091 passed, 45 skipped. Six files failed to load on the first pass because the spec build was rewritingdistmid-run; re-run alone: 6 files, 86 tests passed.@objectstack/objectql:protocol-unmanaged-import-rename-battery12/12,protocol-boot-hydration-scoped21/21; full suite running.@objectstack/spec:stack-unmanaged-install-mode,capability-metadata-kind,metadata-create-seeds,metadata-type-field-registrationpass; full suite running.create-objectstack: 379 passed.@objectstack/lint:validate-security-posture.runtime-surface,runtime-gate.inert-type-writes, 72 passed.@objectstack/metadata-coremeta-write-capability15 passed.plugin-securityaccess-upgrade-reportpassed.pnpm --filter @objectstack/spec buildthencheck:generated: 13 of 14 artifacts current, no diff to commit.check:test-typecheckcrashed with no diagnostics under memory pressure from the parallel test run; re-run pending.check:doc-authoring,check:doc-anchors,check:docs-single-h1,check:docs-spec-enumerations,check:changeset-fixed,check:docs-audit-scope,check:docs-transcript-drift: pass.Fix round for contract review 7005578464 (head c29f645)
plugin-securityfull suite: 279 files, 6992 passed, 45 skipped (VERDICT command-exit 0). Touched suites alone:builtin-capabilities,suggested-audience-bindings,builtin-capabilities.boot, 87 passed._packageId ?? packageId ?? package, put back throughscripts/ablation-replace.mjs, anchor 1 to 0, blob 18a0c1bc to 68552ad7):builtin-capabilities.test.ts2 failed, 10 passed, the two new pins red. Restored: blob equals HEAD,git diff HEADempty; with the fix 12 passed.metadata-protocolpackage-namespace-rename.test.ts18 passed (comments only in that file).typecheckofplugin-security(withcheck:test-typecheck) andmetadata-protocol: exit 0.check:nul-bytes,check:doc-authoring,check:doc-anchors,check:docs-spec-enumerations,check:docs-transcript-drift,check:issue-citations,check:durability-log-level,check:cross-package-test-inputs,check:test-source-alias,check:doc-security-posture,check:doc-formula-expressions,check-affected-docs,check-docs-section-name,check:closed-ceremony-text,check:role-word. The other 71 derived families are CI's (declared narrowing).🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbXuXMUwP5Bbmq6UZRJ