Skip to content

feat(dialect): verified per-dialect semantic refactoring policies - #19

Merged
takeokunn merged 1 commit into
mainfrom
feat/all-dialect-support
Jul 19, 2026
Merged

feat(dialect): verified per-dialect semantic refactoring policies#19
takeokunn merged 1 commit into
mainfrom
feat/all-dialect-support

Conversation

@takeokunn

Copy link
Copy Markdown
Collaborator

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 structured unsupported/unknown status instead of applying Common-Lisp-shaped heuristics to foreign syntax.

  • domain::dialect::semantic (new): sealed per-operation markers (IntroduceLetOperation, RenameBindingOperation, ExtractFunctionOperation) and per-dialect ScopeShape/DefinitionShape/BinderShape/BodyShape descriptions; 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 capabilities now emits a per-command × per-dialect support matrix (supported/unsupported/unknown), and command dispatch enforces it.
  • Generalized across dialects: rename call-identity, inline-function/inline-lambda, lexical-scope capture analysis, extract-function inference, binding-form composition (let/let*/flet/labels equivalents).

Excluded after repo-wide triage

All local diffs, branches, and the stash were reviewed for inclusion:

Testing

  • cargo test: 2,600+ tests green locally (1,108 in the main lib suite), including 161 new dialect-contract tests.
  • cargo clippy --all-targets and cargo fmt --check: clean.
  • proptest regression seeds committed under proptest-regressions/.

…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
@takeokunn
takeokunn merged commit d00fdeb into main Jul 19, 2026
3 checks passed
@takeokunn
takeokunn deleted the feat/all-dialect-support branch July 19, 2026 05:55
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