test(tuning): pin soundness boundaries (status vocab, hash canonicality, registry drift, marker round-trip, shared mode vocabulary)#1177
Merged
Conversation
…ty, registry drift, marker round-trip, shared mode vocabulary) Adds the six test-only work units from the 2026-07-12 tuning review's finding R7, re-scoped against what #1174 (canonical platform keys) and #1167 (generator registry completeness) already landed: - w1: removes the fictional "PASSED" validation-status fixtures in test_tpc_tuning_template_parity.py and pins the real vocabulary (NOT_APPLICABLE/APPLIED/FAILED_TO_SAVE/NOT_VALIDATED) via AST-derived extraction from adapter.py/models.py, not a hand-copied set. - w2: hash canonicality for BenchmarkTunings.get_configuration_hash (full 64-char sha256, insertion-order stable) and profile_validation.hash_tuning_template (16-char truncated; collision posture documented in the assertion message). - w3: cross-source drift test between get_ddl_generator()'s registry, _PLATFORM_COMPATIBILITY_MAP, and platform_capabilities.map_candidate_ to_platform's supported set, narrowed to skip the compat-map/ known-platforms sync #1174 already covers. Every current divergence is an explicit allowlisted entry (ADR-3 gates consolidation); the test fails on new or stale drift only. - w4: feeds resolve_tuning()'s real info_messages into coverage.py's real status_from_log_text() (no hand-written marker strings). - w5: adds the shared ADR-2 tuning_mode vocabulary artifact (tests/unit/ core/tuning/fixtures/tuning_mode_vocabulary.yaml, kept out of a gitignored data/ dir) asserted identically by a Python test and a vitest test (via the db-remediation-pin.test.ts shell-out pattern) -- pins the ADR-2 target contract, not current-emitter compliance. - w6: a stub-adapter/recording-connection harness pinning today's tunings_applied = requested-config behavior (not verified-executed statements), named and documented as such pending the applied-ledger TODO. Verified: tests/unit/core/tuning, tests/unit/cli/test_tuning*, and tests/uat/test_tuning_coverage.py all green (555 passed); results-explorer vitest suite green (768 passed); drift-demo performed and reverted (removing _PLATFORM_COMPATIBILITY_MAP's "mysql" entry failed 2 of the new w3 tests with clear stale-allowlist messages). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QTnjb2i44JUL71kmu9sk1t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Implements TODO
tuning-soundness-test-coverage-20260712(review finding R7 — zero coverage on every tuning soundness boundary). Adds:adapter.py,models.pydefault), so a new status literal fails the test; removes the fictional"PASSED"fixtures (a value production never emits).hash_tuning_template) documented in assertions.map_candidate_to_platform, with per-divergenceEXPECTED_*allowlists (ADR-3-gated) and failure messages distinguishing new drift from stale allowlists. Drift-demo performed: removingmysqlfrom the compat map failed 2 tests with explicit messages; reverted.resolve_tuning()output fed to the real parser; no hand-written strings.tests/unit/core/tuning/fixtures/tuning_mode_vocabulary.yamlpinning ADR-002's set{tuned, tuned-fallback, notuning, auto, custom}+not-recordedsentinel, asserted by pytest AND a vitest test (shell-out pattern matching the existingdb-remediation-pintest).tunings_applied == requested configgap through the real_setup_fresh_database_phasespath with a recording connection; docstring defers verified-execution assertions to the ADR-001 applied-ledger TODO.Narrowed w3 where #1174/#1167 already landed sync/registry tests (documented in the TODO notes). Moves the TODO to DONE.
Type of Change
Testing
tests/unit/core/tuning+tests/unit/cli/test_tuning*+tests/uat/test_tuning_coverage.py— 555 passed; results-explorer vitest — 768 passed full run (4/4 new); ruff +tsc --noEmitcleanPublic Contract Check
Documentation
Code Quality
coverage.pyscope allowance went unused).Artifact Hygiene
data/directory names (repo .gitignore blankets those).Notes
Part of the tuning remediation batch (#1161). The requested-vs-applied test is designed to be superseded by
tuning-applied-ledger-and-validation-status-20260712.🤖 Generated with Claude Code
https://claude.ai/code/session_01QTnjb2i44JUL71kmu9sk1t
Generated by Claude Code