Skip to content

codeSplitter merge 1: settle list and paragraph one-liners deterministically #933

Closed

Description

@QuinnsCode

Design: apps/codesplitter/docs/merge-solutions.md, §3. Measured on the 29 git hunks between main and #893 and #886: today's merge by line id settles 16, and this settles 25.

  • L2a diffToOps pairs a changed old line with its most similar new line, not the first one by position. Fixes the worker.ts import, where main's new beamRoutes line took the old import's id.
  • L2b In prose and comments, the mergeWords rename guard ignores stopwords and words under 3 letters. Fixes the codeSplitter: tags, made here and traded with upstream (#879) #893 README bullet, which tripped on "a" and "it". Code keeps the full guard.
  • L2c A line counts as "doubled" only when it would land twice in the same block, so boilerplate inside two new test bodies doesn't count. Fixes deps.test.ts.
  • L3 Inside a stretch both sides reshaped: pair lines by similarity, then merge list items inside each pair ({…}, […], (…), import {…}, ,/; separators, CSS rules, sentences). Add by key, dedupe identical adds, and keep the rename guard per item. Lines only one side has pass through whole, never word-merged.
  • Ordering: at a shared spot, main's insert goes first, then the branch's. If the base list was sorted, insert sorted instead.

Fixtures: the hunks in the doc's table, especially the ones where a naive token union breaks (held: f.held.value,, digs rank }, ?? {peers } }) and the multi-line registry fetch in deps.ts:270.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions