Skip to content

0.22.0: provable round: wire negotiation, differential oracle, tx lifetime, derived link cardinality - #200

Open
zvndev wants to merge 4 commits into
mainfrom
sprint/0.22.0-provable
Open

0.22.0: provable round: wire negotiation, differential oracle, tx lifetime, derived link cardinality#200
zvndev wants to merge 4 commits into
mainfrom
sprint/0.22.0-provable

Conversation

@zvndev

@zvndev zvndev commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The 0.22.0 sprint plus a full multi-agent review-and-fix round on top. Everything below was verified red before fixing and green after.

Sprint contents

  • Wire protocol version negotiation: hello blocks on Connect/ConnectOk, error class 10, cross-language conformance vectors decoded and re-encoded by both first-party codecs on every CI run. Backward compatibility verified against the published 0.21.0 npm client and the released 0.21.0 server binary in all pairings (byte-identical legacy ConnectOk).
  • powdb-oracle: differential testing vs bundled SQLite with a strict known-divergences ledger (mandatory owner anchors, stale-entry detection, entry-free policing twins). publish = false, zero new external dependencies.
  • Transaction max lifetime (POWDB_TX_MAX_LIFETIME_MS, default 5 minutes, 0 disables): reap rolls back, releases the write-admission gate, closes the connection; write budgets on the reply path with a bounded closing flush.
  • Derived link cardinality: every engine surface derives to-one/to-many live from target-key uniqueness; the catalog byte is advisory and nothing reads it.
  • ~7,900 lines of new parity/matrix/proptest coverage, fuzz_execute + fuzz_catalog_open corpora, five new required CI gates with fail-closed guard scripts.

Review-and-fix round (all verified red to green)

  • Prepared update no longer silently loses writes under non-unique or non-int indexes.
  • Public Engine::execute_plan lowers plans; embedders get text-identical answers.
  • Materialized views: unparseable stored sources are typed errors, union views refresh, dirty views refresh through every fast path.
  • Int/Float compare numerically in filters on every access path; all six known-divergence pin lists are now empty.
  • Write-side reap never writes after a failed frame; guard tests catch refusals hidden behind helper functions.
  • Bench comparator fingerprint gained a measured arch field; the laptop-spoof hole is closed and the selftest proves it.
  • CHANGELOG populated (including a Fixed section), errors.md documents class 10, POWQL documents the numeric comparison rule.

Verification

  • cargo test --workspace: 123 binaries, 2,072 passed, 0 failed
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings: clean
  • TS client: 68/68
  • Oracle campaign: 219 cases, 2,369 comparisons, 0 unexplained divergences, 0 stale ledger entries

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… oracle, tx lifetime bound, derived link cardinality

The sprint that builds the machines that would have caught our shipped bugs,
then gets caught by them and fixed before merge.

Sprint contents:
- Wire protocol version negotiation (hello blocks on Connect/ConnectOk,
  error class 10, cross-language conformance vectors run by both codecs in
  CI). Verified backward compatible against the published 0.21.0 npm client
  and server binary in all pairings.
- powdb-oracle: differential testing vs bundled SQLite (219 cases, 2,369
  comparisons per run) with a strict known-divergences ledger, stale-entry
  detection, and entry-free policing twin shapes.
- Transaction max lifetime (POWDB_TX_MAX_LIFETIME_MS, default 5 min): a
  reaped transaction rolls back, releases the write gate, and closes the
  connection; write budgets on the reply path.
- Link cardinality derived live from target-key uniqueness everywhere;
  the catalog byte is advisory and no engine surface reads it.
- ~7,900 lines of new parity/matrix/proptest coverage plus fuzz_execute and
  fuzz_catalog_open corpora; five new required CI gates with fail-closed
  guard scripts.

Review-and-fix round on top (multi-agent, all verified red to green):
- Prepared UPDATE no longer silently loses writes under non-unique or
  non-int indexes; the fast path is gated to its provably-correct case.
