Skip to content

docs(verify): posture-only docblocks say what the stand-in walls and what it does not - #28760

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-28703-verify-posture-docblock
Nov 1, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-28703-verify-posture-docblock

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread

Fixes #28703

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:只改 packages/verify/src/harness.ts 里的注释(SimulatedOrgScopingPlugin、BootOptions.multiTenant: 'posture-only'、orgContext 一段、一行行内注释),外加一条 @objectstack/verify patch changeset;不改任何代码。
  • 为什么改:旧注释说 posture-only 启动"不打 organization_id、不做隔离,跨组织测试写了也白写";ADR-0131 之后引擎按姿态落组织、Layer 0 按姿态拦截,注释与代码正相反,会让写测试的人放弃本可低成本钉住的跨组织隔离。
  • 风险与回滚:零运行时风险(仅注释,dist/index.d.ts 里的 JSDoc 随之变化);回滚即 revert 本 PR。
  • 先看:packages/verify/src/harness.ts 的 multiTenant 文档块("What it walls" / "What it does NOT give a fixture" 两节);其次文件顶部 SimulatedOrgScopingPlugin 文档块。
  • 两分钟验证:git diff origin/main...HEAD -- packages/verify/src/harness.ts,预期只见注释行变动、无一行代码变化。
  • 需要你做的:无,席位落地。

What changes

Comments only, in packages/verify/src/harness.ts, plus a patch changeset for @objectstack/verify (the BootOptions JSDoc ships in dist/index.d.ts, so the published bytes change).

  • SimulatedOrgScopingPlugin docblock. The "⛔ It stamps no organization_id and scopes no query" sentence is replaced. The stand-in itself still stamps and scopes nothing, but since ADR-0131 (D8, D11) the wall is open-core code that keys on the posture the stand-in makes true. The engine lands an insert in the caller's active organization (ObjectQL#driverWriteTarget), the SQL driver fills an absent organization_id (SqlDriver#injectTenantOnInsert), and reads are scoped by the one Layer 0 verdict (computeTenantLayer0Verdict, postureEnforcesWall).
  • BootOptions.multiTenant 'posture-only' section. "It performs no tenant isolation whatsoever … would assert nothing and pass" is removed. Two subsections replace it:
    • What it walls: insert and read, with the code locations behind each.
    • What it does NOT give a fixture: no default-organization bootstrap (the admin resolves org-less), no per-organization seed replay, no walled membership-policy gate, no deployment declarations on the service, and the memory driver refuses a walled posture.
      The section tells a cross-organization fixture to measure the wall, and points to the precondition case of packages/qa/dogfood/test/create-caller-id-collision-walled.dogfood.test.ts as the shape.
  • orgContext docblock. "Cross-tenant isolation has exactly one honest proof in this repo: multiTenant: true" is replaced. A cross-tenant fixture needs a walled posture, either 'posture-only' or true. The "asserts nothing on single" sentence stays, because it is still true. It now names the Layer 0 verdict as well as the RLS strip.
  • Inline comment at the 'posture-only' branch of bootStack: "activates the POSTURE, never the WALL" now says the open core's wall follows from the posture.

Tests

No behaviour changes, so no test was added or changed.

Local runs at head 5b630f0
  • pnpm --filter '@objectstack/verify...' build (under os-verify-lock): VERDICT command-exit 0.
  • pnpm --filter @objectstack/verify typecheck: VERDICT command-exit 0. check:test-typecheck: OK.
  • pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2: Test Files 48 passed (48), Tests 401 passed (401), VERDICT command-exit 0.
  • Published-surface check after the build: dist/index.d.ts contains "What it does NOT give a fixture" (1 match) and "performs no tenant isolation whatsoever" (0 matches). The positive control databaseDriver has 2 matches. files is ["dist","README.md","CHANGELOG.md"].

Acceptance notes

  • Changeset level. os-dev's fast track lists comments as not published. Here, though, the BootOptions JSDoc measurably ships in dist/index.d.ts, so this takes a patch changeset, not skip-changeset.
  • Left as is (out of scope). The SimulatedOrgScopingPlugin docblock still says "The proof that the REAL plugin walls tenants lives in cloud's security-enterprise multi-org integration test". The read wall is now open-core code that this repo pins too (see the walled pin above), so that sentence understates where the proof lives. It is not a defect, and this PR does not touch it.
  • Spec docblock (not edited, out of scope). postureStampsOrganization's docblock in packages/spec/src/security/tenancy-posture.ts says the stamper is the enterprise runtime, "not the open engine". The open engine plus the SQL driver now stamp the active organization on insert in every posture (ObjectQL#driverWriteTarget, SqlDriver#injectTenantOnInsert). This looks like the same class of drift in another package. It is noted here and not filed.

Verification

Derived gate families (dispatch-gates --commands, head 5b630f0)
  • 54 derived families. 53 exited 0.
  • 1 is NOT MEASURED: pnpm check:dual-build-cjs-loads exited 3 with PREREQUISITE NOT MET because it needs a full pnpm build and only the verify closure was built. CI runs it.
  • node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE reports 54 derived famil(ies) accounted for — 53 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3) and exits 0.
  • Every family CI runs, the repo-wide ones included, is CI's to report on this PR.

Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd

🤖 Generated with Claude Code

…what it does not

The SimulatedOrgScopingPlugin and BootOptions.multiTenant 'posture-only'
docblocks said nothing stamps organization_id and that a cross-tenant
fixture booted that way would assert nothing. Since ADR-0131 D8/D11 the
engine lands an insert in the caller's active organization, the SQL
driver stamps it, and the one Layer 0 verdict walls reads by posture.
The docblocks now say so, tell a fixture to measure the wall, and name
what the stand-in still does not give (default-org bootstrap, seed
replay, membership-policy gate, service declarations, memory driver).
Comments only.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
…rify-posture-docblock

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/verify, touching 2 documentable anchor(s).

⛔ 1 release-owned page(s) name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via BootOptions (symbol, a top-level interface))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 60 of 215 client-bound route-ledger rows — the other 155 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 155: 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; 100 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 — 7 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 5493b8842995fabb0979ae535301d3f3cb9fc65e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 46a22688896d32187c069e7ba6a9a61c6fcd07fd — the merge of head 5b630f038e09b5e97f4893a83e560a264e92ac32 into base 5493b8842995fabb0979ae535301d3f3cb9fc65e, 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 46a22688896d32187c069e7ba6a9a61c6fcd07fd && git checkout 46a22688896d32187c069e7ba6a9a61c6fcd07fd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5493b8842995fabb0979ae535301d3f3cb9fc65e 5b630f038e09b5e97f4893a83e560a264e92ac32 && git checkout -B drift-repro 5493b8842995fabb0979ae535301d3f3cb9fc65e && git merge --no-ff 5b630f038e09b5e97f4893a83e560a264e92ac32

node scripts/docs-audit/affected-docs.mjs --json 5493b8842995fabb0979ae535301d3f3cb9fc65e

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 5493b8842995fabb0979ae535301d3f3cb9fc65e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

席位核对 — ACCEPT · domain:devx#2 · head 5b630f038e09b5e97f4893a83e560a264e92ac32 · 2026-11-01T18:18Z

Checked against GitHub and the PR head, not against the report (os-dev-report 6561820531 on #28703).

  • Shape: a draft to main with Fixes #28703 once, Clause-②: no and Metadata-protocol: none. It has no assignees and no reviewers. The PR changes doc comments in packages/verify/src/harness.ts and adds one patch changeset for @objectstack/verify. A changeset is right rather than skip-changeset: the BootOptions doc comment ships in the package's dist/index.d.ts, so consumers see the new text.
  • Path surface: two files (+95/−29). check-governed-merges --pr 28760 reports it NOT governed and under the 3000-line threshold. No runtime line changes, and it touches no contract face, so the seat reads it with CI and no second agent.
  • Card rules, read in the diff: both docblocks now say what the stand-in does. The "would assert nothing" sentence is gone, and a new "What it does NOT give a fixture" list keeps the limits. The seat checked every symbol the new text cites at the head:
    • ObjectQL#driverWriteTarget is in packages/objectql/src/engine.ts, and SqlDriver#injectTenantOnInsert and #applyTenantScope are in packages/drivers/driver-sql/src/sql-driver.ts.
    • computeTenantLayer0Verdict is in packages/core/src/security/tenant-layer0-verdict.ts, and postureEnforcesWall is in packages/spec/src/security/tenancy-posture.ts. computeTenantLayer0Filter is in plugin-security/src/tenant-layer.ts.
    • assertWalledMembershipPolicyDeclared (plugins/organizations) and assertSingleTenantPosture (driver-memory) exist as named.
    • packages/qa/dogfood/test/create-caller-id-collision-walled.dogfood.test.ts and enterprise-organizations.ts exist.
      The text tells an author to measure the wall, not assume it, and it describes isolation only as the code and ADR-0131 D8/D11 state it.
  • Gates: verify typecheck and its 401 tests exit 0. Of 54 derived families, 53 exit 0. check:dual-build-cjs-loads exited 3 because it needs a full build, and CI answers it. The seat lands once every check on this head is green.
  • Accepted deviations: the merge commit was amended before its first push to carry the trailer pair. Nothing was force-pushed.
  • Out of scope: the same defect in @objectstack/spec is filed as spec(security): the postureStampsOrganization docblock says the enterprise runtime stamps organization_id and the open engine only validates, the opposite of the code and of its own file header #28761. The postureStampsOrganization docblock says the enterprise runtime stamps and the open engine only validates, which contradicts the code and its own file header. The stand-in docblock's line that the real-plugin proof lives in a cloud test understates where the proof is now. It is a wording observation and needs no card. Skills-docs: none — doc comments in a test harness only.
  • Landing: non-governed. Once every check on this head is green, the seat marks the PR ready and enables auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 1, 2026 18:20
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 1, 2026 18:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit d08b859 Nov 1, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-28703-verify-posture-docblock branch November 1, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant