feat(dna): NDO DNA role, per-NDO cell cloning, NdoAnchor in zome_group (#112) - #115
Open
Soushi888 wants to merge 1 commit into
Open
feat(dna): NDO DNA role, per-NDO cell cloning, NdoAnchor in zome_group (#112)#115Soushi888 wants to merge 1 commit into
Soushi888 wants to merge 1 commit into
Conversation
#112) Phase A of the NDO-per-cell architecture (one NDO = one cloned DHT cell): - dnas/ndo/workdir/dna.yaml: new ndo DNA bundling the existing zome_resource and zome_gouvernance WASMs (ADR-012, no code fork) - happ.yaml: ndo role, deferred, clone_limit 512; immutable Layer 0 fields go in clone DNA properties so the DnaHash is the NDO's permanent identity (ADR-010) - zome_group: NdoAnchor entry (appended last, existing entry indices preserved) with full clone coordinates and cached descriptor fields; GroupToNdoAnchors and NdoAnchorUpdates link types; create/get/update externs; identity coordinates immutable across cache updates (ADR-011: anchors in group DHTs, no global registry) - Sweettest (6 tests): DNA-hash-as-identity derivation, genesis identity round trip inside an NDO cell, anchor round trip, cached descriptor update chain, empty-name validation rejection, and a second agent joining the NDO network from anchor coordinates alone with the DnaHash pinning check - Docs: group_zome.md gains NdoAnchor; architecture_overview.md gains the ndo role Verified: bun run build:happ exit 0; group suite 13/13; ndo_anchor suite 6/6.
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.
Summary
Implements Phase A (backend pilot) of the approved NDO-per-cell architecture: one NDO = one cloned DHT cell, completing the fractal Lobby → Group → NDO holarchy. Implements #112 (child of epic #78); unblocks the amended #110 UI cutover.
Key mechanism (ADR-010): the NDO's immutable Layer 0 fields live in the clone's DNA properties, so the resulting
DnaHashis unique per NDO and cryptographically bound to its identity. Immutability is enforced by hash physics; theDnaHashbecomes the NDO's permanent, organization-agnostic identifier. TheNondominiumIdentitygenesis entry lives inside the cell and keeps the mutable lifecycle chain.Changes
dnas/ndo/workdir/dna.yaml(new):ndoDNA bundling the existingzome_resourceandzome_gouvernanceWASMs, integrity and coordinator. No Rust changes to those zomes (ADR-012).zome_person, hREA bridge, andmiscstay out of NDO cells.workdir/happ.yaml:ndorole,deferred: true,clone_limit: 512(packed automatically by the existing recursivehc app pack).zome_group: newNdoAnchorentry type (appended last inEntryTypes— existing entry indices preserved) with the full clone coordinates (ndo_dna_hash,network_seed,identity_action_hash,initiator,ndo_created_at, regime, nature) plus cached descriptor fields (name,description,lifecycle_stage). Link typesGroupToNdoAnchorsandNdoAnchorUpdates. Externscreate_ndo_anchor,get_ndo_anchors(resolves the update chain),update_ndo_anchor(cache-only mutation; identity coordinates copied from the original entry). This fixes the bare-ActionHash weakness ofSoftLink(ADR-011): any reader can re-derive the clone from the anchor and verify theDnaHashas a pinning check.SoftLinksurvives as a planning-level reference.dnas/group/tests/src/ndo_anchor/mod.rs, 6 tests): identity-by-physics derivation (same coordinates → same hash; changed property → different network), genesis identity round trip inside an NDO cell, anchor round trip, cached descriptor sync, empty-name validation rejection, and the full flow — a second agent joins the NDO network from anchor coordinates alone, passing the DnaHash pinning check, and reads the genesis identity.group_zome.md(NdoAnchor entry, links, externs, tests) andarchitecture_overview.md(ndo role in the DNA topology).Design refinements vs the architecture doc
NdoAnchoradditionally carriesinitiatorandndo_created_at: joiners must reconstruct the full DNA properties from the anchor, and those two identity fields are property inputs. They describe the NDO, not the anchor author (the zome_group header convention still applies: anchor author/timestamp come from the action header, so the doc'sanchored_by/anchored_atfields are covered there).update_ndo_anchorby construction (copied from the original entry), mirroring the immutability the DNA properties enforce inside the cell.Known pilot limitations (documented in #112)
zome_gouvernancerole-check paths that cross-zome callzome_person(contribution/agreement) will error inside NDO cells; not exercised by the Phase A surface, resolved with the governance-as-operator track (Define cross-zome interface types for governance-as-operator protocol #41 to Governance-as-operator testing infrastructure: mock engine and cross-zome tests #45).Verification
bun run build:happexits 0 and packsdnas/ndo/workdir/ndo.dnacargo test -p group_sweettest --test ndo_anchor— 6/6 passedcargo test -p group_sweettest --test group -- --test-threads 6— 13/13 passedCloses #112. Refs #78, #110 (amended — see the amendment comment there), design doc ADR-010/011/012.