Bug Description
The Node UI Assertions tab can show "No assertions in this layer" for a project even when that project has many Working Memory assertions, if those assertions were created under a sub-graph.
Observed with the local project:
- Context graph:
dkg-v10-codebase-graphify / "DKG v10 Codebase - Graphify"
- Sub-graph:
code
- UI symptom: Working Memory →
Assertions tab shows No assertions in this layer
- Actual data: 129 WM assertion graphs exist under the
code sub-graph, with 713,702 triples
Environment
- Node version:
10.0.0-rc.9
- Commit:
e0f6b543
- Store backend:
oxigraph-worker
- Node UI source inspected at:
packages/node-ui/src/ui/api.ts and packages/node-ui/src/ui/views/project/components.tsx
Evidence
The assertion data exists under sub-graph-scoped assertion graph IRIs:
SELECT (COUNT(DISTINCT ?g) AS ?assertions) (COUNT(*) AS ?triples) WHERE {
GRAPH ?g { ?s ?p ?o }
FILTER(STRSTARTS(STR(?g), "did:dkg:context-graph:dkg-v10-codebase-graphify/code/assertion/"))
}
Result:
assertions = 129
triples = 713702
The root assertion prefix has no assertion graphs:
SELECT (COUNT(DISTINCT ?g) AS ?assertions) (COUNT(*) AS ?triples) WHERE {
GRAPH ?g { ?s ?p ?o }
FILTER(STRSTARTS(STR(?g), "did:dkg:context-graph:dkg-v10-codebase-graphify/assertion/"))
}
Result:
assertions = 0
triples = 0
The lifecycle metadata does know about the assertions and encodes the sub-graph in the assertion URN:
SELECT ?assertion ?name ?state ?layer WHERE {
GRAPH <did:dkg:context-graph:dkg-v10-codebase-graphify/_meta> {
?assertion a <http://dkg.io/ontology/Assertion> ;
<http://dkg.io/ontology/assertionName> ?name ;
<http://dkg.io/ontology/state> ?state ;
<http://dkg.io/ontology/memoryLayer> ?layer .
}
}
LIMIT 5
Sample result:
urn:dkg:assertion:dkg-v10-codebase-graphify:code:0xccAdb7C905eA4fd1b594A7536C7DE8dB2CB69c03:graphify-e0f6b543-cross-links-001
name = "graphify-e0f6b543-cross-links-001"
state = "created"
layer = "WM"
Probable Root Cause
packages/node-ui/src/ui/api.ts → listAssertions(contextGraphId, layer) handles WM assertions by running:
const sparql = `SELECT DISTINCT ?g (COUNT(?s) AS ?cnt) WHERE { GRAPH ?g { ?s ?p ?o } } GROUP BY ?g`;
const prefix = `did:dkg:context-graph:${contextGraphId}/assertion/`;
...
if (!g || !g.startsWith(prefix)) continue;
That prefix only matches root assertion graph IRIs:
did:dkg:context-graph:<cg>/assertion/<agent>/<name>
It misses sub-graph assertion graph IRIs:
did:dkg:context-graph:<cg>/<subGraph>/assertion/<agent>/<name>
The UI then passes the empty result to AssertionsList in packages/node-ui/src/ui/views/project/components.tsx, which renders:
<div className="v10-layer-state">No assertions in this layer</div>
Why this matters
Large/project-organized imports are naturally partitioned into sub-graphs. The current assertion listing makes those WM assertions invisible in the UI, even though:
- Entities/triples exist in the graph
- Lifecycle metadata exists
- Assertion names are recoverable
- The user needs the assertions tab to inspect/promote/import lifecycle state
Also, promoteAssertion(contextGraphId, assertionName) currently does not pass a subGraphName, so simply listing sub-graph assertions may not be sufficient: promote/publish actions from the assertions UI likely need to carry the sub-graph scope as well.
Expected Behavior
The Node UI should surface assertions stored in sub-graphs, either:
- In the top-level layer
Assertions tab, grouped/labeled by sub-graph, or
- In a sub-graph-specific assertions tab/page, scoped to the selected sub-graph.
For sub-graph assertions, any actions such as promote should pass the correct subGraphName to the API.
Actual Behavior
Top-level WM Assertions tab shows:
No assertions in this layer
while 129 WM assertion graphs exist under did:dkg:context-graph:dkg-v10-codebase-graphify/code/assertion/....
Suggested Fix Direction
- Extend
AssertionInfo with optional subGraphName.
- Update
listAssertions() WM path to enumerate both:
did:dkg:context-graph:<cg>/assertion/...
did:dkg:context-graph:<cg>/<subGraph>/assertion/...
- Or prefer
_meta lifecycle records for WM assertion enumeration, since they already include sub-graph-scoped assertion URNs.
- Update
promoteAssertion() / UI handlers to pass subGraphName when acting on sub-graph assertions.
- Consider adding an Assertions tab inside
SubGraphDetailView so the user can inspect/promote assertions for a selected sub-graph directly.
Reproduction Shape
- Create a context graph.
- Create/register a sub-graph, e.g.
code.
- Create/write WM assertions with
subGraphName: "code".
- Open the project in Node UI.
- Navigate to Working Memory →
Assertions tab.
- Observe
No assertions in this layer, despite assertion graph data under <cg>/code/assertion/....
Bug Description
The Node UI
Assertionstab can show "No assertions in this layer" for a project even when that project has many Working Memory assertions, if those assertions were created under a sub-graph.Observed with the local project:
dkg-v10-codebase-graphify/ "DKG v10 Codebase - Graphify"codeAssertionstab showsNo assertions in this layercodesub-graph, with 713,702 triplesEnvironment
10.0.0-rc.9e0f6b543oxigraph-workerpackages/node-ui/src/ui/api.tsandpackages/node-ui/src/ui/views/project/components.tsxEvidence
The assertion data exists under sub-graph-scoped assertion graph IRIs:
Result:
The root assertion prefix has no assertion graphs:
Result:
The lifecycle metadata does know about the assertions and encodes the sub-graph in the assertion URN:
Sample result:
Probable Root Cause
packages/node-ui/src/ui/api.ts→listAssertions(contextGraphId, layer)handles WM assertions by running:That prefix only matches root assertion graph IRIs:
It misses sub-graph assertion graph IRIs:
The UI then passes the empty result to
AssertionsListinpackages/node-ui/src/ui/views/project/components.tsx, which renders:Why this matters
Large/project-organized imports are naturally partitioned into sub-graphs. The current assertion listing makes those WM assertions invisible in the UI, even though:
Also,
promoteAssertion(contextGraphId, assertionName)currently does not pass asubGraphName, so simply listing sub-graph assertions may not be sufficient: promote/publish actions from the assertions UI likely need to carry the sub-graph scope as well.Expected Behavior
The Node UI should surface assertions stored in sub-graphs, either:
Assertionstab, grouped/labeled by sub-graph, orFor sub-graph assertions, any actions such as promote should pass the correct
subGraphNameto the API.Actual Behavior
Top-level WM
Assertionstab shows:while 129 WM assertion graphs exist under
did:dkg:context-graph:dkg-v10-codebase-graphify/code/assertion/....Suggested Fix Direction
AssertionInfowith optionalsubGraphName.listAssertions()WM path to enumerate both:did:dkg:context-graph:<cg>/assertion/...did:dkg:context-graph:<cg>/<subGraph>/assertion/..._metalifecycle records for WM assertion enumeration, since they already include sub-graph-scoped assertion URNs.promoteAssertion()/ UI handlers to passsubGraphNamewhen acting on sub-graph assertions.SubGraphDetailViewso the user can inspect/promote assertions for a selected sub-graph directly.Reproduction Shape
code.subGraphName: "code".Assertionstab.No assertions in this layer, despite assertion graph data under<cg>/code/assertion/....