Skip to content

v3.10.0

Choose a tag to compare

@58bits 58bits released this 13 Jun 03:27

Highlights

  • @byline/core, @byline/db-postgres, @byline/client, @byline/host-tanstack-start — added the document-grain audit log, an internal staff-accountability record for the document changes the immutable version stream deliberately does not attribute: in-place status transitions, document deletions, and the non-versioned path and available-locale edits. Each such change and its audit row now commit atomically in one transaction (built on the withTransaction capability from 3.9.0), so a change can never land without its audit record. Rows are written by the lifecycle write-points in @byline/core and stored in the new byline_audit_log table (@byline/db-postgres), which is deliberately FK-free so an audit row outlives the document, collection, or actor it names. The log is read back through a new gated CollectionHandle.auditLog() in @byline/client that inherits the document's own read gate exactly as history() does — an actor who cannot see a document gets an empty log rather than leaked change metadata. In the admin, @byline/host-tanstack-start surfaces it as a Document history tab alongside Content versions on the existing /history route, listing who changed what, when, and from → to. See docs/AUDIT.md (Workstreams 2–3).

Chores

  • @byline/cli — synced the bundled Drizzle migration baseline to the squashed 0000 (so fresh byline init installs provision the byline_audit_log table), fixed install-breaking i18n scaffold drift (admin interface locales now default to en/fr with the required adminTranslations bundle wired and split into a dependency-free locales.ts leaf), added @byline/i18n to the installed dependency set, wired the richtext toMarkdown export seam into the scaffolded server.config.ts, and bumped the scaffold's @byline/* version floor to ^3.0.0.
  • @byline/db-postgres — added sortable numeric prefixes to the hand-maintained production upgrade scripts under sql/ (0001_upgrade-2.7.0-to-3.0, 0002_set-source-locale-not-null, 0003_add-audit-log) so they read in historical order.

Migrations

  • @byline/db-postgres — the audit log requires a new byline_audit_log table. Fresh installs get it automatically via drizzle:migrate / byline init. Existing production databases must run the migration before deploying 3.10.0: psql "$DATABASE_URL" -f packages/db-postgres/sql/0003_add-audit-log.sql, executed as the application DB role (the role in your connection string / the database owner), not as a superuser — a table created by postgres is invisible to the app role (permission denied). The migration is purely additive (new table, no backfill, no NOT NULL retrofit). This is required, not optional: on 3.10.0 the document-grain write-points append an audit row in the same transaction, so a missing table would roll back status changes, deletions, and path / available-locale edits.

All other @byline/* packages bumped to 3.10.0 in lockstep with no behavioural changes this cycle.