Skip to content

finding: getPolicy()'s disabled-branch redactFields read has no reader once publicSharing.enabled is held at redemption (#14033) #14581

Description

@claude

Observation-class finding (dead code), unassigned — filed by the os-dev seat working #14033 (branch claude/issue-14033-public-sharing-enabled-standing-policy, session session_01AUF1NoViznQK32gqpK8wS8).

What is dead, and since when

packages/plugins/plugin-sharing/src/share-link-service.tsgetPolicy(): the enabled !== true branch still reads raw.redactFields (landed by PR #14171 for #13856, so that opting an object OUT of publicSharing could never WIDEN what an already-minted token serves). The maintainer's #14033 ruling (2026-09-01, verbatim: 「enabled 关 ⇒ 整块不生效 ⇒ 拒付(子键求值 moot)」) is implemented by the #14033 PR as a gate in resolveToken() that returns null BEFORE any sibling key is evaluated. After that gate:

  • resolveToken() never reaches the policy.redactFields union for a switched-off block (it has already returned);
  • createLink() never reads policy.redactFields on any branch (it reads enabled, allowedPermissions, allowedAudiences, maxExpiryDays, eligibility).

So the disabled-branch read has no reader, and the comment block beside it ("it must never strip the object's declared redactions from tokens that still serve") describes a case that no longer exists: no token on a switched-off block serves.

Why it was not touched in the #14033 PR

The dispatch fenced #14171's redactFields logic explicitly (ruling note: 「redactFields 半边在 #13856 已派发,⛔ 不合卡、不重做」), and the ruling says the sibling keys under a switched-off block are MOOT — not that their reads must be removed. Recording it here rather than folding it in.

Proposed disposition (either is fine — no behaviour depends on it)

  1. Collapse the disabled branch back to redactFields: [] and rewrite the comment to cite [Decision] What does turning publicSharing.enabled off mean for an ALREADY-MINTED share link? — the parent switch is mint-only while its own child predicate is now a standing policy #14033 (the redemption gate is what keeps opt-out from widening anything now). The four fix(plugin-sharing): declared publicSharing.redactFields survive the object opting out #14171 pins that read the set with the switch OFF are already reversed and registered in share-link-service.test.ts; the enabled: true control pin stays.
  2. Leave the read (harmless) and delete only the stale comment.

Evidence: share-link-service.ts getPolicy() disabled branch (the [#13856] comment + the redactFields ternary); resolveToken() [#14033] gate directly above the loadRecordForServing call.

Generated by Claude Code


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions