Skip to content

feat(tuning): give load-only runs full tuning lifecycle parity - #2925

Open
joeharris76 wants to merge 1 commit into
developfrom
feat/tuning-load-only-parity
Open

joeharris76 wants to merge 1 commit into
developfrom
feat/tuning-load-only-parity

Conversation

@joeharris76

Copy link
Copy Markdown
Collaborator

Summary

Implements the D-4 load-only lifecycle parity gate: tuned load-only runs
(--phases generate,load) now execute the same apply → load → post-load →
reconcile → metadata → ledger/receipt → export path as full runs, so a
load-only bundle never carries a tuned mode without platform.tuning.

Soundness review

This change touches the benchmark lifecycle and result-evidence paths.
Requesting soundness review of the current head before merge. This PR must
not auto-merge.

Soundness questions for the reviewer:

  • The native load-only branch now delegates schema/load/apply/metadata to
    adapter._setup_fresh_database_phases instead of calling the native
    loader directly. Confirm no lifecycle side effect (tuned-run marker,
    post-load maintenance accounting, per-table timings) is lost or double
    counted in load-only mode.
  • configure_for_benchmark now runs in load-only mode (session settings
    recorded as session statements). Confirm this is safe for all adapters
    in a query-less run.
  • Adapters without the full lifecycle refuse tuned load-only runs with an
    actionable error. Confirm the refusal message and the untuned fallback
    preserve existing behavior (existing SimpleNamespace-adapter tests cover
    the legacy path).

Verification

  • New test_load_only_lifecycle_parity.py: real-DuckDB parity test
    (load-only ledger statements equal the full-run tail), refusal test,
    untuned-carries-no-tuning test.
  • uv run -- python -m pytest -m fast -q: 37,953 passed, 26 skipped.
  • uv run -- ruff check ., ruff format --check ., ty check: clean.
  • make comment-policy-check, make agent-write-preflight: pass.

Route tuned load-only runs through the adapter's full setup path (schema, tuning apply, metadata, load with post-load hooks) followed by layout fold, reconciliation, session configuration and ledger read-back, exporting tunings, hashes and ledger evidence into the result. Adapters without the full lifecycle refuse tuned load-only runs with an actionable error instead of claiming tuning without evidence.
@joeharris76

Copy link
Copy Markdown
Collaborator Author

/oracle-review

This branch has not been deployed

No deployments
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