Repository navigation
feat(metadata): collectionName, origin @segment, and filter grammar across ports - #565
Merged
Merged
Conversation
Load and validate, in TypeScript, C#, Java (Kotlin through it) and Python: - @segment on origin.first / origin.aggregate, naming a segment.filter of the related entity, ANDed with @filter (ERR_INVALID_ORIGIN otherwise); - a correlated @filter operand { field: "<base field>" } and the null-safe isDistinctFrom / isNotDistinctFrom ops (ERR_BAD_ATTR_FILTER for an unknown base field or another op). The refusal of a passthrough across a reverse @via hop now names the hop as the path wrote it, and Java's and Python's to-many passthrough wording matches the other ports'. error-origin-passthrough-reverse-hop (new) and error-origin-passthrough-to-many pin the message.
…ted filters in every loader A projection @filter key may now name a field of its base entity the view does not output, or a path of to-one hops from the base. A projection that extends another projection is checked against the effective (ANDed) filter of its chain. An origin @from/@Of may name a member of a flattened value object. A report dimension's required flag now treats an unenforced reference, or a hop onto a TPH subtype, as possibly missing. validator.atLeastOne refuses @max under the default load too. Eleven new shared fixtures; every port runs them.
…read flattened reference members The view extractor skipped any origin it could not lower, so a projection loaded clean and then created a view missing a column its generated type declares. Every such shape now throws, naming the projection and field: an origin @segment, a correlated (base-row) operand in an origin @filter, a computed node the lowering does not support, an unknown origin subtype or aggregate. A reference over a member of a flattened value object (`@fields: "address.countryId"`) now resolves to the member's real column everywhere it is read: the foreign key meta migrate emits, a view's join, a passthrough @from onto the member, and the Drizzle key the reverse finder and relations() block read. Two references onto one target now read the join their own @via walked instead of the first join to that entity.
…g.collections in TS and C# An object's collection name (its own @collectionName, else the project's naming.collections pluralizer over its name) now names what the generators derive from it: - the REST collection segment, snake_cased with an acronym-aware split (FAQs serves /faqs), in TypeScript and C#, shared by fixtures/naming-conformance/collection-segments.json; - the reverse finders in both ports; - the C# DbSet, which now also takes a configured pluralizer; - the TypeScript list function, list hook and Drizzle table variable. A project that declares neither keeps every name and URL byte for byte. The collision check refuses two objects whose collection names meet. @collectionName is now implementedIn csharp and typescript.
…eld they meet A literal compared with a field in an origin.computed @expr, as a simple case's when against a field operand or on either side of a comparison, must now be of that field's kind and, for a field.enum, one of its @values. This is the rule a validator @condition already followed, and every port's loader now applies it to both through one shared check (ERR_INVALID_ORIGIN for a computed expression). Two new shared fixtures, error-origin-computed-literal-not-enum-member and error-origin-computed-literal-wrong-kind, run in every port. The CHANGELOG now also records the projection filter paths, the view-extractor refusals, flattened-member references and the collection-name wiring.
…d docker calls Under `bun test --parallel` on a heavily loaded machine, the MySQL helper's blocking spawnSync calls (the readiness poll runs `docker logs` every half second) could miss the child's exit: the test worker then spun at full CPU with a defunct docker child, the beforeAll hook timed out, and the integration lane stayed open until it was killed. Every docker call made during startup is now an async execFile with a timeout, so a killed or stuck call rejects and the hook fails on its own deadline. Teardown keeps one synchronous `docker rm`, now with a timeout, as the Postgres helper does.
…-field no-read-source rule now notes the projection-reach exception. Other doc surfaces (CONFORMANCE, physical-naming, metamodel-docs, CHANGELOG, naming fixture README) already match the change.
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
@collectionNameandnaming.collectionsin the TypeScript and C# generators: REST collection segment, reverse finders, C#DbSet, and the TypeScript list function, list hook and Drizzle table variable.@collectionNameis marked implemented in csharp and typescript in the registry.@segmenton origins and a correlated@filteroperand, with loader validation in TypeScript, C#, Java and Python. Java and Python loaders are new work; all four ports load and validate the new fixtures. Adds 20 metamodel conformance fixtures (corpus 490 → 510) and thecollection-segmentsnaming fixture. Java and Python also apply the reportrequiredrule as TypeScript and C# do, andvalidator.atLeastOnewith@maxis now a loader error.origin.first/origin.computed) field with no read source is accepted when a projection reaches it; the C# entity and DbContext mapping, Kotlin generators, Python ObjectManager reads and Java OMDB table mapping leave such a field out of a table-only entity.Validation
Risk Assessment
Testing
Drove 5 TS CLI scenarios live against synthetic projects built from fixtures; all pass: collection-name REST segments, derived column dropped from table-only entity and kept for replica-view entity, atLeastOne @max refused with one ERR_UNKNOWN_ATTR, flattened @Of resolves and refuses an unknown segment. Not verified live: C#/Kotlin/Java/Python derived-field fixes (only 234 targeted Python unit tests passed), and the extractor refusals. The full regression gate did not complete: TS server suite killed at its 25 min timeout and the full Python unit run hung near 3%. Verdict inconclusive until both full suites finish. Baseline ts-fast/ts-unit was not rerun here.
meta genvia bun on worktree CLI, synthetic 3-entity metadata; generated/Box.ts$path: "/pdf_boxes", Faq.ts$path: "/faqs"meta genhasActiveAgreement: boolean("has_active_agreement")meta verifyon fixtures/conformance/error-validator-at-least-one-max-unknown; exit 1, single ERR_UNKNOWN_ATTR on validator.atLeastOne at the expected jsonPathmeta verifyon error-origin-segment-flattened-of; exit 1, ERR_INVALID_ORIGIN naming CaseHistory and @segment "dead"Evidence: Full TS server suite output (incomplete, killed)
Evidence: Python targeted unit run (234 passed)
Evidence: Python full unit run (partial, stopped)
evidence/proj2/generated)evidence/proj3/generated)Evidence: atLeastOne @max refusal output
Evidence: flattened @Of ERR_INVALID_ORIGIN output
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- The intent says: "This is pull request 1 of 4: vocabulary and loaders in all five ports. Pull requests 2 (TypeScript codegen and migrations), 3 (C# codegen) ... follow it and are out of scope here." The branch still carries TypeScript codegen and migration changes (commits 453cf93 and 3af6073). They are: extract-view-spec.ts (cannotLower refusals, aliasForVia, flattened @from columns), relation-resolver.ts, flattened.ts flatKeyOfPath, templates/queries.ts and queries-file.ts (with copies in test-generators and examples), render-context.ts collection variables, api-model.ts, entity-ui-descriptor.ts resourcePath, naming.ts and collection-name-collision.ts, codegen-ts-tanstack hooks-file.ts, and migrate-ts expected-schema.ts foreign keys. It also carries C# codegen: CSharpNaming.cs RoutePath, DbSetName and ReverseFinderName, plus CollectionSegmentTests.cs. Commit 79d5f73 is an unrelated MySQL integration-test helper change. Some of this may be a deliberate coupling. The registry now marks @collectionName implementedIn typescript, which needs the TS wiring, and the extractor refusals contain the new loader shapes. Confirm that these belong in PR 1, or move them to PR 2 and PR 3.docs/CONFORMANCE.md:29- The intent requires "the 21 new shared fixtures". The branch adds 18 metamodel fixtures and one naming fixture, 19 in all. The metamodel fixtures are: entity-derived-filter-gate, error-origin-computed-literal-not-enum-member, error-origin-computed-literal-wrong-kind, error-origin-correlated-operand-unknown, error-origin-passthrough-reverse-hop, error-origin-segment-unresolved, error-projection-extends-filter-sql-body, error-projection-filter-path-to-many, origin-correlated-filter-and-segment, origin-passthrough-flattened-member, origin-passthrough-two-references-one-target, origin-segment-scoped, projection-extends-abstract-projection, projection-extends-filtered-projection, projection-filter-joined-path, projection-filter-unprojected-base-field, reference-flattened-member and report-dimension-required-by-model. The naming fixture is naming-conformance/collection-segments.json. The corpus count moves 490 -> 508, which is +18. The source branch is not in this repository, so I cannot name the missing fixtures. Confirm whether they are already on main, deferred to a later PR, or omitted.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1548- The loaders in all four ports now give a projection the EFFECTIVE @filter: every extends level's own @filter, ANDed (effectiveProjectionFilter, and its counterparts in C#, Java and Python). The TS view lowering still reads onlyprojection.ownAttr(OBJECT_PROJECTION_ATTR_FILTER). A concrete case: ExportPlans extends LivePlans and GatedPlans, where GatedPlans has @filter {consented:true} and LivePlans has {deleted:false}. If ExportPlans declares its own extends-bound identity (for example identity.primary extends Plan.id) and has no own @filter, or one over its own fields, it loads clean. The view is then created with no WHERE for consented or deleted, so the parent row gates are dropped with no error. The CHANGELOG says such shapes are "refused, not shortened". The inherited fields are also missing from the view, because buildSelectSpec takes ownChildren. The remedy touches PR 2's lowering, so authorization is needed. Options: in this PR, call cannotLower when effectiveProjectionFilter(projection) differs from the own @filter, or when the projection extends another projection. Or lower the effective filter in PR 2.server/typescript/packages/metadata/src/loader/validation-passes.ts:1837- ERR_DERIVED_FIELD_NO_READ_SOURCE is now skipped for an origin.first or origin.computed entity field that a projection reaches. The same skip is in ValidationPasses.cs:1825, ValidationPhase.java:5693 and validation_passes.py:3816. So an entity with only a writable table and a derived field now loads in every port, as fixture entity-derived-filter-gate shows (Member.hasActiveAgreement). TS is safe: drizzle-schema.ts and migrate-ts skip isDerived fields. The C# EntityGenerator drops derived fields only when the entity is write-through (EntityGenerator.cs:380excludeDerived: entity.IsWriteThrough()), and DbContextGenerator configures them the same way. For Member, the EF entity therefore maps HasActiveAgreement to a has_active_agreement column the members table does not have. Every EF query on Member then fails at runtime. I did not check the Java, Kotlin and Python generators for this shape. The remedy belongs to C# codegen (PR 3) or generator parity (PR 4), or the loader relaxation can be held until they land. Choose which.server/typescript/packages/metadata/src/loader/validation-passes.ts:1932- originRelatedEntity splits @Of at the LAST '.'. The same split is in ValidationPasses.cs:1743 and ValidationPhase.java:4071. This change lets @Of name a flattened value-object member, for example "Plan.address.city". In TS, C# and Java that ref resolves the object "Plan.address", gets null, and skips the @segment check, so an origin.first with an unknown @segment loads clean. Python (_origin_related_entity, validation_passes.py:1585) resolves the ref through _validate_entity_field_ref and reports ERR_INVALID_ORIGIN, so the ports disagree. Fix: in TS, C# and Java, resolve @Of's entity with the same silent entity-field resolver the @from/@Of validation already uses (_validateFromPath / ValidateFromPath / validateFromOrOfPath, which understand flattened members and ..:: package refs). Do not slice the string.server/typescript/packages/metadata/src/loader/validation-passes.ts:2121- The intent requires that "atLeastOne @max becomes a loader error". The new behavior is the default (non-strict) load refusal, added in validation-passes.ts:2121, ValidationPasses.cs:2450, ValidationPhase.java:2397 and validation_passes.py:4461. No test in any port executes it. The existing fixture error-validator-at-least-one-max-unknown runs under the strict loader, where the attr was already refused. Add a test per port that loads that fixture's input with the default loader and asserts exactly one ERR_UNKNOWN_ATTR at the validator. The oracle is the fixture's expected-errors.json. The test would catch a regression where a default load keeps @max and ignores it, and one where a strict load reports the error twice.ℹ️
server/typescript/packages/metadata/src/core/reporting/report-shape.ts:361- Inline fix: the viaAlwaysMatches docstrings here and in server/csharp/MetaObjects/Core/Reporting/ReportShape.cs:240 said "Every generated view join is LEFT OUTER". That is false on this tree: extract-view-spec.ts:982 still emits INNER joins under the View DDL: derive INNER vs LEFT OUTER join from reference optionality instead of hardcoding LEFT OUTER #209 rule, and report-required-joins.test.ts asserts INNER. I reworded both to "whichever join type the view lowering picks". The same false claim is still in test comments, which I did not edit because inline fixes may not touch tests: report-required-conformance.test.ts:2, ReportShapeTests.cs:53, ReportShapeTest.java:920 and test_report_shape.py:937.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- Intent calls this the final combined release PR and lists TS and C# generator wiring and the extractor refusals as in scope, so the TS/C# codegen in this diff is expected. The MySQL helper fix is also in the intent. The remaining question is the "1 of 4 PRs" wording from the earlier round, which the current intent no longer carries. No contradiction found with the current intent. Informational only.docs/CONFORMANCE.md:29- Intent: "18 metamodel conformance fixtures (the corpus moves from 490 to 508) and one naming-conformance fixture". The diff matches: +18 metamodel fixtures (490 -> 508) and collection-segments.json. No gap found. The earlier "21 fixtures" wording is gone from the intent.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1548- Loaders in all four ports give a projection the EFFECTIVE @filter (every extends level's own @filter ANDed; effectiveProjectionFilter and its C#/Java/Python twins). View lowering still readsprojection.ownAttr(OBJECT_PROJECTION_ATTR_FILTER), and buildSelectSpec takes ownChildren. Concrete case: ExportPlans extends LivePlans ({deleted:false}) and GatedPlans ({consented:true}), declares an extends-bound identity and no own @filter. It loads clean (new fixtures projection-extends-filtered-projection and projection-extends-abstract-projection show this loads). The generated view then has no WHERE for the inherited gates and lacks the inherited columns. Gate rows are silently dropped. This contradicts the intent that the extractor "refuses (throws, naming the projection and field) any of the new loader shapes it cannot lower, instead of silently skipping it". Smallest remedy: in the extractor call cannotLower when effectiveProjectionFilter(projection) differs from the own @filter, or when the projection extends another projection. This adds a refusal, so it is the author's call. Lowering the inherited filter is out of scope per the intent.server/typescript/packages/metadata/src/loader/validation-passes.ts:1837- ERR_DERIVED_FIELD_NO_READ_SOURCE is now skipped for an origin.first/origin.computed entity field that a projection reaches (same skip at ValidationPasses.cs:1825, ValidationPhase.java:5693, validation_passes.py:3816). An entity with only a writable table plus a derived field now loads in every port (fixture entity-derived-filter-gate, Member.hasActiveAgreement). TS is safe: drizzle-schema and migrate-ts skip isDerived fields. C# EntityGenerator drops derived fields only when the entity is write-through (EntityGenerator.cs:380excludeDerived: entity.IsWriteThrough()), and DbContextGenerator configures them the same way. For Member the EF entity maps HasActiveAgreement to a has_active_agreement column the members table lacks, so EF queries on Member fail at runtime. Not checked: Java, Kotlin, Python generators for this shape. Decide: fix C# (and other) generators in this PR, or hold the loader relaxation.server/typescript/packages/metadata/src/loader/validation-passes.ts:1932- originRelatedEntity splits @Of at the LAST '.', so @Of "Plan.address.city" (a flattened value-object member, now legal) resolves object "Plan.address", gets undefined, and the @segment check is skipped. An origin.first with an unknown @segment then loads clean. Same split in ValidationPasses.cs:1743 and ValidationPhase.java:4071. Python (_origin_related_entity, validation_passes.py:1585) resolves through _validate_entity_field_ref and reports ERR_INVALID_ORIGIN, so the ports disagree on the same input. Fix in TS, C# and Java: resolve the @Of entity with the silent entity-field resolver the @from/@Of check already uses (_validateFromPath / ValidateFromPath / validateFromOrOfPath), not string slicing. Add a shared fixture so the ports are gated against each other.server/typescript/packages/metadata/src/loader/validation-passes.ts:2121- Intent requires "atLeastOne @maxbecomes a loader error". The new default (non-strict) refusal is at validation-passes.ts:2121, ValidationPasses.cs:2450, ValidationPhase.java:2397, validation_passes.py:4461. No test in any port executes it (grep of the TS, Python, C# and Java test trees finds no test using it). The existing fixture error-validator-at-least-one-max-unknown runs under the strict loader, where the attr was already refused. Add a test per port that loads that fixture's input with the default loader and asserts exactly one ERR_UNKNOWN_ATTR at the validator. Oracle: the fixture's expected-errors.json. It rejects a regression where default load keeps @max and ignores it, and one where a strict load reports the error twice.server/typescript/packages/metadata/src/core/reporting/report-shape.ts:361- The reviewer recorded this as fixed inline but made no edit; fix it: Inline fix, already applied in bab7daa: the viaAlwaysMatches docstrings here and in server/csharp/MetaObjects/Core/Reporting/ReportShape.cs:240 no longer claim every view join is LEFT OUTER (extract-view-spec.ts still emits INNER joins under View DDL: derive INNER vs LEFT OUTER join from reference optionality instead of hardcoding LEFT OUTER #209). The same false claim remains in test comments: report-required-conformance.test.ts:2, ReportShapeTests.cs:53, ReportShapeTest.java:920, test_report_shape.py:937.🔧 Fix applied.
5 warnings still open:
server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- Intent calls this the final combined release PR and lists TS and C# generator wiring and the extractor refusals as in scope, so the TS/C# codegen in this diff is expected. The MySQL helper fix is also in the intent. The remaining question is the "1 of 4 PRs" wording from the earlier round, which the current intent no longer carries. No contradiction found with the current intent. Informational only.docs/CONFORMANCE.md:29- Intent: "18 metamodel conformance fixtures (the corpus moves from 490 to 508) and one naming-conformance fixture". The diff matches: +18 metamodel fixtures (490 -> 508) and collection-segments.json. No gap found. The earlier "21 fixtures" wording is gone from the intent.server/typescript/packages/metadata/src/core/reporting/report-shape.ts:361- The reviewer recorded this as fixed inline but made no edit; fix it: Inline fix, already applied in bab7daa: the viaAlwaysMatches docstrings here and in server/csharp/MetaObjects/Core/Reporting/ReportShape.cs:240 no longer claim every view join is LEFT OUTER (extract-view-spec.ts still emits INNER joins under View DDL: derive INNER vs LEFT OUTER join from reference optionality instead of hardcoding LEFT OUTER #209). The same false claim remains in test comments: report-required-conformance.test.ts:2, ReportShapeTests.cs:53, ReportShapeTest.java:920, test_report_shape.py:937.server/csharp/MetaObjects.Codegen/Generators/EntityGenerator.cs:281- Fix-round regression (the round that dropped derived fields for entities with no read source).excludeDerived: entity.IsEntity()now strips derived (origin.*) fields from EVERY object.entity, including an entity whose only source is a read-only view (IsReadOnlyProjection() true, IsWriteThrough() false). That shape loads clean (ERR_DERIVED_FIELD_NO_READ_SOURCE is skipped when a read-capable source exists, ValidationPasses.cs ~1814) and its view does carry the derived columns. Before the round the view-only entity kept them (excludeDerived was IsWriteThrough()); now the C# class silently loses the property and the DbContext.ToViewmapping reads without it. No error, wrong output. Same class in Kotlin: KotlinExposedTableGenerator.kt:257excludeDerivedFields = entity.subType == SUBTYPE_ENTITY, KotlinEntityGenerator.kt ~270entityHost(derived becomes nullable/defaulted), and KotlinGenUtil.columnFields (~608), which drops derived fields from repository/controller column reads for a view-only entity since!obj.isWriteThrough. Smallest fix: exclude only when the class maps to a table, i.e. entity has a writable source or no read source (C#:entity.IsEntity() && !entity.IsReadOnlyProjection(); Kotlin: same guard in the three places). Add a test generating a view-only entity with an origin.first field and asserting the property/column stays.server/python/src/metaobjects/runtime/object_manager.py:714- The decided fix for derived fields on an entity with no read source said to check Java (codegen-spring), Kotlin and Python and fix any that map a column the table lacks, each with a test. The round fixed only C# and Kotlin. Two runtime siblings still map the missing column for fixture entity-derived-filter-gate (Member.hasActiveAgreement, tablemembers, no replica view): Python ObjectManager.find_many selects[_column_of(f) for f in entity.fields()](object_manager.py:714; also :742/:745 column map) from the table, so SELECT names has_active_agreement and fails at runtime (insert/update at :448/:574 already skip derived, reads do not); Java OMDB SimpleMappingHandlerDB.loadColumns/getTableMapping (SimpleMappingHandlerDB.java:112,136) builds a TableDef column for every field with no derived filter (no isDerived reference anywhere in omdb), so Spring repositories select/insert the same column. No test was added in either port. Fix: when the entity has no replica read source, skip derived fields in the Python read column list and the Java table mapping, with a test per port loading entity-derived-filter-gate.🔧 Fix applied.
6 issues (5 warnings, 1 info) still open:
server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- Intent calls this the final combined release PR and lists TS and C# generator wiring and the extractor refusals as in scope, so the TS/C# codegen in this diff is expected. The MySQL helper fix is also in the intent. The remaining question is the "1 of 4 PRs" wording from the earlier round, which the current intent no longer carries. No contradiction found with the current intent. Informational only.docs/CONFORMANCE.md:29- Intent: "18 metamodel conformance fixtures (the corpus moves from 490 to 508) and one naming-conformance fixture". The diff matches: +18 metamodel fixtures (490 -> 508) and collection-segments.json. No gap found. The earlier "21 fixtures" wording is gone from the intent.server/typescript/packages/metadata/src/core/reporting/report-shape.ts:361- The reviewer recorded this as fixed inline but made no edit; fix it: Inline fix, already applied in bab7daa: the viaAlwaysMatches docstrings here and in server/csharp/MetaObjects/Core/Reporting/ReportShape.cs:240 no longer claim every view join is LEFT OUTER (extract-view-spec.ts still emits INNER joins under View DDL: derive INNER vs LEFT OUTER join from reference optionality instead of hardcoding LEFT OUTER #209). The same false claim remains in test comments: report-required-conformance.test.ts:2, ReportShapeTests.cs:53, ReportShapeTest.java:920, test_report_shape.py:937.server/python/src/metaobjects/runtime/object_manager.py:714- The decided fix for derived fields on an entity with no read source said to check Java (codegen-spring), Kotlin and Python and fix any that map a column the table lacks, each with a test. The round fixed only C# and Kotlin. Two runtime siblings still map the missing column for fixture entity-derived-filter-gate (Member.hasActiveAgreement, tablemembers, no replica view): Python ObjectManager.find_many selects[_column_of(f) for f in entity.fields()](object_manager.py:714; also :742/:745 column map) from the table, so SELECT names has_active_agreement and fails at runtime (insert/update at :448/:574 already skip derived, reads do not); Java OMDB SimpleMappingHandlerDB.loadColumns/getTableMapping (SimpleMappingHandlerDB.java:112,136) builds a TableDef column for every field with no derived filter (no isDerived reference anywhere in omdb), so Spring repositories select/insert the same column. No test was added in either port. Fix: when the entity has no replica read source, skip derived fields in the Python read column list and the Java table mapping, with a test per port loading entity-derived-filter-gate.server/python/src/metaobjects/runtime/object_manager.py:1430- Fix-round regression (commits 9a551df and f73696b). The fix was to drop derived (origin.*) fields only where the class maps to a table that lacks them: an entity with a writable source and no read-capable source. The code drops them for every entity that is not write-through, which includes an object.entity whose only source is a read-only view. The loader accepts that shape: ERR_DERIVED_FIELD_NO_READ_SOURCE passes when any read-only source exists. Trace: an object.entity has a single source.rdb @kind view and an origin.first field._read_fieldsreturns the entity without the derived field. The SELECT omits a column the view does provide, and the row comes back with the field missing and no error. Before the fix, reads selected all fields. Java OMDB (SimpleMappingHandlerDB.java:155) is correct because it checkstable instanceof TableDef. The other ports have the same over-broad guard: C# EntityGenerator.cs:281excludeDerived: entity.IsEntity(), which drops the property from a view-mapped class (isView is true for a view-only entity); Kotlin KotlinGenUtil.ktcolumnFields(entity && !isWriteThrough), KotlinExposedTableGenerator.kt:~257excludeDerivedFields = entity.subType == SUBTYPE_ENTITY, and KotlinEntityGenerator.ktentityHost, which makes the data-class derived property nullable and defaulted for a view-only entity too. Fix: narrow every guard to an entity with a writable source and no read-only source (C#!IsReadOnlyProjection(), Python and Kotlin: has a writable own source). The tests that were claimed for this (a view-only entity with an origin.first field keeps its property/column) are missing in all of C#, Kotlin, Python and Java; add them. The existing tests only cover entity-derived-filter-gate, which has a table source only, so they cannot catch this.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1530- Checked the TS refusal for a projection that extends another projection. It is guarded by!writeThrough, and baseEntityFor ignores object-level extends, so no previously lowerable view is newly refused. The test table covers three fixtures and asserts the projection name in the message. The CHANGELOG bullet names the shape. Checked the fixture counts (510 directories, matching AGENTS.md, docs/CONFORMANCE.md and site-payload.json) and the @Of resolution change in TS, C# and Java: both are consistent. Python already resolved @Of through the entity-field resolver.🔧 No changes applied.
5 issues (4 warnings, 1 info) still open:
server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- Intent calls this the final combined release PR and lists TS and C# generator wiring and the extractor refusals as in scope, so the TS/C# codegen in this diff is expected. The MySQL helper fix is also in the intent. The remaining question is the "1 of 4 PRs" wording from the earlier round, which the current intent no longer carries. No contradiction found with the current intent. Informational only.docs/CONFORMANCE.md:29- Intent: "18 metamodel conformance fixtures (the corpus moves from 490 to 508) and one naming-conformance fixture". The diff matches: +18 metamodel fixtures (490 -> 508) and collection-segments.json. No gap found. The earlier "21 fixtures" wording is gone from the intent.server/typescript/packages/metadata/src/core/reporting/report-shape.ts:361- The reviewer recorded this as fixed inline but made no edit; fix it: Inline fix, already applied in bab7daa: the viaAlwaysMatches docstrings here and in server/csharp/MetaObjects/Core/Reporting/ReportShape.cs:240 no longer claim every view join is LEFT OUTER (extract-view-spec.ts still emits INNER joins under View DDL: derive INNER vs LEFT OUTER join from reference optionality instead of hardcoding LEFT OUTER #209). The same false claim remains in test comments: report-required-conformance.test.ts:2, ReportShapeTests.cs:53, ReportShapeTest.java:920, test_report_shape.py:937.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1530- Checked the TS refusal for a projection that extends another projection. It is guarded by!writeThrough, and baseEntityFor ignores object-level extends, so no previously lowerable view is newly refused. The test table covers three fixtures and asserts the projection name in the message. The CHANGELOG bullet names the shape. Checked the fixture counts (510 directories, matching AGENTS.md, docs/CONFORMANCE.md and site-payload.json) and the @Of resolution change in TS, C# and Java: both are consistent. Python already resolved @Of through the entity-field resolver.server/csharp/MetaObjects.Codegen/Generators/EntityGenerator.cs:281- Regression from the earlier fix round 9a551df and f73696b ("drop columnless derived"). These commits changed the derived-field exclusion fromIsWriteThrough()to "any object.entity". The intended case is an entity with a writable table and no read view. The new guard also hits a view-onlyobject.entity, whose only source is a read-only view. That view does carry the derived origin.* columns, but the new guard drops the field anyway. Concrete input: anobject.entitywith a singlesource.rdb @kind: viewand anorigin.firstfield. Before the round, the C# class, Kotlin Exposed object and Python read kept the field. After it, the property or column is silently gone, and nothing errors. A read of that view no longer returns the derived value. Narrow the exclusion to an entity that has a writable own source and no read-capable source (!IsReadOnlyProjection()and not write-through). Sites with the same wrong guard: server/csharp/MetaObjects.Codegen/Generators/DbContextGenerator.cs:1455 (FK-property filter drops derived fields for every entity, view-only included); server/java/codegen-kotlin/.../KotlinGenUtil.kt (columnFields, which testssubType == ENTITY && !isWriteThrough); server/java/codegen-kotlin/.../KotlinExposedTableGenerator.kt (excludeDerivedFields = entity.subType == SUBTYPE_ENTITY); server/java/codegen-kotlin/.../KotlinEntityGenerator.kt (entityHost); server/python/src/metaobjects/runtime/object_manager.py:1430 (_read_fields). The Java OMDB check (table instanceof TableDef) is already right. The new tests only cover the table-onlyMembercase in fixture entity-derived-filter-gate. Add one test per port for a view-only entity with an origin.first field, asserting the property or column stays and is read back with a value.🔧 Fix applied.
3 issues (2 warnings, 1 info) still open:
server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1194- Intent calls this the final combined release PR and lists TS and C# generator wiring and the extractor refusals as in scope, so the TS/C# codegen in this diff is expected. The MySQL helper fix is also in the intent. The remaining question is the "1 of 4 PRs" wording from the earlier round, which the current intent no longer carries. No contradiction found with the current intent. Informational only.docs/CONFORMANCE.md:29- Intent: "18 metamodel conformance fixtures (the corpus moves from 490 to 508) and one naming-conformance fixture". The diff matches: +18 metamodel fixtures (490 -> 508) and collection-segments.json. No gap found. The earlier "21 fixtures" wording is gone from the intent.server/typescript/packages/codegen-ts/src/projection/extract-view-spec.ts:1530- Checked the TS refusal for a projection that extends another projection. It is guarded by!writeThrough, and baseEntityFor ignores object-level extends, so no previously lowerable view is newly refused. The test table covers three fixtures and asserts the projection name in the message. The CHANGELOG bullet names the shape. Checked the fixture counts (510 directories, matching AGENTS.md, docs/CONFORMANCE.md and site-payload.json) and the @Of resolution change in TS, C# and Java: both are consistent. Python already resolved @Of through the entity-field resolver.📝 1 wording or comment-placement note left for the author (no fix round spent):
server/java/metadata/src/main/java/com/metaobjects/reporting/ReportShape.java:386- Docstring drift after the report-required change. The TS and C# docstrings were reworded to say the rule is about a hop being certain to match, not about the join type. The Java and Python docstrings still open with the old 'the hops the view joins INNER ... the join-type rule of the view lowering' claim, and the helpers keep the old names (viaJoinsInner,_via_joins_inner). The logic matches TS and C# (enforce check, hidesRows), so behaviour is correct. Only the wording is stale. The earlier round asked only for the TS and C# docstrings.server/typescript/packages/metadata- Full regression suites not completed.bun testin server/typescript was killed at the 1500s timeout with no result (evidence/ts-server-full.txt, EXIT=143). Full Python unit run (pytest --ignore=tests/integration) hung near 3% with early F results and was stopped; evidence/python-unit.txt is partial. Only the targeted Python subset (-k derived/origin/atLeast, 234 passed) completed. Needs a full re-run to close the regression gate.meta genvia bun on worktree CLI, synthetic 3-entity metadata; generated/Box.ts$path: "/pdf_boxes", Faq.ts$path: "/faqs"meta genhasActiveAgreement: boolean("has_active_agreement")meta verifyon fixtures/conformance/error-validator-at-least-one-max-unknown; exit 1, single ERR_UNKNOWN_ATTR on validator.atLeastOne at the expected jsonPathmeta verifyon error-origin-segment-flattened-of; exit 1, ERR_INVALID_ORIGIN naming CaseHistory and @segment "dead"scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsmeta init/meta verify --codegen/meta genviabun server/typescript/packages/cli/bin/meta.tson scratch projects under evidence/01M79A0CFTXT62XBXQ2EAVM2Y9 (proj, proj2, proj3)meta verifyon fixtures/conformance/error-validator-at-least-one-max-unknown (proj4)meta verifyon fixtures/conformance/error-origin-segment-flattened-of (proj5)bun testin server/typescript (full TS server suite) — killed at timeout, incomplete (evidence/ts-server-full.txt)python3 -m pytest tests/ --ignore=tests/integration -k 'derived or origin or atLeast or at_least'in server/python — 234 passed (evidence/python-targeted.txt)python3 -m pytest -q --ignore=tests/integrationfull run — hung near 3%, stopped; partial output in evidence/python-unit.txt✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.