Skip to content

docs+test: harden treatAsHistorical audit-timeline follow-ups (#3493)#3509

Merged
os-zhuang merged 3 commits into
mainfrom
claude/historical-import-timestamps-0hrwxy
Jul 27, 2026
Merged

docs+test: harden treatAsHistorical audit-timeline follow-ups (#3493)#3509
os-zhuang merged 3 commits into
mainfrom
claude/historical-import-timestamps-0hrwxy

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What & why

Follow-up hardening for #3497 (merged), which taught treatAsHistorical to 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.mdx is the one place treatAsHistorical is documented, but it only covered the FSM-skip half (#3479). One new bullet documents the audit-timeline half that shipped in #3497:

  • Under treatAsHistorical, the write context also carries preserveAudit, which makes updated_at / updated_by client-preferred (a supplied historical last-modified survives instead of being stamped now, symmetric with created_at/created_by on insert), and admits a whitelist through the static-readonly write strip — the audit/timestamp family plus author-declared business readonly fields (closed_at, resolved_by, …).
  • Platform-managed system columns 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'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. Added that assertion in engine.test.ts via the shared buildDriverOptions observable (same pattern as the existing tenantId forwarding tests), plus its opt-in negative.

Notes

  • Docs page is hand-written protocol content — no meta.json change (existing page), no generated-doc impact.
  • Test-only + docs — releases nothing, so the changeset is intentionally empty (the sanctioned "no version bump" declaration the Check Changeset gate expects).
  • The Check PR Size red on an earlier commit was an infra flake — the size-labeler Docker action timed out pulling alpine:3.15 from Docker Hub (fail_if_xl:false, so size never fails it); re-triggered by the test push.

🤖 Generated with Claude Code

#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
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 27, 2026 1:40am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/xs labels Jul 27, 2026
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
@github-actions github-actions Bot added the tests label Jul 27, 2026
@os-zhuang os-zhuang changed the title docs(objectql): document treatAsHistorical audit-timeline preservation (#3493) docs+test: harden treatAsHistorical audit-timeline follow-ups (#3493) Jul 27, 2026
@github-actions github-actions Bot added size/s and removed size/xs labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

13 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx (via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx (via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx (via @objectstack/objectql)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/objectql)
  • content/docs/kernel/services.mdx (via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx (via @objectstack/objectql)
  • content/docs/plugins/index.mdx (via @objectstack/objectql)
  • content/docs/plugins/packages.mdx (via @objectstack/objectql)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/implementation-status.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 02:15
@os-zhuang
os-zhuang merged commit 1598568 into main Jul 27, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/historical-import-timestamps-0hrwxy branch July 27, 2026 02:16
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/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants