Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/notes/wd.codebase-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Core owns portable Semantic Flow behavior: request/result types, RDF/Turtle help
- `src/core/weave` owns shared weave/version/generate contracts and planner helpers.
- `src/core/weave/inventory_append_planner.ts` prepares current inventory bytes and parsed default-graph quads as one opaque value, plans append/no-op/conflict outcomes, and renders planner-approved append facts through one shared compact renderer. The prepared current bytes remain the exact output prefix; a self-contained suffix-only proof checks rendered facts against `plan.missing`, avoiding a second parse of carried blank nodes. `knop.create` MeshInventory growth, FoundingReferentData settlement, current-only ReferenceCatalog and PageDefinition weave, current-shape extract and integrate, import source-registry insertion, first `knop add-reference` catalog registration, extracted-term versioned MeshInventory growth, and shared current-only payload-like page claims use the planner.
- `src/core/knop/add_reference.ts` retains its unwoven/current-only/versioned shape validation and known support-family consistency checks, but treats the shape renderer only as the requested ReferenceCatalog fact set. The original KnopInventory is the append planner's prepared input and exact output prefix, so unknown facts, comments, prefixes, and carried blank nodes survive; single-valued conflicts refuse before the runtime stages writes.
- `src/core/weave/mesh_inventory_renderers.ts` builds only the term, Knop, page, membership, and optional history/state facts owned by each migrated path, then appends them against the original MeshInventory. Versioned first-Knop weave, homogeneous extracted batches, versioned sequential extracted weave, and the shared current-only first-payload/extracted helper preserve carried bytes and graph. First-Knop weave rejects legacy inventory-owned mutable progression before planning instead of silently deleting or retaining it; current-only semantic no-ops return exact input bytes and create no history progression.
- `src/core/weave/mesh_inventory_renderers.ts` builds only the term, Knop, page, membership, and optional history/state facts owned by each migrated path, then appends them against the original MeshInventory. Versioned first-Knop weave, singular/delegated-batch versioned first-payload weave, homogeneous extracted batches, versioned sequential extracted weave, and the shared current-only first-payload/extracted helper preserve carried bytes and graph. Versioned first-Knop/first-payload weave rejects legacy inventory-owned mutable progression before planning; first-payload also rejects conflicting values or locator kinds. Current-only semantic no-ops return exact input bytes and create no history progression.
- `src/core/weave/mesh_support_pages.ts` keeps initial support-history construction separate. Initial versioned support history writes only settled artifact/history/state/manifestation membership into MeshInventory and writes current/latest/next progression for every versioned mesh-owned support artifact into MeshMetadata. Its no-initial-history page-only arm prepares the carried MeshInventory and appends only named support-page claims/types. Runtime ResourcePage history/raw-source assembly combines inventory structure with metadata progression. Exact page-claim duplicates produce no inventory update; comments, repeated blocks, opaque facts, trailing bytes, and carried blank nodes remain untouched prefix data.
- `src/core/weave/knop_inventory_renderers.ts` uses the same append path for current-only ReferenceCatalog and ResourcePageDefinition page claims. PageDefinition working-file validation is RDF-semantic rather than substring/block based, so unrelated mentions cannot hide a conflicting locator; exact duplicates return the original KnopInventory bytes.
- `src/core/extract/extract.ts` keeps its legacy-carried-shape renderer separate, but normal current-shape MeshInventory registration prepares and preserves the original bytes before appending only `_mesh` membership, Knop type/working-inventory, and inventory-file facts. Carried source-locator blank nodes remain prefix data and are not part of the named-node-only append request.
Expand Down
2 changes: 1 addition & 1 deletion documentation/notes/wd.todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Groomed on 2026-05-27 from all `wa.task.*` notes in the Weave archive. Updated a

