ubiquitous-invention/packages/database/migrations/meta/_journal.json
Randall Stillwell 336a5890a8 feat(audit): append-only audit_log, workspace archive cascade + restore, audit view
Soft-delete cascade was the missing half of archive: stamping
workspaces.archived_at alone left objects visible to anyone with a
direct id. The cascade runs in one transaction so the partial state
isn't reachable, and restore inverts it for any archived row in the
workspace — provenance-blind on purpose until we have a use case
that needs to distinguish per-workspace from per-object archives.

audit_log keeps the keyset index on (workspace_id, created_at) and
the actor_user_id FK with onDelete set null. recordAudit() refuses
to write a null actor without a metadata.system_actor label so the
audit view always has something to render. workspaces and invites
mutations call recordAudit on success; objects-router instrumentation
and the markdown importer's system-actor flow are filed as P2
follow-ups because each needs a thoughtful "what's audit-worthy?"
pass, not mechanical wiring.

Settings → Audit log lives at /<slug>/settings/audit, owner-gated,
keyset-paginated. ACTION_LABELS is small on purpose; new actions
fall back to their raw key so missing a label degrades gracefully.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:35:16 -05:00

62 lines
No EOL
1.2 KiB
JSON

{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1774617985473,
"tag": "0000_nervous_ogun",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1774632231368,
"tag": "0001_parched_red_hulk",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1777225115319,
"tag": "0002_markdown_backlog_cursor_sync",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1778124738113,
"tag": "0003_damp_green_goblin",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1779987416637,
"tag": "0004_medical_blob",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1780412597413,
"tag": "0005_cooing_midnight",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1780413875620,
"tag": "0006_broad_lethal_legion",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1780424597399,
"tag": "0007_flaky_kinsey_walden",
"breakpoints": true
}
]
}