Minimal JSON round-trip with external/library references produces unresolved-reference warnings and non-identical derived relationships after reconstruction

Hi,

We are now seeing this on Syside 0.10.3.

This appears related to the same family of issues discussed in:

Our current setup:

  • We use external/user libraries that are installed separately from the main model.
  • For text → JSON, we provide those installed library models as an auxiliary environment.
  • On Syside 0.10.3, that makes serialization/commit work correctly.

However, for JSON → text, we still see failures unless we explicitly rebuild and reapply the same auxiliary environment during deserialization/linking/resolution.

Observed failure:

  • opening a committed model as textual SysML fails with
    • RuntimeError: NamespaceImport is missing target reference

What fixes it on our side:

  1. load installed library models textually
  2. build an environment from them
  3. use project-style syside.json.loads([…])
  4. populate IdMap with both environment docs and deserialized docs
  5. call link(…)
  6. run syside.Sema().resolve(…, env.index(), env.lib)
  7. only then pretty-print to SysML text

So the question is:

On Syside 0.10.3, is this now the expected/supported pattern for JSON→SysML reconstruction when external user libraries are involved?

In other words, should callers always expect to explicitly reconstruct and inject the external-library environment for JSON->text, even if those referenced library elements
are otherwise available in Syside’s broader environment?

This seems consistent with topic 505’s guidance that json.loads(…) alone is not sufficient for external references, but I want to confirm whether this is the intended API
contract in 0.10.3 rather than just a workaround.

If useful, I can provide a minimal reproducer with:

  • one user library package
  • one model importing it
  • successful text → JSON
  • failing JSON → text without auxiliary environment
  • successful JSON → text after explicit environment load + link(…) + Sema.resolve(…)