Repository navigation
feat(op): the graph document carries its catalog — mandatory even empty, refused when absent - #593
Merged
Merged
Conversation
…pty, refused when absent Phase 1 of the resource-construction plan (4-resource-management.md section 5.4). The graph document gains a mandatory resources section: every current-generation ledger entry as intent -- id, uri, state pending, in append order, via the catalog's new IntentEntries -- with content-addressed entries additionally carrying their packed bytes as before. The section serializes even when empty and sits outside the canonical bytes, like the content section. LoadGraph refuses a document without the section: every pre-ruling document fails to load and is rewritten by re-planning, with schema_version staying 1 by ruling. unpackCatalog replaces unpackContent as the load-side dual: every row restores as a Pending entry with its recorded id (the trace-rehydrate discipline -- interning disabled, constructors rebuild from the URI's specific, unpackers consume matching content blobs), an orphan content blob is an error, and nextID re-derives from the recorded ids. The executor backstops the same rule: a catalog-less graph fails pre-flight with preflight_failed before any dispatch, in Run and ResumeUnwind both. ResourceState learns to serialize as its name -- a document carries "pending", never a bare ordinal -- the same typed-value rule the mode-as-384 rendering violated. Both judgment pins land green with this change, earlier than planned: the plan expected them to flip with phase 3, but planning already interns the resource-typed source, so serialization was the missing half and the destination's absence -- a product is a runtime fact, not intent -- was already true. The pins now assert the ruled contract in both directions: source present as pending, destination absent, from Go (catalog_contract_test.go) and front to back through devlore-test (test_graph_catalog_contract.star, six expectations, passing). Four new section-5.4 pins cover the empty-section round trip byte-identically, the missing-section refusal, id-preserving intent-row reconstruction, and the executor backstop. Verified with make check (103 packages ok, 0 failures -- the tree is fully green, pins included) and make vet under GOOS windows and linux. Closes #583. Refs #581, #444.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of resource-construction —
4-resource-management.md §5.4 implemented.
The section
graphDatagains a mandatoryresourcessection — every current-generation entry as intent(
{id, uri, state: "pending"}, append order, via the newResourceCatalog.IntentEntries); content-addressedentries additionally carry packed bytes as before. Present even when empty; outside the canonical bytes like
the content section.
The gates
LoadGraphrefuses a document without the section — every pre-ruling document fails to load and isre-planned;
schema_versionstays 1 by ruling.unpackCatalog(replacingunpackContent): rows restore as Pending with recorded ids — thetrace-rehydrate discipline; unpackers consume matching content blobs; an orphan blob errors;
nextIDre-derives.
preflight_failed) before any dispatch, inRunandResumeUnwindboth.ResourceStateserializes as its name —"pending", never a bare ordinal (themode: 384lesson,applied at the type).
The judgment pins land green — early
The plan predicted the flip at phase 3; it arrived with phase 1, because planning already interns the
resource-typed source — serialization was the missing half, and the destination's absence (a product is a
runtime fact) was already true. Both pins now assert the ruled contract in both directions:
pkg/op/provider/plan/catalog_contract_test.go— source pending present, destination absent,against the reloaded document
cmd/devlore-test/devloretest/data/test_graph_catalog_contract.star— the same, front to back through theharness: 6 expectations, passing
Plus four new §5.4 pins: empty-section round trip (byte-identical), missing-section refusal, id-preserving
intent-row reconstruction, executor backstop.
Verified
make check— 103 packages ok, 0 failures — the tree is fully green, pins includedmake vetGOOS=windows, GOOS=linuxCloses #583. Refs #581, #444. Phase 3's remaining substance (pending-only claiming with no plan-time
existence I/O; the promise grammar) is recorded in the plan.