Skip to content

fix(service-settings): a settings change's audit row records the value before and after, with secrets as digests - #30937

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-84zqc1
Nov 6, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-84zqc1

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

domain:server#1 · os-elon-musk · session_016WV4cy588UNGpATRLjBi9h

Fixes #30923

Claim: 6684421676 (full re-post of 6684227943 with this branch; file surface amended for the dogfood pin, the QA checklist entry and the plugin-audit redaction file)

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:修改设置时写入审计日志的 config_change 记录,现在会记下改前值(old_value)和改后值(new_value),非密钥类设置是可读的原值;密钥类设置(清单标 encrypted: true,password 类型自动算)两边都只记掩码摘要,从不记明文。审计读取端同时补上一道限制:字段级权限看不到设置值的读者,在这条记录里也看不到值和摘要。
  • 为什么改:安全审查要求访问策略(如允许的 IP 范围)的每次修改都能看出改前改后;此前这条记录只有新值的摘要,没有任何入口能读出前后值。ADR-0007 的「审计与历史」一节本来就规定要记前后值、加密值只记占位和校验和,这次是把实现补齐到 ADR。
  • 风险与回滚:只往审计行里多写内容,不改列、不改设置写入本身;密钥规则只在设置服务一处判定,测试覆盖密钥改写、重置、标记翻转三种情况都不出明文。读取端收窄只影响被字段级权限屏蔽了设置值的读者。单 PR 可整体回滚。
  • 先看:packages/services/service-settings/src/settings-service.ts 的 auditReadable / auditPrevious(密钥规则与改前值);config-change-audit.ts 的 old_value / new_value 写法;packages/plugins/plugin-audit/src/audit-log-field-redaction.ts 新增的 config_change 收窄。
  • 两分钟验证:pnpm --filter @objectstack/service-settings exec vitest run src/config-change-audit.test.ts,预期 24 个用例全过,其中 #30923 开头的 6 个覆盖 IP 范围前后值、重置、首次写入和密钥。
  • 需要你做的:无,席位落地。

What changes

ADR-0007 § Audit & history decides that every settings write records its before and after on sys_audit_log, and that a value declared encrypted: true is recorded only as a placeholder plus a checksum. The config_change row recorded a digest of the after and nothing of the before. This PR implements the ADR. No ADR records "a digest, never the value" (searched docs/adr/**); the module header that said so was the deviation, and it is rewritten.

  • config_change row (config-change-audit.ts). new_value is { namespace, key, scope, value, digest }, and null on a reset as before. old_value (an existing column, previously never written) has the same shape for the value the same stored settings row held before the write (the row record_id names). It is null when that row held no value: a first write at that rung, or a row an earlier reset cleared. A reset records its before there.
  • The secret rule, in one place (SettingsService.auditReadable). A value is written readable only when the key is not secret-valued and the row it comes from is not stored encrypted: true. Secret-valued is the manifest's encrypted: true, which type: 'password' forces (registerManifest reads it into encryptedKeys, settings-service.ts about line 1259). That is the only sensitivity flag a specifier declares. No sensitive flag exists in packages/spec, and none is needed, because every credential key in the shipped manifests is type: 'password'. A secret's sides carry only digest: the encrypted marker, which is the word encrypted, a colon and the provider's keyed digest, wrapped in angle brackets (the bare word in angle brackets when no keyed digest is available). That is byte-for-byte the new_value these rows carried before, so a reader that parses it keeps working. The before of a secret is the same keyed digest the settings trail's old_hash records. oldHash is now taken when either ledger is wired, before the reaper destroys the previous ciphertext. A plaintext row of a key declared secret since then, and an encrypted row of a key no longer declared secret, are both recorded masked. metadata is unchanged and carries no value.
  • What the sink is handed (settings-service.types.ts). SettingsAuditSink.record's entry gains two optional fields: value, the after, readable, absent for a secret and on a reset; and previous, { value?, digest } | null. A host sink that ignores them works as before.
  • Every door. sys_setting declares apiMethods: ['get', 'list'] and managedBy: 'engine-owned', so the data API cannot write it. Every settings door (Setup, PUT /api/settings/:namespace, the built-in reset action, resetNamespace, in-process set/setMany) writes through SettingsService.setMany, the only caller of the sink.
  • Who is served the readable value (plugin-audit, audit-log-field-redaction.ts). The ledger's read-side field redaction narrowed only the CRUD mirror's create/update/delete snapshots, and served config_change rows as written on the ground that they held only a digest. A config_change row about a settings store (sys_setting, or sys_platform_setting for a global value) is now judged by that store's value field. A reader not served value (masked or withheld by field-level security) gets neither the value nor its digest on either side, because an unkeyed digest of a short value answers "is it X?". namespace, key and scope stay. The mirror's row about the same write is narrowed the same way. A snapshot that is not a JSON object is dropped (fail closed). A config_change row naming no settings store (the deployment notice's hide) is served as written, as before.

Tests

  • config-change-audit.test.ts, new top-level describe, using the real SettingsServicePlugin boot, its own sink, and the real auth manifest:
    • auth.allowed_ip_ranges: a first write records old_value: null, and a change records both values readable. The before's digest equals the previous after's digest and the settings trail's old_hash, and metadata carries no value.
    • The same through PUT /api/settings/auth.
    • A reset records its before and new_value: null, and a write after a reset records a null before.
    • A secret key written, rotated and reset: no plaintext in old_value, new_value or metadata. Every side is the encrypted marker around an hmac-sha256: digest of 64 hex digits, each before equals the previous after, and the new_value keys stay namespace, key, scope, digest.
    • A key declared secret after a plaintext write: the replaced plaintext is never recorded.
    • A key no longer declared secret: the encrypted row it replaces is recorded masked.
  • audit-log-field-redaction.test.ts, new top-level describe, on redactAuditLogRows over rows in the writer's shape (plugin-audit does not depend on service-settings):
    • A reader with value masked on sys_setting or on sys_platform_setting gets { namespace, key, scope } on both sides.
    • A control reader gets the row byte-identical.
    • A config_change row naming no settings store is served as written.
    • A non-JSON snapshot is dropped.
  • settings-config-change-audit.dogfood.test.ts: the two assertions that pinned the old shape now assert the value. The first case now expects new_value.value, and the Setup: show what people can really do and what really changed, using names rather than ids #30209 case now expects the row to carry the workspace name instead of asserting that it does not.
  • docs/qa/platform-checklist/areas/platform-core.json (platform-core.settings-audit-secret-fingerprint): source[1] now describes the readable before and after, and the item gets revision 6 with a history row. No clause changed, because every clause there scores the secret mail.api_key, whose rows still carry only the masked keyed digest.
Measured on main 0e88208 before the fix (in-process settings service, real sink, real auth and mail manifests)
  • auth.allowed_ip_ranges, set, then changed, then reset: old_value absent on all three rows. new_value was {"namespace":"auth","key":"allowed_ip_ranges","scope":"global","digest":"sha256:…"} on the two sets and null on the reset.
  • mail.api_key, set, then rotated, then reset: old_value absent. new_value carried namespace, key, scope and the encrypted marker around an hmac-sha256: digest, then null on the reset. No plaintext.
Ablations (scripts/ablation-replace.mjs; anchor 1 → 0, mutation marker 0 → 1, restored blob == HEAD blob; both suites import src, so no build between)
  • A. auditReadable returns true (the secret rule dropped): 3 of the 6 #30923 service cases fail. They are the secret write/rotate/reset case (new_value contains the secret), the key declared secret later (old_value contains the old plaintext), and the key no longer declared secret (old_value has a value property). The 3 readable cases stay green.
  • B. the config_change branch removed from the redaction guard: 3 of the 5 new redaction cases fail (masked on sys_setting, masked on sys_platform_setting, non-JSON snapshot). The control case and the no-store case stay green.

Acceptance notes

  • old_value / new_value describe the stored row at the write's own rung, the row record_id names, and that row's previous value is what old_hash already fingerprints. A first tenant-scope write records a null before even when a global value or the default was in force.
  • Clause-②: yes (widening): the served row carries more. The plugin-audit half removes the value and digest only for a reader whose field-level security already withholds the settings store's value. That reader was served the unkeyed digest of a non-secret value before, so for them this is a security narrowing. The seat may judge whether that half wants its own arm.
  • A comment in plugin-audit/src/audit-plugin.ts ("a config_change row's digest sits next to the mirror's row that carries the value") still reads true for secrets but undersells non-secret rows. That file is outside this PR's surface, so it is noted here and not edited.

Verification

Local runs on the final head are quoted with that head in the report comment on #30923: @objectstack/service-settings and @objectstack/plugin-audit test and typecheck; the changed dogfood file; every family node scripts/pm/dispatch-gates.mjs --commands derives from this diff, reconciled with --ran; pnpm lint. CI's required checks are the authority for everything else.


Generated by Claude Code

…er, secrets as digests

The settings config_change row on sys_audit_log now records old_value and
new_value readable for a key that is not secret-valued, as ADR-0007 Audit &
history decides; a secret-valued key (manifest encrypted: true, forced by
type password) keeps the masked digest on both sides. plugin-audit's ledger
field redaction narrows a settings config_change row's value and digest for
a reader whose field-level security masks the settings store's value.

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

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-audit, @objectstack/service-settings, touching 14 documentable anchor(s).

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/drivers.mdx (via SettingsService (symbol, a top-level class))
  • content/docs/deployment/self-hosting.mdx (via config_change (literal, a string literal in CONFIG_CHANGE_ACTION; a string literal in a comment on a changed line))
  • content/docs/kernel/runtime-services/audit-service.mdx (via SettingsAuditSink (symbol, a top-level interface))
  • content/docs/kernel/runtime-services/index.mdx (via SettingsAuditSink (symbol, a top-level interface))
  • content/docs/kernel/runtime-services/settings-service.mdx (via setMany (symbol, a method of class SettingsService))
  • content/docs/protocol/kernel/config-resolution.mdx (via SettingsService (symbol, a top-level class), setMany (symbol, a method of class SettingsService))
  • content/docs/protocol/kernel/index.mdx (via SettingsService (symbol, a top-level class))

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

  • content/docs/releases/v14.mdx (via setMany (symbol, a method of class SettingsService))
  • content/docs/releases/v17/17-0.mdx (via config_change (literal, a string literal in CONFIG_CHANGE_ACTION; a string literal in a comment on a changed line))
  • content/docs/releases/v17/17-6.mdx (via config_change (literal, a string literal in CONFIG_CHANGE_ACTION; a string literal in a comment on a changed line))

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 63 of 222 client-bound route-ledger rows — the other 159 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 159: 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; 104 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 — 14 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 26c965cb8f61ca59804d55e27e737bf7ff91b383 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f2ddf8d699b432b2ad5b9dbb0c8130d575477965 — the merge of head 47b9abc5b704afcd6d9439c4c6cb9af6b96a68c9 into base 26c965cb8f61ca59804d55e27e737bf7ff91b383, 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 f2ddf8d699b432b2ad5b9dbb0c8130d575477965 && git checkout f2ddf8d699b432b2ad5b9dbb0c8130d575477965
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 26c965cb8f61ca59804d55e27e737bf7ff91b383 47b9abc5b704afcd6d9439c4c6cb9af6b96a68c9 && git checkout -B drift-repro 26c965cb8f61ca59804d55e27e737bf7ff91b383 && git merge --no-ff 47b9abc5b704afcd6d9439c4c6cb9af6b96a68c9

node scripts/docs-audit/affected-docs.mjs --json 26c965cb8f61ca59804d55e27e737bf7ff91b383

⚠️ 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 26c965cb8f61ca59804d55e27e737bf7ff91b383 → 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:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 47b9abc5b704afcd6d9439c4c6cb9af6b96a68c9
Local-runs: none
Scope: packages/services/service-settings/src/config-change-audit.ts, packages/services/service-settings/src/settings-service.ts, packages/services/service-settings/src/settings-service.types.ts, packages/plugins/plugin-audit/src/audit-log-field-redaction.ts, packages/services/service-settings/src/config-change-audit.test.ts, packages/plugins/plugin-audit/src/audit-log-field-redaction.test.ts, packages/qa/dogfood/test/settings-config-change-audit.dogfood.test.ts, docs/qa/platform-checklist/areas/platform-core.json, .changeset/30923-config-change-before-after.md + packages/plugins/plugin-audit/src/served-fields.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/plugins/plugin-audit/src/parent-field-query-guard.ts, packages/plugins/plugin-audit/src/audit-log-read-visibility.ts, packages/plugins/plugin-audit/src/audit-plugin.ts, packages/platform-objects/src/system/sys-setting.object.ts, packages/platform-objects/src/system/sys-platform-setting.object.ts, packages/services/service-settings/src/index.ts, docs/adr/0007-settings-manifest-and-kv-store.md, packages/plugins/plugin-audit/CHANGELOG.md (precedent entries fbcc05f and 2ecf6a7)

Face note: record-recognisers.mjs --paths on the nine changed paths decides no schema or governed face. The owed face is the declaration face (Clause-②: yes alone). This record is served at the higher tier as asked; a tier above the owed one is allowed (contract-review.md: the tier is not a ceiling).

① Derived judgments

Must-fix: none.

Should-fix (follow-up cards, not blockers; both outside the claim's file surface):

  • S1. packages/plugins/plugin-audit/src/audit-plugin.ts:277-279 still says a config_change row's "digest sits next to the mirror's row that carries the value". True for a secret key only now. The dev noted it in the PR body. One comment line; file a docs-only follow-up.
  • S2. packages/plugins/plugin-audit/src/audit-log-read-visibility.ts:51-58 says a config_change row that names no record_id carries no record's field values. After this PR such a row (only when the store hands back no id, settings-service.ts:3932-3937) carries a readable non-secret value. The field redaction still narrows it, because it keys on object_name and not on record_id (audit-log-field-redaction.ts:182-184), so the behaviour is right and only the comment is stale. Same follow-up as S1.

Confirmed, by file and line:

  1. Secret rule, one place. settings-service.ts:3820-3822 auditReadable(keyIsSecret, row) answers true only when the key is not in encryptedKeys and the row is not stored encrypted: true. encryptedKeys is filled at settings-service.ts:1259 from the manifest's encrypted or type: 'password'. The after side is handed to the sink only under !isNull && auditReadable(isEncrypted, null) (settings-service.ts:2909); the before side goes through auditPrevious (settings-service.ts:3847-3863), which returns a readable value only when auditReadable(keyIsSecret, previous) holds for the previous row itself. So:
    • set of a secret: no value, valueDigest is the masked keyed digest (:2906, :3829-3830); old side is the keyed old_hash (:2879-2883, previousSecretAuditDigest :3902-3924, plaintext lives in that frame only and is never logged).
    • reset of a secret: new_value is null (config-change-audit.ts:347); old_value carries the masked keyed digest only.
    • first write: previous is null from upsertRow (settings-service.ts:3983, :3995) so old_value is null.
    • key flipped to secret after a plaintext write: auditReadable(true, prevPlainRow) is false; oldHash from previousSecretAuditDigest is null because previous.encrypted !== true (:3907); result is the bare placeholder, no value, no unkeyed hash (:3863). Pinned at config-change-audit.test.ts:1009-1029.
    • key flipped from secret to plain: previous row is stored encrypted: true, so auditReadable(false, prevEncRow) is false; the comment at :3861-3862 is right that a non-secret key's oldHash is unkeyed and so is not used; result is the bare placeholder. Pinned at :1031-1045, with not.toHaveProperty('value') at :1042.
    • unknown key not in any manifest: setMany refuses the whole call with UnknownKeyError before any write (settings-service.ts:2087), so no row is written. Fail closed.
    • metadata is unchanged and carries event, namespace, key, scope, encrypted, requestId only (config-change-audit.ts:365-372).
    • No log line or error carries a value: the sink's one error message carries the engine's err.message (config-change-audit.ts:383-400), and the row it tried to insert never holds a secret's plaintext; previousSecretAuditDigest's warn line carries the decrypt error only (settings-service.ts:3916-3919).
  2. Doors. this.audit.record(...) has one caller, setMany (settings-service.ts:2897). set (:2613) and resetNamespace (:3452) go through it. sys_setting and sys_platform_setting declare managedBy: 'engine-owned' and apiMethods: ['get', 'list'] (sys-setting.object.ts:48, :259; sys-platform-setting.object.ts:53, :147), so the data API cannot write them. The CLI ownership-apply and the metadata-protocol migrations touch the stores' identity columns, not values, and write no config_change row.
  3. Redaction. audit-log-field-redaction.ts:182-185 treats a row as a settings change when action === 'config_change' and object_name is in AUDIT_LOG_SETTINGS_STORE_OBJECTS, which is [sys_setting, sys_platform_setting] (sys-audit-log.object.ts:60-63), so tenant/user scope and global scope are both keyed. The served set comes from the same servedFor(object) the CRUD mirror's rows use (:192-193, servedFieldsPerRead in served-fields.ts:100; readable intersected with queryable, fail-closed to [] when the mask cannot be answered, served-fields.ts:85-93). The settings branch differs only in the drop function: dropUnservedSettingValue (:140-150) removes value and digest on both columns when value is not served, and keeps namespace, key, scope. A digest of a non-secret value is an unkeyed SHA-256 (settings-service.ts:2853), so dropping it with the value is the right call for a low-entropy value. A non-object snapshot is dropped (:205-208). Rows of other actions, and a config_change row naming no settings store, hit continue at :185 and are served as written. Readers served value get the bytes unchanged (:209-213).
  4. Predicate probing of the now-readable new_value is already closed: parent-field-query-guard.ts refuses a non-system query naming old_value/new_value for a reader withheld any field of the parent object the query names (or of every registered object when it names none), and it does not condition on action, so config_change rows are inside its class.
  5. The changeset body states the narrowed case in words (the masked reader gets neither value nor digest), so an upgrading reader who greps the ledger entry finds it.
  6. ADR-0007 § Audit & history (docs/adr/0007-settings-manifest-and-kv-store.md:338-344) asks for before and after on sys_audit_log, and for an encrypted value only a placeholder plus checksum. The row now carries both sides, and a secret's sides carry the placeholder with the keyed checksum. The PR implements the ADR; the old module header was the deviation.
  7. QA checklist platform-core.json: source[1] rewritten, revision 5 to 6 with a dated history row (:3329, :3411, :3448-3453). Every clause there scores the secret mail.api_key, whose rows still carry the masked digest only, so no clause moves. Right.

② Semver level

@objectstack/service-settings: patch, @objectstack/plugin-audit: patch. Correct. Metadata-protocol is none (no spec key, no authorable value, no default moves; the only type change is two optional fields on SettingsAuditSink.record's entry, settings-service.types.ts:262-284, exported via index.ts:69, which a host sink may ignore). AGENTS.md step 3: none takes patch.

Clause-② arm: yes (widening) stands. Reasoning against the repo's own precedent on this ledger:

③ Boundary flags

  • Dev's open question on the Clause-② arm: answered above, A.
  • PR user.login is objectstack-fleet[bot] (read from the API), so no author note is owed under contract-review.md.
  • PR body's Verification quotes local runs on the final head; this record did not re-run them. Check-runs on the head read from the API: Lint & Repo Gates, TypeScript Type Check, Build Core, Governed Surface Queue Guard, Test Core 1-8 and aggregate, Test UI, Live E2E UI, Check Changeset, PR-body guards, Dogfood Regression Gate all completed/success; UI lint/typecheck/build skipped (no ui/ paths).
  • The two stale comments (S1, S2) sit outside the claim's file surface; they are follow-up cards, not reasons to hold this head.

④ Design judgment

Declaration face only: no schema or governed path in the diff, no narrowing arm declared, so ④ is not owed. For the record, the one design call made here is read against ADR-0007: the before-side describes the stored row at the write's own rung (the row record_id names), so a first tenant-scope write records a null before even when a global value or the default was in force. That is the ADR's "before" for the row the ledger points at, and it matches what old_hash has always fingerprinted. Consistent.

Tests, read for what they pin and whether the reported ablations go red:

  • Secret rule: config-change-audit.test.ts:979-1007 asserts no plaintext in old_value, new_value or metadata across set, rotate and reset, that every side is the encrypted marker around a 64-hex keyed digest, and that new_value keys are unchanged. Ablation A (auditReadable returns true) puts value on the after side, so not.toHaveProperty('value') goes red; the flip case at :1009-1029 would carry the old plaintext in old_value, red; the unflip case at :1031-1045 would carry value: null on the old side, red on not.toHaveProperty('value'). The three readable cases do not touch the rule, green. Matches the report.
  • Reset and first write: :926-944 (first write null before, change readable both sides, before digest equals previous after digest and the trail's old_hash), :963-977 (reset records its before, null after; the write after a reset records a null before).
  • Redaction: audit-log-field-redaction.test.ts:371-432. The masked cases use toEqual(WHICH), which fails if digest survives, so "neither value nor digest" is pinned on both stores. Ablation B (the config_change branch removed from the guard at :182-185) makes the row hit continue, so both masked cases keep the value, red; the non-JSON case is served as written, red; control and no-store cases pass either way. Matches the report.
  • The dogfood pin and the route case (:946-961) cover the PUT door.

Implemented-by: claude/project-thread-84zqc1
Reviewed-by: session_016WV4cytLmJxfAmgPVjUbbW

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

席位核对 · ACCEPT · 2026-11-06T13:14Z · #30923

Head-sha: 47b9abc

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 6, 2026 13:15
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 616311c Nov 6, 2026
51 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-84zqc1 branch November 6, 2026 13:35
os-elon-musk pushed a commit that referenced this pull request Nov 6, 2026
…0937

The config_change row now carries a non-secret key's readable before and
after itself; the header no longer says it holds only a digest.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1abDZNVe9GRYCpLEn
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 tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings config_change audit records only a digest of the new value, so a policy change's before and after cannot be read from any door

2 participants