Skip to content

Add certificate-checked exact closure over finite domains (SLM-61)#335

Merged
Tyler-R-Kendrick merged 7 commits into
mainfrom
claude/slm-61-exact-closure
Jul 18, 2026
Merged

Add certificate-checked exact closure over finite domains (SLM-61)#335
Tyler-R-Kendrick merged 7 commits into
mainfrom
claude/slm-61-exact-closure

Conversation

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner

Summary

Implements the monotone certificate-checked exact closure for the Verified Scope Solving project (SLM-61 / VSS1-01): a deterministic fixed point that orchestrates the VSS0-04 support oracle and removes only candidates carrying a replay-valid UNSUPPORTED certificate.

Stacked on #332 (SLM-60). Base is claude/slm-60-support-oracle so this diff shows only the VSS1-01 change; it retargets down the stack as bases land. Pure orchestration — it does not reimplement the support search. Torch-free, no decode integration, no ship/speed claim.

Changes

  • dsl/solver/closure.pyexact_closure(state, provider, *, query_order, cache, certificate_store, max_queries) plus CertifiedDeduction, ClosureCounters, ClosureResult, WitnessRef, the SupportProvider protocol, and EnumerativeSupportProvider (the VSS0-04 oracle + its replay checker). Deterministic query order (smallest domain first, then HoleId, then canonical value order); each pass's deductions are computed against a single consistent pass-start state and applied together to one new immutable state; the cache is keyed by state.fingerprint + hole/value + backend version, so a shrunk state is a miss and every removal replays against the exact pre-refinement state. UNKNOWN — and any UNSUPPORTED whose certificate fails replay — never shrinks a domain. Certified bottom only when every value of a domain was removed under an accepted certificate.
  • dsl/solver/__init__.py — exports the closure API.
  • Docsverified-scope-solver.md gains fixed-point pseudocode, pass consistency, stale-proof handling, and the structurally-solved vs certified-bottom vs partial-closure distinction + a dated status note.

Honesty

  • result.state is always a subset of the input; every CertifiedDeduction cites one certificate id per removed value; full certificates live in a caller-provided certificate_store (records hold only digests + compact summaries).
  • A deliberately forged UNSUPPORTED certificate leaves state identity unchanged (replay fails → no removal); a stale proof (fingerprint mismatch) is rejected; a max_queries budget yields an honest partial (reached_fixed_point=False, stop_reason="budget:max_queries"), never a bottom or solved claim.

Verification

python -m pytest tests/test_dsl/test_solver_closure.py tests/test_dsl/test_solver_support.py -q31 passed · ruff clean · python -m scripts.repo_policy ok · git diff --check clean. test_solver_closure.py (13 tests) pins multi-pass propagation (a value removed only after an earlier reduction), UNKNOWN/SUPPORTED retention, forged-certificate no-op, certified bottom, budgeted partial closure, determinism, cache identity, stale-replay rejection, the subset invariant, and torch-free.

