Repository navigation
fix(platform-objects): the settings audit old_hash / new_hash columns describe both digest formats they carry - #26652
Conversation
…e formats they carry A non-secret value is digested as `sha256:` + hex SHA-256 of its canonical JSON; a secret value carries the crypto provider's keyed `hmac-sha256:` digest, never an unkeyed hash. Both `sys_setting_audit` and its platform twin now say so in the TSDoc and the field description. Description text only. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mfZPv35uwM4wiMZZt
…ettings audit hash descriptions `pnpm i18n:extract` refreshes the `en` leaves. The zh-CN, ja-JP and es-ES leaves held translations of the old SHA-256 wording, which the merge keeps as they are and no source hash marks stale, so they are re-translated in place per the bundle header; a second extract leaves every file unchanged. Adds the `@objectstack/platform-objects` patch changeset. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mfZPv35uwM4wiMZZt
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 3 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 656b4042f367652471f3c327c5d98fdeaeeadd3b && git checkout 656b4042f367652471f3c327c5d98fdeaeeadd3b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin dbf7e04adff66aba72e634c65aae754440a8d89d a32e5507f98a61264050a0b294809d8e069cb559 && git checkout -B drift-repro dbf7e04adff66aba72e634c65aae754440a8d89d && git merge --no-ff a32e5507f98a61264050a0b294809d8e069cb559
node scripts/docs-audit/affected-docs.mjs --json dbf7e04adff66aba72e634c65aae754440a8d89d
|
席位核对ACCEPT · The maintainer's standing authorisation for landing reviewed PRs, verbatim: 「按照 pm-dispatch 规则复核过的都授权」.
Generated by Claude Code |
Requested by Leehom · project thread
Fixes #26603
Clause-②: no
Metadata-protocol: none
维护者速读
sys_setting_audit与平台孪生表sys_platform_setting_audit的old_hash/new_hash字段说明(TSDoc 与description),改为同时写明两种摘要格式;四个语言的翻译包随之更新。只改说明文字。hmac-sha256:摘要。按说明核对审计行的运维或 AI 会把每条机密行判成格式错误,甚至拿机密的 SHA-256 去比对,这正是带密钥摘要要防的离线猜测。packages/services/**;回滚即还原本 PR。packages/platform-objects/src/system/sys-setting-audit.object.ts(两段说明);②sys-platform-setting-audit.object.ts(孪生表对齐);③zh-CN.objects.generated.ts的两条重译。git grep -n "SHA-256 of the previous value" -- packages/platform-objects应无输出;pnpm check:i18n应打印all bundles in sync。What changes
sys_setting_audit(packages/platform-objects/src/system/sys-setting-audit.object.ts): theold_hash/new_hashTSDoc anddescriptionnow state both formats the settings audit writer records:sha256:+ hex SHA-256 of its canonical JSON (settingAuditDigest);encrypted: true): the crypto provider's keyed digest,hmac-sha256:…, never an unkeyed hash;old_hash, reset fornew_hash), and null for a secret when no keyed digest is available;sha256:digest may carryfnv32:, and that only same-prefix values compare.sys_platform_setting_audit(the global rung, same writer and row shape): the same two descriptions, plus TSDoc that points at the tenant table's format text.pnpm i18n:extract(the generator the config's docstring and the rootpackage.jsonname) refreshed theenleaves. The zh-CN, ja-JP and es-ES leaves were re-translated in place (see Acceptance notes); a secondpnpm i18n:extractleaves every bundle file, the source-hash tables included, byte-unchanged.@objectstack/platform-objectspatch.Description text only: no column type, length or name changes, and nothing about what is written.
Why
A secret row's
new_hashhas been the keyed digest since the keyed-digest work, and itsold_hashis too since #26534 (PR #26600). The column metadata still said SHA-256./metaserves these descriptions to Studio and agents, so a reader who checks a row against them is told a format secret rows never carry.Tests
pnpm --filter @objectstack/platform-objects test: Test Files 96 passed (96), Tests 1361 passed (1361), lock VERDICT command-exit 0.pnpm --filter @objectstack/platform-objects typecheck: VERDICT command-exit 0,check:test-typecheck: OK.eslint packages/platform-objects --no-inline-config: exit 0.Acceptance notes
os i18n extract --mergeonly fills gaps, so it kept the zh-CN, ja-JP and es-ES translations of the old "SHA-256 of the … value" wording. They had no entry in the generated*.source-hashes.generated.tstables (a translation, not a byte copy of the source), so they are legacy-trusted: measured after the regenerate and before the re-translation,pnpm check:i18nandpnpm check:i18n-coverageboth exited 0 while the three locales still served the SHA-256 text. No gate catches it. The bundle headers state the repo's rule for this case ("Re-translate it by hand when its source changes"; "Re-translate the leaf in the objects bundle and the next extract drops its entry by itself"), so the six leaves (old_hash.help,new_hash.help× three locales) were re-translated in place, leaf values only, and the second extract confirmed the structure is untouched.sys_platform_setting_audithas no bundle entry. The platform-objects extract config does not list that object, so its descriptions ship in English only. That was already true before this change, and it is not touched here.packages/services/service-settings/src/crypto-adapter.ts:22andsettings-audit-old-hash.test.ts:8-9describe the declaration as SHA-256, and the pending.changeset/26465-settings-audit-old-hash.mddoes too. Each speaks of the non-secret digest, which is still SHA-256, so none is wrong;packages/services/**is outside this card's ruling.Verification
All readings at head
a32e5507.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 53 commands; each was run with its exit code captured before any pipe, and--ranreconciles "53 derived, 53 run, 0 NOT-MEASURED, 0 UNRUN". 52 exited 0 on the first pass.check-plugin-teardown-shape.mjs --self-testexited 3 (shallow clone: it could not read its pinned positive control621a4876); aftergit fetch origin 621a4876…it exited 0 ("48 cases pass").pnpm check:i18n"OK (10 package(s), all bundles in sync, no undeclared authoring keys)";pnpm check:i18n-stale-fill"OK (11 bundle set(s), no new stale fills, 0 baselined)";pnpm check:i18n-coverage"OK (14 config(s), 527 baselined untranslated string(s), none new)".node scripts/check-changeset-no-major.mjs --base origin/main --event(this body as the event) readsClause-②: noandMetadata-protocol: none, "a non-protocol change atpatch", and "moves no metadata-protocol baseline".git grep -n "SHA-256 of the previous value" -- packages/platform-objectsexits 1 (no match).pnpm build, 116 tasks) under the verify lock: VERDICT command-exit 0.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5mfZPv35uwM4wiMZZt
Generated by Claude Code