feat(dialect): verified per-dialect semantic refactoring policies - #19
Merged
Conversation
…ct policies Route introduce-let, rename-binding, and extract-function through a VerifiedSemanticPolicy type-state proof so every dialect (Common Lisp, Emacs Lisp, Scheme, Clojure, Janet, Fennel) either gets a verified semantic shape or a structured unsupported/unknown denial instead of Common-Lisp-shaped guesses. Common Lisp keeps its existing code path. - add per-dialect scope/definition/binder/body shapes (dialect::semantic) - add reader policy so dialect-specific reader syntax stops semantic refactors instead of being misparsed (sexpr::reader_policy) - expose a per-command dialect support matrix via inspect capabilities and deny dispatch for unsupported/unknown combinations (cli::contract) - generalize rename call-identity, inline-function, lexical-scope capture, and extract-function inference across dialects - add dialect contract tests (161 new tests) plus proptest seeds
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.
Summary
Generalizes the semantic refactoring engine beyond Common Lisp. Introduce-let, rename-binding, and extract-function now dispatch through a
VerifiedSemanticPolicy<Operation>type-state proof: each dialect (Common Lisp, Emacs Lisp, Scheme, Clojure, Janet, Fennel) either provides a verified semantic shape (scope/definition/binder/body) or the CLI denies dispatch with a structuredunsupported/unknownstatus instead of applying Common-Lisp-shaped heuristics to foreign syntax.domain::dialect::semantic(new): sealed per-operation markers (IntroduceLetOperation,RenameBindingOperation,ExtractFunctionOperation) and per-dialectScopeShape/DefinitionShape/BinderShape/BodyShapedescriptions; Common Lisp keeps its existing code path unchanged.domain::sexpr::reader_policy(new): dialect reader syntax that cannot be represented faithfully stops semantic refactors instead of being silently misparsed.cli::contract(new):inspect capabilitiesnow emits a per-command × per-dialect support matrix (supported/unsupported/unknown), and command dispatch enforces it.Excluded after repo-wide triage
All local diffs, branches, and the stash were reviewed for inclusion:
origin/feat/local-trailing-whitespace(e745ad5): already merged into main via PR refactor: enforce domain boundaries; fix trailing whitespace and split-file reader safety #17 (normalize_changed_line_triviais on main) — the branch is stale and can be deleted.stash@{0}(similarity_report newtype WIP): incomplete, and itsString→PathBufchange for S-expression form paths ("0.1") is a semantic mismatch — excluded.Testing
cargo test: 2,600+ tests green locally (1,108 in the main lib suite), including 161 new dialect-contract tests.cargo clippy --all-targetsandcargo fmt --check: clean.proptest-regressions/.