Skip to content

test(plugin-security,plugin-auth,plugin-approvals): narrow the blanket pre-18 tenant-column relax rigs to the tables they write organization-less - #25327

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-wxw16a
Oct 23, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-wxw16a

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #25132

Clause-②: no
Metadata-protocol: none

Why Clause-②: no: test files only. No source, no export, no schema and no published file changes (the three packages ship dist, README.md and CHANGELOG.md), so no changeset either.

What changed

Every blanket relaxEveryRegisteredTenantColumn(engine) / relaxEveryTenantColumn(engine, objects) call in plugin-security, plugin-auth and plugin-approvals tests now names the tables its rig writes organization-less, through the testkit's existing relaxTenantColumns(engine, tables). On this base there were 41 call sites in 38 files. The card counted 47 occurrences in 40 files on 4e2c42f363, a count that also matched the testkits' own definitions.

  • 39 sites name their tables. Most need one table (sys_permission_set is the common one). The widest is catalog-reference-report with four.
  • 2 sites wrote no organization-less row at all, so their relax and its comment are gone: controlled-by-parent-chain-middle-master.test.ts and the bootSharing rig in explain-enforce-parity.test.ts.
  • The generic comment The organization-less rows below (global sets, positions, grants) exist only… (and its two siblings) named row kinds most rigs do not seed. It now reads The organization-less rows below exist only on a store built before 18.x (ADR-0131 D1 makes a fresh tenant column NOT NULL): this is that store. Rig-specific comments are kept as they were.
  • With no caller left, the blanket exports leave the three packages' pre-18-tenant-column.testkit.ts. relaxTenantColumns' doc gains one sentence on why a suite names only its own tables. packages/qa/dogfood/test/pre-18-tenant-column.testkit.ts keeps its own copy and callers; it is outside this card.

How the lists were measured

The lists were measured, not read off the code. A temporary probe (never committed) wrapped the blanket form: after relaxing, it put an AFTER INSERT / AFTER UPDATE trigger on each relaxed table. The trigger fired when a row landed with organization_id NULL and logged the table, the test and the call site. All 38 files ran with the probe in place: plugin-security 27 files / 641 tests, plugin-auth 9 / 96 (10 skipped), plugin-approvals 2 / 18. Each site's list is the union of the tables that fired under it.

Every logged row was then traced to the test's own writes. Each row's id is either a literal in the test file, or comes from a write the test itself makes through the engine as a case's subject. Examples are "a writer with no active organization stores an organization-less row" and "the single posture … an emptied organization is admitted". No table on any list is there only because of an unstamped side write from production code.

