feat(setup): report optional-scope impacts instead of scope names alone - #226
Conversation
eddiearc
left a comment
There was a problem hiding this comment.
MERGE-WITH-NITS(Fable 5.1 审合)— 文案对齐后合
可选权限从「只有名字」变成「能力影响」,必需 scope 门禁不变,方向对。「其他权限」fallback 避免漏报。
请补:1) grant-scopes.ts 旧提示行也走同一套 impact 映射;2) Owner 确认各 capability 文案(尤其 employee_id 标签);3) im:chat 不在 TENANT_SCOPES,属死条目。缺 version bump。与 #222 同改 bot-register,先 rebase/错开。
Maintainer follow-up — 缓合(独立 UX 批次)方向可以,先别跟 runtime 修复绑在一起合。 请小改后再叫我们看:
相关:#225。 |
aa58d93 to
0d1090a
Compare
|
四条已改完(head 更新为
验证: |
|
核对过 head
等 CI 全绿后,maintainer 侧倾向 APPROVE;合入仍等 idan 明确 yes。 |
0d1090a to
652b639
Compare
|
|
Windows gate 失败排查:CI 基础设施 403,非代码问题
是下载构建 artifact 被拒(GitHub Actions 基础设施抖动),测试根本没开跑;同一 run 的 source-checks 与 standalone artifact 均通过。烦请重跑该 job 一次。 |
The scope reconciliation already listed which optional scopes were not
granted, but not what they cost: an im:chat* gap surfaces as
"成员表拉取失败" in the daemon log, drive:drive as missing document
comments, admin:app.visibility as a failed visibility update. Group the
missing optional scopes by the capability they degrade and print that
next to the scope names — in both the bot-register gate and the
grant-scopes reconciliation — keeping the freshness gate as the only
blocking requirement. The wording stays hedged ("可能受限,实际以平台
校验为准") and the table is display-only.
Bumps the package patch version (0.5.9 -> 0.5.10) per the Owner policy.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-authored-by: idan <eddiearc6@gmail.com>
652b639 to
6263be6
Compare
What
Setup's scope reconciliation already lists which optional scopes were not granted (#211), but not what each gap costs. On a real machine that meant discovering the gaps only from the daemon log: a missing
im:chat*surfaced as成员表拉取失败,drive:driveas a failed document-comment subscription,admin:app.visibilityas a failed visibility update. Filed as #225.Change
src/setup/tenant-scope-grant.ts:missingOptionalScopeImpacts()groups missing optional scopes by the capability they degrade — chat info/members, chat management, document comments, visibility, employee-id signature, message search, base messaging — and falls back to a其他权限line for anything unbucketed, so no requested scope is silently dropped.src/setup/bot-register.ts: the non-blocking optional-scope notice now prints those impact lines. The required-scope fail-closed gate and the console recovery link are unchanged.test/unit/setup/tenant-scope-impact.test.mjs(grouping, declaration order, empty input, unbucketed fallback) andtest/integration/setup/setup-optional-scope-report.test.mjs(required granted + every optional missing → setup completes, and the output carries the impact lines and the console link; the fixture stubsglobalThis.fetchso the test stays offline).Resulting output sketch:
Validation
bun test test/unit/setup/tenant-scope-impact.test.mjs test/integration/setup/setup-optional-scope-report.test.mjs→ 3 pass / 0 failbun test test/unit/setup/ test/unit/app/setup-cli.test.mjs test/integration/setup/→ 78 pass / 1 skip / 1 fail. The failure is the known environmentalsetup-single-rootclean-build test (it builds inside bun's 5 s test timeout; a clean build measures ~11.4 s on this machine) and is unrelated to this change.bun run build✅ ·bun run typecheck✅ ·bun run licenses:check✅ ·bun run publication:check:tree✅bun run test:unit→ 894 pass / 1 skip / 4 fail on a machine with three other agents' daemons running:three-Agent live acceptance …— known pre-existing environmental failure (fails on unmodifiedmainhere too);Agent CLI process consumes native-shaped Codex, Claude, and Pi directory fixturesanda live reclaim guard is never stolen while its owner protects stale-lock recovery— both reproduce identically on unmodifiedmainin the same session (7.0 s / 11.4 s against their 10 s budget), i.e. load-sensitive process/timing tests;local control keeps upsert ID idempotency …— passes in isolation.None of the four touch this change.
Lands ahead of maintainer alignment on #225 — happy to adjust the groupings, the wording, or split out the runtime-side (
status/agents) visibility as a follow-up.Fixes #225
🤖 Generated with Claude Code