600 pvl pr 2 holonnode envelope validation vertical slice#602
Open
owleyeview wants to merge 4 commits into
Open
600 pvl pr 2 holonnode envelope validation vertical slice#602owleyeview wants to merge 4 commits into
owleyeview wants to merge 4 commits into
Conversation
evomimic
requested changes
Jul 23, 2026
evomimic
left a comment
Owner
There was a problem hiding this comment.
Review Findings
The PR is close, but I don't think it's merge-ready yet.
- P2: The issue contract requires five-op adapter coverage for the new public envelope seam, but the added tests do not exercise that seam across the actual Holochain op variants. The implementation now routes validation through
prepare_holon_node_envelope(...)inhapp/crates/holons_guest_integrity/src/holon_node_envelope.rs, and raw-byte selection depends onholon_node_entry_bytes(...)there as well. However, the tests in that file only drive the internalrun(raw)helper with synthetic byte slices, and the new conductor test intests/sweetests/tests/pvl_validation_tests.rscovers only the 257-property rejection on the authoring path. As a result, the PR does not yet prove the required behavior for all five HolonNode entry-op forms, including correct raw app-entry extraction and the “size before must_get_valid_record” guarantee on the StoreRecord update path.
Smallest practical fix direction:
- Add adapter-level tests that construct and cover all five HolonNode entry-op forms:
- StoreEntry create
- StoreEntry update
- RegisterUpdate
- StoreRecord create
- StoreRecord update
- Assert that each form reaches the single public adapter seam and selects the correct stored inner app-entry bytes.
- Include a StoreRecord update case that proves an oversized payload is rejected before later dependency work.
What I checked:
- PR 602 against issue #600
- CI on the latest PR head SHA
15baf727b051283c2a0a94114b141e830a127594:ci_pass,fmt, andtestare passing - Local branch
600-pvl-pr-2-holonnode-envelope-validation-vertical-sliceis up to date aftergit fetch originandgit pull --ff-only
Manual verification recorded:
build:happ: passedbuild:host: passednpm test: nominalnpm start: nominal
Collaborator
Author
|
Added the requested adapter coverage:
All targeted tests and formatting checks pass. |
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.
PVL PR 2 — HolonNode Envelope Validation (Vertical Slice)
Closes #600.
Summary
First MAP-level rejection logic in the Integrity zome. Implements descriptor-independent envelope validation for the
HolonNodeentry as an end-to-end vertical slice — pure-core rules, substrate-adapter entry point, Integrity wiring for all HolonNode entry-op forms, and explicit violation→Invalidmapping — turning the PR 1 limit/violation contracts into enforced rules on the live write path.Per PVL Design Spec v0.4 (§5.1–5.2, §10) and Implementation Plan v2.4 (PR 2), validation covers:
MAX_HOLON_NODE_BYTES= 262,144) →MAP-PVL-1003MAP-PVL-1001(DecodeFailed)MAP-PVL-1001(NonCanonicalEncoding)MAX_PROPERTY_COUNT= 256) →MAP-PVL-1101Rules run in a deterministic, consensus-relevant order: size → decode → canonical → count, pinned by tests.
Why
Before this PR,
validate_create_holon/validate_update_holonwere no-ops and the zome accepted every decodableHolonNodeunconditionally — no floor on entry size, property count, or non-canonical encoding, so a coordinator defect or peer could commit oversized/incoherent entries every peer must then store, gossip, and traverse. This establishes the deterministic hygiene floor without consulting descriptors or runtime state.Design
Follows the PVL §3.3 layering, with the Integrity zome holding dispatch + callback mapping only:
prepare_holon_node_envelope(&op)guard runs beforeop.flattened(), extracting the inner app-entry bytes directly from the rawOp(StoreEntry,StoreRecord,RegisterUpdate). It measures and rejects oversized entries before typed decode and before any dependency request — in the StoreRecord-update arm, before its existingmust_get_valid_record.BTreeMapdecoding is last-wins for duplicate keys, so nothing is observable post-decode) and doubles as the guest/preflight serialization-parity guarantee. It catches duplicate keys, non-canonical ordering, non-canonical integer widths, and ignored extra fields.Err(PvlViolation)→ValidateCallbackResult::Invalid(violation.to_string()), so the consensus-visible message is exactly theMAP-PVL-<code>: <summary>contract rather than a substrate-wrapped guest string.Storage SL2 breadcrumbs (no behavior change)
ForUpdateNewVersionstill persists viacreate_entry. Breadcrumb comments mark the anticipated Storage SL2 switch (root-addressed nativeupdate_entryagainst the lineage-root Create, removal oforiginal_idfrom the entry shape, parity-fixture revisit) at the guest commit path and the RegisterUpdate / StoreRecord-update arms. The update-op wiring is exercised by adapter tests but is dead for MAP writes until SL2, since writes currently emit onlyCreateactions.Scope / impact
validate()) — requires fresh test state; acceptable pre-production.HolonError::PvlViolationand its SDK mirror landed in PR 1; violations stay inside Integrity until preflight (PR 8).Testing
encodeparity and model↔guest-entry parity (both legs of the canonical-compare pinned); decode-failure; duplicate-key / reordered / non-canonical integer-width / ignored-extra-field →NonCanonicalEncoding; oversized-before-decode; over-count.HolonNodeis rejected with the exactMAP-PVL-1101: property count exceeds 256message reaching the author, via a reusableassert_commit_rejected_with_pvlharness helper.npm run check,npm run fmt:check,npm run test:unit, andnpm run sweetestall pass (corpus loads; existing dance suites green).Explicitly out of scope
Property-name / native-value rules (PR 3); identifier shape (PR 4); update/delete target, lineage,
original_idimmutability (PR 5 + Storage SL2); SmartLink validation (PR 6); dependency-budget + coordinator preflight (PR 8); changing howForUpdateNewVersionpersists (Storage SL2). OnlyTooManyPropertiesis exercised at the conductor level here by design; broader negative-path conductor coverage is PR 8.