test(runtimelib): pin the module identity of persisted built-in archetypes - #8968
Closed
SupulHeshan wants to merge 1 commit into
Closed
test(runtimelib): pin the module identity of persisted built-in archetypes#8968SupulHeshan wants to merge 1 commit into
SupulHeshan wants to merge 1 commit into
Conversation
…types Root and GenericEdge are jaclang's own concrete archetypes, and their fully-qualified name is part of the on-disk wire format (see Serializer._get_class). jaseci-labs#8747 showed what happens when one of them moves without a corresponding alias: existing databases lose the anchor silently, and nothing at review time would have caught it. This pins their current identity in a manifest a future rename has to touch directly, with a failure message that points straight at data/serializer.jac's _BUILTIN_MOVED_FROM instead of just tripping an opaque assertion. Verified the guardrail actually fires: temporarily pointing the manifest at the wrong module reproduces the exact message, reverted before committing.
SupulHeshan
added a commit
to SupulHeshan/jaseci
that referenced
this pull request
Sep 7, 2026
…types Folded in from the separate jaseci-labs#8968 PR: keep the fix and its regression guardrail in one place. The two tests above this one cover Root and GenericEdge's specific pre-move aliases. This manifest test is the guardrail for the *next* move: it pins the current module identity of every jaclang built-in that is actually persisted with a concrete `__type__`, so a future package reorganization (more are queued per jaseci-labs#8681) can't repeat this same silent-drop failure by accident. The failure message points straight at data/serializer.jac's _BUILTIN_MOVED_FROM instead of leaving the next contributor to rediscover jaseci-labs#8747 from scratch. Verified the guardrail actually fires: temporarily pointed the manifest at the wrong module, confirmed the exact intended failure message, reverted before committing.
Collaborator
Author
|
Folded into #8956 — this test now lives in that PR alongside the fix itself, so there's one PR to review instead of two for the same issue. Closing this one. |
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.
Summary
Follow-up to #8956 (fixes #8747). That PR aliased
Root/GenericEdgeto their pre-#8682 module path, but nothing stops the next package move from repeating the same silent failure: forgetting to add an alias produces no warning at review time, only a data-loss report from a user later. #8681 has more of these moves queued.This adds a small guardrail instead of relying on someone remembering:
_PERSISTED_BUILTIN_IDENTITIESpins the current fully-qualified name of every jaclang built-in that is actually persisted with a concrete__type__(today:Root,GenericEdge). Base archetypes (NodeArchetype,EdgeArchetype,WalkerArchetype,ObjectArchetype) are deliberately excluded — they're never instantiated as themselves, so no stored row ever carries their name.data/serializer.jac's_BUILTIN_MOVED_FROM(the mechanismregister_alias/schema_wasbuilt for exactly this) instead of leaving the next contributor to rediscover Renaming jac0core.archetype to runtime.archetype drops Root from existing databases: no serializer alias registered #8747 from scratch.Verified the guardrail actually fires, not just that it compiles: temporarily pointed the manifest at the wrong module and confirmed the exact intended failure message, then reverted before committing.
This intentionally does not attempt to fix the other gap identified during #8956's review — the destructive self-heal in
ExecutionContext._resolve_roots, which can silently overwrite the system root anchor if it fails to materialize for any reason (not just this one). That's a materially different, riskier change to root-bootstrap semantics and belongs in its own issue/PR.Test plan
JAC_TEST_JOBS=1 jac test jac/tests/runtimelib/test_layer3_coercion_alias.jac— 22 passed.jac precommitpasses clean. No release-notes fragment needed (test-only change underjac/tests/).