fix: load knowledge diffing after core types - #46
Conversation
| @@ -30,7 +30,6 @@ using JSON3 | |||
|
|
|||
| include("consensus/raft.jl") | |||
There was a problem hiding this comment.
🚨 Bug: Load-order fix is incomplete; other submodules still fail
diffing.jl failed to load because it references ResearchProject/LinkedEntity in method signatures (evaluated at definition time) via using ..PostDisciplinary, while being included before those structs are defined at lines 80-96. But triangulation.jl (line 37), evolutionary.jl (38), hermeneutics.jl (40), and knowledge_transfer.jl (42) use the exact same pattern and are all still included before the type definitions. Since triangulation.jl now loads at the first include position that previously belonged to diffing.jl, package initialization will still throw UndefVarError: ResearchProject/LinkedEntity at triangulation.jl before diffing.jl is ever reached — the PR does not actually make the package load. Move the core type definitions (structs LinkedEntity, ResearchProject, and the ResearchProject(name) constructor) above the entire include(...) block so every submodule can resolve them, which also lets diffing.jl stay in place.
Hoist LinkedEntity/ResearchProject above all include() calls so all submodules load; keep full docstrings from the original definitions.:
# Define core public types BEFORE any include, so every submodule that
# references them in method signatures can resolve them at load time.
struct LinkedEntity
id::UUID; source_library::Symbol; original_id::Symbol
kind::Symbol; metadata::Dict{Symbol, Any}
end
struct ResearchProject
id::Symbol; name::String; graph::MetaGraph
end
function ResearchProject(name::String)
g = MetaGraph(SimpleGraph(); label_type=UUID, vertex_data_type=LinkedEntity,
edge_data_type=Dict{Symbol,Any}, graph_data=name)
return ResearchProject(gensym("project"), name, g)
end
# ...then the include(...) block, including synthesis/diffing.jl
Was this helpful? React with 👍 / 👎
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review.
|
Note Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime. Code Review 🚫 Blocked 0 resolved / 1 findingsRestores module initialization order for knowledge diffing, but the fix is incomplete as other submodules still fail to load. 🚨 Bug: Load-order fix is incomplete; other submodules still fail📄 src/PostDisciplinary.jl:31-43 📄 src/PostDisciplinary.jl:80-94 📄 src/PostDisciplinary.jl:151-154
Hoist LinkedEntity/ResearchProject above all include() calls so all submodules load; keep full docstrings from the original definitions.🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Important Your trial ends in 1 day — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more. Was this helpful? React with 👍 / 👎 | Gitar |
4eb2ecc
into
chore/julia-action-pins-20260809
KnowledgeDiffing defines methods over ResearchProject and LinkedEntity. Load that submodule after the core type definitions so package initialization succeeds.