Repository navigation
feat(plugin-security): the boot writes no sys_position row — delete the built-in and declared position seeders and the everyone baseline junction writer (ADR-0131 D2, #15204 stage 6a) - #22793
Conversation
…rs and the everyone baseline junction writer Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
…umulator, the exemption and the per-organization permission-set pins Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
…base's unchanged rows and grants, and the everyone baseline as a declaration Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
…es a sys_position row; drop the deleted test from two gate baselines Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
…existing database's rows where a gate judges a row; refresh the census and the double ledgers Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
…a-position-seeders # Conflicts: # packages/plugins/plugin-security/src/bootstrap-seed-round-trips.test.ts # packages/plugins/plugin-security/src/security-plugin.test.ts # packages/plugins/plugin-security/src/security-plugin.ts
📓 Docs Drift CheckThis PR changes 1 package(s): 27 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 15 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 e82fcd5c0b5c730793dbee25a47a4d5d85b04b30 && git checkout e82fcd5c0b5c730793dbee25a47a4d5d85b04b30
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b7cd1af9df7ade29e165e838503cbbef05e4299e ac2d982b92d7931aefa2d3205dc9d5088e4be044 && git checkout -B drift-repro b7cd1af9df7ade29e165e838503cbbef05e4299e && git merge --no-ff ac2d982b92d7931aefa2d3205dc9d5088e4be044
node scripts/docs-audit/affected-docs.mjs --json b7cd1af9df7ade29e165e838503cbbef05e4299e
|
…a-position-seeders # Conflicts: # content/docs/permissions/tenant-audit-census.mdx # docs/audits/2026-08-tenant-audit-write-call-sites.counts.md
… on the merged tree; carry this branch's rows 11b/23b and the census prose figures over main's Claude-Session: https://claude.ai/code/session_01YLbobfnaoKFrxZcQZT8rYP Co-authored-by: Claude <noreply@anthropic.com>
Part of #15204 (ADR-0131 cutover, stage 6a). This PR deletes the built-in and declared position seeders and the
everyonebaseline junction writer. The card stays open for the remaining stages.Clause-②: no
Size: 36 files, +443 / −2,045 (2,488 changed lines) against
mainatb7cd1af9df. That is under the 3,000 line.Landing: this PR stays a draft until stage 5 (C9) lands, per order correction 3 of the stage-0 record on #15204. Setup's position pickers still read rows, so on a fresh database they would list no built-in position.
What is deleted
plugin-security/src/bootstrap-builtin-positions.ts(bootstrapBuiltinRoles, 166 lines)plugin-security/src/bootstrap-declared-positions.ts(bootstrapDeclaredPositions, 391 lines), with its test file (410 lines)security-plugin.ts:seedCatalogPositions,seedCatalogBuiltinsandbindBaselineToEveryoneclosures;resolveOwnOrganizationRow/seedCtximports that only they used.seedCatalogForOrganizationnow runs the one catalog step left (the permission-set seeder, which 6b-2 retires).isBuiltinPositionNameinbuiltin-positions.ts. Its only caller was the deleted declared-positions seeder's exclusion.per-organization-catalog.tsis untouched: 6a never imported it directly, and 6c retires it.bootstrap-platform-admin.tsimported nothing from the deleted modules (measured: no import, two comments only), so there is no seam with 6b-2.Why no grant moves
Since stage 1 the resolver reads position definitions:
everyone's baseline is the anchor's declaredpermissionSets.declareEveryoneBaselineregisters it atkernel:ready.this.baselinePermissionSets, which is the app's default set composed withmember_default.describeHighPrivilegeBitsagainst the same declared-capability contextbindBaselineToEveryoneused.So the junction rows this PR stops writing granted nothing. Measured:
builtin-positions.boot.test.tsboots the real plugin over SQLite in 3 postures × 4 variants, including a new existing database variant that holds the rows the retired seeders wrote.sys_positionrow and no ledger write in any variant. An existing database keeps exactly the rows it had.security-plugin.test.ts: theeveryonedefinition names the app set when its token is declared, and does not when the token is undeclared or names a platform capability. No junction row is written for either token.declared-position-provenance: a real showcase boot writes no position row, and a cold boot of an existing database re-stamps, refreshes and adds nothing.resolve-authz-context.batch-equivalence.golden.json) is not touched.Tests
Every test that imported a deleted module or pinned a deleted row:
bootstrap-declared-positions.test.tsaudience-anchors.test.tsbootstrap-seed-round-trips.test.tsbuiltin-positions.boot.test.tsbuiltin-positions.test.tsisBuiltinPositionNamecase deleted with the functioncatalog-reference-report.test.tsobjects/reserved-identity-names.test.tsplatform-provenance write; the exemption stays until stage 8 retires the objectper-organization-catalog.test.tseveryonerowssecurity-plugin.test.tsseed-write-refusal.test.tsshowcase-declarative-rbac-seedingdeclared-position-provenanceme-apps-and-everyone-baseline,showcase-d7-default-profileeveryonedefinition; no row is writtenshowcase-invoice-seed-isolationcontributordeclaration; no row or junction row is writtenshowcase-permission-zooposition-held-name-setup-createDocs and ledgers
authorization.mdx(the declared-positions bullet and the lifecycle row),positions.mdx,permission-metadata.mdx,system-context.mdx(rows 11b and 23b), andtenant-audit-census.mdx. The census is regenerated (238 → 233 write sites: the 5 deleted writes) and its prose figures are updated.builtin-positions.ts,reserved-identity-names.ts,position-catalog-refusal.ts,suggested-audience-bindings.tsandbootstrap-platform-admin.ts.engine-double-contract.baseline.json,engine-double-contract.pinned.jsonandobjectql-double-limit.baseline.jsondrop the doubles that went with the deleted cases.content/docs/releases/and anypackages/spec/srcpath. 6b-1c, now onmain, already rewrotehigh-privilege.ts's sentence namingbindBaselineToEveryone.Open question for the seat: the audience-binding suggestion confirm
Settled: the seat answered A in 6106681412 (no change in 6a). The confirm went to decision card #22801, ruled A (6108478638), and stage U2 builds it.
Measured on a real showcase boot of this head, with the app default CLI-wired:
showcase_member_defaultis a pendingeveryonesuggestion.everyonerow and no junction row.confirmAudienceBindingSuggestionneeds theeveryonerow, so a confirm on a fresh database answersSuggestionStateError("not seeded yet").On
main, by reading the code (this before-leg was NOT MEASURED in that wiring):confirmed(observed);In the default wiring both trees measured
pending. This is the suggestion-confirm path that release-cut condition (d) of the stage-1 ACCEPT already holds out of every release. No fix is built here (only delete; U2 belongs to its own stage). The report on #15204 carries the options.Acceptance notes
driver-sqlsql-driver-sys-position-organization-unique.test.ts:310,bootstrap-platform-admin-seeded-provenance.test.ts:204,objects/sys-position.organization-unique.test.ts:44andsuggested-audience-bindings-install-path.test.ts:139. Each reads as history of an existing database's rows. Not edited.objects/sys-position.object.ts(stage 8),seed-name-lookup.ts(7a),bootstrap-declared-permissions.ts(6b-2) andposition-write-through.ts(7b).scripts/measure-position-name-fold-census.mjsstill modelsbindBaselineToEveryoneas a junction producer. It is a measurement instrument whose question (name-fold vs junction) ADR-0131 retires. Carrier: none.Gates
Derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat headac2d982b(merge baseb7cd1af9df). Each command was run with its exit code recorded, and the record was reconciled with--ran: 105 derived, 104 run, 1 NOT MEASURED, 0 unrun.check-plugin-teardown-shape --self-testexited 3. A shallow clone cannot reach its pinned fixture commit, as on the sibling stages.Suites on the merged head
ac2d982b, each after a dependency-closure build (plugin-auth and the example apps were measured at68ba543eand not re-run onac2d982b; CI runs them):@objectstack/plugin-security(typecheck + suite)@objectstack/plugin-auth@objectstack/runtime@objectstack/dogfoodBefore-leg of the deletion: with the deletion in place and only the five importing test files fixed, the full plugin-security suite was red, with 22 failures in 3 files (the boot census, the catalog report's built-in precondition, and the #18535 junction cases). The first dogfood run was red too, with 15 failures in 6 files. Every one of them pinned a row the deleted seeders wrote. CI was not awaited.
Seat edits at landing round 1 (
ac2d982b, a merge ofmainb7cd1af9dfplus the census regeneration): the size base, the census figures, the gate head and the suite rows above, from the dev's report 6108751935. Lines 1–2 are unchanged.Generated by Claude Code