Skip to content

fix(weave): do not compact mesh IRIs into invalid sflo: prefixed names - #35

Merged
djradon merged 1 commit into
mainfrom
lane/sflo-namespace-collision
Aug 2, 2026
Merged

fix(weave): do not compact mesh IRIs into invalid sflo: prefixed names#35
djradon merged 1 commit into
mainfrom
lane/sflo-namespace-collision

Conversation

@djradon

@djradon djradon commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Found by dogfooding: the sflo published-mesh regeneration (wa.task.2026.2026-08-01_2032-regenerate-sflo-published-mesh) could not weave a single payload.

The defect

The sflo mesh is published at https://semantic-flow.github.io/sflo/ and its ontology payload sits at the ontology/ designator — so its own mesh resources have IRIs like https://semantic-flow.github.io/sflo/ontology/_knop/_sources. That prefix is also SFLO_NAMESPACE, the vocabulary namespace.

renderNamedNodeTerm compacted those mesh resources to sflo:_knop/_sources. A Turtle prefixed name's local part may not contain /, so the carried support facts Weave had just rendered failed to re-parse:

=== FAILED TURTLE ===
@prefix sflo: <https://semantic-flow.github.io/sflo/ontology/> .

sflo:_knop sflo:hasKnopSourceRegistry sflo:_knop/_sources .
...
=== N3 ERROR: Unexpected "sflo:_knop/_sources" on line 3.

Every weave of that mesh refused with Could not parse carried Knop support facts Turtle. sflo is plausibly the only affected mesh, because it is the one that self-hosts the vocabulary it is published under — which is likely why its current gh-pages state is a commit literally titled "lovely manual re-creation".

The fix

Compact to sflo: only when the remaining local name contains no /; otherwise fall through to the existing mesh-relative or absolute IRI form. Deliberately surgical: no other mesh's generated bytes change, so there is no fixture churn.

Evidence

  • Fail-on-old recorded: the new regression fails against the unmodified renderer (0 passed | 1 failed) and passes with the fix.
  • The regression asserts the carried facts re-parse and that no emitted prefixed name has a separator in its local part.
  • Full deno task ci and deno task build:npm-lib green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LHrFYeUefDr227gLuWWuq1

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Turtle rendering for SFLO IRIs whose local names contain path separators.
    • Preserved support-fact data and source registry paths when using the SFLO vocabulary namespace.
    • Ensured generated Turtle remains valid and can be parsed successfully.

A mesh published under the SFLO vocabulary namespace — the sflo mesh
itself, at https://semantic-flow.github.io/sflo/ with its ontology
payload at the `ontology/` designator — has resources whose IRIs begin
with the vocabulary namespace, e.g.
<https://semantic-flow.github.io/sflo/ontology/_knop/_sources>.

renderNamedNodeTerm compacted those to `sflo:_knop/_sources`. A Turtle
prefixed name's local part may not contain `/`, so the carried support
facts Weave had just rendered failed to re-parse, and every weave of
that mesh refused with "Could not parse carried Knop support facts
Turtle." Found by dogfooding the sflo published-mesh regeneration.

- compact to `sflo:` only when the local name has no path separator;
  otherwise fall through to the existing mesh-relative or absolute IRI
  form, so no other mesh's output changes
- regression: carried support facts for a mesh at the vocabulary
  namespace must re-parse and must contain no prefixed name whose local
  part carries a separator; fail-on-old recorded (the test fails
  against the unmodified renderer)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHrFYeUefDr227gLuWWuq1
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 19d08dcc-3116-4803-9a7f-f444c227eb6f

📥 Commits

Reviewing files that changed from the base of the PR and between e9503b1 and 54ba663.

📒 Files selected for processing (2)
  • src/core/weave/knop_support_renderers.ts
  • src/core/weave/knop_support_renderers_test.ts

📝 Walkthrough

Walkthrough

The renderer now avoids invalid sflo: prefixed names when SFLO local names contain /. Such IRIs use relative or absolute rendering. A regression test verifies Turtle re-parsing and support-source preservation.

Changes

SFLO IRI Rendering

Layer / File(s) Summary
Renderer fallback and regression coverage
src/core/weave/knop_support_renderers.ts, src/core/weave/knop_support_renderers_test.ts
renderNamedNodeTerm falls back from sflo: rendering for slash-containing local names. The regression test validates parsed Turtle output, rejects invalid prefixed names, and confirms the _knop/_sources path remains present.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary fix for invalid sflo: prefixed names caused by mesh IRI compaction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lane/sflo-namespace-collision

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@djradon
djradon merged commit 2f04b71 into main Aug 2, 2026
7 checks passed
@djradon
djradon deleted the lane/sflo-namespace-collision branch August 2, 2026 05:13
@djradon djradon mentioned this pull request Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant