Skip to content

Next/v0.2.2#20

Merged
djradon merged 19 commits into
mainfrom
next/v0.2.2
May 28, 2026
Merged

Next/v0.2.2#20
djradon merged 19 commits into
mainfrom
next/v0.2.2

Conversation

@djradon

@djradon djradon commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Artifact resolution with content retrieval, digest validation, observed-resolution evidence; mesh-local and layered config-source discovery with recursive resolution, tracing, and deterministic precedence. Provider-based per-target/mesh effective-config flow; per-page presentation selection; "current-only" page-definition weaving; deterministic fixture snapshot cache for tests.
  • Tests

    • Expanded end-to-end and integration coverage for artifact resolution, effective-config discovery/precedence, page-generation, and fixture snapshot behavior.
  • Refactor

    • Unified resolver-based loading for pages/artifacts and provider-driven config plumbing; simplified test harness lifecycle.
  • Documentation

    • Expanded runtime docs, guidance, groomed backlog, and release notes.

Review Change Stack

djradon added 6 commits May 27, 2026 16:08
- Preserve original Deno test file locations by replacing the test temp Deno.test wrapper with native test hooks
- Keep per-file JUnit suites and testcase line/column metadata in the Codecov-normalized report
- Add regression coverage for preload JUnit location preservation
- add runtime ArtifactResolutionSpec request normalization and resolution APIs
- resolve direct local paths, governed working/latest/exact payload sources, and exact in-mesh located files under local path policy
- preserve requested versus observed coordinates and verify expected SHA-256 digests when bytes are read
- fail closed for unsupported remote, repository, fallback, manifestation, and conflicting locator shapes
- cover resolver behavior with focused runtime tests
Discover mesh-local sfcfg:hasConfigSource attachments from conventional mesh config and mesh metadata, resolve them through the shared artifact resolver under the active local path policy, and compile resolved Turtle as ordinary mesh-local inputs. Preserve fail-closed behavior for unsupported attachment subjects, cycles, digest mismatches, remote URLs, and denied local paths; earlier sources in a chain now win over later same-layer sources. Add focused unit coverage plus a runtime integration test for config-source supplied ResourcePage generation policy.
…e loading to the shared resolver in page_definition.ts.
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@djradon, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 34 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 30cfe4d8-8fba-4fbd-996c-4fe5274ac1d5

📥 Commits

Reviewing files that changed from the base of the PR and between 22319e3 and 3eb94fd.

📒 Files selected for processing (6)
  • documentation/notes/wd.todo.md
  • documentation/notes/wd.vision.md
  • src/core/knop/add_reference.ts
  • src/core/weave/inventory_append_planner.ts
  • src/core/weave/inventory_append_planner_test.ts
  • src/core/weave/knop_support_renderers_test.ts
📝 Walkthrough

Walkthrough

Adds a unified artifact-resolution subsystem and models; implements mesh-local and Knop layered config-source discovery using the resolver with resolutionTrace; threads discovered layered inputs into effective-config compilation with deterministic sourceOrder tie-breaking; exposes resolution evidence in inventories; refactors artifact loaders, page definition rendering, execution/provider wiring, fixture snapshotting, Knop inventory preservation, and many tests/docs.

Changes

Artifact resolution & config-source discovery

Layer / File(s) Summary
Models & basic types
src/runtime/artifact_resolution/models.ts
Defines artifact-resolution request/result/context types and content-mode/mode unions.
Resolver core: parsing, dispatch & IO
src/runtime/artifact_resolution/resolver.ts
Parses ArtifactResolutionSpec quads/Turtle, validates requests, dispatches locator strategies (direct, located-file, working/latest/historical via governed inventory), performs overlay-aware reads, digest computation/validation, and UTF-8 decoding; exposes ArtifactResolutionError kinds.
Resolver helpers & naming utilities
src/runtime/artifact_resolution/resolver.ts
RDF quad extraction, uniqueness enforcement, snapshot-path naming, request compaction, and expected-digest formatting/verification helpers.
Resolver tests & helpers
src/runtime/artifact_resolution/resolver_test.ts
End-to-end tests covering parsing, direct/local resolution, governed modes, digest checks, fallback semantics, and materialized payload helpers.
Mesh-local & Knop layered discovery
src/runtime/config/config_sources.ts
discoverMeshLocalConfigSources and discoverKnopConfigSources: extract attachments, recursively resolve artifacts (cycle/dedupe), produce MeshLocal/LayeredConfigInput and emit resolutionTrace entries.
Effective config compilation & tie-breaking
src/runtime/config/effective_config.ts
Accepts mesh/Knop layered inputs and aggregated resolutionTrace, threads sourceOrder into policy parsing, selects winners by layer then earliest sourceOrder, exposes EffectiveConfig.resolutionTrace, and validates Knop authority scope for exact targets.
Effective-config tests
src/runtime/config/effective_config_test.ts
Tests mesh-local discovery, chaining and precedence, rejection cases (invalid attachments, cycles, unsafe coords), Knop inheritance/precedence, and Knop-scope target validation.
Inventory: resolution request & observed evidence
src/runtime/mesh/inventory.ts, src/runtime/mesh/inventory_test.ts
Inventory resolvers now produce resolutionRequest and optional resolutionObservation (observed coordinates + observedAt) and translate into legacy flattened evidence for compatibility; tests updated.
Artifact loaders & page-definition refactor
src/runtime/weave/artifact_loaders.ts, src/runtime/weave/page_definition.ts, src/runtime/weave/page_definition_test.ts
Delegate extraction/historical/page-source resolution to artifact resolver (text mode for pages), remove legacy snapshot helpers, validate returned observed fields, and wrap resolver errors into domain errors; tests adapted for payload/state fixtures and fallback behavior.
Execution config provider & generation wiring
src/runtime/weave/execution_config.ts, src/runtime/weave/page_generation.ts, src/runtime/weave/version_execution.ts
Introduce EffectiveConfigProvider flows, allow mesh/metadata/localPathPolicy overrides, add loadKnopConfigScopePathForTarget, and thread per-target scoped configs into planning and page generation.
Page model assembly & per-page presentation
src/runtime/weave/page_model_assembly.ts, src/runtime/weave/pages.ts, src/runtime/weave/page_contexts.ts
collectResourcePageModels and rendering now use EffectiveConfigProvider; per-page async resourcePagePresentationForPage hook added and consumed during render; ownerDesignatorPath added to simple page models.
Current-only page-definition weaving
src/core/weave/*
Add renderer and page-builder for current-only ResourcePageDefinition, tighten detection logic, and add planWeave branch/tests for current-only flows.
Knop support renderers & inventory append planner
src/core/weave/knop_support_renderers.ts, src/core/weave/inventory_append_planner.ts
Refactor preservation into collect-carried-support-facts + planInventoryAppend append flow; add inventory append planner, rendering helpers, and tests for append/unchanged/conflict/preservation behaviors.
Fixture snapshot cache & fixture adapters
tests/support/fixture_snapshot.ts, tests/support/*_fixture.ts, tests
Introduce FixtureSnapshotCache to materialize and cache git-backed fixtures by commit; adapt fixture helpers to delegate and add tests for stability.
Test harness lifecycle & JUnit normalization
tests/support/test_tmp.ts, scripts/normalize-deno-junit.ts, tests
Switch test harness to Deno.test.beforeEach/afterEach isolated env lifecycle; refactor JUnit normalization to Map-based attribute handling and update tests/fixtures accordingly.
Docs & backlog grooming
documentation/notes/*
Document artifact-resolution and mesh-local config-source discovery; groom wd.todo and update backlog guidance and release notes.

Sequence Diagram (high-level resolver flow)

sequenceDiagram
  participant Caller
  participant Resolver
  participant Inventory
  participant FS
  Caller->>Resolver: ArtifactResolutionRequest (quads/spec)
  alt in-mesh/governed artifact
    Resolver->>Inventory: load _inventory/inventory.ttl
    Inventory-->>Resolver: artifact coordinates & history info
    Resolver->>FS: read overlay-first file bytes
  else direct local path or located-file IRI
    Resolver->>FS: read overlay-first local path
  end
  Resolver-->>Caller: ArtifactResolutionResult (observed coords + optional content)
Loading

Estimated code review effort:
🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs:

  • semantic-flow/weave#11: Related runtime artifact-backed ResourcePageDefinition resolution flow and page-definition wiring.
  • semantic-flow/weave#13: Overlaps in effective-config and config-resolution/inheritance infrastructure.
  • semantic-flow/weave#7: Prior RDF-based inventory parsing changes that this PR extends to expose resolution evidence.

"I dug a spec in moonlit code,
Found traces on the mesh's road.
I fetched the bytes, I traced the source,
And brought them home — a tidy course.
Hop, hop, the rabbit saved the node. 🐇"

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next/v0.2.2

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@documentation/notes/wd.general-guidance.md`:
- Line 54: Change the incorrect phrase "The backlogs is kept in [[wd.todo]]" to
correct subject-verb agreement by replacing it with "The backlog is kept in
[[wd.todo]]" so the sentence reads properly; update the line containing that
exact phrase in documentation/notes/wd.general-guidance.md (look for the string
"The backlogs is kept in [[wd.todo]]") and commit the corrected text.

In `@tests/integration/validate_version_generate_test.ts`:
- Around line 754-769: The test currently attaches sfcfg:hasConfigSource under
the _mesh resource inside the config Turtle written via writeMeshConfig, but
mesh-local source discovery expects that triple in mesh metadata
(meshMetadataTurtle / _mesh/_meta/meta.ttl). Move the sfcfg:hasConfigSource
block out of the config Turtle and into the mesh metadata Turtle (the content
written to _mesh/_meta/meta.ttl / meshMetadataTurtle) so the test validates
metadata-based discovery; update the test so writeMeshConfig remains for
config.ttl and the mesh metadata writer (or the meshMetadataTurtle string)
contains the _mesh a sflo:SemanticMesh ; sfcfg:hasConfigSource [...] statement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 129e1c8d-0d7b-44da-b364-74647e49c839

📥 Commits

Reviewing files that changed from the base of the PR and between c5cece4 and 8c0c3c2.

📒 Files selected for processing (21)
  • documentation/notes/wd.codebase-overview.md
  • documentation/notes/wd.general-guidance.md
  • documentation/notes/wd.todo.md
  • scripts/normalize-deno-junit.ts
  • src/runtime/artifact_resolution/models.ts
  • src/runtime/artifact_resolution/resolver.ts
  • src/runtime/artifact_resolution/resolver_test.ts
  • src/runtime/config/config_sources.ts
  • src/runtime/config/effective_config.ts
  • src/runtime/config/effective_config_test.ts
  • src/runtime/mesh/inventory.ts
  • src/runtime/mesh/inventory_test.ts
  • src/runtime/weave/artifact_loaders.ts
  • src/runtime/weave/execution_config.ts
  • src/runtime/weave/page_definition.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/weave/version_execution.ts
  • tests/integration/validate_version_generate_test.ts
  • tests/scripts/normalize_deno_junit_test.ts
  • tests/support/test_tmp.ts
  • tests/support/test_tmp_test.ts

Comment thread documentation/notes/wd.general-guidance.md Outdated
Comment thread tests/integration/validate_version_generate_test.ts
djradon added 3 commits May 27, 2026 20:03
- discover Knop-local and inheritable config-source attachments from current Knop metadata
- project inherited sources through the shared config inheritance helper
- layer Knop config into effective config precedence with local > inherited > mesh-local
- wire single-target version/generate execution to load Knop scope metadata
- add fail-closed and runtime integration coverage
…gSource triple into _mesh/_meta/meta.ttl; writeMeshConfig() now only writes the ordinary mesh config in validate_version_generate_test.ts (line 64).
- add runtime EffectiveConfigProvider for mesh/global and target scopes
- derive version planner policies from mesh versus target configs by artifact ownership
- render ResourcePages with per-page presentation config
- preserve mesh-inventory page candidates during owner-scoped page assembly
- reject Knop exact-artifact policy targets outside their authority scope
- cover mesh-owned history isolation and multi-target presentation rendering

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/runtime/weave/page_generation.ts`:
- Around line 186-225: The function ownerDesignatorPathForPage is reconstructing
a designator from page.path (handling _knop and _history) which causes wrong
results for simple pages; instead, use the owning designator already threaded
into the page model: for non-mesh pages return page.ownerDesignatorPath (or
page.designatorPath for kinds that already use it like
identifier/customIdentifier/knop) and stop inferring from page.path in
ownerDesignatorPathForPage; leave the existing special-case branches only if
page.ownerDesignatorPath is undefined as a strict fallback, and ensure
resourcePagePresentationForTarget consumes the ownerDesignatorPath value rather
than any path-derived value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8f372e97-e268-48a1-b0b3-1ef74de3017a

📥 Commits

Reviewing files that changed from the base of the PR and between 8c0c3c2 and c0a737e.

📒 Files selected for processing (12)
  • documentation/notes/wd.general-guidance.md
  • documentation/notes/wd.todo.md
  • src/runtime/config/config_sources.ts
  • src/runtime/config/effective_config.ts
  • src/runtime/config/effective_config_test.ts
  • src/runtime/weave/execution_config.ts
  • src/runtime/weave/page_contexts.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/weave/page_model_assembly.ts
  • src/runtime/weave/pages.ts
  • src/runtime/weave/version_execution.ts
  • tests/integration/validate_version_generate_test.ts
✅ Files skipped from review due to trivial changes (2)
  • documentation/notes/wd.general-guidance.md
  • documentation/notes/wd.todo.md

Comment thread src/runtime/weave/page_generation.ts Outdated
djradon added 3 commits May 27, 2026 22:55
- add graph-aware ArtifactResolutionSpec resolution with one explicit fallback spec
- classify resolver failures so fallback only runs for unavailable exact/latest payload sources
- route artifact-backed ResourcePageSource loading through the shared resolver
- preserve fail-closed handling for local helper broadening, direct URLs, unsupported locators, validation failures, and digest mismatches
- add focused resolver and page-definition tests for exact state, fallback, diagnostics, and rejection paths
- update the Weave backlog note for the completed ResourcePageSource slice
- route ResourcePageDefinition history policy into page-definition weave planning
- render current-only _knop/_page from working page.ttl without minting _history001
- stop re-detecting settled current-only page definitions as pending weave slices
- add tests for current-only page-definition planning and custom page loading
- add a shared fixture snapshot cache keyed by fixture repo and resolved commit
- convert Alice Bio, Sidecar Fantasy Rules, and Branch Fantasy Rules materializers to copy from snapshots
- add focused snapshot cache tests and record smoke results in the optimization task note

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/runtime/weave/page_definition.ts (1)

239-290: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Delegate all supported page-source locators to the resolver.

This code still hand-loads targetLocalRelativePath and hard-rejects targetLocatedFile, so ResourcePageDefinition regions bypass resolveArtifactResolutionSpecQuads() for two resolver-supported cases. That means direct local sources never honor expectsContentDigest/fallback semantics here, and exact in-mesh targetLocatedFile sources are still unusable from page definitions.

Also applies to: 301-309

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/weave/page_definition.ts` around lines 239 - 290, The code
bypasses the resolver for targetLocalRelativePath and rejects targetLocatedFile;
change the logic so both single-entry targetLocalRelativePaths and any
targetLocatedFile cases delegate to resolveArtifactResolutionSpecQuads() instead
of directly calling normalizeTargetLocalRelativePath/readAllowedSourceText or
throwing; specifically, in the branch that currently handles
targetLocalRelativePaths (symbols: targetLocalRelativePaths,
normalizeTargetLocalRelativePath, readAllowedSourceText) call
resolveArtifactResolutionSpecQuads(designatorPath, regionSpec,
artifactResolutionModes, artifactResolutionFallbackSpecs,
requestedTargetHistories, requestedTargetStates, ...) to obtain a resolved
artifact spec and then honor expectsContentDigest/fallback semantics when
loading content, and remove the hard throw for targetLocatedFile so that
resolveArtifactResolutionSpecQuads() is used for targetLocatedFile resolution as
well (symbols: targetLocatedFile, resolveArtifactResolutionSpecQuads,
expectsContentDigest, artifactResolutionFallbackSpecs).
src/runtime/artifact_resolution/resolver.ts (1)

910-925: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate the latestHistoricalState node type before resolving it.

resolvePayloadExactState() now rejects states that are not typed as sflo:HistoricalState, but the latest-state path still skips that check. A malformed inventory can therefore resolve in latestState mode and fail in exact-state mode for the same state.

Proposed fix
   const stateIri = requiredNamedNodeObject(
     inventory.quads,
     historyIri,
     SFLO_LATEST_HISTORICAL_STATE_IRI,
     `${
       describeRequest(request)
     } requests latest-state resolution for ${inventory.target.artifactPath}, but ${historyPath} has no latestHistoricalState.`,
     "unavailable",
   );
+  const statePath = requireMeshPathFromIri(
+    meshBase,
+    stateIri,
+    `${describeRequest(request)} resolved state outside the mesh: ${stateIri}.`,
+  );
+  assertTypedHistoricalState(inventory.quads, stateIri, statePath, request);
   return resolvePayloadStateSnapshot(
     meshBase,
     inventory,
     request,
     historyPath,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/artifact_resolution/resolver.ts` around lines 910 - 925, The code
returns stateIri from requiredNamedNodeObject and immediately calls
resolvePayloadStateSnapshot without verifying the node is typed as
sflo:HistoricalState, allowing malformed inventories to succeed in latest-state
mode but fail in exact-state mode; add the same type validation used by
resolvePayloadExactState before calling resolvePayloadStateSnapshot: after
obtaining stateIri, assert the quad/triple exists that types stateIri as
sflo:HistoricalState (use the existing helper that checks types - e.g.,
requiredTypeTriple/requiredTypeObject or similar validation used by
resolvePayloadExactState), and if missing throw the same "unavailable" error
message (or the same descriptive message pattern used for other failures) so
latest-state resolution rejects non-HistoricalState nodes consistently with
resolvePayloadExactState.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/support/fixture_snapshot.ts`:
- Around line 205-214: The snapshot reads use the mutable ref resolved.gitRef
causing potential cache/content mismatches; update the methods that call git
(notably `#listGitTree` and the git show usage in `#buildSnapshot`) to pass the
resolved commit SHA (e.g., resolved.commitSha) instead of resolved.gitRef so
ls-tree and git show read the exact commit used as the cache key; ensure any
other git invocations in the same file (the git show block around the other diff
region) are changed the same way.

---

Outside diff comments:
In `@src/runtime/artifact_resolution/resolver.ts`:
- Around line 910-925: The code returns stateIri from requiredNamedNodeObject
and immediately calls resolvePayloadStateSnapshot without verifying the node is
typed as sflo:HistoricalState, allowing malformed inventories to succeed in
latest-state mode but fail in exact-state mode; add the same type validation
used by resolvePayloadExactState before calling resolvePayloadStateSnapshot:
after obtaining stateIri, assert the quad/triple exists that types stateIri as
sflo:HistoricalState (use the existing helper that checks types - e.g.,
requiredTypeTriple/requiredTypeObject or similar validation used by
resolvePayloadExactState), and if missing throw the same "unavailable" error
message (or the same descriptive message pattern used for other failures) so
latest-state resolution rejects non-HistoricalState nodes consistently with
resolvePayloadExactState.

In `@src/runtime/weave/page_definition.ts`:
- Around line 239-290: The code bypasses the resolver for
targetLocalRelativePath and rejects targetLocatedFile; change the logic so both
single-entry targetLocalRelativePaths and any targetLocatedFile cases delegate
to resolveArtifactResolutionSpecQuads() instead of directly calling
normalizeTargetLocalRelativePath/readAllowedSourceText or throwing;
specifically, in the branch that currently handles targetLocalRelativePaths
(symbols: targetLocalRelativePaths, normalizeTargetLocalRelativePath,
readAllowedSourceText) call resolveArtifactResolutionSpecQuads(designatorPath,
regionSpec, artifactResolutionModes, artifactResolutionFallbackSpecs,
requestedTargetHistories, requestedTargetStates, ...) to obtain a resolved
artifact spec and then honor expectsContentDigest/fallback semantics when
loading content, and remove the hard throw for targetLocatedFile so that
resolveArtifactResolutionSpecQuads() is used for targetLocatedFile resolution as
well (symbols: targetLocatedFile, resolveArtifactResolutionSpecQuads,
expectsContentDigest, artifactResolutionFallbackSpecs).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1d340f1c-7a0f-47e1-92cb-25cef35146bd

📥 Commits

Reviewing files that changed from the base of the PR and between c0a737e and fb696e9.

📒 Files selected for processing (25)
  • documentation/notes/wd.todo.md
  • src/core/weave/knop_inventory_renderers.ts
  • src/core/weave/resource_page_builders.ts
  • src/core/weave/slice_classification.ts
  • src/core/weave/weave.ts
  • src/core/weave/weave_test.ts
  • src/runtime/artifact_resolution/resolver.ts
  • src/runtime/artifact_resolution/resolver_test.ts
  • src/runtime/config/config_sources.ts
  • src/runtime/config/effective_config.ts
  • src/runtime/config/effective_config_test.ts
  • src/runtime/weave/execution_config.ts
  • src/runtime/weave/page_contexts.ts
  • src/runtime/weave/page_definition.ts
  • src/runtime/weave/page_definition_test.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/weave/page_model_assembly.ts
  • src/runtime/weave/pages.ts
  • src/runtime/weave/version_execution.ts
  • tests/integration/validate_version_generate_test.ts
  • tests/support/fixture_snapshot.ts
  • tests/support/fixture_snapshot_test.ts
  • tests/support/mesh_alice_bio_fixture.ts
  • tests/support/mesh_branch_fantasy_rules_fixture.ts
  • tests/support/mesh_sidecar_fantasy_rules_fixture.ts
✅ Files skipped from review due to trivial changes (1)
  • documentation/notes/wd.todo.md
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/runtime/weave/page_contexts.ts
  • src/runtime/weave/pages.ts
  • src/runtime/weave/page_model_assembly.ts
  • src/runtime/config/effective_config_test.ts
  • src/runtime/weave/version_execution.ts
  • src/runtime/config/effective_config.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/config/config_sources.ts
  • src/runtime/weave/execution_config.ts

Comment thread tests/support/fixture_snapshot.ts
djradon added 6 commits May 27, 2026 23:32
- introduce planInventoryAppend for append/no-op/conflict inventory planning
- compare current and requested Turtle semantically using RDF parsing
- append only missing settled facts while preserving existing inventory bytes
- fail closed on caller-declared single-valued predicate conflicts
- add focused unit coverage for duplicate no-op, append, conflict, and unknown triple preservation
- route carried source-registry and reference-catalog preservation through the RDF append planner
- append only missing Knop support-link facts instead of rewriting the Knop block
- preserve absent carried support blocks byte-for-byte when they do not contain mutable progression
- fail closed on single-valued support fact conflicts
- add focused unit coverage for semantic no-op, append, conflict, coexistence, and byte preservation
- replace add-reference source preservation block surgery with the shared support preservation helper
- preserve carried source-registry blocks and unknown facts through planner-backed append decisions
- keep Knop support links as appended RDF facts instead of rewriting the Knop subject block
- add focused regressions for source preservation and conflicting source registry facts
- pin fixture snapshot extraction to resolved commit SHAs
- validate latestHistoricalState nodes as HistoricalState
- thread owner designator paths through simple page models
- add focused regression coverage
- bump root version metadata
- update release notes
- verify source quality gate
Render carried Knop support facts with sflo prefixes and mesh-local relative IRIs
instead of absolute predicate/object IRIs. Provide parser directives when those
compact snippets are fed through the append planner, and cover the extraction
source-reference path that exposed the formatting regression.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/core/knop/add_reference.ts (1)

299-310: ⚡ Quick win

Only remap expected validation failures here.

This converts every Error from renderKnopInventoryWithPreservedSupportArtifacts() into KnopAddReferenceInputError, so renderer bugs become indistinguishable from bad input and lose their original stack. Catch the expected input/shape error type specifically and rethrow everything else unchanged.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/knop/add_reference.ts` around lines 299 - 310, The catch currently
converts any Error from renderKnopInventoryWithPreservedSupportArtifacts into
KnopAddReferenceInputError; instead, import/identify the specific
validation/input-shape error type that the renderer throws (the exact class/name
used by renderKnopInventoryWithPreservedSupportArtifacts) and only remap that
type to KnopAddReferenceInputError, leaving all other errors rethrown unchanged
so renderer bugs keep their original stack and type; update the catch to check
instanceof (or a type guard/error.name match) against the renderer's validation
error class and throw new KnopAddReferenceInputError(error.message) only in that
case, otherwise rethrow the original error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/weave/inventory_append_planner.ts`:
- Around line 85-115: The planner currently only checks conflicts against
currentBySubjectPredicate; add detection of divergent requestedFacts for the
same slot by tracking previously seen requested objects keyed by
toSubjectPredicateKey(requestedQuad) (e.g., a requestedSeen map); for each
requestedFact, if requestedSeen has the slot and rdfTermsEqual(existingObject,
requestedQuad.object) is false, push a conflict entry (use
requestedFact.summary, toFactSummary for existing, predicate from
requestedQuad.predicate.value, and formatConflictMessage) and continue;
otherwise store the object in requestedSeen and proceed with the existing
current/inventory checks (currentKeys, alreadyPresent, missing) as before.

In `@src/core/weave/knop_support_renderers_test.ts`:
- Around line 184-197: The test renderKnopInventoryWithPreservedSupportArtifacts
currently asserts on the emitted text which can miss leaked progression facts
serialized under different prefixes; change the assertions to parse the Turtle
output into RDF quads and assert semantically that the predicate IRIs for the
progression facts (e.g., the full IRIs corresponding to
sflo:currentArtifactHistory and sflo:nextHistoryOrdinal) are not present. In the
test that calls renderKnopInventoryWithPreservedSupportArtifacts, use the
project’s Turtle/RDF parser (or an N3/rdflib parser available in the repo) to
convert output into quads and then check that no quad has predicate equals the
exact progression IRIs; keep the same inputs (inventoryWithSupportFacts,
meshBase, knopPath) and replace the string-based
assertFalse(output.includes(...)) checks with quad-level absence assertions for
those predicate IRIs.

---

Nitpick comments:
In `@src/core/knop/add_reference.ts`:
- Around line 299-310: The catch currently converts any Error from
renderKnopInventoryWithPreservedSupportArtifacts into
KnopAddReferenceInputError; instead, import/identify the specific
validation/input-shape error type that the renderer throws (the exact class/name
used by renderKnopInventoryWithPreservedSupportArtifacts) and only remap that
type to KnopAddReferenceInputError, leaving all other errors rethrown unchanged
so renderer bugs keep their original stack and type; update the catch to check
instanceof (or a type guard/error.name match) against the renderer's validation
error class and throw new KnopAddReferenceInputError(error.message) only in that
case, otherwise rethrow the original error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6cef813c-7f70-466e-a61b-aa3b675ae22b

📥 Commits

Reviewing files that changed from the base of the PR and between fb696e9 and 22319e3.

📒 Files selected for processing (24)
  • AGENTS.md
  • deno.json
  • documentation/notes/release-notes.v0.2.2.md
  • documentation/notes/wd.release-runbook.md
  • documentation/notes/wd.runtime.md
  • documentation/notes/wd.testing.md
  • documentation/notes/wd.todo.md
  • documentation/notes/wu.cli-reference.md
  • src/core/knop/add_reference.ts
  • src/core/knop/add_reference_test.ts
  • src/core/weave/inventory_append_planner.ts
  • src/core/weave/inventory_append_planner_test.ts
  • src/core/weave/knop_support_renderers.ts
  • src/core/weave/knop_support_renderers_test.ts
  • src/core/weave/mod.ts
  • src/core/weave/resource_page_models.ts
  • src/runtime/artifact_resolution/resolver.ts
  • src/runtime/artifact_resolution/resolver_test.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/weave/page_generation_test.ts
  • src/runtime/weave/page_model_assembly.ts
  • tests/integration/extract_test.ts
  • tests/support/fixture_snapshot.ts
  • tests/support/fixture_snapshot_test.ts
✅ Files skipped from review due to trivial changes (7)
  • src/core/weave/mod.ts
  • AGENTS.md
  • documentation/notes/release-notes.v0.2.2.md
  • documentation/notes/wu.cli-reference.md
  • documentation/notes/wd.release-runbook.md
  • documentation/notes/wd.runtime.md
  • documentation/notes/wd.todo.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/runtime/weave/page_model_assembly.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/artifact_resolution/resolver_test.ts
  • tests/support/fixture_snapshot.ts
  • src/runtime/artifact_resolution/resolver.ts

Comment thread src/core/weave/inventory_append_planner.ts
Comment thread src/core/weave/knop_support_renderers_test.ts
- detect divergent requested objects for declared single-valued inventory slots
- preserve multi-valued requested predicate behavior
- assert Knop support progression omissions semantically
- narrow knop add-reference renderer error remapping
@djradon djradon merged commit 4cd56d3 into main May 28, 2026
5 of 6 checks passed
@djradon djradon deleted the next/v0.2.2 branch May 28, 2026 07:50
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