Skip to content

harden: production-readiness pass (gold-standard audit)#89

Merged
zvndev merged 1 commit into
mainfrom
chore/gold-standard-prod-hardening
Jun 13, 2026
Merged

harden: production-readiness pass (gold-standard audit)#89
zvndev merged 1 commit into
mainfrom
chore/gold-standard-prod-hardening

Conversation

@zvndev

@zvndev zvndev commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Implements the actionable findings from the gold-standard audit (43.5/50). Closes the real gaps without cargo-culting. Behavior-preserving for existing clients.

Server / security

  • RBAC enforces the full permission lattice. Statements map to Read/Write/Ddl; readwrite now explicitly carries Ddl (app users create their own tables), so readwrite/admin keep full access, readonly stays read-only, any authenticated role may still read. Admin reserved for user management. Was previously a binary read/write gate with a defined-but-unenforced lattice. +tests.
  • Resource-limit errors surface to remote clients. Sort/join/memory-budget errors (e.g. "…add a LIMIT clause") were masked to the generic query execution error by the wire sanitizer — same bug class as the unique-violation message fixed last release. Now allowlisted (leak no internal state). +tests.

Release / CI / supply chain

  • Automated post-publish durability gatescripts/smoke-release.sh: install → README PowQL flow → kill -9 → restart → assert WAL replay recovered every row + unique constraint still enforced. Wired as a required release.yml job. This is the exact gate whose absence yanked v0.4.1–0.4.3. Verified ALL-PASS locally.
  • Real MSRV build job — compiles the workspace on the pinned 1.93 toolchain (the old job only grepped that the version string matched docs).
  • cargo audit fixed — scoped-ignore the 3 postgres DoS advisories whose entire path is confined to the publish = false powdb-compare bench crate (.cargo/audit.toml + action ignore:, with provenance). No shipping crate affected; cargo audit now exits clean instead of failing the gate on dev-only noise.
  • TS client version drift fixedCLIENT_VERSION = src = dist = package.json (0.5.0); README points at npm so it can't restale; new CI job asserts package.json === CLIENT_VERSION.
  • Dockerfile dep-cache now copies the auth/backup manifests it was silently missing (full dependency closure cached).

Build / hygiene

  • panic = "abort" documented as a deliberate crash-only design (fast exit → supervised restart → WAL replay → consistent state — safer for a stateful engine than unwinding into a poisoned RwLock). Every deploy example confirmed under an auto-restart policy; requirement documented in examples/deploy/README.md. (The audit suggested removing abort; verifying against the actual lock model showed keeping it is the correct, safer call — see the Cargo.toml comment.)
  • [workspace.lints] (clippy::all = deny) so cargo clippy fails locally with the same rules CI enforces. No new failures — mirrors the existing gate.
  • Removed ~190 LOC dead mvcc.rs/tx.rs snapshot-isolation scaffolding shipping in powdb-storage; the live engine uses RwLock.
  • Fixed stale powdb-auth "not wired in" doc-comments and a CLI --help example using a | pipe operator PowQL doesn't have.

Verification

cargo build/clippy/fmt clean · full workspace tests 0 failures · scripts/smoke-release.sh ALL-PASS · cargo audit clean · TS-version assert pass.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Implements the audit's P0–P2 findings (43.5/50 → closes the actionable gaps).

Server / security
- RBAC now enforces the full permission lattice: statements map to
  Read/Write/Ddl; readwrite gains Ddl (behavior-preserving — readwrite/admin
  keep full access, readonly stays read-only, any role may read). Admin
  reserved for user mgmt. (handler.rs, role.rs)
- Resource-limit errors (sort/join/memory budget) now reach remote clients
  verbatim instead of being masked to 'query execution error' — same fix
  class as the unique-violation message. +tests.

Release / CI / supply chain
- scripts/smoke-release.sh: post-publish durability gate (install → README
  PowQL flow → kill -9 → restart → assert WAL replay recovered rows + unique
  still enforced), wired as a required release.yml job. Verified ALL-PASS.
- Real MSRV build job (compiles on pinned 1.93, not just a doc grep).
- cargo audit: scoped-ignore the 3 postgres DoS advisories confined to the
  publish=false powdb-compare crate (.cargo/audit.toml + action ignore), with
  provenance. cargo audit now exits clean; no shipping crate affected.
- TS client version drift fixed (CLIENT_VERSION=src=dist=pkg 0.5.0) + a CI
  job that asserts package.json === CLIENT_VERSION.
- Dockerfile dep-cache now copies auth+backup manifests (full closure).

Build / hygiene
- panic='abort' documented as a deliberate crash-only design (fast exit →
  supervised restart → WAL replay); every deploy example confirmed under an
  auto-restart policy + documented in examples/deploy/README.md.
- [workspace.lints] clippy::all=deny so clippy fails locally like CI does.
- Removed ~190 LOC dead mvcc.rs/tx.rs scaffolding from powdb-storage.
- Fixed stale powdb-auth 'not wired in' doc-comments + CLI --help PowQL
  pipe-operator example that doesn't parse.

Verified: cargo build/clippy/fmt clean, full workspace tests 0 failures,
smoke-release ALL-PASS, cargo audit clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zvndev zvndev merged commit fa58095 into main Jun 13, 2026
9 checks passed
zvndev added a commit that referenced this pull request Jun 14, 2026
Bumps workspace + inter-crate pins 0.4.7 → 0.4.8, moves CHANGELOG
[Unreleased] → [0.4.8], updates SECURITY.md supported-versions and the
user-facing version pins (cargo install, ghcr image tags, REPL banners).
Historical 'since 0.4.7' notes left intact.

Ships the gold-standard hardening from #89: full RBAC lattice enforcement
(behavior-preserving), resource-limit errors surfaced to remote clients,
automated post-publish durability gate, MSRV build job, scoped cargo-audit,
crash-only panic documentation, dead-code removal.

Verified: build/clippy/fmt clean, full workspace tests 41 suites 0 failures,
backward-compat (v0.4.7-created DB + auth.json open cleanly on 0.4.8, both
directions), smoke-release ALL-PASS.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant