You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import-file route handler in packages/cli/src/daemon.ts pins documentIri: assertionUri when calling extractFromMarkdown. This causes all structural content triples (frontmatter properties, H1→schema:name, wikilinks, hashtags, dataview fields, section headings) to be emitted with the assertion UAL as their subject — regardless of whether the user supplied a frontmatter rootEntity override.
The result is a semantic mismatch: _meta row 14 (<assertionUal> dkg:rootEntity <urn:note:parent>) claims the assertion's root entity is urn:note:parent, but the actual content triples partition under <assertionUri> when assertionPromote runs — NOT under <urn:note:parent>. A SPARQL consumer querying "what content belongs to urn:note:parent?" finds nothing in SWM for assertions that were supposed to be about it.
This was flagged by Codex Review as Bug 10 on PR #121 (see #121 (comment) or whichever review link applies). It was deliberately deferred out of the PR #121 Round 4 scope because it's architectural — fixing it requires either:
Extractor rewrites content-triple subjects to resolvedRootEntity when frontmatter rootEntity is set. ~20 LOC in extractFromMarkdown, but has semantic hazards: if two assertions both claim rootEntity: urn:note:parent, they'd both write content triples on <urn:note:parent>, re-introducing the cross-assertion contention problem PR feat: source-file linkage triples + devnet hardening (chain onto PR #120) #121 Bug 8 just solved via the assertionPromote filter.
Remove the rootEntity override feature entirely. Drop frontmatter rootEntity precedence from buildSourceFileLinkage. Row 3/14 always = reflexive. Deletes a spec-defined feature (§19.10.1:508) but sidesteps the semantic question.
Document the current behavior as "rootEntity is a metadata HINT, not a content-retargeting". Row 14 in _meta is an annotation/backlink, not an authoritative partition statement. Zero code change beyond comments.
The Round 4 consensus (parked as a follow-up, not a decision) was that 10C — documenting the current behavior — is the smallest defensible path, and that 10A's semantic hazards around cross-assertion subject contention need a wider architectural discussion before we commit to a retargeting pipeline.
Related spec section: 19_MARKDOWN_CONTENT_TYPE.md §10.1 rows 3 and 14 (rootEntity); §19.10.1:508 promises the frontmatter override is honored.
Related code: packages/cli/src/extraction/markdown-extractor.tsresolveSubjectIri (line ~226) + buildSourceFileLinkage (line ~498); packages/cli/src/daemon.ts import-file route handler extractFromMarkdown call site with documentIri: assertionUri.
Acceptance criteria
Whichever option is chosen, the outcome should be that a user who sets frontmatter rootEntity: urn:note:parent on a document and then imports it gets either:
A consistent graph where content-triple subjects actually match _meta row 14 (Option 10A), or
Clear documentation that rootEntity is a hint, not a retargeting directive (Option 10C), or
A spec update that removes the promise in §19.10.1:508 (Option 10B).
Not blocking
This is tracking a known-deferred issue; the current PR #121 ships without fixing it. Users who hit the mismatch today can work around it by leaving rootEntity unset (the reflexive default is correct and consistent), or by accepting that the _meta annotation is informational.
Summary
The import-file route handler in
packages/cli/src/daemon.tspinsdocumentIri: assertionUriwhen callingextractFromMarkdown. This causes all structural content triples (frontmatter properties, H1→schema:name, wikilinks, hashtags, dataview fields, section headings) to be emitted with the assertion UAL as their subject — regardless of whether the user supplied a frontmatterrootEntityoverride.The result is a semantic mismatch:
_metarow 14 (<assertionUal> dkg:rootEntity <urn:note:parent>) claims the assertion's root entity isurn:note:parent, but the actual content triples partition under<assertionUri>whenassertionPromoteruns — NOT under<urn:note:parent>. A SPARQL consumer querying "what content belongs tourn:note:parent?" finds nothing in SWM for assertions that were supposed to be about it.This was flagged by Codex Review as Bug 10 on PR #121 (see #121 (comment) or whichever review link applies). It was deliberately deferred out of the PR #121 Round 4 scope because it's architectural — fixing it requires either:
Extractor rewrites content-triple subjects to
resolvedRootEntitywhen frontmatterrootEntityis set. ~20 LOC inextractFromMarkdown, but has semantic hazards: if two assertions both claimrootEntity: urn:note:parent, they'd both write content triples on<urn:note:parent>, re-introducing the cross-assertion contention problem PR feat: source-file linkage triples + devnet hardening (chain onto PR #120) #121 Bug 8 just solved via theassertionPromotefilter.Remove the
rootEntityoverride feature entirely. Drop frontmatterrootEntityprecedence frombuildSourceFileLinkage. Row 3/14 always = reflexive. Deletes a spec-defined feature (§19.10.1:508) but sidesteps the semantic question.Document the current behavior as "rootEntity is a metadata HINT, not a content-retargeting". Row 14 in
_metais an annotation/backlink, not an authoritative partition statement. Zero code change beyond comments.The Round 4 consensus (parked as a follow-up, not a decision) was that 10C — documenting the current behavior — is the smallest defensible path, and that 10A's semantic hazards around cross-assertion subject contention need a wider architectural discussion before we commit to a retargeting pipeline.
Context
19_MARKDOWN_CONTENT_TYPE.md §10.1rows 3 and 14 (rootEntity);§19.10.1:508promises the frontmatter override is honored.packages/cli/src/extraction/markdown-extractor.tsresolveSubjectIri(line ~226) +buildSourceFileLinkage(line ~498);packages/cli/src/daemon.tsimport-file route handlerextractFromMarkdowncall site withdocumentIri: assertionUri.Acceptance criteria
Whichever option is chosen, the outcome should be that a user who sets frontmatter
rootEntity: urn:note:parenton a document and then imports it gets either:_metarow 14 (Option 10A), orrootEntityis a hint, not a retargeting directive (Option 10C), orNot blocking
This is tracking a known-deferred issue; the current PR #121 ships without fixing it. Users who hit the mismatch today can work around it by leaving
rootEntityunset (the reflexive default is correct and consistent), or by accepting that the_metaannotation is informational.