Skip to content

Next/v0.3.0#21

Merged
djradon merged 8 commits into
mainfrom
next/v0.3.0
Jul 6, 2026
Merged

Next/v0.3.0#21
djradon merged 8 commits into
mainfrom
next/v0.3.0

Conversation

@djradon

@djradon djradon commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

v0.3.0 is a planner-generalization release driven by Stagecraft, Weave's first application-shaped consumer. Later-payload advancement is now derived from current RDF facts instead of carried fixture shapes, so application meshes can advance _s0003 and later payload states with current-only support artifacts. The release adds deterministic multi-target payload batches with pre-write input snapshot verification, a --generated-at flag for pinned ResourcePage timestamps, and service-integration documentation for applications that drive Weave programmatically.

Summary by CodeRabbit

  • New Features

    • Added a --generated-at option to pin generated page timestamps.
    • Added support for batching multiple exact payload targets in a single run.
    • Improved handling of later payload progression, including more deterministic updates.
  • Bug Fixes

    • Reduced unnecessary rewrites for timestamp-only page differences.
    • Added stronger validation to fail fast on inconsistent payload inputs.
  • Documentation

    • Updated CLI and release documentation with the new behavior and examples.
  • Tests

    • Expanded end-to-end and integration coverage for timestamp pinning and batched payload workflows.

djradon added 7 commits May 28, 2026 07:43
- set DENO_DIR in the test tmp harness so child deno run commands reuse a stable /tmp cache
- cover the harness env behavior and document the cache path
- record the e2e and full-suite timing improvement

docs: vision
- document Accord as a transition checker rather than a Weave executor
- record ResourcePage expectations for woven fixture rungs
- replace fixture main reset guidance with merge-based accepted-rung provenance
Add a later-payload read model that derives current history, latest state, next ordinal, support policy, and KnopInventory progression from current RDF facts.

Classify later ordinal payload candidates without second-state fixture hints, render computed later payload and inventory state paths, and keep exact targets narrow.

Add Stagecraft-shaped planner/runtime coverage, condition-specific diagnostics, and the top-level sparqljs import mapping needed by Accord-backed fixture-ladder tests.
- rename generalized later-payload slice symbols from second-payload terminology
- remove the unused second-payload inventory shape assertion
- preserve state/manifestation block ordering in generalized later-payload inventory rendering
- mark Accord acceptance follow-up complete in developer notes
- plan explicit payload targets together in canonical designator-path order with merged shared inventory progression and no-op reruns

- add scoped working-payload-file snapshot verification around batch capture with fail-closed diagnostics

- add --generated-at to full weave and generate, canonicalizing ISO instants and forcing explicit footer timestamp convergence

- document the new CLI surface, app-owned atomicity boundary, and hash-scope decision

- tests: deno task test; deno task lint
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a1fbcf12-7978-48e7-a4b5-ff0b0ce97fc5

📥 Commits

Reviewing files that changed from the base of the PR and between b07f389 and e44fe7b.

📒 Files selected for processing (9)
  • documentation/notes/wd.todo.md
  • src/cli/generated_at.ts
  • src/cli/generated_at_test.ts
  • src/cli/run.ts
  • src/core/import/import.ts
  • src/core/weave/payload_version_layout.ts
  • src/core/weave/payload_weave_read_model.ts
  • src/core/weave/rdf_helpers.ts
  • src/runtime/weave/version_execution.ts
📝 Walkthrough

Walkthrough

This PR generalizes payload weaving from a fixed "second payload" slice to an RDF-fact-driven "later payload" progression with deterministic multi-target batching and pre-write snapshot verification, adds a --generated-at CLI flag for pinning ResourcePage footer timestamps, introduces a conflict-detecting Knop source registry inventory append planner, updates test-harness DENO_DIR isolation, and refreshes documentation.

Changes

Later Payload Weave Generalization, Batching & Snapshot Verification

