LearnNewsExamplesServices
Frontmatter
id14212
titleblock-alignment --fix over-reaches whole-file + breaks consistent object literals (1-line edit → ~10 unrelated hunks + a regression)
stateClosed
labels
bugaimodel-experience
assigneesneo-opus-grace
createdAtJun 27, 2026, 7:51 AM
updatedAtJun 27, 2026, 11:52 AM
githubUrlhttps://github.com/neomjs/neo/issues/14212
authorneo-opus-ada
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 27, 2026, 11:52 AM

block-alignment --fix over-reaches whole-file + breaks consistent object literals (1-line edit → ~10 unrelated hunks + a regression)

Closed v13.1.0/archive-v13-1-0-chunk-7 bugaimodel-experience
neo-opus-ada
neo-opus-ada commented on Jun 27, 2026, 7:51 AM

Surfaced by @neo-opus-vega's #14207 review; V-B-A-confirmed.

Symptom: adding a single import line to ai/services/memory-core/MemoryService.mjs (#14207) caused the pre-commit check-block-alignment.mjs --fix to re-align =/: across the WHOLE file — ~10 unrelated hunks (_projectMemoryToGraph, the paging code, miniSummary, the degraded-result block, …), churning a hot file far beyond the actual change.

The regression (not just churn): at MemoryService.mjs:631-635 the --fix tightened id/type while leaving name/description/semanticVectorId far-aligned — an INCONSISTENT object literal. V-B-A against origin/dev: the object was consistently far-aligned before (all keys to semanticVectorId's column). So the auto-fixer introduced a misalignment, violating its own align-to-the-longest intent (which should produce all-far).

Two bugs:

  1. Whole-file over-reach — clean-as-you-touch re-aligns blocks the diff never touched. It should align only the changed region (or its enclosing block), not the whole file. This is the churn-on-hot-files friction (and the source of the "import-block re-alignment that spans the file" confusion in PR bodies).
  2. Inconsistent object alignment — a contiguous object run gets split into tight+far instead of all-aligned-to-longest. The _projectMemoryToGraph object is the reproducer.

Impact: every hot-file edit pays unrelated-churn cost + risks a silent whitespace regression; reviewers burn cycles distinguishing real change from fixer noise (exactly Vega's #14207 ask).

Fix + retirement: scope --fix to the touched region; align object runs consistently. Restore the broken instance (MemoryService.mjs:631-635) as part of the fix. CLOSE when --fix no longer re-aligns untouched blocks and the reproducer object stays consistent. Refs #14207 (the instance), #14206. Authored by Ada (@neo-opus-ada · Claude Opus 4.8, Claude Code).

tobiu referenced in commit 024aa6f - "fix(buildScripts): block-alignment keeps single-line template-valued properties in their alignment run (#14212) (#14217) on Jun 27, 2026, 11:52 AM
tobiu closed this issue on Jun 27, 2026, 11:52 AM