Repository navigation
feat(plugin-security): delete the curated capability seeder — the boot writes no sys_capability row for the platform's capabilities (ADR-0131 D3, #15204 stage 6b-1b) - #22709
Conversation
…p-system-capabilities) The boot no longer writes sys_capability rows for the platform's curated capabilities or for undeclared systemPermissions names; the curated ones are served by the registry since 6b-1a. The seeder's own test goes, the cases in other suites that asserted its behaviour go, the one that only used it to set up a platform row inserts that row directly, and comments that would now be false are reworded. Claude-Session: https://claude.ai/code/session_0113mDBBZPBFzvZqbJqfaFMv Co-authored-by: Claude <noreply@anthropic.com>
…y row Claude-Session: https://claude.ai/code/session_0113mDBBZPBFzvZqbJqfaFMv Co-authored-by: Claude <noreply@anthropic.com>
… seeder's write sites Claude-Session: https://claude.ai/code/session_0113mDBBZPBFzvZqbJqfaFMv Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 142 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 f473bb721047813018e12cfbc68ca6ee66fdf7f0 && git checkout f473bb721047813018e12cfbc68ca6ee66fdf7f0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d7b26df5b50f323dd42d693eea5d7de55922bdd1 b8df7fda7b8fc0205bae7d45995fac7c600cfc95 && git checkout -B drift-repro d7b26df5b50f323dd42d693eea5d7de55922bdd1 && git merge --no-ff b8df7fda7b8fc0205bae7d45995fac7c600cfc95
node scripts/docs-audit/affected-docs.mjs --json d7b26df5b50f323dd42d693eea5d7de55922bdd1
|
… PR corrects Claude-Session: https://claude.ai/code/session_0113mDBBZPBFzvZqbJqfaFMv Co-authored-by: Claude <noreply@anthropic.com>
…h no sys_capability row Claude-Session: https://claude.ai/code/session_0113mDBBZPBFzvZqbJqfaFMv Co-authored-by: Claude <noreply@anthropic.com>
…b1b-system-capability-seeder # Conflicts: # packages/plugins/plugin-security/src/bootstrap-system-capabilities.ts # packages/plugins/plugin-security/src/security-plugin.ts
|
os-dev-report addendum: landing patch round (6b-1b, ruling 6104498446) Merge head Conflict resolutions
Gate and suite exits (all at
Each sentence re-verified against
The PR stays a draft. Generated by Claude Code |
Contract reviewServed-tier: Post-hoc audit after merge. PR #22709 (stage 6b-1b of #15204) was queued on ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Part of #15204
Clause-②: no
Stage 6b-1b of the cutover plan only (claim amendment 6098440046): the curated and derived-default capability seeder
bootstrapSystemCapabilities(packages/plugins/plugin-security/src/bootstrap-system-capabilities.ts) is deleted, with its test, its import and its one call insecurity-plugin.ts. This is a deletion only (batch #310 item 4). The rest of #15204 stays open.bootstrapDeclaredCapabilities,capability-name-collisionand 6b-1a's transitional engine view are 6b-1c's and are kept as they are. Nosys_capabilityrow is deleted,sys-capability.object.tsis unchanged, and who may author a capability is unchanged (#22621 → A).Landing: after stage 5 (C9), per stage-0 order correction 3. This PR stays a draft until the PM schedules it.
Premise, re-verified on
origin/main96469912main: 995 lines, plus a 1,376-line test. Its only production caller issecurity-plugin.ts(import:88, call:5015).index.tsdoes not export it.claude/issue-15204-*heads are s1, s3 and s6c-prep. Of these, only s6c-prep touches the module, and only to repoint one import (per-organization-catalogtoorganization-scope, 2 lines). Whichever of the two PRs lands second gets a modify/delete conflict on this file, and the fix is to keep the deletion.builtin-capabilities.boot.test.tsasserts it.Who reads
sys_capabilityrows (re-measured on this tree)nav_capabilities(security-plugin.ts:1612) and the object's list pagesys-capability.object.tslookup providers (:122,:132,:142)security-plugin.ts:7652–:7710, stage 8-pre)PLATFORM_CAPABILITY_NAMES, not the seeded rows; it reads a row only to detect a renamecli/src/utils/organization-ownership-inventory.ts:349lint/src/validate-capability-references.ts:97dataseed declarations, not rowsNo runtime authorization path reads a row: grants resolve by the name in
systemPermissions(core/src/security,rest,objectql,servicesgrep: zerosys_capabilityreads).Measured fresh-database effect (showcase,
pnpm dev -- --fresh, this branch, all three reads asadmin@objectos.ai)main, from the 6b-1a report 6096357309 and the boot pin's old census)GET /api/v1/data/sys_capability(the Setup capability list)platform+ 2packageshowcase.export_data,showcase.restricted_ops, bothmanaged_by: packageGET /api/v1/meta/capabilityGET /api/v1/meta/capability/manage_usersThe derived half adds nothing: the 6b-1a report measured that every
systemPermissionsentry of the platform's default sets is curated, and the showcase's one non-curated grant (showcase.export_data) is its own declared capability.Changes
bootstrap-system-capabilities.ts(995) andbootstrap-system-capabilities.test.ts(1,376).security-plugin.ts: removed the import, thebootstrapSystemCapabilitiestry block, and thematerializedCapabilityNameshandoff. That variable existed only to feed the deleted call, and undernoUnusedLocalsit cannot stay. ThebootstrapDeclaredCapabilitiescall, its arguments and thewithoutPlatformCapabilityDeclarationsview are unchanged; only itsconst capOutcome =binding goes. Two comments that would now be false are reworded: the seeding block and the curated-name gate's doc.bootstrap-seed-round-trips.test.ts: the#11451/#11520describe asserts the seeder's own round trips, so its eight seeder cases go. One case (the existing callers still emit their exact key set) only callsbootstrapDeclaredPermissionsand fencesbuildExistingByName. It is kept, in a describe of its own.bootstrap-declared-capabilities.test.ts(measured here; not in the amendment's list):CLAIMS a derived … placeholderused the seeder only to set up aplatformrow, so it now inserts that row directly.declared name suppresses the implicit derived placeholder, and eight#4967 Part 1cases, assert how the two seeders combine, so they go.materializedNames reconciles with the outcome countersstays. The whole file goes in 6b-1c.builtin-capabilities.boot.test.ts(measured here; 6b-1a's pin): its census expected the nine curated rows. It now expects only the stack's package row, on a fresh database and on a re-opened one, with zero writes on the second boot. This is the stage's acceptance pin.seed-name-lookup-degradation-audible.test.ts,bootstrap-platform-admin-seeded-provenance.test.ts,sys-capability.organization-unique.test.ts,driver-sql/…/sql-driver-declared-index-organization-respelling.test.ts: each named the seeder in a comment only. The sentence that would now be false is reworded or dropped. No assertion changes.builtin-capabilities.ts(item 2 of its header),spec/src/security/capabilities.ts(its consumer list; doc comment only, no schema or export change),lint/src/validate-capability-references.ts(the "mirrors bootstrapSystemCapabilities" clause).scripts/engine-double-contract.baseline.jsonloses the deleted test's row.node scripts/tenant-audit-census.mjs --writere-counted the write call sites (241 → 239, two erased-receiver sites gone). The hand-written prose counts oncontent/docs/permissions/tenant-audit-census.mdxare corrected to match, as the gate requires..changeset/15204-s6b1b-system-capability-seeder.md,@objectstack/plugin-securityminor.Verification
--filter '@objectstack/plugin-security...',lint...,driver-sql...,dogfood^...,runtime..., plus the packagesdual-build-cjs-loadsneeded: all exit 0.plugin-security:typecheckexit 0 (tsc, scripts, andcheck:test-typecheck, which covers the tests);vitest run: 197 files, 4055 passed / 45 skipped, atb88b3567. The later commit264e056dtouched only the two census docs.lint: 135 files, 6231 passed; typecheck exit 0.driver-sql: the edited file passed 26 tests; typecheck exit 0.runtime:standalone-stack-seeder-declaration-copypassed 13 tests.security-catalog-showcase,audit-log-audit-capability,showcase-d3-d4-capabilities,me-apps-and-everyone-baselineandorg-admin-affordance-reach: 5 files, 69 passed.dispatch-gates --commandsderived 121 commands.--ranreconciles 121 derived, 121 run, 0 NOT-MEASURED, 0 UNRUN. The first pass of four commands needed work before they passed:check-tenant-audit-censusand its self-test went red on this diff's real count change, and were fixed above.check-plugin-teardown-shape --self-testneeded an unshallowed clone.check:dual-build-cjs-loadsneeded 8 packages built outside the closure.Acceptance notes
sys-capability.object.ts:87still says "The two production readers of the table are both seeders (bootstrap-system-capabilities.ts,bootstrap-declared-capabilities.ts)". The amendment excludes any change to that file, so it waits for stage 8, which retires the object. Carrier: stage 8.platformrows stay (no row is deleted). They are no longer refreshed at boot, and stage 8 / C7b retire them.Generated by Claude Code