SQL Workbench: table help, guardrail test, audit retention #25

Merged
KofTwentyTwo merged 2 commits from feature/tables-populated-defaults into develop 2026-10-14 22:19:51 +00:00
KofTwentyTwo commented 2026-10-14 21:58:12 +00:00 (Migrated from github.com)

Audit

  • All 6 tables are read/written by runtime code (NotebookService and NotebookVersioning for notebook/cell/version/share/snapshot, ExecutionAuditor for execution). All are user content or logs, so none is seeded (no optional Welcome notebook either).
  • notebookVersionRetention=100: enforced by NotebookVersioning.prune on save; covered by NotebookServiceTest (retention keeps the newest 3).
  • Execution retention did not exist (DESIGN.md said auditRetentionDays, "the host prunes"; no code). Fixed: new auditRetentionDays config, default null (keep forever, so no behavior change on deploy). When set, old non-RUNNING audit rows are deleted at most once an hour as a run is audited.
  • Home already has empty states for no notebooks and no runs.

Changes

  • help/sql-workbench.yaml + SqlWorkbenchHelp (STAND-IN core#1198), applied after the app and tables are in the instance; never overrides host help.
  • auditRetentionDays + ExecutionAuditor.pruneIfDue / pruneOlderThan.
  • Docs: README, UPGRADE, CHANGELOG, DESIGN. docs/ddl/postgres.sql and the H2 schema untouched (PR #23).

Tests

SqlWorkbenchTablesGuardrailTest, SqlExecutionEngineTest.testAuditRetentionPrunesOldRows, testAuditRetentionValidation. CI=true ./mvnw verify green (incl. Postgres integration).

Not done

None.

🤖 Generated with Claude Code

## Audit - All 6 tables are read/written by runtime code (NotebookService and NotebookVersioning for notebook/cell/version/share/snapshot, ExecutionAuditor for execution). All are user content or logs, so none is seeded (no optional Welcome notebook either). - `notebookVersionRetention=100`: enforced by `NotebookVersioning.prune` on save; covered by `NotebookServiceTest` (retention keeps the newest 3). - Execution retention did not exist (DESIGN.md said `auditRetentionDays`, "the host prunes"; no code). Fixed: new `auditRetentionDays` config, default null (keep forever, so no behavior change on deploy). When set, old non-RUNNING audit rows are deleted at most once an hour as a run is audited. - Home already has empty states for no notebooks and no runs. ## Changes - `help/sql-workbench.yaml` + `SqlWorkbenchHelp` (STAND-IN core#1198), applied after the app and tables are in the instance; never overrides host help. - `auditRetentionDays` + `ExecutionAuditor.pruneIfDue` / `pruneOlderThan`. - Docs: README, UPGRADE, CHANGELOG, DESIGN. `docs/ddl/postgres.sql` and the H2 schema untouched (PR #23). ## Tests `SqlWorkbenchTablesGuardrailTest`, `SqlExecutionEngineTest.testAuditRetentionPrunesOldRows`, `testAuditRetentionValidation`. `CI=true ./mvnw verify` green (incl. Postgres integration). ## Not done None. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.