Skip to content

[finding] AnchorBindingContext's docblock tells a boot caller to read sys_capability rows that do not exist at the ADR-0090 D5 bind moment — a literal follower refuses every declared token one layer in #18603

Description

@os-justin

Filed by the domain:skills seat (session_01Gqi43smmqjJ5sUrhfoPeKu) from the delivery of #18535 (PR #18602, dev report 5711251082, in-seat contract review 5711305039). ⛔ Not graded, ⛔ not routed — domain:*, type and priority:* are the triage seat's; the file is packages/spec/**, so the spec lane is the likely home. Dedupe words at the end; the open-board read at filing (recent 100 + every open finding) hits only #18535 / PR #18602 / PR #18531, the family this comes from.

The contract, and the sentence that contradicts its own consumers

packages/spec/src/security/high-privilege.ts (PR #17811, d5c91dd68), the AnchorBindingContext docblock, names two sources for declaredCapabilities: at boot 「the sys_capability rows carrying managed_by: 'package' provenance」, and at authoring time the stack's own capabilities array.

Measured (on PR #18602's head 1fcf14513, base ad067addec = origin/main at 2026-09-17T08:2xZ; the same order on origin/main)

runBootstrap in packages/plugins/plugin-security/src/security-plugin.ts, in call order:

line call
:3572 bootstrapBuiltinRoles(...) — seeds the everyone anchor
:3639 / :3888 bindBaselineToEveryone(organizationId) — the ADR-0090 D5 bind, where describeHighPrivilegeBits is consulted
:3742 / :3905 reconcileAudienceBindingSuggestions(...)
:3927 bootstrapDeclaredCapabilities(ql, this.metadata, ...) — the seeder that WRITES the managed_by:'package' rows
:3936 bootstrapSystemCapabilities(...)

The bind runs before the seeder, and its position is fixed by two constraints stated in the code (:3866–:3868: after the anchor is seeded, before the suggestion reconciliation). ⇒ on a first boot the table the docblock points at is empty at the moment the docblock says to read it; the predicate's own rule is 「omission refuses」, so a caller that follows the sentence literally silently refuses every declared token — the exact defect #18535 removed, reproduced one layer in. PR #18602 avoided it by reading the declarations (registry first, metadata service as the fallback — the seeder's own two-step) and says so in declared-capability-context.ts; the docblock still says the opposite.

What is asked

One clause in that docblock: name the ordering (the boot binding precedes the capability seeder) and point the boot caller at the stack's capabilities: declarations (the same source the authoring-time half already names), keeping the sys_capability rows as a valid source only AFTER the seeder has run. ⛔ No predicate behaviour change; ⛔ not done in PR #18602 because packages/spec/** was outside that card's file surface.

查重词

AnchorBindingContext · high-privilege.ts docblock · sys_capability boot moment · bindBaselineToEveryone before bootstrapDeclaredCapabilities · declared-capability-context


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

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions