Skip to content

fix(export): check sysx:conjugatedTyping against the typing element only - #1485

Open
devin-ai-integration[bot] wants to merge 5 commits into
developfrom
fix/rdf-conjugated-port-subsetting
Open

devin-ai-integration[bot] wants to merge 5 commits into
developfrom
fix/rdf-conjugated-port-subsetting

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The RDF decoder (internal/translate/export/rdf_in_normative.go, decoder.impliedRelationship) compared every materialized relationship element a feature owns against the owner's sysx:conjugatedTyping flag. A conjugated port with an explicit subsets, redefines or references clause (port p2 : ~Pd subsets Parts::Part::ownedPorts;) was therefore refused when read back from Turtle: its Subsetting is not a ConjugatedPortTyping, so it "disagreed" with the flag. The flag qualifies the typing alone, so the comparison now applies only to typing elements (FeatureTyping / ConjugatedPortTyping, i.e. the metaclasses whose collapsed kind is RelTyping); the other relationship elements keep going through the ordinary collapsed-end checks.

This was the only unwritable model in the RDF corpus ratchet (spec-examples/sysml/8.4.12.1/3.sysml).

Specification basis

SysML v2 textual notation: ConjugatedPortTyping is the typing of a port by ~P (SysML 8.4.12.1); it says nothing about the port's subsettings, redefinitions or reference subsettings. No spec-compliance.md row moves.

How it was verified

  • internal/translate/export/rdf_conjugated_typing_test.go (new): from the graph alone (source text and source ranges stripped) a conjugated port with subsets, with redefines, with references, with a multiplicity, and a plain-typed port with subsets all read back, and a second Turtle hop is byte-identical; a genuine disagreement (plain typing under a sysx:conjugatedTyping flag, conjugated typing without the flag) is still refused with an UnsupportedError naming the flag and the owner. Both tests fail on develop.

  • By hand: sysml examples/spec-examples/sysml/8.4.12.1/3.sysml -convert ttl → -convert sysml → -convert ttl is byte-identical to the first Turtle (cmp); the same for the minimal model package M { port def Pd; part def Q specializes Parts::Part { port p3 : ~Pd subsets Parts::Part::ownedPorts; } }.

  • Corpus ratchets, all require variables set, downloaded corpora (download-training-examples.sh, download-pilot-corpora.sh, download-spec-examples.sh), 876 files:

    Verdict Turtle before Turtle after api-json before api-json after
    stable 830 831 830 831
    whitespace-only 7 7 7 7
    unwritable 1 0 1 0
    refused:syntax 38 38 38 38
    graph-diff / unparseable 0 0 0 0

    The only movement in either file is spec-examples/sysml/8.4.12.1/3.sysml: unwritable → stable. Regenerated with -update-corpus-roundtrip -update-api-json-roundtrip, run twice, second run byte-identical. All 838 corpus files that parse now round-trip in both forms.

  • docs/project/rdf-corpus-roundtrip.md: corpus table and both baseline tables brought to the current roots (the spec-examples roots had not been recorded), the unwritable fix noted.

  • docs/project/api-json-differential-baseline.json: re-recorded with go run -C tools ./cmd/pilot-apijson-diff -update because the baseline digests internal/translate/export; only the writer digest and the recording date moved (929 files, 91774 elements matched, same buckets). make docs-counts passes.

  • go build ./..., go vet ./..., gofmt -l . (empty), make lint (staticcheck + gosec: "Lint passed"), go test -count=1 ./... with the require variables set: all packages ok (cmd/sysml and tests/codegen hit the 10 min default timeout while the 22 min differential re-record ran beside them; alone with -timeout 40m both pass in under 6 min). make docs-check passes through check-doc-links, check-doc-ids, check-doc-figures and changelog.py check; its last step needs the mkdocs Python package, which is not installed here.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Requested by: @HuiJun

The RDF decoder compared every materialized relationship a feature owns
against the owner's sysx:conjugatedTyping flag, so a conjugated port with
an explicit subsets, redefines or references clause was refused as a
disagreement. The flag qualifies the typing alone: measure it against
FeatureTyping and ConjugatedPortTyping and leave the other relationship
elements to the ordinary collapsed-end checks.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits October 25, 2026 03:13
…atchets

Both corpus round-trip ratchets move the file from unwritable to stable; no
other verdict moves (831 stable, 7 whitespace-only, 38 refused:syntax of
876). Refresh the record's corpus table and baselines for the spec-examples
roots and add the changelog fragment.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… edited writer package

The baseline digests internal/translate/export; the decoder fix moved the
digest and nothing else (929 files, 91774 elements matched, same buckets).

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 25, 2026 04:43
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits October 25, 2026 04:44
Co-Authored-By: jason.han <hanhuijun@gmail.com>
… edit

Only the api-json-writer sourceDigest moves; counts and date are unchanged.

Co-Authored-By: jason.han <hanhuijun@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant