Repository navigation
feat: move Java and Python codegen onto the code writer and remove legacy generators - #676
Merged
Merged
Conversation
…R-0063) The extractor, output-parser, trace-helper, render-helper, names, requirement-tests and API-docs emitters, plus the extract delegate/schema emitters, now write through PyWriter instead of typing line breaks and indentation, and no longer call the ruff format pass. Output changes in layout only (checked against a capture of every emitted file in tests/codegen: normalized AST, comments and docstrings unchanged), with one fix: an unresolved @objectref mapper argument used to put its comma inside the trailing comment, which was a syntax error; it is now `x=None, # unresolved @objectRef`. Seam change: ExtractorGenerator._emit_mapper now takes the writer (`_emit_mapper(self, w, vo, root)`) and writes, instead of returning lines. The layout ratchet allowlist shrinks to router_generator.py. The writer gains TWO_SPACE_INDENT so a two-space block (the witness-key collision message) is spelled in one place.
…drop the ruff format pass (ADR-0063) The router generator (routes) now writes through PyWriter instead of typing its own line breaks and indentation, so every Python generator is on the writer and the layout ratchet's `unconverted` list is empty. The ruff format pass (metaobjects.codegen.format, ruff_format) had no callers left and is removed; ruff stays in the dev group only for the `ruff check` lint the compile gate runs. Output changes in layout only: a capture of every file tests/codegen emits has the same normalized AST, comments and docstrings, with imports compared as a set (the writer groups __future__, absolute, then relative imports, each in code-point order, where ruff's isort split stdlib from third-party). Lines break at 88 columns on the last bracketed list. Seam change: RouterGenerator._emit_repository_protocol now takes the writer (`_emit_repository_protocol(self, w, repo_class, m2m, pk_type)`) and writes the Protocol, left open for an override to add members, instead of returning lines. Tests that assert what a signature or call says read the source through tests/codegen/layout_helpers.one_line, which folds the writer's breaks, so they do not also pin where it broke.
…changelog for the writer move The router now breaks a line past 88 columns at its last bracketed list, so the portable-wire assertion reads the folded source, like the other router tests. Adds the changelog fragment for the Python writer move and the removed ruff format pass, with the upgrade notes for the two seam changes.
…ve codegen-mustache (ADR-0063) BaseObjectCodeWriter, JavaCodeWriter, PojoAwareCodeWriter and ValueObjectCodeWriter now write lines and blocks on JavaWriter instead of printing through FileIndentor. Output changes in layout only: no trailing whitespace, no blank line right after a class opens or before it closes, and the one-sentence bridge-setter Javadoc fits on one line. Checked against a capture of the interface, pojoAware and valueObject flavors over the fitness corpus and the template test model (109 files): identical with whitespace ignored apart from that Javadoc. The eject file set is unchanged; WriterException joins the Java engine surface beside CodeWriter and JavaWriter. The layout ratchet gains an indented-print rule (println(true, ...)), the call that typed indentation without a literal and kept this family out of sight. The deprecated mustache generator (MustacheTemplateGenerator) and the metaobjects-codegen-mustache module are removed; template replaces them. A pom that still names the class fails with a message naming template (GeneratorRegistry.RETIRED_GENERATORS, checked in buildGenerators), covered by RetiredGeneratorTest. maven-plugin declares the Jackson test dependency it used to get through the removed module.
…rators The forwarding attribute constants and register*Attributes methods on the AI and JSON-schema doc generators (CodeGenMetaDataProvider owns them), the no-op MetaDataFileSchemaWriter.addConstraintFile, and the pre-HtmlDirectWriter writeHtml hook with its compatibility test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
PyWriter. Codegen no longer runsruff format, so output no longer depends on whetherruffis installed. Subclass hooks take the writer first. The deprecatedmetaobjects.apidocs.*andcodegen.*module aliases are removed; imports must use theruntime/paths.entitywriters (BaseObjectCodeWriter,JavaCodeWriter,PojoAwareCodeWriter,ValueObjectCodeWriter) write throughJavaWriter. Thecodegen-mustachemodule and themustachegenerator are removed; usecom.metaobjects.generator.template.TemplateScopeGenerator. The deprecated shims in the documentation generators and thecodegen-springforwarding helpers are removed.Validation
Risk Assessment
Testing
Drove the Java scenario that was previously untested. Installed the maven-plugin reactor into a scratch repo and ran two disposable Maven projects offline. The valid project generated a ProductDto record with BUILD SUCCESS. The project naming the retired MustacheTemplateGenerator failed with ClassNotFoundException, which matches the removal decision. Both scenarios are live with evidence. The scratch directory was removed. Python and the other scenarios from earlier rounds were not re-driven in this turn, and the configured command's passing run covers broad regression.
Evidence: Java valid-project generate log (BUILD SUCCESS)
Evidence: Retired-generator generate log (ClassNotFoundException)
Evidence: Generated ProductDto.java from metadata
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringDtoGenerator.java:1114- The intent requires removing "the deprecated shims" from the Java codegen ("Java: the legacy println generator family ..., the codegen-mustache module (1,912 lines, T10c) and the deprecated shims"). Commit d5da320 removes only the shims in the documentation generators (MetaDataAIDocumentationGenerator, MetaDataFileJsonSchemaGenerator, MetaDataFileSchemaWriter.addConstraintFile, SingleHtmlDirectGeneratorBase.writeHtml(MetaDataHtmlDocumentationWriter)). Twenty-three@Deprecated ... kept so 1.0.x callers still compileforwarding shims remain in the codegen-spring generators: SpringDtoGenerator.java:1114-1180 (15 static forwarders such as settableFields and scalarFields), SpringRepositoryGenerator.java:475-493 (appliesTo, m2mFinderName, m2mFinderNameForSubtype, targetSubtypeParam) and AutoSetSupport.java:106-148 (stampFields, onUpdateFields and two others). Decide whether "the deprecated shims" covers these. If it does, remove them and add an upgrade note to the changelog. If the readiness report meant only the doc-generator shims, no change is needed.changelog.d/python-codegen-writer-no-ruff.md:17- The intent lists for Python "the router generator (W-PY-3) and about eight other emitters not yet on the writer, plus the ruff formatter callers and aliases". The ruff callers andmetaobjects.codegen.formatare removed. The deprecated alias modules built onmetaobjects/codegen/_moved.pyare kept on purpose: codegen/extract_schema_emitter.py, extract_delegate_emitter.py, fr010_field_mapping.py, output_format_spec_emitter.py, generators/m2m_codegen.py, generators/fr019_shared_enum.py and others. The changelog says: "The 1.1.0 alias modules (metaobjects.codegen.apidocs.*and the other moved modules) stay until 2.0, as announced." The intent's word "aliases" may mean these modules, or it may mean aliases of the ruff formatter, which no longer exist. Removing the modules in 1.3.0 would break the announced 2.0 deprecation window for ejected copies that still import the old paths, so you need to decide which reading is meant.server/java/codegen-spring/src/main/java/com/metaobjects/generator/GeneratorRegistry.java:855- Simplification pass: the change adds a new component the intent does not ask for. It is aRETIRED_GENERATORSmap plusretiredMessage()(GeneratorRegistry.java:848-866), a pre-instantiation check in AbstractMetaDataMojo.java:918-923, and a new test (maven-plugin/src/test/.../RetiredGeneratorTest.java). Together they turn a pom that still namesMustacheTemplateGeneratorinto a guided failure. The intent asks only for removal ("I want ALL of the old codegen replaced and removed"), and a removed class already fails the build with ClassNotFoundException. This is a reasonable migration aid but goes beyond the intent. Keep it only if you want it; otherwise remove the map, the mojo check and the test, and keep the changelog upgrade note.server/java/codegen-base/src/main/java/com/metaobjects/generator/direct/object/javacode/README-flavored-objects.md:75- This file is outside the changed-file list, so it was not edited inline, but this change makes it wrong. The README still says an ejectedentity/extractorcopy relies on "MultiFileDirectGeneratorBaseandFileDirectWriter, which the copies extend". BaseObjectCodeWriter now extendsGeneratorIOWriterand writes throughCodeWriter/JavaWriter/WriterOptions/WriterException, which are the engine classes added to the registry.json eject engine list. ReplaceFileDirectWriterwithGeneratorIOWriterand the code writer classes in that list.server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").docs/ports/java.md:894- The rewritten sentence says every generator in the table above can be ejected excepttemplate. This is false becausedocs-siteis also exempt. Its row in the same table says "Not ejectable: the builder is engine, the theme is what you own".GeneratorRegistry.javaregisters it with no eject path, under the comment "Exempt from eject (registry.json)". The old sentence already left outdocs-site, so the inline edit did not introduce the error. The edit removed themustacheclause correctly, but the line it rewrote is still wrong. Change it to say every generator can be ejected excepttemplateanddocs-site, and that fordocs-siteyou own only the theme undercodegen/docs-site/. Keep the existing link about thetemplateprimitive next totemplate.🔧 Fix applied.
12 issues (6 warnings, 6 infos) still open:
changelog.d/python-codegen-writer-no-ruff.md:17- The intent lists for Python "the router generator (W-PY-3) and about eight other emitters not yet on the writer, plus the ruff formatter callers and aliases". The ruff callers andmetaobjects.codegen.formatare removed. The deprecated alias modules built onmetaobjects/codegen/_moved.pyare kept on purpose: codegen/extract_schema_emitter.py, extract_delegate_emitter.py, fr010_field_mapping.py, output_format_spec_emitter.py, generators/m2m_codegen.py, generators/fr019_shared_enum.py and others. The changelog says: "The 1.1.0 alias modules (metaobjects.codegen.apidocs.*and the other moved modules) stay until 2.0, as announced." The intent's word "aliases" may mean these modules, or it may mean aliases of the ruff formatter, which no longer exist. Removing the modules in 1.3.0 would break the announced 2.0 deprecation window for ejected copies that still import the old paths, so you need to decide which reading is meant.server/java/codegen-spring/src/main/java/com/metaobjects/generator/GeneratorRegistry.java:855- Simplification pass: the change adds a new component the intent does not ask for. It is aRETIRED_GENERATORSmap plusretiredMessage()(GeneratorRegistry.java:848-866), a pre-instantiation check in AbstractMetaDataMojo.java:918-923, and a new test (maven-plugin/src/test/.../RetiredGeneratorTest.java). Together they turn a pom that still namesMustacheTemplateGeneratorinto a guided failure. The intent asks only for removal ("I want ALL of the old codegen replaced and removed"), and a removed class already fails the build with ClassNotFoundException. This is a reasonable migration aid but goes beyond the intent. Keep it only if you want it; otherwise remove the map, the mojo check and the test, and keep the changelog upgrade note.server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").changelog.d/python-codegen-writer-no-ruff.md:13- Deletingmetaobjects.codegen.formatbreaks unedited ejected copies in a 1.3.0 minor release. At the base commit the referencerouter,extractor,output-parser,trace-helper,namesandrender-helpergenerators each didfrom metaobjects.codegen.format import ruff_formatat module top, and eject copies them verbatim. The module was also on the declared Python eject engine surface (the entry removed fromfixtures/generator-registry-conformance/registry.json). So an adopter who ejected any of the six and upgrades getsModuleNotFoundErrorwhengenorverify --codegenimports the copy.spec/decisions/ADR-0063-generators-own-layout.md:47-50also says Pythonruff_formatstays exported for adopter-owned generators, because an owned copy calls it itself, and that retiring it is a separate decision. The ADR is not updated. The changelog only mentions an owned generator that 'called it'. The intent's 'ruff formatter callers and aliases' may authorize the removal, so the maintainer should decide. Either keepruff_formatas an exported helper that no reference generator calls, which matches the ADR. Or confirm the removal, amend ADR-0063, and say in the changelog that every earlier ejected copy of those six generators stops importing.changelog.d/python-codegen-writer-no-ruff.md:14- The upgrade note says two subclass hooks changed, but many more did.RouterGeneratoralso changed_emit_reverse_finders(now takeswand returns None),_emit_route_handler,_emit_m2m_route,_emit_tph_m2m_route,_emit_tph_list_body,_emit_readonly_reject_handlersand_report_list_with_export(router_generator.py:1237-2072). Four of the first five are listed as override points in the class docstring. In_emit_route_handler, thecreate_autoset,update_autoset,frozen_stripanddenied_striparguments are nowBodyStepcallables instead of line lists.RenderHelperGenerator._emit_documentand_emit_emailnow takeheaderaslist[str]; the migration doc names both as subclasser hooks. In the runtime emitters that eject hands over,nested_mirror_dataclasses,nested_mappersanddelegate_helpersbecamewrite_*(w, ...), andmirror_dataclassandmirror_initializerwere removed. That also affects re-ejecting: eject never overwrites an existingcodegen/runtime/copy, even with--force. A freshoutput-parserorextractorcopy placed beside an oldextract_delegate_emitter.pytherefore callsrde.write_nested_mirror_dataclasses, which that copy lacks. List all of these, and tell adopters to refreshcodegen/runtime/extract_delegate_emitter.pyandextract_schema_emitter.py.server/python/src/metaobjects/codegen/generators/requirement_tests_generator.py:305- Source returned by a project'srequirement_testsrenderer hook (RenderedTest.source) used to be written verbatim. It now goes throughw.text(), which removes the common margin and a leading blank line, strips trailing whitespace from every line, and collapses consecutive blank lines into one. This also applies inside string literals. For example, a hook that returns a test comparing output to a triple-quoted string with two blank lines, or with a line ending in spaces, now gets a different expected string, andgenreports no error. It also collapses the two-blank-line gap between a helper and a test in one hook source. The 'same syntax tree' check in the changelog covers only the built-in renderer. Write hook-supplied source verbatim, for example through a verbatim method in the writer package so the layout ratchet still holds, and keeptext()for generator-authored snippets only.server/java/codegen-base/src/main/java/com/metaobjects/generator/direct/object/javacode/JavaCodeWriter.java:159- EveryimportListentry, including those from the publicGenerationContext.addImport(merged inBaseObjectCodeWriter.writeObject), now goes throughJavaWriter.use.useclaims the text after the last dot as a unique simple name. For wildcard imports that name is*. A customcreateWriterthat adds bothjava.util.*andjava.io.*now fails withIMPORT_CONFLICT('* is imported from both ...'). The old writer printed both lines, and the result was valid Java. Do not claim a local name for entries ending in.*, either inJavaWriter.useor at this call site. Still emit those imports.server/python/src/metaobjects/codegen/generators/router_generator.py:600- Fixed two docstring references to functions this change renamed:_validated_input_linesis now_write_validated_check, and, at line 787,_target_subtype_paramis now_target_subtype_params.server/python/src/metaobjects/codegen/generators/trace_helper_generator.py:195- Updated a comment that still namedschema_literal. The code now callsschema_piece.server/python/src/metaobjects/codegen/generators/render_helper_generator.py:149- Removed the private_field_tree_literalwrapper, which this change left with no references anywhere in the repository, along with theflatimport that only it used.🔧 Fix applied.
13 issues (6 warnings, 7 infos) still open:
changelog.d/python-codegen-writer-no-ruff.md:17- The intent lists for Python "the router generator (W-PY-3) and about eight other emitters not yet on the writer, plus the ruff formatter callers and aliases". The ruff callers andmetaobjects.codegen.formatare removed. The deprecated alias modules built onmetaobjects/codegen/_moved.pyare kept on purpose: codegen/extract_schema_emitter.py, extract_delegate_emitter.py, fr010_field_mapping.py, output_format_spec_emitter.py, generators/m2m_codegen.py, generators/fr019_shared_enum.py and others. The changelog says: "The 1.1.0 alias modules (metaobjects.codegen.apidocs.*and the other moved modules) stay until 2.0, as announced." The intent's word "aliases" may mean these modules, or it may mean aliases of the ruff formatter, which no longer exist. Removing the modules in 1.3.0 would break the announced 2.0 deprecation window for ejected copies that still import the old paths, so you need to decide which reading is meant.server/java/codegen-spring/src/main/java/com/metaobjects/generator/GeneratorRegistry.java:855- Simplification pass: the change adds a new component the intent does not ask for. It is aRETIRED_GENERATORSmap plusretiredMessage()(GeneratorRegistry.java:848-866), a pre-instantiation check in AbstractMetaDataMojo.java:918-923, and a new test (maven-plugin/src/test/.../RetiredGeneratorTest.java). Together they turn a pom that still namesMustacheTemplateGeneratorinto a guided failure. The intent asks only for removal ("I want ALL of the old codegen replaced and removed"), and a removed class already fails the build with ClassNotFoundException. This is a reasonable migration aid but goes beyond the intent. Keep it only if you want it; otherwise remove the map, the mojo check and the test, and keep the changelog upgrade note.server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").changelog.d/python-codegen-writer-no-ruff.md:13- Deletingmetaobjects.codegen.formatbreaks unedited ejected copies in a 1.3.0 minor release. At the base commit the referencerouter,extractor,output-parser,trace-helper,namesandrender-helpergenerators each didfrom metaobjects.codegen.format import ruff_formatat module top, and eject copies them verbatim. The module was also on the declared Python eject engine surface (the entry removed fromfixtures/generator-registry-conformance/registry.json). So an adopter who ejected any of the six and upgrades getsModuleNotFoundErrorwhengenorverify --codegenimports the copy.spec/decisions/ADR-0063-generators-own-layout.md:47-50also says Pythonruff_formatstays exported for adopter-owned generators, because an owned copy calls it itself, and that retiring it is a separate decision. The ADR is not updated. The changelog only mentions an owned generator that 'called it'. The intent's 'ruff formatter callers and aliases' may authorize the removal, so the maintainer should decide. Either keepruff_formatas an exported helper that no reference generator calls, which matches the ADR. Or confirm the removal, amend ADR-0063, and say in the changelog that every earlier ejected copy of those six generators stops importing.changelog.d/python-codegen-writer-no-ruff.md:14- The upgrade note says two subclass hooks changed, but many more did.RouterGeneratoralso changed_emit_reverse_finders(now takeswand returns None),_emit_route_handler,_emit_m2m_route,_emit_tph_m2m_route,_emit_tph_list_body,_emit_readonly_reject_handlersand_report_list_with_export(router_generator.py:1237-2072). Four of the first five are listed as override points in the class docstring. In_emit_route_handler, thecreate_autoset,update_autoset,frozen_stripanddenied_striparguments are nowBodyStepcallables instead of line lists.RenderHelperGenerator._emit_documentand_emit_emailnow takeheaderaslist[str]; the migration doc names both as subclasser hooks. In the runtime emitters that eject hands over,nested_mirror_dataclasses,nested_mappersanddelegate_helpersbecamewrite_*(w, ...), andmirror_dataclassandmirror_initializerwere removed. That also affects re-ejecting: eject never overwrites an existingcodegen/runtime/copy, even with--force. A freshoutput-parserorextractorcopy placed beside an oldextract_delegate_emitter.pytherefore callsrde.write_nested_mirror_dataclasses, which that copy lacks. List all of these, and tell adopters to refreshcodegen/runtime/extract_delegate_emitter.pyandextract_schema_emitter.py.server/python/src/metaobjects/codegen/generators/requirement_tests_generator.py:305- Source returned by a project'srequirement_testsrenderer hook (RenderedTest.source) used to be written verbatim. It now goes throughw.text(), which removes the common margin and a leading blank line, strips trailing whitespace from every line, and collapses consecutive blank lines into one. This also applies inside string literals. For example, a hook that returns a test comparing output to a triple-quoted string with two blank lines, or with a line ending in spaces, now gets a different expected string, andgenreports no error. It also collapses the two-blank-line gap between a helper and a test in one hook source. The 'same syntax tree' check in the changelog covers only the built-in renderer. Write hook-supplied source verbatim, for example through a verbatim method in the writer package so the layout ratchet still holds, and keeptext()for generator-authored snippets only.server/python/src/metaobjects/codegen/generators/router_generator.py:600- Fixed two docstring references to functions this change renamed:_validated_input_linesis now_write_validated_check, and, at line 787,_target_subtype_paramis now_target_subtype_params.server/python/src/metaobjects/codegen/generators/trace_helper_generator.py:195- Updated a comment that still namedschema_literal. The code now callsschema_piece.server/python/src/metaobjects/codegen/generators/render_helper_generator.py:149- Removed the private_field_tree_literalwrapper, which this change left with no references anywhere in the repository, along with theflatimport that only it used.server/python/src/metaobjects/codegen/generators/requirement_tests_generator.py:298- A renderer hook'simportsstrings still go throughw.line(statement).lineraises ERR_WRITER_NEWLINE_IN_LINE on any line break. Take a hook that returnsRenderedTest(imports=("from acme.testing import (\n helper_a,\n helper_b,\n)",), source=...), or just"import json\n". The old"\n".join(extra)accepted both and produced valid Python; nowgenfails. This is project-authored text, likeRenderedTest.source. The round 2 fix for review-3 switched onlysourcetow.verbatim(line 305) and left this sibling behind. Write each hook import withw.verbatim(statement.rstrip()); the pending blank line before the first one is still honored.importsandsourceare the only two hook-supplied fields written into the file.changelog.d/python-codegen-writer-no-ruff.md:29- Fixed the Python upgrade note, partly written by the round 2 fix for review-2. It toldoutput-parserandextractorowners to delete bothextract_delegate_emitter.pyandextract_schema_emitter.py. Neither generator's registryruntimeincludes the schema emitter, so re-ejecting them would not write it back, and an ownedtrace-helperwould lose its import. Onlytrace-helpercopies that file, and its new reference callsschema_piece, which an old kept copy lacks; the note did not mentiontrace-helper. The note now pairs each runtime file with the generators that copy it. It also no longer offersschema_piece, a schema descriptor, as the replacement for the removedmirror_dataclassandmirror_initializer.🔧 Fix applied.
9 issues (2 warnings, 7 infos) still open:
changelog.d/python-codegen-writer-no-ruff.md:17- The intent lists for Python "the router generator (W-PY-3) and about eight other emitters not yet on the writer, plus the ruff formatter callers and aliases". The ruff callers andmetaobjects.codegen.formatare removed. The deprecated alias modules built onmetaobjects/codegen/_moved.pyare kept on purpose: codegen/extract_schema_emitter.py, extract_delegate_emitter.py, fr010_field_mapping.py, output_format_spec_emitter.py, generators/m2m_codegen.py, generators/fr019_shared_enum.py and others. The changelog says: "The 1.1.0 alias modules (metaobjects.codegen.apidocs.*and the other moved modules) stay until 2.0, as announced." The intent's word "aliases" may mean these modules, or it may mean aliases of the ruff formatter, which no longer exist. Removing the modules in 1.3.0 would break the announced 2.0 deprecation window for ejected copies that still import the old paths, so you need to decide which reading is meant.server/java/codegen-spring/src/main/java/com/metaobjects/generator/GeneratorRegistry.java:855- Simplification pass: the change adds a new component the intent does not ask for. It is aRETIRED_GENERATORSmap plusretiredMessage()(GeneratorRegistry.java:848-866), a pre-instantiation check in AbstractMetaDataMojo.java:918-923, and a new test (maven-plugin/src/test/.../RetiredGeneratorTest.java). Together they turn a pom that still namesMustacheTemplateGeneratorinto a guided failure. The intent asks only for removal ("I want ALL of the old codegen replaced and removed"), and a removed class already fails the build with ClassNotFoundException. This is a reasonable migration aid but goes beyond the intent. Keep it only if you want it; otherwise remove the map, the mojo check and the test, and keep the changelog upgrade note.server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").server/python/src/metaobjects/codegen/generators/router_generator.py:600- Fixed two docstring references to functions this change renamed:_validated_input_linesis now_write_validated_check, and, at line 787,_target_subtype_paramis now_target_subtype_params.server/python/src/metaobjects/codegen/generators/trace_helper_generator.py:195- Updated a comment that still namedschema_literal. The code now callsschema_piece.server/python/src/metaobjects/codegen/generators/render_helper_generator.py:149- Removed the private_field_tree_literalwrapper, which this change left with no references anywhere in the repository, along with theflatimport that only it used.changelog.d/python-codegen-writer-no-ruff.md:29- Fixed the Python upgrade note, partly written by the round 2 fix for review-2. It toldoutput-parserandextractorowners to delete bothextract_delegate_emitter.pyandextract_schema_emitter.py. Neither generator's registryruntimeincludes the schema emitter, so re-ejecting them would not write it back, and an ownedtrace-helperwould lose its import. Onlytrace-helpercopies that file, and its new reference callsschema_piece, which an old kept copy lacks; the note did not mentiontrace-helper. The note now pairs each runtime file with the generators that copy it. It also no longer offersschema_piece, a schema descriptor, as the replacement for the removedmirror_dataclassandmirror_initializer.🔧 Fix applied.
17 issues (4 warnings, 13 infos) still open:
changelog.d/python-codegen-writer-no-ruff.md:17- The intent lists for Python "the router generator (W-PY-3) and about eight other emitters not yet on the writer, plus the ruff formatter callers and aliases". The ruff callers andmetaobjects.codegen.formatare removed. The deprecated alias modules built onmetaobjects/codegen/_moved.pyare kept on purpose: codegen/extract_schema_emitter.py, extract_delegate_emitter.py, fr010_field_mapping.py, output_format_spec_emitter.py, generators/m2m_codegen.py, generators/fr019_shared_enum.py and others. The changelog says: "The 1.1.0 alias modules (metaobjects.codegen.apidocs.*and the other moved modules) stay until 2.0, as announced." The intent's word "aliases" may mean these modules, or it may mean aliases of the ruff formatter, which no longer exist. Removing the modules in 1.3.0 would break the announced 2.0 deprecation window for ejected copies that still import the old paths, so you need to decide which reading is meant.server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").server/python/src/metaobjects/codegen/generators/router_generator.py:600- Fixed two docstring references to functions this change renamed:_validated_input_linesis now_write_validated_check, and, at line 787,_target_subtype_paramis now_target_subtype_params.server/python/src/metaobjects/codegen/generators/trace_helper_generator.py:195- Updated a comment that still namedschema_literal. The code now callsschema_piece.server/python/src/metaobjects/codegen/generators/render_helper_generator.py:149- Removed the private_field_tree_literalwrapper, which this change left with no references anywhere in the repository, along with theflatimport that only it used.changelog.d/python-codegen-writer-no-ruff.md:29- Fixed the Python upgrade note, partly written by the round 2 fix for review-2. It toldoutput-parserandextractorowners to delete bothextract_delegate_emitter.pyandextract_schema_emitter.py. Neither generator's registryruntimeincludes the schema emitter, so re-ejecting them would not write it back, and an ownedtrace-helperwould lose its import. Onlytrace-helpercopies that file, and its new reference callsschema_piece, which an old kept copy lacks; the note did not mentiontrace-helper. The note now pairs each runtime file with the generators that copy it. It also no longer offersschema_piece, a schema descriptor, as the replacement for the removedmirror_dataclassandmirror_initializer.changelog.d/python-codegen-writer-no-ruff.md:51- Fix round 4 added upgrade guidance that does not work for a real ejected copy. It says a copy ejected before 1.1.0 'needs its imports changed, or re-eject it'. Theoutput-parsercopy from v1.0.0 and v1.0.13 importsfrom metaobjects.codegen import extract_delegate_emitter as rde. It also callsrde.nested_mirror_dataclasses,rde.nested_mappersandrde.delegate_helpers, and this change removes all three. An adopter who only repoints the import tometaobjects.codegen.runtimegets anAttributeErroratgen. The error named in the note is also wrong for that import form:from metaobjects.codegen import <removed submodule>raises plainImportError: cannot import name ..., notModuleNotFoundError. SayImportError(of whichModuleNotFoundErroris a subclass). Also say that a pre-1.1.0output-parsercopy must be re-ejected, or moved towrite_nested_mirror_dataclasses,write_nested_mappersandwrite_delegate_helpers. Sibling sites: changelog.d/python-codegen-writer-no-ruff.md:38 (theModuleNotFoundErrorclaim); docs/features/own-your-codegen.md:1139-1148 (the 'until you change each import' claim, and the recipe that copies the new runtime files under the old generator copy and only changes imports).docs/ports/java.md:480- Fixed inline. Fix round 4 removed the retired-generator message and updated the changelog, but left this page saying a pom that namesMustacheTemplateGeneratorfails with a message namingtemplate. The page now says it fails withClassNotFoundExceptionand namestemplateas the replacement.docs/RELEASING-java.md:19- Fixed inline. Aftercodegen-mustachewas removed, the reactor has 13 modules, which is 14 artifacts with the parent POM. Updated the old 14 and 15 counts.docs/RELEASING-java.md:203- Fixed inline: changed 'all 14 reactor modules' to 13.server/java/README.md:3- Fixed inline: changed 'across 14 modules' to 13.docs/llms/llms.txt:71- Fixed inline: changed the Java counts to 13 publishable modules and 14 artifacts with the parent POM.docs/RELEASING.md:995- This page still says 'The 14com.metaobjects:*modules (15 artifacts, counting the parent POM)'. Withcodegen-mustacheremoved, the counts are 13 and 14. It was not edited inline because the file is outside the changed-file list.docs/RELEASING-java.md:177- The recorded fixinline-releasing-java-module-countsays it updated the old counts, and lines 19-20 and 203 now say 13 modules. Line 177, in the smoke-build step of the same procedure, still says "All 14 publishable modules should reach SUCCESS". The page now contradicts itself, and a releaser would expect a module that no longer exists.server/java/pom.xmllists 13 modules. Change 14 to 13 on line 177.server/java/README.md:3- The edited sentence now says Maven Central has 13 modules "at8.2.0for the 1.2.0 release". This is wrong for that release. Theserver/java/pom.xmlat tagv1.2.0lists 14 modules, includingcodegen-mustache. The count of 13 applies only after the 1.3.0 removal. Keep 13, but do not tie it to 8.2.0. For example, say the current reactor has 13 modules, and that the 8.2.0 release also includedcodegen-mustache, removed in 1.3.0.🔧 Fix applied.
12 infos still open:
server/java/codegen-base/src/test/java/com/metaobjects/generator/writer/layout/LayoutAnalyzer.java:779- For visibility against "anything code generated has to go to the new line based version ... unless you review it and tell me it's good": the Java ratchet still scans codegen-plantuml. PlantUMLWriter (extends FileDirectWriter,println(true, ...)at PlantUMLWriter.java:671-695) and MetaDataHtmlDocumentationWriter stay on the old print style. A pre-existingexemptruling in layout-ratchet/allowlist.json covers them as documentation output. FileDirectWriter and SingleFileDirectGeneratorBase now remain only for PlantUML. The newindented-printrule would flag PlantUMLWriter if that exemption were lifted. Nothing to change in this run. The user should know this exemption is the remaining print-style emit.docs/ports/java.md:894- Removed the stale clause "and the deprecatedmustache" from the "Own a generator" paragraph. The generator no longer exists, and the table above it now says it was removed in 1.3.0.server/python/src/metaobjects/codegen/generators/output_parser_generator.py:289- Removed a trailing space this change left before the closing quotes of the_render_moduleextension-seam docstring ("emission entirely. &test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;" now reads "emission entirely.&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;&test(conformance): combined multi-package extends + overlay + cross-package references fixture #34;").server/python/src/metaobjects/codegen/generators/router_generator.py:600- Fixed two docstring references to functions this change renamed:_validated_input_linesis now_write_validated_check, and, at line 787,_target_subtype_paramis now_target_subtype_params.server/python/src/metaobjects/codegen/generators/trace_helper_generator.py:195- Updated a comment that still namedschema_literal. The code now callsschema_piece.server/python/src/metaobjects/codegen/generators/render_helper_generator.py:149- Removed the private_field_tree_literalwrapper, which this change left with no references anywhere in the repository, along with theflatimport that only it used.changelog.d/python-codegen-writer-no-ruff.md:29- Fixed the Python upgrade note, partly written by the round 2 fix for review-2. It toldoutput-parserandextractorowners to delete bothextract_delegate_emitter.pyandextract_schema_emitter.py. Neither generator's registryruntimeincludes the schema emitter, so re-ejecting them would not write it back, and an ownedtrace-helperwould lose its import. Onlytrace-helpercopies that file, and its new reference callsschema_piece, which an old kept copy lacks; the note did not mentiontrace-helper. The note now pairs each runtime file with the generators that copy it. It also no longer offersschema_piece, a schema descriptor, as the replacement for the removedmirror_dataclassandmirror_initializer.docs/ports/java.md:480- Fixed inline. Fix round 4 removed the retired-generator message and updated the changelog, but left this page saying a pom that namesMustacheTemplateGeneratorfails with a message namingtemplate. The page now says it fails withClassNotFoundExceptionand namestemplateas the replacement.docs/RELEASING-java.md:19- Fixed inline. Aftercodegen-mustachewas removed, the reactor has 13 modules, which is 14 artifacts with the parent POM. Updated the old 14 and 15 counts.docs/RELEASING-java.md:203- Fixed inline: changed 'all 14 reactor modules' to 13.server/java/README.md:3- Fixed inline: changed 'across 14 modules' to 13.docs/llms/llms.txt:71- Fixed inline: changed the Java counts to 13 publishable modules and 14 artifacts with the parent POM.🔧 **Test** - 2 issues found → no changes applied ✅
server/java- Java half of the intent not live-validated: removal of codegen-mustache and the legacy println generators, and the retired-generator message. No Maven build was driven in this step. Evidence rests on the configuredscripts/ci-local.sh --affected --strict-toolchainsrun that already passed. Live check would needmvnoffline against a pom namingMustacheTemplateGenerator, expecting ClassNotFoundException.metaobjects genon a fresh project emits the new-writer output for entity, names, filter-allowlist and routes generators (live local CLI, synthetic Ticket entity)metaobjects genin a scratch directory → 'wrote 8 file(s) across 1 target(s).' exit 0; generated/acme/shop/ticket_router.py, Ticket.py, ticket_names.py, ticket_filter_allowlist.pypython3 -I -m py_compilesucceeded on all 8 generated files; no 'ruff' string in generated tree;metaobjects verify→ 'in sync'metaobjects gen→ 'nothing changed since the last run, so nothing was generated'mvnrun of the reactor, or a pom naming MustacheTemplateGenerator and runningmvn metaobjects:generate. The Ja…scripts/ci-local.sh --affected --strict-toolchainsmetaobjects initandmetaobjects gen(with generators entity, names, filter-allowlist, routes) in a disposable project at a scratch directory, using server/python/.venvpython3 -I -m py_compileon all 8 generated .py filesmetaobjects verify(default --codegen --templates)secondmetaobjects genfor idempotencygrep forruffin generated outputscratch project removed after the run; worktree clean🔧 No changes applied.
✅ Re-checked - no issues remain.
scripts/ci-local.sh --affected --strict-toolchainsmvn -B -o -DskipTests -Dmaven.repo.local=<scratch>/m2 install -pl maven-plugin -am (server/java) — exit 0Scenario 2: mvn -B -o -Dmaven.repo.local=<scratch>/m2 generate-sources in disposable proj-ok (metaobjects-maven-plugin 8.3.0, SpringDtoGenerator + SpringValueObjectGenerator, outputDir/package args, one object.entity Product) — BUILD SUCCESS, target/gen/shop/ProductDto.java emittedScenario 3: mvn -B -o -Dmaven.repo.local=<scratch>/m2 generate-sources in disposable proj-retired naming com.metaobjects.generator.mustache.MustacheTemplateGenerator — BUILD FAILURE with java.lang.ClassNotFoundException✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.