Skip to content

feat(check): report a feature-owned multiplicity's featuring types and record type-system validation status - #503

Merged
HuiJun merged 3 commits into
developfrom
feature/type-system-validation-audit
Sep 22, 2026
Merged

HuiJun merged 3 commits into
developfrom
feature/type-system-validation-audit

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What and why

docs/project/spec-compliance.md listed four Type System items as not implemented — "Full generic/specialization validation", "Interface realization", "Redefinition conformance checking", "Subsetting validation". An audit of each against the pilot's named validate* constraints found the list stale: every named specialization, redefinition and subsetting constraint is already reported (✅ in the census), one KerML rule was genuinely missing, and "interface realization" is not a SysML v2 concept.

  • Implemented validateFeatureMultiplicityDomain (KerML 1.0 §8.3.3.3.4): a feature-owned multiplicity must have the same featuring types as its feature. The only textual way to violate it is a standalone featuring of C::x::m by D; on the multiplicity, which MultiplicityDomainPass (constraint tier, error, pilot wording Multiplicity must have same featuring types as it feature) now reports on the relationship member. A target that is one of the feature's featuring contexts, or specializes one, is accepted; classifier-owned multiplicities (validateClassifierMultiplicityDomain, ⛔ deliberate) and unresolved ends are left alone. Census row ❌ → ✅ with a probe; the pipeline self-model gains the pass (56 → 57).
  • The six ⚠️ rows stay approximate, each now stating why in validation-constraints.md: validateBindingConnectorTypeConformance (the value/feature typing judgment is the type tier's, where a mismatch is an error — a constraint-tier warning would let the constraint tier run over an ill-typed model), validateClassifierDefaultSupertype (the Links::BinaryLink requirement is KerML §8.3.4.7 and is kept), validateFlowEndImplicitSubsetting (the same end is already rejected as inaccessible; the pilot's warning beside it would report one defect twice), validateExposeOwningNamespace and validateRequirementConstraintMembershipOwningType (deliberate extensions: warning by default, -strict matches the pilot), validateTransitionUsageSuccession (the state-machine reading is what the state executor runs).
  • Docs: the Type System bullets are rewritten with status, file:function and test per rule; "Interface realization" is removed (UML InterfaceRealization has no v2 counterpart — an interface def is a connection between ports, and the two sides of an interaction are port conjugation); roadmap Track V figures updated; census counts regenerated.

Audit summary (rule → pilot constraint → status):

Bullet Pilot constraints Status
Specialization validate{Class,DataType,Structure,Behavior}Specialization, validate{Association,Connector}BinarySpecialization, validateSpecializationSpecificNotConjugated, validateTypeAtMostOneConjugator, validateFeatureHasType, validate*UsageType, validate{Definition,Usage}VariationSpecialization ✅; validateClassifierDefaultSupertype ⚠️ (stricter, deliberate). "Generic" types do not exist in KerML/SysML v2
Interface realization not a SysML v2 concept (removed); the v2 rules that do exist — validateInterface{Definition,Usage}End, validateInterfaceUsageType, validatePortUsage* — are ✅
Redefinition conformance validateRedefinition{FeaturingTypes,EndConformance,DirectionConformance,MultiplicityConformance}, validateSubsetting{Constant,Uniqueness}Conformance, validateFeatureValueOverriding ✅ (multiplicity as a warning, like the pilot)
Subsetting validateSubsetting{FeaturingTypes,MultiplicityConformance}, validateFeatureOwned{Reference,Cross}Subsetting, validateCrossSubsetting*, validateFeatureCrossFeature*, validateFlowEndSubsetting, validateFeatureMultiplicityDomain ✅ (the last one landed here); validateFlowEndImplicitSubsetting ⚠️; validateSubsettingPortionConformance is a no-op in the pinned pilot

Census: 162 → 163 of 217 reported; 156 → 157 ✅; 6 ⚠️; 1 → 0 ❌; 1 ⛔; 0 🚧; 53 ❔.

Specification basis

KerML 1.0 §8.3.3.3.4 (Feature: multiplicity.featuringType = featuringType), the pilot's KerMLValidator.validateFeatureMultiplicityDomain. Moves the census row in docs/project/validation-constraints.md and rewrites the Type System entries in docs/project/spec-compliance.md.

How it was verified

  • internal/check/passes/multiplicity_domain_test.go: package-level and body-level standalone featuring are reported once each; a target that is the feature's owner, a featuring on the feature itself, a classifier-owned multiplicity and an unresolved target are silent.
  • Census probe tools/census/validation/testdata/probes/validateFeatureMultiplicityDomain.kerml; go run -C tools ./cmd/validation-census -check and go test -C tools ./census/validation pass. The pinned pilot KerML validator was run over the probe and both negative shapes by hand: silent on all three (its featuringType reads only owned type featurings; its only trigger for this constraint is the defective alias/reference derivation recorded in omg-issues.md, which stays a valid model here).
  • False positives: featuring occurs in the corpora only in kerml-examples/Simple Tests/Features.kerml and two rejection fixtures; a sweep over examples/, tests/testdata/ and the fixtures reports zero multiplicity-featuring-type diagnostics.
  • Pilot referees, before and after, identical structured totals (jar not found: 0):
    • differential: 378 file(s), 347 fully agreeing; 38 agreed diagnostic(s), 38 only ours, 1185 only the pilot's
    • xpect: 429 .xt file(s), 0 unparsed; 1264 assertion(s), 1326 expectation(s): 1296 agree (of which 248 wording-only), 30 disagree, 0 unlocated, 0 not adjudicated
    • rejection: 306 case(s): 297 both reject, 0 only the pilot rejects, 9 only we reject, 0 both accept
    • The one baseline movement is pilot-differential-baseline.json provenance.inputs[examples].digest: the self-model gained the new pass; no diagnostic or total moved. No rejection case was added — the pilot accepts the model, which the rejection corpus's policy records as a coverage gap rather than a case. training_examples_expected.txt is untouched.
  • Gates (all exit 0):
    go build ./... && go vet ./... && gofmt -l .        # gofmt prints nothing
    OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_PILOT_LIBRARY_XMI=1 go test ./...   # ok, incl. tests/corpus, tests/identity
    go test -C tools ./...                               # ok
    make docs-check                                      # 0 broken links; no internal labels; census/suite figure tests OK
    python3 scripts/changelog.py check                   # ok
    

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

devin-ai-integration Bot and others added 3 commits September 21, 2026 18:13
…model

Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
devin-ai-integration Bot marked this pull request as ready for review September 21, 2026 18:59

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread internal/check/passes/multiplicity_domain.go
@HuiJun
HuiJun merged commit 464d143 into develop Sep 22, 2026
15 checks passed
@HuiJun
HuiJun deleted the feature/type-system-validation-audit branch September 22, 2026 00:50
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