Repository navigation
fix(plugin-audit,platform-objects): the audit log's default list shows what people did; the audit objects read in Chinese - #30620
Conversation
… and the audit objects' zh-CN names Red on main: the sign-in stamp and the machinery rows reach the default view, and three audit objects read English under zh-CN. Claude-Session: https://claude.ai/code/session_01Utp6CbEH94Gqn2583kuuzH Co-authored-by: Claude <noreply@anthropic.com>
…es out machinery rows; audit objects read in Chinese - The ledger writer marks the sign-in stamp (an update of sys_user that only stamps last_login_at / last_login_ip) with metadata.event auth.last_login_stamp; the row is still written. - sys_audit_log's first view, recent, leaves out that row, the settings stores' mirrored writes beside a config_change, the settings trails, the secret store, the signing key and the migration ledger. all_events lists every row. - sys_platform_setting and sys_platform_setting_audit join platform-objects' extract config and read in Chinese under zh-CN; sys_comment_reaction's zh-CN bundle is translated. Claude-Session: https://claude.ai/code/session_01Utp6CbEH94Gqn2583kuuzH Co-authored-by: Claude <noreply@anthropic.com>
…global rung's two objects Claude-Session: https://claude.ai/code/session_01Utp6CbEH94Gqn2583kuuzH Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbEH94Gqn2583kuuzH Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 25 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 4 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 11 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 70e0312b9a90cacb2a4db8beb745dd2503c10ef8 && git checkout 70e0312b9a90cacb2a4db8beb745dd2503c10ef8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1c5cee6736518291d86148cd69124542dfc0d021 ef370d07ea841903f55a891f17791391f7263ddd && git checkout -B drift-repro 1c5cee6736518291d86148cd69124542dfc0d021 && git merge --no-ff ef370d07ea841903f55a891f17791391f7263ddd
node scripts/docs-audit/affected-docs.mjs --json 1c5cee6736518291d86148cd69124542dfc0d021
|
|
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE 席位记录 · 2026-11-05T18:41Z · Head-sha
|
Requested by Bill · project thread
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE
维护者速读
{"event":"auth.last_login_stamp"}。回滚即 revert 本 PR,已写入的标记无害。packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts(默认视图 recent 的过滤与排除清单),packages/plugins/plugin-audit/src/sign-in-stamp.ts与audit-writers.ts里打标记的两处,packages/platform-objects/scripts/i18n-extract.config.ts。pnpm --filter @objectstack/plugin-audit exec vitest run src/sys-audit-log-default-view.integration.test.ts,预期 5 条全过:登录戳被标记且不进默认列表,管理员改用户仍在,设置变更行仍在,「全部」仍列出所有行。Refs #30209 (row 3)
Clause-②: no — no
packages/specchange; the new constants are module-internal (not exported from the package entry)Metadata-protocol: none
Skills-docs: none —
git grep -n -i -E "audit log|last_login|sys_platform_setting|comment reaction" -- skillsonef370d07eanswers two lines (skills/objectstack-ui/rules/list-views.md:222, an example grid labelledAudit Log;skills/objectstack-platform/references/plugin-development.md:211, a plugin's log line), neither about the shipped audit log's views or names, so this PR makes neither false.What changes
Row 3, the audit log's default list. Measured on a fresh
pnpm dev -- --freshshowcase boot (c23eafa8), one act wrote several ledger rows:sys_audit_logloginonsys_session, andupdateon the person'ssys_userstampinglast_login_at/last_login_ip(plugin-authstampLastLogin, under the person's own id)createonsys_jwks(the token-signing key)create/updateonsys_setting,config_changenamingsys_setting,createonsys_setting_auditcreateonsys_secret,createonsys_platform_setting,config_changenamingsys_platform_setting,createonsys_platform_setting_auditsys_migrationplugin-audit: the CRUD ledger writer marks the sign-in stamp.isSignInStamp(sign-in-stamp.ts) answers true for an update ofsys_userwhose changed fields (the writer's own diff) arelast_login_at/last_login_ipand nothing else; the row then carriesmetadata: {"event":"auth.last_login_stamp"}, the placeconfig_changerows already name their event (settings.set). An administrator's edit of a user, or any write that changes another field beside the stamp, carries no mark. The row is still written. A delegated write'sperformed_by/on_behalf_ofkeys are kept beside the mark when both apply.sys_audit_log.listViews.recent(the first declared view, which Setup opens) gains a filter: rows onsys_secret,sys_setting_audit,sys_platform_setting_audit,sys_jwks,sys_migrationandsys_migration_journalare left out; rows onsys_setting/sys_platform_settingare left out unless the action isconfig_change(that row names the store as its object); and a row whosemetadatacontains the stamp's event is left out (an any-of group withmetadatais null, so rows without metadata stay).metadatais not one of the value-bearing columnsparent-field-query-guard.tsrefuses to filter on, so every reader can run the view.all_eventsis unchanged and lists every row. Object names are read from the definitions (@objectstack/platform-objects/system,SystemObjectName.JWKS), not a name prefix:sys_user,sys_member, sharing rules and the like stay in, because their writes are acts.Row 3, the audit objects' names in Chinese.
sys_platform_settingandsys_platform_setting_audit(registered byservice-settings, defined inplatform-objects) were in no extract config, so no bundle carried them in any locale. They joinplatform-objects' extract config (and itsbundle-ownershiplist); the extract added them to every bundle, and zh-CN is written by hand (object, field, help, option and view names, followingsys_setting/sys_setting_audit).sys_comment_reaction's zh-CN leaves inplugin-auditheld the English fill and are translated; the regenerate dropped their fill records.Tests
plugin-audit/src/sys-audit-log-default-view.integration.test.ts(new; real kernel,AuditPlugin, SQLite driver, the view's filter lowered the way the Console lowers it,orgroup included, and parsed byparseFilterAST): the stamp is marked and the two controls are not;recentkeepslogin, bothconfig_changerows and the administrator's edits, and leaves out the stamp and every machinery row;recentreads newest first;all_eventsstill lists all of them.platform-objects/src/system/platform-setting-zh-cn.test.ts(new): served zh-CN (SetupAppTranslations) names both objects and every declared field and option in Chinese.plugin-audit/src/translations/comment-reaction-zh-cn.test.ts(new): served zh-CN (AuditTranslations) namessys_comment_reaction, its fields and helps in Chinese.Red first on
main2ffdb649(pin commitccb7a5f8): default view 2 failed / 3 passed (stamp unmarked; stamp inrecent), platform settings zh-CN 4/4 failed, comment reaction zh-CN 2/2 failed.Ablation (once,
scripts/ablation-replace.mjs, anchor hit x1, restored blob equals HEAD,git diff HEADempty): withsignInStamp = isSignInStamp(…)replaced byfalse, the default-view file goes 2 failed / 3 passed (the mark pin and therecentpin).Acceptance notes
Refs, not a closing keyword). Row 4 (config change old/new values) and row 5 (the sharing-rule object picker) are in the card report as decisions; row 6 (queue members) is a reading only.source-hashesfiles;sys_comment_reactionin those locales is unchanged.last_login_at/last_login_iponsys_userfor another reason would be marked too; today plugin-auth's stamp is the only writer of those two fields.sys_*objects that still read English under zh-CN (approvals tokens and approvers, connector and flow credentials, metadata commit and activation, webhook, trusted key, identity email, automation run, assignment cursor, audience binding suggestion, migration journal) belong to other packages and are not touched.Verification
Package suites and typechecks (head ef370d0, after merging origin/main with #30551)
pnpm --filter @objectstack/platform-objects --filter @objectstack/plugin-audit testunder the verify lock: platform-objects 114 files / 1567 tests, plugin-audit 73 files / 1144 tests, VERDICT command-exit 0.pnpm --filter @objectstack/plugin-audit --filter @objectstack/platform-objects typecheck: VERDICT command-exit 0.node scripts/check-i18n-bundles.mjs --writeafter the merge: byte-identical (no file changed);pnpm check:i18n: all ten bundle sets in sync.--no-inline-configon the changed TypeScript files: exit 0.Derived gate families
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackonef370d07e(after theorigin/mainmerge) derived 64 commands. Each ran with its exit code captured before any pipe: all 64 exited 0.--ran: 64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN.77f2050b) the same 64 ran green exceptnode scripts/check-plugin-teardown-shape.mjs --self-test, exit 3 on the shallow clone; it exited 0 aftergit fetchof its fixture commit, and exited 0 on the merged head too.pnpm lint(repository-wide,eslint . --no-inline-config) onef370d07e: exit 0.Generated by Claude Code