Skip to content

refactor(scope): clarify generated method bodies - #1525

Merged
joaodinissf merged 2 commits into
masterfrom
codex/readable-scope-generators
Sep 8, 2026
Merged

joaodinissf merged 2 commits into
masterfrom
codex/readable-scope-generators

Conversation

@joaodinissf

@joaodinissf joaodinissf commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

The migrated scope generators bury package switches, rule dispatch and lambda bodies in long sequences of small append calls. This refactor gives the emission phases named helpers, shares the reference/type switch scaffolding, and combines static source fragments into readable text blocks. Dynamic multiline fragments retain StringConcatenation indentation and separator handling.

Stacked on #1519, following #1517 and #1518. Merge the parent stack first. The generator refactoring changes ScopeProviderGenerator.java and ScopeNameProviderGenerator.java; their public method signatures and generated behavior are preserved. The parent POM also selects Tycho's archive-content comparator for the baseline gate, as described below. The remaining Xtend sources and compiler configuration stay in place. #1522 edits the scope inferrer, whose calls to these methods remain compatible.

Validation on Java 21:

  • Clean unchanged-stack baseline build passed.
  • The first full reactor test/quality run passed: 354 tests, zero failures/errors, two skipped. Two later full test runs each had one testBulkApplyingQuickfix UI timeout waiting for the table labelled Select a fix: (354 tests, zero failures, one error, two skipped). The final tree is therefore not claimed to have a fully green local test run.
  • Final full-reactor build and all Checkstyle, PMD, CPD and SpotBugs gates passed with tests skipped to isolate the UI timeout. Both edited files now participate in CPD without file-wide suppression.
  • JDT formatting, whitespace and repository line-ending checks passed.
  • Throwaway differential tests against the saved refactor: migrate Xtend to Java - com.avaloq.tools.ddk.xtext.scope #1519 generators: 4,636 direct comparisons (including 1,706 matching exceptions), 35,160 nested-composition comparisons and 11 independent assertions passed. Two representative generated Java classes containing ten emitted methods also compiled.
  • Independent adversarial fidelity and readability reviews found no behavioral regression. Review fixes remove stale file-wide CPD suppressions and make reference/type differences explicit in the shared emitters. The coordinator checked these final corrections and reran the differential harness; the additional agent rereview did not complete.

The differential harness is intentionally outside the repository, as requested. It compiles saved originals alongside the refactored classes and uses the actual StringConcatenation and EMF libraries.

The differential harness covers generated text, indentation, ordering, collaborator traces and explicit exception messages using controlled fixtures. Leaf collaborators are stubbed; JVM-generated helpful NPE diagnostic wording is excluded. These tests support preservation for the exercised cases, rather than proving all possible inputs.

Baseline verification fix: compare-version-with-baselines now uses Tycho's zip comparator instead of its default whole-file byte comparison. A fresh local build with baseline replacement disabled reproduced the failure on an unchanged bundle: all archive entry contents matched the release, but ZIP timestamps differed. With the content comparator, the full reactor clean verify -DskipTests -Dtycho.baseline.replace=none passed, including xtext.valid and test.core, which failed in CI. A throwaway check against Tycho 5.0.4 confirmed timestamp-only changes are accepted and changed payload bytes are rejected. Version checks remain enabled; no bundle versions were bumped. The full test suite is left to the new CI run.

@joaodinissf
joaodinissf force-pushed the codex/readable-scope-generators branch from 862abe0 to 19ba3aa Compare September 7, 2026 21:28
rubenporras
rubenporras previously approved these changes Sep 8, 2026
rubenporras
rubenporras previously approved these changes Sep 8, 2026
rubenporras
rubenporras previously approved these changes Sep 8, 2026
@joaodinissf
joaodinissf disabled the stack merge September 8, 2026 08:33
Base automatically changed from migrate/xtend-to-java/scope-step-3 to master September 8, 2026 08:34
joaodinissf and others added 2 commits September 8, 2026 10:34
Use Tycho zip comparison so ZIP metadata differences do not reject unchanged bundle contents.

Co-authored-by: Astra <noreply@openai.com>
@joaodinissf
joaodinissf merged commit 70f006b into master Sep 8, 2026
4 checks passed
@joaodinissf
joaodinissf deleted the codex/readable-scope-generators branch September 8, 2026 09:07
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.

2 participants