- Public Engine::execute_plan now lowers plans; embedders get text-identical
  answers.
- Materialized views: unparseable stored sources are typed errors, union
  views refresh, and dirty views refresh through every fast path.
- Int and Float compare numerically in filters on every access path; all six
  known-divergence pin lists are empty.
- The write-side reap never writes after a failed frame and every connection
  exit gets a bounded flush; guard tests catch refusals hidden behind
  helpers.
- Bench comparator fingerprint now includes a measured arch field; the
  laptop-spoof hole is closed and the selftest proves it.
- CHANGELOG populated; errors.md documents class 10; POWQL documents the
  numeric comparison rule.

Workspace: 2,072 tests / 0 failures, fmt and clippy clean, TS client 68/68.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

zvndev and others added 3 commits August 3, 2026 21:01
The node addon suite caught the widened rule at its edge: i64::MAX as f64
rounds up to 2^63, so `.v = 9223372036854775808.0` matched a row holding
i64::MAX on the interpreted path while the exact index machinery matched
nothing, and the answer depended on the access path.

The filter rule is now exact numeric comparison (the SQLite approach), in
one helper (eval::int_f64_cmp) used by the generic evaluator and both
compiled JSON scalar leaves. The compiled float leaf and the float-lane
index probe decline int literals whose widening is not exact (past 2^53,
and literal 0, where total_cmp disagrees with numeric zero equality) and
fall back to the exact generic path.

New coverage: an int_f64_cmp truth table (2^53 neighbors, 2^63, -0.0, NaN,
fractions) and an engine-level access-path parity sweep at extreme
magnitudes. The oracle's new content anchors caught the LIKE code moving
+50 lines and were re-pointed; docs updated from "lossy above 2^53" to the
exact rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…exer

The PR fuzz job pulled `` `:` `` from the corpus: a valid statement (a table
scan of a table named ":") whose canonical text stopped parsing, because the
fuzz target's own printer wrote Ident/DotIdent/Param tokens bare. It now asks
the lexer which spelling reads back as the same token (bare, then
backtick-quoted, else unrenderable), the same rule the engine's stored-view
writer applies. The crashing input is pinned as a seed so the deterministic
replay gate holds the case forever.

Also re-points the two oracle ledger anchors that rustfmt shifted by two
lines after they were first re-pointed; the content-anchor check caught it
both times.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fuzz_execute's first CI run found a client-reachable abort: a
materialized view's backing column types were derived from the first
result row only, while a projection is typed per row. A json-then-int
column (`.tags ?? 0`) hit the row encoder's unreachable (an abort under
the shipped panic=abort profile), and a mixed int/float column was
worse: both are fixed 8-byte columns, so one type's bits were stored
and decoded as the other, turning 7 into 3.5e-323 silently.

- derive_view_schema now unifies each column's type across every row;
  null never constrains it, an all-null column stores as str, and a
  projection that genuinely mixes types in one column is a typed error
  before any backing table exists
- refresh_view validates fresh rows against the frozen backing schema
  before the destructive delete, so a type flip in the source is a
  typed error that keeps the view's previous contents, not an abort
  mid-replace; the access_path_equivalence pin for the old abort now
  asserts the clean error on every read shape
- pinned fuzz seed: materialize over the fixture's nullable json column

CI robustness, all three from the same round:

- fuzz_wal_replay's harness retries fs ops on EINTR: libFuzzer's
  SIGALRM landing inside fs::copy surfaced as a fake crash
- the ping-flood reap test accepts a clean EOF at a frame boundary as
  the reap (the closing flush is time-bounded and a flooded socket can
  hold it up, which is the documented contract); a torn frame still
  fails
- fuzz-corpus-replay guards its cargo install: the job cache restores
  ~/.cargo/bin without cargo's install-tracking metadata, so an
  unconditional install hard-fails on the restored binary

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