docs+test: harden treatAsHistorical audit-timeline follow-ups (#3493)#3509
Merged
Conversation
#3493) The state-machine doc already covered the FSM-skip half of `treatAsHistorical` (#3479); extend the same bullet with the audit-timeline half that shipped in #3497: under the flag the write context also carries `preserveAudit`, so `updated_at`/`updated_by` become client-preferred and a whitelist (audit family + author-declared business `readonly` fields) survives the upsert readonly strip, while platform-managed tenancy/system columns stay stripped. Keeps the one place `treatAsHistorical` is documented accurate and discoverable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5rdfBKjkbcoEif4KUV6xE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The Check Changeset gate requires every PR to add a changeset; the sanctioned declaration for a change that releases nothing (docs-only) is an empty-frontmatter changeset. No version bump. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5rdfBKjkbcoEif4KUV6xE
Follow-up hardening for #3497. Each layer of the historical-import audit preservation is tested (audit hook + readonly whitelist through the real engine in plugin.integration.test.ts; the driver's updated_at stamp in sql-driver-timestamp-format.test.ts; the runner wiring in import-runner-historical.test.ts) — but nothing asserted that the ENGINE threads `context.preserveAudit` into the DRIVER options, the wire that makes the driver's stamp reachable from a real write. Add that assertion via the shared `buildDriverOptions` observable (same pattern as the tenantId forwarding tests), plus its opt-in negative. Test-only; releases nothing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B5rdfBKjkbcoEif4KUV6xE
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 13 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 27, 2026 02:15
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.
What & why
Follow-up hardening for #3497 (merged), which taught
treatAsHistoricalto preserve the original audit timeline (#3493). Two loose ends, neither releasing anything:1. Docs — make the shipped capability discoverable
content/docs/protocol/objectql/state-machine.mdxis the one placetreatAsHistoricalis documented, but it only covered the FSM-skip half (#3479). One new bullet documents the audit-timeline half that shipped in #3497:treatAsHistorical, the write context also carriespreserveAudit, which makesupdated_at/updated_byclient-preferred (a supplied historical last-modified survives instead of being stamped now, symmetric withcreated_at/created_byon insert), and admits a whitelist through the static-readonlywrite strip — the audit/timestamp family plus author-declared businessreadonlyfields (closed_at,resolved_by, …).systemcolumns outside that family (organization_id, tenancy/generated) stay stripped; permissions / RLS / FLS unchanged; opt-in.2. Test — pin the one untested wire
Each layer of #3497 is tested (audit hook + readonly whitelist through the real engine in
plugin.integration.test.ts; the driver'supdated_atstamp insql-driver-timestamp-format.test.ts; the runner wiring inimport-runner-historical.test.ts) — but nothing asserted that the engine threadscontext.preserveAuditinto the driver options, the wire that makes the driver's stamp reachable from a real write. Added that assertion inengine.test.tsvia the sharedbuildDriverOptionsobservable (same pattern as the existingtenantIdforwarding tests), plus its opt-in negative.Notes
meta.jsonchange (existing page), no generated-doc impact.Check PR Sizered on an earlier commit was an infra flake — the size-labeler Docker action timed out pullingalpine:3.15from Docker Hub (fail_if_xl:false, so size never fails it); re-triggered by the test push.🤖 Generated with Claude Code