Honest caveat: .githooks/check-changed --staged surfaces the same 13 pre-existing environmental DSL/pack/tokenizer failures as the base branch (vocab_size 500 != 480, bridge-unavailable QUARANTINE), unrelated to this change; all dsl/solver/* tests pass.

🤖 Generated with Claude Code


Generated by Claude Code

claude and others added 5 commits July 17, 2026 20:50
Specify the guarantee boundary separating prefix legality from support
(participation in a bounded, fully verified completion) for the Verified
Scope Solving & Hybrid Realization project. Spec-only: no solver code,
dependency, experiment, or checkpoint; decode behavior is unchanged until a
later VSS issue enables new flags.

- docs/design/verified-scope-solver.md: term definitions, SUPPORTED /
  UNSUPPORTED / UNKNOWN semantics (UNKNOWN never removes a candidate), a
  deterministic bounded-enumeration reference backend (no SMT/Z3) plus an
  optional future backend protocol, certificate replay and the
  deduction-vs-decision transitions with every destructive step citing an
  exact proof/replay, capsule SCC boundaries, late realization, a
  relationship-to-existing-code table, and an end-to-end partial-coverage
  live-UNKNOWN example.
- research-lineage.md: VSS0 research anchors (DeepCoder, CEGIS, egg /
  e-graphs, EDLM, TreeDiff, LDT) with the existing Faithful/Adapted/
  Surrogate/Adjacent fidelity vocabulary; none tagged Faithful (spec-only).
- README.md: register the new doc in the design-doc navigation index.

Verified: python -m scripts.repo_policy ok, check-changed selects no tests
(docs-only), git diff --check clean, all relative links resolve.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeD6nTTabPQhva7pXtTMNj
…SLM-60)

VSS0-04: implement the deterministic reference oracle that decides whether a
candidate participates in at least one bounded, verifier-accepted completion —
the first component allowed to produce UNSUPPORTED — plus a pure replay checker.
Torch-free, not wired into decode, no ship or speed claim.

- dsl/solver/support.py: SupportQuery / SupportCertificate / SupportResult /
  SearchCounters, the SupportOracle + ProblemExpander + Verifier protocols, and
  EnumerativeSupportOracle — iterative (no Python recursion) deterministic search
  in canonical domain-value order, fingerprint dedup, per-SolverBounds budgets,
  tri-state verdicts (SUPPORTED witness / exhausted-complete UNSUPPORTED /
  partial|budget|unavailable UNKNOWN), and replay_support_certificate returning
  structured violations rather than a bare bool.
- dsl/solver/openui_support.py: OpenUIForestExpander (advances a token prefix via
  build_completion_forest + completion_forest_state; eos->terminal, none->dead,
  partial->incomplete) and OpenUIWellFormedVerifier (lang-core validate; ParseError
  ->REJECT, missing-bridge/timeout->UNAVAILABLE, never UNSUPPORTED).
- tests/test_dsl/test_solver_support.py: tiny closed fixtures pinning all three
  verdicts, witness-before-partial, duplicate-state suppression, determinism,
  stale-query/candidate rejection, JSON round-trip, torch-free, and replay
  rejection of tampered digests / non-exhausted UNSUPPORTED / incomplete coverage /
  stale versions, plus an OpenUI wiring smoke.
- solver/__init__ exports the new public API; docs add the implemented-oracle
  section + tri-state table + replay rules to verified-scope-solver.md and a
  prefix-extendability-vs-support subsection to lattice-recursive-search.md.

Verified: pytest test_solver_support.py test_solver_state.py test_compiler_decode.py
(92 passed), ruff, repo_policy, git diff --check. Stacked on SLM-59. The 13 failures
check-changed surfaces are pre-existing environmental DSL/pack/tokenizer failures on
the base branch (vocab 500!=480, bridge-unavailable QUARANTINE), unrelated to this
change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHgqD6cnywdnaXP9gRFCwt
VSS1-01: implement the deterministic monotone fixed-point operator that
orchestrates the VSS0-04 support oracle and removes only candidates carrying a
replay-valid UNSUPPORTED certificate. Pure orchestration — it does not reimplement
the support search. Torch-free, no decode integration, no ship claim.

- dsl/solver/closure.py: exact_closure(state, provider, *, query_order, cache,
  certificate_store, max_queries) plus CertifiedDeduction / ClosureCounters /
  ClosureResult / WitnessRef and the SupportProvider protocol +
  EnumerativeSupportProvider (oracle + replay). Deterministic query order (smallest
  domain, then HoleId, then canonical value order); per-pass deductions applied
  against one consistent pass-start state; stale proofs re-queried (cache keyed by
  state fingerprint + hole/value + backend version); certified bottom only when
  every value was removed under an accepted certificate; UNKNOWN / failed-replay
  never shrink a domain.
- tests/test_dsl/test_solver_closure.py: tiny fixtures for multi-pass propagation,
  UNKNOWN/SUPPORTED retention, forged-certificate no-op (state identity unchanged),
  all-unsupported certified bottom, budgeted partial closure, determinism, cache
  identity, stale-replay rejection, subset invariant, and torch-free.
- solver/__init__ exports the new API; docs add fixed-point pseudocode + pass
  consistency + stale-proof handling + structurally-solved vs certified-bottom vs
  partial-closure to verified-scope-solver.md.

Verified: pytest test_solver_closure.py test_solver_support.py (31 passed), ruff,
repo_policy, git diff --check. Stacked on SLM-60. The 13 check-changed failures are
pre-existing environmental DSL/pack/tokenizer failures on the base branch, unrelated
to this change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHgqD6cnywdnaXP9gRFCwt
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
slm-training Ready Ready Preview, Comment Jul 18, 2026 4:50am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Tyler-R-Kendrick, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b0530f9-b6b2-464a-b29a-6ece9fe9f131

📥 Commits

Reviewing files that changed from the base of the PR and between 3847f45 and 906cd27.

📒 Files selected for processing (4)
  • docs/design/verified-scope-solver.md
  • src/slm_training/dsl/solver/__init__.py
  • src/slm_training/dsl/solver/closure.py
  • tests/test_dsl/test_solver_closure.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/slm-61-exact-closure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The prior commit staged the test file before the F401 unused-import fix was
applied, so CI's `ruff check .` failed on CertifiedDeduction/ClosureResult/
WitnessRef. Drop them; only default_query_order and exact_closure are used.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHgqD6cnywdnaXP9gRFCwt
Base automatically changed from claude/slm-60-support-oracle to main July 18, 2026 04:28
# Conflicts:
#	docs/design/lattice-recursive-search.md
#	docs/design/verified-scope-solver.md
#	src/slm_training/dsl/solver/__init__.py
@Tyler-R-Kendrick
Tyler-R-Kendrick merged commit 955c243 into main Jul 18, 2026
4 checks passed
@Tyler-R-Kendrick
Tyler-R-Kendrick deleted the claude/slm-61-exact-closure branch July 18, 2026 04:58
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.

2 participants