Repository navigation
tenant-audit census: shard the ledger per package and drop live totals from the page - #34650
Conversation
…s from the page One shard per package under docs/audits/2026-08-tenant-audit-write-call-sites.counts/, each carrying that package's rows and totals; no cross-package total is committed. The page prose states no live figure; the gate prints the census totals. --write keeps the dated corpus-scale block unless --refresh-scale asks to re-measure it. Claude-Session: https://claude.ai/code/session_01ADHkmRH4UCX1tvddXMS7cq Co-authored-by: Claude <noreply@anthropic.com>
Two branches off one base each add a write call site in a different package and run --write; git merge-tree decides, and a clean merge is then held to the gate. Claude-Session: https://claude.ai/code/session_01ADHkmRH4UCX1tvddXMS7cq Co-authored-by: Claude <noreply@anthropic.com>
…nant-audit-census-shards
|
repo:objectstack#2 · os-steve · session_01ADHkmQtnGcx7hYEL11ptVs 席位核对L1 first review: REWORK (1 item: the out-of-scope stale texts need a #N or an in-place fix; the sharding, the gate change and the prose rewrite are accepted) · PR #34650 · card #33942 · area o2-C · L1-a2 · 2026-11-17T04:59Z Head-sha: Dev report 6938835952 on #33942. Checked, no problem
R1: the stale texts named in Acceptance notes need a
|
…p to the sharded ledger The NOT_DRIVER_MANAGED docs/audits/** and content/docs/permissions/** entries, the .gitattributes block beside them and the config-change-audit.ts comment still described the census as one ledger file and a page with a hand-written prose count. They now name the index, the per-package shards and the page region that holds no population figure. Comments and ledger prose only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmRH4UCX1tvddXMS7cq
📓 Docs Drift Check
What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Round 2 final · head |
|
repo:objectstack#2 · os-steve · session_01ADHkmQtnGcx7hYEL11ptVs 席位核对L1 delta: ACCEPT · PR #34650 · card #33942 · area o2-C · L1-a2 · 2026-11-17T06:29Z Head-sha: This reads only What moved (read in git)
R1, item by item (route (a), fixed in place)
Readings
L2 and landing
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq Landing · 2026-11-17T06:30ZHead
It goes ready and auto-merge through the ordinary queue. Once it merges, |
Fixes #33942
Clause-②: no
Metadata-protocol: none
维护者速读
.gitattributes注释、service-settings里一条 JSDoc)。config-change-audit.ts,纯注释,不改行为,不进任何导出),不发布行为变化;门禁仍然逐字节核对每个分片(每个包的小计之和就是原总数,所以原来能拦的现在都拦);回滚就是还原本 PR。scripts/check-tenant-audit-census.mjs(分片缺失/多余/漂移三条新规则与正文不得写实时总数),scripts/tenant-audit-census.mjs(分片渲染与--write保留已提交的规模块),scripts/tenant-audit-census-replay.mjs(两分支回放)。node scripts/check-tenant-audit-census.mjs—— 预期打印一张总数表(写调用点 322 等)和一行cite: 3 / 322,最后一行✓ check-tenant-audit-census: OK -- 322 write call sites certified across 18 package shard(s)。What changes
The tenant-audit census used to commit its population totals in three places that every PR adding a write call site rewrote: the page's generated region, the ledger
docs/audits/2026-08-tenant-audit-write-call-sites.counts.md(its## Totalstable, plus a dated corpus-scale line re-dated on every--write), and about two dozen hand-written numbers in the page prose. Any two such PRs conflicted.docs/audits/2026-08-tenant-audit-write-call-sites.counts/services/PACKAGE.mdand.../plugins/PACKAGE.md(18 shards today), for every package holding a write call site or an undefended subtraction. Each shard carries that package's rows, its undefended subtractions and its totals: every field ofcensus.totalsplus the undefended counts. No total across packages is committed anywhere, the same cure the strictness ledger's.counts/shards and the livenessstate-counts/shards already use.node scripts/check-tenant-audit-census.mjsprints every census total (the sametotalsRowseach shard renders) and acite:line on every run, red or green.--writekeeps the corpus-scale block. The page region and the index keep their committed scale values and date unless--write --refresh-scaleasks to re-measure them. The gate never compared those values (the 2026-08-31 split). Re-dating them on every run was the last line two sharded branches would both rewrite.--refresh-scaleis a new flag name: the seat may rename it.[census-drift]with the sameFix: --write. Because each total is a sum of per-package totals, a moved total is a drifted shard. Check B changes from "every prose number equals the census" to "the prose states no live total": the 12 shapes those numbers used to take must match nothing ([prose-total]). Checks C and the empty-census and no-region refusals, and the enforced/unenforced split, are unchanged.docs/audits/**andcontent/docs/permissions/**entries ofNOT_DRIVER_MANAGEDinscripts/regen-artifacts.mjsand the.gitattributescomment block beside the system-context row now name the index, the per-package shards and a page region that holds no population figure. The JSDoc inpackages/services/service-settings/src/config-change-audit.tsnow points at that package's shard instead of a "hand-written prose count" the page no longer has. Comments and ledger prose only; no row, route or code changes.scripts/tenant-audit-census-replay.mjsis the card's proof (below). It is a measurement, not a CI gate.Tests
Two-branch replay (sharded head) and its control (origin/main)
The replay runs in a throwaway
git clone --sharedwith no merge driver registered, which is the condition GitHub's server-side merge runs under. It never touches this worktree's refs.Gate self-test and gate (before and after: identical totals)
node scripts/check-tenant-audit-census.mjs --self-testpasses 29 cases, and the generator's own 101 classifier cases are unchanged. The gate printsWrite call sites 322, decidable 227, run time 95, tenancy-enabled 220, declared off 7, threading a context 251, provably none 12 / 3, unreadable 59 / 32, elevated 181 / 0 / 129, placement 255 / 57 / 5 / 5, object name 141 / 86 / 10 / 85, undefended 1 / 0. Every figure equals the region and ledger it replaces onorigin/main.Tests changed because the artefact moved. Each case is named here:
A DRIFT: "an edited count inside the page region" became "an edited line inside the page region", because the region holds no count. "an edited total inside the ledger" became "an edited total inside a shard". The row-deletion case now deletes from a shard. Two cases are new: a package with sites and no shard, and a shard for a package with no sites. The floor goes from 5 to 7.B PROSE: the four cases now write a live total back into the prose in three former shapes (unreadable-share sentence, deviation row,Cite N / M) and expect[prose-total]. The fourth is a control: a dated history figure is not a finding.⭐ THE SPLIT: the control "a population count in the same table" now moves a shard's total beside a moved scale count, because the page table holds no population figure. The other eight cases are unchanged.Ablation: one per new shard rule, on disk, with the real gate CLI
git diff HEADempty)services/service-job.mdtotal6changed to5(viaablation-replace.mjs, anchor hit 1)[census-drift] ... services/service-job.md is not what the tree produces. First difference at line 17services/service-job.mddeleted[census-drift] the census has write call sites in the package ... services/service-job.md is the shard for, and that shard is not committedplugins/plugin-no-such-package.mdadded[census-drift] ... plugin-no-such-package.md is committed ... but the census finds no write call site**59 of the 322 sites are spelled that way**written back into the prose[prose-total] ... "sites whose options argument is unreadable"--write --refresh-scalewas run once and reverted. It rewrites only the dated line and the scale values in the page and the index.Acceptance notes
--writeno longer re-dates the corpus-scale block. Its date now means "last re-measured", and--refresh-scaleis the way to refresh it..github/workflows/lint.ymlnames the page in a comment, and its two commands are unchanged.Verification
Round 1 ran at
1277945da8:node scripts/pm/dispatch-gates.mjs --commandsderived 67 families, all 67 exited 0 (four first answered exit 3 because@objectstack/formula,client,client-reactandlintwere unbuilt, and were re-run after building them).Round 2 (L1 R1, the three description fixes) ran at
e237ebe91b. The new paths raise the derived set to 99 families. All 99 ran with stdin from/dev/null, each exit code captured before any pipe, and all 99 exited 0;--ranreconciliation answered 99 derived, 99 run, 0 NOT-MEASURED.check:dual-build-cjs-loadsfirst answered exit 3 (PREREQUISITE NOT MET, nodist/in apps and connectors) and was re-run after a fullpnpm build --concurrency=2; the re-run code is the one recorded. The head was then synced withmainby the relay (870f898cf1, a merge commit; this PR's own diff is unchanged), andnode scripts/check-tenant-audit-census.mjs, its--self-testandpnpm check:merge-driverwere re-run there: all exit 0, 322 sites across 18 shards.Highlights
The CI families are cited from this PR's check-runs. No changeset: the diff is repo tooling (root
scripts/), docs (content/docs,docs/audits),.gitattributes, and one JSDoc comment on a module-local constant in@objectstack/service-settings, which changes no emitted code, type or behaviour. It carriesskip-changeset.Generated by Claude Code