feat(help): guided empty states for every worm_audit table; remove dead seed() #12

Merged
KofTwentyTwo merged 2 commits from feature/tables-populated-defaults into develop 2026-10-14 22:15:42 +00:00
KofTwentyTwo commented 2026-10-14 21:52:33 +00:00 (Migrated from github.com)

Audit result

table used? seeded? help
worm_audit_settings WormAuditSettings.read() feeds the chainer, verifier, exporter, schedules and home; edits go through SettingsCustomizer. All 10 settings fields are read at runtime. yes, by the database script (changeset worm-audit:10, insert-if-absent from host config) yes
worm_audit_chain WormAuditChainer writes, verifier/exporter read no: log yes
worm_audit_checkpoint WormAuditChainer writes, verifier/exporter read no: log yes
worm_audit_export SealedExporter, ExportProcesses no: log yes
worm_audit_verification VerificationRuns no: log yes
worm_audit_purge written by the database owner's purge function; AuditStore and the home read it no: log yes

Dead seed() decision: removed

WormAuditSettings.seed() had no caller in src/main, only tests and the demo. I removed it rather than wire it:

  • The database script already seeds row 1 from the host config (insert-if-absent), and read() already falls back to the configured values when the row is absent, so behavior is identical either way.
  • A runtime insert would freeze config-derived values into the row on any transient absence (later config changes would silently stop applying), and adds an application write on a compliance table for no behavior gain.
  • Tests and the demo keep an equivalent helper (WormAuditTestSupport.seedSettings).

What changed

  • help/qbit-worm-audit.yaml (app plus 6 tables, "How rows get created") and WormAuditHelp (STAND-IN for core #1198), called at the end of produce().
  • WormAuditTablesGuardrailTest: runtime use, seeded-or-STARTS_EMPTY, help.
  • WormAuditSettingsSeedTest: the full script is PostgreSQL-only (triggers, roles, plpgsql), so it runs the settings CREATE and the rendered seed statement on H2 in PostgreSQL mode: row appears with host values, second run inserts nothing, an edit survives; also asserts the only top-level INSERT is the settings seed.
  • README, UPGRADE.md (new), CHANGELOG.

No Setup card: the home already shows setup warnings (PostgresSetupWarnings).

Tests

./mvnw -o verify: 92 tests, 0 failures, checkstyle and JaCoCo green. Docker-backed Postgres/MinIO tests were not run locally.

Not done

  • No Liquibase-run seed test: the script is a PostgreSQL-only template with ${...} placeholders, not a plain changelog.

Update after review (4d2a735)

  • WormAuditSettings.seed() is not removed: restored as @Deprecated and documented as the supported way for memory/H2 hosts to create row 1 (the settings table disables insert). Statements above about removing it are superseded. Test: deprecatedSeedStillWorksForMemoryHosts.
  • CHANGELOG: ### Deprecated entry instead of ### Removed; STAND-IN markers carry removeBy=4.1.0-RC.7.

🤖 Generated with Claude Code

## Audit result | table | used? | seeded? | help | |---|---|---|---| | worm_audit_settings | `WormAuditSettings.read()` feeds the chainer, verifier, exporter, schedules and home; edits go through `SettingsCustomizer`. All 10 settings fields are read at runtime. | yes, by the database script (changeset `worm-audit:10`, insert-if-absent from host config) | yes | | worm_audit_chain | `WormAuditChainer` writes, verifier/exporter read | no: log | yes | | worm_audit_checkpoint | `WormAuditChainer` writes, verifier/exporter read | no: log | yes | | worm_audit_export | `SealedExporter`, `ExportProcesses` | no: log | yes | | worm_audit_verification | `VerificationRuns` | no: log | yes | | worm_audit_purge | written by the database owner's purge function; `AuditStore` and the home read it | no: log | yes | ## Dead seed() decision: removed `WormAuditSettings.seed()` had no caller in `src/main`, only tests and the demo. I removed it rather than wire it: - The database script already seeds row 1 from the host config (insert-if-absent), and `read()` already falls back to the configured values when the row is absent, so behavior is identical either way. - A runtime insert would freeze config-derived values into the row on any transient absence (later config changes would silently stop applying), and adds an application write on a compliance table for no behavior gain. - Tests and the demo keep an equivalent helper (`WormAuditTestSupport.seedSettings`). ## What changed - `help/qbit-worm-audit.yaml` (app plus 6 tables, "How rows get created") and `WormAuditHelp` (STAND-IN for core #1198), called at the end of `produce()`. - `WormAuditTablesGuardrailTest`: runtime use, seeded-or-STARTS_EMPTY, help. - `WormAuditSettingsSeedTest`: the full script is PostgreSQL-only (triggers, roles, plpgsql), so it runs the settings CREATE and the rendered seed statement on H2 in PostgreSQL mode: row appears with host values, second run inserts nothing, an edit survives; also asserts the only top-level INSERT is the settings seed. - README, UPGRADE.md (new), CHANGELOG. No Setup card: the home already shows setup warnings (`PostgresSetupWarnings`). ## Tests `./mvnw -o verify`: 92 tests, 0 failures, checkstyle and JaCoCo green. Docker-backed Postgres/MinIO tests were not run locally. ## Not done - No Liquibase-run seed test: the script is a PostgreSQL-only template with `${...}` placeholders, not a plain changelog. ## Update after review (4d2a735) - `WormAuditSettings.seed()` is **not removed**: restored as `@Deprecated` and documented as the supported way for memory/H2 hosts to create row 1 (the settings table disables insert). Statements above about removing it are superseded. Test: `deprecatedSeedStillWorksForMemoryHosts`. - CHANGELOG: `### Deprecated` entry instead of `### Removed`; STAND-IN markers carry `removeBy=4.1.0-RC.7`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.