Repository navigation
docs(permissions): generate the system-context site register; behaviour rows key their reads by symbol name - #26522
Merged
Conversation
…y their reads by symbol name WIP: the behaviour rows name their symbols in a Symbol column, and a generated region lists every census site with its read count and owning rows. check-system-context-census gains --write and a drift check. Claude-Session: https://claude.ai/code/session_01ADHkmSHnQFa1PEAAXJ9hmc Co-authored-by: Claude <noreply@anthropic.com>
…ext page; self-test the register Claude-Session: https://claude.ai/code/session_01ADHkmSHnQFa1PEAAXJ9hmc Co-authored-by: Claude <noreply@anthropic.com>
…-08uk9o # Conflicts: # content/docs/permissions/system-context.mdx
…merging main main moved resolveOneHopRelated into engine-master-detail-related.ts; the register follows it and row 29b is unchanged. Claude-Session: https://claude.ai/code/session_01ADHkmSHnQFa1PEAAXJ9hmc Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · devx seat 2 · 2026-10-27T06:26ZSeat
Landing: ready + auto-merge once CI on this head is green. The card closes on |
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #26442
Part of #26431
Clause-②: no
Metadata-protocol: none
维护者速读
system-context.mdx的行为表不再手写文件路径。每行在新的Symbol列里只写符号名(如registerAuthzMiddleware)。页尾新增一个生成区「Site register」,每个有 isSystem 读点的符号一行,写完整的path#symbol、该符号里的读点数和归属的行号。check-system-context-census.mjs加了--write来重生这个区,检查时要求它和树上算出来的一字不差。--write,登记表变一行,行文不动。本 PR 开发期间 main 正好又挪了一次(resolveOneHopRelated挪进engine-master-detail-related.ts),合并后跑--write,登记表变了一行,没有手改任何一行。scripts/check-system-context-census.mjs里新加的resolveRowKeys和evaluateRegister(F 段);再看页面## The table一节的Symbol列和页尾## Site register。pnpm check:system-context-census,预期自测 all cases passed,门禁最后一句以the generated register (132 symbol(s)) matches the tree.结尾。domain:server确认符号清单(见下方 Server-lane confirmation)。What changes
Generate, not retire. The card offered two ways. This PR takes the generated one. The page is read: four docs pages link to it (
permissions/authorization.mdx,permissions/index.mdx,permissions/record-view-auditing.mdx,protocol/objectql/security.mdx), two source comments quote it (packages/objectql/src/engine.ts,security-plugin-authz-middleware.ts), and #26466 is about to link its row 1b. Its value is the per-row behaviour prose, which no generator can write. So the census half is split off and generated, and the prose stays hand-written. This is thetenant-audit-census.mdxsplit.The page (
content/docs/permissions/system-context.mdx)Anchorcolumn (and section 6'sSite) becomesSymbol. A cell names its symbols by name, for exampleregisterAuthzMiddleware. Which file holds each one is no longer written by hand.isUserContextWrite(3 files), andonInsert,onUpdateandstart(2 each). For these the row keeps the fullpath#symbolanchor (rows 12, 23c, 23d, 25, 26, 26b, 62). The shared resolver still checks them, and they still move the old way. Three non-read citations stay as full anchors, as before (READONLY_CLASS_REASONS,assertEngineOwnedWriteAllowed,registerCrudNodes).## Site registersection holds a generated region, marked like the tenant-audit page's. It has one line per census symbol:`path#symbol`, its read count, and the rows whoseSymbolcell names it. There are 132 lines and no total line, which keeps [Decision] isSystem 提权清单页(system-context.mdx):保留「每处提权都要登记」,正文统计数字删掉(B)、挪进生成文件(B')、维持(A),还是整页删(C) #22927's no-totals ruling.The gate (
scripts/check-system-context-census.mjs)evaluateRegister). Every census read must be owned by a row whoseSymbolcell names it ([read-without-a-row]). Every bare key must name exactly one file's symbol ([row-key-no-read],[row-key-ambiguous]). Every row must key at least one read ([row-without-a-read],[row-without-a-key]). The committed region must equal what--writerenders ([register-drift], which names the first differing line and the fix command). Missing or duplicated markers and a renamed key column are refusals ([no-register],[no-row-keys]).--write. It splices only the region, so every byte outside the marker pair stays the same. It refuses, writing nothing, while any read has no row: the generator never assigns a read to a row.--fixstill refuses with exit 2, and now names--write.--fixbattery is rewritten to "only--writewrites, and only the register" (5 cases). The precision battery gains a case showing the register now catches an added read (3 cases). The roster floor moves from 16 to 18.check:system-context-census,lint.yml, and anyisSystemread. So this PR is not Tier H.Why
The gate's
--fixwas retired (exit 2), so any change to an anchor was a hand edit. Measured onorigin/mainfor the 30 days to00a4593ad7: 84 commits touched the page, and 12 of them changed nothing on it but the path inside an anchor. For example:bdfad1fc7,366e4aa69,2e7127bc3(objectqlengine.tscuts), anddf893f6d7,c15fd9a72,82f5a111b,dd124e946,77a77e42f,3e514912a(plugin-securitysecurity-plugin.tscuts).With this PR, a symbol move is
node scripts/check-system-context-census.mjs --write, which changes one register line and no row.Server-lane confirmation (domain:server)
The triage line asks
domain:serverto confirm the symbol list. This PR does not change anyisSystemread. It only moves where each row writes its file. Please confirm two things:Symbolcell names the reads that row describes. The conversion was mechanical: a full anchor whosepath#symbolis a census read became its bare name when the name is unique, and nothing else changed. A row-by-row old/new listing is in the page diff, in the last cell of every table row.Rowscolumn is right. Each register line says which rows own the symbol. Five symbols are owned by more than one row:registerAuthzMiddleware(rows 1, 2, 30),insertinengine.ts(21, 22),updateinengine.ts(19, 20),refusePackageRequest(52, 54) andhandleMetadataRequest(50, 52).Tests
Red demonstration on a real tree: an
isSystemread ADDED inside a keyed symbol, without regenerating (head 8b1b4d8 vsorigin/main00a4593)scripts/ablation-replace.mjsaddedconst probeSecondRead = execCtx?.isSystem;insidepackages/objectql/src/engine-driver-options.ts#buildDriverOptions(row 24's key). The file was restored, andgit diff HEADwas empty afterwards.origin/main00a4593 (a detached control worktree):check-system-context-censusexit 0. This is the precision gap the page declared.Red demonstration: a keyed symbol MOVED to another file, then regenerated with zero row edits (head 8b1b4d8)
isPerfDisclosurePrincipal(row 13) was moved frompackages/observability/src/perf-timing.tsinto a new tracked file,perf-timing-moved.ts. The page was not touched.[register-drift],[unresolved-symbol],[file-without-a-row]and[anchor-is-not-a-read-site], one each. The drift line namesperf-timing-moved.ts#isPerfDisclosurePrincipal | 1 | 13.--write: exit 0. The page diff is exactly one register line (-perf-timing.ts#…/+perf-timing-moved.ts#…), and row 13 is unchanged.--write: exit 0. The tree was restored afterwards, withgit diff HEADempty and the status clean.The same thing happened for real during this card.
origin/mainmovedresolveOneHopRelatedintoengine-master-detail-related.ts. The merge conflicted only on the old anchor cell, which was resolved to the bare-key side. The gate then went red ([register-drift],[file-without-a-row],[anchor-is-not-a-read-site]), and--writechanged one register line (commit 4d2bbfe).Self-test and gate on HEAD
Acceptance notes
Card acceptance. A symbol move needs no hand edit of the table: shown above, twice.
check-system-context-censusis a drift check over generated output plus the row-ownership rules. Its anchor checks are kept.The register's read count is a tripwire, not a row requirement.
--writeclears a count change without touching the row, as the old site-total generator did. The page and the gate header both say so. Whether the row still describes the symbol is the reviewer's call.Pinned keys still move by hand. Seven rows pin a name that two files share. A refactor that moves one of those files still means editing the anchor. A new collision is refused by name the day it appears (
[row-key-ambiguous]).Prose citations still move by hand. Anchors in prose outside the tables (for example the "What
isSystemdoes not do" table,enforceAuth,stampSystemInsertOwner) are citations. The shared resolver still holds them.Not merge-driver routed. Like
tenant-audit-census.mdx, the page text-merges. A merge that leaves the region wrong is F's drift refusal on the PR and in the queue, as happened here.Stale comments outside this card's file surface (not edited here). Three comments now say something false:
.gitattributesL97–108 says "nothing on it is generated".scripts/regen-artifacts.mjs,NOT_DRIVER_MANAGEDrowcontent/docs/permissions/**, says it "is plain prose now". That row also prescribes routing any generated page here;tenant-audit-census.mdxis not routed either.scripts/git-merge-regen.mjsMIXED_COMPARATORSdescribes--fixrewriting line anchors. That was already stale before this PR.These are left to the seat.
Verification
Readings on head
4d2bbfe38, which includes the merge oforigin/mainat3ebac9f5f:node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 64 derived commands, every exit captured before any pipe. All 64 exited 0.check:pm-dispatch-gatesran its fast tier (1935 cases, 394s). Two families first exited 1 and 3 because the merge leftpackages/spec's build older than its sources (check:docs: json-schema older than src;check:skill-examples: exit 3, prerequisite). Afterpnpm --filter @objectstack/spec build, both exited 0.--ran:64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN(a DERIVED zero: all 64 recorded an exit code and none is 3).pnpm exec eslint --no-inline-config scripts/check-system-context-census.mjs: exit 0.Build DocsandPlan Test Core shardssteps, which the derivation names as path-scheduled with no local invocation. CI runs them on this PR.Changeset:
skip-changeset. The diff is a docs page and a repo-internal gate script, and nothing publishes.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the changed script: exit 0; the full run is CI's)main, one pull request.skip-changeset)packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmSHnQFa1PEAAXJ9hmc
Generated by Claude Code