You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4f20614
Browse filesBrowse the repository at this point in the historyBrowse files
fix(plugin-security): the boot report names a refused grant's candidates and the bind; a refused suggestion's fix follows its column (#33930)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_Fixes#32753
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:启动时的目录引用报告现在把「两个包都持有同名权限集、而授权未指明包」的授权列为被拒绝,并列出全部候选包与 `os migrate
stored-references bind` 修复;受众绑定建议在包列已有值时不再给出不适用的 bind 提示。
- 为什么改:原报告把这类授权当作「目录解析不到」,建议「重新声明权限集」,而这改变不了什么;建议的拒绝文案给出的 bind
命令对非空包列直接拒绝。
- 风险与回滚:只改日志与拒绝文案,没有授权因此多给或少给;回滚即还原两个源文件。
- 先看:`catalog-reference-report.ts`
的授权循环与授权行日志;`suggested-audience-bindings.ts` 的
`refusedSuggestionFix`;`catalog-reference-report.test.ts` 末尾新 describe。
- 两分钟验证:`pnpm --filter @objectstack/plugin-security exec vitest run
src/catalog-reference-report.test.ts -t "name two packages hold"`,预期 4
passed。
- 需要你做的:无,席位落地。
## What changes
- **Boot report, permission-set half** (`catalog-reference-report.ts`).
A grant whose name the catalog holds but refuses for the grant (a grant
naming no package, of a name two packages hold:
`ambiguous-in-environment`) is still listed on the grant line, now with
the resolver's refusal: `refusal` on the row (`packageId` = the column,
`reason`, every candidate, the resolver's sentence), and `refusals` in
that organization's meta. The line's fix, appended only when a refusal
is listed, follows the column: a refused grant naming no package is
bound after review with `os migrate stored-references bind --table
sys_user_permission_set --id ID --package PACKAGE`; one that already
names a package is granted again naming the candidate meant, then
removed. A name nothing holds keeps the old line byte for byte.
- **Boot report, position half**: unchanged code; now pinned for the
two-holder case (`ambiguous-in-environment`, both candidates named).
- **Suggestion refusal** (`suggested-audience-bindings.ts`,
`resolveSuggestedSet`). The refused suggestion's fix follows its
`permission_set_package`: a column naming no package keeps the bind; a
column that already names a package (one that no longer serves the set)
names that package and says the bind does not apply (it writes only a
null column), then gives the fix that does: install or enable that
package again if its set is the one meant, or dismiss the suggestion. No
refusal code or status changes: the `409` and `SuggestionStateError` are
as before.
## Tests
- `catalog-reference-report.test.ts`: new describe, four cases: position
half (both holders), permission-set half (bare grant with both
candidates, stale-column grant with its column, a ghost set with no
refusal), the logged line (meta refusals plus both fix sentences), and a
CONTROL that a line with no refusal names neither fix.
- `suggested-audience-bindings.test.ts`: one case in the existing
package-scoped harness: two non-null-column refusals carry no bind and
name their package and fix; an accepted row's withheld reason says the
same. The existing null-column pin (bind named with the row id) is
unchanged and green.
## Acceptance notes
- The card's item 2 says "grant"; the only refusal that appends the bind
for a stale column is a suggestion's (`resolveSuggestedSet`), which has
no re-grant or delete door (the table is read-only through the API). Its
fix therefore names the two acts that exist: serve the set from the
column's package again, or dismiss.
- `os doctor` does not read this report (no reference to it under
`packages/cli/src/commands/doctor.ts`). Surfacing it there is a cli
change, left out of this PR.
## Verification
Measured at 843e83d (objectstack-ai/objectstack). The head, 1a99d2a,
adds only a merge of origin/main, which touches no file under
packages/plugins/plugin-security or packages/core.
- `pnpm --filter @objectstack/plugin-security typecheck`: exit 0. `pnpm
--filter @objectstack/plugin-security test`: 267 files passed, 6686
passed, 45 skipped.
- eslint `--no-inline-config` on the four touched source and test files:
exit 0.
- Ablations (each through `scripts/ablation-replace.mjs`, restored to
blob == HEAD, `git diff HEAD` empty): (1) the grant row's refusal not
attached: 2 red (the permission-set half and the logged line); (2) the
suggestion fix always given the null-column branch, the old text: 1 red
(the new suggestion pin); (3) the position refusal not recorded: 1 red
(the position half).
- Derived gate families: `node scripts/pm/dispatch-gates.mjs --commands`
derived 71 families at 843e83d; 68 exit 0. NOT MEASURED, each left to
CI: `check:dual-build-cjs-loads` and `check:i18n` (exit 3, PREREQUISITE
NOT MET: whole-workspace build absent), `check:type-check-debt`
(verify-lock queue, exit 99, then the 10-minute foreground cap on
retry). `--ran` reconciliation: 71 accounted, 0 UNRUN.
`check-partof-closing-keyword` on this body: exit 0.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(plugin-security): the catalog reference boot report names a refused grant's candidates and the reviewed bind, and a refused audience-binding suggestion's fix follows its package column
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The catalog reference boot report listed a grant naming no package, of a permission-set name two packages hold, as a grant naming a set the catalog does not resolve, with no candidates and the fix "declare the permission set again", which changes nothing. Such a grant is now listed on the same line with the resolver's refusal (`refusals` in the line's meta: the grant, the package its column names, the reason and every candidate), and the line's fix names `os migrate stored-references bind --table sys_user_permission_set --id ID --package PACKAGE` for a refused grant naming no package, and, for one that already names a package, to grant the candidate meant again naming its package and then remove the listed grant. The position half of the report already named its refusals and candidates.
11
+
12
+
A suggestion refused for a `permission_set_package` column that already names a package (a package that no longer serves the set) no longer offers `os migrate stored-references bind`, which writes only a column naming no package. Its refusal now names the package and the fix that applies: install or enable that package again if its set is the one meant, or dismiss the suggestion. A suggestion whose column names no package keeps the bind.
13
+
14
+
No grant or suggestion confers more or less: only the report's lines and the refusal's text move.
it('logs the refusals in the grant line, and its fix names the bind for a grant naming no package and the re-grant for one naming a package',async()=>{
0 commit comments