Repository navigation
fix(plugin-sharing): warn once per boot when a hierarchy scope falls back to owner-only - #35780
Conversation
…back to owner-only Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): ⛔ 3 release-owned page(s) name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 49 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 e4ad1bbcb550876ee8b38f089f02f9697c091337 && git checkout e4ad1bbcb550876ee8b38f089f02f9697c091337
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1a21ce93a2f8f95a52955380ab6f296b6ab89db4 9c805c664c8768d9e956724018b664a3977bfeb2 && git checkout -B drift-repro 1a21ce93a2f8f95a52955380ab6f296b6ab89db4 && git merge --no-ff 9c805c664c8768d9e956724018b664a3977bfeb2
node scripts/docs-audit/affected-docs.mjs --json 1a21ce93a2f8f95a52955380ab6f296b6ab89db4
|
…nstead of claiming silence Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat checkL1: ACCEPT on code and tests (L1-a, for area d7-B) at head
Owed before landing: the
|
… owner-only fallback Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat check (delta)L1: ACCEPT (L1-a, for area d7-B) at head
The delta
Each clause holds:
The edit also keeps the advisory's own reason true, since it is the earlier, request-independent voice.
Gates and routingAfter CI is green at Generated by Claude Code |
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Landing · 2026-11-20T09:31Z · head
State: |
Requested by Tesla · project thread
Fixes #35172
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
SharingService.resolveOwnerScopeIds(plugin-sharing) fails closed to owner-only when a hierarchy scope (own_and_reports,unit,unit_and_below) is asked for and nohierarchy-scope-resolverservice is registered. That branch used to log nothing, so onlyos serve(the CLI line added by #35168) ever said so.warn(HIERARCHY_RESOLVER_ABSENT_NOTICE), with meta{ capability: 'hierarchy-security', provider, scope }. The provider is read fromPLATFORM_CAPABILITY_PROVIDERS['hierarchy-security'].package, so it is the same@objectstack/security-enterprisestringos validate/os verify/os serveprint. The prefix and level match the no-org warning just below it ([sharing] hierarchy scope NOT widened: ...,warn). Per AGENTS.md "Degradation log levels", this is a functional degradation, sowarnis the right level.SharingService, in itskernel:readyhook (sharing-plugin.ts), so one instance means one boot. The callers (read filter, write gates, share management, middleware) run per request. The condition belongs to the composition, not to a caller or an object, so a finer key would only repeat the line. The latch is claimed before the log, inside atry, so a throwing logger cannot fail a gate or throw once per request.own,organd an unset scope return before the resolver lookup, so an app that never uses a hierarchy scope logs nothing. A registered resolver also logs nothing.enterpriseAbsenceConsequence(packages/cli/src/utils/capability-preflight.ts) used to end every enterprise-token sentence with "and no log line says so". A new table,ENTERPRISE_ABSENCE_RUNTIME_NOTICE, maps a token to the opening words of the warning its runtime logs. Forhierarchy-security, the sentence now says the runtime logs one warning ([sharing] hierarchy scope NOT widened ...) the first time it falls back. Any token without a row keeps the old clause. I made it a separate table, not a clause folded intoENTERPRISE_ABSENCE_CONSEQUENCE, for two reasons. First, the consequence is what the metadata does and the notice is what the runtime says, and a token can have either without the other. Second, the exported table's type stays unchanged.[me]).check:startup-registry-verdictis green on this tree.Tests
New top-level
describeinsrc/sharing-service.test.ts(the shared harness file). It has six cases:unit_and_below, thenown_and_reports) plus a publiccanManageSharesgate, and every call answers['bob'];undefined/own/orgproduce nowarnat all;The plugin-side notice pin also asserts the prefix the CLI quotes.
packages/cli/test/capability-preflight.test.tsgains three pins:hierarchy-securityno longer contains "no log line says so" and names the[sharing] hierarchy scope NOT widenedprefix;Acceptance notes
9c805c664c), comment only: the comment on the unmounted-known-tokens block inpackages/cli/src/commands/serve.tsno longer says the owner-only fallback happens "without a word". It now says the runtime logs it once at the first fallback, and thatos servesays it at start-up, before any request. Readings on that file: eslint--no-inline-configexit 0; check:doc-authoring, check:issue-citations, check:nul-bytes, check:closed-ceremony-text and check-drift-comment all exit 0.Verification
Two-minute check:
pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/sharing-service.test.ts -t "said once per boot"should show 6 passed.Files to read first:
packages/plugins/plugin-sharing/src/sharing-service.ts. The risk hunk is theif (!resolver)branch inresolveOwnerScopeIds.Round-1 readings are on head
e26a7e36bb. Round-0 readings, on4ae41bb446, are kept below.Two-minute check (CLI):
pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2 test/capability-preflight.test.tsshould show 50 passed.Round 1 (e26a7e3): affected test files, CLI ablation, derived gates
NOT MEASURED:
check:dual-build-cjs-loadsandcheck:i18n. Reason: both exit 3 PREREQUISITE NOT MET, for want of a repo-wide build; CI runs both.Declared narrowing: the full CLI
unittier andpnpm --filter @objectstack/cli typecheckwere not run locally. The verify lock was queued for about 75 minutes behind dogfood runs, so the build was narrowed to the closures the two touched test files import. CITest CoreandTypeScript Type Checkrun the full set.Round 0 (
4ae41bb446):Package test + typecheck (under os-verify-lock)
Ablation: latch removed, the once-pin goes red; restored by blob hash
Derived gates (dispatch-gates --commands, reconciled with --ran)
NOT MEASURED:
check:dual-build-cjs-loadsandcheck:i18n. Reason: both exit 3, PREREQUISITE NOT MET, because they need a repo-wide build (58+ packages withoutdist/). CI runs both. As a direct substitute, the rebuiltplugin-sharingdist/index.js(CJS) anddist/index.mjs(ESM) both load and exportSharingService. Also run, beyond the derivation:check:startup-registry-verdictexit 0 andcheck:durability-log-levelexit 0.Not run locally: the full
test:repoproject (CITest Core), dogfood (no!and no narrowing arm), andpnpm lint(CI-owned).Generated by Claude Code