Repository navigation
docs(skills): objectstack-data security.md teaches how a package position resolves its permission sets - #31858
Merged
Merged
Conversation
…tion resolves its permission sets A package's position reads each permissionSets name as its own package's set, else the one holder in its declared dependencies closure plus sys; else the name is refused (outside-closure, ambiguous-in-closure), logged by the boot's catalog reference report, and grants nothing. Eval case 19 pins the declared dependency. The security.md token ceiling rises by the measured remainder after one restatement cut (ruling 6513306068, letter B). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU2AtcY5Ky9skxahcy
Contributor
Author
|
domain:skills#2 · zhuangjianguo · session_01QsR2jT34CXs5fCn3BDirZw 维护者速读
席位核对Head-sha:
|
os-zhuang
marked this pull request as ready for review
November 9, 2026 08:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steedos · project thread
Fixes #31819
Clause-②: no
Metadata-protocol: none
维护者速读
security.md讲岗位授权的那一节新增一条:软件包里的岗位引用权限集时,先找本包的,再找它声明的依赖(加sys)里唯一的那个;找不到或有两个就被拒绝,启动报告会列出来,这个岗位通过这个名字什么都不授予。另加一个评测用例。security.md的 token 上限从 3768 提到 3959(常设裁决 6513306068:「A:先削重复,余额按实测提高」)。回滚即 revert 本 PR。skills/objectstack-data/rules/security.md「Positions grant only what they name」一节的新条目;scripts/check-skills-token-ratchet.mjs该文件的上限行与注释;评测hooks-security-seeds-datasources.json的用例 19。node scripts/check-skills-token-ratchet.mjs,预期security.md is 3959 tokens (ceiling 3959; headroom 0)且整体通过。skills/**)。What changes
skills/objectstack-data/rules/security.md, section "Positions grant only what they name": one new bullet, read from the merged ADR-0150 E3 code (PR feat(core, plugin-security)!: permission sets resolve by (package, name), and a package position's sets resolve from its package (ADR-0150 E3) #31815,3487ccc1).permissionSetsname as its own package's set, else the one holder in its declareddependenciesclosure plussys. Otherwise the name is refused. Source:packages/core/src/security/security-catalog.tsresolvePermissionScoped(L497–556) overpackages/core/src/package-scoped-resolution.tsresolvePackageScopedHolders(L547–590, steps 1–3) andpackages/metadata-core/src/package-closure.tspackageResolutionClosure(L216).outside-closure: only a non-dependency holds the set (package-scoped-resolution.tsL584–589), or only the environment holds it (security-catalog.tsL538–556, the D3 (a) refusal naming the environment).ambiguous-in-closure: two holders it reaches (package-scoped-resolution.tsL582). One example each.packages/plugins/plugin-security/src/catalog-reference-report.tsL352–378, logged at L490–510) lists each refusal with every candidate. At run time the position grants nothing through that name and its other sets still grant (resolve-authz-context.tscatalogSetBodyL1419–1432; test "a set one position cannot resolve is still granted through another position that can").everyone/guestanchors (security-catalog.tsreferenceCallerL477–490).skills/objectstack-data/evals/hooks-security-seeds-datasources.json: new case 19, placed after case 18. A package position nameshd_agentfromcom.acme.helpdesk. The expected output declaresdependencies: { 'com.acme.helpdesk': '^1.0.0' }. The assertions requirepermissionSets: ['hd_agent'],dependencies: {andoutside-closure, and refusename: 'hd_agent'(redeclaring the set). So an answer without a declared dependency fails.scripts/check-skills-token-ratchet.mjs: thesecurity.mdceiling row moves 3768 → 3959, with its comment..changeset/31819-data-security-position-permission-sets.md:'@objectstack/skills': patch.Token budget
The ceiling is paid under standing ruling 6513306068, letter B, quoted verbatim: 「A:先削重复,余额按实测提高」.
Cut first (restatement, with its survivor):
security.mdsecretparagraph: "Fail-closed: with no crypto provider, writes throw rather than persist cleartext."rules/field-types.mdL44, thesecretrow: "fail-closed (ADR-0100)"No other passage in the file is restated elsewhere without being a pointer an agent follows (docs links, schema keys, helper names), so nothing else was cut.
Byte arithmetic (bytes / 4, rounded up):
origin/main(5377a12a): 15056 bytes = 3764 tokens; ceiling 3768 (15072 bytes), headroom 16 bytes.skills/**readingsskills/objectstack-data/rules/security.mdlinesskills/objectstack-data/rules/security.mdtokensskills/*/SKILL.md, linesTests
No runtime code changes, so no test was added or run beyond the gates. The eval file parses as JSON, and its ids run 1–19 with no duplicate.
Acceptance notes
packages/objectql/src/security-catalog-namespace.ts): a second package declaring a set name is refused when it registers. That refusal happens first, so the bullet says so beside theambiguous-in-closureexample. The order asked for the refusal to be taught, and it is, without claiming a path the registry blocks.guest_portalresolves environment-wide whatever the caller (PLATFORM_REQUESTED_BARE_NAMES_BY_TYPE,package-scoped-resolution.tsL250). It is a name, not a caller, so the bullet does not list it.delegated-admin-gate.ts). That is outside an authoring rule, so the bullet does not teach it.Verification
The derived sweep ran on
31a8d0f3. Mergingorigin/mainthen brought one commit (fix(drivers), #31831) that touches none of this PR's files; the token ratchet re-ran on the final head4187450a, exit 0.dispatch-gates: 62 derived, 61 run exit 0, 1 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --ran FILE: "62 derived famil(ies) accounted for — 61 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET: it needs every package'sdist, "Runpnpm buildfirst"). Left to CI.node scripts/check-skills-token-ratchet.mjs: exit 0,security.md is 3959 tokens (ceiling 3959; headroom 0).pnpm check:pm-dispatch-gates: exit 0, 2205 fast-tier cases.turbo run buildfor formula, lint and objectql, 14 tasks, VERDICT command-exit 0.Generated by Claude Code