Skip to content

chore(metamodel): regenerate to fix the dropped typeof:/abstract: keys - #115

Merged
kervel merged 2 commits into
mainfrom
chore/regenerate-metamodel-typeof
Aug 25, 2026
Merged

chore(metamodel): regenerate to fix the dropped typeof:/abstract: keys#115
kervel merged 2 commits into
mainfrom
chore/regenerate-metamodel-typeof

Conversation

@kervel

@kervel kervel commented Aug 25, 2026

Copy link
Copy Markdown

Lands the fix for #108 by regenerating the metamodel, and corrects the reproducibility rule
#112 introduced.

The criterion was wrong

GENERATED_FROM listed the generator commits not in linkml/main and declared that the crate
"cannot be reproduced from upstream linkml alone" until they merged. That made every regen wait
on an upstream review queue for no reason.

Naming the changes is enough. Each extra commit is now resolved to every PR whose head carries
it, and the stamp reads as a recipe:

generator_revision = e7015ec5cfe365db14e4aea92b646f58759ef254
generator_describe = v1.11.1-288-ge7015ec5c

# To reproduce: apply these generator changes on top of linkml/main,
# then run ./regen.sh. They need not be merged; naming them is enough.
# Newest first:
# e7015ec5c fix(rustgen): preserve LinkML slot name on the wire for escaped fields  (linkml/linkml#3919)
# 0e8b0cb3a fix(rustgen): include concrete base class in its *OrSubtype enum  (linkml/linkml#3919)
# a9c00ca0a fix(rustgen): emit serde tag for type designators on subtype enums  (linkml/linkml#3919)

So a generator fix has to be identifiable, not merged: pushed, with a PR open, so the stamp
names something a reader can fetch rather than a sha that only exists on the author's disk.
All three commits resolve to #3919 because they are stacked on that branch — the older PRs
#3661/#3662 carry pre-rebase versions with different shas, and fetching #3919 gets you all three.

regen.sh also warns when the generator checkout has uncommitted changes: the recorded revision
then does not determine the output, which is the one thing the stamp promises. A warning, not a
refusal — the diff may be unrelated to the generator.

The regen

typeof and abstract now line up with their typeof_/abstract_ fields instead of being
dropped, so a derived type has a parent again. The seven tests #112 left #[ignore]d go green
unchanged
, which is what they were for, and the ignores are removed. Fixes #108.

User-visible, in turtle output:

-geotest:mirror "https://mirror.brussels.be" ;
+geotest:mirror <https://mirror.brussels.be> ;
-geotest:track_length "1200" ;
+geotest:track_length 1200 ;

Nothing is hand-patched. The renames are the generator's own output, derived generically from
"was this name escaped" rather than from a list of names — on meta.yaml that comes to exactly
five (typeof on TypeDefinition, abstract on four structs; type_ does not occur).

What rides along

Two generator commits sit under the fix on that branch, so regenerating brings them:

Verification

cargo test --workspace 74 suites green, cargo fmt --all --check, clippy with
-D warnings, and stub_gen --check all clean. ./regen.sh --check reports
OK: committed crate reproduces from v1.11.1-288-ge7015ec5c, so the gate works in both
directions — it reported drift before this regen and is clean after.

Note for whoever bumps a downstream pin

A consumer asserting the buggy behaviour on purpose will now fail, which is the intended signal.
In asset360 that is sparql_terms.rs::typeof_only_type_has_no_datatype_and_is_not_numeric:
trackLength becomes xsd:integer and numeric, so the assertion inverts.

Frank Dekervel and others added 2 commits August 25, 2026 12:11
…erge

The reproducibility criterion was wrong. GENERATED_FROM listed the generator
commits not in linkml/main and declared that the crate "cannot be reproduced
from upstream linkml alone" until they merged -- which made every regen wait on
an upstream review queue for no reason.

Naming the changes is enough. Each extra commit is now resolved to every pull
request whose head carries it, and the stamp reads as a recipe: apply these PRs
on top of linkml/main, run ./regen.sh. A generator fix therefore has to be
identifiable, not merged -- pushed, with a PR open, so the stamp names something
a reader can fetch rather than a sha that only exists on the author's disk.

PR lookup is best effort (needs gh, network, and the commit pushed to the
searched repo) and falls back to naming the commit alone. LINKML_PR_REPO
overrides the repo searched; it defaults to linkml/linkml.

Also warn when the generator checkout has uncommitted changes: the recorded
revision then does not determine the output, which is the one thing the stamp is
supposed to promise. A warning rather than a refusal, since the diff may be
unrelated to the generator.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Regenerated with the rust generator from linkml/linkml#3919, which emits
#[serde(rename = "<linkml name>")] for every field whose Rust name had to be
escaped. `typeof` and `abstract` now line up with their `typeof_`/`abstract_`
fields instead of being dropped without error, so a derived type has a parent
again: type_ancestors walks the whole chain, and the datatype and IRI
disposition it carries are inherited.

The seven tests 03d64e9 left #[ignore]d for this go green unchanged, which is
what they were for. Fixes #108. The user-visible half is in turtle output: a
`typeof: uri` range now emits a named node rather than a literal, and a
`typeof: integer` range carries ^^xsd:integer rather than serializing plain.

Nothing was hand-patched; the renames are the generator's own output, derived
generically from "was this name escaped" rather than from a list, so the fix
covers every escaped field. On meta.yaml that is exactly five: typeof on
TypeDefinition and abstract on four structs.

The generator branch also carries two changes that sit under the fix, so the
regen brings them along:

* the concrete base class is now a variant of its own *OrSubtype enum --
  ExtensionOrSubtype::Extension and EnumExpressionOrSubtype::EnumExpression,
  with the matching From, PyO3, from_pair_*, stub and poly.rs dispatch arms.
  This is why the Python stubs move: every `extensions` field widens from
  Annotation to Annotation | Extension (#110).
* the type-designator serde tag, which changes nothing here because meta.yaml
  declares no type designator (#111).

GENERATED_FROM names all three, each resolved to the PR carrying it, so the
crate is reproducible from that list without waiting for those PRs to merge.
`./regen.sh --check` is clean against the revision in the stamp.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kervel
kervel force-pushed the chore/regenerate-metamodel-typeof branch from 351e064 to e641216 Compare August 25, 2026 10:12
@kervel
kervel merged commit 875aca2 into main Aug 25, 2026
1 check passed
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.

Bug: typeof: and abstract: are silently dropped at deserialization; derived types inherit nothing

1 participant