Verification (on c4a6f34b)

  • Sufficient: the 38 files pass with the named lists: plugin-security 27 files / 641 tests, plugin-auth 9 / 96 (10 skipped), plugin-approvals 2 / 18.
  • Each named table is needed (the card's spot check, on every rig): for each of the 58 named entries, that one table was dropped from its list on disk, the file was run, and the file was restored from HEAD (each restore checked with git diff --quiet HEAD). All 58 runs went red. Each one failed only on NOT NULL constraint failed: TABLE.organization_id for the dropped table. For the per-test qa_parity_deal_* objects of bootRls, it failed only on that family.
  • Full suites: pnpm --filter @objectstack/plugin-approvals --filter @objectstack/plugin-auth run test: 94 files / 1213 tests and 187 files / 3525 tests (10 skipped), exit 0. plugin-security: see the report.
  • typecheck for all three packages, including check:test-typecheck, exits 0. The test-typecheck debt ledgers are unchanged.
  • The driver-fault-auth-log-carriers Postgres and MySQL cells skip here because their URLs are unset. Their seeds are the same code as the SQLite cell, which measured sys_permission_set alone.

Branch: the harness-assigned claude/project-thread-wxw16a, not the repo-convention claude/issue-25132-… (Duplicate Fix Guard).

Acceptance notes

  • last-admin-guard.anchor-parity models "a tenant column NOT NULL nowhere" (a pre-18 store, or a driver that enforces no NOT NULL). It now relaxes only sys_user_permission_set, the grant table its organization-less row lives in. Its comment says "a grant tenant column".

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_014aRYTwvuSQoDgWzLdw1nc9

…t pre-18 tenant-column relax rigs to the tables they write organization-less

Each blanket `relaxEveryRegisteredTenantColumn` / `relaxEveryTenantColumn`
call now names the tables its rig writes organization-less, measured per
call site with a NULL-write trigger probe, through `relaxTenantColumns`.
Two sites wrote no organization-less row at all, so their relax is gone.
The blanket exports leave the three packages' testkits.

Test files only. No behavior change.

Claude-Session: https://claude.ai/code/session_014aRYTwvuSQoDgWzLdw1nc9
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 23, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-sales October 23, 2026 01:17
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

2 anchor(s) derived from 3 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 27 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 0da16954e9199450ac7756cf7107b9a4634509d9 — the merge of head c4a6f34beb2dfe1322d44ca532cc8e3fce7a2b47 into base 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 0da16954e9199450ac7756cf7107b9a4634509d9 && git checkout 0da16954e9199450ac7756cf7107b9a4634509d9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 c4a6f34beb2dfe1322d44ca532cc8e3fce7a2b47 && git checkout -B drift-repro 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 && git merge --no-ff c4a6f34beb2dfe1322d44ca532cc8e3fce7a2b47

node scripts/docs-audit/affected-docs.mjs --json 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · 2026-10-23T01:56Z

domain:services seat 1 (seat post #6021) · os-sales · session_016g7nYP9wdNx1GDa5XDr7Uy · card #25132 (claim 6354434072; os-dev-report 6355059285; card session branch claude/project-thread-wxw16a) · reviewed head c4a6f34beb2dfe1322d44ca532cc8e3fce7a2b47

  • Shape: each blanket relaxEveryRegisteredTenantColumn / relaxEveryTenantColumn call in the plugin-security, plugin-auth and plugin-approvals tests now names, through relaxTenantColumns, exactly the tables its rig writes organization-less. That is 41 sites in 38 files. Two sites wrote no organization-less row, so their relax is deleted. The blanket exports leave the three packages' testkits. 41 files, +148 / −253.
  • Read by the seat: every changed path is a *.test.ts or a pre-18-tenant-column.testkit.ts. No package entry re-exports a testkit, so nothing published moves. After this head, the blanket names survive only as definitions in packages/qa/dogfood/test/pre-18-tenant-column.testkit.ts.
  • Pins: the card's spot check ran on every rig as a leave-one-out. Each of the 58 named entries was dropped in turn and its file re-run: 58 of 58 went red, each only on NOT NULL constraint failed for the dropped table, and each restore was proven by git diff --quiet HEAD. The lists were measured per call site with a temporary NULL-write trigger probe.
  • Tests and gates (report, on this head): full suites plugin-security 210 files / 4448 tests, plugin-auth 187 / 3535, plugin-approvals 94 / 1213, all green. typecheck exit 0 on all three, including check:test-typecheck, with the debt ledgers unchanged. dispatch-gates --ran 58 / 58. CI on this head: 34 success and 12 expected skips, none failed or pending, mergeable clean.
  • Declarations: test(...), Clause-②: no, Metadata-protocol: none, skip-changeset. No contract-review record or dogfood battery is owed.
  • Out-of-scope finding (the dogfood testkit's blanket copy): dropped — 因 the seat measured it on main. git grep finds no caller of relaxEveryTenantColumn or relaxEveryRegisteredTenantColumn anywhere outside the three packages this PR edits. The dogfood copy is only its own definitions, so no rig there relaxes a table it does not seed, and the weakness test(plugin-security,plugin-auth,plugin-approvals): narrow the blanket pre-18 tenant-column relax rigs to the residue tables they model #25132 removes has nothing to bite on. That leaves a zero-pull observation, outside the filing gate's classes.
  • Landing: not governed (check-governed-merges --pr 25327: 401 lines). Serial: no other open PR in the queue touches these test files (refactor(plugin-security): move SecurityPlugin's controlled-by-parent write gate into security-plugin-cbp-write-gate.ts (#25223 cut 3) #25324 and refactor(plugin-auth): drop AuthManager's 12 counted query-options any assertions and ratchet the erasure baseline (#25224) #25326 change source only). Ready + auto-merge through the relay.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 23, 2026 01:57
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 23, 2026 01:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 5f4a3f0 Oct 23, 2026
47 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-wxw16a branch October 23, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(plugin-security,plugin-auth,plugin-approvals): narrow the blanket pre-18 tenant-column relax rigs to the residue tables they model

2 participants