- [ ] Keep Stagecraft's persisted roleplaying-data use case in view when prioritizing runtime work: prefer slices that improve stable identifiers, exact state citation, append-onlyish histories, source provenance, and generated inspection pages for ordinary application data.- [ ] Remove the remaining first-payload planner blockers from [[wa.task.2026.2026-05-04-refactor-planFirstPayloadWeave]]. Multi-pending first-payload weave shipped in `v0.7.0` (PR #33), extracted-term sets joined the batch path post-regroom (PR #41), and condition-specific diagnostics landed (PR #42). Still open: current-mode extracted-term weave, and the SFLO/URPX docs pass to drop the old failure-mode warnings.
- [ ] Implement append-onlyish inventory writes through [[wa.plan.2026.2026-05-17-append-onlyish-inventory]]: normal inventory operations append new settled facts, no-op existing facts, and fail closed on conflicts; current/latest/next progression belongs in metadata or explicit repair/regeneration/retraction modes. `planInventoryAppend` now has consistency-by-construction prepared current input and one exactness-checked shared append renderer; current-only ReferenceCatalog and PageDefinition, first/later `knop.create`, FoundingReferentData, import source-registry insertion, first `knop add-reference` catalog registration, extracted/current-only/versioned first-Knop MeshInventory weave growth, current-shape extract/integrate, and mesh-support page-only growth use it, while ResourcePage policy deletion is fixed. Mesh-support progression producers and affected fixture tails are corrected. The fresh audit cut [[wa.task.2026.2026-08-31_1905-versioned-first-payload-mesh-inventory-append]] next; payload/other KnopInventory writers and fixture/docs closure follow.
- [ ] In the next Weave release notes, call out the first-Knop MeshInventory output change from [[wa.completed.2026.2026-08-31_1111-versioned-first-knop-mesh-inventory-append]]: carried bytes/facts now survive as the exact prefix, stale inventory-owned progression refuses pending explicit repair, and the affected Alice live fixture refs were regenerated.
- [ ] In the next Weave release notes, call out the first-Knop and versioned first-payload MeshInventory output changes from [[wa.completed.2026.2026-08-31_1111-versioned-first-knop-mesh-inventory-append]] and [[wa.task.2026.2026-08-31_1905-versioned-first-payload-mesh-inventory-append]]: carried bytes/facts now survive as the exact prefix, stale inventory-owned progression and conflicting first-payload locator kinds refuse pending explicit repair, and the affected Alice live fixture refs were regenerated.
- [ ] Harden the shared append renderer against an internally mismatched prepared-inventory/plan pair, even though current production callers construct and pass the pair together and the final G1 review found no public reachability. Keep this separate from FoundingReferentData unless that work touches the renderer.
- [ ] Stop reusing one stateful N3 Parser across multiple planned Turtle files in import, integrate, version execution, and payload update validators; instantiate per document so `@base`/`@prefix` state cannot leak between files. Found by [[wa.review.2026-08-22_2303-stagecraft-phase1-g1-claude]], outside G1.
- [ ] Replace FoundingReferentData history progression's compact-`sflo:` regex rewrite with the shared subject-block/progression machinery or an equivalently representation-independent path, preserving fail-closed diagnostics for foreign-but-equivalent inventory serialization. Accepted as a non-landing G2 residual in [[wa.review.2026-08-23_0939-stagecraft-phase2-final-claude]].
Expand Down
7 changes: 5 additions & 2 deletions src/core/knop/create_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,12 @@ Deno.test(
"https://semantic-flow.github.io/sflo/ontology/hasKnop",
"_knop",
);
assertStringIncludes(
assertNamedNodeFact(
plan.updatedFiles[0]?.contents ?? "",
"sflo:hasHistoricalState <_mesh/_inventory/_history001/_s0005> ;",
"https://semantic-flow.github.io/mesh-alice-bio/",
"_mesh/_inventory/_history001",
"https://semantic-flow.github.io/sflo/ontology/hasHistoricalState",
"_mesh/_inventory/_history001/_s0005",
);
assertNamedNodeFact(
plan.updatedFiles[0]?.contents ?? "",
Expand Down
Loading