Replace HasUID with IsChunk in drasil-lang type constraints#4718
Closed
Replace HasUID with IsChunk in drasil-lang type constraints#4718
Conversation
Co-authored-by: balacij <1627302+balacij@users.noreply.github.com>
Co-authored-by: balacij <1627302+balacij@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Switch all HasUID usage in drasil-lang to IsChunk
Replace HasUID with IsChunk in drasil-lang type constraints
Jan 30, 2026
Collaborator
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.
Migrates all
HasUIDconstraints indrasil-langtoIsChunk, strengthening the type system to require proper chunk dependency tracking viaHasChunkRefs.Background
IsChunkis a constraint alias combining three requirements:Previously, many type signatures only required
HasUID, allowing chunks without dependency tracking.Changes
Added Missing
HasChunkRefsInstances (9 types)Types with
HasUIDbut missingHasChunkRefs:CodeChunk,CodeVarChunk,CodeFuncChunkSection,DecRefRelationConcept,UnitalChunk,CI,ConstrConcept,UncertQ,QDefinitionAll instances use stub implementation per instructions:
Replaced Constraints in Type Signatures
Class constraints:
NamedIdea:class HasUID c => NamedIdea c→class IsChunk c => NamedIdea cReferable:class (HasUID s, ...) => Referable s→class (IsChunk s, ...) => Referable sFunction constraints (24 functions across 7 modules):
Affected modules:
Drasil.Code.CodeExpr.Class(6 functions)Language.Drasil.Expr.Class(5 functions)Language.Drasil.Reference(5 functions)Language.Drasil.ModelExpr.Class(2 functions)Language.Drasil.DecoratedReference(2 functions)Language.Drasil.Chunk.Eq(3 functions)Language.Drasil.Sentence(1 function)Impact
16 files modified. All changes are backwards compatible at the call site level—existing code satisfying
HasUIDconstraints will continue to work if types also implementHasChunkRefs(which they now do).Original prompt
HasUIDusage indrasil-langtoIsChunk. #4717💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.