Skip to content

refactor: enforce domain boundaries; fix trailing whitespace and split-file reader safety - #17

Merged
takeokunn merged 3 commits into
mainfrom
feat/consolidate-domain-and-fixes
Jul 13, 2026
Merged

refactor: enforce domain boundaries; fix trailing whitespace and split-file reader safety#17
takeokunn merged 3 commits into
mainfrom
feat/consolidate-domain-and-fixes

Conversation

@takeokunn

Copy link
Copy Markdown
Collaborator

Summary

Consolidates useful, tested work found sitting unmerged across local branches/worktrees:

  • refactor: enforce domain boundaries — continues the domain-owned refactoring architecture landed in refactor: establish domain-owned refactoring architecture #15. Introduces a validated BindingIndex newtype, replaces panicking .expect() calls in extract-constant path resolution with proper Result-based errors, and splits LetCompositionPlan into distinct merge/split plan types so split-let's binding index is no longer an Option<usize> on a plan that never needs it.
  • fix: trim trailing whitespace on edited linesedit replace/format rewrites could leave stray trailing whitespace on lines they touched. Normalizes trailing spaces/tabs on changed lines only, leaving untouched lines and opaque trivia (multiline atoms, block comments) alone.
  • fix: scope split-file reader safety to moved spanssplit-file previously rejected any Common Lisp reader-conditional/vector-literal form present anywhere in the source file, even when the split left those forms untouched. Narrows the safety check to only the spans actually being moved, so unrelated reader-time forms elsewhere in the file no longer block a safe split.

Other local branches/worktrees were checked and found to be stale (content-identical to already-merged PRs #14/#16): feat/common-lisp-vector-reader-2026, feat/top-level-insert-2026, feat/splice-reader-prefix-guard, feat/split-file-reader-conditionals. No action needed there.

Test plan

  • cargo build
  • cargo test (1275 + 1065 + 4 doctests, all passing)
  • cargo clippy --all-targets (clean)
  • cargo fmt --check (clean)

Continue the domain-owned refactoring architecture (PR #15) by
introducing a validated BindingIndex newtype, replacing panicking
.expect() calls in extract-constant path resolution with proper
Result-based errors, and splitting LetCompositionPlan into distinct
merge/split plan types so split-let's binding index is no longer an
Option<usize> on a plan that never needs it.
edit replace/format rewrites could leave stray trailing whitespace on
lines they touched. Normalize trailing spaces/tabs on changed lines
only, leaving untouched lines and opaque trivia (multiline atoms,
block comments) alone.
split-file rejected any Common Lisp reader-conditional/vector-literal
form present anywhere in the source file, even when the split left
those forms untouched. Narrow the safety check to only the spans
actually being moved out of the file, so unrelated reader-time forms
elsewhere in the file no longer block a safe split.
@takeokunn
takeokunn merged commit 03839a0 into main Jul 13, 2026
1 check passed
@takeokunn
takeokunn deleted the feat/consolidate-domain-and-fixes branch July 13, 2026 05:48
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