Skip to content

refactor: generate DAO candidates through jet3-cli requests (#380 part 6) - #394

Merged
oglassdev merged 3 commits into
mainfrom
cleanup/examples-to-cli
Sep 25, 2026
Merged

oglassdev merged 3 commits into
mainfrom
cleanup/examples-to-cli

Conversation

@oglassdev

@oglassdev oglassdev commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Closes the last cleanup item of #380. The 39 crates/jet3/examples/* candidate programs and their *_support/ directories are gone. Every DAO suite now builds its candidates from jet3-cli create/mutate requests.

Approach

  • Each registry suite now has a candidates(spec) method. It returns image recipes of the form {file, from, steps}. oracle/windows-dao/recipes.py runs those recipes through jet3-cli. Steps can be a request, limits, locate (a row locator lookup, optionally in another image), an expected refusal, or a small byte edit. The byte edit is used for the wide-row damage cases.
  • Rust-reader receipts, which the example programs used to print, now come from jet3-cli inspect --layout. common.reader() loads that output, and each suite adapts it to its existing receipt shape. Self-validation still goes through common.validate.
  • Continuation images (prepare_continue) are also built through recipes.
  • scripts/golden-check.sh now builds only jet3-cli. It runs scripts/golden_corpus.py, which applies the creation/mutation recipes in scripts/golden_recipes/ plus every registry suite's candidates, together with the existing CLI types/schema/mutate corpus.
  • The indexed-boundary test support moved to crates/jet3/tests/support/indexed_boundary.rs.
  • Updated the README, the oracle README, the support-matrix paths (tools/validate_contract.py passes) and the suite specs (the example key is removed).
  • No Rust was kept. No testkit binary was needed, because the receipts became inspect --layout. The parser crate's public API is unchanged.

CLI additions

Existing requests produce the same behavior and output.

  • mutate and create take the --max-allocation-bytes, --max-work-units, --max-chain-depth and --max-encoded-bytes flags after --input. They set the write resource budget. The allocation and chain-budget refusal suites need these.
  • A {"long_value": [bytes...]} cell passes raw long-value bytes, so the caller-supplied-header refusal can be expressed.
  • inspect <file> --layout [--table <name>] reports:
    • row locators, stored value bytes, and long-value references with their payloads;
    • index definitions, with trees and entries.
  • Tests were added to crates/jet3-cli/tests/{inspect,mutate}.rs.

Byte identity (base 3fe1fd6 examples vs HEAD recipes)

SHA-256 of every database the base examples produced (from the golden corpus's gen/ and mut/ directories), compared with the recipe-built corpus:

Suite / recipe dir Databases Identical
allocation-lifecycle 4 4
autoincrement 6 6
composite-index 3 3
creation-tables 10 10
definition-chains 6 6
empty-value 20 20
field-update 1 1
fixed-field-update 11 11
fixed-text-index 22 22
index-capacity 19 19
index-trees 27 27
indexed-boundary 6 6
indexed-row 3 3
indexed-rows 8 8
initial-long-value 2 2
initial-row 1 1
long-value-lifecycle 32 32
memo-allow-empty 2 2
multi-level-index 3 3
multi-page-row 1 1
multi-table-row 2 2
multiple-index 2 2
multiple-long-values 8 8
nullable-index 6 6
numeric-index 8 8
numeric-indexes 39 39
practical-lifecycle 16 16
relationship-graph 2 2
relationship-mutation 8 8
relationship-row 1 1
rich-relationship 1 1
row-delete 1 1
row-delete-compaction 1 1
row-insert 1 1
row-update 4 4
single-leaf-key 6 6
wide-rows 30 30
total 323 323

The HEAD corpus has 328 databases, and none of them lacks a base counterpart: the extra five are repeated fixtures. With JET3_ROW_OVERFLOW_CAPTURES set, the opt-in row-overflow recipes match as well: 42/42 identical.

Offline replay against retained DAO runs

The retained 20260924-oracle-harness outboxes were replayed without the VM. For each suite, the regenerated candidate images and continuation images were byte-compared with the retained ones, and evaluate was re-run:

Suite Candidate images Continuation images Evaluate
creation-tables 10/10 — accepted
index-capacity 19/19 10/10 accepted
index-trees 27/27 6/6 accepted
indexed-boundary 6/6 — accepted
indexed-rows 8/8 — accepted
long-value-lifecycle 32/32 8/8 accepted
multiple-long-values 8/8 — accepted
numeric-indexes 39/39 14/14 accepted
practical-lifecycle 16/16 — accepted
wide-rows 30/30 16/16 accepted

Golden-check corpus

  • Before (base 3fe1fd6, old script): 1,923 non-log outputs, including 354 databases.
    • 323 were example databases.
    • 31 came from the CLI types/schema/mutate corpus.
  • After: 6,880 non-log outputs. These include:
    • the 328 recipe databases plus the same 31 CLI databases;
    • the generated request/receipt JSON for every suite.
  • scripts/golden-check.sh HEAD (base == head): 8,047 files, 8,047 identical, 0 differ, in 32s.
  • Base revisions for this script must support the corpus requests. So the first useful base is this branch; 3fe1fd6 was compared through the sweep above.

Failures that already exist on main

Both were converted as-is, with the same bytes and the same failure. They are not fixed or hidden here.

  • definition-chains: prepare still fails with "Compact candidate continuation placement". All 6 candidate images are identical.
  • allocation-lifecycle: still fails with field update failed: Catalog(Page(Read(LimitExceeded { kind: TotalReadBytes, requested: ByteCount(536870927), maximum: ByteCount(536870912) }))). All 4 images are identical, and the receipt adapter matches the old Rust receipts.

Checks

  • just ready: passed. It covers fmt, clippy, tests, docs, source size, the support matrix, and the Python checks, including 20 oracle unit tests.
  • dao.py list enumerates all 19 suites.
  • No Windows VM run was needed. The evidence is the byte identity above plus the offline replays.

Size

  • crates/jet3/examples/: removed 47 files and 9,410 lines.
  • Whole PR: +2,196 / −9,913 across 93 files.
    • The new CLI code is about 400 lines, including tests.
    • The new recipe/registry Python is about 1,800 lines.

🤖 Generated with Claude Code

…t --layout

create and mutate accept --max-allocation-bytes, --max-work-units, --max-chain-depth and --max-encoded-bytes after --input; row cells accept {"long_value": [...]}; inspect --layout reports each table's row locators, stored bytes, long-value payloads and references, and index definitions and trees. Existing requests and outputs are unchanged.
Registry suites describe their Rust candidates as ordered jet3-cli request recipes (oracle/windows-dao/recipes.py) built with the run's frozen CLI. Rust reader receipts come from jet3-cli validate and inspect --layout; refusal receipts from the CLI results. golden-check builds the same recipes plus the archived candidates' recipes (scripts/golden_recipes).
Their recipes now live in the oracle registry modules and scripts/golden_recipes; the indexed-boundary test fixture moves under crates/jet3/tests/support.
@oglassdev
oglassdev merged commit a05b241 into main Sep 25, 2026
10 checks passed
@oglassdev
oglassdev deleted the cleanup/examples-to-cli branch September 25, 2026 00:47
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