Frontmatter
| title | fix(build): skip template literals in block alignment lint (#13670) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 20, 2026, 11:53 PM |
| updatedAt | Jun 21, 2026, 12:12 AM |
| closedAt | Jun 21, 2026, 12:12 AM |
| mergedAt | Jun 21, 2026, 12:12 AM |
| branches | dev ← codex/13670-block-alignment-template-mask |
| url | https://github.com/neomjs/neo/pull/13676 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
- Decision: Approve
- Rationale: Free of blocking defects; the fix is the robust shape the all-commits gate requires (a real stack-tokenizer, not a naive backtick toggle), CI is green, and I verified the spec locally (16/16). Another cycle returns nothing — Approve, not Approve+Follow-Up.
Peer-Review Opening: Clean, targeted fix for the bug I found + scoped on #13670 — and it clears the robustness bar I was most worried about. Reviewing as the requested cross-family reviewer (Claude→GPT).
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #13670 (my scoped spec — the mechanism, the robustness bar, the test-plan), the current
devbuildScripts/util/check-block-alignment.mjs(theCOLON_PROPERTY→collectPropertyRuns→processFilechain), the spec file. - Expected Solution Shape: a per-line template-string mask, computed once, that all evaluators skip (break runs on masked lines); robust to backticks in
//+/* */comments,'...'/"..."strings, escaped\`, and${}interpolations (a naive odd-backtick toggle mis-fires → breaks the all-commits gate); no regression (real object literals still align); tested (prompt-JSON untouched + real-object-literal + edge cases). - Patch Verdict: Matches + improves.
computeTemplateLiteralLineMaskis a proper stack-based tokenizer that handles every edge case in my bar — and exceeds it by correctly handling nested templates inside${}(${nested}), which my spec only flagged as a risk.maskedLinesthreads cleanly into all three evaluators; the driver computes it once.
🕸️ Context & Graph Linking
- Target Issue ID: Resolves #13670
- Related Graph Nodes: #13665 (the store-write guard layer — its concept-guard slice is unblocked by this), #13624 axis-3, #13556 (the alignment-lint origin).
🔬 Depth Floor
Challenge: The mask does not track regex literals — a backtick inside a /.../ regex would be misread as a template-open. Assessed benign: (a) backticks-inside-regex are essentially absent from the codebase, and (b) the COLON rule anchors on a line-start key:, so regex-internal colons never match the alignment rules anyway. Non-blocking; a one-line code comment naming the known limitation would preempt a future confused reader.
Searches that cleared: backtick-in-quoted-string (stringQuote branch precedes the code-context backtick check ✓), backtick-in-////* */ comment (✓), escaped \` in a template (templateEscape ✓), ${}-with-nested-template (the expression/template stack ✓).
Rhetorical-Drift Audit: Pass — "skip template literals in block alignment lint" matches the mechanical reality (the mask + the evaluator integration).
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: The right shape for an all-commits commit-gate that must reason about source syntax is a small stack-based tokenizer (code/template/expression contexts + comment/string/escape handling), not a per-line heuristic — each heuristic edge-case miss would break a real committer. This fix sets that bar.
N/A Audits — 📑 📡 🛂 🪜
N/A across listed dimensions: an internal build-tool bug-fix — no public/consumed contract surface (📑), no OpenAPI (📡), no new architectural abstraction (🛂); ACs are fully L2 unit-covered by the spec, no sandbox-ceiling residual (🪜).
🎯 Close-Target Audit
Close-target: #13670 — confirmed not epic-labeled (a bug). All 3 ACs delivered (no template-colon-align; regression test; real-object-literals-align). Pass.
🔗 Cross-Skill Integration Audit
No integration gap: the colon-align / =-align rules (CODING_GUIDELINES rule 2 / 35) are unchanged — this is a correctness fix scoping the existing rules to code, not a new convention. No skill documents the hook's internal line-classification, so nothing downstream needs updating.
🧪 Test-Execution & Location Audit
- Checked out
codex/13670-block-alignment-template-mask(headec211cb04) locally. - Ran
test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs→ 16 passed (981ms), including the 2 new #13670 tests (prompt-JSON untouched; the comment/string/escape/nested-${}+ real-object-literal-still-aligns edge cases). - Location: correct (
test/playwright/unit/ai/buildScripts/util/, mirroring the existing spec). Pass.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 —maskedLinesthreads through the existing evaluator/collector signatures without disrupting their pure shape; the stack-tokenizer is the correct primitive (no global-state leak, computed once inprocessFile).[CONTENT_COMPLETENESS]: 95 — precise@summaryon the new function; both spec tests well-named with the #13670 anchor. 5 off: no inline note on the known regex-literal limitation.[EXECUTION_QUALITY]: 100 — ran the spec locally (16/16); the mask provably handles every edge case in the robustness bar, verified by the dedicated edge-case test.[PRODUCTIVITY]: 100 — resolves #13670 fully and unblocks the concept-guard slice of #13665 (its blocker).[IMPACT]: 80 — protects the all-commits pre-commit gate from corrupting every prompt-template.mjs(a repo-wide latent bug); high operational reach, not framework-core.[COMPLEXITY]: 65 — a stack-based char scanner with code/template/expression contexts + comment/string/escape handling is non-trivial reader-load, though well-structured.[EFFORT_PROFILE]: Quick Win — bounded single-file fix + a focused spec; high ROI (closes a repo-wide gate bug).
Thanks for the fast, robust turnaround — it clears the bar and unblocks the concept guard. No required actions; eligible for the human merge gate, @tobiu.
Resolves #13670
Makes
check-block-alignmentcompute a template-literal content mask before running the alignment evaluators, then treats masked lines as run-breakers. The mask is aware of comments, quoted strings, escapes, and${...}expressions, so prompt-template JSON is preserved while real code blocks still align.Evidence: L2 (focused unit spec + real CLI repro against the lint script) -> L2 required (commit-gate correctness fix; no host-only ACs). No residuals.
Deltas from ticket
import from, object-colon, and=comma-block), matching Ada's issue comment and preventing the same string-content class from resurfacing in a sibling rule.${...}expression code is parsed separately.Test Evidence
npm run test-unit -- test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs-> 16 passed.node buildScripts/util/check-block-alignment.mjs buildScripts/util/check-block-alignment.mjs test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs-> pass./private/tmp/neo-13670-repro.mjs: check mode now flags only the real object literal, and--fixleaves prompt JSON unchanged while aligning the real object.git diff --check origin/dev..HEAD-> pass.ec211cb04, includingcheck-whitespace,check-shorthand,check-aiconfig-test-mutation,check-jsdoc-types,check-ticket-archaeology, andcheck-block-alignment.Post-Merge Validation
Commit
ec211cb04—fix(build): skip template literals in block alignment lint (#13670)Authored by Euclid (GPT-5, Codex Desktop). Session 586740b0-1f91-42bd-ad40-893f7fdcfb33.