Layer / File(s) Summary
Slice rename and shape cleanup
src/core/weave/slices.ts, src/core/weave/slice_classification.ts, src/core/weave/shape_assertions.ts, src/core/weave/artifact_history_queries.ts
"secondPayloadWeave" is renamed to "laterPayloadWeave" across slice detection/classification; obsolete second-payload shape assertion removed; current-state resolution now uses diagnostics-aware error messages.
Version layout resolver and read model
src/core/weave/payload_version_layout.ts, src/core/weave/payload_weave_read_model.ts
Renames the resolver to resolveLaterPayloadVersionLayout with targeted diagnostics; adds resolveLaterPayloadWeaveReadModel deriving history/progression state from current RDF facts.
Rendering path
src/core/weave/payload_renderers.ts, src/core/weave/mesh_inventory_renderers.ts, src/core/weave/resource_page_builders.ts
Combines state+manifestation Turtle blocks with blank-line normalization; adds a batched first-payload mesh inventory renderer and buildLaterPayloadWeavePages.
Batch orchestration
src/core/weave/weave.ts, src/runtime/weave/candidate_loader.ts
Adds planExplicitPayloadBatchWeave for multi-target batching with merge/conflict checks; routes the payload slice to planLaterPayloadWeave; extends candidate loading with includeSettledPayloadTargets.
Input snapshot verification
src/runtime/weave/version_execution.ts, src/runtime/weave/prepared_execution.ts, src/runtime/weave/weave.ts
Adds InputSnapshotVerificationHooks and payload working-file hashing/re-verification around explicit batch capture, wired through the execution pipeline.
Tests
src/core/weave/weave_test.ts, tests/integration/weave_test.ts
Adds/updates fixtures and tests for later-payload ordinal advancement, batching determinism, and snapshot-verification failures.
Batching documentation
documentation/notes/wu.cli-reference.target-syntax.md, documentation/notes/wu.cli-reference.version.md
Documents canonical batch ordering and pre/post capture verification semantics.

--generated-at Timestamp Flag

Layer / File(s) Summary
CLI parsing/wiring
src/cli/run.ts
Adds ISO-8601 instant parsing/validation and wires --generated-at into weave and generate subcommands.
Timestamp-only write behavior
src/runtime/weave/page_generation.ts, src/runtime/weave/weave.ts
Adds updateTimestampOnlyPages option to allow writing footer-only timestamp differences instead of always skipping them.
Tests and docs
tests/e2e/weave_cli_test.ts, documentation/notes/wu.cli-reference.generate.md, documentation/notes/wu.cli-reference.weave.md
Adds e2e coverage for stamping, byte-identical output across offsets, invalid-instant rejection; updates CLI reference docs.

Knop Source Registry Inventory Append Planner

Layer / File(s) Summary
Append planner and tests
src/core/import/import.ts, src/core/import/import_test.ts
Adds planImportInventoryAppend/appendTurtleBlock using planInventoryAppend with a predicate allowlist; throws ImportInputError on conflicts; adds append/conflict tests.

Test Harness DENO_DIR Isolation

Layer / File(s) Summary
DENO_DIR isolation
tests/support/test_tmp.ts, tests/support/test_tmp_test.ts
Adds testDenoDir constant, isolates DENO_DIR per test, and adds a test verifying subprocess behavior.

Project Documentation and Release Notes

Layer / File(s) Summary
Release notes and planning
deno.json, documentation/notes/release-notes.v0.3.0.md, documentation/notes/wd.decision-log.md, documentation/notes/wd.codebase-overview.md, documentation/notes/wd.todo.md
Bumps version, adds sparqljs import, adds v0.3.0 release notes/decision log entries, and backlog updates.
Testing playbook and vision docs
documentation/notes/wd.testing.fixture-ladder-regeneration.md, documentation/notes/wd.testing.md, documentation/notes/wd.vision.md, documentation/notes/wu.repository-options.md
Updates fixture-ladder and testing guidance, rewrites vision description, adds application-managed mesh option.
weave integrate docs
documentation/notes/wu.cli-reference.integrate.md, documentation/notes/wu.cli-reference.md
Clarifies --source-repository-url/--source-repository-current behavior.

Estimated code review effort: 5 (Critical) | ~150 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant planWeave
  participant planExplicitPayloadBatchWeave
  participant version_execution as prepareVersionExecution
  participant Snapshot as PayloadBatchWorkingFileSnapshot
  CLI->>planWeave: multiple --target payload requests
  planWeave->>planExplicitPayloadBatchWeave: build ordered batch entries
  version_execution->>Snapshot: hash working payload files
  Snapshot-->>version_execution: afterInitialHash()
  version_execution->>Snapshot: verify() after candidate loading
  Snapshot-->>version_execution: afterVerifiedCapture() or reject
  planExplicitPayloadBatchWeave-->>planWeave: merged files/pages
  planWeave-->>CLI: batched plan or fail-closed error
Loading
sequenceDiagram
  participant CLI
  participant resolveGeneratedAtOption
  participant executeWeave
  participant generatePreparedPages
  CLI->>resolveGeneratedAtOption: parse --generated-at
  resolveGeneratedAtOption-->>CLI: {iso, now()}
  CLI->>executeWeave: now, updateTimestampOnlyPages=true
  executeWeave->>generatePreparedPages: updateTimestampOnlyPages
  generatePreparedPages-->>executeWeave: pages written with pinned timestamp
Loading

Possibly related PRs

  • semantic-flow/weave#5: Implements the original "second payload weave" slice logic that this PR replaces with the generalized "later payload weave" slice.
  • semantic-flow/weave#7: Refactors slice detection and planWeave logic in src/core/weave/weave.ts, overlapping the same weave planning/slicing code paths modified here.
  • semantic-flow/weave#9: Modifies prepareVersionExecution's target-handling contract, overlapping the same runtime execution seam extended here with snapshot verification hooks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too generic and version-only, so it does not clearly summarize the main changes in the release. Rename it to mention the primary change, such as later-payload generalization, batch planning, or the v0.3.0 release theme.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next/v0.3.0

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.

@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

🧹 Nitpick comments (4)
src/core/weave/payload_version_layout.ts (1)

437-481: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Third near-duplicate single-non-negative-integer scanner.

requireSingleNonNegativeIntegerLiteralWithDiagnostics largely duplicates requireSingleNonNegativeIntegerLiteral (rdf_helpers.ts) and requireSingleNonNegativeIntegerFact (payload_weave_read_model.ts), differing only in how errors are messaged (single message vs missing/conflict/invalid diagnostics, list vs Set dedup). Consider consolidating into one helper that accepts optional per-case diagnostic messages, so the three copies can't drift (they already differ subtly in dedup semantics). Not blocking.

🤖 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/weave/payload_version_layout.ts` around lines 437 - 481, The helper
logic for scanning a single non-negative integer is duplicated across
requireSingleNonNegativeIntegerLiteralWithDiagnostics,
requireSingleNonNegativeIntegerLiteral, and requireSingleNonNegativeIntegerFact,
and the implementations are already drifting in dedup/error handling.
Consolidate the shared parsing and validation into one reusable helper that
accepts optional missing/conflict/invalid diagnostic messages, then have the
existing functions delegate to it so behavior stays consistent and only the
messaging varies.
src/core/import/import.ts (1)

753-758: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Catch only the planner’s input error type. planInventoryAppend only raises WeaveInputError for expected Turtle/shape failures; catching every Error here will also relabel unexpected bugs as ImportInputError. Narrow this catch to WeaveInputError and let other exceptions bubble up.

🤖 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/import/import.ts` around lines 753 - 758, The catch block in
planInventoryAppend is too broad and currently converts any Error into
ImportInputError, which masks unexpected bugs. Update the handling around the
planner call to catch only WeaveInputError, preserve its message when rethrowing
ImportInputError, and let all other exceptions bubble up unchanged so the import
path in import.ts only treats expected input/shape failures as user-facing input
errors.
src/cli/run.ts (2)

1943-2039: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add direct unit tests for the new date-parsing helpers.

parseIso8601Instant/parseOffsetMinutes/daysInMonth/isLeapYear currently appear to be exercised only indirectly via slow e2e CLI tests (tests/e2e/weave_cli_test.ts). A small unit-test module directly targeting these pure functions (leap years, offset signs, boundary hours/minutes/seconds, fractional seconds) would give faster, more precise coverage of this critical input-validation path.

🤖 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/cli/run.ts` around lines 1943 - 2039, Add direct unit coverage for the
new date-parsing helpers instead of relying only on
`tests/e2e/weave_cli_test.ts`. Create focused tests for `parseIso8601Instant`,
`parseOffsetMinutes`, `daysInMonth`, and `isLeapYear` that verify leap-year
behavior, positive/negative offsets, boundary hour/minute/second values, and
fractional-second parsing. Use the helper names to locate the logic in
`src/cli/run.ts` and keep the tests narrow and deterministic.

102-103: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider Temporal.Instant.from() instead of hand-rolled ISO-8601 parsing.

The custom regex + daysInMonth/isLeapYear/offset-math implementation duplicates what Temporal.Instant.from() already does natively: it strictly validates calendar dates (throws on 2026-02-31) and requires an explicit offset/Z, which matches this feature's exact requirements. Temporal has been stable in Deno since 2.7 (Feb 2026), so if the project's toolchain target is at or above that, this ~70-line block could collapse to a few lines with less surface area for date-math bugs.

♻️ Sketch using Temporal
-function resolveGeneratedAtOption(
-  value: string | undefined,
-  commandName: string,
-): { iso: string; now: () => Date } | undefined {
-  if (value === undefined) {
-    return undefined;
-  }
-  const instant = resolveRequiredOptionValue(
-    value,
-    `${commandName} --generated-at requires an ISO 8601 instant`,
-    (message) => new WeaveInputError(message),
-  );
-  const parsed = parseIso8601Instant(instant);
-  if (parsed === undefined) {
-    throw new WeaveInputError(
-      `${commandName} --generated-at must be an ISO 8601 instant with an explicit UTC offset, such as 2026-07-06T12:34:56Z or 2026-07-06T08:34:56-04:00`,
-    );
-  }
-  const iso = parsed.toISOString();
-  return {
-    iso,
-    now: () => new Date(iso),
-  };
-}
+function resolveGeneratedAtOption(
+  value: string | undefined,
+  commandName: string,
+): { iso: string; now: () => Date } | undefined {
+  if (value === undefined) {
+    return undefined;
+  }
+  const instant = resolveRequiredOptionValue(
+    value,
+    `${commandName} --generated-at requires an ISO 8601 instant`,
+    (message) => new WeaveInputError(message),
+  );
+  let iso: string;
+  try {
+    iso = Temporal.Instant.from(instant).toString();
+  } catch {
+    throw new WeaveInputError(
+      `${commandName} --generated-at must be an ISO 8601 instant with an explicit UTC offset, such as 2026-01-01T12:34:56Z or 2026-01-01T08:34:56-04:00`,
+    );
+  }
+  return { iso, now: () => new Date(iso) };
+}

Please confirm the project's Deno target/toolchain (deno.json, CI image) is on 2.7+ before adopting this; otherwise --unstable-temporal/polyfill considerations apply.

Also applies to: 1968-2039

🤖 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/cli/run.ts` around lines 102 - 103, The ISO-8601 parsing in run.ts is
hand-rolled with regex and date math, but this feature can be simplified by
using Temporal.Instant.from() if the Deno toolchain target supports it. Update
the parsing path around ISO_8601_INSTANT_PATTERN and the related
date-validation/offset logic to rely on Temporal.Instant.from() for strict
calendar validation and required offset/Z handling, and first confirm deno.json
and CI are on Deno 2.7+ before removing the custom implementation.
🤖 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/version_execution.ts`:
- Around line 651-786: `resolvePayloadBatchPolicies` is not checking
`resourcePageGenerationConfig` for batch consistency, so
`planExplicitPayloadBatchVersion` can reuse the first target’s
artifact-generation settings across differing targets. Update the comparison in
`resolvePayloadBatchPolicies` to include `resourcePageGenerationConfig` in the
serialized consistency key, and keep the existing `WeaveInputError` path when
any candidate’s scoped config differs from the first one.

---

Nitpick comments:
In `@src/cli/run.ts`:
- Around line 1943-2039: Add direct unit coverage for the new date-parsing
helpers instead of relying only on `tests/e2e/weave_cli_test.ts`. Create focused
tests for `parseIso8601Instant`, `parseOffsetMinutes`, `daysInMonth`, and
`isLeapYear` that verify leap-year behavior, positive/negative offsets, boundary
hour/minute/second values, and fractional-second parsing. Use the helper names
to locate the logic in `src/cli/run.ts` and keep the tests narrow and
deterministic.
- Around line 102-103: The ISO-8601 parsing in run.ts is hand-rolled with regex
and date math, but this feature can be simplified by using
Temporal.Instant.from() if the Deno toolchain target supports it. Update the
parsing path around ISO_8601_INSTANT_PATTERN and the related
date-validation/offset logic to rely on Temporal.Instant.from() for strict
calendar validation and required offset/Z handling, and first confirm deno.json
and CI are on Deno 2.7+ before removing the custom implementation.

In `@src/core/import/import.ts`:
- Around line 753-758: The catch block in planInventoryAppend is too broad and
currently converts any Error into ImportInputError, which masks unexpected bugs.
Update the handling around the planner call to catch only WeaveInputError,
preserve its message when rethrowing ImportInputError, and let all other
exceptions bubble up unchanged so the import path in import.ts only treats
expected input/shape failures as user-facing input errors.

In `@src/core/weave/payload_version_layout.ts`:
- Around line 437-481: The helper logic for scanning a single non-negative
integer is duplicated across
requireSingleNonNegativeIntegerLiteralWithDiagnostics,
requireSingleNonNegativeIntegerLiteral, and requireSingleNonNegativeIntegerFact,
and the implementations are already drifting in dedup/error handling.
Consolidate the shared parsing and validation into one reusable helper that
accepts optional missing/conflict/invalid diagnostic messages, then have the
existing functions delegate to it so behavior stays consistent and only the
messaging varies.
🪄 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: bf926f26-4750-4ee9-985c-424d2e88db8e

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd56d3 and b07f389.

⛔ Files ignored due to path filters (1)
  • deno.lock is excluded by !**/*.lock
📒 Files selected for processing (38)
  • deno.json
  • documentation/notes/release-notes.v0.3.0.md
  • documentation/notes/wd.codebase-overview.md
  • documentation/notes/wd.decision-log.md
  • documentation/notes/wd.testing.fixture-ladder-regeneration.md
  • documentation/notes/wd.testing.md
  • documentation/notes/wd.todo.md
  • documentation/notes/wd.vision.md
  • documentation/notes/wu.cli-reference.generate.md
  • documentation/notes/wu.cli-reference.integrate.md
  • documentation/notes/wu.cli-reference.md
  • documentation/notes/wu.cli-reference.target-syntax.md
  • documentation/notes/wu.cli-reference.version.md
  • documentation/notes/wu.cli-reference.weave.md
  • documentation/notes/wu.repository-options.md
  • src/cli/run.ts
  • src/core/import/import.ts
  • src/core/import/import_test.ts
  • src/core/weave/artifact_history_queries.ts
  • src/core/weave/mesh_inventory_renderers.ts
  • src/core/weave/payload_renderers.ts
  • src/core/weave/payload_version_layout.ts
  • src/core/weave/payload_weave_read_model.ts
  • src/core/weave/resource_page_builders.ts
  • src/core/weave/shape_assertions.ts
  • src/core/weave/slice_classification.ts
  • src/core/weave/slices.ts
  • src/core/weave/weave.ts
  • src/core/weave/weave_test.ts
  • src/runtime/weave/candidate_loader.ts
  • src/runtime/weave/page_generation.ts
  • src/runtime/weave/prepared_execution.ts
  • src/runtime/weave/version_execution.ts
  • src/runtime/weave/weave.ts
  • tests/e2e/weave_cli_test.ts
  • tests/integration/weave_test.ts
  • tests/support/test_tmp.ts
  • tests/support/test_tmp_test.ts
💤 Files with no reviewable changes (1)
  • src/core/weave/shape_assertions.ts

Comment thread src/runtime/weave/version_execution.ts
- reject payload batches when target-scoped resource page generation config differs
- replace hand-rolled generated-at instant parsing with Temporal-backed parsing
- add deterministic generated-at parser coverage for leap dates, offsets, bounds, and fractions
- preserve unexpected import planner exceptions instead of wrapping every Error
- consolidate non-negative integer literal diagnostics across weave helpers
@djradon djradon merged commit 412e979 into main Jul 6, 2026
5 of 6 checks passed
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