Nondominium Documentation

Infrastructure for organization-agnostic, uncapturable, self-governed resources — built on Holochain and ValueFlows.

Getting Started

Architecture

Requirements

Technical Specifications

Development

Applications

TELOS: Nondominium

Vision

A protocol for resource governance without ownership. Resources participate in Nondominium Object (NDO) lifecycles where rights and responsibilities attach to relationships, not to titles. The goal is infrastructure for commons-based economies that cannot be re-enclosed — not by platform operators, not by nation-states, and not by the project's own developers.

Mission

Build and ship the Holochain hApp and underlying protocol that demonstrates governance-embedded commons management at production scale. Integrate with hREA for ValueFlows semantics. Provide an incremental adoption path so existing organizations (Sensorica, Dolibarr/TikiWiki users, OVN-aligned cooperatives) can participate without wholesale migration.

Philosophy

  • Protocol-level economic enforcement over policy-level. CAL-1.0 + AGPLv3 dual license with protocol-level constraints (no re-enclosure, no revocation of nondominium status) baked into governance rules, not documents.
  • Three-layer progressive model. Prima Materia (potential, Layer 0) → Specified (designed, Layer 1) → Custodial/Process (instantiated, Layer 2). Coordination overhead matches social complexity; no pre-classification at creation.
  • Private Participation Receipts (PPR) as user-sovereign reputation primitive. 16 categories, bilaterally signed, stored as Holochain private entries. No global scoring aggregator, no third-party visibility by default.
  • Composability with hREA and ValueFlows, not replacement. NDO entries bridge to hREA's EconomicResource/Agent types. ValueFlows is the canonical action vocabulary.
  • Capability-based security via Holochain capability tokens. Access rights are cryptographically issued, field-level scoped, and expire after 30 days maximum.
  • Agent-centric data model. All data tied to individual agents' source chains. No shared database. DHT is the coordination layer, not the control layer.
  • Embedded governance. Resources carry their own access and transfer rules as GovernanceRule entries on ResourceSpecification. The governance zome is a state-transition operator, not a policy server.

Operating Principles for the AI

  • Prefer correctness over cleverness. This is governance infrastructure for real economic relationships. A wrong validation rule on the DHT cannot be rolled back.
  • ValueFlows vocabulary is canonical. If a concept exists in VF (EconomicEvent, Commitment, Claim, VfAction), use VF terminology. Do not invent parallel ontologies.
  • The NDO architecture in documentation/requirements/ndo_prima_materia.md is load-bearing. Changes to the three-layer model, capability slots, or lifecycle state machine ripple through governance, PPR, and UI. Flag any proposal that touches this document's scope and note the downstream impact.
  • PPR must remain user-sovereign. Resist any design that aggregates reputation into global scores, centralizes storage, or enables third-party visibility without explicit capability grant.
  • UI work uses Svelte 5 runes, UnoCSS, and Melt UI next-gen (melt). Not shadcn. Not Tailwind utility classes directly in templates. Not Svelte 4 reactive statements ($:). Check the mcp__svelte MCP server for current Svelte 5 API.
  • Consult REVIEW.md before proposing PR-shaped changes. It explicitly lists patterns to flag. If your proposed code matches a flagged pattern, explain why it is safe before proceeding.
  • Read CONTRIBUTING.md for branch model and commit conventions (feat/, fix/, refactor/, docs/, chore/ prefixes; Conventional Commits scopes).

What This PAI Is NOT For

  • General TypeScript or Rust questions disconnected from Nondominium architecture. Use a generic AI session for language-level questions.
  • Holochain learning content not specific to this codebase. The holochain-agent-skill covers Holochain generally; this TELOS is for Nondominium-specific decisions.
  • Personal or spiritual contexts. Use a personal-level AI session.
  • Speculation about post-MVP integrations (Unyt, Flowsta) without first reading their integration docs in documentation/requirements/post-mvp/.

nondominium - Requirements Document

1. Executive Summary

nondominium is a foundational infrastructure project aimed at enabling a new class of Resources that are organization-agnostic, uncapturable, and natively collaborative. These Resources are governed not by platforms or centralized authorities, but through embedded rules, transparent peer validation, and a comprehensive reputation system.

The project's central goal is to support a true sharing economy, overcoming the structural flaws of centralized platforms (centralization of power, censorship, unsuitable regulations).

Built on the Holochain framework and using the ValueFlows standard, nondominium allows any Agent to interact with these Resources in a permissionless but accountable environment, with automatic reputation tracking through Private Participation Receipts (PPRs).

2. Objective & Goals

2.1 Main Objective

Develop a new class of Resources that are:

  • Permissionless Access: Anyone can Access Resources under defined governance rules
  • Organization Agnostic: Exist independently of any single organization. Not owned or controlled by any single Agent or organization.
  • Capture Resistant or Unenclosable: Uncapturable and resilient to monopolization. No Agent or group of Agents can control or delete Resources.
  • Self-governed: Rules driven associated directly with the Resources, which govern interactions or Actions that Agents can take, as defined by the system. Roles: Set of Activities or types of interactions that an Agent can perform with respect to the Resource. Also related to Custody (responsibility), maintenance or improvements (obligations). Access control: Rules associated with Roles of Agents, membranes, to grant permissions to interact with Resources in specific ways, Role-related. Is pseudonymous.
  • Self-regulated: Peer reviewed, verified and tested (quality control)
  • Shareable by Default: Resources are designed for sharing from inception
  • Credentials and Reputation-enabled: Built-in accountability through cryptographically-signed participation tracking
  • Process-aware: Supporting structured Economic Processes (Use, Transport, Storage, Repair)
  • Fully specified: Machine readable in terms of function, design architecture, standards (dimensions, tolerances, quality), etc.
  • Composable: Resources can be combined into come complex resources, allow fork and remix
  • Hard to Clone: Governance, set of rules and incentives to make unnecessary copying of a resource unlikely.
  • Lifecycle Managed: Resources have managed lifecycles from creation through validation to end-of-life.
  • Traceable: Full provenance and economic activity tracking, affiliation to component resources

2.2 Supporting Goals

  1. Digital Representation: Define machine-readable, digital, and material Resources as nondominium, implemented as DHT entries on Holochain
  2. Proof-of-Concept Implementation: Build and test a prototype of a distributed platform supporting Resource sharing under the nondominium property regime
  3. Governance and Incentive Layer: Implement all ValueFlows Actions and Economic Processes with embedded governance rules
  4. Identity and Role System: Develop Agent identity infrastructure supporting pseudonymity, credentials, and private entry identification
  5. Reputation System: Implement Private Participation Receipts (PPRs) for trustworthy, cumulative reputation tracking
  6. Process Management: Support structured Economic Processes with role-based access control

2.3 Post-MVP capability integrations (NDO, Unyt, Flowsta)

The current MVP in this repository implements ResourceSpecification, EconomicResource, and GovernanceRule with governance-as-operator patterns as specified elsewhere in this document. Normative requirements for the generic Nondominium Object (NDO) — three-layer model, lifecycle vs operational state, capability slot surface, and typed integration with external operators — live in ndo_prima_materia.md (REQ-NDO-L0 through REQ-NDO-AGENT-08, REQ-NDO-CS-01 through REQ-NDO-CS-15, migration §10).

Optional, pay-as-you-grow integrations (communities may adopt one, both, or neither):

IntegrationRoleNormative detailDesign stub
Lobby DNAMulti-network federation: entry point (Lobby DHT) + per-group coordination (Group DHT) + NDO-to-NDO hard links, Contributions, Smart Agreements; dual deployment (standalone + Moss applet)REQ-LOBBY-, REQ-GROUP-, REQ-NDO-EXT-*lobby-dna.md / lobby-architecture.md
UnytEconomic settlement (Smart Agreements, RAVE proofs, PPR↔RAVE provenance)ndo_prima_materia.md §6.6, §11.5; REQ-NDO-CS-07–CS-11unyt-integration.md
FlowstaCross-app identity (Vault IsSamePersonEntry, FlowstaIdentity slot, DID, recovery); Tier 1 (Phase 1) vs Tier 2 (Phase 3)ndo_prima_materia.md §6.5–6.7, §11.6; REQ-NDO-CS-12–CS-15; REQ-NDO-AGENT-07–08flowsta-integration.md

Knowledge-base context (ontology, OVN alignment, gap analysis): resources.md, agent.md, governance.md. This PRD remains the anchor for MVP user stories and REQ-USER / REQ-RES / REQ-GOV IDs; NDO-wide REQ-NDO-* IDs are defined in ndo_prima_materia.md §9.

3. nondominium Resource Characteristics

nondominium Resources must exhibit the following characteristics:

  • REQ-RES-01: Permissionless Access: Anyone can access nondominium Resources under defined governance rules. Post-MVP note: "defined governance rules" must be extensible to include AffiliationState-based conditions (e.g. min_affiliation: ActiveAffiliate) in addition to role-based conditions; see REQ-AGENT-03, REQ-AGENT-05, and REQ-GOV-09 annotation below.
  • REQ-RES-02: Organization Agnostic: Resources exist independently of any single organization and are associated with Agents according to their Roles. Post-MVP note: "Agents" must encompass all AgentEntityType variants (Individual, Collective, Project, Network, Bot) — see REQ-AGENT-01 and REQ-AGENT-02; EconomicResource.custodian will expand from AgentPubKey to AgentContext.
  • REQ-RES-03: Capture Resistant: No Agent or group can control, delete, or monopolize nondominium Resources
  • REQ-RES-04: Self-governed: Governance rules are embedded within ResourceSpecifications and enforced programmatically
  • REQ-RES-05: Fully Specified: Resources are machine-readable in terms of function, design, standards, and governance rules
  • REQ-RES-06: Hard to Clone: Governance, incentives, and reputation systems make unnecessary copying unlikely
  • REQ-RES-07: Shareable by Default: Resources are designed for sharing from inception
  • REQ-RES-08: Process-Enabled: Resources can be used in structured Economic Processes (Use, Transport, Storage, Repair)
  • REQ-RES-09: Lifecycle Managed: Resources have managed lifecycles from creation through validation to end-of-life

4. User Roles & Stories

4.1 Simple Agent

A user who can search for nondominium Resources and contribute new ones. Linked to a general capability token.

Identity & Onboarding

  • REQ-USER-S-01: As a Simple Agent, I want to use the nondominium hApp with minimal effort and without permission
  • REQ-USER-S-02: As a Simple Agent, I want to complete my identity by associating private information (legal name, address, email, photo ID) with my Agent identity, stored as Holochain private entries

Resource Discovery

  • REQ-USER-S-03: As a Simple Agent, I want to search for available nondominium Resources and their specifications
  • REQ-USER-S-04: As a Simple Agent, I want to search for other Agents, view their public profiles and roles

Resource Creation

  • REQ-USER-S-05: As a Simple Agent, I want to create new nondominium Resources with embedded governance rules
  • REQ-USER-S-06: As a Simple Agent, I want to interact with Agents interested in accessing my created Resources

First Transaction & Promotion

  • REQ-USER-S-07: As a Simple Agent, I want to make my first transaction, transferring my new Resource to an Accountable Agent
  • REQ-USER-S-08: As a Simple Agent, I want to become an Accountable Agent after my first transaction is validated

4.2 Accountable Agent

A user who can signal intent to access Resources and participate in governance. Linked to a restricted capability token.

Resource Access

  • REQ-USER-A-01: As an Accountable Agent, I want to search for available nondominium Resources and their governance rules
  • REQ-USER-A-02: As an Accountable Agent, I want to search for other Agents and view their reputation summaries
  • REQ-USER-A-03: As an Accountable Agent, I want to create new nondominium Resources with embedded governance rules
  • REQ-USER-A-04: As an Accountable Agent, I want to signal intent to access Resources for specific Economic Processes (Use, Transport, Storage, Repair)

Role & Process Management

  • REQ-USER-A-05: As an Accountable Agent, I want to acquire specialized roles (Transport, Repair, Storage) through validation
  • REQ-USER-A-06: As an Accountable Agent, I want to initiate and complete Economic Processes according to my roles
  • REQ-USER-A-07: As an Accountable Agent, I want to chain multiple process actions (e.g., transport → repair → transport) in a single commitment

Validation & Governance

  • REQ-USER-A-08: As an Accountable Agent, I want to validate new Resources during first access events
  • REQ-USER-A-09: As an Accountable Agent, I want to validate Agent identity information and first transactions
  • REQ-USER-A-10: As an Accountable Agent, I want to validate Economic Process completions and outcomes

Reputation & Participation

  • REQ-USER-A-11: As an Accountable Agent, I want to receive Private Participation Receipts for all my economic interactions
  • REQ-USER-A-12: As an Accountable Agent, I want to view my reputation summary and participation history
  • REQ-USER-A-13: As an Accountable Agent, I want to cryptographically sign participation claims to ensure authenticity

4.3 Primary Accountable Agent (Custodian)

The agent with physical possession (custodianship) of a material nondominium Resource.

Custodial Responsibilities

  • REQ-USER-P-01: As a Primary Accountable Agent, I want all capabilities of an Accountable Agent
  • REQ-USER-P-02: As a Primary Accountable Agent, I want to apply governance rules programmatically for access decisions
  • REQ-USER-P-03: As a Primary Accountable Agent, I want to manage Resource custody transfers with full audit trails

Advanced Governance

  • REQ-USER-P-04: As a Primary Accountable Agent, I want to validate specialized role requests from other Agents
  • REQ-USER-P-05: As a Primary Accountable Agent, I want to participate in dispute resolution processes
  • REQ-USER-P-06: As a Primary Accountable Agent, I want to initiate Resource end-of-life processes with proper validation

4.4 Agent Ontology Requirements (Post-MVP)

Status: Post-MVP. Gaps identified against the OVN wiki ontology (15 years of commons-based peer production practice). See documentation/archives/agent.md for the full analysis. Requirements below are design targets for the generic NDO; the current MVP implements individual agents only.

Agent Type Taxonomy

  • REQ-AGENT-01: Agent Type Field: Every agent context must carry an AgentEntityType discriminant: Individual, Collective(String), Project(ActionHash), Network(ActionHash), Bot { capabilities, operator }, ExternalOrganisation(String). The MVP supports Individual only; all other variants require post-MVP implementation.
  • REQ-AGENT-02: Collective Agents — Dual-Face Model: Groups, working groups, projects, and network-level entities are composed agents. Each has an agent face (AgentContext with the relevant AgentEntityType variant) through which it participates in economic events as provider/receiver, and may optionally have a resource face (NondominiumIdentity) as its digital twin. The ActionHash in Project(ActionHash) and Network(ActionHash) links the agent face to the resource face. These two faces are ontologically distinct — the NondominiumIdentity is a Resource; the AgentContext is an Agent — and neither replaces the other. Individual agents hold roles in both their own profile and in collective agents' governance. Collective agents may act through multi-signature patterns (N-of-M member authorisation) when performing economic events.
  • REQ-AGENT-03: Bot/AI Delegation: A DelegatedAgent relationship must allow a Person to authorise an AI agent or bot to act on their behalf within a defined scope of capabilities and for a defined duration.

Affiliation Spectrum

  • REQ-AGENT-04: Five-State Affiliation: The system must model the OVN affiliation spectrum — UnaffiliatedStranger, CloseAffiliate, ActiveAffiliate, CoreAffiliate, InactiveAffiliate — as a derived (not stored) property computed algorithmically from PPR activity, recency, and contribution history. Binary "in/out" membership is insufficient for governance decisions.
  • REQ-AGENT-05: Affiliation Record: Formal network entry must be formalised as an AffiliationRecord entry: the agent cryptographically signs acknowledgement of the Terms of Participation (ToP), the Nondominium & Custodian agreement, and the Benefit Redistribution Algorithm. This record is the prerequisite for ActiveAffiliate status.
  • REQ-AGENT-06: Configurable Role Taxonomy: The RoleType enum must become configurable at the network level. Communities must be able to define their own role taxonomies rather than relying on the six predefined types (SimpleAgent, AccountableAgent, PrimaryAccountableAgent, Transport, Repair, Storage). Predefined roles become defaults, not constraints.

Composable Profile

  • REQ-AGENT-07: AgentProfile View: The system must expose a composable AgentProfile query that aggregates Person, ReputationSummary, PersonRole list, active commitment count, economic event counts, CapabilitySlot attachments, and network affiliations into a single queryable view. This view is computed from existing DHT data — it is not a new stored entry type.
  • REQ-AGENT-08: Social Graph: The system must model peer relationships via an AgentRelationship bidirectional link type (typed: colleague, collaborator, trusted, voucher), stored privately. Social relations are part of agent wealth in the OVN model and must be legible to governance without being publicly exposed.
  • REQ-AGENT-09: Network Affiliations: Agents must be able to hold membership in multiple NDO networks simultaneously. Cross-network affiliations must be modelled as typed links from Person to other NDO instance hashes, enabling agents to be bridge nodes between communities.
  • REQ-AGENT-10: Needs and Wants: An optional AgentNeedsWants profile extension must allow agents to declare what resources they need and what they can offer, enabling matching at the network level.

Identity, Privacy, and Portability

  • REQ-AGENT-11: CapabilitySlot on Agent: The Person entry hash must serve as a stigmergic attachment surface (analogous to the resource-level CapabilitySlot) for external credential wallets, DID documents, reputation oracles, and professional networks. Agents can attach capabilities to their identity without modifying the core Person entry.
  • REQ-AGENT-12: Portable Credentials: The system must support a PortableCredential structure — a cryptographically signed summary of an agent's roles and ReputationSummary — that can be verified by other Holochain networks. This implements the OVN requirement for cross-network identity portability.
  • REQ-AGENT-13: Zero-Knowledge Capability Proofs: Agents must be able to prove capability eligibility (I have at least N completed maintenance commitments) without revealing the underlying PPR data. ZKP proofs break the false binary between full data disclosure (low privacy) and no disclosure (no accountability).
  • REQ-AGENT-14: Pseudonymous Participation Mode: The system must support ephemeral participation: an agent contributes under a temporary key without linking to their Person entry. Contribution is recorded but unlinkable to physical identity. This is the individual-level participation tier in the OVN individual/person model.
  • REQ-AGENT-15: Sybil Resistance: Network membership must support optional sybil-resistance mechanisms: social vouching (existing agents vouch for new agents), biometric opt-in, or integration with an external Proof-of-Personhood system, configurable per network as a membrane proof.

Promotion Workflow Integrity

  • REQ-AGENT-16: Queryable Promotion Requests: The request_role_promotion function must create a real, queryable RolePromotionRequest entry linked to both the requesting agent and an anchor for pending requests — not return a placeholder hash. Promotion requests must be discoverable by authorised approvers.

4.5 MVP UI Requirements

Status: Implemented in the current codebase. See documentation/specifications/ui_architecture.md for design; documentation/IMPLEMENTATION_STATUS.md for status.

These requirements govern the Svelte 5 / SvelteKit frontend implemented in the ui/ directory. They derive from documentation/requirements/ui_design.md and the reconciliation decisions documented in GitHub Issue #102 (where conflicts arose, ui_design.md is the source of truth).

  • REQ-UI-NAV-01: Three-Level Hierarchy: The UI must implement Lobby → Group → NDO as the navigational hierarchy. Users enter via the Lobby, join or create Groups, and access NDOs within a Group context.
  • REQ-UI-NAV-02: Group-Scoped NDO Creation: NDOs may only be created from within a Group. There is no global "Create NDO" flow. The /ndo/new route must redirect to the relevant Group or provide an explanation.
  • REQ-UI-NAV-03: Context-Aware Sidebar Link: The "New NDO" Sidebar link must navigate to /group/{id}?createNdo=1 when a Group is selected, or to /ndo/new (explanation) otherwise.

Lobby

  • REQ-UI-LOBBY-01: NDO Browser: The Lobby must display all known NDOs in a browse-and-filter grid. Filter chips must allow multi-select across LifecycleStage, ResourceNature, and PropertyRegime simultaneously. OR logic applies within each dimension; AND logic applies across dimensions.
  • REQ-UI-LOBBY-02: Group Sidebar: The Lobby must include a sidebar listing the agent's Groups, with "Create Group" and "Join Group" actions. New or joined Groups must appear immediately and navigate the agent to the Group view.
  • REQ-UI-LOBBY-03: Lobby Profile Bar: The Lobby must display the agent's nickname from LobbyUserProfile, or a "Set up profile" CTA if no profile exists.

Identity — Three Levels

  • REQ-UI-ID-01: LobbyUserProfile (Level 1): Agents must be prompted to create a LobbyUserProfile (nickname required; real name, bio, email, phone, address optional) on first Lobby entry. This profile is stored in localStorage only and does not require a DHT write.
  • REQ-UI-ID-02: GroupMemberProfile (Level 2): On first entry to each Group, agents must be prompted to choose how their LobbyUserProfile data is presented to other Group members (anonymous vs. selective disclosure). This choice is stored per-Group in localStorage.
  • REQ-UI-ID-03: Person entry (Level 3): A Person entry in zome_person is created at most once — on the agent's first DHT-active action (e.g., NDO creation, acceptance of a Commitment). Lobby browsing and Group membership do not require a Person entry.

Groups (MVP Shell)

  • REQ-UI-GRP-01: Group as localStorage shell: In the MVP, Groups are persisted as GroupDescriptor entries in localStorage (no Group DNA). The LobbyService implementation must be replaceable with a Group DNA backend without requiring component changes.
  • REQ-UI-GRP-02: Invite Links: Groups must support invite links (base64-encoded GroupDescriptor) that allow another agent to join by pasting a link.
  • REQ-UI-GRP-03: Group-scoped NdoBrowser: The Group view must display only NDOs created within that Group, using the same filter chip UI as the Lobby NdoBrowser.

NDO Management

  • REQ-UI-NDO-01: NDO Creation Form: The NDO creation form must include: name (text), property_regime (select, 6 options with tooltips), resource_nature (select, 5 options with tooltips), lifecycle_stage (select, 10 options), description (textarea). Name uniqueness is checked client-side against existing lobby NDOs (warning, not block).
  • REQ-UI-NDO-02: Initiator Display: The NDO identity panel must display the initiator's Person.name as a profile link, or fall back to a truncated AgentPubKey if no Person entry exists.
  • REQ-UI-NDO-03: Lifecycle Transition: The initiator of an NDO must have access to a lifecycle transition button. The frontend must encode the full valid transition table (mirroring the Rust validation). Special cases: Deprecated requires successor NDO selection; Hibernating requires confirmation.
  • REQ-UI-NDO-04: Transition History: NDO identity panels must show a collapsible transition history panel listing from_stage, to_stage, agent, timestamp, and event_hash (with copy-to-clipboard) for each recorded transition.
  • REQ-UI-NDO-05: Fork Button: An informational "Fork this NDO" button must be accessible to all authenticated users. The fork modal must explain the fork friction concept (negotiation, consensus, post-MVP Unyt stake) and provide a copy-initiator-pubkey CTA. Actual fork submission is post-MVP.

5. Economic Process Requirements

5.1 Core Process Types

  • REQ-PROC-01: Use Process: Any Accountable Agent can initiate Use processes for accessing Resources without consuming them
  • REQ-PROC-02: Transport Process: Only Agents with Transport role can initiate transport processes to move Resources between locations
  • REQ-PROC-03: Storage Process: Only Agents with Storage role can initiate storage processes for temporary Resource custody
  • REQ-PROC-04: Repair Process: Only Agents with Repair role can initiate repair processes that may change Resource state

5.2 Process Management

  • REQ-PROC-05: Process Initiation: Agents must have appropriate roles to initiate specialized processes
  • REQ-PROC-06: Process Tracking: All processes must be tracked with status, inputs, outputs, and completion state
  • REQ-PROC-07: Process Validation: Process completions must be validated according to process-specific requirements
  • REQ-PROC-08: Process Chaining: Agents with multiple roles can chain process actions within a single commitment
  • REQ-PROC-09: Process History: Complete audit trail of all processes affecting each Resource

6. Governance & Validation Requirements

6.1 Resource Lifecycle Management

  • REQ-GOV-01: First Resource Requirement: Simple Agents must create at least one Resource before accessing others
  • REQ-GOV-02: Resource Validation: New Resources must be validated by Accountable Agents through peer review during first access
  • REQ-GOV-03: Agent Validation: Simple Agents must be validated by Accountable Agents during their first transaction to become Accountable Agents. Post-MVP note: this workflow currently assumes individual agents only; post-MVP must support collective agent promotion workflows where the promotee is a Collective/Project/Network NDO and the promoter is its designated PrimaryAccountableAgent representative (ref G1, REQ-GOV-16).
  • REQ-GOV-04: Specialized Role Validation: Transport, Repair, and Storage roles require validation by existing role holders

6.2 Validation Schemes

  • REQ-GOV-05: Role-Gated Validation: Certain validations are restricted to Agents with specific roles. Post-MVP note: ValidationReceipt.validator is currently AgentPubKey; post-MVP must accept AgentContext to allow collective agent and bot validators within their declared scope (ref G1, REQ-GOV-16).
  • REQ-GOV-06: Multi-Reviewer Validation: Support configurable validation schemes (2-of-3, N-of-M reviewers)
  • REQ-GOV-07: Process Validation: Economic Process completions must be validated according to process-specific criteria

6.3 Governance Rules

  • REQ-GOV-08: Embedded Rules: ResourceSpecifications must contain embedded governance rules for access and process management
  • REQ-GOV-09: Rule Enforcement: Governance rules must be enforced programmatically across all interactions. Post-MVP note: the governance evaluation engine (evaluate_transition) must be extended to support AffiliationState-based rule conditions in addition to the current role-membership check. This requires a cross-zome query from zome_governance to zome_person to derive the requesting agent's AffiliationState before evaluating GovernanceRule.rule_data["min_affiliation"]. See REQ-AGENT-03, REQ-AGENT-05, implementation_plan.md §3 [G2+Resource], and governance-operator-architecture.md §2.1 TODO G2.
  • REQ-GOV-10: Rule Transparency: All governance rules must be publicly visible and machine-readable

6.4 End-of-Life Management

  • REQ-GOV-11: End-of-Life Declaration: Resources reaching end-of-life must go through formal decommissioning process
  • REQ-GOV-12: End-of-Life Validation: Multiple validators required for end-of-life declarations to prevent abuse
  • REQ-GOV-13: Challenge Period: Time-delayed finalization with challenge period for end-of-life declarations

6.5 Affiliation and Collective Governance (Post-MVP)

These requirements depend on post-MVP agent architecture (REQ-AGENT-01 through REQ-AGENT-07) and the AffiliationState/AffiliationRecord system from agent.md §4.2 and §6.4.

  • REQ-GOV-14: Affiliation-Based Governance Access — governance processes gated by AffiliationState must be enforceable via GovernanceRule.rule_data["min_affiliation"]; the governance operator must cross-zome query AffiliationState from zome_person (refs G2, G6, governance.md §3.6.2)

  • REQ-GOV-15: AffiliationRecord Governance Ceremony — signing an AffiliationRecord must generate a Commitment/EconomicEvent/Claim cycle in zome_governance, creating an auditable on-chain record of the Terms of Participation (ToP) signing event; this event triggers AffiliationState → ActiveAffiliate (refs G6, governance.md §3.6.3)

  • REQ-GOV-16: Collective Agent Governance ParticipationValidationReceipt, PPR counterparty, EconomicEvent.provider/receiver, and GovernanceTransitionRequest.requesting_agent must accept AgentContext post-MVP; collective NDO governance requires designated-operator or N-of-M multi-sig patterns (refs G1, governance.md §6.6)

  • REQ-GOV-17: Sybil Resistance for Governance — governance-tier role promotion (AccountableAgent → PrimaryAccountableAgent) must require either N-of-M active affiliate vouching or optional proof-of-personhood membrane proof (refs G9, governance.md §5.3)

  • REQ-GOV-18: Pseudonymous Governance Participation — agents must be able to reach ActiveAffiliate status via pseudonymous AgentPubKey (no Person entry required); pseudonymous agents are blocked from governance roles requiring legal accountability (refs G10, governance.md §5.3)

7. Private Participation Receipt (PPR) Requirements

7.1 Receipt Generation

  • REQ-PPR-01: Bi-directional Issuance: Every economic interaction generates exactly 2 receipts between participating Agents
  • REQ-PPR-02: Automatic Generation: PPRs are automatically issued for all Commitment-Claim-Event cycles
  • REQ-PPR-03: Cryptographic Integrity: All receipts are cryptographically signed for authenticity
  • REQ-PPR-04: Performance Tracking: PPRs include quantitative performance metrics (timeliness, quality, reliability, communication)

7.2 Receipt Categories

  • REQ-PPR-05: Resource Creation: Receipts for Resource creation and validation activities
  • REQ-PPR-06: Custody Transfer: Receipts for responsible custody transfers and acceptances
  • REQ-PPR-07: Service Processes: Receipts for service commitments and fulfillments (Transport, Repair, Storage)
  • REQ-PPR-08: Governance Participation: Receipts for validation activities and governance compliance
  • REQ-PPR-09: End-of-Life: Enhanced receipt requirements for end-of-life declarations and validations

7.3 Privacy & Security

  • REQ-PPR-10: Private Storage: PPRs stored as Holochain private entries accessible only to owning Agent
  • REQ-PPR-11: Reputation Derivation: Agents can derive and selectively share reputation summaries from their PPRs
  • REQ-PPR-12: Signature Validation: System must validate cryptographic signatures of participation claims

7.4 Privacy Tiers and Cross-Network Portability (Post-MVP)

TODO: The following requirements depend on post-MVP agent architecture (see REQ-AGENT-12 through REQ-AGENT-15 and documentation/archives/agent.md Sections 4.4–4.5).

  • REQ-PPR-13: Per-Interaction Privacy Level: Agents must be able to choose their privacy level per interaction type: fully anonymous (no PPRs, no reputation accumulation), pseudonymous (PPRs linked to persistent pseudonym, not physical identity), or named (PPRs linked to public Person entry). The current model only supports named participation.
  • REQ-PPR-14: ZKP-Compatible Reputation Sharing: The reputation summary derived from PPRs must be ZKP-compatible, allowing agents to produce proofs of the form "I have at least N claims of type T" without revealing the counterparties, timestamps, or raw scores. This is a prerequisite for privacy-preserving meritocracy — governance access based on contribution without requiring surveillance.
  • REQ-PPR-15: Cross-Network Reputation Export: The ReputationSummary must be exportable as a PortableCredential (see REQ-AGENT-12), signed by a Primary Accountable Agent and countersigned by the claim owner, verifiable by receiving networks. Without portability, contribution history cannot flow across organisational boundaries, blocking growth of the P2P ecosystem.

8. Security & Access Control

8.1 Capability-Based Security

  • REQ-SEC-01: Capability Tokens: Use capability tokens to manage access rights (general for Simple Agents, restricted for Accountable Agents)
  • REQ-SEC-02: Role-Based Access: Economic Processes enforce role-based access control with validated credentials
  • REQ-SEC-03: Cross-Zome Validation: Maintain transactional integrity across zome boundaries

8.2 Privacy Architecture

  • REQ-SEC-04: Private Identity: Personal identification information stored as Holochain private entries
  • REQ-SEC-05: Private Receipts: Participation receipts stored privately while enabling reputation derivation
  • REQ-SEC-06: Selective Disclosure: Agents control what private information to share and with whom

8.3 Network Security

  • REQ-SEC-07: Membrane Validation: DNA membrane controls network entry (permissionless for PoC with validation hooks)
  • REQ-SEC-08: Dispute Resolution: Edge-based dispute resolution involving recent interaction partners
  • REQ-SEC-09: Reputation Protection: False claims and end-of-life abuse severely impact Agent reputation

9. Technical Architecture Requirements

9.1 Zome Structure

The hApp must be structured with three zomes:

  • zome_person: Agent identity, roles, reputation, and private data management
  • zome_resource: Resource specifications, economic resources, and process management (pure data model)
  • zome_governance: Validation, commitments, claims, and PPR issuance

9.2 ValueFlows Compliance

  • REQ-ARCH-01: REA Model: Implement Resources, Events, Agents pattern with Economic Processes
  • REQ-ARCH-02: Standard Actions: Support all relevant ValueFlows actions with nondominium-specific extensions
  • REQ-ARCH-03: Multi-Layer Ontology: Support Knowledge, Plan, and Observation levels

9.3 Modular Governance Architecture

REQ-ARCH-07: Modular Governance: The resource zome operates as a pure data model, while the governance zome operates as a state transition operator. This separation enables independent evolution of data structures and governance rules.

Business Benefits:

  • Swappable Governance: Governance rules can be updated without modifying resource data structures
  • Independent Evolution: Data model and governance logic can evolve separately
  • Clear Separation of Concerns: Data management separated from business logic enforcement
  • Testability: Governance logic can be tested independently of data management

REQ-ARCH-08: Swappable Governance: Governance rules and validation logic must be modifiable without changing the resource data model. Different governance schemes can be applied to the same resource types.

Business Value:

  • Future-Proof: System can adapt to new governance requirements without data migration
  • Multi-Tenancy: Different governance rules can be applied in different contexts
  • Experimentation: New governance approaches can be tested without disrupting existing data

REQ-ARCH-09: Cross-Zome Interface: Well-defined interfaces between resource and governance zomes must support all state transitions while maintaining clear separation of responsibilities.

Interface Requirements:

  • State Transition Requests: Resource zome requests state changes from governance zome
  • Governance Decisions: Governance zome provides validation and new state decisions
  • Event Generation: All state changes must generate corresponding economic events
  • Audit Trail: Complete history of governance decisions and state changes

REQ-ARCH-10: Event-Driven State Changes: All resource state changes must generate corresponding economic events to maintain complete ValueFlows compliance and audit trails.

Event Requirements:

  • Complete History: Every state transition must be recorded as an economic event
  • Governance Context: Events must include governance decision context
  • ValueFlows Compliance: Events must follow ValueFlows standard patterns
  • Reputation Integration: Events must support PPR generation for reputation tracking

9.4 Data Integrity

  • REQ-ARCH-04: Entry Validation: Comprehensive validation logic in integrity zomes
  • REQ-ARCH-05: Link Management: Proper linking between related entries across zomes
  • REQ-ARCH-06: State Management: Resource and process state tracking with proper transitions

10. Future Enhancements

Phase 2 Requirements

  • Advanced governance rule engines with conditional logic
  • Automated validation workflows and smart contracts
  • Enhanced dispute resolution mechanisms
  • Cross-network resource sharing protocols

Phase 3 Requirements

  • Integration with external governance systems
  • Advanced reputation algorithms and trust networks
  • Scalable validation schemes for large networks
  • Economic incentive mechanisms and value accounting

11. Future Development: Architecture Variants for P2P and Organizational Contexts

11.1 Context Overview

As Nondominium evolves beyond proof-of-concept, two distinct deployment contexts emerge:

  • Pure P2P Context: Individual humans directly using Nondominium for peer-to-peer resource sharing
  • Organizational Context: Organizations (using ERPs or web platforms like Tiki) accessing Nondominium through bridge services

While the core ValueFlows logic and resource model remain consistent, the governance, identity, and security layers require significant architectural adaptations to serve both contexts effectively.

11.2 Identity & Delegation Requirements

Pure P2P Context

  • REQ-FUT-P2P-ID-01: Support direct 1:1 mapping between human individuals and Holochain agent keys
  • REQ-FUT-P2P-ID-02: Enable personal device-based key management with biometric or password protection
  • REQ-FUT-P2P-ID-03: Support direct agency where the individual is the sole signer and decision-maker

Organizational Context

  • REQ-FUT-ORG-ID-01: Support organizational agent identities representing legal entities (e.g., "Acme Corp")
  • REQ-FUT-ORG-ID-02: Implement delegation pattern where employee keys can sign on behalf of organizational agents
  • REQ-FUT-ORG-ID-03: Support scoped delegations with specific capabilities (e.g., "Transport only", "Use up to $1000 value")
  • REQ-FUT-ORG-ID-04: Support time-limited delegations with automatic expiry
  • REQ-FUT-ORG-ID-05: Enable immediate delegation revocation (e.g., when employee leaves) without changing organizational identity
  • REQ-FUT-ORG-ID-06: Track which delegate performed which action for internal organizational audit
  • REQ-FUT-ORG-ID-07: Support delegation hierarchies (e.g., manager delegates to team lead, who delegates to employees)

11.3 Reputation & Accountability Requirements

Pure P2P Context

  • REQ-FUT-P2P-REP-01: All reputation (PPRs) accrues directly to the individual agent
  • REQ-FUT-P2P-REP-02: Support full reputation portability across contexts and networks
  • REQ-FUT-P2P-REP-03: New users start with zero reputation and build it through transactions

Organizational Context

  • REQ-FUT-ORG-REP-01: External reputation accrues to the organizational agent, not individual delegates
  • REQ-FUT-ORG-REP-02: Support internal attribution linking PPRs to specific delegates (hashed/private)
  • REQ-FUT-ORG-REP-03: Enable organizational reputation inheritance for new delegates
  • REQ-FUT-ORG-REP-04: Distinguish between organizational performance and individual delegate performance
  • REQ-FUT-ORG-REP-05: Support aggregation of delegate performance into organizational reputation metrics
  • REQ-FUT-ORG-REP-06: Maintain privacy of internal organizational structure while supporting accountability

11.4 Governance & Decision-Making Requirements

Pure P2P Context

  • REQ-FUT-P2P-GOV-01: Support ad-hoc, autonomous decision-making by individuals
  • REQ-FUT-P2P-GOV-02: Enable social negotiation of resource access terms
  • REQ-FUT-P2P-GOV-03: Support simple template-based governance rules

Organizational Context

  • REQ-FUT-ORG-GOV-01: Support policy-driven, automated decision-making based on organizational rules
  • REQ-FUT-ORG-GOV-02: Enable automated approval of resource requests based on criteria (e.g., credit score thresholds)
  • REQ-FUT-ORG-GOV-03: Support multi-signature requirements for high-value transactions
  • REQ-FUT-ORG-GOV-04: Enable threshold-based governance (e.g., 2-of-3 delegates must approve)
  • REQ-FUT-ORG-GOV-05: Support integration with organizational policy engines
  • REQ-FUT-ORG-GOV-06: Enable organizational administrators to configure governance rules without code changes

11.5 Custody & Ownership Requirements

Pure P2P Context

  • REQ-FUT-P2P-OWN-01: Support convergent custody and ownership (same person)
  • REQ-FUT-P2P-OWN-02: Handle temporary custody transfers (lending) and permanent ownership transfers (selling/giving)
  • REQ-FUT-P2P-OWN-03: Simple custody validation based on physical possession

Organizational Context

  • REQ-FUT-ORG-OWN-01: Support divergent custody and ownership (organization owns, employee holds custody)
  • REQ-FUT-ORG-OWN-02: Track internal organizational custody transfers without triggering ownership change events
  • REQ-FUT-ORG-OWN-03: Support location tracking for organizational resources
  • REQ-FUT-ORG-OWN-04: Enable attachment of legal contracts (hashed PDFs) to commitments and events
  • REQ-FUT-ORG-OWN-05: Distinguish between internal organizational moves and external transfers
  • REQ-FUT-ORG-OWN-06: Support organizational inventory reconciliation with Nondominium state

11.6 Device & Session Management Requirements

Pure P2P Context

  • REQ-FUT-P2P-DEV-01: Support personal, single-user devices
  • REQ-FUT-P2P-DEV-02: Simple biometric or password-based security
  • REQ-FUT-P2P-DEV-03: Keys stored securely on personal devices
  • REQ-FUT-P2P-DEV-04: Support standard consumer mobile platforms (iOS, Android)

Organizational Context

  • REQ-FUT-ORG-DEV-01: Support shared devices (e.g., warehouse tablets used by multiple employees)
  • REQ-FUT-ORG-DEV-02: Enable rapid delegate login/logout on shared devices
  • REQ-FUT-ORG-DEV-03: Support BYOD (Bring Your Own Device) with organizational key management
  • REQ-FUT-ORG-DEV-04: Integrate with organizational IAM/SSO systems (OAuth, SAML)
  • REQ-FUT-ORG-DEV-05: Map organizational authentication tokens to Holochain capability tokens
  • REQ-FUT-ORG-DEV-06: Support enterprise device management policies
  • REQ-FUT-ORG-DEV-07: Enable remote device key revocation for security

11.7 Bridge Integration Requirements

Organizational Context (ERP/Web Platform Bridges)

  • REQ-FUT-ORG-BRG-01: Support RESTful bridge services using Node.js and @holochain/client
  • REQ-FUT-ORG-BRG-02: Enable bidirectional synchronization between organizational systems and Nondominium
  • REQ-FUT-ORG-BRG-03: Support real-time signal forwarding from Holochain to organizational systems
  • REQ-FUT-ORG-BRG-04: Enable batch operations for efficiency in organizational contexts
  • REQ-FUT-ORG-BRG-05: Support caching strategies for frequently accessed organizational data
  • REQ-FUT-ORG-BRG-06: Enable webhook-based event notification to organizational systems
  • REQ-FUT-ORG-BRG-07: Support organizational resource publishing from ERP inventory systems
  • REQ-FUT-ORG-BRG-08: Enable organizational authentication mapping (OAuth/session tokens to agent keys)
  • REQ-FUT-ORG-BRG-09: Support deployment via Docker containerization for organizational IT environments
  • REQ-FUT-ORG-BRG-10: Enable organizational administrators to monitor bridge health and performance

11.8 Architecture Modularity Requirements

  • REQ-FUT-ARCH-01: Design modular architecture supporting both P2P and organizational contexts
  • REQ-FUT-ARCH-02: Core ValueFlows and resource model must remain context-agnostic
  • REQ-FUT-ARCH-03: Governance and identity layers must support pluggable implementations
  • REQ-FUT-ARCH-04: Support seamless interoperability between P2P agents and organizational agents
  • REQ-FUT-ARCH-05: Enable organizations to act as agents in the P2P network with equal standing
  • REQ-FUT-ARCH-06: Support mixed-mode transactions (P2P individual borrowing from organization)
  • REQ-FUT-ARCH-07: Maintain unified reputation and trust framework across contexts

11.9 Privacy & Compliance Requirements

Pure P2P Context

  • REQ-FUT-P2P-PRIV-01: Minimize data collection to essential transaction information
  • REQ-FUT-P2P-PRIV-02: User controls all personal data disclosure
  • REQ-FUT-P2P-PRIV-03: Support pseudonymous participation

Organizational Context

  • REQ-FUT-ORG-PRIV-01: Support organizational data retention and audit requirements
  • REQ-FUT-ORG-PRIV-02: Enable compliance with organizational security policies
  • REQ-FUT-ORG-PRIV-03: Support organizational data export for regulatory compliance
  • REQ-FUT-ORG-PRIV-04: Maintain separation between organizational data and public DHT data
  • REQ-FUT-ORG-PRIV-05: Support organizational right-to-delete while preserving transaction integrity

11.10 Implementation Priority

Phase 1 (Current): Pure P2P implementation with direct agent-person mapping

Phase 2 (Future Development):

  • Delegation pattern implementation
  • Organizational reputation aggregation
  • Basic bridge service architecture

Phase 3 (Future Development):

  • Advanced multi-signature governance
  • Enterprise device and session management
  • Full IAM/SSO integration
  • Production-ready organizational bridges

12. Success Criteria

The nondominium system is successful when:

  1. Resources remain organization-agnostic and capture-resistant
  2. Governance is transparent, fair, and community-driven
  3. Reputation system enables trust without central authority
  4. Economic Processes support real-world sharing scenarios
  5. System scales while maintaining decentralized principles
  6. Privacy is preserved while enabling accountability

Agent: Ontology, Implementation, and Forward Map

Type: Archive / Knowledge Base Document
Created: 2026-03-11
Relates to: governance.md, resources.md, ndo_prima_materia.md, unyt-integration.md, flowsta-integration.md
Sources: MVP code (zome_person, zome_gouvernance PPR/validation), post-MVP design, OVN wiki — Agent, Identity, Individual profile, Organizational structure


Purpose

This document maps the three states of Agent understanding in the Nondominium / NDO project:

  1. Implemented — what exists today in the MVP zome_person and governance-related agent handling
  2. Planned — what is designed in post-MVP documents for agent evolution
  3. Remaining — what the OVN wiki's 15 years of commons-based peer production practice contains that NDO does not yet plan for

The goal is to ensure the generic NDO agent model is as complete and principled as the OVN ontology, enabling diverse applications (resource-sharing, digital commons, open science, cooperative production) to configure agent behaviour through data, not custom code.


1. Conceptual Foundation: What is an Agent in P2P Complexity Economics?

1.1 Agent vs User — A Critical Distinction

The OVN wiki is unequivocal: "In a p2p context it is not advised to reduce agents or affiliates to users." The word user is appropriate for centralised platforms (Facebook, Uber) where participants have no control over the platform, interact on terms set by the owner, and provide data in exchange for access. An agent, by contrast, is an entity with agency — the capacity to plan and take actions, to own its own data, and to participate in defining the rules of the system it operates within.

This is not merely semantic. The data model follows the ontology: a "user" has an account on a server that another party controls. An agent has a cryptographic key pair that they control, a source chain of their own actions that only they can append to, and relationships with other agents that are maintained on a shared DHT — not a shared database controlled by an operator. Holochain is the first infrastructure natively designed for agent-centric data models. The NDO must take this seriously from the ground up.

1.2 The Agent Type Spectrum

The OVN wiki defines agents as: "anything that can perform an action. Has agency, i.e. can also plan to take actions. Agents can be individuals, groups, projects, networks. Agents can also be bots, machines (IoT)."

This spectrum is essential. In a P2P complexity economics framework, the system must model:

  • Individual agents: human participants, each with a source chain
  • Collective agents: groups, working groups, communities — entities with collective agency
  • Project/venture agents: temporary organised efforts with their own goals and resources
  • Network agents: larger-scale communities (an OVN as a whole is also an agent in its ecosystem)
  • Artificial agents: bots, AI models, IoT devices — increasingly significant actors in the commons

The current NDO models only individual agents. This is a significant constraint for the generic NDO project, which aims to support Sensorica-style open value networks where ventures, networks, and partner organisations are themselves agents in economic processes.

1.3 Individual vs Person — The Two Layers of Agent Identity

The OVN wiki makes a distinction of deep philosophical and technical importance:

"An individual is the physical you. You exist and therefore you have access to certain things. A person is a representation of the physical you, it is an agent in a socio/economic context."

In practical terms:

  • Individual-type identity: exists by virtue of holding a cryptographic key pair. Permissionless access. No disclosure required. Like Bitcoin: you only need keys to transact. This is the foundation of the NDO's permissionless entry model.
  • Person-type identity: requires reputation, credentials, or demonstrated capabilities earned through participation. Required for sensitive processes: governance participation, custodianship, specialised service provision.

This two-layer model is not bureaucratic gatekeeping — it is a precise answer to the information-theoretic question: "what does this process require to function well?" Taking the bus requires a ticket, not identification. Performing surgery requires credentials. The NDO must distinguish which processes are ticket-level (individual-type) and which require person-type identity, and build the appropriate mechanisms for each.

In complexity economics terms: forcing all interactions through person-type identity is a high information-overhead solution applied to low-information-need situations. It reduces participation, increases friction, and creates centralisation risks (who issues the credentials?). The OVN model, and therefore the NDO model, reserves person-type identity for the specific processes that genuinely need it.

1.4 Identity ≠ Credentials

The OVN wiki offers a clarifying thought experiment: "When you take the bus you don't need to tell the driver all about yourself before boarding, you just show your ticket, which is the credential required to access the transportation service."

Credentials are context-specific access tokens derived from past actions or present conditions. They are not identity. You can prove you can safely use a 3D printer (credential) without revealing who you are (identity). This distinction, made precise through zero-knowledge proof technology, is the foundation for privacy-preserving participation in P2P systems.

The implications for NDO agent design: the system should be designed so that agents prove what they can do through minimally-revealing credentials, not by revealing who they are through full identity disclosure. This is currently only partially implemented: the PPR system generates verifiable contribution records (a form of capability credential), but there is no ZKP layer to share them without revealing the underlying data.

1.5 Agent as Network Node: Social Capital and Interconnection

The OVN wiki's individual profile description captures a dimension of agents often overlooked in technical implementations: an agent's profile includes "social relations (connections with other agents), which can be seen as social capital, may be shared in context / processes, part of the wealth structure of a network" and "network affiliations."

Social capital — the value embedded in relationships and network position — is an intangible resource that the NDO system should make legible, not obscure. In complexity economics, information flows through social networks, and an agent's connectivity is a measure of their access to collective intelligence. The individual profile should capture relational wealth, not just transactional history.

1.6 The Long Tail of Agent Engagement

From the governance archive, the OVN operates with a 1-9-90 engagement distribution: 1% core (entrepreneurial, high commitment), 9% active contributors, 90% occasional participants. This is not a design flaw — it is universal in open networks. The agent model must be designed for this reality.

An agent system designed only for the 1% (assuming high engagement, rich profiles, continuous participation) will exclude the 99% who should still be able to participate meaningfully at their actual engagement level. The affiliation model (unaffiliated → close → active → core) is the OVN's answer to this: design for the full spectrum, not just the core.


2. Current Implementation (MVP)

2.0 Three-Level Identity Model (UI)

The MVP UI introduces three distinct identity layers that reflect the Lobby → Group → NDO hierarchy defined in ui_design.md. These layers are intentionally separate: they allow progressive disclosure of personal information and defer DHT costs until the agent acts.

Level 1 — Lobby (UI-only, localStorage)

LobbyUserProfile is the outermost, lightest identity layer. It is never written to the DHT.

FieldRequiredNotes
nicknameYesDisplayed in the Lobby profile bar and Group profile
realNameNoOptional; user controls whether it is shared in groups
bioNoOptional
emailNoOptional
phoneNoOptional
addressNoOptional
  • Stored in localStorage under the key ndo_lobby_profile_v1.
  • Written to app.context.lobbyUserProfile (Svelte $state) on every page load.
  • Created via UserProfileForm.svelte (modal on first launch; page-mode for editing).
  • Exists before any Person DHT entry is created. An agent can browse the Lobby anonymously (no profile) or under a pseudonym (nickname only).

Level 2 — Group (UI-only, localStorage)

GroupMemberProfile is a per-group presentation choice derived from LobbyUserProfile. It is also never written to the DHT (Groups are localStorage-persisted shells for the MVP; Group DNA is a post-MVP deliverable).

FieldTypeNotes
isAnonymousbooleanIf true, the agent appears only by pseudonym
shownFields(keyof LobbyUserProfile)[]Fields from LobbyUserProfile the agent explicitly consents to share
  • Stored alongside the GroupDescriptor in localStorage under ndo_groups_v1.
  • Prompted via GroupProfileModal.svelte on first entry to each group.
  • No consensus or DHT record required; this is a purely local choice.

Level 3 — NDO / Agent (DHT, zome_person)

Person is the public, on-chain agent profile. It is created when the agent performs their first DHT-active action — creating an NDO or accepting a commitment. This layer corresponds to the "person-type identity" described in §1.3.

  • Written to the DHT via create_person in zome_person.
  • Linked to the agent's AgentPubKey through Holochain's source chain.
  • Required for governance participation, custodianship, and specialised service provision.
  • Discoverable by other agents via the all_persons anchor.

This three-level model enables permissionless browsing (Level 1 not required), group participation under a pseudonym (Level 2), and full economic participation (Level 3), without conflating disclosure requirements across contexts.

Cross-reference: ui_design.md MVP section describes the intended UI flow. Implementation lives in app.context.svelte.ts (lobbyUserProfile), lobby.service.ts (GroupDescriptor.memberProfile), UserProfileForm.svelte, GroupProfileModal.svelte, and GroupSidebar.svelte.


2.1 The Two-Layer Identity Model in Code

The NDO MVP implements the individual/person distinction at the data model level:

Individual layer — the Holochain AgentPubKey:

  • Cryptographic key pair generated locally by the agent
  • Source chain is agent-owned and agent-controlled
  • Permissionless network entry (validate_agent_joining returns ValidateCallbackResult::Valid unconditionally)
  • No disclosure required for basic read access to the DHT

Person layer — the Person entry (public) + PrivatePersonData entry (private):

#![allow(unused)]
fn main() {
pub struct Person {
    pub name: String,
    pub avatar_url: Option<String>,
    pub bio: Option<String>,
}

pub struct PrivatePersonData {
    pub legal_name: String,
    pub email: String,
    pub phone: Option<String>,
    pub address: Option<String>,
    pub emergency_contact: Option<String>,
    pub time_zone: Option<String>,
    pub location: Option<String>,
}
}

Person entries are the public identity anchor — discoverable via the AllPersons anchor, versioned (via PersonUpdates links), and permanently immutable once created (validate_delete_person returns Invalid). They cannot be deleted: consistent with the OVN principle that contribution records and identity anchors must be permanent.

PrivatePersonData is a Holochain private entry stored only on the agent's source chain, accessible to others only through explicit capability grants.

2.2 The Capability-Based Private Data System

The MVP implements a sophisticated field-level capability sharing system for private data:

PrivateDataCapabilityMetadata: tracks each capability grant issued by an agent:

  • granted_to, granted_by, fields_allowed (subset of: email, phone, location, time_zone, emergency_contact, address)
  • context: why the access was granted
  • expires_at with a hard-coded 30-day maximum duration
  • cap_secret: stored locally for revocation

RevokedGrantMarker: explicit revocation record (important because Holochain native capability revocation is silent — this creates an auditable revocation trail)

FilteredPrivateData: the view of private data after capability filtering — what the other agent actually sees given their access level

This system implements the OVN principle of "absolute privacy by default" with agent-controlled selective disclosure. The legal_name field is notably never shared (not in allowed_fields), preserving the individual/person separation at the field level.

2.3 The Role System — Four Capability Levels

The MVP implements a six-role system across two dimensions:

Governance tiers (progressive trust levels):

  • SimpleAgent (member) — permissionless entry; basic participation
  • AccountableAgent (coordination) — validated private identity; can validate others; can initiate process commitments
  • PrimaryAccountableAgent (governance) — highest trust; can promote agents; can approve governance decisions

Functional service roles (validated competencies):

  • Transport, Repair, Storage (stewardship level)

Capability level hierarchy: member < stewardship < coordination < governance

The promotion workflow is a cross-zome interaction:

SimpleAgent → Accountable:
  1. Agent calls request_role_promotion("Accountable Agent")
  2. System validates private data exists (legal_name, email required)
  3. Cross-zome call: governance.validate_agent_for_promotion()
  4. Accountable/Primary agent approves: approve_role_promotion()
  5. Cross-zome call: governance.validate_agent_identity() (with first_resource_hash)
  6. Role entry created and linked to Person

Accountable → Primary:
  1. Requires PPR milestones (governance_claims in ReputationSummary)
  2. Specialized role validation for functional roles
  3. Governance-level approver required

The promotion workflow correctly implements the OVN's "access to governance is earned through contribution" principle. Simple agents exist (permissionless) but cannot act as validators or custodians without establishing person-type identity.

2.4 Multi-Device Agent Architecture

The MVP's most technically sophisticated agent-layer contribution: a clean many-to-many Agent ↔ Person relationship model.

AgentPersonRelationship: explicitly models the link between a cryptographic key (AgentPubKey) and a persistent identity (Person hash):

  • relationship_type: Primary (initial device), Secondary (additional devices), Device (dedicated device agents)

Device entry: tracked per physical device with device_id, device_name, device_type (mobile/desktop/tablet/web/server), registration, last-active timestamps, and revocable DeviceStatus.

Bidirectional links: AgentToPerson (key to identity) and PersonToAgents (identity to all associated keys) enable multi-device coordination without leaking any of the devices' keys.

This is a forward-looking implementation: one person may use Nondominium from a phone, a desktop, and a shared lab computer. Each device has its own key. All keys are controlled by the same person. The Person is the persistent socio-economic identity; AgentPubKeys are the session-level cryptographic instruments.

2.5 What the MVP Does Well

  • The individual/person dual layer correctly implements OVN's identity model: permissionless individual access + earned person-type credentials
  • Permanent identity anchors (Person entries cannot be deleted): enforces the OVN principle that contribution history cannot be retroactively erased
  • Field-level capability grants with 30-day expiry and explicit revocation are privacy-first by design, consistent with the OVN's "absolute privacy by default" principle
  • Multi-device architecture is pragmatic and technically sound — most systems ignore this, resulting in brittle single-key identities
  • The cross-zome promotion workflow is correctly designed: role assignment requires governance validation, not just peer-to-peer agreement
  • Functional roles as validated competencies (not just trust levels) introduce the credential concept correctly, even if without portability

2.6 Known Gaps in the MVP

GapOVN relevanceImpact
Only individual agentsOVN: groups, projects, networks, bots are also agentsCannot model collective agency, AI participants, or network-level actors
Person profile is minimal (name/avatar/bio)OVN: profile contains contributions, roles, artifacts, social relations, affiliationsCannot produce a rich agent profile for governance or contribution accounting
No contribution aggregation in profileOVN: profile is "window into the past" and "predictive tool"ReputationSummary is separate; not discoverable as part of agent profile
No credential portabilityOVN: profile must be portable across networksRoles and PPRs are local to this DNA instance
Roles are closed (6 predefined)OVN: roles emerge from community needsCommunities cannot define their own role taxonomies
No zero-knowledge proofsOVN: "prove capability without providing access to data"Agents must reveal private data to prove eligibility
No affiliation typesOVN: unaffiliated / close / active / core / inactive spectrumCannot model the long tail of engagement; all non-members look the same
No social graphOVN: social relations are part of profile / social capitalCannot surface network wealth or organisational reach
No agent type taxonomyOVN: individual, group, project, network, botEverything is modeled as an individual human
Promotion is partially stubbedrequest_role_promotion returns a placeholder hashPromotion requests cannot be queried or tracked
Legal_name is never sharedAppropriate for most use cases but inflexibleCannot support cases where legal identity sharing is required (e.g., insurance, legal agreements)
No cross-app identity or DIDOVN: portable profile across networks; agents as bridge nodes between OVNsAgents cannot prove they are the same person on another Holochain app; reputation and roles stay local to this DNA. Planned: FlowstaIdentity CapabilitySlot on Person hash, W3C DID via Flowsta agent linking (ndo_prima_materia.md Section 6.7)
No deterministic key recoveryPermanent Person and PPR model assume long-lived signing keysDevice loss can strand the agent from their source chain and private entries. Planned: Flowsta Vault BIP39 recovery, auto-backup, CAL-compliant export (ndo_prima_materia.md Section 6.7)

3. Post-MVP Roadmap

3.1 Collective Agents and Their Digital Twins

A collective entity — a project-as-organisation, a cooperative, an open value network — has two distinct ontological faces in the Nondominium model. These faces are different roles the same real-world entity plays, and they must not be collapsed into one.

The agent face is the AgentContext carrying the relevant AgentEntityType variant (Collective, Project, Network). Through this face the collective participates in economic events as provider or receiver, holds commitments, accumulates reputation, and may be the primary_accountable on shared resources. Collective agents of this kind are composed agents or group agents: their actions may require N-of-M authorisation from individual member agents (multi-signature pattern — forward design, post-MVP). This is how REA-ontology-compliant collective economic agency works — it is distinct from the physical thing the collective creates or represents.

The resource face is the NondominiumIdentity — the collective's digital twin as a Nondominium Object. NDOs are Resources, and the resource face of a collective carries its permanent identity anchor, property regime, lifecycle stage, specification (what the collective IS — its mission, assets, rules of participation), and governance rules (how agents interact with it). The resource face does not have agency; it records which agents are associated and under what terms.

The ActionHash inside AgentEntityType::Project(ActionHash) and AgentEntityType::Network(ActionHash) links the agent face to the resource face: it points to the NondominiumIdentity that is the collective's digital twin. The two faces are thus connected by this hash reference.

Agent faceResource face
Entry typeAgentContextNondominiumIdentity
Role in economic eventsProvider / receiver— (no agency)
AccumulatesReputation (PPRs, EconomicEvents)Contribution records (individual agents who contributed)
Can hold custodyYes — via AgentContext as primary_accountableNo
Has lifecycle/spec/governanceYes — LifecycleStage, ResourceSpecification, GovernanceRules
Permanent / immutableNoYes — NondominiumIdentity is permanent

An individual agent can hold a PersonRole in both their own profile and in a collective's governance. Cross-agent capability grants enable a collective's AgentContext to act on behalf of its members (with appropriate authorisation).

A Collective(String) agent (e.g. a working group or committee) may not yet have an associated NDO — its agent face exists independently of any resource face. Attaching a resource face (creating an associated NondominiumIdentity) is optional and done when the collective's digital representation as a Resource becomes useful.

When a collective does have an associated NDO, the NDO's three-layer structure (Identity + Specification + Process) applies to the collective's resource face — not to the collective as an agent:

  • NDO Identity layer = the collective's permanent identity anchor (name, regime, nature, creation record)
  • NDO Specification layer = the collective's documented form (mission, assets, governance rules for how agents interact with it)
  • NDO Process layer = the economic activity around the collective as a resource (contributions, agreements, events involving the collective-as-resource)

The NDO may use a subset of LifecycleStage values — a working group does not go through Prototype or Distributed. The PropertyRegime and ResourceNature fields on NondominiumIdentity remain applicable to the collective's resource face: a working group's shared knowledge base is a Commons/Digital NDO; a collectively owned workshop is a Collective/Physical NDO.

3.2 CapabilitySlot on Agent Identity

The NDO CapabilitySlot surface (from ndo_prima_materia.md) can be extended to agent identities: an agent's Person entry hash becomes a stigmergic attachment point for external applications — credential wallets, reputation oracles, DID documents, professional networks — without modifying the core Person entry. This is the agent-level equivalent of the resource-level CapabilitySlot.

Flowsta Auth (ndo_prima_materia.md Section 6.7) is the first specified implementation: a FlowstaIdentity CapabilitySlot from the Person entry hash to an IsSamePersonEntry (dual-signed attestation: NDO agent key + Flowsta Vault key), yielding a W3C DID (did:flowsta:uhCAk...) without changing the Person schema. Full architecture, two-tier identity authority, and integration phases are summarised in Section 3.5 below.

3.3 Composable Profile Aggregator

A post-MVP AgentProfile view that composes:

  • Person (public identity)
  • ReputationSummary (derived from PPRs)
  • PersonRole list
  • Participation statistics (economic event counts by category)
  • Capability slot attachments (external credentials, DIDs)

This view is not stored as a new entry type — it is computed from existing DHT data. But exposing it as a queryable composite is the key step toward the OVN individual profile model.

3.4 Credential Portability via Holochain Membrane Proofs

Post-MVP: a mechanism to export cryptographically signed summaries of an agent's role assignments and ReputationSummary that can be verified by other Holochain networks. This implements the OVN requirement for portable identity: a person's contribution track record in one community should be recognisable in another.

Flowsta agent linking provides a cross-app identity anchor (DID) so ReputationSummary and participation history can be attributed across Flowsta-linked apps; full PortableCredential structures (this document, Section 6.5) remain the NDO-native export path — the two are complementary (ndo_prima_materia.md Section 6.7, PPR cross-app attribution).

3.5 Flowsta Integration (flowsta-integration.md)

Decentralized identity and authentication for Holochain apps: agent linking commits IsSamePersonEntry on this DNA via flowsta-agent-linking zomes; FlowstaIdentity CapabilitySlot on the agent's Person entry hash points to that attestation. Tier 1 (Flowsta Phase 1): permissionless self-attestation (trust signal; REQ-NDO-CS-12/CS-13). Tier 2 (Flowsta Phase 3): governance can require a valid Flowsta link for sensitive transitions (e.g. PrimaryAccountableAgent promotion, high-value custody) via IdentityVerification-style rules (REQ-NDO-CS-14/CS-15). Flowsta Vault: BIP39 recovery, encrypted auto-backups, CAL-aligned export — addressing the gap between permanent Person/PPR anchors and real-world key loss. OAuth-only path (@flowsta/auth): consistent DID across web apps while the app keeps its own Holochain keys (Flowsta docs "Option 1"); Vault path ("Option 2") is the one that produces IsSamePersonEntry on the NDO DHT. See ndo_prima_materia.md Section 6.7 and Section 11.6; see also resources.md Section 3.8 for resource-ontology cross-links.


4. OVN Agent Ontology: 15 Years of Practice

4.1 Agent Type Taxonomy

The OVN wiki classifies agents into four primary types:

Agent typeExamplesNDO support
IndividualHuman participants, affiliates✅ Implemented (Person + AgentPubKey)
Group/CollectiveWorking groups, committees❌ Gap: no collective agent type
Project/VentureAn open hardware project, a design sprint❌ Gap: ventures are implicit in resources, not agents
NetworkAn OVN as an entity in the ecosystem❌ Gap: no network-level agent
ArtificialBots, AI models, IoT devices❌ Gap: no bot/machine agent type

In the REA model used by Sensorica, economic agents can represent:

  • An individual
  • A project/venture (another network or autonomous open business unit)
  • Another network (cross-OVN interactions)
  • A traditional organisation (partner, supplier, funder)

The NDO currently only models the individual case. For the generic NDO to support Sensorica-style operations, at minimum group/collective and project/venture agent types are needed.

Complexity economics note: The omission of collective agents is not just an inconvenience — it makes it impossible to model the actual economic events in many commons-based peer production contexts. When Sensorica licenses a sensor to a university, the economic agents are Sensorica (a network) and the university (a traditional organisation), not individual humans. Without collective agent types, the economic model is systematically misrepresented.

4.2 The Affiliation Spectrum

The OVN wiki defines five affiliation states that capture the long tail of participation:

Unaffiliated: anonymous; accesses public information only; no obligations; not known by affiliates.

Close affiliate: not yet contributed in a trackable way; known by some affiliates; can access database and some activities; no formal obligations but respects OVN's assets.

Active affiliate: has logged contributions in the NRP-CAS AND is recognised by the community; has access to OVN infrastructure, governance, and production assets; must adhere to the Benefit Redistribution Algorithm and affiliation conditions.

Core affiliate: algorithmically selected from active affiliates based on contribution + reputation; special privileges within specific projects or ventures; status is dynamic (in/out based on contribution; can expire through inactivity).

Inactive affiliate: previously contributed, currently inactive; access to some activities; can re-engage by contributing again.

Formal affiliation: becoming an active affiliate formally consists of:

  1. Acknowledging the Affiliate Handbook
  2. Acknowledging the Nondominium & Custodian agreement
  3. Signing the "Acknowledgement of Knowledge Commons" agreement
  4. Signing the Benefit Redistribution Algorithm agreement

The NDO currently has only two states: joined (has a Person entry) and not joined. There is no modelling of engagement depth, affiliation conditions, formal affiliation agreements, or the core/active/close/inactive spectrum. This means the system cannot algorithmically determine who should participate in a governance decision (active affiliates only? core affiliates? anyone with a Person entry?), cannot manage the onboarding process, and cannot track affiliation lifecycle.

4.3 The Individual Profile as Composable Aggregate

The OVN wiki defines the individual profile as "a digital environment that aggregates information and data about Agents." Key properties:

Composable: can contain roles, reputation, contributions, artifacts, social relations, network affiliations, credentials, available assets, needs/wants.

Standard format: portable across contexts.

Non-transferable: cannot be reassigned from one individual to another (analogous to soul-bound tokens). The link to the physical self must be unique.

Portable: "An individual can participate in more than one OVN simultaneously... enables the individual to transport his/her reputation and credentials from one cluster of economic activities to another."

Owner-controlled: the agent controls what is shared, with whom, for what purpose, and for how long. But crucially: some parts are write-protected — "applications can write data about contributions, roles, and reputation, which cannot be deleted by the affiliate in question." This is exactly what the NDO implements with immutable Person entries and private-but-signed PPRs. The profile owner cannot delete their contribution history, but controls what they reveal.

Predictive: "can be used as a predictive tool, to judge if a future action or relation would be beneficial."

Agency-extended: "The individual profile can even have agency in the digital world. It can be AI-enhanced to act on behalf of the real agent in some circumstances, sign contracts based on predefined rules."

The NDO currently splits what should be the individual profile across at least four separate concepts: Person, PrivatePersonData, ReputationSummary, and PersonRole. These are correct building blocks but lack the composable aggregation layer that would make the profile a genuine OVN individual profile.

4.4 Identity Architecture: SSI, DIDs, VCs, ZKP

The OVN wiki synthesises the state of the art in decentralised identity:

Self-Sovereign Identity (SSI): The individual controls their own identity data; no third party can revoke or modify it without the individual's consent. Roles in the SSI ecosystem: issuer (issues credentials), wallet (stores and provides), validator (requests and obtains), revoker.

Decentralised Identifiers (DIDs): W3C-standardised unique identifiers for individuals and organisations that are independent of any centralised registry, resolved through decentralised systems. DIDs enable "a direct, encrypted channel for p2p communication" and portability from one transport or security context to another.

Verifiable Credentials (VCs): "Sets of claims about an agent of which the provenance and immutability can be proved." ZKP-compatible: an agent can prove "I have a credential that satisfies condition X" without revealing the credential's full contents.

Soul-bound tokens: non-transferable, non-sellable reputation tokens. The OVN wiki references these as one potential mechanism for non-transferable credentials. The NDO's Person entries (non-deletable) and PPRs (bilaterally signed, private) are soul-bound-like, but not interoperable with external VC/DID ecosystems.

Portability challenge: "I can gain some credentials based on activities in one organization/context and have that, or only a part of it, being recognized in another context." This is the core portability requirement. The technical path: ZKP-based proofs from Holochain source chains that can be verified by other Holochain networks or other distributed systems.

Near-term bridge — Flowsta: Flowsta supplies W3C DIDs and dual-signed agent linking (IsSamePersonEntry on the NDO DHT, ndo_prima_materia.md Section 6.7) so the same human can be recognised across Holochain conductors without shared DNA. PrivateParticipationClaim entries remain non-transferable and bound to the local AgentPubKey; reputation summaries can nevertheless be attributed to a DID for cross-app trust — the same distinction as resources.md Section 4.6 (attribution portability is not claim transferability). REQ-NDO-AGENT-08 positions the Flowsta DID as the cross-network identity anchor for portable credentials. ZKP/VC layers remain the longer-term path for minimally revealing proofs at scale.

The identity insurance alternative: the OVN wiki cites Vinay Gupta's proposal that what P2P systems need is not reputation but restorative justice — insurance that compensates you if an agent acts in bad faith. "If I present you with proof that I am insured against bad conduct, and you trust my insurer will pay, REPUTATION is suddenly a whole bunch less important." This is a provocative alternative to the PPR approach: rather than tracking reputation to prevent bad actors, use economic backstops to make bad acting unprofitable. The NDO's Unyt Smart Agreement integration could potentially implement this pattern.

4.5 Privacy vs Network Efficiency

The OVN wiki frames this as a genuine tension with no universal solution: an agent's contribution history can improve network efficiency (matching to tasks, governance access, trust in new interactions) but also creates a privacy risk (triangulation of physical identity, de-platforming vulnerability).

The OVN wiki's resolution: "the agent must be given the choice, allow an individual profile to be formed from past activity or not, weighing the pros and cons, the benefits and the potential harm." The NDO's private-but-derivable PPR system partially implements this: agents sign PPRs (opting into accountability) but control how their ReputationSummary is shared. The gap is that there is currently no mechanism for an agent to participate partially — all PPRs follow the same model.

A more complete implementation would allow agents to choose their privacy level per interaction:

  • Full anonymity: no PPRs, no reputation accumulation, no access to governance
  • Pseudonymous: PPRs linked to a persistent pseudonym, not to physical identity
  • Named: PPRs linked to public Person entry

This spectrum maps to the OVN's individual/person identity model: individual-level participation (anonymous), person-level participation (reputation-accumulating), and fully identified participation (legal accountability for high-trust processes).

4.6 Agent Profile and Network Wealth

The OVN wiki's individual profile description includes something not present in most technical systems: network affiliations as a form of organisational wealth. "The information about affiliations can be used... to assess the organic reach into other organisational contexts, beyond the immediate zone of influence of the context. This allows surfacing of a new form of network wealth, its influence or degree of connectivity with other networks within the ecosystem, provided by the number of relations extending from the context network to other networks, through agents."

An agent who participates in multiple OVNs is a bridge node — a carrier of information, trust, and potential collaboration across network boundaries. This agent's profile is not just a personal record; it is a piece of the network's connective tissue. Making this visible makes the network's resilience and reach legible.

The NDO currently has no social graph and no multi-network affiliation model. An agent is either in this network or not. The generic NDO should model the OVN's insight that agents are simultaneously nodes in multiple overlapping networks, and that this multi-membership is itself a form of value.


5. Gap Analysis

5.1 Mapped — OVN concepts implemented or planned in NDO

OVN conceptNDO implementationStatus
Individual/person identity distinctionAgentPubKey (individual) + Person entry (person-type)✅ Implemented
Permissionless individual-level accessvalidate_agent_joining unconditional pass✅ Implemented
Owner-controlled private data with selective disclosurePrivatePersonData + field-level capability grants✅ Implemented
Non-transferable, non-deletable identity anchorPerson entries are permanent (delete validation returns Invalid)✅ Implemented
Earned access to sensitive processesRole promotion requiring private data validation✅ Implemented
Contribution history write-protected from ownerBilaterally signed PPRs cannot be unilaterally deleted✅ Implemented
Multi-device supportAgent-Person many-to-many relationship model✅ Implemented
Capability expiry and explicit revocation30-day max grants + RevokedGrantMarker✅ Implemented
Composable profile building blocksPerson + PrivatePersonData + PersonRole + ReputationSummary✅ Partial (separate, not aggregated)
Functional role credentialsTransport / Repair / Storage validated competency roles✅ Implemented
Cross-app identity / DID (agent)FlowstaIdentity CapabilitySlot + Flowsta agent linking (ndo_prima_materia.md Section 6.7)🔄 Planned (post-MVP)
Agent key recovery (Vault)Flowsta Vault BIP39, auto-backup, CAL export (ndo_prima_materia.md Section 6.7)🔄 Planned (post-MVP)

5.2 Partial — concepts present in OVN and partially covered in NDO

OVN conceptNDO partial coverageGap
Affiliation spectrumJoined (has Person) vs not joinedNo close/active/core/inactive states; no affiliation conditions
Active affiliate = contribution + recognitionSimpleAgent → Accountable promotion is contribution-gatedRecognition is informal; no algorithmic determination of active affiliate status
Core affiliate = algorithmically selectedPPR-based ReputationSummary provides the dataNo algorithm using PPR data to compute core affiliate status
PortabilityRoles and PPRs are localNo export mechanism; no VC/DID interoperability yet. Planned: cross-app attribution via Flowsta DID + FlowstaIdentity slot (ndo_prima_materia.md Section 6.7); NDO-native PortableCredential export (this document, Section 6.5) remains complementary
Privacy vs efficiency trade-offAgents can share ReputationSummary selectivelyNo per-interaction privacy level choice; no pseudonymous participation mode
Agent-controlled profile sectionsPrivate data share controlledNo mechanism to protect some sections while exposing others; no correction mechanism for contributions

5.3 Missing — OVN concepts not yet planned in NDO

OVN conceptGap descriptionProposed resolution
Agent type taxonomy (individual, group, project, network, bot)Only individual agents existModel collective agents as NDOs with their own governance; add AgentType to person context
Composable individual profileProfile is split across unconnected entriesBuild AgentProfile as a composable view aggregating Person, PPR summary, roles, capability slots, affiliations
Social graph (social capital, network relations)No peer relationships modeledAdd AgentRelationship link type: bidirectional, typed (colleague, collaborator, trusted, etc.), private
Network affiliationsOnly single-network membershipModel cross-network affiliations as links from Person to other NDO instances
Affiliation conditions (formal ToP agreements)No affiliation ceremonyAdd AffiliationRecord: a hash-referenced acknowledgement of Terms of Participation + benefit redistribution agreement
Affiliation lifecycle (active/core/close/inactive)Binary in/out membershipDerive affiliation state algorithmically from PPR activity + recency; expose as queryable status
Zero-knowledge capability proofsMust reveal raw data to prove eligibilityIntegrate ZKP library or ZKP-compatible VC layer; allow prove_capability(condition) without data disclosure
Credential portability (across networks)Roles and PPRs are localFlowsta W3C DID + FlowstaIdentity CapabilitySlot on Person hash as cross-network identity anchor (REQ-NDO-AGENT-08, ndo_prima_materia.md Section 6.7); and define a PortableCredential structure: signed summary of roles + PPR statistics, verifiable by other Holochain networks
Sybil resistance mechanismNo proof-of-personhoodOptional Tier 2 governance requirement for verified Flowsta identity (REQ-NDO-CS-14) for high-trust roles; complements social vouching (existing agents vouch for new agents), biometric opt-in, or Proof-of-Personhood integration as optional membrane proof
Pseudonymous participation modeContribution always linked to AgentPubKeyAllow ephemeral agents (agent contributes under a temporary key without linking to Person); contribution is recorded but unlinkable to physical identity
Agent AI/bot delegationAgents must act manuallyDefine a DelegatedAgent relationship: a Person can authorise an AI agent to act on their behalf within defined scope
Needs and wants in profileNot modeledAdd AgentNeedsWants as an optional profile extension: what resources the agent needs and what they can offer; enables matching

6. Forward Map: Generic NDO Agent Architecture

6.1 Agent Type as Configuration, Not Hard-Code

Rather than adding parallel code paths for each agent type, the generic NDO should treat agent type as a configuration property:

#![allow(unused)]
fn main() {
pub enum AgentEntityType {
    Individual,                    // Human participant
    Collective(String),            // Group/working group (name/description)
    Project(ActionHash),           // Project NDO this agent represents
    Network(ActionHash),           // Network NDO this agent represents
    Bot { capabilities: Vec<String>, operator: AgentPubKey }, // AI/bot with declared capabilities
    ExternalOrganisation(String),  // Traditional org (name, for partner modelling)
}

pub struct AgentContext {
    pub agent_type: AgentEntityType,
    pub person_hash: Option<ActionHash>,   // None for bots/external orgs
    pub created_at: Timestamp,
    pub network_seed: String,              // Which NDO network this context belongs to
}
}

Individual agents have AgentEntityType::Individual with a linked Person. Collective agents (working groups, projects) reference an NDO hash. Bots have no Person but have declared capabilities and a responsible operator.

6.2 Affiliation State as a Derived Property

Rather than storing affiliation state (which would need maintenance and could become inconsistent), derive it algorithmically from existing DHT data:

affiliation_state(agent) = f(
    person_exists(agent),                   // Boolean
    contributions_count(agent),             // From economic events
    last_contribution_timestamp(agent),     // Recency from economic events
    reputation_summary.total_claims,        // From PPRs
    affiliation_record_exists(agent),       // Has the agent signed the ToP?
    governance_claims_count(agent)          // From PPRs
)

→ UnaffiliatedStranger | CloseAffiliate | ActiveAffiliate | 
  CoreAffiliate | InactiveAffiliate

CoreAffiliate is algorithmically determined: an active affiliate whose PPR contribution rate in the past N days exceeds a configurable threshold becomes a core affiliate. This implements the OVN governance equation: governance access as benefit derived from contribution activity.

6.3 Composable AgentProfile View

The aggregated individual profile, computed on demand:

#![allow(unused)]
fn main() {
pub struct AgentProfile {
    // Identity layer
    pub agent_pub_key: AgentPubKey,
    pub person: Option<Person>,
    pub affiliation_state: AffiliationState,
    
    // Capability layer
    pub roles: Vec<PersonRole>,
    pub capability_level: String,           // member/stewardship/coordination/governance
    pub capability_slots: Vec<CapabilitySlotInfo>,  // External credential attachments; includes FlowstaIdentity → IsSamePersonEntry; optional resolved flowsta_did for UI (`ndo_prima_materia.md` Section 6.7)
    
    // Reputation layer (derived, selectively shared)
    pub reputation_summary: Option<ReputationSummary>,
    pub economic_reliability_score: Option<f64>,    // For Unyt credit limit
    
    // Participation layer
    pub active_commitments_count: u32,
    pub economic_events_count: u32,
    pub resource_custodianships_count: u32,
    
    // Social layer (optional, agent-controlled)
    pub network_affiliations: Vec<NetworkAffiliation>,
    pub peer_vouches: Option<u32>,          // Number of vouches from trusted peers
    
    // Temporal
    pub joined_at: Option<Timestamp>,
    pub last_active_at: Option<Timestamp>,
}
}

This profile is not an entry type — it is a query result, composed from existing entries. The agent controls which sections are exposed by granting access to the constituent entries.

6.4 Affiliation Record — The Terms of Participation Bridge

A lightweight mechanism to record formal affiliation:

#![allow(unused)]
fn main() {
pub struct AffiliationRecord {
    pub agent: AgentPubKey,
    pub network_id: String,                    // Which NDO network
    pub documents_acknowledged: Vec<DocumentAck>,  // Hash + title of each ToP document
    pub signed_at: Timestamp,
    pub signature: Signature,                  // Agent signs the affiliation record
    pub witness: Option<AgentPubKey>,          // Optional vouching agent
}

pub struct DocumentAck {
    pub document_hash: String,         // Hash of the document text
    pub document_title: String,
    pub document_version: String,
}
}

When an agent creates their first Person entry, the UI prompts them to acknowledge the network's Terms of Participation. The acknowledgement is cryptographically signed and stored as an AffiliationRecord. This bridges the OVN's formal affiliation ceremony with the NDO's digital infrastructure.

6.5 Portable Credential Summary

A structure that can be shared with other Holochain networks as proof of contribution and capability:

#![allow(unused)]
fn main() {
pub struct PortableCredential {
    pub issuing_network: String,               // DNA hash of the issuing network
    pub agent: AgentPubKey,
    pub credential_type: PortableCredentialType,
    pub claims: PortableCredentialClaims,
    pub issued_at: Timestamp,
    pub valid_until: Option<Timestamp>,
    pub issuer_signature: Signature,           // Signed by a Primary Accountable Agent
    pub agent_signature: Signature,            // Countersigned by the agent
}

pub enum PortableCredentialType {
    RoleCredential(String),                    // "Accountable Agent in network X"
    ReputationCredential,                      // Aggregated reputation score
    CompetencyCredential(String),              // "Certified 3D printer operator"
    AffiliationCredential,                     // "Active affiliate of network X since date"
}
}

A receiving network can verify the issuer_signature against the issuing network's DNA hash, establishing a cryptographic chain of trust without requiring centralized credential issuers.

Receiving networks may correlate credentials with a Flowsta DID when the issuer also records a FlowstaIdentity link on the agent's Person hash — improving interoperability without making PPR entries themselves transferable.


7. Complexity Economics Justification: Why Each Agent Concept Matters

Agent type taxonomy matters because economic models must faithfully represent economic actors. In Sensorica's actual operations, the entities performing actions are networks, ventures, and partner organisations — not just individuals. Flattening these to individual-human agents produces systematically inaccurate economic accounting. Benkler's P2P advantage — that P2P systems can process more information and model more finely-grained reality — is lost when the agent model is coarser than the actual social structure.

The affiliation spectrum matters because governance decisions made by binary "in/out" membership are weaker than those made by graded participation-aware membership. The governance equation (contribution history → governance access) requires a nuanced engagement model as input. If everyone is either "in" or "out," the governance equation reduces to "everyone who joined gets an equal vote," which ignores the 1-9-90 engagement reality. The result is either oligarchy (the 1% who do all the work decide everything while the 90% technically could override them) or paralysis (decisions require the majority of a population that mostly isn't paying attention).

ZKP capability proofs matter because the current privacy-accountability model forces a false binary: either share raw data (low privacy, high accountability) or share nothing (high privacy, no accountability). Zero-knowledge proofs break this binary. An agent can prove "I have at least 10 completed maintenance commitments" without revealing who the counterparties were, what the resources were, or what the exact performance scores were. This is the technical foundation for privacy-preserving meritocracy — governance access based on contribution without requiring surveillance.

Credential portability matters because the value of contribution data is severely limited if it only functions within a single application instance. An experienced Sensorica contributor who joins a new OVN should be able to leverage their track record. Without portability, every new commons requires starting from zero, creating massive friction to growth of the P2P ecosystem. Benkler's model of the peer production advantage assumes information flows across organisational boundaries — credential portability is the mechanism that makes this flow possible.

Cross-app identity (Flowsta) matters for the same reason credential portability matters: agents who participate in multiple OVNs or hApps are bridge nodes (Section 4.6). Without a verifiable same-person link across conductors, every network treats them as a stranger; sybil pressure and cold-start friction repeat. Flowsta's permissionless Tier 1 keeps overhead low for casual participants; Tier 2 lets communities demand verified identity only where Bar-Yam-style complexity matching says it is worth the coordination cost (high-trust governance, high-value custody).

The composable individual profile matters because an agent's full profile — their roles, contributions, social relations, affiliations, capabilities — is the information substrate for most governance and economic decisions in the commons. If this information is scattered across disconnected entries with no composable view, the information cost of making well-informed decisions is high. Bar-Yam's complexity matching principle: the governance system's access to information about participants must match the complexity of the participation patterns it is trying to govern.

Collective agent types matter because commons-based peer production is fundamentally about collectives. Modelling it as a collection of individual agents without collective agency misses the emergent properties of collaboration. A working group is not just the sum of its members — it has its own identity, its own resource access, its own reputation, and its own governance. Without collective agent types, the NDO cannot model the holonic structure of OVNs: the fact that every entity is simultaneously a whole and a part of a larger whole.


This is a living document. Section 5.3 should be converted into formal requirements as the generic NDO project begins. Section 6 describes design directions, not final specifications. The OVN wiki pages at Agent, Identity, Individual profile, and Organizational structure remain authoritative references for agent design in peer production systems.

Resources: Ontology, Implementation, and Forward Map

Type: Archive / Knowledge Base Document
Created: 2026-03-11
Relates to: ndo_prima_materia.md, versioning.md, digital-resource-integrity.md, unyt-integration.md, flowsta-integration.md
Sources: MVP code (zome_resource), post-MVP design documents, OVN wiki — Resource, OVN wiki — Resource type


Purpose

This document maps the three states of Resource understanding in the Nondominium / NDO project:

  1. Implemented — what exists today in the MVP zome_resource codebase
  2. Planned — what is designed in the post-MVP requirements documents
  3. Remaining — what the OVN wiki's 15 years of commons-based peer production practice contains that NDO does not yet plan to implement, and which should inform the generic NDO design

The goal is to ensure that the generic NDO — which will be built as a standalone hApp and then instantiated by Nondominium and other projects — represents a complete and principled resource ontology, not an accidental by-product of a single use-case.


1. Conceptual Foundation: Resources in P2P Complexity Economics

Before mapping what is and is not implemented, it is necessary to establish what a Resource is in the theoretical context this project operates within. The OVN wiki defines resources from the REA (Resources, Events, Agents) ontology and extends it through 15 years of Sensorica practice. The NDO builds further on this.

1.1 Beyond REA Primitives

In standard REA accounting, a Resource is simply an entity that has economic value and can be tracked as it flows through Events performed by Agents. This is a correct but minimal definition — adequate for accounting, inadequate for governance.

In P2P peer production, a resource is also:

  • An information carrier: it encodes design intent, provenance, contribution history, and quality evidence
  • A coordination node: agents discover it, express intent to use it, negotiate access, and coordinate around it
  • A trust anchor: its history of use (how it has been treated, maintained, transacted) is evidence about the agents who interacted with it
  • An economic attractor: governance rules embedded in a resource determine who can create value with it, and therefore shape the economic topology of the network around it

This richer conception changes the design requirements fundamentally. A Resource is not merely a record in a ledger — it is a socially embedded DHT object with its own identity, governance constitution, and economic role.

1.2 The Tragedy of the Commons Solved by Embedded Governance

Hardin's "tragedy of the commons" (1968) argued that shared resources are inevitably depleted because individual agents have incentives to overuse. His solution was privatisation or central regulation. Ostrom's work (Governing the Commons, 1990) empirically refuted this: communities have sustainably governed shared resources for centuries through embedded, peer-enforced rules — without privatisation and without central authorities.

The NDO is, architecturally, an implementation of Ostrom's finding. The GovernanceRule entries embedded in ResourceSpecifications are exactly the "locally evolved institutions" that Ostrom identified as the mechanism of successful commons governance. The peer validation of economic events, PPR generation, and role-based access control are the "monitoring and sanctioning" mechanisms she observed.

This theoretical grounding is not academic decoration. It justifies specific design choices: governance rules must be embedded in the resource (not in a separate administrative system), enforcement must be peer-based (not authority-based), and participation in governance must generate reputational stake for participants.

1.3 Rivalrous vs. Non-Rivalrous: The Governance Fork

Benkler (The Wealth of Networks, 2006) identifies the rivalry or non-rivalry of a resource as the primary determinant of optimal governance strategy:

  • Non-rivalrous resources (digital designs, methods, documentation, software): can be copied and shared at near-zero marginal cost. Restricting access does not preserve the resource — it only reduces total value creation. Default governance: open access, attribution-based, copy-left.
  • Rivalrous resources (physical tools, equipment, spaces, materials): use by one agent excludes others. Restricting access is necessary to prevent overuse and ensure maintenance. Default governance: Ostromian embedded rules, reputation-gated access, stewardship requirements.

This distinction has profound implications for NDO Resource modeling. A resource's governance defaults, access rules, lifecycle requirements, and Unyt integration patterns should all differ based on rivalry. The current implementation does not model rivalry explicitly — this is a fundamental gap.

1.4 Complexity Matching: Governance Overhead Must Match Resource Complexity

Bar-Yam's complexity matching principle states that the governance complexity of a system must match the complexity of the challenges it manages. Applied to resources:

  • A simple idea (Layer 0 only, Ideation lifecycle stage) requires near-zero governance overhead
  • A design file shared across a network requires moderate governance (attribution, versioning, integrity)
  • A physical CNC machine used by 50 agents requires substantial governance (access rules, maintenance scheduling, custody chains, reliability tracking)

The NDO's three-layer model (ndo_prima_materia.md) directly implements this principle. The LifecycleStage enum ensures that governance overhead is matched to the resource's current social complexity. But this document will argue that even the NDO plan needs further refinement to model the full spectrum of resource types that exist in practice.

1.5 Resources as Social Infrastructure

The OVN wiki goes further than REA in recognising intangible resources: social capital, trust, community sense, governance knowledge, competencies, synergy. These are not commodifiable — they cannot be transferred, traded, or priced. But they are inputs to productive processes and outputs of participation.

In complexity economics terms: these intangibles are the emergent properties of the social system. They cannot be designed in; they arise from the right conditions. But they can be cultivated, protected, and damaged. A governance system that only models material and digital resources is blind to a large fraction of the actual value that flows in peer production communities.

The NDO does not need to track intangible resources in the same way it tracks a bicycle or a CAD file. But it must be aware of them — as a category of resource type — to avoid designing governance mechanisms that damage them.


2. Current Implementation (MVP)

2.1 Entry Types in zome_resource Integrity

The MVP implements three entry types:

ResourceSpecification

#![allow(unused)]
fn main() {
pub struct ResourceSpecification {
    pub name: String,
    pub description: String,
    pub category: String,
    pub image_url: Option<String>,
    pub tags: Vec<String>,
    pub is_active: bool,
}
}

This is the knowledge layer in ValueFlows terminology: the type or template of a resource. It corresponds to the OVN concept of "Resource Type" — an abstract representation that groups interchangeable concrete instances.

EconomicResource

#![allow(unused)]
fn main() {
pub struct EconomicResource {
    pub quantity: f64,
    pub unit: String,
    pub custodian: AgentPubKey, // TODO (G1, REQ-AGENT-02): replace with AgentContext post-MVP
                                // to support Collective, Project, Network, and Bot agents as
                                // Primary Accountable Agents. Currently assumes individual agent.
    pub current_location: Option<String>,
    pub state: ResourceState,
}
}

This is the observation layer: a specific instance of a resource at a point in time, held by a specific custodian.

GovernanceRule

#![allow(unused)]
fn main() {
pub struct GovernanceRule {
    pub rule_type: String,   // free-form string (e.g., "access_requirement")
    pub rule_data: String,   // JSON-encoded, completely untyped
    pub enforced_by: Option<String>,
}
}

Economic rules governing access and use. Currently entirely untyped — rule_data is a free-form JSON string with no schema enforcement.

ResourceState (enum) — conflated, pending split

PendingValidation | Active | Maintenance | Retired | Reserved

The code contains a TODO comment noting this enum conflates two orthogonal dimensions:

  • LifecycleStage (maturity/evolutionary phase — advances rarely, almost irreversibly)
  • OperationalState (current process acting on the instance — cycles frequently)

Maintenance and Reserved are operational conditions imposed by active processes; they are not lifecycle milestones. A resource being repaired is still LifecycleStage::Active — it just has OperationalState::InMaintenance. Similarly, InTransit and InStorage are operational states valid at any lifecycle stage.

The link types model resource discovery and navigation:

  • Anchor links for global discovery (AllResourceSpecifications, AllEconomicResources, AllGovernanceRules)
  • Hierarchical links (SpecificationToResource, SpecificationToGovernanceRule)
  • Agent-centric links (CustodianToResource, AgentToOwnedSpecs, AgentToManagedResources)
  • Faceted search links (SpecsByCategory, ResourcesByLocation, ResourcesByState, RulesByType)
  • Governance links (ResourceToValidation)
  • Update chain links (for Holochain's append-only update pattern)

2.3 What the MVP Does Well

  • Clean separation of specification (type/template) from resource (instance) — consistent with ValueFlows Knowledge/Observation layering
  • Single-custodian model is appropriate for the current Artcoin/simple sharing use case
  • GovernanceRule linked to ResourceSpecification rather than EconomicResource is architecturally correct: rules belong to the type, not the instance
  • The anchor link pattern enables permissionless discovery

2.4 Known Gaps in the MVP

GapImpactPlanned fix
ResourceState conflates lifecycle and operational dimensions (TODO in code)Cannot model in-transit, in-storage, or in-maintenance resources independently of lifecycle stageSplit into LifecycleStage (on NondominiumIdentity) + OperationalState (on EconomicResource) — see ndo_prima_materia.md Section 5
No property regime fieldCannot distinguish nondominium from commons from individual stewardshipPropertyRegime enum (ndo_prima_materia.md)
No resource nature fieldCannot distinguish digital from physical from hybridResourceNature enum (ndo_prima_materia.md)
GovernanceRule.rule_data is untyped JSON stringNo schema enforcement, no tooling support, no peer validation of rule semanticsGovernanceRuleType enum with typed schemas (ndo_prima_materia.md + unyt-integration.md)
No lifecycle before PendingValidationCannot model resources in ideation, design, development stagesLifecycleStage (ndo_prima_materia.md)
Single custodian onlyCannot model shared tools, collective custody, resource poolsMany-to-many flows (post-MVP)
No resource-level identity separate from specification hashIdentity changes when specification is updatedNondominiumIdentity (ndo_prima_materia.md Layer 0)
No versioningCannot track design evolution, forks, repairsVersioning DAG (post-MVP)
No digital integrityCannot verify downloaded digital resource dataDigital Resource Integrity (post-MVP)
No rivalry/non-rivalry modelingGovernance defaults are the same for all resource typesGap — see Section 5
No scope classificationCannot determine network-wide vs. project-specific visibilityGap — see Section 5
No resource reliabilityNo way to track a tool's track record independent of custodian reputationGap — see Section 5
No cross-app identity or DIDAgents cannot prove identity across Holochain apps or networks; reputation is local to this DHT; no key recovery mechanismFlowstaIdentity CapabilitySlot on Person entry hash (ndo_prima_materia.md Section 6.7); W3C DID via Flowsta agent linking; Vault key recovery
No agent key recoveryIf agent loses device, signing key (and all private entries/PPRs) are inaccessible; no deterministic key regenerationFlowsta Vault BIP39 recovery phrases; auto-backup; CAL-compliant data export (ndo_prima_materia.md Section 6.7)

3. Post-MVP Roadmap

The following improvements are designed in the post-MVP documentation. Each is described briefly here; full specifications are in the referenced documents.

3.1 NDO Three-Layer Model (ndo_prima_materia.md)

The most significant architectural change. Replaces the flat ResourceSpecification + EconomicResource model with a progressive three-layer structure:

  • Layer 0 — NondominiumIdentity: A permanent, immutable identity anchor. The genesis entry whose action hash becomes the stable identifier for the resource across its entire existence. Contains name, description, initiator, property_regime, resource_nature, lifecycle_stage, created_at. Never voided — serves as the tombstone at end of life.
  • Layer 1 — ResourceSpecification (activated by NDOToSpecification link): The form of the resource — design, governance rules, assets, digital integrity manifests. Activated when the resource has a form worth sharing.
  • Layer 2 — Process (activated by NDOToProcess link): The activity around the resource — EconomicEvents, Commitments, Claims, PPRs. Activated when multi-agent coordination begins.

This model directly implements the complexity matching principle: coordination overhead grows with actual social complexity, not at resource creation. The three-layer structure describes the resource face of any entity — including collective entities. When a collective (project-organisation, cooperative, network) has an associated NDO, that NDO is its digital twin as a Resource: its permanent identity, lifecycle, specification, and governance. The collective also has an agent face (AgentContext) through which it participates in economic events. These are distinct — see agent.md §3.1 for the dual-face model.

3.2 Property Regime and Resource Nature

#![allow(unused)]
fn main() {
pub enum PropertyRegime {
    Private,        // Full rights bundle; individual ownership
    Commons,        // Non-rivalrous shared resource; governance via licensing/attribution
    Collective,     // Cooperative/collective ownership
    Pool,           // Pool of shareables: rivalrous shared resources; custody/scheduling/maintenance
    CommonPool,     // Rivalrous consumable resource; governance via quota/depletion rules
    Nondominium,    // Uncapturable by design; contribution-based access; no alienation permitted
}

pub enum ResourceNature {
    Digital,   // Software, data, design files, documents
    Physical,  // Material objects, equipment, spaces
    Hybrid,    // Digital twin of a physical resource
}
}

These enums are part of NondominiumIdentity (Layer 0) — they classify the resource at creation and remain stable across its lifecycle. The PropertyRegime enum is reconciled from the OVN property regime taxonomy (§4.4.3) — see §4.4.6 for the full analysis.

3.3 LifecycleStage and OperationalState

The current 5-state ResourceState enum is replaced by two orthogonal enums:

LifecycleStage (10 stages on NondominiumIdentity) — the maturity/evolutionary phase of the resource, advancing rarely and mostly irreversibly:

Ideation → Specification → Development → Prototype →
Stable → Distributed → Active →
Hibernating → Deprecated → EndOfLife

OperationalState (7 states on EconomicResource) — the current process acting on a specific instance, cycling frequently as processes begin and end:

PendingValidation | Available | Reserved | InTransit | InStorage | InMaintenance | InUse

Maintenance and Reserved move from LifecycleStage to OperationalState. Transport, storage, and maintenance are processes that can apply to a resource at any lifecycle stage (a Prototype can be InTransit between labs; an Active resource can be InMaintenance).

Each transition is governance-validated (the governance zome is the state transition operator), generates an economic event, and creates a lifecycle history audit trail.

3.4 Versioning (versioning.md)

A DAG-based version graph applicable to material resources (physical instances and designs), digital resources (code, documents, CAD), and the Nondominium hApp itself. Typed relations: EvolvedFrom, ForkedFrom, MergedFrom, RepairedFrom, AugmentedFrom, PortedToPlatform. OVN-compliant contribution propagation upstream through the version graph.

3.5 Digital Resource Integrity (digital-resource-integrity.md)

Cryptographic integrity verification for digital resources: SHA-256 content addressing per 64KB chunk, Merkle tree structure for selective verification, composable/fractal resource architecture (atomic → component → composite), supply chain transparency.

3.6 Many-to-Many Flows (many-to-many-flows.md)

Extension of the single-custodian model to shared custody with weights and roles, one-to-many/many-to-one/many-to-many custody transfers, resource pools, co-custodian delegation.

3.7 Unyt Integration (unyt-integration.md)

Economic settlement layer via Unyt Smart Agreements and RAVEs. EconomicAgreement GovernanceRule type, RAVE validation as state transition precondition, PPR↔RAVE provenance chain, reputation-derived credit limits.

3.8 Flowsta Integration (flowsta-integration.md)

Decentralized identity and authentication layer via Flowsta agent linking. FlowstaIdentity CapabilitySlot on Person entry hash, providing W3C DID (did:flowsta:uhCAk...) without modifying the Person entry schema. Two-tier identity authority: Tier 1 (permissionless attestation via CapabilitySlot link) and Tier 2 (governance-enforced identity verification for role promotions and high-value transitions). Flowsta Vault provides BIP39 key recovery and auto-backup for agent data resilience (CAL-compliant). PPR ReputationSummary becomes attributable to a cross-app DID, enabling portable reputation across Flowsta-linked Holochain apps.


4. OVN Resource Ontology: 15 Years of Practice

The OVN wiki (Resource, Resource type) represents the distilled understanding of commons-based peer production at Sensorica. This section synthesises its key concepts in the context of NDO design, with complexity economics justifications.

4.1 Resource Primitives (Greg Cassel / OVN)

The OVN wiki adopts Greg Cassel's resource primitive taxonomy: mental resources, identity, physical resources, and media resources. This is broader than REA.

Mental resources — thoughts, feelings, ideas, knowledge that exists in agents' minds. Cannot be modelled directly in a DHT system (they are in the agent's head, not on a public ledger), but they are inputs to productive processes. In NDO terms: mental resources become visible when an agent creates an Ideation-stage NDO (Layer 0 only), which is the externalization of a mental resource into a public intent. The Ideation lifecycle stage is precisely the mechanism by which mental resources enter the observable network.

Identity — the capacity to distinguish agents and resources. In NDO terms: the NondominiumIdentity entry is the identity resource for every NDO object. Agent identity is handled by zome_person.

Physical resources — material objects with physical properties. NDO's Physical nature classification and the full custody/maintenance/transport/repair process suite cover this category.

Media resources — information superimposed on mediums: signs, signals, streams, messages, items, channels. This maps to NDO's Digital nature classification but is richer: the OVN taxonomy distinguishes between a design file (media item) and the channel through which it is shared (media channel). NDO currently does not make this distinction — a Digital resource could be either.

Complexity economics note: Mental resources and media resources are both non-rivalrous. Their governance implications differ from physical resources. Encoding this distinction at the resource type level is prerequisite to correct governance defaults.

4.2 Value Chain Maturity

The OVN wiki characterises resources by their stage of development:

OVN stageDescriptionNDO LifecycleStage equivalent
IdeaDocumented, contextualised intentIdeation
DesignFormalised in CAD, SPICE, etc.Specification, Development
StudyDocumented R&DDevelopment, Prototype
PrototypeTangible, somewhat functionalPrototype
Usable artifactReady-to-use productStable, Distributed, Active

The NDO LifecycleStage enum covers and extends this taxonomy with the addition of post-operational stages (Hibernating, Deprecated, EndOfLife) that OVN implies but does not formally enumerate. The NDO model is thus more complete in this dimension.

Complexity economics note: A resource's governance complexity should match its value-chain maturity. An Ideation-stage resource (someone's declared intent) requires near-zero governance. A Stable design that is being distributed for fabrication requires full governance, integrity verification, and versioning. The NDO's pay-as-you-grow layer activation model directly implements this — it is why the three-layer model is correct.

4.3 Production Process Resource Types

The OVN wiki classifies what production processes need:

OVN typeDescriptionNDO coverage
Human laborTime spent workingNot modeled as a resource type; covered by PPR participation records
UsablesNon-consumed inputs (tools, equipment)Physical resources in NDO
ConsumablesDepleted inputs (glue, components)Physical resources in NDO; quantity tracking covers depletion
SpacePhysical or virtual locationsNot explicitly modeled as a resource type
MethodProtocol, recipe, sequenceNot modeled as a resource type
CurrencySymbolic value exchange systemNot modeled as a resource type; partially addressed by Unyt integration

The most significant gaps here are Method (documented processes, recipes, protocols) and Space (physical locations with governance, scheduling, and access control needs). Both are important in commons-based peer production settings.

Method resources are particularly interesting in the NDO context: a fabrication method (how to assemble a CNC machine) is a non-rivalrous digital resource — it can be copied freely. But it is also a governance-bearing resource: it defines the conditions under which physical resources should be used, encoding safety requirements, quality standards, and attribution requirements. In NDO terms, a Method would be a Digital NDO whose Layer 1 specification includes both the documented process and governance rules referencing it.

Space resources are rivalrous (only one person can use the CNC machine bay at a time) and require scheduling/booking mechanics that the current NDO does not model. A future generic NDO should be able to express temporal availability as a dimension of resource governance.

4.4 Property Regimes

4.4.1 What Property Is

The OVN wiki opens its treatment of property with a definition that reorients the entire concept away from legal formalism: "Property is about the relationship between agents and things. These relationships are institutionalized, meaning that they are codified as norms or rules or laws, are made public and are widely accepted by everyone in a social setting."

Property is not an object — it is a bundle of rights and obligations connecting a subject (agent) to an object (resource). Bentham identified four key classes of stakeholder rights in this bundle:

RightDescriptionNDO mapping
UseExclusive or otherwise — the right to interact with the resourceRole-gated VfAction execution; GovernanceRule access_requirement
UsufructThe fruits of use — the right to benefit from what the resource producesBenefit redistribution algorithm; PPR-based credit distribution
ManagementThe right to define how the resource is governedGovernanceRule creation; role-gated rule modification
Custody/StewardshipThe right and obligation to maintain and protect the resourceEconomicResource.custodian; custody transfer protocols

These four rights are not always bundled together. A Simple Agent may have Use rights without Management rights. A maintenance specialist has Custody rights for the duration of a repair without having Management rights. The NDO's role system and GovernanceRule architecture partially implements this unbundling, but without explicit modelling of which rights each role confers.

4.4.2 Goods Typology: The Excludability × Rivalry Matrix

Before classifying property regimes, Ostrom (following Samuelson) establishes a goods typology based on two independent axes:

  • Excludability: can non-payers or non-members be excluded from use?
  • Rivalry (subtractability): does one agent's use reduce availability for others?
Low excludabilityHigh excludability
Low subtractabilityPublic goods (open knowledge, broadcast)Toll / Club goods (private park, cable TV, software)
High subtractabilityCommon-pool resources (fisheries, physical tools)Private goods (equipment owned by one person)

Critically: goods types exist independently of property regimes. A common-pool resource (high subtractability, low excludability) can be owned as government property, private property, community property, or no-one's property. The goods type characterises the resource's physical or informational nature; the property regime characterises the social arrangement governing it.

This distinction matters for the NDO: ResourceNature and Rivalry describe the intrinsic characteristics of the resource. PropertyRegime describes the chosen governance arrangement. They are orthogonal fields.

4.4.3 The Full Property Regime Taxonomy

The OVN wiki distinguishes more regime types than the current NDO plan. All are important for the generic NDO:

RegimeRivalryExcludabilityDescriptionNDO coverage
PrivateAnyHighOwned by one agent; full rights bundle; protected by a higher authority (or by Nondominium design)Private (NDO forward map)
PublicAnyLowOwned by the state; accessible under conditions; not relevant in a stateless P2P contextNot planned (stateless system)
CommonsNon-rivalrousLowPool of tangible but immaterial resources (designs, knowledge, software) with use governance (licences, attribution). Technically can be privatised through governance captureCommons (NDO forward map)
Pool of ShareablesRivalrousMediumTangible material resources intended for sharing within a network; individually governed by property regime and intrinsic characteristics; designed for preservation and perpetual accessPool (NDO forward map)
Common-pool resourceRivalrousLowMostly consumables, governed in bulk with rules for prevention of depletion; community-managed quotasCommonPool (NDO forward map)
CondominiumRivalrousHighResource divided into privately owned parts with collective governance of the whole (infrastructure, integrity, shared structures)Not planned (can be added as a future variant)
NondominiumAnyHigh (by design)Requires extremely high costs of control, making it virtually uncontrollable by any entity — not even nation states. Does not need external protection because no actor can capture it. Examples: Bitcoin network, open seas, indigenous forest commonsNondominium (NDO forward map)
Toll goods (club goods)Non-rivalrousHighExcludable but non-rivalrous up to a point (congestion); fee-based or membership-based accessNot planned (can be added as a future variant)

The three most critical distinctions for the NDO:

Commons ≠ Pool of Shareables: The OVN wiki makes an important distinction. Commons are immaterial (non-rivalrous) resources — sharing a design file costs nothing and excludes no one. Pool of Shareables are material (rivalrous) — sharing a 3D printer requires scheduling, maintenance, and custody transfer. These have different governance requirements and should map to different PropertyRegime variants.

Commons ≠ Nondominium: In the OVN model:

  • Commons: governed resources with shared stewardship; theoretically, governance capture could privatise a commons (a bad actor could modify the governance rules to extract exclusive control)
  • Nondominium: uncapturable by design — no one can assert ownership, no organisation can enclose them. The property regime exists independently of governance rules: even if governance rules were to declare individual ownership, the cryptographic architecture makes it technically unenforceable

The NDO's architecture (append-only DHT, no admin key, agent-centric source chains) is a Nondominium implementation at the infrastructure level. This should be formally reflected in the data model.

Nondominium is defined by cost of capture, not by intent: The OVN wiki is precise — "The conditions for it to exist is to have extremely high costs of control, making it virtually uncontrollable by any entity, not even by nation states." This is a technical condition, not a legal or normative one. The NDO's PropertyRegime::Nondominium variant should encode a validation constraint: a resource declared as Nondominium must have governance rules that do not permit ownership assignment or transfer, and the system should reject GovernanceRule updates that attempt to add such rules.

4.4.4 Property Regime Determines Possible Economic Models

The OVN wiki makes a point that is central to the NDO's relationship with Unyt: "once the property regime is fixed, only a limited number of motivation and incentive models are possible on top of that (call it economic model or business model). In turn, this determines people's values and behaviour within that organization."

This has direct architectural implications:

PropertyRegimeAllowable economic modelsUnyt implications
PrivateFull market (buy/sell/rent/lend); individual benefit captureSmart Agreement can specify price, rental, usage fees
CommonsAttribution-based; copyleft/open sourceSmart Agreement triggers on share events, not sale events
PoolScheduling-based access; contribution-weighted priority; insurance/maintenance poolsSmart Agreement triggers on custody transfer; maintenance settlement. Post-MVP: access eligibility should also gate on AffiliationStateActiveAffiliate (TODO G2)
CommonPoolQuota-based; depletion taxes; collective replenishmentSmart Agreement governs extraction rate
NondominiumContribution-based; access is earned but not purchased; no alienationSmart Agreement can distribute benefits of use but cannot assign ownership. Post-MVP: high-stakes access should gate on AffiliationStateActiveAffiliate or CoreAffiliate (TODO G2)

The PropertyRegime on NondominiumIdentity should therefore be a hard constraint on which GovernanceRules and Unyt Smart Agreements are valid for that resource. The governance zome should enforce this: an attempt to attach a sale Smart Agreement to a Nondominium resource must be rejected.

4.4.5 Property and Distribution — Transfer Rights

The OVN wiki observes: "Distribution is a change in status, a transfer of rights and obligations associated with that thing... Distribution is not possible without the notion of property."

In the NDO, different property regimes enable different types of transfers:

RegimeOwnership transferCustody transferUse rights transferBenefit transfer
Private✅ Full alienation
Commons✅ (stewardship)✅ (attribution)
Pool❌ (stays in pool)✅ (temporary custody)✅ (scheduled)
CommonPool✅ (extraction)✅ (quota-limited)
Nondominium❌ (architecturally impossible)

The current NDO models custody transfer well (through EconomicResource.custodian and TransferCustody VfAction). It does not model ownership transfer, benefit transfer, or the regime-specific restrictions on which transfers are valid. The governance zome should enforce regime-appropriate transfer restrictions.

4.4.6 OVN Analysis and NDO PropertyRegime Reconciliation

The OVN wiki identifies eight property regime types (§4.4.3 table). The current NDO plan (Commons, Individual, Collective, Mixed) is too narrow. The full OVN taxonomy is preserved in §4.4.3 as an analytical reference. The NDO forward map (§6.3) selects the six regimes that are architecturally relevant to the generic NDO:

#![allow(unused)]
fn main() {
pub enum PropertyRegime {
    Private,        // Full rights bundle; individual ownership
    Commons,        // Non-rivalrous shared resource; governance via licensing/attribution
    Collective,     // Cooperative/collective ownership
    Pool,           // Pool of shareables: rivalrous shared resources; custody/scheduling/maintenance
    CommonPool,     // Rivalrous consumable resource; governance via quota/depletion rules
    Nondominium,    // Uncapturable by design; contribution-based access; no alienation permitted
}
}

Mixed is removed — mixed regimes should be expressed as compound governance rules on top of a primary regime, not as a separate enum variant (which conveys no information about what the mix contains). Individual is renamed to Private to align with OVN property vocabulary. Condominium and TollGoods are omitted from the initial generic NDO — they can be added as future variants if communities require them.

Complexity economics note: The OVN wiki states: "Property regime is not merely a legal classification, it shapes the entire economic topology of flows. A resource under the Nondominium regime cannot be enclosed, which is a stronger guarantee than a Commons resource (which can theoretically be privatised through governance capture)." This is precisely the Bar-Yam complexity matching principle applied to governance: the information requirements for different property regimes are vastly different. A Private resource can be governed by simple bilateral contracts. A Nondominium resource requires cryptographic enforcement of uncapturability — human agreements are insufficient. The NDO's Holochain DHT architecture provides the technical foundation for Nondominium governance at scale; encoding the regime explicitly in the data model closes the loop between the technical guarantee and the social norm.

4.5 Accessibility, Availability, and Rivalry

The OVN wiki provides three orthogonal classification axes that NDO does not yet model:

Accessibility (who can access the resource):

  • Free: public, no restrictions
  • Protected/regulated: requires credentials — skill, role, reputation, or payment. In the NDO, "credentialed" access encompasses:
    • Role-based: existing RoleType membership, enforced by GovernanceRule enforced_by field
    • AffiliationState-based (post-MVP, TODO G2): derived from participation history via AffiliationRecord entries — e.g. ActiveAffiliate or CoreAffiliate tier. Not declared but computed; harder to game than assigned roles
    • PortableCredential-based (post-MVP, TODO G8): cross-network verifiable claims from allied networks, enabling recognition of contribution history that happened elsewhere
    • ZKP-based (post-MVP, TODO G7): privacy-preserving proofs of the form "I have ≥ N claims of type T" without revealing raw scores, counterparties, or timestamps — prerequisite for governance access without surveillance
    • FlowstaIdentity-based (post-MVP): cross-app identity via FlowstaIdentity CapabilitySlot on the agent's Person entry hash pointing to a dual-signed IsSamePersonEntry (Vault agent linking). Tier 1 (REQ-NDO-CS-12/CS-13) is a voluntary trust signal; Tier 2 (REQ-NDO-CS-14/CS-15) lets governance require a valid link for high-value or high-risk resource access — sybil resistance and cross-network accountability without revealing private PPR data
  • Formally restricted: requires formal approval procedures

This maps to governance rule patterns in NDO but is not a first-class property. Encoding it explicitly would allow the system to set appropriate governance defaults and UI affordances automatically.

Availability (how much is there):

  • Abundant: near-zero marginal reproduction cost (ideas, designs, documents)
  • Scarce: high marginal reproduction cost (physical tools, equipment, materials)

And the related distinction:

  • Rivalrous: access by one agent excludes others
  • Non-rivalrous: multiple agents can access simultaneously without exclusion

This is the most critical missing dimension in the NDO plan. Rivalry determines optimal governance strategy more directly than any other property. Non-rivalrous resources should default to open access (information wants to be free); rivalrous resources require access scheduling, usage tracking, and maintenance governance. The generic NDO should model rivalry explicitly as a first-class EconomicResource property.

Complexity economics note: Benkler's entire argument for commons-based peer production rests on the distinction between rivalrous and non-rivalrous resources. A P2P governance system that does not formally model this distinction will produce governance rules that are either too restrictive for non-rival resources (inefficient) or too permissive for rival resources (destructive).

4.6 Transferability

OVN transferabilityDescriptionNDO coverage
TransferableCan change ownership (currency, consumables)Custody transfer in EconomicResource; ownership transfer in EconomicEvents
Non-transferableCannot be sold or given (social capital, reputation)PPRs are non-transferable by design (cryptographic linkage to agent key)
ShareableCommons / pool items — shared without ownership transferGovernanceRules can encode this but it is not a first-class classification

The OVN wiki makes an important observation: allowing non-transferable assets (like reputation) to be transferred would destroy their value — "allowing this would in fact destroy the reputation system, as its meaning would be called into question." This is why Nondominium PPRs are cryptographically linked to the generating agent's key pair and cannot be assigned to another agent.

Flowsta's FlowstaIdentity CapabilitySlot introduces an important nuance: PPR reputation becomes attributable across apps (via a verified W3C DID) without becoming transferable. The DID is a stable cross-app reference key — other Flowsta-linked apps can verify that a given reputation history belongs to a specific cross-app identity — but the underlying PrivateParticipationClaim entries remain cryptographically bound to the generating agent's key pair on this DHT. Attribution portability and claim transferability are orthogonal: the former enables cross-network trust signals; the latter remains forbidden to preserve the integrity of the reputation system.

Complexity economics note: Transferability determines what kind of market or exchange system applies to a resource. Non-transferable resources require non-market coordination mechanisms (gifting, contribution tracking, reputation systems). The NDO already enforces non-transferability of PPRs at the cryptographic level. Extending this concept to other resources (should a method always be shareable? should equipment ever be non-transferable? these are governance questions) requires transferability to be a formal property.

4.7 Scope

The OVN wiki classifies resources by the domain they can affect:

ScopeDescriptionExamples
Project / VentureBenefit mostly the specific project teamA bespoke chemical solution for a single R&D project
NetworkBenefit the entire organisational networkA shared lab space, the network website
PublicCommons accessible to the entire worldOpen source designs, documented methods

This dimension is completely absent from the current NDO data model. Its importance for the generic NDO is significant: visibility, discovery, and governance rules for a network-scoped resource should differ from those of a public resource. A public design file should be discoverable globally; a project-scoped resource should only be visible to project participants.

4.8 Source

The OVN wiki tracks resource provenance:

SourceDescription
OVNCreated within the network; part of commons/nondominium/pool
PartnersContributed by allied networks with possible use restrictions
PurchasedAcquired through market exchange; property of the network

In the NDO, this is modelled as a ResourceSource enum on NondominiumIdentity (Layer 0, see §6.1). It matters for governance (a purchased resource may still be owned by its buyer and not be a true nondominium) and for attribution (OVN-sourced resources carry contribution history; purchased resources do not).

4.9 Reliability

The OVN wiki identifies reliability as a property of material usables — distinct from, but analogous to, agent reputation:

"Material resources, mostly usables, should have a parameter of reliability, which is related to the risk associated with their use... Is that piece of equipment going to break during the fabrication process? Is that sensor going to present accurate data?"

This is currently absent from the NDO model. A resource can have high-quality custodians (good PPR scores) but be itself unreliable (it breaks frequently, produces defective outputs, or presents safety risks). Resource reliability should be:

  • Accumulated from economic events: repair events, usage incidents, quality validation failures
  • Independent of custodian reputation: a reliable agent can custody an unreliable tool
  • A governance input: unreliable resources may require pre-access inspection, reduced access frequency, or mandatory insurance

Complexity economics note: In information theory, reliability is a measure of signal-to-noise ratio. A governance system that cannot distinguish reliable from unreliable resources is processing high-noise information — it cannot direct maintenance effort, access restrictions, or replacement decisions to where they are most needed.

4.10 Intangibles as Resources

The OVN wiki provides the most extensive taxonomy in the entire resource ontology for intangibles, identifying:

  • Brand (network and deliverable identity)
  • Social capital (opening markets, driving campaigns)
  • Group dynamics (energising and animating a community)
  • Member/customer loyalty
  • Synergy (linking ventures in value systems)
  • Internal structure and relationships (weaving agent networks)
  • Incentive systems (designing and embedding incentives)
  • Competencies (individual skill, group know-how)
  • Cultural values (maintaining and evolving culture)
  • Governance resources (decision-making knowledge and mechanisms)
  • Trust (trust by members in the network, in its metrics, in its fairness)
  • Sense of community

These cannot be traded, transferred, or precisely measured. But they are:

  • Outputs of participation (being part of a well-functioning community increases social capital)
  • Inputs to production (communities with high trust and good governance outperform those without)
  • Destroyable by bad governance (surveillance capitalism, governance capture, and unfair systems all erode intangibles)

For the generic NDO, the implication is: do not model intangible resources as DHT entries. Instead, design the system's governance and participation architecture so that positive interactions generate intangibles as emergent properties. The PPR system, the reputation-credit loop, the transparent governance architecture, the permissionless access — these are design choices that cultivate social capital, trust, and community sense without attempting to track them as assets. The NDO should be consciously designed as an intangible resource producer, not just a material resource tracker.


5. Gap Analysis

5.1 Mapped — OVN coverage implemented or planned in NDO

OVN conceptNDO implementationStatus
Resource Type (specification/instance distinction)ResourceSpecification + EconomicResource✅ Implemented
Property regimes (Private, Commons, Collective, Pool, CommonPool, Nondominium)PropertyRegime enum🔄 Planned (ndo_prima_materia.md)
Value chain maturity stagesLifecycleStage enum (10 stages)🔄 Planned (ndo_prima_materia.md)
Embedded governance rulesGovernanceRule entries linked to ResourceSpecification✅ Implemented (weakly typed)
Physical resource custodyEconomicResource.custodian, custody transfer✅ Implemented (single custodian, assumed individual agent — gap: collective agent custodianship not supported; TODO G1)
Multi-custodian / shared custodyMany-to-many flows🔄 Planned
Capture resistanceDHT architecture + Holochain's append-only model✅ Architectural property
Digital resources (composable, integrity)Digital Resource Integrity🔄 Planned
Versioning / DAG evolutionVersioning DAG🔄 Planned
Contribution trackingPPR system, Layer 2 EconomicEvents✅ Implemented
OVN license / contribution propagationVersioning + PPR upstream propagation🔄 Planned
Economic settlementUnyt integration🔄 Planned (post-MVP)
Cross-app identity / DIDFlowstaIdentity CapabilitySlot via Flowsta agent linking (ndo_prima_materia.md Section 6.7)🔄 Planned (post-MVP)
Agent key recoveryFlowsta Vault BIP39 recovery, auto-backup, CAL-compliant data export🔄 Planned (post-MVP)

5.2 Partial — concepts present in OVN and partially covered in NDO

OVN conceptNDO partial coverageGap
Resource nature (physical/digital/media)ResourceNature enum (Digital, Physical, Hybrid)Missing Mental analog; media channel vs. media item distinction absent
Governance of access (role-based)Role-based enforced_by in GovernanceRuleRule types are untyped strings; no first-class accessibility classification
Material/Immaterial behaviorPhysical vs. Digital natureNo formal rivalrous/non-rivalrous property
Method as resourceCovered as Digital resourcesNot explicitly modelled; no template/recipe entry type
Property regime: Nondominium vs. CommonsNondominium now a distinct variant in PropertyRegime (§6.3)Resolved — Nondominium has no-enclosure guarantees distinct from Commons
TransferabilityCustody transfer + PPR non-transferabilityNo formal transferability classification on resources
ReliabilityNot modelled at resource levelPPR tracks agent quality, not resource condition/reliability

5.3 Missing — OVN concepts not yet planned in NDO

These represent the forward agenda for the generic NDO design:

OVN conceptGap descriptionProposed resolution
Rivalrous / Non-rivalrousFundamental governance fork not modelled; all resources treated equivalentlyAdd rivalry: Rivalrous | NonRivalrous field to NondominiumIdentity (Layer 0, see §6.1); derive governance defaults from this property
Resource scope (Project / Network / Public)Visibility and governance should differ by scope; not modelledAdd ResourceScope enum to NondominiumIdentity; drive discovery anchor selection from scope
Resource source (OVN / Partner / Purchased)Provenance matters for attribution and governanceAdd ResourceSource enum to NondominiumIdentity
Space as resource typePhysical spaces need scheduling, booking, temporal availabilityAdd Space to ResourceNature; design temporal availability governance patterns
Method / Recipe as resource typeProcess documentation is a resource with its own governanceAdd Method to ResourceNature; link methods to the physical resources they govern
Currency as resource typeCurrencies (including Unyt Base Units) are resources in the OVN modelAdd Currency to ResourceNature; Unyt Alliance represents a currency resource
Resource reliabilityA tool's track record (failure rate, repair history) is independent of custodian reputationAdd reliability_score: Option<f64> derived from EconomicEvents (repair, incident PPRs); update on each Repair/Maintenance event
Accessibility classificationFree / Protected / Restricted as a first-class propertyAdd Accessibility enum; governance defaults derived from this
Transferability classificationFormal encoding of transferable / non-transferable / shareableAdd Transferability enum; informs custody transfer governance
Nondominium as distinct PropertyRegimeNondominium (no-enclosure guarantee) ≠ Commons (shared stewardship)Resolved in §6.3 — Nondominium variant added to PropertyRegime with validation that no governance rule can assert or transfer ownership
Affiliation-gated resource accessRole membership alone is insufficient for high-stakes access to rivalrous resources — participation quality (affiliation tier) should also gate access. GovernanceRule currently evaluates only role membership, not derived AffiliationStateExtend GovernanceRule.rule_data schema with min_affiliation field (e.g. "min_affiliation": "ActiveAffiliate"); extend governance operator evaluate_transition to cross-zome query AffiliationState from zome_person (refs G2, REQ-AGENT-03, REQ-AGENT-05)
Cross-app identity verificationNo mechanism for an agent to prove they are the same person across multiple Holochain apps or external systems. PPR reputation is local to this DHT; no cross-network trust signalAdd FlowstaIdentity CapabilitySlot on Person hash (ndo_prima_materia.md Section 6.7, REQ-NDO-CS-12). Governance rules can require Tier 2–validated Flowsta linking for high-value access (REQ-NDO-CS-14, Flowsta Phase 3). Flowsta DID provides the cross-app identity anchor for portable credentials (REQ-NDO-AGENT-08)
Collective agent custodianshipEconomicResource.custodian is currently AgentPubKey, assuming individual agent. Collective, Project, Network, and Bot agents (G1) should also be valid custodiansReplace AgentPubKey with AgentContext (union type) across EconomicResource.custodian, TransitionContext.target_custodian, and NondominiumIdentity.initiator (ref G1, REQ-AGENT-02)
IntangiblesSocial capital, trust, competencies — not tracked but should be preservedDesign principle: NDO governance architecture should cultivate intangibles as emergent properties, not track them as entries

6. Forward Map: Generic NDO Resource Ontology

Based on the gap analysis, the generic NDO should extend its resource classification to the following model. This is a design proposal, not a requirements document — it will be refined as the generic NDO project begins.

6.1 Extended NondominiumIdentity (Layer 0)

#![allow(unused)]
fn main() {
pub struct NondominiumIdentity {
    // Existing fields
    pub name: String,
    pub description: Option<String>,
    pub initiator: AgentPubKey,
    pub lifecycle_stage: LifecycleStage,
    pub created_at: Timestamp,

    // Classification fields (drive governance defaults)
    pub property_regime: PropertyRegime,  // existing
    pub resource_nature: ResourceNature,  // extended
    pub rivalry: Rivalry,                 // NEW
    pub scope: ResourceScope,             // NEW
    pub source: ResourceSource,           // NEW
    pub accessibility: Accessibility,     // NEW
    pub transferability: Transferability, // NEW
}
}

6.2 Extended ResourceNature

#![allow(unused)]
fn main() {
pub enum ResourceNature {
    Physical,   // Material objects: tools, equipment, consumables
    Digital,    // Software, data, design files, documents
    Hybrid,     // Digital twin of a physical resource
    Space,      // Physical or virtual locations with temporal availability
    Method,     // Documented process, recipe, protocol
    Currency,   // Symbolic value exchange system (including Unyt Alliance Base Units)
    // Note: Mental resources are represented by Ideation-stage NDOs, not a separate type
}
}

6.3 Extended PropertyRegime

#![allow(unused)]
fn main() {
pub enum PropertyRegime {
    Private,        // Full rights bundle; individual ownership (renamed from Individual per OVN vocabulary)
    Commons,        // Non-rivalrous shared resource; governance via licensing/attribution
    Collective,     // Cooperative/collective ownership
    Pool,           // Pool of shareables: rivalrous shared resources; custody/scheduling/maintenance
    CommonPool,     // Rivalrous consumable resource; governance via quota/depletion rules
    Nondominium,    // Uncapturable by design; contribution-based access; no alienation permitted
}
}

6.4 New Classification Enums

#![allow(unused)]
fn main() {
pub enum Rivalry {
    Rivalrous,    // Use by one agent excludes others; access governance required
    NonRivalrous, // Multiple agents can access simultaneously; open access preferred
}

pub enum ResourceScope {
    Project,  // Benefits mostly the specific project/venture team
    Network,  // Benefits the entire organisational network
    Public,   // Commons accessible to the entire world
}

pub enum ResourceSource {
    Network,   // Created within the network (OVN/nondominium)
    Partner,   // Contributed by allied networks (may have use restrictions)
    Purchased, // Acquired through market exchange
    Donated,   // Gifted with conditions
}

pub enum Accessibility {
    Free,       // Open access, no restrictions
    Credentialed, // Requires role, reputation, or demonstrated skill
    Gated,      // Requires formal application and approval
}

pub enum Transferability {
    Transferable,    // Ownership can change (exchange, gifting)
    NonTransferable, // Cannot be exchanged or gifted (reputation, social capital)
    Shareable,       // Pool/commons items: shared without ownership transfer
}
}

6.5 Resource Reliability (Layer 2 derived property)

Resource reliability should be derived from Layer 2 EconomicEvents rather than stored as a static field — it is an emergent property of the resource's history, not a declared attribute:

reliability_score ← derived from:
  - Repair event frequency (more repairs = lower reliability)
  - Maintenance completion rate (scheduled vs. emergency maintenance ratio)
  - Incident reports (damage, failure, safety events)
  - Quality validation results (passed vs. failed inspections)

This score accumulates over time and is queryable from the governance zome alongside the custodian's ReputationSummary. A resource reliability score and a custodian reputation score together give a complete picture of a resource interaction's risk profile.

6.6 Governance Defaults from Classification

The power of explicit resource classification is that it enables automatic governance defaults. The generic NDO should define a GovernanceDefaultsEngine that derives appropriate starting governance rule templates from the classification:

NatureRivalryPropertyGovernance defaults
DigitalNonRivalrousCommonsOpen access, copy-left attribution, versioning required
DigitalNonRivalrousNondominiumOpen access, attribution, no enclosure possible
PhysicalRivalrousPoolCredentialed access, custody transfer required, maintenance schedule
PhysicalRivalrousNondominiumPermissionless access under rules, peer validation, PPR required
SpaceRivalrousPoolBooking/scheduling, temporal access governance
MethodNonRivalrousCommonsOpen access, execution tracking, version-linked
CurrencyNonRivalrousNetworkDefined by Unyt Alliance configuration

These defaults are starting points — communities override them through the GovernanceRule entries on Layer 1. But having well-considered defaults dramatically reduces the governance design burden for community members setting up new resources.

TODO (G2, G7, G8 — post-MVP): The Credentialed access defaults shown for Pool (Physical/Rivalrous/Pool) and Nondominium rows above will eventually support three additional credential dimensions beyond role membership:

  • AffiliationState-based gating (G2): the governance operator queries zome_person for the requesting agent's derived affiliation tier and compares it to the min_affiliation condition in GovernanceRule.rule_data
  • PortableCredential acceptance (G8): governance rules can declare which external credential types they accept, enabling cross-network access without re-joining
  • ZKP-compatible evaluation (G7): reputation proofs are verified without revealing raw PPR scores or counterparties
  • FlowstaIdentity Tier 1 (Flowsta Phase 1; REQ-NDO-CS-12, REQ-NDO-CS-13): Agents can attach a FlowstaIdentity slot on their Person hash to a valid IsSamePersonEntry (Vault dual-signed attestation), making a DID discoverable and enabling cross-app attribution of reputation — without AffiliationRecord, PortableCredential, or ZKP infrastructure. The governance zome does not enforce Tier 1 (ndo_prima_materia.md Section 6.7).
  • FlowstaIdentity Tier 2 (Flowsta Phase 3; REQ-NDO-CS-14, REQ-NDO-CS-15): Governance rules can require a valid Flowsta link (per REQ-NDO-CS-15 checks) for credentialed access to resources that need sybil resistance or cross-network accountability — same phase and pattern as Unyt governance-operator enforcement (ndo_prima_materia.md Section 6.7).

The AffiliationState, PortableCredential, and ZKP dimensions above require the AffiliationRecord entry type (REQ-AGENT-05), cross-zome AffiliationState queries, and/or ZKP proof infrastructure — all post-MVP. Flowsta Tier 1 is the exception among trust signals: voluntary linking can ship in Flowsta Phase 1 without those dependencies. Flowsta Tier 2 enforcement requires Flowsta Phase 3 (zome_gouvernance changes), not Phase 1.


7. Complexity Economics Justification: Why Each Classification Matters

Rivalry matters because it determines the fundamental economic logic. Non-rivalrous resources exhibit positive sum dynamics — sharing them creates more value, never less. Rivalrous resources exhibit zero-sum dynamics in the short term — access by one agent genuinely prevents access by another. Conflating these in a governance system produces either over-restriction (damaging information flows) or under-restriction (depleting physical commons). No other classification has more direct governance consequences.

Scope matters because it determines information propagation. Benkler's analysis of networked information environments shows that scope determines who needs to know about a resource for it to produce value. A method that benefits the entire world should propagate globally; a specialised tool scoped to one project should not create noise in the global discovery layer. Scope-driven discovery anchors reduce the information overhead of the global DHT.

Property regime matters because it encodes the relationship between the resource and its community. A Nondominium resource cannot be captured, enclosed, or removed from the commons — this is a hard guarantee built into its governance validation rules. A Commons resource can be governed into restriction by its stewards. Individual-owned resources can be withheld. The economic consequences of each regime are profound and should be permanent attributes of the resource's identity, not mutable governance settings.

Reliability matters because it is information. In a P2P system with no central quality control, agents making decisions about which resources to access, which tools to borrow, which methods to follow, need reliable information about the track record of those resources. A resource with a high failure rate imposes hidden costs on the network — missed deadlines, wasted materials, unsafe working conditions. Making reliability visible and queryable converts hidden costs into explicit governance inputs.

Resource nature and method resources matter because the governance architecture for a documented protocol is fundamentally different from the governance architecture for a physical tool. A method (recipe, process, protocol) is non-rivalrous, can be forked and adapted, should be versioned and attributed, and its quality affects every physical process it governs. Modelling methods as first-class resources enables the network to track method provenance, quality, and evolution — and to connect method quality to the physical resource outcomes produced using those methods.

Intangibles matter negatively — as a design constraint. The OVN wiki's extensive treatment of intangibles is a warning: governance systems that ignore social capital, trust, and community sense will inadvertently destroy them through surveillance, commodification, or capture. The NDO's design choices (peer validation rather than central authority, private PPRs rather than public scoring, permissionless access rather than gatekeeping) are intangible-preserving choices. They should be recognised as such, so that future design decisions are evaluated against the same standard.


This is a living document. As the generic NDO project begins, the gap analysis in Section 5.3 should be converted into formal requirements. The forward map in Section 6 should be reviewed against the actual NDO project scope and prioritised accordingly. The OVN wiki at ovn.world remains the authoritative reference for community-validated resource ontology concepts.

Governance: Ontology, Implementation, and Forward Map

Type: Archive / Knowledge Base Document
Created: 2026-03-11
Relates to: ndo_prima_materia.md, unyt-integration.md, flowsta-integration.md, resources.md, agent.md
Sources: MVP code (zome_gouvernance, zome_person), post-MVP design documents, OVN wiki — Governance


Purpose

This document maps the three states of Governance understanding in the Nondominium / NDO project:

  1. Implemented — what exists today in the MVP zome_gouvernance and zome_person codebases
  2. Planned — what is designed in post-MVP requirements documents
  3. Remaining — what the OVN wiki's 15 years of commons-based peer production practice contains that NDO does not yet plan to implement

The goal is to ensure that the generic NDO — built as a standalone hApp — represents a principled, complete governance architecture that can support diverse communities and use cases through configuration, not custom code.


1. Conceptual Foundation: Governance in P2P Complexity Economics

1.1 What Governance Is (and Is Not)

The OVN wiki defines governance as "a means of direct influence for an organization." More structurally, it has three core functions:

  • Selection — choosing among alternatives; decision-making
  • Enforcement — enacting and reinforcing choices
  • Adaptation — sensing, feedback, and evolving the rules

In traditional organisations, governance is largely concentrated: a small group selects, enforces, and adapts. In P2P open networks, all three functions must be distributed across a large, permeable, changing set of participants — without centrally controlled bottlenecks. This is not a political preference; it is an information-theoretic necessity. Bar-Yam's complexity matching principle: the governance system's complexity must match the organisational complexity it manages. As the network grows and its challenges diversify, only distributed governance can keep pace.

1.2 Embedded Governance and Stigmergy

The most important governance concept for the NDO is embedded governance: engineering the environment so that desirable behaviour is facilitated and undesirable behaviour is made impossible or costly, rather than relying on policing.

The OVN wiki describes this precisely: "Embedded governance (or immanent governance) is about engineering the environment in which actions are deployed to direct, channel or shape action, to take away the possibility of undesirable or less desirable action alternatives."

In practice: instead of writing a rule "you must not transfer a resource without a validated custodian," make it technically impossible to record a custody transfer without a prior commitment accepted by an accountable agent. The rule is in the architecture, not in a policy document that humans can ignore.

This is also stigmergy in the complexity economics sense: governance through environmental modification. Ants do not follow written rules — their collective behaviour emerges from pheromone trails (environmental signals) that individual agents respond to locally. The NDO's capability slot surface (Layer 0 stigmergic attachment) is exactly this: governance emerges from what agents choose to attach to resources, without central coordination.

The same stigmergic attachment pattern applies to agent identity anchors: a FlowstaIdentity capability slot on the agent's Person entry hash (ndo_prima_materia.md Section 6.5 defines the Person attachment surface; Section 6.7 specifies Flowsta). Tier 1 is permissionless at the DHT level; Tier 2 is when a community turns that signal into a hard governance precondition via typed GovernanceRule mechanisms (Flowsta Phase 3).

The distinction between soft and hard embedded governance matters:

  • Hard embedded: cryptographic impossibility of the prohibited action (Holochain validation rules, capability tokens)
  • Soft embedded: social norms encoded as discoverable defaults (GovernanceRules marked as required, reputation consequences)

The NDO primarily uses hard embedded governance (Holochain integrity zomes are cryptographic) with soft embedded governance at the application layer (GovernanceRules are data that agents must choose to enforce in their coordinator logic).

1.3 Governance as Signal Processing, Not Rule Enforcement

The OVN wiki makes a critical distinction: OVN governance is not "rules-based, but rather signal-based, as norms emerge in real time from agent preferences, in context." Rules assume a known, closed world. Signals are the governance of complex, open, evolving systems.

In complexity economics terms: the adjacent possible (Kauffman) is never fully knowable. Rules written today cannot anticipate tomorrow's edge cases. The governance architecture must support emergence — agents should be able to propose and enact new norms through their behaviour, not just comply with pre-written rules.

This has direct implications for NDO design: the governance layer should expose proposing, voting, and adapting mechanisms as first-class capabilities, not just enforcement mechanisms. The current MVP focuses almost entirely on enforcement. Adaptation is barely present. Proposal is absent.

1.4 The REA Governance Parallel

The OVN wiki makes a structural proposal with deep implications: "Architecture governance in a way that it becomes compatible with the organizational and economic model architecture. REA is used to model the economic reality of the network, use the same structure to describe governance."

This means: governance events are EconomicEvents. Governance policies are Resources. Governance actors are Agents. The Policy/Scheduling/Accountability layers of REA are the governance architecture, not just the economic architecture.

The implication: the NDO's zome_gouvernance — which already models EconomicEvents, Commitments, and Claims — should be the natural home for governance events as well. A decision to grant a role is a governance EconomicEvent. A governance proposal is a Commitment. The decision outcome is a Claim. This unification is not complete in the current codebase but is architecturally supported.

1.5 Holonic Multi-Scale Governance

The OVN is fractal: ventures nest in networks, networks nest in networks-of-networks. Each level has its own governance concerns, while sharing protocols and standards. The NDO, as a holon (simultaneously whole and part), needs governance that is self-similar across scales — the same primitives should work at the instance level, the network level, and the federation level.

The OVN wiki defines three governance layers:

  • Network-of-networks (ecosystem): protocols, standards, interoperability
  • Network (commons community): shared resources, roles, benefit distribution
  • Venture (project): specific work, specific benefit distribution

Currently the NDO implements only venture-level governance (single resource interactions, agent roles, process validation). Network and federation-level governance are absent.

1.6 Ostrom's Principles as NDO Architecture

Elinor Ostrom's 8 principles for governing commons (Governing the Commons, 1990) provide a design checklist for the NDO governance architecture:

Ostrom's PrincipleNDO implementation
1. Clearly defined boundaries (who is in)Role system: SimpleAgent / AccountableAgent / PrimaryAccountable + functional roles
2. Match rules to local conditionsGovernanceRules embedded in ResourceSpecifications (per-resource rules)
3. Collective choice arrangementsGap: No formal participation in rule-making by affected agents
4. Monitoring (observation of rules and resources)EconomicEvents + PPR system provides comprehensive audit trail
5. Graduated sanctionsGap: PPR system tracks rule compliance, but sanctions are informal
6. Conflict-resolution mechanismsGap: Only a PPR category exists; no dispute resolution process
7. Minimal recognition of rightsArchitectural property: Holochain permissionless access
8. Nested enterprises (multi-scale)Gap: Only single-level governance; no nested structure

2. Current Implementation (MVP)

2.1 Governance-as-Operator Architecture

The most important architectural choice in the MVP is the separation of data from governance logic:

  • zome_resource: pure data model — creates and stores ResourceSpecification, EconomicResource, GovernanceRule entries without enforcing any business logic
  • zome_gouvernance: state transition operator — the resource zome requests transitions, the governance zome evaluates the applicable rules and approves or rejects them

This is the REQ-ARCH-07 design. It means governance logic can evolve without touching the data model, different governance schemes can be applied to the same resource types, and governance is independently testable.

This architecture is the NDO's most principled contribution to governance design — it directly implements the OVN insight that governance must be compatible with the economic model (REA), because governance and economics are handled by the same zome operating on the same entry types.

2.2 VfAction System (16 Actions)

The VfAction enum defines all possible economic actions, and by extension, all possible governance-relevant state transitions:

Standard ValueFlows actions: Transfer, Move, Use, Consume, Produce, Work, Modify, Combine, Separate, Raise, Lower, Cite, Accept

Nondominium-specific extensions: InitialTransfer (first transaction by a Simple Agent, triggering role promotion), AccessForUse (access request triggering governance evaluation), TransferCustody (custody-specific transfer preserving nondominium property regime)

Each action has semantic methods: requires_existing_resource(), creates_resource(), modifies_quantity(), changes_custody(). This is the deontic layer — actions are typed by their governance implications.

2.3 Commitment / EconomicEvent / Claim Cycle

The MVP implements the core ValueFlows observation cycle:

Commitment (intent + obligation)
  └─ EconomicEvent (what actually happened)
       └─ Claim (link: this event fulfills that commitment)

This is the planning → observation bridge. Commitments are governance artifacts: they are the declared intent of an agent, time-bound, linking provider and receiver for a specific VfAction on a specific resource. The claim verifies fulfillment. The entire chain is auditable on the DHT.

This cycle is both governance and economics — consistent with the OVN wiki's REA governance parallel.

2.4 Validation System

ValidationReceipt: a peer-issued record that a specific item (resource, event, agent identity) was validated by a specific agent, with an approval decision, type, notes, and timestamp.

ResourceValidation: a multi-agent validation workflow for a specific resource, with configurable schemes ("2-of-3", "simple_majority", "N-of-M"). Tracks current vs. required validator counts and aggregate status.

The validation system implements the monitoring and graduated sanction aspects of Ostrom's principles: it is the mechanism by which the community collectively validates that resources, agents, and processes meet the network's standards before they gain access to higher-trust activities.

Validation functions in the coordinator:

  • validate_new_resource: validates a resource being added to the network
  • validate_agent_identity: validates an agent's private identity data for role promotion
  • validate_specialized_role: validates a request for Transport, Repair, or Storage roles
  • create_resource_validation: creates a multi-agent validation workflow
  • check_validation_status: queries whether required validators have approved

2.5 The PPR System: 16 Categories, Bilateral Cryptographic Signatures

The Private Participation Receipt (PPR) system is the most complete governance mechanism in the MVP. It generates cryptographically signed, private, bilateral records of every economic interaction.

PrivateParticipationClaim entry structure:

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    pub fulfills: ActionHash,           // References the Commitment
    pub fulfilled_by: ActionHash,       // References the EconomicEvent
    pub claimed_at: Timestamp,
    pub claim_type: ParticipationClaimType,   // One of 16 categories
    pub performance_metrics: PerformanceMetrics,
    pub bilateral_signature: CryptographicSignature, // Both parties sign
    pub counterparty: AgentPubKey,
    pub resource_hash: Option<ActionHash>,
    pub notes: Option<String>,
}
}

The 16 ParticipationClaimType categories across 5 groups:

GroupCategoriesGovernance role
GenesisResourceCreation, ResourceValidationNetwork entry, contribution tracking
Core custodyCustodyTransfer, CustodyAcceptanceCustody chain accountability
ServicesMaintenanceCommitmentAccepted, MaintenanceFulfillmentCompleted, StorageCommitmentAccepted, StorageFulfillmentCompleted, TransportCommitmentAccepted, TransportFulfillmentCompleted, GoodFaithTransferService economy accountability
GovernanceDisputeResolutionParticipation, ValidationActivity, RuleComplianceGovernance participation tracking
End-of-lifeEndOfLifeDeclaration, EndOfLifeValidationLifecycle management accountability

PerformanceMetrics structure with weighted components:

  • timeliness (weight 0.25)
  • quality (weight 0.30)
  • reliability (weight 0.25)
  • communication (weight 0.20)
  • overall_satisfaction (additional signal)

Bilateral cryptographic signatures: both the recipient and the counterparty sign the PPR. This is not just authentication — it is mutual accountability. Neither party can unilaterally issue a PPR; both must sign. This prevents false claims and creates bilateral commitment to the record.

ReputationSummary: a derived, privacy-preserving aggregate that agents can selectively share. Counts by category, average performance, time period. The agent controls what they reveal; the summary proves they have a track record without revealing individual interactions.

The PPR system is the NDO's most direct implementation of Ostrom's monitoring principle. It is also the input to the governance equation (access to governance = f(contribution history)).

2.6 Role System and Capability-Based Access

RoleType enum: SimpleAgent, AccountableAgent, PrimaryAccountableAgent, Transport, Repair, Storage

The first three are governance tiers (graduated trust levels). The last three are functional roles (validated competencies for specific processes).

Role assignment is tracked in PersonRole entries (in zome_person), created by assigned_by agents with appropriate governance tier. Role transitions (SimpleAgent → Accountable, Accountable → Primary) require:

  1. Private identity validation by existing AccountableAgents
  2. Completion of first validated transaction (for Simple → Accountable)
  3. PPR milestones and specialist role validation (for Accountable → Primary)

Capability-based access (Holochain native): capability tokens gate cross-zome calls and agent-to-agent requests. The NDO extends this with:

  • PrivateDataCapabilityMetadata: tracks field-level access grants with 30-day maximum expiry
  • RevokedGrantMarker: explicit revocation record (Holochain capability revocation does not leave a trace by default)

This is the access control layer of the deontic ontology: permissions are cryptographically issued and cryptographically revoked, not relying on runtime checks.

TODO (G1, REQ-AGENT-01, REQ-AGENT-02 — post-MVP): The role system and all governance workflows assume AgentPubKey as the requestor. Specifically: RoleType is assigned to individual agents only; ValidationReceipt.validated_by is a single AgentPubKey; PPR counterparty is an AgentPubKey; and GovernanceTransitionRequest.requesting_agent is an AgentPubKey. Collective, Project, Network, and Bot agents (AgentEntityType from agent.md §6.1) cannot currently hold roles, participate in validation schemes, sign PPRs, or act as governance requestors. Post-MVP, role assignment must accept AgentContext (a union of individual and collective agent references). Delegation rules for collective signing authority must be defined — e.g., a designated PrimaryAccountableAgent representative key for the collective NDO, or an N-of-M multi-sig from its member agents. See implementation_plan.md §3 [G1+Resource] and agent.md §3.1.

2.7 What the MVP Does Well

  • Governance-as-operator is the correct architectural pattern: clear separation of data model and governance logic, enabling swappable governance
  • VfAction semantics — typed actions with governance implications — are a principled approach to deontic governance encoding
  • Bilateral cryptographic PPRs are a novel and strong accountability mechanism; stronger than reputation systems that rely on one-sided ratings
  • Multi-scheme validation ("2-of-3", "N-of-M") supports configurable collective decisions at the resource validation level
  • Graduated role tiers implement Ostrom's "clearly defined boundaries" principle
  • Private-yet-derivable reputation (PPR → ReputationSummary) correctly addresses the privacy/accountability tension

2.8 Known Gaps in the MVP

GapImpactStatus
No governance proposal mechanismAgents cannot propose changes to GovernanceRules; changes require developer updatePlanned indirectly via GovernanceRule update functions
No collective decision makingOnly binary validation schemes; no conviction voting, quadratic voting, etc.Gap
No dispute resolution processOnly a PPR category for dispute resolution participation; no actual mechanismGap
Governance tiers create de facto hierarchyThe Simple/Accountable/Primary tier system, while non-coercive, concentrates governance influenceStructural design tension
No metagovernanceWho can change the governance rules? No formal mechanismGap
No temporal governanceRules don't expire; decisions don't sunsetGap
No governance layersOnly venture-level governance; no network or federation layerGap
No registriesNo formal lists of validated agents, active ventures, legitimate proposalsGap
Governance rules untypedrule_type and rule_data are free strings; no schema enforcementPlanned fix in ndo_prima_materia.md
No offchain governance bridgeNo mechanism to record offchain decisions as DHT artifactsGap
ReputationSummary not used for governance weightPPRs accumulate but don't mechanically influence governance accessPlanned via Unyt credit limit integration
No affiliation spectrum in governance accessAll validated agents treated equivalently; governance cannot enforce "active affiliates only" conditions; the 1-9-90 participation distribution is acknowledged conceptually but not implementedGap — requires AffiliationState (G2) cross-zome query from the governance operator; see agent.md §4.2, resources.md §4.5
No collective agent governance participationCollective, Project, Network, and Bot agents (G1) cannot hold roles, sign PPRs, or act as validators; economic events between a project and an organisation cannot be correctly modelledGap — requires AgentContext extension across role assignment, PPR issuance, and validation receipt; see agent.md §4.1
No governance-enforced cross-app identityCommunities cannot cryptographically require a verified same-person link (W3C DID / IsSamePersonEntry) before high-trust transitionsPlanned: IdentityVerification-style GovernanceRule + FlowstaIdentity slot checks (ndo_prima_materia.md Section 6.7, REQ-NDO-CS-14, REQ-NDO-CS-15)
No sybil resistance for governanceMultiple source chains controlled by one physical person can dilute validation quorums, game role promotion, or accumulate disproportionate PPR countsGap — requires social vouching (N existing active affiliates vouch for a new agent) or optional proof-of-personhood (G9); see agent.md §5.3. Planned complement (not replacement): optional Tier 2 Flowsta identity checks for high-trust roles (REQ-NDO-CS-14, ndo_prima_materia.md Section 6.7)
No pseudonymous governance participationPseudonymous or anonymous agents cannot accumulate PPRs or earn governance access without linking contributions to a persistent identityGap — by current design; pseudonymous participation mode (G10) is a post-MVP option with a defined affiliation path; see agent.md §4.5

3. Post-MVP Roadmap

3.1 Governance-as-Operator Extended to LifecycleStage

The prima-materia model introduces two orthogonal state dimensions, both governed by the governance zome acting as state transition operator:

  • LifecycleStage (10 stages on NondominiumIdentity): the maturity/evolutionary phase of the resource. Each transition requires a valid economic event and a role-authorized request. Examples: Prototype → Stable (peer validation), Active → EndOfLife (challenge period).
  • OperationalState (7 states on EconomicResource): the current process acting on a resource instance. Transitions are triggered by process events: a transport Move event sets InTransit; its completion clears it back to Available. Transport, storage, and maintenance are processes — they do not advance LifecycleStage.

Both dimensions generate auditable lifecycle history via EconomicEvent entries, extending the governance-as-operator pattern to cover the complete resource state model.

3.2 EconomicAgreement GovernanceRule Type (Unyt Integration)

The EconomicAgreement GovernanceRule type (see unyt-integration.md) adds programmable economic governance to the existing rule set. Unyt Smart Agreements (RHAI scripts) become governance rules — specifying not just who may act but what economic consequence follows. This is a direct implementation of the OVN's connection between governance and the economic model.

Identity verification for cross-app identity follows the same structural pattern: a discoverable CapabilitySlot (Tier 1) plus an enforceable GovernanceRule (Tier 2) — detailed in Section 3.7 (Flowsta).

3.3 NDO Capability Slot Surface (Stigmergic Governance)

The CapabilitySlot surface (Section 6 of ndo_prima_materia.md) enables stigmergic governance at the NDO level. Any agent can attach governance tools (a GovernanceDAO slot, a dispute resolution hApp, a voting tool) to any NDO's Layer 0 identity hash without modifying the NDO entry. Governance infrastructure attaches to resources, not the other way around.

That same ndo_prima_materia.md Section 6 also defines the Person entry hash as a capability surface for agents (e.g. FlowstaIdentity); as rules mature, the governance operator may read both resource Layer 0 attachments and agent identity attachments when evaluating transitions — without prescribing every MOSS tool in the DNA.

Multi-custodian consent mechanisms (from many-to-many-flows.md): when a resource has multiple custodians, governance decisions that affect it require multi-party consent. This brings network-level governance down to the resource level.

3.5 Reputation-Weighted Governance (via Unyt)

The PPR → Unyt credit limit feedback loop (unyt-integration.md Section 7) is the governance equation in practice: contribution history determines economic access, and economic access determines which governance interactions are available. This is not yet explicit governance weighting, but it creates the data foundation for it.

When both Unyt and Flowsta are adopted, a Flowsta DID (via a valid Tier 1 FlowstaIdentity slot and IsSamePersonEntry) can anchor cross-app attribution of the same reputation signals that inform Unyt credit limits (ndo_prima_materia.md Section 6.7, Section 11.6).

3.6 Agent Ontology Impacts on Governance-as-Operator (Post-MVP)

The expanded agent ontology from agent.md introduces three structural changes to the governance-as-operator architecture that must be addressed in the post-MVP generic NDO:

3.6.1 AgentContext as Requestor (TODO G1, REQ-AGENT-02)

The GovernanceTransitionRequest.requesting_agent: AgentPubKey field (see governance-operator-architecture.md §2.1) must be extended to requesting_agent: AgentContext post-MVP. AgentContext is a union that accommodates Individual, Collective, Project, Network, Bot, and ExternalOrganisation agent types (see agent.md §6.1). The governance evaluation functions validate_agent_permissions and validate_agent_for_promotion must be extended to handle each type. For Bot and collective agents, the signing authority is the operator: AgentPubKey declared in AgentEntityType::Bot, or the designated PrimaryAccountableAgent representative of the collective NDO. Multi-sig patterns (N-of-M from collective NDO members) are an alternative for high-stakes governance actions. See Section 6.6 of this document for the full collective agent governance pattern.

3.6.2 AffiliationState as Governance Condition (TODO G2, REQ-AGENT-03, REQ-AGENT-05)

The governance operator must support min_affiliation conditions in GovernanceRule.rule_data. When a GovernanceRule contains a min_affiliation field (e.g. "min_affiliation": "ActiveAffiliate"), the operator must:

  1. Cross-zome call zome_person to retrieve the requesting agent's AffiliationRecord entries
  2. Derive the agent's current AffiliationState (UnaffiliatedStranger | CloseAffiliate | ActiveAffiliate | CoreAffiliate | InactiveAffiliate)
  3. Compare the state against the min_affiliation threshold and block the transition if the agent does not meet it

This is the mechanism by which the governance equation (Section 4.4, Section 6.4) becomes operationally enforceable — not merely a conceptual aspiration. Without this cross-zome query, the governance equation has no runtime implementation. See resources.md §5.3 (Affiliation-gated resource access) and implementation_plan.md §3 [G2+Resource].

3.6.3 AffiliationRecord as Governance Ceremony (TODO G6, REQ-AGENT-05)

Signing an AffiliationRecord — the formal Terms of Participation ceremony — is itself a governance event in the ValueFlows sense. Using the existing Commitment/EconomicEvent cycle:

  • The agent creates a Commitment entry: "I commit to the Terms of Participation, Nondominium & Custodian agreement, and Benefit Redistribution Algorithm"
  • The act of signing the AffiliationRecord entry with the agent's key constitutes the fulfilling EconomicEvent
  • A Claim links the two, creating an auditable on-chain record of the affiliation ceremony

The AffiliationRecord entry hash then becomes the evidence that the agent's AffiliationState function returns ActiveAffiliate. This is what transitions the agent from CloseAffiliate (knows the network, not yet committed) to ActiveAffiliate (has formally committed, gains governance access). No separate "activation" function is needed — the AffiliationState derivation reads the presence or absence of the AffiliationRecord directly from the DHT.

3.7 Flowsta Integration — Identity Verification Governance (flowsta-integration.md)

Parallel to Unyt (ndo_prima_materia.md Section 6.6 vs 6.7): Unyt combines a UnytAgreement capability slot with an endorsed EconomicAgreement GovernanceRule and, at full enforcement, a RAVE proof on the transition request. Flowsta combines a FlowstaIdentity capability slot on the agent's Person entry hash (target: an IsSamePersonEntry action hash committed by flowsta-agent-linking zomes) with an endorsed IdentityVerification rule (or equivalent typed rule): transitions that the rule scopes (e.g. PrimaryAccountableAgent promotion, high-value TransferCustody) are blocked unless Tier 2 validation passes (REQ-NDO-CS-15: slot present, IsSamePersonEntry includes requestor key, not revoked).

Tier 1 — permissionless attestation (REQ-NDO-CS-12, REQ-NDO-CS-13): FlowstaIdentity is a SlotType variant; any agent may attach a slot pointing at a valid IsSamePersonEntry. The governance zome does not require this for baseline participation.

Tier 2 — governance requirement (REQ-NDO-CS-14, REQ-NDO-CS-15): When an applicable rule is in force, evaluation shall verify: (a) a FlowstaIdentity capability slot exists from the requestor's Person hash; (b) the referenced IsSamePersonEntry includes the requestor's AgentPubKey as one of the two signing parties; (c) the link has not been revoked via the Flowsta coordinator's revoke_link (ndo_prima_materia.md Section 6.7).

Implementation locus (planned, not MVP): In ndo_prima_materia.md, Flowsta Phase 3 extends the same governance-operator / evaluate_transition_request story as Unyt Phase 3 — unified transition evaluation that reads typed rules and cross-zome / cross-cell evidence. Today's MVP stores GovernanceRule as rule_type / rule_data strings in zome_resource (no enum yet) and uses separate coordinator paths such as validate_agent_for_promotion and validate_agent_for_custodianship for private-field checks, without Flowsta or IdentityVerification enforcement. Tier 2 identity checks are specified to fold into that unified evaluation as the generic NDO matures.

PPR and reputation: With a verified slot, ReputationSummary is attributable to a cross-app DID (REQ-NDO-AGENT-08; prima Section 6.7). Attribution (same person across apps) is not claim transferability (PrivateParticipationClaim entries remain bound to local keys) — the same distinction as resources.md §4.6.

Complementarity: Flowsta answers who is who; Unyt answers who owes what. Communities may adopt one, both, or neither (ndo_prima_materia.md Section 6.7, Flowsta and Unyt). See resources.md §3.8 for resource-ontology cross-links and agent.md §3.5 for the agent-facing tier summary.

Traceability: ndo_prima_materia.md Section 11.6 (Flowsta integration in the requirements matrix).


4. OVN Governance Ontology: 15 Years of Practice

4.1 Governance Layers

The OVN wiki defines three governance layers, each with different concerns:

Network-of-networks layer (ecosystem governance):

  • Protocols and standards for cross-network interoperability
  • Role and reputation portability across organisational boundaries — planned: W3C DIDs plus FlowstaIdentity / IsSamePersonEntry as a near-term cross-network identity anchor (REQ-NDO-AGENT-08, ndo_prima_materia.md Section 6.7), with Verifiable Credentials and ZKP proofs as longer-term depth (see agent.md §4.4)
  • Content management standards enabling effective cross-network documentation
  • Custodian agreements, exchange firm mandates

Network layer (commons community governance):

  • Resource access governance (tools, spaces, brand, infrastructure)
  • Access to network-level governance participation
  • Benefit distribution algorithm and governance equation
  • Protocols for contribution accounting and transactions within the network

Venture layer (project governance):

  • Benefit distribution for specific projects (regulated by benefit redistribution algorithm)
  • Autonomous governance within the network's meta-rules

The NDO currently implements only venture-layer governance. The generic NDO must support all three, using the same primitives at each scale.

Complexity economics note: Multi-scale governance that uses self-similar primitives is not just architecturally elegant — it is functionally necessary. A governance system that only works at one scale cannot adapt to the fractal structure of real OVN communities. The holonic NDO structure (each NDO is both a whole and a part) requires holonic governance.

4.2 Governance Components

Governing bodies: Committees, offices, working groups. The OVN wiki notes that functions like "leadership," "coordination," and "accountability" should be seen as processes that can be distributed or embodied, not as roles necessarily held by specific individuals. The NDO's role system partially addresses this, but does not model governing body structures.

Registries: Formal lists used in governance processes — list of affiliates, list of events, list of legitimate funding proposals, list of ventures, list of digital services. Registries enable algorithmic governance: "only those included in the registry of affiliates will be considered for participating" in a decision. The NDO has anchor-based discovery links but no governance-specific registries.

Decision making: The OVN wiki lists multiple decision-making mechanisms: Free initiative, Red flag, Lazy democracy, Advice process, Voluntary subordination. None of these are implemented in the NDO beyond binary approval/rejection in validation schemes.

Body of agreements: Smart contracts + paper contracts + hybrid. Currently the NDO has GovernanceRules (programmable, onchain) and Commitments (onchain). Missing: integration with paper/legal agreements (even as hash references), and the hybrid model between onchain enforcement and offchain human processes.

People, environment, purpose: The OVN draws on constitutional theory: People (who is in and how they interact), Environment (external pressures on the organisation), Purpose (the attractor that orients governance). In NDO terms: People = agent system; Environment = DHT and surrounding ecosystem; Purpose = the nondominium property regime embedded in the DNA. These are correct architecturally but not explicitly modeled as governance artifacts.

4.3 Governance Processes

The OVN wiki lists five governance processes for how decisions get made:

ProcessDescriptionNDO support
Free initiativeAny agent can act without prior approval within their scopePartially: permissionless network entry; role-gated process initiation
Red flagAny agent can signal concern about a proposed actionGap: No signal mechanism for concerns
Lazy democracyProposals pass by default unless someone objectsGap: Not implemented
Advice processMust consult affected parties before actingGap: Not implemented
Voluntary subordinationAgents voluntarily follow decisions they didn't makePartially: governance-as-operator (agents accept system rules by participating)

The processes are not mutually exclusive. Different types of decisions warrant different processes. The generic NDO should support configurable governance process assignment per decision type.

4.4 Access to Governance and the Governance Equation

The OVN wiki identifies a key design problem in open systems: the long tail distribution of participation. A typical OVN has a 1-9-90 structure: 1% are core participants (entrepreneurial, high commitment), 9% are active contributors, 90% are occasional participants. The governance system must be sensitive to this — it cannot treat all participants equally without producing either governance paralysis (too inclusive) or oligarchy (too exclusive).

The governance equation maps contribution history to governance access:

governance_access = f(past_contributions, future_commitments)

Past contributions are measured through contribution accounting (PPRs in NDO). Future commitments are pledges of future work (Commitments in NDO). Access to governance is seen as a benefit — one of the outputs of participation in the commons, alongside economic benefits and social benefits.

The OVN affiliation spectrum (agent.md §4.2) is the operational definition of this equation — the concrete mechanism by which participation depth maps to governance tier:

  • UnaffiliatedStranger / CloseAffiliate → individual-level access only: permissionless DHT reads, basic VfActions; no governance participation
  • ActiveAffiliate → governance participation unlocked: validation, proposal submission, dispute resolution
  • CoreAffiliate → elevated governance weight: rule amendment, role promotion, registry management; algorithmically determined from PPR contribution rate above a configurable threshold
  • InactiveAffiliate → reduced access: prior contributions preserved and visible; governance weight suspended until re-engagement

The AffiliationRecord entry (G6) is the formal on-ramp that transitions an agent from CloseAffiliate to ActiveAffiliate. It is a governance event in the ValueFlows sense: the agent creates a Commitment (I commit to the Terms of Participation, the Nondominium & Custodian agreement, and the Benefit Redistribution Algorithm), fulfils it by signing the AffiliationRecord entry on-chain, and a Claim links the two. From that moment, the agent's AffiliationState derivation function (which reads DHT data, not a stored field) returns ActiveAffiliate, and the governance gate opens.

Post-MVP, ZKP proofs (G7) enable agents to prove their affiliation tier to other governance participants without revealing which network they are affiliated with, their full contribution history, or the identity of their counterparties. An agent can prove "I am at least an ActiveAffiliate with ≥ N governance claims" without disclosing the raw PPR data. This is the privacy-preserving meritocracy design: governance access based on contribution without requiring surveillance of the agent's full history.

Flowsta and complexity matching: Tier 1 (permissionless FlowstaIdentity attestation) keeps friction low for the long tail of occasional participants. Tier 2 (REQ-NDO-CS-14, ndo_prima_materia.md Section 6.7) lets communities require Tier 2–validated Flowsta linking only where Bar-Yam-style complexity matching justifies the coordination cost — e.g. PrimaryAccountableAgent promotion or high-stakes custody — without mandating Flowsta for every agent.

Non-binary decision making: The OVN wiki proposes mechanisms beyond yes/no voting: conviction voting (continuous preference posting, updated over time), quadratic voting (cost of additional votes grows quadratically, preventing concentration), rank choice (preference ordering across alternatives). These are described as composable — basic decision-making patterns that can be combined into more complex governance recipes.

Complexity economics note: The governance equation is an application of Benkler's observation that P2P systems can process more granular information than market or hierarchical systems. Instead of binary in/out, the governance system can weight participation based on the richness of contribution history, producing governance decisions that reflect actual contribution patterns rather than crude majority rules.

4.5 Embedded Governance — Onchain and Offchain

The OVN wiki's most practically important governance insight for NDO: the distinction between:

  • Governance of the OVN: meta-rules about how the network behaves; control resides outside/above the automated system
  • Governance through the OVN: automated execution through smart contracts, self-enforcing agreements

This maps to:

  • Offchain governance (governance of): the community's agreements about rules, maintained in documents and social processes; what the DNA is designed to implement
  • Onchain governance (governance through): the actual HDI validation rules, capability tokens, GovernanceRules; what the DNA implements and enforces automatically

The OVN wiki is explicit: "What cannot be automated? Human issues: interpersonal problems, emotions, etc. cannot be automated." Metagovernance — discussions about the rules, proposals for new rules, architectural decisions — requires human process. The NDO should provide hooks for metagovernance without trying to automate it.

Sensorica's current governance is described as "mostly offchain (written in documents), although some governance aspects are embedded within the infrastructure." The NDO project represents the transition toward more onchain governance, with Nondominium as "the resource transfer and flow engine... designed as an organization-agnostic system that embeds governance rules directly within resource definitions."

Complexity economics note: The question of how much to automate is itself a governance decision. Full automation produces a rigid, brittle system that cannot adapt to unforeseen situations. Full human process is slow and expensive. The optimal point depends on the community and context — which is why the NDO should support configurable automation depth, not hard-code a single approach.

4.6 Stigmergy and Governance

The OVN wiki treats stigmergy as a governance mechanism, not just an implementation pattern. "Stigmergic governance relies on embedded governance, meaning that the effect of these fundamental principles are complemented by the properties of the environment."

The key insight: governance can be reduced to a small number of principles embedded in the environment, with complex collective behaviour emerging from individual responses to environmental signals. Ants build nests of extraordinary complexity without written rules — just a few genetic principles and an environment they modify collectively.

For the NDO: the fundamental governance principles should be encoded into the DHT structure (Holochain validation rules, capability tokens, the VfAction semantics). The specific governance recipes for different communities should emerge from how those communities configure and extend the environment (GovernanceRules, CapabilitySlot attachments, role definitions). The system should not need a comprehensive rulebook — it needs a well-designed environment.

The OVN's description of stigmergy as "governance focused on attention — governing our collective attention" is relevant: capability slots and anchor links are both mechanisms for directing agents' attention to what is relevant, allowing them to coordinate without central direction.

4.7 Deontic Ontology

The OVN wiki explicitly calls for a deontic ontology integrated with REA: "Fundamental concepts and relations that allow us to speak about decisions, rules, norms, obligation and permission." The core operators are Obligation and Permission, from which Access (to benefits or resources) can be derived.

In NDO terms:

  • Permission → capability tokens + role-gated validation + GovernanceRule enforced_by
  • Obligation → Commitment entries (a declared obligation to perform a VfAction by a due date)
  • Access → derived: agent has capability token AND meets GovernanceRule conditions → access granted

The current NDO implements these concepts but does not name them using deontic vocabulary. The generic NDO should formalise the deontic layer as first-class governance entries, not as implicit properties of other entry types.

A deontic governance entry might look like:

#![allow(unused)]
fn main() {
pub struct DeonticRule {
    pub operator: DeonticOperator,  // Obligation | Permission | Prohibition
    pub applies_to: AgentRole,      // Who this rule applies to
    pub regarding: ActionOrResource, // What action or resource it concerns
    pub conditions: Vec<Condition>, // Preconditions for the rule to apply
    pub enforced_by: GovernanceLayer, // Venture | Network | Federation
    pub expires_at: Option<Timestamp>,
}
}

This would replace the current untyped GovernanceRule with a formally typed deontic structure.

Planned first typed rule families alongside that migration include EconomicAgreement (Unyt settlement / RAVE path) and IdentityVerification (Flowsta FlowstaIdentity + IsSamePersonEntry path) — both specified in ndo_prima_materia.md Sections 6.6–6.7 while MVP code still uses rule_type / rule_data strings in zome_resource.

4.8 Temporal Governance

The OVN wiki identifies several temporal dimensions of governance:

  • Decision expiry: decisions can have expiration dates, not just single-moment validity
  • Evaluation triggers: decisions can include evaluation conditions that, if triggered, initiate review or revision
  • Past-looking and forward-looking governance access: both contribution history and future commitments count
  • Preference voting as continuous process: agents update preferences over time, building an ongoing governance profile

The NDO currently has only one temporal governance mechanism: capability grant expiry (30-day maximum for private data access grants). This is correct but minimal. The generic NDO should support temporal governance more broadly.

4.9 Constitution and the Governance of Governance

The OVN wiki discusses whether OVNs should have constitutions. Its conclusion: traditional constitutions (for closed, bounded organisations) don't map well to open, fractal networks. But the concept of a constitutive infrastructure — "all of that organization's implementations of the constitutive function" — is useful.

The constitutive infrastructure of an NDO community is:

  • The DNA validation rules (hard-coded, very difficult to change)
  • The global GovernanceRules (encoded in the DHT, updatable through governance)
  • The community agreements (offchain, referenced but not enforced by the DNA)

The governance surface — the mechanisms through which the constitutive infrastructure can be modified — is a critical design element. In the OVN model, this includes: who can propose a rule change, what deliberation process applies, how changes are ratified, and how they are recorded.

The NDO has no formal governance surface. Rule changes require developer intervention (DNA upgrades) or are limited to per-resource GovernanceRule updates (controlled by role-gated validation). This is a fundamental gap for any community that needs to evolve its own rules.


5. Gap Analysis

5.1 Mapped — OVN concepts implemented or planned in NDO

OVN conceptNDO implementationStatus
Governance-as-operator (embedded rules)zome_gouvernance as state transition operator✅ Implemented
Deontic permission systemCapability tokens + role-gated validation✅ Implemented
Deontic obligation systemCommitment entries with due dates✅ Implemented
Access from PermissionRole-gated VfAction execution✅ Implemented
Monitoring and accountabilityPPR system (16 categories, bilateral signatures)✅ Implemented
Graduated trust / bounded membershipSimpleAgent → Accountable → Primary tiers✅ Implemented
Multi-scheme collective validationResourceValidation with "2-of-3", "N-of-M"✅ Implemented
Governance equation (contribution → access)PPR → role promotion; Unyt credit limit feedback✅ Partial (promotion path); 🔄 Planned (credit/weight)
Embedded governance in resourcesGovernanceRule entries in ResourceSpecifications✅ Implemented (weakly typed)
Typed governance rulesGovernanceRuleType enum (incl. EconomicAgreement, IdentityVerification / Flowsta)🔄 Planned (ndo_prima_materia.md §6.6–6.7, unyt-integration.md, flowsta-integration.md)
Stigmergic governance surfaceCapabilitySlot surface (Layer 0)🔄 Planned (ndo_prima_materia.md)
Economic governance (Smart Agreements)Unyt EconomicAgreement GovernanceRule🔄 Planned (unyt-integration)
End-of-life governance (challenge period)REQ-GOV-11 through REQ-GOV-13🔄 Planned (requirements.md)
Privacy-preserving accountabilityPrivate PPRs + derivable ReputationSummary✅ Implemented
AffiliationRecord entry (formal ToP ceremony)agent.md §6.4 forward design; uses the existing Commitment/EconomicEvent cycle for the signing ceremony; AffiliationState is derived from its presence on the DHT🔄 Planned (post-MVP, G6, REQ-AGENT-05)
Affiliation-gated resource governanceGovernanceRule.rule_data["min_affiliation"] condition evaluated by the governance operator; cross-zome AffiliationState query from zome_person; blocks state transitions for agents below the threshold🔄 Planned (post-MVP, G2 — see resources.md §5.3, implementation_plan.md §3 [G2+Resource])
Governance-enforced identity verificationIdentityVerification rule + FlowstaIdentity slot validation (REQ-NDO-CS-14, REQ-NDO-CS-15; W3C DID + IsSamePersonEntry; ndo_prima_materia.md Section 6.7)🔄 Planned (post-MVP)
Cross-app identity anchor for portable governance signalsStable DID + dual-signed attestation; portable credential attribution (REQ-NDO-AGENT-08)🔄 Planned (post-MVP)

5.2 Partial — concepts present in OVN and partially covered in NDO

OVN conceptNDO partial coverageGap
Openness / equipotentialityPermissionless network entry + role-gated governanceNo formal mechanism to EARN governance access beyond role promotion
TransparencyAll rules and events are public DHT entriesPPRs are private; no holoptism mechanism for governance state
DecentralisationAgent-centric Holochain validationRole tiers create de facto power concentration
Emergent governanceHolochain peer validation is emergentRules are still designed; no mechanism for rules to emerge from agent behaviour
Free initiativeWithin role scope, agents can act unilaterallyNo explicit free initiative declaration or scope definition
Voluntary subordinationAgents accept system rules by joiningNo mechanism to formally express "I subordinate to this decision I opposed"
Body of agreementsGovernanceRules (onchain)No paper/legal agreement model; no hybrid onchain/offchain agreements
Temporal governanceCapability grant expiry (30 days max)No expiry on GovernanceRules; no evaluation triggers on decisions
MetagovernanceGovernanceRule update with role validationNo proposal mechanism; no formal deliberation; no ratification process

5.3 Missing — OVN concepts not yet planned in NDO

OVN conceptGap descriptionProposed resolution
Governance layers (venture / network / federation)Only venture-level governance existsModel governance scope as a property of GovernanceRules and registries; use NDO's holonic composition to nest governance
Decision-making processes (free initiative, red flag, lazy democracy, advice process)No process models beyond binary validationAdd GovernanceProcess as a configurable entry type; composable decision patterns
Governing bodies (committees, working groups)Not modeledModel as a specialised NDO (a governing body is itself an NDO with its own governance and membership)
Registries (affiliate lists, venture lists, legitimate proposal lists)Only anchor-based discovery linksAdd Registry entry type: a governance-managed list of validated entries
Non-binary decision making (conviction voting, quadratic voting, rank choice)Only binary approve/rejectModular vote aggregation patterns in a GovernanceProcess framework
Red flag / concern signalingNo mechanism for agents to raise concerns about proposed actionsAdd GovernanceConcern entry: a signal from any agent about a resource action or governance decision
Governance of governance (metagovernance surface)Rule changes require developer intervention or role-gated updates onlyDefine a formal governance amendment process as a GovernanceProcess type
Long tail awareness (1-9-90 structure)All validated agents treated equivalently in governanceParticipation-weighted governance access (governance equation formally implemented)
Holonic multi-scale governanceOnly single-level governanceGovernance primitives should work at venture, network, and federation scales using the same structures
Temporal governance (rule expiry, decision evaluation triggers)Only capability grant expiryAdd expires_at and evaluation_trigger to GovernanceRules and governance decisions
Offchain governance bridgeNo way to record offchain decisions as DHT artifactsAdd GovernanceRecord entry: a hash of an offchain document/decision with metadata, linking offchain and onchain governance
Constitution / Governance surfaceNo formal description of who can change what rulesImplement a GovernanceConstitution entry at the DNA level: a hash-referenced document + amendment process
Affiliation-based governance access gatingGovernance processes cannot enforce "active affiliates only" conditions; all agents with any role receive the same governance access regardless of participation depthExtend GovernanceRule.rule_data schema with min_affiliation field; extend governance operator evaluate_transition to cross-zome query AffiliationState from zome_person; block transitions below threshold (refs G2, G6, agent.md §4.2, resources.md §5.3)
Collective agent governance participationValidation schemes, PPR issuance, and role assignment all require AgentPubKey; collective, network, and bot agents cannot act as governance participants; economic events between organisations cannot be correctly modelledExtend GovernanceTransitionRequest.requesting_agent and ValidationReceipt.validated_by to accept AgentContext; define delegation rules for collective signing authority — designated operator key or N-of-M from collective NDO members (ref G1, agent.md §4.1, Section 6.6 of this document)
Sybil resistance in governanceMultiple source chains controlled by one physical person can dilute validation quorums, inflate role promotion counts, or accumulate disproportionate PPR governance_claimsOptional Tier 2 Flowsta identity checks (REQ-NDO-CS-14, ndo_prima_materia.md Section 6.7) for high-trust role or transition classes — complementary to social vouching (N existing active affiliates vouch for a new agent before first governance-tier role promotion) and optional proof-of-personhood as a membrane condition (ref G9, agent.md §5.3)
Pseudonymous governance participationPseudonymous or anonymous agents cannot accumulate PPRs or earn governance access without linking contributions to a persistent Person identity; the privacy/efficiency trade-off has no intermediate optionDesign a pseudonymous affiliation path: PPRs issued to a persistent pseudonymous AgentPubKey (no Person entry required); pseudonymous agents can reach ActiveAffiliate status through contribution; blocked from governance roles that require legal accountability (e.g. dispute resolution involving off-chain agreements); see agent.md §4.5 (ref G10)

6. Forward Map: Generic NDO Governance Architecture

6.1 Governance as REA — The Unified Model

The most important design principle for the generic NDO: governance events are EconomicEvents. The unified model:

GovernanceRule  (knowledge layer)    → ResourceSpecification analog
GovernanceRecord (planning layer)    → Commitment analog  
GovernanceDecision (observation layer) → EconomicEvent analog

This means:

  • Proposing a rule change = creating a GovernanceRecord (a Commitment-like intent)
  • Deliberation = Commitments from affected agents (support/oppose)
  • Decision = GovernanceDecision (EconomicEvent-like outcome)
  • Implementation = updated GovernanceRule entries
  • Accountability = ValidationReceipt on the implementation + PPR for governance participants

This is not a new subsystem — it is the existing ValueFlows cycle applied to the governance domain. The governance zome already handles this cycle for resource governance. Extending it to meta-governance is architecturally natural.

6.2 Governance Process as Configurable Entry

#![allow(unused)]
fn main() {
pub struct GovernanceProcess {
    pub name: String,                   // "lazy_democracy", "advice_process", etc.
    pub applies_to: GovernanceScope,    // Venture | Network | Federation
    pub decision_type: DecisionType,    // RuleAmendment | RoleGrant | ResourceAccess | ...
    pub participation_required: Vec<ParticipantSpec>, // Who must participate
    pub quorum: QuorumSpec,             // Minimum participation threshold
    pub threshold: ThresholdSpec,       // What counts as a decision (majority, supermajority, etc.)
    pub timeline: GovernanceTimeline,   // Deliberation + decision + implementation windows
    pub veto_period: Option<Duration>,  // Optional lazy democracy reversal window
    pub expires_at: Option<Timestamp>,  // Sunset clause
}
}

Communities configure which governance process applies to which decision type. The generic NDO provides a library of composable process patterns (from the OVN vocabulary); each NDO instantiation selects and configures its governance recipe.

6.3 Registry Model

Registries are governance-managed lists. They are themselves NDO resources (a registry is a resource with its own governance rules):

#![allow(unused)]
fn main() {
pub struct Registry {
    pub name: String,               // "ValidatedAgents", "ActiveVentures", "LegitimateProposals"
    pub scope: GovernanceScope,     // Which governance layer manages this registry
    pub entry_type: RegistryEntryType, // What kind of entries it contains
    pub admission_process: GovernanceProcess, // How entries are added
    pub removal_process: GovernanceProcess,  // How entries are removed
    pub is_public: bool,            // Whether the registry is publicly readable
}
}

The registry mechanism enables algorithmic governance: "only agents in the ValidatedAgents registry may participate in the next decision." This moves governance from relying on per-decision ad hoc membership determination to managed, auditable lists.

6.4 Participation-Weighted Governance (The Governance Equation)

The OVN governance equation implemented as a cross-zome computation:

governance_weight = f(
    affiliation_state,                            // PREREQUISITE GATE (from agent.md §6.2)
                                                  //   < ActiveAffiliate  → weight = 0 (blocked)
                                                  //   = ActiveAffiliate  → weight computed normally
                                                  //   = CoreAffiliate    → weight × core_multiplier
                                                  //   = InactiveAffiliate → weight = 0 (suspended)
    reputation_summary.average_performance,       // quality of past contributions
    reputation_summary.governance_claims,         // governance participation depth
    reputation_summary.custody_claims,            // resource stewardship depth
    unyt_credit_capacity,                         // economic standing in commons
    active_commitments_count                      // forward-looking engagement
)

The affiliation_state input is derived (not stored) from existing DHT data by zome_person using the formula in agent.md §6.2:

affiliation_state(agent) = f(
    person_exists(agent),
    affiliation_record_exists(agent),   // AffiliationRecord (G6) signed on-chain?
    contributions_count(agent),         // from EconomicEvents
    last_contribution_timestamp(agent), // recency window check
    reputation_summary.total_claims,
    governance_claims_count(agent)
)

The affiliation_state gate ensures that the governance equation's contribution data is only evaluated after the formal affiliation ceremony (AffiliationRecord, G6) is complete. An agent with high PPR scores but no signed AffiliationRecord remains at CloseAffiliate and cannot participate in governance — they must formally commit to the network's terms before their contributions are recognised as governance standing. This prevents incidental interactions (browsing the DHT, casual transactions) from accumulating governance weight without commitment.

This weight determines:

  • Vote weight in non-binary decision mechanisms
  • Thresholds for initiating certain governance processes
  • Access to higher-trust governance functions (dispute resolution, rule amendment)

Critically: the weight function is itself a GovernanceRule, configurable by communities. Different communities weight contribution dimensions differently. The core_multiplier and the recency window for InactiveAffiliate detection are also governance-configurable parameters.

Note: the inclusion of unyt_credit_capacity as an input creates a feedback loop (PPR → reputation → Unyt credit → governance weight → more governance participation → more PPRs). To prevent runaway accumulation, the weight function should apply dampening — e.g., logarithmic scaling of the credit capacity input — so that marginal increases in credit produce diminishing governance weight returns.

Communities may also (configurably) treat Tier 2–validated FlowstaIdentity (or simply presence of a Tier 1 DID link for softer signals) as an additional input for high-trust governance processes — aligned with PPR reputation attributable to a DID (ndo_prima_materia.md Section 6.7) — without requiring a new field in the sketch above.

6.5 Offchain Governance Bridge

A minimal mechanism for linking offchain human decisions to the onchain governance record:

#![allow(unused)]
fn main() {
pub struct GovernanceRecord {
    pub document_hash: String,           // Hash of the offchain document (PDF, markdown, etc.)
    pub document_uri: Option<String>,    // Where to find the document
    pub record_type: OffchainRecordType, // Agreement | Policy | Decision | Constitution
    pub ratified_by: Vec<AgentPubKey>,   // Agents who have ratified this record
    pub effective_at: Timestamp,
    pub supersedes: Option<ActionHash>,  // Previous version of this record
    pub scope: GovernanceScope,
}
}

This is the bridge between the OVN's offchain governance reality (most governance today is documents and social processes) and the onchain aspiration. Agents ratify offchain documents by signing GovernanceRecord entries — creating a cryptographic commitment to the offchain text without requiring full onchain implementation of its processes.

6.6 Collective Agent Governance Patterns (Post-MVP)

The expanded agent ontology (agent.md §3.1, §4.1`) enables working groups, projects, networks, and bots to act as governance participants. Three structural patterns cover the main cases:

Pattern 1 — Collective agents as NDOs

A working group, project, or network is itself an NDO with its own governance layer (Identity + Specification + Process). When a collective NDO participates in external governance — signing a ValidationReceipt, acting as a GovernanceTransitionRequest.requesting_agent, or being a PPR counterparty — it does so through a designated representative: the PrimaryAccountableAgent of the collective NDO, whose AgentPubKey acts on the collective's behalf. Governance decisions affecting the collective (e.g., approving a resource access request it submitted) require internal governance within that collective NDO before the external signature is issued. This nests governance holonically: venture → network → federation, all using the same VfAction/Commitment/EconomicEvent primitives.

Pattern 2 — Multi-sig validation for collective actors

When a governance process requires approval from a collective agent (e.g., a working group must validate a new resource), the ResourceValidation scheme must support AgentContext references in its required_validators field. Two implementation options:

  • Designated operator: the collective NDO has nominated a single PrimaryAccountableAgent whose signature counts as the collective's approval. Simple but creates a governance bottleneck at the operator.
  • Member threshold: the governance scheme accepts approval from N-of-M individual agents who are current active members of the collective NDO. More resilient but requires the validator set to be dynamically resolved from the collective NDO's membership links at validation time.

Both options require the GovernanceProcess entry (Section 6.2) to declare which pattern applies per decision_type. The ResourceValidation.required_validators field transitions from Vec<AgentPubKey> to Vec<AgentContext> post-MVP.

Pattern 3 — Bot / AI agent governance scope

Bot agents (AgentEntityType::Bot { capabilities, operator }) can participate in governance only within the scope declared in their capabilities vector. Examples:

  • A bot may be authorised to sign ValidationReceipt entries for automated integrity checks (e.g., a digital resource hash validation bot) — but not for role promotions or rule amendments, which require human judgment.
  • A bot may be authorised to issue EconomicEvent entries for automated processes (e.g., a scheduler bot recording that a storage commitment has been fulfilled on time) — but not for dispute resolution.

The operator: AgentPubKey in the Bot type is the governance-responsible party: all bot actions are attributed to the operator for accountability purposes, and any PPRs generated by bot interactions list the operator as the accountable counterparty. Bot governance_claims in the ReputationSummary do not contribute to the operator's affiliation_state — they are tracked separately under the bot's own AgentContext with a governance_weight = 0 gate (bots cannot accumulate governance standing independent of their human operator).

TODO (G1, G11 — post-MVP): Implement AgentContext type, extend GovernanceTransitionRequest, ValidationReceipt, and PPR counterparty fields to accept AgentContext. Define Bot delegation scope enforcement in the governance operator's validate_agent_permissions function. See implementation_plan.md §3 [G1+Resource] and agent.md §5.3 (DelegatedAgent).


7. Complexity Economics Justification: Why Each Governance Concept Matters

Governance layers matter because the OVN is fractal. A governance architecture that only works at one scale (venture) cannot coordinate the network-level and federation-level decisions that determine the ecosystem's evolution. Governance without scale awareness will centralise at whichever scale is most powerful, undermining the decentralisation that makes peer production competitive with capitalist alternatives.

Decision processes (advice process, lazy democracy, etc.) matter because different types of decisions have different optimal deliberation speeds. Time-sensitive operational decisions need fast, local authority (free initiative). Rule-changing decisions need wide deliberation and consent. Treating all decisions equally produces either paralysis (everything goes through full deliberation) or autocracy (important decisions get made without consultation). The composable governance process library is the infrastructure for decision-appropriate governance.

Non-binary decision making matters because voting aggregates preferences by throwing away information. A community where 60% support a proposal and 40% strongly oppose it is very different from one where 60% support and 40% mildly prefer an alternative. Binary voting cannot distinguish these — it just says "60% win." Conviction voting (continuous preference updating), quadratic voting (cost-weighted expression), and rank choice (preference ordering) all recover more information from the deliberation process. In complexity economics terms: higher-resolution preference aggregation produces better decisions because it uses more of the information that participants possess.

Registries matter for the same reason that formal membership distinctions matter in Ostrom's commons governance: without a clear definition of who is in the community, governance processes cannot be bounded, quorums cannot be calculated, and the accountability chain cannot be closed. The OVN's long tail distribution means that simple "everyone who has ever participated" definitions produce governance bodies so large and diffuse that decisions become impossible. Algorithmically managed registries — updated by governance, not by developer deployment — solve this.

The governance equation matters because access to governance should not be arbitrary (cooptation, seniority, formal appointment) in a P2P system. Benkler's observation about peer production's information advantage is applicable: distributed contribution data is richer than any centralised assessment of "who is a responsible governance participant." The PPR system generates this data as a byproduct of ordinary participation. Using it to weight governance access converts participation history into governance standing automatically — without administrative overhead.

The offchain bridge matters because full onchain governance is a fiction. Human communities have always and will always need spaces for informal conversation, emotional resolution, and contextual judgment that no smart contract can replicate. The OVN wiki is explicit: "Human issues: interpersonal problems, emotions, etc. cannot be automated." A governance architecture that ignores its own offchain complement will be gamed by agents who understand that the informal layer always overrides the formal. Acknowledging and linking the offchain layer makes the full governance stack legible, auditable, and improvable.

Temporal governance matters because all rules become outdated. A GovernanceRule written for a community of 10 becomes inappropriate for a community of 1000. A decision made under one set of conditions may be harmful under new conditions. Sunset clauses and evaluation triggers are the governance equivalent of software unit tests: they force the community to consciously re-evaluate whether rules still serve their purpose, rather than allowing dead rules to accumulate and complicate the governance landscape.

Cross-app identity (Flowsta) matters for governance for the same reason credential portability and network-layer reputation matter in the OVN model: agents who participate in multiple OVNs or hApps are bridge nodes between networks. Without a verifiable same-person link across conductors, each network treats them as a stranger and must re-derive trust from zero; sybil pressure and cold-start friction repeat at every boundary. Flowsta Tier 1 keeps overhead low for casual participants; Tier 2 applies Flowsta link validation only where complexity matching says the coordination cost is justified (ndo_prima_materia.md Section 6.7, REQ-NDO-CS-14).


This is a living document. The gap analysis in Section 5.3 should be converted into formal requirements as the generic NDO project begins. The forward map in Section 6 describes design directions, not final specifications. Major external capability integrations (Unyt, Flowsta) are traced in ndo_prima_materia.md Sections 6.6–6.7 and Sections 11.5–11.6. The OVN wiki at ovn.world remains the authoritative reference for peer production governance practice.

Nondominium Prima Materia

Status: Post-MVP Design Document
Created: 2026-03-10
Authors: Nondominium project
Relates to: many-to-many-flows.md, versioning.md, digital-resource-integrity.md, unyt-integration.md, flowsta-integration.md, lobby-dna.md


Table of Contents

  1. What is the Prima Materia?
  2. Complexity Economics as Architectural Foundation
  3. Complexity Oriented Programming
  4. The Three-Layer Model: The Prima Materia
  5. Lifecycle State Machine
  6. The Surface of Attachment — Capability Slots
  7. Design Patterns
  8. DHT Data Structures
  9. Requirements
  10. Migration from Current Architecture
  11. Relationship to Other Post-MVP Work

1. What is the Prima Materia?

In medieval alchemy, the prima materia is the primordial, undifferentiated substance that underlies all matter — the formless potential from which everything is made. Before a substance becomes gold, lead, or salt, it passes through the prima materia: an essential, minimal state that carries the capacity to become anything. The alchemists were not simply mystifying chemistry. They were describing a pattern: complex things begin as nearly nothing, and their nature reveals itself progressively through process.

This document borrows that metaphor deliberately. A Nondominium Object (NDO) is the prima materia of the Nondominium system: a minimal DHT structure that carries the potential to become any kind of resource — digital or physical, simple or composite, idea or fabricated artifact — and that grows in structure and function as the resource it represents grows in complexity and social embeddedness.

1.1 The Gap in the Current Model

The current Nondominium data model contains two primary entry types for resources:

  • ResourceSpecification — the type or template of a resource: name, description, category, governance rules
  • EconomicResource — an instance of a resource: quantity, unit, custodian, location, state

This model is well-grounded in the ValueFlows standard and works well for resources that already exist in a stable, operational form. But it has a fundamental limitation: it represents being, not becoming.

There is no structure in the current model for a resource that is:

  • an idea that has not yet been designed
  • a project in active development
  • a design under peer review before any physical instance exists
  • an artifact entering hibernation, not end-of-life
  • a project record that persists as institutional memory after activity has ceased

The current ResourceState enum (PendingValidation, Active, Maintenance, Retired, Reserved) conflates two orthogonal dimensions: the maturity/evolutionary phase of the resource (LifecycleStage) and the transient operational condition imposed by active processes (OperationalState). It also does not describe the emergence of a resource from nothing, nor its graceful retirement into archival memory.

1.2 The Intent of the Prima Materia

The prima materia defines a minimal DHT object that:

  1. Exists as a placeholder from the moment of conception — before design, before specification, before any physical instantiation
  2. Grows in structure progressively — gaining specification, governance rules, assets, and process infrastructure as the resource matures
  3. Carries a permanent, stable identity — a content-addressed anchor that persists through all transformations, including end-of-life
  4. Provides a surface of attachment for capabilities that cannot be anticipated in advance — external hApps, governance tools, fabrication queues, issue trackers
  5. Represents the full lifecycle — from the first spark of an idea to archival tombstone

1.3 The Key Example: Nondominium Itself

The Nondominium hApp is itself an NDO. It began as an idea (Ideation), passed through design (Specification), prototype implementation (Development → Prototype), and is now moving toward its first stable release. Its assets are code on GitHub. Its process is the collaborative work of contributors. Its governance rules are embedded in the code. Its identity is stable across all versions.

When someone starts a hardware design project for a shared CNC machine, they create an NDO. When they publish the 3D files for distributed fabrication, Layer 1 (Specification) is activated. When contributors begin working, Layer 2 (Process) is activated. When the design is mature and being fabricated by many, all three layers are fully active. When the design becomes obsolete, Layers 1 and 2 are archived, but the NDO identity remains — a permanent record that the thing existed, who created it, and what happened to it.


2. Complexity Economics as Architectural Foundation

The three-layer design of the NDO is not an arbitrary architectural preference. It is a direct consequence of applying complexity economics to the problem of representing resources in a decentralized peer-to-peer system. Three theoretical pillars justify the design.

2.1 Bar-Yam: Complexity Matching

Yaneer Bar-Yam's central thesis in Complexity Rising is that a system's behavioral complexity must match the complexity of the challenges it faces. When the environment's complexity exceeds a system's adaptive capacity, the system fails. Hierarchical command-and-control structures have cognitive ceilings — there is only so much complexity a centralized decision-maker can handle. As the environment grows more complex, decentralized, networked systems with distributed decision-making become necessary.

Applied to DHT data design, this principle has a direct corollary: do not pre-classify a resource at creation time. At the moment a resource is conceived, its full lifecycle complexity is unknowable. A project started as a personal experiment may become a global standard. A community tool may be adopted by thousands of fabrication networks. A hardware design may spawn dozens of forks and regional variants. Committing to a fixed classification at t=0 is the data equivalent of hierarchical overreach — assuming a knowledge of the future that no agent possesses.

The OVN computational model (ovn.world) demonstrates this formally: Finite State Machines, the computational model underlying most fixed-classification systems, require a number of states that grows exponentially with social complexity — quickly reaching numbers exceeding the atoms in the observable universe for even modestly complex communities. FSMs are not inadequate; they are categorically incompatible with governing complex human systems. A resource data model built on fixed state at creation is an FSM in disguise.

The solution is the adjacent possible (Kauffman): at any moment, only the next step is visible. The NDO model respects this by making layer activation a response to rising environmental complexity, not a commitment made at genesis.

2.2 Benkler: Information Opportunity Costs

Yochai Benkler's analysis of commons-based peer production (Coase's Penguin, 2002; The Wealth of Networks, 2006) identifies the primary economic advantage of P2P coordination as lower information opportunity costs. Markets and managerial hierarchies are informationally lossy — they filter, aggregate, and approximate the rich information available in a distributed network. P2P systems process this information with lower loss because agents at the edges of the network can sense and act on local information directly, without routing it through central aggregators.

In the NDO context, this principle justifies the pay-as-you-grow structure of layer activation. Each layer carries a coordination overhead:

  • Layer 0 (Identity) has near-zero coordination cost: one agent creates one entry.
  • Layer 1 (Specification) has moderate cost: governance rules must be written, assets attached, peer review coordinated.
  • Layer 2 (Process) has the highest cost: economic events must be recorded, commitments tracked, PPRs issued, multi-agent consent coordinated.

In a hierarchical system, all resources would bear the full overhead of the richest representation, regardless of their current needs. Benkler's insight says this is wasteful — it imposes coordination costs that exceed the information value returned. The NDO model matches coordination cost to actual coordination demand: a tool lent between neighbors needs no Process layer; a shared fabrication standard being actively developed by a distributed network needs all three.

2.3 Morin: The Seven Principles of Complexity

Edgar Morin's seven principles of complex thought, applied in the SENSORICA complexity economics framework, provide a philosophical grounding for the NDO's structure. Each principle finds direct expression in the design:

Morin's PrincipleExpression in the NDO
Systemic (interdependence)Every NDO exists in relation to agents, processes, and other NDOs; its identity is defined by its links, not its content alone
Holographic (part reflects whole)Every NDO carries the full three-layer potential, regardless of its current activation state
Retroactive (feedback loops)Lifecycle stage changes are triggered by economic events (outputs of the system feeding back as inputs)
Recursive (products as producers)An NDO representing a project produces NDOs representing its outputs; Nondominium-the-hApp produces Nondominium-as-resource
Dialogical (antagonisms coexist)The NDO holds the tension between digital and physical, between stability (identity) and change (process), between public (spec) and private (governance)
Reintroduction of the subjectAgent motivation and contribution are first-class: PPRs, custody, and contribution tracking are built into the NDO's process layer
Ecology of actionNo action guarantees its outcome; the NDO's stigmergic capability surface allows unforeseen capabilities to attach — the system is never fully knowable from the source code alone

2.4 Holonic Structure

The NDO is a holon in the sense used by the OVN model: an entity that is simultaneously a whole in itself and a part of a larger whole. Arthur Koestler coined the term holon to describe systems where every level of organization is both complete and a component. Holonic systems are characteristic of living organisms, ecosystems, and complex economies.

An NDO is:

  • A whole: it has its own identity, specification, and process — it is a complete self-describing object
  • A part: it is embedded in networks of other NDOs — a Project NDO contains Resource NDOs, which contain Design NDOs, which reference Component NDOs

This recursive self-similarity is what makes the NDO fractal. Each NDO carries the same structural potential; the difference between a sub-component and a top-level project is only one of social context and activation state, not of structural type.


3. Complexity Oriented Programming

The NDO's design embodies a programming paradigm that does not yet have a formal name but is emerging in practice. We call it Complexity Oriented Programming (COP).

3.1 The Reductive Paradigm and Its Limits

All dominant programming paradigms share a common epistemological assumption: complexity is a problem to be eliminated through abstraction.

  • Object-Oriented Programming (OOP) encapsulates complexity behind interfaces, hiding internal state
  • Functional Programming (FP) eliminates side effects, reducing programs to pure transformations
  • Procedural programming linearizes execution, replacing concurrency with sequence

These strategies are powerful for building closed, bounded systems where the programmer can anticipate all relevant states in advance. But they break down when applied to open, complex, emergent systems — precisely the kind of systems that P2P infrastructure must support.

The failure mode is always the same: the abstraction boundary becomes a wall that the system's actual complexity cannot respect. Side effects leak through interfaces. State escapes encapsulation. The linear pipeline encounters a feedback loop it was not designed to handle. The FSM reaches a state it was not designed to represent.

3.2 Complexity Oriented Programming: The Inversion

COP inverts the reductive assumption. Instead of hiding complexity through abstraction, COP models complexity faithfully and works with it as the primary material. The vocabulary shifts:

Reductive ParadigmComplexity Oriented Programming
Single source of truthDistributed state with coherence protocols
Deterministic pipelinesAdaptive feedback architectures
Contained side effectsTyped relational events flowing through a graph
Static type at creationDynamic layer activation in response to context
Closed system designConditions designed for emergence

The epistemological shift is from programmer as god (designs a closed, fully known system) to programmer as ecologist (designs conditions, observes what arises). The system is never fully knowable from the source code alone.

3.3 Where COP Already Exists

COP is not invented here — it is being discovered simultaneously in several places:

  • Holochain's agent-centric model: there is no global state machine. Each agent runs local validation rules, and global coherence emerges from the aggregate of local actions. The DHT is not designed; it arises.
  • ValueFlows/REA: the economic model is not a state machine but a flow of events. Resources do not "have states" in the FSM sense — they accumulate economic events that describe what has happened to them. The past is permanent; the present is an interpretation of the past.
  • Actor model concurrency: concurrent entities with private state communicating through asynchronous messages — the distributed system coordinates without shared mutable state.
  • Reactive/dataflow systems (FRP, signals): time and context are primary, not afterthoughts. Computation is driven by the flow of values through a graph, not by sequential instruction execution.
  • Cellular automata: global patterns emerge from purely local rules. Complexity at the macro level is not programmed; it is grown.

3.4 The NDO as a COP Primitive

The NDO is the fundamental COP primitive in the Nondominium system. Its design embodies COP in every structural choice:

  • Layer activation is not a state machine transition — it is a response to rising environmental complexity, designed to allow emergence rather than constrain it
  • Capability slots are not predefined interfaces — they are typed relational events that flow through the DHT link graph, allowing unforeseen tools to attach without modifying the NDO entry
  • Lifecycle transitions are not deterministic state machine edges — they are feedback arcs driven by economic events (agents' actions feeding back into the resource's representation of itself)
  • The tombstone at end of life is not a deletion — it is the permanent memory that the system was alive, respecting the append-only nature of the DHT as a feature, not a constraint

The honest challenge of COP, noted in the complexity_oriented_programming archive: tooling. Debuggers, type systems, and unit tests all assume reducibility. COP requires new verification paradigms — closer to simulation and formal methods than conventional testing. This is reflected in the Nondominium testing strategy, which relies on multi-agent Tryorama scenarios rather than isolated unit tests.


4. The Three-Layer Model: The Prima Materia

The prima materia is realized in the NDO as a three-layer structure, where each layer corresponds to a different register of complexity and is activated independently in response to the resource's current context.

4.1 The Brain Architecture Analogy

The human brain provides the most vivid structural analogy. It did not evolve as a single organ — it evolved in layers, each built on and coupled to the previous:

  • The brainstem handles vital functions: breathing, heartbeat, arousal. It is always active. The organism cannot survive without it. It is the oldest evolutionary layer.
  • The cerebellum handles coordination, posture, and procedural memory — the form of the body's activity. It evolved on top of the brainstem and is coupled to it, but can be understood as a distinct functional layer.
  • The cortex handles higher cognition, agency, and deliberate action. It evolved on top of the cerebellum and is the most recently evolved layer. It is situational — not all cognitive tasks require cortical engagement.

These layers do not replace each other. They are coupled and co-active. The cortex does not work without the brainstem. But the brainstem can sustain basic life without the cortex (as in the case of brain death with brainstem function preserved). And at death, the cortex goes first.

The NDO mirrors this exactly:

┌─────────────────────────────────────────────────────────────────┐
│ Layer 2 — PROCESS                                               │
│ (cortex: agency, higher cognition, multi-agent economic work)   │
│ Activated situationally. Deactivated at hibernation / EOL.      │
├─────────────────────────────────────────────────────────────────┤
│ Layer 1 — SPECIFICATION                                         │
│ (cerebellum: coordination, form, replication)                   │
│ Activated when form needs to be shared. Archived at EOL.        │
├─────────────────────────────────────────────────────────────────┤
│ Layer 0 — IDENTITY                                              │
│ (brainstem: vital functions, always on, the tombstone)          │
│ Always active. The last thing standing. Never voided.           │
└─────────────────────────────────────────────────────────────────┘

4.2 Layer 0: Identity — The Permanent Anchor

Layer 0 is the prima materia in its most essential form. It is the minimum viable NDO — the smallest structure that gives a resource a stable, cryptographically-anchored identity in the DHT.

Structure:

#![allow(unused)]
fn main() {
struct NondominiumIdentity {
    name: String,
    initiator: AgentPubKey,
    property_regime: PropertyRegime,
    resource_nature: ResourceNature,
    lifecycle_stage: LifecycleStage,
    created_at: Timestamp,
    // Optional: a brief human-readable description
    description: Option<String>,
}
}

Key properties:

  • The action hash of this genesis entry becomes the permanent, stable identity of the NDO — a DID-like namespace that all other layers and capabilities link to
  • It is never voided — Holochain's append-only DHT makes deletion impossible, and this is correct: the identity of a resource that ever existed should be permanently accessible
  • The only field that evolves is lifecycle_stage, updated through governance-validated transitions
  • At end of life, Layer 0 alone remains as the tombstone: a permanent record that the resource existed, who created it, its nature, and when it concluded

When Layer 0 exists alone:

  • A stub registration: "this thing exists, I intend to develop it"
  • A tombstone: all other layers have been archived, the identity remains
  • The minimal representation of an idea that has not yet been designed

4.3 Layer 1: Specification — The Form

Layer 1 is activated when a resource has a form that needs to be communicated to others — when the resource is ready to be described, shared, peer-reviewed, or replicated.

Activation mechanism: Creation of an NDOToSpecification link from the Layer 0 identity hash to a ResourceSpecification entry.

Layer 1 carries:

  • Design intent and description (what the resource is)
  • Governance rules (who can access it and how)
  • Assets: files, 3D models, code references, digital integrity manifests, documentation links
  • Tags and categories for discovery

When to activate Layer 1:

  • The resource has a design worth sharing with others
  • Distributed fabrication is intended (the spec is the product)
  • Peer review or validation of the design is needed
  • The resource needs to be discoverable by category or tag

When Layer 1 becomes dormant:

  • The resource enters hibernation or end of life
  • The specification is archived (is_active: false)
  • The NDOToSpecification link remains readable (DHT is append-only), but no new updates are made to the spec

The design file as the product: In the distributed fabrication context (cosmolocal production), the Layer 1 specification is the product in the most meaningful sense. When a hardware design reaches Stable lifecycle stage, anyone with a 3D printer and the fabrication spec can produce a local instance. The spec is not documentation for a product — it is the shareable, replicable artifact. This is the nondominium model's most radical departure from capitalist product logic.

4.4 Layer 2: Process — The Activity

Layer 2 is activated when there is active multi-agent economic work around the resource — when contributions are being tracked, custody is being transferred, use events are being recorded, or commitments are being made.

Activation mechanism: Creation of an NDOToProcess link from the Layer 0 identity hash to a ValueFlows Process entry.

Layer 2 carries:

  • EconomicEvent records of all actions taken on or with the resource
  • Commitment records of agents' intentions to perform future actions
  • Claim records linking commitments to fulfilling events
  • PrivateParticipationClaim (PPR) records issued to participants
  • Labor contribution tracking for OVN-compliant attribution

When to activate Layer 2:

  • A second agent becomes involved (multi-agent coordination begins)
  • Development work begins in earnest and contributions need to be tracked
  • Custody transfers are required
  • Use events or resource access need to be recorded
  • PPRs need to be issued (any economically accountable interaction)

When Layer 2 becomes dormant:

  • The process concludes: all commitments are fulfilled or cancelled, all events are finalized
  • The resource enters hibernation (process paused, not terminated)
  • End of life: process is formally concluded with terminal events

4.5 Layer Composition Across the Lifecycle

graph TD
    L0["Layer 0: Identity\n(always active)"]
    L1["Layer 1: Specification\n(activated when form exists)"]
    L2["Layer 2: Process\n(activated for active work)"]

    subgraph ideation ["Ideation"]
        L0_i[Layer 0 only]
    end

    subgraph design ["Specification / Design"]
        L0_d[Layer 0]
        L1_d[Layer 1 activated]
        L0_d --> L1_d
    end

    subgraph dev ["Development / Active"]
        L0_v[Layer 0]
        L1_v[Layer 1]
        L2_v[Layer 2 activated]
        L0_v --> L1_v --> L2_v
    end

    subgraph hib ["Hibernation"]
        L0_h[Layer 0]
        L1_h["Layer 1 (dormant)"]
        L2_h["Layer 2 (dormant)"]
        L0_h --> L1_h -.-> L2_h
    end

    subgraph eol ["End of Life"]
        L0_e["Layer 0 (tombstone)"]
        L1_e["Layer 1 (archived)"]
        L2_e["Layer 2 (concluded)"]
        L0_e --> L1_e -.-> L2_e
    end

    ideation --> design --> dev --> hib --> eol

5. Resource State Model: Two Orthogonal Dimensions

The current ResourceState enum (PendingValidation, Active, Maintenance, Retired, Reserved) conflates two independent dimensions of a resource's state. The NDO requires their explicit separation:

  • LifecycleStage — the maturity or evolutionary phase of the resource as an artefact. Advances rarely and (mostly) irreversibly, driven by significant events (design completion, peer validation, fabrication, end-of-life declaration). Lives on the NondominiumIdentity (Layer 0).
  • OperationalState — what process is currently acting on a specific resource instance. Cycles frequently as processes begin and end. Managed by the governance zome. Lives on the EconomicResource instance (Layer 2).

The key distinction: transport, storage, and maintenance are processes that can apply to a resource at any lifecycle stage. A Prototype can be InTransit (moved between R&D labs). An Active resource can be InStorage, InTransit, or InMaintenance simultaneously with its lifecycle stage. These are not lifecycle milestones — they are transient operational conditions.

5.1 LifecycleStage Enum

Lives on NondominiumIdentity. Describes what the resource has become, not what is happening to it right now.

#![allow(unused)]
fn main() {
pub enum LifecycleStage {
    // --- Emergence Phase ---
    Ideation,       // Placeholder: name and intent only. Layer 0 alone.
    Specification,  // Design/requirements being written. Layer 1 activating.
    Development,    // Active construction, prototyping. Layers 0+1+2 active.
    Prototype,      // PoC exists, not production-ready. Layers 0+1+2 active.

    // --- Maturity Phase ---
    Stable,         // Production-ready, design is replicable. All layers active.
    Distributed,    // Being actively fabricated/used across the network.

    // --- Operation Phase ---
    Active,         // In normal use. All layers active.

    // --- Suspension ---
    Hibernating,    // Not end-of-life — dormant. Layers 1+2 dormant, L0 active.

    // --- Terminal ---
    Deprecated,     // Superseded by a newer version. Links to successor.
    EndOfLife,      // Concluded. L0 tombstone, L1 archived, L2 concluded.
}
}

Note: Maintenance and Reserved are not lifecycle stages — they describe transient operational conditions and belong in OperationalState (Section 5.4).

5.2 Lifecycle → Layer Activation Table

Lifecycle StageLayer 0Layer 1Layer 2Notes
IdeationActivePure stub: name + property regime
SpecificationActiveActivatingSpec being written, governance rules defined
DevelopmentActiveActiveActiveMulti-agent contributions begin
PrototypeActiveActiveActivePoC exists, process ongoing
StableActiveActiveActiveSpec is production-ready
DistributedActiveActiveActiveUse events flowing
ActiveActiveActiveActiveNormal operation; OperationalState cycles independently
HibernatingActiveDormantDormantIdentity preserved; no new events
DeprecatedActiveArchivedConcludedSuccessor NDO linked
EndOfLifeActive (tombstone)ArchivedConcludedPermanent record only

At any stage from Development onward, the OperationalState (Section 5.4) may be any value independently of the lifecycle stage.

5.3 Lifecycle Transitions and Governing Events

Each transition between lifecycle stages is driven by a VfAction economic event, validated by the governance zome acting as state transition operator. This is consistent with the existing governance-as-operator architecture (REQ-ARCH-07).

stateDiagram-v2
    [*] --> Ideation : "NondominiumIdentity created"

    %% Forward maturity chain (monotonic, no skipping)
    Ideation --> Specification : "Produce (spec created)"
    Specification --> Development : "Work (contributions begin)"
    Development --> Prototype : "Produce (PoC delivered)"
    Prototype --> Stable : "Accept (peer validated)"
    Stable --> Distributed : "Transfer (first fabrication)"
    Distributed --> Active : "Use (operational)"

    %% Suspend — any non-terminal stage may enter Hibernating
    Ideation --> Hibernating : "Lower"
    Specification --> Hibernating : "Lower"
    Development --> Hibernating : "Lower"
    Prototype --> Hibernating : "Lower"
    Stable --> Hibernating : "Lower"
    Distributed --> Hibernating : "Lower"
    Active --> Hibernating : "Lower (activity paused)"

    %% Resume — always returns to the stage that was paused (hibernation_origin)
    Hibernating --> Ideation : "Raise (to origin)"
    Hibernating --> Specification : "Raise (to origin)"
    Hibernating --> Development : "Raise (to origin)"
    Hibernating --> Prototype : "Raise (to origin)"
    Hibernating --> Stable : "Raise (to origin)"
    Hibernating --> Distributed : "Raise (to origin)"
    Hibernating --> Active : "Raise (to origin)"

    %% Terminal — any non-terminal stage may deprecate or end
    Hibernating --> Deprecated : "Cite (successor declared)"
    Active --> Deprecated : "Cite (superseded)"
    Deprecated --> EndOfLife : "Consume (formally concluded)"
    Active --> EndOfLife : "Consume (formally concluded)"

Hibernating is a memory-preserving pause. The hibernation_origin field records the stage that was active before entering Hibernating. On resume ("Raise"), the resource returns to exactly that stage — not necessarily Active. This means a resource paused at Specification resumes at Specification, preserving the integrity of the maturity chain.

The Mermaid above shows representative "Raise" arrows; in practice, the valid resume target is always hibernation_origin, enforced by the integrity zome.

Transition authorization by role:

TransitionAuthorized by
Ideation → SpecificationInitiator (Layer 0 creator)
Specification → DevelopmentInitiator or any Accountable Agent with contribution
Development → PrototypeCustodian + governance validation
Prototype → StableMulti-agent peer validation (configurable N-of-M)
Stable → DistributedCustodian
Distributed → ActiveCustodian
Any → HibernatingCurrent custodian(s)
Hibernating → {origin stage}Current custodian(s)
Any → DeprecatedCustodian + declaration of successor NDO
Any → EndOfLifeCustodian + challenge period (see REQ-GOV-11 to REQ-GOV-13)

5.4 OperationalState Enum

Lives on EconomicResource (Layer 2). Describes what process is currently acting on a specific resource instance. Set and cleared by the governance zome when processes begin and end.

#![allow(unused)]
fn main() {
pub enum OperationalState {
    // Default — no active process.
    Available,

    // A Commitment exists for a future process; no active Event yet.
    // Cleared when the Event is created or the Commitment is cancelled.
    Reserved,

    // A transport process is active (a TransferCustody or Move Event is open).
    // Valid at any LifecycleStage (a Prototype may be InTransit between labs).
    InTransit,

    // A storage service commitment is active.
    // Valid at any LifecycleStage.
    InStorage,

    // A repair or maintenance process is active (a Modify Event is open).
    // Valid at any LifecycleStage; does NOT advance the lifecycle.
    InMaintenance,

    // Actively being used (a Use Event is open).
    InUse,

    // Awaiting peer validation before becoming Available.
    // Initial state for newly created EconomicResource instances.
    PendingValidation,
}
}

OperationalState transitions (governed by the governance zome, triggered by EconomicEvents):

TriggerFromTo
EconomicResource createdPendingValidation
Peer validation approvedPendingValidationAvailable
Commitment acceptedAvailableReserved
Commitment cancelledReservedAvailable
Transport process begins (Move / TransferCustody event)Available or ReservedInTransit
Transport process completes (Accept event)InTransitAvailable
Storage process beginsAvailable or ReservedInStorage
Storage process completesInStorageAvailable
Maintenance process begins (Modify event)AvailableInMaintenance
Maintenance process completes (Accept event)InMaintenanceAvailable
Use begins (Use event opened)AvailableInUse
Use endsInUseAvailable

OperationalState transitions do not advance LifecycleStage. A resource that completes a repair cycle returns to OperationalState::Available at the same LifecycleStage it had before.


6. The Surface of Attachment — Capability Slots

A central requirement of the NDO is that it must not need to anticipate all future capabilities at design time. Like Discord channels to which anyone can add integrations, or like the MOSS Weave Interaction Pattern where hApps can link to any Weave Asset, the NDO must provide a surface of attachment for capabilities that do not yet exist.

6.1 The COP Principle of the Attachment Surface

In COP terms: you cannot design the attachment surface in advance. The DHT link space is the surface. Any agent, any hApp, any future tool that knows the Layer 0 identity hash can create a link from that hash to whatever it needs to attach. The NDO entry itself does not change.

This is stigmergy in the complexity economics sense: indirect coordination through the environment. Ants coordinate the construction of a nest not by communicating plans but by leaving pheromone trails (environmental modifications) that other ants respond to. The NDO's Layer 0 hash is the pheromone trail — any agent can respond to it by attaching capabilities.

The attachment mechanism uses typed DHT links with structured link tags:

NDO_identity_hash →[LinkType: CapabilitySlot, tag: { slot_type, author, attached_at }]→ capability_target_hash

Predefined slot type vocabulary (extensible):

Slot TypeDescriptionTypical target
DocumentationHuman-readable docs, wiki, manualsWiki entry hash or external URI
IssueTrackerBug reports, feature requestsIssue tracker hApp cell hash
FabricationQueueDistributed manufacturing requestsFabrication process hash
GovernanceDAOGovernance proposals and votingDAO hApp cell hash
VersionGraphVersion history and forksVersioned entity hash (see versioning.md)
DigitalAssetFiles, 3D models, code, manifestsAsset manifest hash
WeaveWALMoss/Weave Asset LinkWAL (Weave Asset Locator)
FlowstaIdentityCross-app identity attestationIsSamePersonEntry action hash
UnytAgreementProgrammable economic terms governing value flows triggered by resource interactionsUnyt Smart Agreement entry hash (cross-cell reference)
CustomAppAny other hApp integrationAny hash, labelled by consumer

6.3 MOSS / Weave Integration

The Weave Interaction Pattern defines an open standard for creating, searching, linking, and organizing "social space units" — precisely what an NDO is. MOSS integration works as follows:

  1. The NDO is declared as a Weave Asset by creating a WeaveWAL capability slot pointing to the asset's WAL
  2. Other MOSS tools (issue trackers, document editors, governance DAOs, fabrication queues) can attach to the NDO's Layer 0 hash via the Weave protocol without modifying the NDO entry
  3. As the NDO gains lifecycle stages, MOSS tools can respond to those transitions — a fabrication queue tool might automatically activate when the NDO reaches Stable

6.4 Governance of the Attachment Surface

The stigmergic surface is permissionless at the DHT level — any agent can create a capability link. But the governance layer determines which links are trusted and surfaced to other agents, versus which are ignored or filtered:

  • Links created by the initiator or custodians are trusted by default
  • Links created by Accountable Agents are conditionally trusted
  • Links created by unknown agents are filtered until governance validation
  • The governance zome can validate capability attachments using the same validate_new_resource pattern already in place

This mirrors the approach taken in the wider complex systems literature: edge-based sensing and attachment is permissionless (lower information opportunity costs), while trust propagation and filtering happens through distributed consensus rather than centralized gatekeeping.

6.5 CapabilitySlot on Agent Identity (Post-MVP)

TODO (G15 — Agent CapabilitySlot): The stigmergic attachment pattern described in this section applies equally to agent identities. The Person entry hash is itself a stable, permanent identity anchor — analogous to the NondominiumIdentity Layer 0 hash — and should serve as a surface of attachment for external capabilities:

  • DID documents (W3C Decentralised Identifiers)
  • Verifiable Credential wallets
  • Reputation oracles from other networks
  • Professional credential registries
  • Social graph exports

An agent's Person entry hash → CapabilitySlot → external capability target, using the same CapabilitySlotTag / SlotType pattern defined in Section 8.3. This enables credential portability and DID interoperability without modifying the core Person entry schema.

See documentation/archives/agent.md §3.2 and REQ-AGENT-11.

Flowsta Auth (Section 6.7) provides the first concrete implementation of this pattern: a FlowstaIdentity capability slot linking the Person hash to an IsSamePersonEntry — a dual-signed cryptographic attestation that the agent's NDO key and their Flowsta Vault key belong to the same person. This gives every agent a W3C DID (did:flowsta:uhCAk...) without modifying the Person entry schema.

6.6 Economic Agreement Slots — Unyt Integration

A detailed analysis of the UnytAgreement slot type, its relationship to the governance layer, and the three-phase integration path.

Why Unyt Is a Capability, Not a Layer

The prima materia model has three structural layers. It might seem natural to propose a fourth — an "Economic Layer" — for payment and value-flow infrastructure. This would be the wrong architecture.

The COP principle of pay-as-you-grow is explicit: impose only the coordination overhead that the resource's current social complexity demands. Not all resources need payment infrastructure. A bicycle lent between neighbours does not need a Unyt Smart Agreement. A shared CNC machine used by fifty contributors under a usage-fee model does. Imposing economic infrastructure at NDO creation — making it structural — would repeat the reductive paradigm mistake that the three-layer model was designed to avoid. It would be a fixed classification at t=0 of a future that no agent can know.

Unyt belongs in the capability surface for the same reason that governance DAOs, fabrication queues, and issue trackers do: it is an economic operator that some resources need and others do not, and its attachment should emerge from the network's actual practice rather than be prescribed by the programmer.

The UnytAgreement slot type has one property that other slot types do not: it is governance-enforceable. A Documentation link is informational — the governance zome does not condition state transitions on it. A UnytAgreement link, when endorsed through a GovernanceRule of type EconomicAgreement, becomes a precondition for transition approval. This makes it a hybrid: permissionless at the attachment surface, authoritative at the governance layer.

Two-Tier Economic Authority

The UnytAgreement capability slot operates at two tiers.

Tier 1 — Permissionless Proposal (CapabilitySlot)

Any Accountable Agent can attach a Unyt Smart Agreement to any NDO by creating a CapabilitySlot link of type UnytAgreement. This is an assertion: "I believe this agreement should govern interactions with this resource." The governance zome does not enforce it. Other agents can read it as a proposal, a community suggestion, or a pricing signal. Multiple competing proposals may coexist.

This tier respects the stigmergic principle: lower information opportunity costs, permissionless economic expression, no gatekeeping on proposals.

Tier 2 — Governance Endorsement (GovernanceRule)

When the NDO's custodian — or a community governance process — formally endorses a Unyt Smart Agreement by creating a GovernanceRule entry of type EconomicAgreement, the agreement becomes enforceable. State transitions that trigger it (Access, CustodyTransfer, service processes) require the requesting agent to provide a valid Unyt RAVE as proof of economic settlement before the governance zome approves the transition.

The capability slot (Tier 1) and the governance rule (Tier 2) are independent but complementary: the slot makes the agreement discoverable; the rule makes it mandatory.

graph TD
    Agent["Any Accountable Agent"]
    Custodian["Custodian / Governance Process"]
    NDO["NDO Identity Hash (Layer 0)"]
    Unyt["Unyt Smart Agreement\n(on Unyt DHT)"]
    GovRule["GovernanceRule\n(EconomicAgreement type)\n— Layer 1 asset —"]
    Transition["State Transition Request\n(AccessForUse, CustodyTransfer, etc.)"]
    GovZome["Governance Zome\n(state transition operator)"]
    RAVE["Unyt RAVE\n(proof of settlement)"]
    PPR["PrivateParticipationClaim (PPR)\n+ settlement_rave_hash"]

    Agent -->|"CapabilitySlot link\n(Tier 1: permissionless proposal)"| NDO
    NDO -.->|"links to"| Unyt
    Custodian -->|"GovernanceRule\n(Tier 2: endorsed terms)"| GovRule
    GovRule -->|"linked from ResourceSpecification\n(Layer 1)"| NDO

    Transition -->|"includes rave_hash"| GovZome
    GovZome -->|"validates EconomicAgreement rule"| GovRule
    GovZome -->|"validates RAVE against Unyt DHT"| RAVE
    GovZome -->|"on approval, issues"| PPR
    PPR -->|"settlement_rave_hash"| RAVE

Unyt Smart Agreement as Economic GovernanceRule

The current GovernanceRule entry in zome_resource carries rule_type, rule_data (JSON-encoded), and an optional enforced_by role requirement. The Unyt integration adds a new rule_type variant and a corresponding structured rule_data schema:

#![allow(unused)]
fn main() {
// New variant in GovernanceRuleType enum (zome_resource integrity)
pub enum GovernanceRuleType {
    // ... existing rule types ...
    EconomicAgreement, // rule_data: JSON-serialized EconomicAgreementRuleData
}

// rule_data schema for EconomicAgreement rules
#[derive(Serialize, Deserialize)]
pub struct EconomicAgreementRuleData {
    pub unyt_alliance_id: String,          // Network seed of the Unyt Alliance
    pub smart_agreement_hash: String,       // Entry hash of the Unyt Smart Agreement
    pub trigger_actions: Vec<VfAction>,     // Which VfActions trigger this agreement
    pub settlement_window_secs: u64,        // Max time between RAVE execution and transition request
    pub note: Option<String>,               // Human-readable description of the economic terms
}
}

When the governance zome encounters an EconomicAgreement rule during a state transition evaluation, it executes the following validation sequence:

  1. Confirms that the transition's VfAction is in the rule's trigger_actions list
  2. Requires a rave_hash field in the transition request payload
  3. Queries the Unyt DHT (via cross-DNA call()) to retrieve and validate the RAVE
  4. Confirms the RAVE was executed within the declared settlement_window_secs
  5. Confirms the RAVE's inputs match the transition context (resource identity, provider, receiver, quantity or duration)
  6. Only then approves the state transition and issues the PPR

This makes the governance zome's approval conditional on cryptographic proof of economic settlement — the resource does not move (physically, digitally, or in custody) until the agreed value has flowed.

Value Flow Patterns

Four standard patterns map the most common resource-interaction economics onto Unyt's Smart Agreement library:

PatternTrigger VfActionUnyt Agreement TemplateEconomic logic
Access FeeAccessForUseConditional ForwardUser pre-pays; access granted on RAVE
Service BillingWork (fulfilled Claim)Proof-of-ServiceProvider paid on validated Claim
Revenue SharingTransferAggregate PaymentProceeds split: custodian / protocol / creator
Custody BondTransferCustodyConditional Forward (escrowed)Bond held; returned on clean handoff with PPR

These map directly to the Smart Agreement templates in the Unyt Smart Agreement Library. The Conditional Forward template is the workhorse for access and custody patterns; Aggregate Payment and Proof of Service serve billing and revenue distribution.

The templates use RHAI scripting — the same logic that currently drives Unyt's DePIN billing (Log → Invoice → Agreement → Settlement). For Nondominium, the "log" is the Nondominium Commitment + Claim + ValidationReceipt chain; the invoice is implicit in the EconomicAgreementRuleData; the settlement is the RAVE.

PPR and RAVE: A Complete Provenance Chain

When a state transition is approved with a valid RAVE, the PrivateParticipationClaim generated for the interaction carries the RAVE hash as an optional field:

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    // ... existing fields ...
    pub settlement_rave_hash: Option<String>, // Unyt RAVE hash, if economic settlement occurred
}
}

This creates a complete, cross-verifiable provenance chain:

Commitment
  └─ (fulfilled by) EconomicEvent
       └─ (generates) PrivateParticipationClaim (PPR)
            └─ settlement_rave_hash → Unyt RAVE
                 └─ (verifiable on Unyt DHT: inputs, outputs, agreement, executor)

The PPR is the participation proof: who did what, at what quality, in which role. The RAVE is the economic proof: what value flowed, to whom, under what rules, verified by Unyt peers. Together, they constitute a full, mutually-reinforcing record of a resource interaction that neither system alone can provide.

This linkage also feeds back into the credit system: agents whose PPRs consistently carry RAVEs (meaning they reliably execute their economic obligations) earn higher reputation scores, which in turn increases their Unyt credit limits (see unyt-integration.md). Reputation and credit become two readings of the same underlying participation data.

The Resource as Economic Actor

When an NDO has an endorsed EconomicAgreement governance rule, it becomes a self-pricing, self-settling economic actor. No platform intermediary determines what the resource costs, no rent is extracted by infrastructure owners, and no contract enforcement requires a legal system. The community that embedded the rule in the resource's Layer 1 specification determines the economic terms, and Unyt enforces them cryptographically among peers.

This is the nondominium model's deepest departure from platform economics. Platform platforms capture value by positioning themselves between resource and user — Airbnb between host and guest, Uber between driver and passenger. In the NDO model, the "platform" is the DHT itself: owned by no one, accessible to everyone, governed by the rules the community wrote into the resource. The resource is simultaneously a physical or digital artifact, a governance system, and an economic agent.

In complexity economics terms: the resource has become a holon with economic agency. Not only does it exist within the economic web (participating in ValueFlows events), it actively shapes the economic flows that run through it — enforcing its own terms, rewarding its stewards, and settling its debts, all without human intermediation.

Integration Path

The Unyt integration is structured as three independent phases, each delivering immediate value and requiring no rollback of prior work.

Phase 1 — Capability Surface Extension (no zome structural changes required)

Add UnytAgreement(String) to the SlotType enum. Any Accountable Agent can now attach a proposed Unyt Smart Agreement to any NDO. The governance zome does not enforce these links — they are informational, discoverable proposals. This phase delivers: economic expression in the network (market pricing signals without enforcement), tooling foundations (UIs can surface proposed payment terms), and community standard-setting (the network can develop shared pricing conventions before enforcement is added).

Phase 2 — Governance Rule Extension (zome_resource changes only)

Add EconomicAgreement to the GovernanceRuleType enum and define the EconomicAgreementRuleData schema. Custodians can now formally endorse a Unyt Smart Agreement by creating a GovernanceRule entry. The governance zome reads these rules but does not yet enforce them at transition time — Phase 2 makes the endorsement discoverable and legible to the network without yet conditioning transitions on RAVEs. This phase delivers: governance-layer economic declarations, tooling for custodians to set and communicate official payment terms, and the data structure foundation for Phase 3.

Phase 3 — Governance Zome Integration (zome_gouvernance changes)

The governance zome's evaluate_transition_request function is extended to: (a) check for EconomicAgreement governance rules when processing relevant VfAction events; (b) require a rave_hash in transition requests when such a rule exists; (c) validate the RAVE via cross-DNA call to the Unyt cell; (d) link the RAVE hash into the generated PPR via settlement_rave_hash. This phase delivers: full enforcement, automatic settlement, and the complete PPR↔RAVE provenance chain. The NDO becomes a fully self-pricing economic actor.

6.7 Identity and Authentication Slots — Flowsta Integration

A detailed analysis of the FlowstaIdentity slot type, its relationship to the agent identity surface (Section 6.5), and the three-phase integration path.

Why Flowsta Is a Capability, Not a Layer

The prima materia model has three structural layers. It might seem natural to propose cross-app identity as a mandatory component of Layer 0 — to require every agent to complete Flowsta Vault linking before they can participate. This would be the wrong architecture.

The COP principle of pay-as-you-grow is explicit: impose only the coordination overhead that the resource's current social complexity demands. Not all communities need cross-app identity. A neighbourhood tool-sharing network may operate perfectly well with Holochain-native AgentPubKey identifiers and locally-earned PPR reputation. A multi-network fabrication coalition spanning multiple Holochain apps — where contributors participate in design, fabrication, logistics, and economic settlement across separate DHTs — needs verifiable cross-app identity to prevent sybil fragmentation and enable reputation portability.

Imposing Flowsta at agent registration — making it structural — would repeat the reductive paradigm mistake that the three-layer model was designed to avoid. It would be a fixed classification at t=0 of a future that no agent can know: whether this particular agent will ever need cross-app identity, whether this particular community will ever span multiple networks.

Flowsta belongs in the capability surface for the same reason that Unyt does: it is an identity operator that some communities need and others do not, and its attachment should emerge from the network's actual practice rather than be prescribed by the programmer.

IsSamePersonEntry: The Cross-App Attestation

Flowsta's agent linking mechanism creates a cryptographic attestation — IsSamePersonEntry — on the NDO's DHT that proves two Holochain agent keys belong to the same person. The attestation is committed via the flowsta-agent-linking zomes (flowsta-agent-linking-integrity and flowsta-agent-linking-coordinator), which are added to the NDO's DNA manifest.

The 78-byte signing payload:

  • Bytes 0–38: First agent public key (39 bytes: 3-byte prefix + 32-byte Ed25519 key + 4-byte checksum)
  • Bytes 39–77: Second agent public key (same format)
  • Both keys are sorted lexicographically for canonical ordering
  • Both agents sign this payload: the NDO agent key signs via the local conductor, and the Flowsta Vault agent key signs via the Vault's lair keystore

Verification properties:

  • Purely cryptographic: Ed25519 signature verification on the dual-signed payload — no shared DNA, no API dependency, no central authority needed for verification
  • Any agent on the NDO DHT can verify the attestation by checking both signatures against the embedded public keys
  • Purpose-specific: Flowsta Vault computes the signing payload itself and displays it to the user for approval — apps cannot trick the Vault into signing arbitrary data
  • Revocable: either party can revoke the link via the revoke_link zome function
  • Each Flowsta user carries a W3C DID: did:flowsta:uhCAk... (or did:key:z6Mk...), providing a standards-compliant cross-app identifier

Two-Tier Identity Authority

The FlowstaIdentity capability slot operates at two tiers, paralleling the Unyt two-tier model (Section 6.6).

Tier 1 — Permissionless Attestation (CapabilitySlot)

Any agent can link a Flowsta identity to their Person entry by creating a CapabilitySlot link of type FlowstaIdentity, pointing to the IsSamePersonEntry action hash. This is an assertion: "I have completed Vault agent linking (dual-signed attestation)." The governance zome does not enforce it at Tier 1. Other agents can read it as a trust signal — a voluntarily disclosed cross-app identity. Multiple agents may have Flowsta links; some may not.

This tier respects the stigmergic principle: lower information opportunity costs, permissionless identity expression, no gatekeeping on attestation.

Tier 2 — Governance Requirement (GovernanceRule / Role Promotion)

When a community's governance rules require verified cross-app identity — for example, as a precondition for PrimaryAccountableAgent role promotion, or for custody transfer of high-value resources — the governance zome can condition role transitions on the presence of a verified FlowstaIdentity capability slot on the agent's Person hash. The verification checks:

  1. A FlowstaIdentity CapabilitySlot link exists from the agent's Person hash
  2. The target IsSamePersonEntry contains the agent's AgentPubKey as one of the two signing parties
  3. The attestation has not been revoked

The capability slot (Tier 1) makes the identity discoverable; the governance rule (Tier 2) makes it mandatory for specific actions.

graph TD
    Agent["Agent on NDO DHT"]
    Vault["Flowsta Vault\n(local Holochain conductor + lair)"]
    PersonHash["Person Entry Hash\n(agent identity anchor)"]
    FlowstaSlot["FlowstaIdentity\nCapabilitySlot link"]
    ISP["IsSamePersonEntry\n(dual-signed 78-byte attestation)\non NDO DHT"]
    DID["W3C DID\ndid:flowsta:uhCAk..."]
    OtherApp["Other Flowsta-Linked\nHolochain App"]
    PPR["PrivateParticipationClaim"]
    RepSummary["ReputationSummary\n(cross-app attributable)"]
    GovRule["GovernanceRule\n(IdentityVerification type)"]
    RolePromotion["Role Promotion\n(PrimaryAccountableAgent)"]

    Agent -->|"has"| PersonHash
    Agent -->|"runs"| Vault
    PersonHash -->|"CapabilitySlot link\n(Tier 1: permissionless)"| FlowstaSlot
    FlowstaSlot -->|"points to"| ISP
    ISP -->|"dual-signed by"| Vault
    ISP -->|"carries"| DID
    DID -.->|"verifiable by"| OtherApp
    PPR -->|"attributed to"| DID
    PPR -->|"aggregated into"| RepSummary
    RepSummary -.->|"portable via DID"| OtherApp
    GovRule -->|"Tier 2: requires\nFlowstaIdentity slot"| RolePromotion
    RolePromotion -->|"checks"| FlowstaSlot

PPR Cross-App Attribution

When an agent has linked a Tier 1 FlowstaIdentity slot to a valid, non-revoked IsSamePersonEntry, their PPR ReputationSummary becomes attributable to a cross-app DID. (This is cryptographic attestation via Vault dual-signing — not the same as Tier 2 governance enforcement in Phase 3.) This creates the foundation for portable reputation without requiring full Verifiable Credential infrastructure:

  • Other Flowsta-integrated apps can query whether an agent has a linked NDO identity by checking their own DHT for an IsSamePersonEntry containing the same Flowsta Vault key
  • The DID serves as the stable key for reputation aggregation across apps — a single DID may accumulate PPR histories from multiple independent Holochain networks
  • Agents control disclosure: the FlowstaIdentity slot is voluntary (Tier 1), and PPR summaries are already selectively shared via existing capability grants
  • This is the practical path toward REQ-NDO-AGENT-08 (Portable Credentials): the DID provides the identity anchor; the PPR provides the participation record; selective disclosure provides the privacy control

The cross-app attribution chain is:

Person entry (NDO DHT)
  └─ FlowstaIdentity CapabilitySlot → IsSamePersonEntry
       └─ carries DID: did:flowsta:uhCAk...
            └─ same DID resolvable on other Flowsta-linked apps
                 └─ PPR ReputationSummary attributable to DID across apps

Recovery and Backup via Vault

Flowsta Vault provides recovery infrastructure that the NDO currently lacks:

  • BIP39 recovery phrases: Deterministic Ed25519 keypair regeneration from a 24-word mnemonic. If an agent loses their device, they can regenerate the same key pair on a new device using their recovery phrase.
  • Auto-backups: Encrypted snapshots every 60 minutes (up to 10 timestamped snapshots per app), working while the Vault is locked (after first unlock in a session). Oldest snapshots are auto-rotated.
  • Full data export: Decrypted private entries and cryptographic keys can be exported, compliant with the Cryptographic Autonomy License (CAL).

This aligns with the NDO's design principle that identity must persist through all transformations. The non-deletable, append-only nature of Person entries and PPRs assumes the agent retains access to their signing key — a guarantee the current NDO architecture cannot make. Vault's deterministic key regeneration ensures that the permanent records the NDO creates remain accessible to their authors across device loss and hardware failure.

CAL alignment: The Cryptographic Autonomy License requires that users can always get a copy of their own data plus the cryptographic keys needed for independence from any particular service provider. Vault's full data export — including decrypted private entries and cryptographic keys — satisfies this requirement directly, and positions NDO communities for CAL-compliant distribution.

Flowsta and Unyt: Complementary Capabilities

Flowsta and Unyt are the two external capability integrations defined for the NDO. They are complementary and independent:

  • Flowsta answers who is who — cross-app identity, DID, recovery, authentication
  • Unyt answers who owes what to whom — credits, debits, settlement, economic closure

An NDO community may adopt one, both, or neither. When both are active, they reinforce each other: an agent's Flowsta DID provides the stable identity across Unyt Alliances, and their Unyt credit limit (derived from PPR reputation) is attributable to that DID (via Tier 1 link / IsSamePersonEntry, and optionally Tier 2–gated processes). The agent is simultaneously identifiable, accountable, and economically active — without any platform intermediary.

Integration Path

The Flowsta integration is structured as three independent phases, each delivering immediate value and requiring no rollback of prior work.

Phase 1 — Capability Surface Extension (no core zome structural changes required)

Add FlowstaIdentity to the SlotType enum. Add flowsta-agent-linking-integrity and flowsta-agent-linking-coordinator zomes to the DNA manifest (dna.yaml). Install @flowsta/holochain SDK in the frontend. Any agent can now link their Flowsta identity to their Person entry via a FlowstaIdentity capability slot. This phase delivers: cross-app identity expression in the network (trust signals without enforcement), DID attachment to agent profiles, and the foundation for Vault-backed key recovery.

Phase 2 — Frontend and UX Integration (UI changes only)

Add a "Link Flowsta Identity" flow in the person/profile management UI. Display linked Flowsta DIDs on agent profiles. Show Flowsta verification badges on agents in search results and governance views. Integrate Vault backup API for agent data resilience (@flowsta/holochain backup functions: startAutoBackup, backupToVault, retrieveFromVault, listVaultBackups). This phase delivers: user-facing identity management, visible trust indicators, and data resilience.

Phase 3 — Governance-Enforced Identity Verification (zome_gouvernance changes)

Add IdentityVerification variant to GovernanceRuleType (or use existing rule mechanisms). Governance rules can now require a FlowstaIdentity slot as a precondition for role promotions (e.g., PrimaryAccountableAgent) or for high-value custody transfers. The governance zome validates the IsSamePersonEntry signature chain — checking that the FlowstaIdentity slot exists, that the target IsSamePersonEntry contains the agent's AgentPubKey, and that the attestation has not been revoked — before approving the conditioned transition. This phase delivers: governance-enforced identity verification, sybil resistance for high-trust roles, and the bridge between permissionless participation and accountable governance.


7. Design Patterns

The NDO embodies six named design patterns. These patterns are architectural idioms that recur throughout the system and should guide implementation decisions.

Pattern 1: Identity Anchor

Intent: Give every resource a stable, cryptographically-secure identity anchor that persists through all transformations, including end of life.

Structure: The NondominiumIdentity genesis entry. Its action hash is the stable namespace for all other entries and links. Nothing else in the system references a resource by any other handle.

Rationale: In complex adaptive systems, identity must be decoupled from form. A person's identity persists even as their body, beliefs, and relationships change. A corporation's identity persists through restructuring. The NDO's identity must persist through design changes, custody transfers, version forks, and end of life. Content-addressing in Holochain makes this natural: the action hash of the genesis entry never changes.

Holochain idiom:

#![allow(unused)]
fn main() {
// Layer 0 creation — returns the stable identity hash
let ndo_hash = create_entry(&EntryTypes::NondominiumIdentity(identity))?;
// Everything else links to ndo_hash
}

Pattern 2: Complexity-Matched Layer Activation

Intent: Activate only the structural complexity that the current coordination environment demands. Do not pay coordination costs in advance of need.

Structure: Layer activation via link creation. Layer 1 activates when NDOToSpecification link is created. Layer 2 activates when NDOToProcess link is created. Both can be created retroactively, at any lifecycle stage.

Rationale: Benkler's information opportunity cost analysis: overhead that exceeds the value of the coordination it enables is pure waste. A tool being lent between friends does not need a full ValueFlows process. A community hardware standard being developed across fifty fabrication networks does. The NDO model allows the system's complexity to grow with the resource's social complexity, not ahead of it.

Holochain idiom:

#![allow(unused)]
fn main() {
// Activate Layer 1 — link identity to specification
create_link(ndo_hash, spec_hash, LinkTypes::NDOToSpecification, ())?;

// Activate Layer 2 — link identity to process
create_link(ndo_hash, process_hash, LinkTypes::NDOToProcess, ())?;
}

Pattern 3: Holonic Composition

Intent: Allow NDOs to contain other NDOs, creating fractal hierarchies where every level of organization has the same structural potential.

Structure: NDOToComponent links from a parent NDO's identity hash to child NDO identity hashes. A Project NDO links to Resource NDOs. A Resource NDO links to Design NDOs. A Design NDO links to Component NDOs.

Rationale: Morin's holographic principle and the fractal composable resource architecture (documented in digital-resource-integrity.md). In complex systems, the same structure appears at every scale. The NDO's three-layer potential is the same whether the resource is an atomic component or a multi-organization project.

Holochain idiom:

#![allow(unused)]
fn main() {
// Link parent NDO to child NDO
create_link(
    parent_ndo_hash,
    child_ndo_hash,
    LinkTypes::NDOToComponent,
    LinkTag::new(component_role.as_str()), // e.g., "required", "optional", "alternative"
)?;
}

Pattern 4: Progressive Disclosure

Intent: Present resources at the appropriate level of complexity for the current context, without exposing structural complexity that is not yet active.

Structure: Three starting archetypes that correspond to common initialization states, presented as UI choices that set the initial lifecycle stage. These are starting configurations, not permanent classifications.

ArchetypeLayers activeLifecycle stageUse when
StubL0 onlyIdeationRegistering an intention
Open DesignL0 + L1SpecificationSharing a design
Active ProjectL0 + L1 + L2DevelopmentStarting work with collaborators

Rationale: Kauffman's adjacent possible — present only what is currently achievable. An agent creating their first NDO should not be confronted with the full complexity of the three-layer model. The system should reveal its depth progressively as the resource's context demands it.


Pattern 5: Tombstone

Intent: Preserve permanent identity records for all resources that have ever existed, including those that have reached end of life, been deprecated, or been abandoned.

Structure: At end of life, only Layer 0 remains active. Layers 1 and 2 are archived (spec is_active: false, process concluded with terminal EconomicEvent). The identity entry is never deleted.

Rationale: The DHT is append-only — this is not a limitation, it is a feature. The permanent memory of what resources existed, who created them, and what happened to them is institutional knowledge. Tombstones enable:

  • OVN-compliant contribution tracking even after a project ends
  • Versioning lineage that traces forks back to their origins
  • Historical record for the network

Holochain idiom:

#![allow(unused)]
fn main() {
// End-of-life transition — archive layers
update_entry(spec_hash, &ResourceSpecification { is_active: false, ..spec })?;
// Create terminal EconomicEvent for Layer 2
create_entry(&EntryTypes::EconomicEvent(EconomicEvent {
    action: VfAction::Consume,
    lifecycle_transition: Some(LifecycleStage::EndOfLife),
    ..
}))?;
// Layer 0 NondominiumIdentity is NOT deleted — it becomes the tombstone
}

Pattern 6: Stigmergic Capability Attachment

Intent: Allow any agent or external hApp to attach capabilities to an NDO without modifying the NDO entry, without requiring permission from the NDO's custodian, and without needing to have been anticipated by the NDO's designer.

Structure: CapabilitySlot links from the Layer 0 identity hash to capability targets. Link tags carry the slot type, author, and attachment timestamp. Governance layer filters trusted vs untrusted links.

Rationale: Morin's ecology of action: no action guarantees its outcome. The capabilities that will be most useful to attach to a resource cannot be known at creation time. The attachment surface must be open. Centralized gatekeeping of capabilities (requiring permission from the NDO custodian before attaching) would impose coordination costs that violate Benkler's information opportunity cost principle.

Holochain idiom:

#![allow(unused)]
fn main() {
let slot_tag = CapabilitySlotTag {
    slot_type: SlotType::IssueTracker,
    attached_at: sys_time()?,
};
create_link(
    ndo_identity_hash,
    issue_tracker_cell_hash,
    LinkTypes::CapabilitySlot,
    LinkTag::new(serde_json::to_vec(&slot_tag)?),
)?;
}

8. DHT Data Structures

8.1 NondominiumIdentity Entry (Layer 0)

#![allow(unused)]
fn main() {
#[hdk_entry_helper]
#[derive(Clone, PartialEq)]
pub struct NondominiumIdentity {
    // Core identity fields
    pub name: String,
    pub description: Option<String>,
    pub initiator: AgentPubKey, // TODO (G1, REQ-AGENT-02): replace with AgentContext post-MVP
                                // to support Collective, Project, Network, and Bot agents as
                                // initiators. Currently assumes individual agent. Aligns with
                                // the same change needed for EconomicResource.custodian.

    // Classification
    pub property_regime: PropertyRegime,
    pub resource_nature: ResourceNature,

    // Initial lifecycle state
    pub lifecycle_stage: LifecycleStage,

    // Timestamp
    pub created_at: Timestamp,
}
}

8.2 Supporting Enums

#![allow(unused)]
fn main() {
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum PropertyRegime {
    Private,        // Full rights bundle; individual ownership
    Commons,        // Non-rivalrous shared resource; governance via licensing/attribution
    Collective,     // Cooperative/collective ownership
    Pool,           // Pool of shareables: rivalrous shared resources; custody/scheduling/maintenance
    CommonPool,     // Rivalrous consumable resource; governance via quota/depletion rules
    Nondominium,    // Uncapturable by design; contribution-based access; no alienation permitted
}
// Canonical definition: documentation/archives/resources.md Section 6.3

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum ResourceNature {
    Digital,   // Software, data, design files, documents
    Physical,  // Material objects, equipment, spaces
    Hybrid,    // Digital twin of a physical resource, or physical+digital bundle
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize, Default)]
pub enum LifecycleStage {
    // Emergence
    #[default]
    Ideation,
    Specification,
    Development,
    Prototype,

    // Maturity
    Stable,
    Distributed,

    // Operation
    Active,

    // Suspension
    Hibernating,

    // Terminal
    Deprecated,
    EndOfLife,
}
}
#![allow(unused)]
fn main() {
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct CapabilitySlotTag {
    pub slot_type: SlotType,
    pub attached_at: Timestamp,
    pub label: Option<String>, // Human-readable label for this specific slot
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum SlotType {
    Documentation,
    IssueTracker,
    FabricationQueue,
    GovernanceDAO,
    VersionGraph,
    DigitalAsset,
    WeaveWAL,
    FlowstaIdentity,       // Flowsta agent-linking attestation (IsSamePersonEntry action hash)
    UnytAgreement(String), // Unyt Alliance network seed identifier (empty string = sandbox default)
    CustomApp(String),     // Extensible: custom slot type identified by string
}
}
#![allow(unused)]
fn main() {
// In zome_resource integrity LinkTypes enum — new variants to add:
pub enum LinkTypes {
    // ... existing link types ...

    // --- NDO Three-Layer Links ---
    NDOToSpecification,     // NondominiumIdentity → ResourceSpecification (Layer 1 activation)
    NDOToProcess,           // NondominiumIdentity → Process (Layer 2 activation)
    NDOToComponent,         // NondominiumIdentity → NondominiumIdentity (holonic composition)

    // --- Capability Surface ---
    CapabilitySlot,         // NondominiumIdentity → capability target (typed by tag)

    // --- Discovery ---
    AllNDOs,                // Anchor → NondominiumIdentity (global discovery)
    NDOsByLifecycleStage,   // LifecyclePath → NondominiumIdentity
    NDOsByNature,           // NaturePath → NondominiumIdentity
    NDOsByRegime,           // RegimePath → NondominiumIdentity

    // --- Lifecycle History ---
    NDOLifecycleHistory,    // NondominiumIdentity → LifecycleEvent (audit trail)
}
}

8.5 NondominiumIdentity Updates

Layer 0 entries may be updated only to change lifecycle_stage. All other fields are immutable after creation. This preserves the identity anchor property: the content of the NDO changes as little as possible, while the DHT link graph around it grows freely.

#![allow(unused)]
fn main() {
// Only lifecycle_stage updates are permitted
pub struct UpdateNDOLifecycleInput {
    pub original_action_hash: ActionHash,
    pub previous_action_hash: ActionHash,
    pub new_stage: LifecycleStage,
    pub transition_event_hash: ActionHash, // Must reference a valid EconomicEvent
}
}

8.6 Holonic Composition Diagram

graph TB
    ProjectNDO["Project NDO\n(Layer 0: identity)\n(Layer 1: project spec)\n(Layer 2: process)"]
    ResourceNDO["Resource NDO\n(Layer 0: identity)\n(Layer 1: design spec)\n(Layer 2: use process)"]
    ComponentNDO["Component NDO\n(Layer 0: identity)\n(Layer 1: component spec)\n(Layer 2: none yet)"]
    AssetNDO["Asset NDO (digital)\n(Layer 0: identity)\n(Layer 1: manifest)\n(Layer 2: none)"]

    ProjectNDO -->|"NDOToComponent\n(required)"| ResourceNDO
    ResourceNDO -->|"NDOToComponent\n(required)"| ComponentNDO
    ResourceNDO -->|"NDOToComponent\n(optional)"| AssetNDO
    ComponentNDO -->|"CapabilitySlot\n(DigitalAsset)"| AssetNDO

8.7 Agent Context Entry (Post-MVP)

TODO (G1 — AgentEntityType): The NDO three-layer model currently focuses on resource representation. For the generic NDO to support commons-based peer production as practised in OVNs (where ventures, networks, and partner organisations are also economic agents), the agent layer needs an equivalent minimal identity structure. The following is a forward-design proposal, not yet implemented. See documentation/archives/agent.md §6.1 and REQ-AGENT-01.

#![allow(unused)]
fn main() {
// Post-MVP: AgentContext entry type (companion to Person, or standalone for non-human agents)
#[hdk_entry_helper]
pub struct AgentContext {
    pub agent_type: AgentEntityType,
    pub person_hash: Option<ActionHash>,  // None for bots and external organisations
    pub created_at: Timestamp,
    pub network_seed: String,             // Which NDO network this context belongs to
}

pub enum AgentEntityType {
    Individual,                           // Human participant with a Person entry
    Collective(String),                   // Working group / committee (name/description)
    Project(ActionHash),                  // Project NDO this agent entity represents
    Network(ActionHash),                  // Network NDO this agent entity represents
    Bot {                                 // AI agent or IoT device
        capabilities: Vec<String>,
        operator: AgentPubKey,            // Responsible human operator
    },
    ExternalOrganisation(String),         // Traditional org (for partner modelling)
}
}

Design principles:

  • Individual agents have AgentEntityType::Individual with a linked Person entry
  • Collective, Project, and Network agents are composed agents (group agents). Project(ActionHash) and Network(ActionHash) carry an ActionHash pointing to the NondominiumIdentity that is the collective's resource face — its digital twin as a Nondominium Object. The AgentContext itself is the agent face through which the collective participates in economic events. These are ontologically distinct: the NondominiumIdentity is a Resource; the AgentContext is an Agent. Neither replaces the other. A Collective(String) agent may not yet have an associated NDO; its agent face exists independently of any resource face.
  • Bot agents have no Person but have declared capabilities and a responsible human operator; their actions are attributed to the operator for PPR purposes
  • ExternalOrganisation agents model traditional partners/suppliers without requiring them to run a Holochain node

Derived affiliation state (computed from existing DHT data, not stored):

affiliation_state(agent) = f(
    person_exists(agent),               // Boolean
    affiliation_record_exists(agent),   // Has agent signed ToP?
    contributions_count(agent),         // From economic events
    last_contribution_timestamp(agent), // Recency
    reputation_summary.total_claims,    // From PPRs
    governance_claims_count(agent)      // From PPRs
)

→ UnaffiliatedStranger | CloseAffiliate | ActiveAffiliate | CoreAffiliate | InactiveAffiliate

9. Requirements

9.1 Layer 0 — Identity Requirements

  • REQ-NDO-L0-01: The system shall support the creation of a NondominiumIdentity entry as the minimal representation of any Nondominium Object, requiring only name, initiator, property_regime, resource_nature, lifecycle_stage, created_at, and an optional description.
  • REQ-NDO-L0-02: The action hash of the NondominiumIdentity genesis entry shall be the stable, permanent identity of the NDO for its entire existence and shall never be voided or replaced.
  • REQ-NDO-L0-03: A NondominiumIdentity entry shall never be deletable by any agent or governance action. Its permanent presence in the DHT is a design guarantee, not a policy choice.
  • REQ-NDO-L0-04: Only the lifecycle_stage field of a NondominiumIdentity entry may be updated after creation. All other fields are immutable.
  • REQ-NDO-L0-05: Every update to lifecycle_stage shall reference a valid EconomicEvent action hash as the triggering transition event.
  • REQ-NDO-L0-06: At end of life (LifecycleStage::EndOfLife), the NondominiumIdentity entry shall remain fully readable and discoverable, serving as a tombstone.
  • REQ-NDO-L0-07: The system shall support discovery of NDOs by lifecycle_stage, resource_nature, and property_regime via DHT path-based anchors.

9.2 Layer 1 — Specification Requirements

  • REQ-NDO-L1-01: Layer 1 shall be activated by creating an NDOToSpecification link from the NDO identity hash to a ResourceSpecification entry. No modification of the NondominiumIdentity entry is required for activation.
  • REQ-NDO-L1-02: Layer 1 may be activated at any lifecycle stage at or after Ideation. Retroactive activation (for NDOs that began at Ideation without a spec) shall be fully supported.
  • REQ-NDO-L1-03: Multiple ResourceSpecification entries may be linked to one NDO identity, representing version evolution. The most recent link shall be considered the canonical Layer 1 specification.
  • REQ-NDO-L1-04: When Layer 1 enters dormant state (hibernation or end of life), the specification shall be marked is_active: false. The NDOToSpecification link shall remain readable.
  • REQ-NDO-L1-05: GovernanceRule entries shall continue to be linked to ResourceSpecification entries as currently implemented. They are considered Layer 1 assets.
  • REQ-NDO-L1-06: Digital asset references (files, 3D models, code, integrity manifests) shall be attached to the NDO via CapabilitySlot links of type DigitalAsset, not embedded in the ResourceSpecification entry.

9.3 Layer 2 — Process Requirements

  • REQ-NDO-L2-01: Layer 2 shall be activated by creating an NDOToProcess link from the NDO identity hash to a ValueFlows Process entry.
  • REQ-NDO-L2-02: Layer 2 may be activated at any lifecycle stage at or after Specification.
  • REQ-NDO-L2-03: All EconomicEvent, Commitment, Claim, and PrivateParticipationClaim entries associated with an NDO shall be linked through the active Layer 2 process.
  • REQ-NDO-L2-04: When a process concludes (all commitments fulfilled or cancelled), a terminal EconomicEvent with VfAction::Consume shall be recorded, formally concluding Layer 2.
  • REQ-NDO-L2-05: A new Layer 2 process may be activated for the same NDO after a previous process has concluded (e.g., a second development cycle after hibernation).
  • REQ-NDO-L2-06: EconomicResource entries (physical instances of the resource) shall be linked to the NDO via the Layer 2 process, not directly to the Layer 0 identity.

9.4 Lifecycle and Operational State Requirements

LifecycleStage Requirements

  • REQ-NDO-LC-01: The system shall implement the LifecycleStage enum as defined in Section 5.1 on the NondominiumIdentity entry, replacing the lifecycle dimension of the current ResourceState enum. The migration mapping in Section 10 shall be used for backward compatibility.
  • REQ-NDO-LC-02: Lifecycle stage transitions shall be validated by the governance zome acting as state transition operator, consistent with REQ-ARCH-07 (governance-as-operator).
  • REQ-NDO-LC-03: Each lifecycle transition shall generate a corresponding EconomicEvent with the triggering VfAction, creating an auditable lifecycle history.
  • REQ-NDO-LC-04: The Hibernating stage shall be clearly distinguished from Deprecated and EndOfLife. A hibernating resource may be reactivated; deprecated and end-of-life resources may not be reactivated.
  • REQ-NDO-LC-05: Transition to EndOfLife shall respect the challenge period defined in REQ-GOV-13.
  • REQ-NDO-LC-06: The Deprecated stage shall require a link to a successor NDO identity hash. Deprecation without a declared successor is not permitted.
  • REQ-NDO-LC-07: The governance zome shall enforce the authorized role for each lifecycle transition as defined in Section 5.3.

OperationalState Requirements

  • REQ-NDO-OS-01: The system shall implement the OperationalState enum as defined in Section 5.4 on the EconomicResource entry, replacing the process-related dimension of the current ResourceState enum.
  • REQ-NDO-OS-02: OperationalState transitions shall be managed exclusively by the governance zome. The resource zome stores the field; only the governance zome may initiate valid transitions.
  • REQ-NDO-OS-03: Each OperationalState transition shall correspond to an open or completed EconomicEvent. The governance zome shall reject state transitions for which no corresponding event exists.
  • REQ-NDO-OS-04: OperationalState and LifecycleStage are orthogonal. An OperationalState transition shall never cause a LifecycleStage transition, and vice versa.
  • REQ-NDO-OS-05: The InTransit, InStorage, and InMaintenance states may occur at any LifecycleStage at or after Development. The system shall not restrict these states to any specific lifecycle stage.
  • REQ-NDO-OS-06: The ResourcesByState link type shall be split into ResourcesByLifecycleStage and ResourcesByOperationalState to enable independent faceted queries on each dimension.

TODO (code): Split the current ResourceState enum in zome_resource integrity into LifecycleStage (on NondominiumIdentity) and OperationalState (on EconomicResource). Update EconomicResource struct, governance zome state transition logic, ResourcesByState link type, and all coordinator functions. See Section 10.3 for the migration map.

9.5 Capability Surface Requirements

  • REQ-NDO-CS-01: The system shall support CapabilitySlot links from any NDO identity hash to any DHT hash or external reference, using the CapabilitySlotTag structure defined in Section 8.3.
  • REQ-NDO-CS-02: Any Accountable Agent shall be able to create a CapabilitySlot link to any NDO, without requiring permission from the NDO's custodian. Permissionless attachment at the DHT level is a design guarantee.
  • REQ-NDO-CS-03: The governance zome shall support validation of CapabilitySlot links, allowing custodians and Accountable Agents to mark specific slots as trusted or untrusted.
  • REQ-NDO-CS-04: The system shall support all SlotType variants defined in Section 8.3, including CustomApp(String) for extensibility.
  • REQ-NDO-CS-05: The WeaveWAL slot type shall be supported as the integration point for MOSS/Weave tools, enabling NDOs to appear as Weave Assets.
  • REQ-NDO-CS-06: The capability surface shall remain open across all lifecycle stages, including Hibernating and EndOfLife. Historical attachments on archived NDOs shall remain readable.
  • REQ-NDO-CS-07: The system shall support a UnytAgreement(String) slot type in the SlotType enum, where the String carries the Unyt Alliance network seed. The target of a UnytAgreement capability slot link shall be a Unyt Smart Agreement entry hash (cross-cell reference).
  • REQ-NDO-CS-08: Any Accountable Agent shall be able to create a UnytAgreement capability slot on any NDO (Tier 1: permissionless proposal). The governance zome shall not require validation of Tier 1 UnytAgreement slots beyond the standard capability surface governance defined in REQ-NDO-CS-03.
  • REQ-NDO-CS-09: The GovernanceRuleType enum in zome_resource integrity shall support an EconomicAgreement variant. A GovernanceRule entry of this type shall carry EconomicAgreementRuleData as its rule_data, including: unyt_alliance_id, smart_agreement_hash, trigger_actions (list of VfAction values), settlement_window_secs, and an optional note.
  • REQ-NDO-CS-10: When the governance zome processes a state transition whose VfAction matches a trigger_actions entry in an endorsed EconomicAgreement governance rule, the transition request shall be required to include a rave_hash. The governance zome shall validate the RAVE against the Unyt DHT (via cross-DNA call) before approving the transition.
  • REQ-NDO-CS-11: When a state transition is approved in the presence of a valid EconomicAgreement rule, the PrivateParticipationClaim generated for all participating agents shall include the settlement_rave_hash field referencing the validated Unyt RAVE. This field shall be None for all transitions where no economic agreement was triggered.
  • REQ-NDO-CS-12: The system shall support a FlowstaIdentity slot type in the SlotType enum. The target of a FlowstaIdentity capability slot link shall be an IsSamePersonEntry action hash committed by the flowsta-agent-linking coordinator zome.
  • REQ-NDO-CS-13: Any agent shall be able to create a FlowstaIdentity capability slot on their own Person entry hash (Tier 1: permissionless attestation). The governance zome shall not require validation of Tier 1 FlowstaIdentity slots beyond the standard capability surface governance defined in REQ-NDO-CS-03.
  • REQ-NDO-CS-14: The governance zome shall support an IdentityVerification governance rule type (or equivalent mechanism) that conditions role promotions or high-value state transitions on the presence of a verified FlowstaIdentity capability slot on the requesting agent's Person entry hash (Tier 2: governance requirement).
  • REQ-NDO-CS-15: When verifying a FlowstaIdentity slot for Tier 2 governance enforcement, the governance zome shall validate that: (a) a FlowstaIdentity CapabilitySlot link exists from the agent's Person hash; (b) the target IsSamePersonEntry contains the agent's AgentPubKey as one of the two signing parties; (c) the attestation has not been revoked via the revoke_link function of the flowsta-agent-linking coordinator.

9.6 Migration Requirements

  • REQ-NDO-MIG-01: All new resources created after the introduction of the NDO model shall begin with a NondominiumIdentity creation as their first action.
  • REQ-NDO-MIG-02: Existing ResourceSpecification entries created before the NDO model shall be retroactively anchored to a new NondominiumIdentity entry. This operation shall be additive (no existing entries are modified or deleted).
  • REQ-NDO-MIG-03: The ResourceState enum shall be deprecated and replaced by LifecycleStage. Existing records using ResourceState values shall be mapped using the migration table in Section 10.2 without data loss.
  • REQ-NDO-MIG-04: Existing EconomicResource entries shall not require migration. They shall be linked to the new NDO model via Layer 2 process links when the NDO is retroactively created.
  • REQ-NDO-MIG-05: The migration shall be implemented as a one-time migration coordinator function, not as a permanent API change, to avoid polluting the steady-state code with migration logic.

9.7 Agent Architecture Requirements (Post-MVP)

Status: Post-MVP. Gaps identified against the OVN wiki ontology (15 years of commons-based peer production practice). See documentation/archives/agent.md for the full analysis. The current MVP implements individual agents only. Requirements below are design targets for the generic NDO.

  • REQ-NDO-AGENT-01: Agent Type Taxonomy: The system shall support an AgentEntityType discriminant on every agent context, distinguishing at minimum: Individual, Collective, Project, Network, Bot, and ExternalOrganisation (see Section 8.7 for the proposed data structure). The MVP's implicit individual-only model is insufficient for commons-based peer production where ventures and networks are first-class economic actors.
  • REQ-NDO-AGENT-02: Collective Agents — Dual-Face Model: Groups, working groups, projects, and network-level entities are composed agents. Each has an agent face (AgentContext with the relevant AgentEntityType variant) through which it participates in economic events, and may optionally have a resource face (NondominiumIdentity) as its digital twin. The ActionHash in Project(ActionHash) and Network(ActionHash) links the agent face to the resource face. These two faces are ontologically distinct — the NondominiumIdentity is a Resource; the AgentContext is an Agent — and neither replaces the other. Collective agents may act through multi-signature patterns (N-of-M member authorisation) when performing economic events.
  • REQ-NDO-AGENT-03: Affiliation Spectrum: The system shall derive the OVN affiliation state (UnaffiliatedStranger, CloseAffiliate, ActiveAffiliate, CoreAffiliate, InactiveAffiliate) algorithmically from existing DHT data — PPR contribution history, recency, and AffiliationRecord existence. Affiliation state shall not be stored as a separate entry (which would require maintenance and risk inconsistency). The derivation function is defined in Section 8.7.
  • REQ-NDO-AGENT-04: AffiliationRecord: The system shall support an AffiliationRecord entry for formal network onboarding: the agent cryptographically signs acknowledgement of the network's Terms of Participation, Nondominium & Custodian agreement, and Benefit Redistribution Algorithm. The AffiliationRecord is the machine-readable prerequisite for ActiveAffiliate status.
  • REQ-NDO-AGENT-05: Composable AgentProfile View: The system shall expose a composable AgentProfile query assembling identity, capability, reputation, participation, social, and temporal data into a single queryable output. This view shall be computed from existing DHT data — it is not a new stored entry type. Agents control which sections are exposed by granting access to constituent entries.
  • REQ-NDO-AGENT-06: Social Graph: The system shall model peer relationships via an AgentRelationship bidirectional link type (typed: colleague, collaborator, trusted, voucher), stored as private links. Social relations are part of agent wealth in the OVN model and must be accessible to governance without being publicly discoverable.
  • REQ-NDO-AGENT-07: CapabilitySlot on Agent Identity: The Person entry hash shall serve as a stigmergic attachment surface for external credential wallets, DID documents, and reputation oracles, using the same CapabilitySlot link pattern defined in Section 6 for NDO resources. See Section 6.5 for the forward design. Flowsta's FlowstaIdentity capability slot (Section 6.7) provides the first concrete implementation: a DID-backed, dual-signed attestation attachable to the Person hash without schema modification.
  • REQ-NDO-AGENT-08: Portable Credentials: The system shall support a PortableCredential structure — bilaterally signed by an issuer (PrimaryAccountableAgent) and the credential owner — verifiable by other Holochain networks. Types: RoleCredential, ReputationCredential, CompetencyCredential, AffiliationCredential. This is the technical mechanism for cross-network identity portability required by the OVN model. Flowsta's W3C DID (did:flowsta:uhCAk...) provides the cross-network identity anchor required for credential portability. When combined with the FlowstaIdentity capability slot, portable credentials become attributable to a verified cross-app identity.

10. Migration from Current Architecture

10.1 Current Architecture Overview

The current Nondominium zome architecture has three resource-related entry types:

ResourceSpecification  (zome_resource)
  ↓ SpecificationToResource
EconomicResource       (zome_resource)
  - custodian: AgentPubKey
  - state: ResourceState  { PendingValidation, Active, Maintenance, Retired, Reserved }
    ↑ TODO: split into LifecycleStage (on NondominiumIdentity) + OperationalState (on EconomicResource)

GovernanceRule         (zome_resource)
  (linked from ResourceSpecification via SpecificationToGovernanceRule)

EconomicEvent          (zome_gouvernance)
  - provider: AgentPubKey
  - receiver: AgentPubKey
  - resource_inventoried_as: ActionHash → EconomicResource

10.2 Migration Mapping

graph LR
    subgraph current ["Current Architecture"]
        RS[ResourceSpecification]
        ER[EconomicResource]
        GR[GovernanceRule]
        RS -->|SpecificationToResource| ER
        RS -->|SpecificationToGovernanceRule| GR
    end

    subgraph ndoModel ["NDO Three-Layer Model"]
        L0[NondominiumIdentity\nLayer 0]
        L1[ResourceSpecification\nLayer 1]
        L2[Process\nLayer 2]
        L2E[EconomicResource\nInstance]
        GR2[GovernanceRule\nLayer 1 asset]
        L0 -->|NDOToSpecification| L1
        L0 -->|NDOToProcess| L2
        L2 -->|ProcessToResource| L2E
        L1 -->|SpecToGovernanceRule| GR2
    end

    RS -->|"maps to"| L1
    ER -->|"maps to"| L2E
    GR -->|"maps to"| GR2

Detailed mapping table:

Current constructNDO modelChange typeNotes
ResourceSpecificationLayer 1 (ResourceSpecification)No structural changeGains NDOToSpecification link from Layer 0
EconomicResourceLayer 2 artifact (resource instance)No structural changeLinked via Process, not directly to NDO
ResourceState enumLifecycleStage + OperationalState enumsSplit replacementSee migration map below — each variant maps to one of the two new enums
GovernanceRuleLayer 1 assetNo structural changeStill linked from ResourceSpecification
EconomicEventLayer 2 componentNo structural changeNow linked through Process entry
Commitment / ClaimLayer 2 componentsNo structural changeNow linked through Process entry
(none)NondominiumIdentityNewRoot Layer 0 entry for all resources
(none)NDOToSpecification linkNewLayer 1 activation link
(none)NDOToProcess linkNewLayer 2 activation link
(none)NDOToComponent linkNewHolonic composition
(none)CapabilitySlot linkNewStigmergic capability attachment
(none)LifecycleStage transitionsNewGoverned by zome_gouvernance (maturity dimension)
(none)OperationalState transitionsNewGoverned by zome_gouvernance (process dimension)

10.3 ResourceState Migration Map

The current ResourceState enum is split across the two new orthogonal dimensions. Each existing variant maps to a (LifecycleStage, OperationalState) pair:

Current ResourceStateLifecycleStageOperationalStateMigration notes
PendingValidationPrototypePendingValidationResource not yet peer-validated; both dimensions set simultaneously
ActiveActiveAvailableThe common case; lifecycle is Active, no process currently running
Maintenance(unchanged — keep existing stage)InMaintenanceMaintenance is a process, not a lifecycle milestone; LifecycleStage is preserved
RetiredDeprecated or EndOfLifeAvailableDetermine lifecycle by whether a successor NDO exists; operational state is Available (no active process)
Reserved(unchanged — keep existing stage)ReservedPre-allocation is an operational condition; LifecycleStage is preserved

The pre-operational stages (Ideation, Specification, Development) have no equivalent in the current model and will apply only to newly created NDOs.

10.4 Migration Strategy

The migration is strictly additive — no existing entries are modified or deleted. The append-only nature of the DHT is respected throughout.

Phase 1 — Forward compatibility (immediate):

  • All new resources created after the NDO model lands must begin with NondominiumIdentity creation
  • New NDOToSpecification and NDOToProcess link types are added to the integrity zome
  • LifecycleStage (on NondominiumIdentity) and OperationalState (on EconomicResource) replace ResourceState for new resources
  • ResourcesByState link type is split into ResourcesByLifecycleStage and ResourcesByOperationalState

Phase 2 — Retroactive anchoring (migration coordinator):

  • For each existing ResourceSpecification entry, create a NondominiumIdentity entry and the corresponding NDOToSpecification link
  • The NondominiumIdentity is created by the original author of the ResourceSpecification (or by a designated migration agent)
  • Map the existing ResourceState to (LifecycleStage, OperationalState) pairs using the migration table in Section 10.3
  • Link existing EconomicResource instances to the new NDO via a retroactive Process entry

Phase 3 — Cleanup (optional, post-migration):

  • Deprecate the ResourceState enum in code (keep for deserialization compatibility of existing DHT entries)
  • Update the UI to show LifecycleStage and OperationalState vocabulary separately
  • Activate capability slots for resources that have associated external assets

What is not required:

  • No deletion of any existing entries
  • No update to any existing ResourceSpecification or EconomicResource entries
  • No data migration (existing data remains valid in both old and new reading code)

11. Relationship to Other Post-MVP Work

11.1 Many-to-Many Flows

many-to-many-flows.md defines shared custody and multi-party resource transfers. In the NDO model:

  • Shared custody (co-custodians) is expressed at Layer 0: the NondominiumIdentity carries a reference to shared custodianship state, or the governance zome maintains co-custodian records linked from the identity hash
  • Multi-party transfer events (REQ-MMF-06 through REQ-MMF-14) are Layer 2 EconomicEvent records with multiple providers/receivers
  • The Layer 0 identity hash provides the stable anchor for all custodian-to-resource links across custody transfers

11.2 Versioning

versioning.md defines a DAG of versions for resources. In the NDO model:

  • The R-VERS-01 requirement for "base identity vs version nodes" maps directly to the NDO: Layer 0 is the base identity; ResourceSpecification versions linked via NDOToSpecification are the version nodes
  • The version DAG is expressed as a VersionGraph capability slot linking the NDO identity to a versioning system
  • Fork relationships (ForkedFrom, EvolvedFrom) are expressed between ResourceSpecification entries linked to (potentially different) NDO identities
  • The Deprecated lifecycle stage with a mandatory successor link implements the R-VERS-01 base identity continuity requirement

11.3 Digital Resource Integrity

digital-resource-integrity.md defines cryptographic integrity manifests for digital resources. In the NDO model:

  • Digital asset manifests are attached to the NDO via CapabilitySlot links of type DigitalAsset
  • The fractal composable resource architecture (atomic → component → composite) maps directly to the Holonic Composition Pattern: each component is itself an NDO, with NDOToComponent links expressing the assembly hierarchy
  • The VersionGraph capability slot integrates with manifest-backed versions (R-VERS-DIG-01)

11.4 MOSS / Weave Integration

The Weave Interaction Pattern defines how hApps create, search, link, and organize social space units into complex social fabric. The NDO is the fundamental social space unit in Nondominium:

  • Layer 0 identity hash → declared as a Weave Asset via WeaveWAL capability slot
  • MOSS tools (governance DAOs, fabrication queues, issue trackers) attach via the stigmergic capability surface without requiring NDO entry modifications
  • Lifecycle stage transitions can be signaled to MOSS via Holochain signals, allowing MOSS tools to respond dynamically to NDO state changes

11.5 Unyt Integration

unyt-integration.md defines Unyt as the transactional layer for Nondominium — peer-to-peer accounting infrastructure built on Holochain, providing currencies, Smart Agreements, and agent-centric value flows. In the NDO model, Unyt integrates at three points:

  • Capability surface: UnytAgreement slot type (Section 6.6) is the permissionless attachment point — any agent can propose economic terms for any NDO
  • Layer 1: GovernanceRule entries of type EconomicAgreement carry endorsed Unyt Smart Agreement references as Layer 1 assets, sitting alongside other governance rules in the resource's specification
  • Layer 2: RAVE hashes (Recorded Agreement Verifiably Executed) link into PrivateParticipationClaim entries via settlement_rave_hash, binding economic settlement records to participation records in the Layer 2 process

The NDO three-layer model and Unyt are architecturally complementary: the NDO tracks what happens (resource events, custody, quality, lifecycle); Unyt tracks who owes what to whom (credits, debits, settlement). The governance zome is the bridge that conditions resource state transitions on proof of economic settlement, making the resource itself the enforcement mechanism for its own economic terms.

The PPR system and Unyt credit limits form a feedback loop: agents' ReputationSummary (derived from their accumulated PPRs) feeds into the Unyt Compute Credit Limit Agreement, making participation history the collateral for economic access in the commons network. This is the primary mechanism by which the Nondominium commons becomes self-sustaining without platform intermediaries or administrative overhead.

11.6 Flowsta Integration

flowsta-integration.md defines Flowsta as the identity and authentication layer for the NDO — decentralized authentication built on Holochain, providing cross-app identity linking, W3C DIDs, and zero-knowledge privacy. In the NDO model, Flowsta integrates at three points:

  • Capability surface: FlowstaIdentity slot type (Section 6.7) is the permissionless Tier 1 attachment point — any agent can link their Person entry to a Vault dual-signed IsSamePersonEntry, making their cross-app DID discoverable (no governance enforcement at this tier)
  • Agent identity (G15): The FlowstaIdentity slot is the first concrete implementation of the PersonCapabilitySlot pattern defined in Section 6.5 — a DID-backed attestation attached to the agent's identity anchor without modifying the Person entry schema
  • Governance enforcement (Tier 2, Phase 3): IdentityVerification governance rules can condition role promotions and high-value transitions on a FlowstaIdentity slot that passes REQ-NDO-CS-15 validation (valid IsSamePersonEntry, requestor key included, not revoked), bridging permissionless participation and accountable governance

The NDO three-layer model and Flowsta are architecturally complementary: the NDO tracks who does what (participation, custody, quality, reputation via PPRs); Flowsta tracks who is who (cross-app identity, DID, recovery). The capability slot mechanism is the bridge that connects an agent's local DHT identity to their portable, cross-app identity without requiring any core entry schema changes.

Flowsta Vault's BIP39 recovery and auto-backup mechanisms address a gap in the current NDO architecture: agent key recovery. The non-deletable, append-only nature of Person entries and PPRs assumes the agent retains access to their signing key. Vault's deterministic key regeneration from a 24-word mnemonic ensures that the permanent records the NDO creates remain accessible to their authors across device loss and hardware failure.

11.7 Lobby DNA Integration

lobby-dna.md defines the multi-network federation layer that sits above the NDO DHT: a public Lobby DHT (permissionless agent and NDO descriptor registry), per-group Group DHTs (invite-only coordination spaces), and three extensions to the existing NDO DNA (zome_gouvernance).

The Lobby layer connects to the NDO three-layer model at specific points:

  • Layer 0 (NondominiumIdentity) as the NDO's public identity anchor: The NdoDescriptor entry in the Lobby DHT mirrors the Layer 0 identity fields (name, lifecycle_stage, property_regime, resource_nature) and references the Layer 0 hash (ndo_identity_hash). The Lobby provides the discovery surface; Layer 0 is the authoritative source of truth.
  • Layer 2 (EconomicEvent/Commitment/Claim) as the hard-link gate: NdoHardLink entries are created only on validated EconomicEvent fulfillment — the same Layer 2 cycle that governs all NDO state changes. The Lobby's soft links (planning intent) become NDO-level hard links only through the existing governance-as-operator path.
  • Agreement as Layer 2 benefit-distribution governance: The Agreement entry type added to zome_gouvernance extends the NDO's Layer 2 process layer with benefit-distribution rules, activated post-MVP by Unyt RAVEs (see §11.5).
  • Contribution as a peer-validated Layer 2 work record: Validated Contribution entries record work done on the NDO at the Layer 2 observation level, with optional cross-DHT references to informal Group-level WorkLog entries for audit purposes.

Deployment modes: The Lobby DNA is designed for dual deployment — standalone hApp (Lobby DNA + Group DNA + NDO DNA, all managed by one conductor) and Moss/Weave Tool applet (Moss handles agent invites and identity at the surface; Nondominium owns the NDO layer). The NDO DNA is identical in both modes.

See lobby-dna.md for normative requirements (REQ-LOBBY-, REQ-GROUP-, REQ-NDO-EXT-*) and specifications/post-mvp/lobby-architecture.md for full schema, coordinator APIs, pipelines, UI, Moss contract, and 7 ADRs.


This document is post-MVP. The NDO Three-Layer Model will be implemented after the first Nondominium proof-of-concept is complete. The proof-of-concept uses ResourceSpecification + EconomicResource + GovernanceRule as defined in the current zome_resource integrity zome. The migration described in Section 10 will be the bridge between the two architectures.

Nondominium UI Design Vision

MVP

This section describes the minimalistic UI for MVP Layer 0 — NDO Identity (stable anchor; only lifecycle_stage evolves after creation; REQ-NDO-L0-*). The MVP UI implements the concepts of Lobby, Groups, and NDO view.


Lobby

The Lobby is a permissionless digital environment that anyone can join. It is the persistent outer shell of the application, always visible regardless of which route is active.

Implemented:

  • Persistent left sidebar present on all routes, containing:
    • Browse NDOs link → root page (/) listing all unique NDOs across all the user's groups, with filter chips (Lifecycle Stage, Resource Nature, Property Regime)
    • Groups list — links to each group the user has created or joined (/group/:id)
    • + New Group — inline form: user enters a group name and confirms; they become the group creator
    • → Join Group — inline form: user pastes an invite code or link
    • My Profile / Edit profile — at the bottom of the sidebar; opens the profile modal
  • First-time profile modal — triggered automatically on first app launch when no lobby profile exists; requires at least a nickname; all other fields (real name, bio, email) are optional and stored in localStorage

Groups

Groups are organizational contexts for NDOs. A user can create a solo Group or join an existing one. At MVP, group membership and NDO associations are tracked in localStorage (no DHT-backed group entries yet).

Implemented:

  • Group panel (/group/:id): shows group name, list of NDO cards, and a "Create NDO" button
  • Group profile prompt: on first visit to a group the user is asked how they wish to present themselves (anonymous / custom); stored in localStorage
  • NDO cards in group: each card shows name, lifecycle-stage badge, property-regime badge, resource-nature badge, and description excerpt; clicking a card navigates to the NDO detail page
  • Switching groups: navigating from one group to another correctly reloads the group name and NDO list

Not yet implemented:

  • Invite other users to a group (multi-member groups; sharing an invite link)
  • Displaying group members from DHT
  • Group-level governance

NDO Creation

NDOs can only be created from within a Group. The "Create NDO" button in a Group panel opens a creation form. NDO identity data is stored on the Holochain DHT as a NondominiumIdentity (Layer 0) entry; the action_hash of that entry is the NDO's permanent stable identity.

Implemented fields:

FieldControlNotes
nametext inputrequired; uniqueness warning shown if name already exists in the lobby
property_regimeselect4 variants: Private, Commons, Nondominium, CommonPool; tooltip per option
resource_natureselect5 variants: Physical, Digital, Service, Hybrid, Information; tooltip per option
lifecycle_stageselectrestricted to initial stages: Ideation, Specification, Development, Stable, Hibernating
descriptiontextareaoptional

Note: the original spec listed 6 property-regime variants (including Collective and Pool) and 4 initial lifecycle stages (including Prototype). Both have been revised — see the Rust PropertyRegime enum and LifecycleStage for current canonical values.


NDO View

Clicking an NDO card navigates to /ndo/:hash.

Implemented:

  • NDO name displayed in header (populated immediately from in-memory cache on card click; refreshed from DHT in the background)
  • Truncated hash shown below the name
  • Detail card: labeled fields for Description, Property Regime, Resource Nature, Lifecycle Stage, and Created date
  • Identity badges: lifecycle-stage color badge, property-regime badge, resource-nature badge
  • Lifecycle transition button (visible to NDO initiator only): advances the lifecycle stage
  • Join NDO button — placeholder; toggles inline "Coming soon"; no backend call yet
  • Associate with a group button — always shown in the header; opens a modal that lists groups the user has created or joined that are not already linked to this NDO (multi-select); if the user has no groups, the modal explains that case; confirming writes associations to localStorage (ndo_groups_v1 keyed like other group data — see group.store.svelte.ts); the NDO card then appears in the selected group(s)
  • Fork this NDO button — opens the fork friction modal; visible only when the Holochain conductor is connected and the UI has resolved the user's agent key
  • Tabs: Resources, Governance, Composition, Activity (stubs for post-MVP content)

Browse NDOs

Implemented:

  • "Browse NDOs" in sidebar → root page showing all unique NDOs from all groups the user has created or joined
  • Filter chips by Lifecycle Stage, Resource Nature, and Property Regime (4 variants)
  • NDO cards with name, badges, description excerpt, and truncated hash
  • "No NDOs yet" state when the user has no groups or no NDOs

User / Agent Identity

At the Lobby level the User can be anyone. At this level the User creates a Lobby Profile, stored in localStorage. At the Group level the User also has a profile, linked to the Lobby profile but customizable per group. As the User creates or links to an NDO, their identity is distilled into a Holochain Agent (as implemented in zome_person). Since NDOs are public and permissionless, no personal information is revealed at the NDO level — only a pseudonymous agent key address is shown. Access to personal data (e.g. PPR — Personal Participation Receipts) is selective and governed by the Governance zome.

Implemented:

  • First-time Lobby profile modal: nickname required; realName, bio, email optional; stored in localStorage
  • "Edit profile" in sidebar for returning users
  • Group profile prompt on first group visit: user can choose how to present themselves (anonymous or with selected fields from their Lobby profile)
  • Agent public key shown on the NDO initiator line when Holochain is connected

MVP ToDos

  1. Multi-member groups — invite link: implement invite-link generation and redemption so a group creator can share a link with other agents, who can then join the group and see its NDO list.

  2. NDO fork friction: the "Fork this NDO" button opens a form but currently has no governance friction. Per spec, forking should present a notice about negotiation, consensus, and eventual payment (Unyt integration); the MVP version should at minimum display this notice before proceeding.

  3. NDO detail page — DHT refresh reliability: the NDO detail page seeds its display from an in-memory card cache and then attempts a background DHT refresh. The DHT refresh path (getMyNdosgetAllNdos) should be validated end-to-end; if it consistently fails, the root cause in get_ndo / get_all_ndos zome calls should be investigated.

  4. Group member list: the Group panel has a MemberList stub that currently shows an empty list. Implement fetching and displaying group members (requires the invite/join flow from ToDo 1).

  5. Browse NDOs onboarding: when the user has no groups, the NDO browser shows nothing. Add a visible call-to-action ("Create or join a group to see NDOs") to guide new users.

  6. Update agent.md: foundational document should be updated to reflect the three-tier identity model — Lobby profile (localStorage) → Group profile (localStorage, per-group) → DHT Agent (zome_person), including the pseudonymity guarantees at the NDO level.

  7. NDO–Group association DHT propagation: the "Associate with a group" action currently writes only to the local agent's localStorage. Once the Group DNA is implemented, each association must also be written to the Group's DHT table so all group members see the NDO card — not just the agent who performed the association. The write site is associateNdoWithGroup in group.store.svelte.ts (marked with a TODO comment).

  8. Join NDO: the UI only shows placeholder copy ("Coming soon"). Implement backend + UI wiring: join_ndo (or equivalent) coordinator API, integrity entry or link types for membership, and DHT propagation so the joining agent appears in the NDO's contributor/member record. Distinct from Associate with group (curated short list per group).

Post MVP

This section is about UI improvements after a functional MVP.

Core Design Philosophy

  • Perspective-centric design: Interface adapts to agent's role and context
  • Landscape as fundamental pattern: Natural spatial metaphor for resource organization
  • Parallax 3D depth: Isometric perspective with 3-4 layers creating intuitive navigation
  • Horizontal navigation: Primary movement left-right through parallax layers
  • Intuitive interaction: Natural gestures and spatial awareness
  • Symbolic representation: Resources/entities as round icons with peripheral state indicators

Three-Layer Depth System

🔬 Micro Layer (z-index: 300)

  • Purpose: Detailed resource view (modal/overlay)
  • Trigger: Click/tap on resource entity
  • Opacity: 1.0, no blur
  • Content: Full resource details, actions, history
  • Navigation: Close to return to meso, or jump to related entities

🎯 Meso Layer (z-index: 200) - DEFAULT

  • Purpose: Contextual workspace, agent's primary focus
  • Scope: Local context relevant to agent's role/location
  • Opacity: 0.9-1.0, no blur
  • Content: 10-20 most relevant resources/entities (4-5 on screen, but we can circle them while staying in meso view)
  • Interaction: Full interactive capabilities

🌍 Macro Layer (z-index: 100)

  • Purpose: Global landscape, broader system context
  • Scope: All entities less directly related to agent
  • Opacity: 0.4-0.7, 2-4px blur
  • Content: Overview of entire resource network
  • Interaction: Hover preview, click to refocus meso layer

Perspective Types

👷 Role Perspective

Agent sees resources relevant to their role/capabilities

maintainer_role:
  focus_filter: needs_maintenance = true
  priority_order: urgency_level
  color_scheme: earth_tones
  layout: spatial_proximity

📦 Resource Perspective

Focus on specific resource types or categories

resource_view:
  focus_filter: resource_type = selected
  group_by: category | location | status
  color_scheme: resource_type_colors
  layout: cluster_hierarchy

👥 Agent Perspective

Social/collaborative view of other agents

social_view:
  focus_filter: collaboration_potential
  relationship_mapping: trust_network
  color_scheme: relationship_strength
  layout: network_graph

📍 Geographic Perspective

Location-based resource organization

geographic_view:
  focus_filter: spatial_proximity
  center_point: agent_location
  radius: role_responsibility_area
  layout: concentric_circles

Visual Design System

Entity Representation

.resource-entity {
  shape: circle | rounded-square | hexagon;
  size: calc(proximity_score * base_size);
  background: resource_type_color;
  border: 2px solid state_color;

  /* Peripheral indicators */
  .state-badges: action_indicators[];
  .glow-effect: urgency_level;
  .pulse-animation: activity_state;
}

State Indicators

  • 🟢 Available/Healthy: Ready for use, optimal condition
  • 🟡 Needs Attention: Maintenance required, low priority
  • 🔴 Critical/Blocked: Urgent action needed, system risk
  • 🔵 In Use/Reserved: Currently engaged, not available
  • Dormant/Archive: Inactive, background status
  • 🟣 Pending: Awaiting approval/assignment

Concentric Layout Pattern

  • Center: Agent's current focus/role context
  • Inner Ring: High-relevance resources (meso layer)
  • Outer Ring: Background context (macro layer, blurred)
  • Smooth Transitions: Elastic zoom and pan between layers

Proximity Calculation Algorithm

function calculateProximity(entity, agent_context) {
  const weights = {
    role_relevance: 0.4, // Match to agent's role/skills
    geographic_distance: 0.2, // Physical/logical proximity
    interaction_frequency: 0.2, // Historical engagement
    temporal_urgency: 0.1, // Time-sensitive needs
    governance_access: 0.1, // Permission/capability level
  };

  const proximity_score =
    weights.role_relevance * entity.roleMatch(agent_context.role) +
    weights.geographic_distance *
      (1 - entity.distance(agent_context.location)) +
    weights.interaction_frequency *
      entity.interactionHistory(agent_context.id) +
    weights.temporal_urgency * entity.urgencyScore() +
    weights.governance_access * entity.accessLevel(agent_context.capabilities);

  return Math.min(1.0, Math.max(0.0, proximity_score));
}

// Layer assignment
function assignLayer(proximity_score) {
  if (proximity_score >= 0.7) return "micro_candidate";
  if (proximity_score >= 0.4) return "meso";
  return "macro";
}

Dynamic View Composition

Filter System

const meso_composition = {
  keywords: ["maintenance", "urgent", "mechanical"],
  tags: ["infrastructure", "public"],
  date_range: "last_30_days",
  proximity_threshold: 0.6,
  max_entities: 20,
  sort_by: "urgency_desc",
};

Adaptive Personalization

  • Learning: System learns from agent's interaction patterns
  • Preferences: Custom color themes, entity sizes, layout density
  • Context Switching: Quick perspective toggles based on current task

Primary Navigation (Horizontal)

  • Left/Right Scrolling: Move through perspective layers
  • Parallax Effect: Different scroll speeds per layer (macro slower than meso)
  • Momentum Scrolling: Natural deceleration with bounce effects
  • Breadcrumb Trail: Visual path showing navigation history

Secondary Navigation (Vertical)

  • Zoom In: Meso → Micro (entity details)
  • Zoom Out: Meso → Macro (broader landscape)
  • Elastic Transitions: Smooth scaling with momentum physics
  • Quick Return: One-click return to default meso view

Interaction Gestures

  • Click/Tap: Open micro view or refocus meso
  • Double-Click: Quick action (depends on entity type)
  • Long Press: Context menu with available actions
  • Pinch/Zoom: Layer transition control
  • Swipe: Navigate between related entities

Use Case Examples

🌲 Forester Agent Example

Role: Forest maintenance specialist Meso View: Trees/forest sections under their responsibility

  • Focus: Trees needing attention (disease, damage, scheduled maintenance)
  • Layout: Geographic clusters by forest section
  • Priority: Health status and maintenance urgency

Micro View: Individual tree details

  • Health metrics, species info, maintenance history
  • Available actions: Schedule maintenance, mark for removal, update status

Macro View: Entire forest ecosystem

  • All forest resources beyond immediate responsibility
  • Ability to see broader patterns and request assistance

🔧 Maintenance Coordinator Example

Role: Equipment and infrastructure maintenance Meso View: Equipment requiring maintenance within their jurisdiction

  • Priority filter: Critical systems first, then scheduled maintenance
  • Status indicators: Operational, needs attention, critical failure
  • Timeline view: Maintenance schedules and deadlines

🏗️ Resource Allocation Agent Example

Role: Optimizing resource distribution across projects Meso View: Available resources and current allocations

  • Filter by: Resource type, availability, location, project needs
  • Visual flow: Resource movement between projects
  • Optimization indicators: Efficiency metrics, bottlenecks

Responsive Design Considerations

Mobile Adaptation

  • Single Layer Focus: Simplified view with layer swipe transitions
  • Larger Touch Targets: Minimum 44px touch areas for entities
  • Simplified Indicators: Essential state information only
  • Gesture Navigation: Swipe for layers, tap for details

Desktop Enhancement

  • Full Parallax Experience: All three layers simultaneously visible
  • Keyboard Shortcuts: Layer navigation, entity selection, quick actions
  • Multi-Selection: Batch operations on multiple entities
  • Rich Hover States: Detailed tooltips and preview information

Accessibility Features

  • High Contrast Mode: Enhanced visual differentiation
  • Screen Reader Support: Semantic markup and ARIA labels
  • Keyboard Navigation: Full functionality without mouse
  • Motion Preferences: Respect user's motion sensitivity settings

Technical Implementation Notes

  • Rendering: Canvas-based or WebGL for smooth 3D transitions
  • Data Binding: Real-time updates from Holochain DHT
  • Performance: Virtualized rendering for large entity sets
  • Caching: Intelligent prefetching based on proximity scores
  • State Management: Maintain layer states and user preferences

Digital Resource Integrity - High-Level Requirements

Problem Statement

The nondominium system must provide cryptographic proof that downloaded resource data is identical to the original data uploaded to the Holochain DHT. This ensures trust in resource exchange and prevents unauthorized modifications during storage and transmission.

Core Requirements

R1: Cryptographic Integrity Verification

The system shall provide mathematical proof that downloaded data matches the original uploaded data.

Acceptance Criteria:

  • Users can verify that any downloaded resource is identical to the original
  • Verification process works even if data is stored by multiple unknown agents
  • Any modification to data is immediately detectable
  • Verification can be performed without trusting storage providers

R2: Distributed Storage with Guarantees

The system shall store resource data across multiple Holochain agents while maintaining integrity.

Acceptance Criteria:

  • Files are split into chunks for distributed storage
  • Each chunk is cryptographically addressed by its content hash
  • Data can be retrieved even if some storage agents are offline
  • Storage failures do not compromise data integrity

R3: Efficient Verification Process

The system shall allow users to verify resource integrity efficiently.

Acceptance Criteria:

  • Verification can be performed without downloading entire resources
  • Users can verify specific portions of large resources
  • Verification process completes within acceptable time limits
  • Users receive clear success/failure feedback on verification

R4: Manifest-Based Organization

The system shall use manifests to organize and describe resource data.

Acceptance Criteria:

  • Each resource has a manifest describing its structure and integrity
  • Manifests contain metadata about files and their organization
  • Manifests are themselves cryptographically verifiable
  • Manifest format supports multiple files and complex resources

R5: Composable Resource Architecture

The system shall support hierarchical resource compositions where parent resources are assembled from child resources.

Acceptance Criteria:

  • Resources can reference other resources as components with specified quantities
  • Each component maintains independent integrity verification and trust status
  • Parent resource integrity depends on component integrity with dependency rules
  • Component replacements trigger appropriate re-verification of affected parent assemblies
  • Support for required, optional, and alternative components with different verification levels

R6: Fractal Verification Process

The system shall provide recursive verification that cascades through resource hierarchies.

Acceptance Criteria:

  • Verify complete resource tree from leaf components to root assembly
  • Identify specifically which components failed verification in hierarchical context
  • Allow partial verification of subsystems without full assembly verification
  • Component integrity changes propagate trust/verification status up through parent assemblies
  • Support for "trusted component" status that simplifies verification of dependent assemblies

R7: Component Dependency Management

The system shall manage dependencies between components with version compatibility and substitution rules.

Acceptance Criteria:

  • Version compatibility matrices defining which component versions can work together
  • Required vs optional vs alternative component classification with clear rules
  • Component substitution rules that specify verification implications for replacements
  • Assembly upgrade paths that maintain verification continuity and trust propagation

R8: Selective Component Verification

The system shall allow users to verify specific components or subsystems efficiently.

Acceptance Criteria:

  • Verify only critical components for time-sensitive operations with reduced scope
  • Component-level verification status caching to avoid redundant verifications
  • Trust propagation from previously verified components to parent assemblies
  • Impact analysis showing which parent assemblies are affected by component changes

R9: Component Supply Chain Transparency

The system shall provide transparency into component origins, manufacturing processes, and assembly relationships.

Acceptance Criteria:

  • Component provenance tracking through complete assembly hierarchy
  • Manufacturer and supplier verification at component level with cryptographic proofs
  • Integration with external supply chain verification systems and standards
  • Component recall and replacement notifications that affect dependent assemblies

Verification Process Requirements

Phase 1: Resource Discovery & Composition Analysis

User Action: Request a resource from the DHT

System Responsibilities:

  1. Retrieve the resource manifest from the DHT
  2. Verify the manifest's cryptographic signature
  3. Analyze resource composition:
    • Identify if resource is atomic or composite
    • Load component manifests recursively for composite resources
    • Build complete component dependency tree
    • Check version compatibility between components
  4. Present comprehensive manifest metadata including:
    • File list, sizes, and hashes
    • Component breakdown with integrity status
    • Dependency relationships and version constraints
    • Critical vs optional component classification
  5. Obtain user consent to proceed with download

Phase 1A: Component Integrity Pre-Check (Composite Resources)

System Responsibilities:

  1. Verify availability of all required components
  2. Check component verification status and trust levels
  3. Identify any missing, corrupted, or incompatible components
  4. Present component integrity summary before download
  5. Allow user to proceed with available components or wait for missing ones

Phase 2: Hierarchical Chunk Verification During Download

User Action: Download the resource data

System Responsibilities:

  1. For atomic resources: Retrieve and verify individual chunks as before
  2. For composite resources:
    • Download component resources in dependency order
    • For each component: verify its chunks and integrity according to its verification level
    • Track component verification status independently
  3. Real-time integrity feedback:
    • Show component-by-component verification progress
    • Flag individual component failures without stopping entire download
    • Continue with available components while troubleshooting failed ones
  4. Dependency validation:
    • Verify component compatibility during assembly
    • Check that required components are present before marking assembly complete
    • Handle optional component absences gracefully

Phase 3: Complete Assembly Verification

User Action: After download completes, request full verification

System Responsibilities:

  1. For atomic resources: Verify complete resource against manifest's Merkle root
  2. For composite resources:
    • Verify individual component integrity (already done in Phase 2)
    • Verify assembly integrity:
      • Validate component quantities and relationships
      • Check assembly rules and constraints
      • Verify no required components are missing
      • Validate optional component selections
  3. Generate hierarchical verification results:
    • FULLY VERIFIED: All components and assembly validated
    • ⚠️ PARTIALLY VERIFIED: Core components verified, optional issues present
    • ASSEMBLY FAILED: Critical components missing or incompatible
    • COMPONENT CORRUPTED: One or more components failed verification
  4. Detailed component reporting:
    • Show exact component verification status
    • Identify which components failed and why
    • Provide impact analysis on parent assembly

Phase 4: Hierarchical Integrity Reporting

User Action: Request verification report

System Responsibilities:

  1. Generate comprehensive hierarchical verification report:
    • Component breakdown with individual integrity status
    • Assembly verification results with dependency analysis
    • Verification timestamps for each component and assembly
    • Trust propagation analysis showing how component trust affects assembly
  2. Supply chain transparency:
    • Component provenance information
    • Manufacturer and supplier verification status
    • Version compatibility analysis
    • Substitution and upgrade recommendations
  3. Audit trail maintenance:
    • Store verification results at component and assembly levels
    • Maintain component dependency history
    • Enable verification proof sharing for component sub-assemblies
  4. Impact analysis tools:
    • Show which parent assemblies are affected by component changes
    • Provide upgrade and maintenance recommendations
    • Support compliance reporting for regulatory requirements

User Experience Requirements

UX1: Clear Feedback During Verification

The system shall provide users with real-time feedback during the verification process.

Requirements:

  • Progress indicator showing verification status
  • Clear messaging about which chunks are being verified
  • Immediate notification of any verification failures
  • Estimated time remaining for verification

UX2: Hierarchical Verification Options

The system shall offer users flexibility in verification approaches for complex resource assemblies.

Options:

  • Quick Verify: Verify only critical components and core assembly
  • Full Verify: Verify all components, chunks, and complete assembly hierarchy
  • Selective Verify: Verify specific components, files, or chunks at any level
  • Component Verify: Verify only selected components without full assembly
  • Background Verify: Run verification in background with progress notifications
  • Trust-Based Verify: Skip verification of pre-trusted components and assemblies
  • Supply Chain Verify: Include manufacturer and supplier verification in verification process

UX3: Hierarchical Error Handling and Recovery

The system shall handle verification failures gracefully at component and assembly levels.

Requirements:

  • Component-level error reporting: Clear error messages explaining which components failed verification
  • Assembly impact analysis: Show how component failures affect parent assemblies
  • Graceful degradation: Continue with available components while handling failed ones
  • Component substitution assistance: Suggest alternative components when available
  • Automatic retry mechanisms: Retry failed components and chunks with different sources
  • Recovery recommendations: Provide step-by-step guidance for resolving verification issues
  • Partial assembly support: Allow use of partially verified assemblies with clear warnings

Integration Requirements

I1: ValueFlows Compatibility

The system shall integrate seamlessly with existing ValueFlows resource management.

Requirements:

  • Integrity metadata stored with ResourceSpecification entries
  • Resource transfers include integrity verification steps
  • Economic events can depend on successful verification
  • Reputation systems consider verification success rates

I2: Governance Integration

The system shall respect existing governance rules and access controls.

Requirements:

  • Verification operations respect capability-based permissions
  • Audit trails for all verification activities
  • Resource owners can set verification requirements
  • Verification failures can trigger governance actions

I3: Standards Compliance

The system shall follow relevant industry standards for digital integrity.

Requirements:

  • Compatibility with IOPA (Internet of Production Alliance) standards
  • Support for common cryptographic standards (SHA-256, Merkle trees)
  • Documentation of verification processes for compliance audits
  • Extensible design for future standard updates

Performance Requirements

P1: Verification Speed

  • Individual chunk verification: <100ms per chunk
  • Full resource verification: <10 seconds for typical resources
  • Verification report generation: <1 second
  • Concurrent verification support for multiple resources

P2: Storage Efficiency

  • Manifest overhead: <1% of total resource size
  • Chunk size optimization for DHT performance
  • Efficient data structures for verification metadata
  • Minimal additional storage for verification data

P3: Network Efficiency

  • Parallel chunk retrieval for faster downloads
  • Optimized chunk location algorithms
  • Caching strategies for frequently accessed resources
  • Bandwidth-efficient verification protocols

Security Requirements

S1: Cryptographic Security

  • Use industry-standard cryptographic algorithms (SHA-256)
  • Proper random number generation for cryptographic operations
  • Protection against collision attacks through hash algorithms
  • Regular security reviews of cryptographic implementations

S2: Access Control

  • Verification operations respect existing access permissions
  • Audit trails for all integrity-related operations
  • Protection against unauthorized modification of verification data
  • Secure storage of cryptographic keys and certificates

S3: Data Privacy

  • Optional encryption for sensitive resource data
  • Privacy-preserving verification options when possible
  • Compliance with data protection regulations
  • User control over verification data sharing

Success Metrics

Technical Metrics

  • Verification success rate: >99.9%
  • False positive rate: <0.01%
  • Verification time within performance requirements
  • Resource availability with integrity guarantees

User Experience Metrics

  • User satisfaction with verification process
  • Trust levels in resource integrity system
  • Adoption rate of verification features
  • Support requests related to verification issues

Business Metrics

  • Reduced disputes over resource integrity
  • Increased trust in resource exchanges
  • Compliance with industry regulations
  • Competitive advantage through robust integrity guarantees

Technical Context (for Implementation Reference)

Storage Architecture

  • File Chunking: Resources split into 64KB chunks for DHT distribution
  • Content Addressing: Each chunk addressed by its SHA-256 hash
  • Manifest System: Resource manifests organize chunks and provide integrity metadata
  • Merkle Trees: Hierarchical hash structure enables efficient selective verification
  • Component References: Manifests can reference other resource manifests as components
  • Assembly Hierarchies: Support for unlimited nesting depth in resource compositions

Cryptographic Foundation

  • Hash Algorithm: SHA-256 for chunk and resource verification
  • Tree Structure: Merkle trees for efficient integrity proofs
  • Signature Scheme: Holochain's built-in cryptographic signatures
  • Validation: Multi-level verification (chunk → file → resource → component → assembly)
  • Trust Propagation: Cryptographic proof chaining through component hierarchies
  • Component Signatures: Individual component verification proofs that combine into assembly proofs

Composability Architecture

  • Atomic Resources: Base resources with no sub-components (files, data chunks)
  • Component Resources: Resources that can be used as parts of larger assemblies
  • Composite Resources: Assemblies built from multiple component resources
  • Assembly Rules: Constraints and requirements for valid component combinations
  • Version Matrices: Compatibility rules defining which component versions work together
  • Substitution Rules: Allowable component replacements with verification implications

Integration Points

  • ResourceSpecification: Enhanced with component references and assembly rules
  • Governance Zome: Access control and audit trail integration for component operations
  • Economic Events: Verification-dependent transaction flows for component exchanges
  • Reputation Systems: Agent reliability based on component and assembly verification history
  • Supply Chain Integration: External manufacturer and supplier verification systems
  • Standards Compliance: IOPA and other manufacturing standards for component assemblies

This requirements document provides the foundation for implementing a comprehensive digital resource integrity system that ensures trust and reliability in the nondominium resource exchange ecosystem.

Many-to-Many and Multi-Party Resource Flows (Post-MVP)

This document defines the plan and requirements for extending Nondominium beyond one-to-one custody transfers. The approach is to extend the ValueFlows model (EconomicEvent, Commitment, and related structures) to support multiple providers and multiple receivers, rather than using workarounds such as bundling pairwise events.

These requirements are post-MVP and will be developed after the first Nondominium proof-of-concept.


1. Context and Goals

1.1 Current State (MVP)

  • EconomicResource has a single custodian: AgentPubKey.
  • EconomicEvent and Commitment have single provider: AgentPubKey and receiver: AgentPubKey.
  • Transfer patterns: Only one-to-one custody transfers are supported.
  • PPR: Exactly two receipts per interaction (one per agent in the pair).

1.2 Target State (Post-MVP)

  • Support one-to-one, one-to-many, many-to-one, and many-to-many custody and transfer patterns.
  • Support resource pools (multiple resources under mixed regimes) transferred to one or many agents, with all current custodians of any resource in the pool required to consent.
  • Support shared custody with optional weights and roles per custodian.
  • Support delegation among co-custodians (e.g. one custodian holds legal responsibility or facility-management role).
  • Extend ValueFlows data structures and semantics to n-ary participants; keep PPR issuance rules well-defined for multi-party flows.

1.3 Design Principle

Extend ValueFlows, do not work around it. EconomicEvent and Commitment (and any dependent types) shall be extended to allow multiple providers and/or multiple receivers where the domain requires it. Compatibility with existing one-to-one flows shall be preserved (e.g. single-provider/single-receiver as a special case).


2. Use Cases and Transfer Patterns

2.1 One-to-Many (Current Custodian Adds Co-Custodians)

  • Example: Agent A is custodian of a physical space. A transfers custody so that A, B, C, D are all co-custodians (co-stewards). B, C, D can use and co-manage the space.
  • Pattern: One provider (A), many receivers (A, B, C, D) or (B, C, D) if A relinquishes.
  • Applies to: Shared spaces, shared digital resources (e.g. shared wallet, shared document list).

2.2 Many-to-One (All Co-Custodians Transfer to One Agent)

  • Example: Agents B, C, D share custody of a CNC machine. The machine needs repair. All three must agree and co-sign a custody transfer to the repair agent R for a limited time.
  • Pattern: Many providers (B, C, D), one receiver (R).
  • Applies to: Repair, storage, or any handover that requires full consent of current co-custodians.

2.3 Many-to-Many (One Group Hands Over to Another Group)

  • Example: B, C, D are co-custodians of a CNC in a makerspace. They transfer custody to another group E, F, G in a different makerspace, who will share responsibility. All of B, C, D agree; custody becomes E, F, G.
  • Pattern: Many providers (B, C, D), many receivers (E, F, G).
  • Applies to: Equipment handovers between groups, shared digital assets.

2.4 Pool Transfers (Multiple Resources, Mixed Regimes)

  • Example: A pool contains resources under various property regimes. The entire pool is transferred to one agent or to a group. Every agent who is custodian or co-custodian of any resource in the pool must sign the transaction.
  • Pattern: Many providers (all custodians across the pool), one or many receivers.
  • Applies to: Bundled asset transfers, project handovers.

2.5 Delegation Among Co-Custodians

  • Example: A physical space has co-custodians A, B, C, D. Legal responsibility (relationship with municipality or landlord) is delegated to one of them (e.g. A), not all. A can perform certain actions (sign contracts, represent to authority) on behalf of the group.
  • Requirement: The system must support roles and delegation within the set of custodians so that specific actions can be restricted to a delegate without requiring every co-custodian to sign each time.

3. Plan (Implementation Phases)

Phase 1: Data Model and Shared Custody

  • Extend EconomicResource or introduce SharedCustody so that a resource can have multiple custodians with optional weights and roles.
  • Define ResourcePool (optional) for grouping resources for pool transfers.
  • Ensure backward compatibility: resources with a single custodian continue to work as today.

Phase 2: ValueFlows Extension (Events and Commitments)

  • Extend EconomicEvent to support:
    • providers: Vec<AgentPubKey> and receiver: AgentPubKey, or
    • providers: Vec<AgentPubKey> and receivers: Vec<AgentPubKey> (full n-to-m).
  • Extend Commitment similarly (multiple providers, multiple receivers).
  • Define validation rules: when multiple providers are present, policy may require that all (or a weighted threshold) have agreed before the event is valid.
  • Keep Claim and EconomicEvent linkage clear (one Commitment fulfilled by one EconomicEvent; the event itself may be n-ary).
  • Introduce multi-party consent for transfers that change custody when there are multiple current custodians:
    • Either encode consent in the Commitment/Event (e.g. list of signatories), or
    • Introduce a lightweight CustodyTransferProposal (or equivalent) that collects signatures and, when satisfied, creates the EconomicEvent and updates custody.
  • Define execution semantics: when all required providers have signed, custody is updated and the event is recorded.

Phase 4: Delegation (Resource-Scoped)

  • Introduce ResourceDelegation (or equivalent): which agent(s) may perform which actions on behalf of which co-custodians for a given resource or pool.
  • Roles (e.g. legal_delegate, facility_manager) and optional allowed_actions.
  • Governance checks: before executing an action, verify either direct custodianship or a valid delegation for that action.

Phase 5: PPR Distribution for Multi-Party Flows

  • Define how Private Participation Receipts are generated when providers and/or receivers are multiple:
    • Which agents receive PPRs.
    • How to attribute responsibility (e.g. delegate vs full group, weights).
  • Extend PPR structures as needed (e.g. on_behalf_of, role_context) so reputation and OVN accounting can attribute correctly.
  • Ensure backward compatibility: one-to-one flows still produce exactly two PPRs as today.
  • Implement pool transfer flows: gather all custodians of all resources in the pool, require their consent, then create events and update custody for each resource (or define a single composite event type for pools).
  • Define how PPRs are distributed when a pool is transferred (per resource, per agent, or aggregated as specified).

4. Requirements

4.1 Shared Custody and Weights/Roles

  • REQ-MMF-01 – Multiple Custodians: The system shall support resources for which more than one agent holds custody (co-custodians).
  • REQ-MMF-02 – Backward Compatibility: Resources with a single custodian shall remain supported and behave as in the current MVP (single custodian or single-member shared custody).
  • REQ-MMF-03 – Weights (Optional): For resources with multiple custodians, the system shall support optional weights (e.g. shares) per custodian for responsibility, benefit, or voting.
  • REQ-MMF-04 – Roles (Optional): For resources with multiple custodians, the system shall support optional roles per custodian (e.g. legal_delegate, facility_manager) to support delegation of specific actions to one or a subset of custodians.
  • REQ-MMF-05 – Thresholds (Optional): The system shall support optional threshold rules (e.g. "transfers require consent of custodians representing ≥ 80% of weight") for multi-party decisions.

4.2 ValueFlows Extension (Events and Commitments)

  • REQ-MMF-06 – Multiple Providers: EconomicEvent and Commitment shall support multiple providers (e.g. providers: Vec<AgentPubKey>), with single-provider as a special case.
  • REQ-MMF-07 – Multiple Receivers: EconomicEvent and Commitment shall support multiple receivers (e.g. receivers: Vec<AgentPubKey>), with single-receiver as a special case.
  • REQ-MMF-08 – ValueFlows Compliance: Extensions shall remain consistent with ValueFlows vocabulary and semantics; where the standard does not define n-ary flows, Nondominium shall define a minimal, documented extension.
  • REQ-MMF-09 – Validation of n-ary Events: The system shall validate that all required providers (or a defined subset/threshold) have consented before an EconomicEvent involving multiple providers is considered valid and executed.
  • REQ-MMF-10 – Claim-Event Linkage: Each Commitment shall still be fulfilled by at most one EconomicEvent; that event may reference multiple providers and/or multiple receivers.

4.3 Transfer Patterns

  • REQ-MMF-11 – One-to-Many Transfer: The system shall support custody transfers from one agent to a set of agents (one-to-many), including the case where the original custodian remains in the set (co-stewardship).
  • REQ-MMF-12 – Many-to-One Transfer: The system shall support custody transfers from a set of agents to one agent (many-to-one), requiring consent of all current custodians (or a defined threshold).
  • REQ-MMF-13 – Many-to-Many Transfer: The system shall support custody transfers from a set of agents to another set of agents (many-to-many), with consent and execution semantics clearly defined.
  • REQ-MMF-14 – Pool Transfers: The system shall support transfers of a pool of resources to one or more agents, where every custodian (or co-custodian) of any resource in the pool must consent (or meet a defined threshold) before the transfer is executed.

4.4 Delegation Among Co-Custodians

  • REQ-MMF-15 – Resource-Scoped Delegation: The system shall support delegation of specific actions (e.g. sign contract, represent to municipality) to one or more agents on behalf of the co-custodians of a resource or pool.
  • REQ-MMF-16 – Delegation Roles: Delegation shall be expressible with role labels (e.g. legal_delegate, facility_manager) and optional allowed_actions so that only delegated actions can be performed by the delegate without full co-custodian consent.
  • REQ-MMF-17 – Delegation Revocation: Delegation shall be revocable; revocation shall not require changing the set of co-custodians.
  • REQ-MMF-18 – Governance Check: Before executing an action that affects a resource with multiple custodians, the system shall verify that the acting agent is either a custodian or a valid delegate for that action.

4.5 PPR Distribution and Attribution

  • REQ-MMF-19 – PPR for Multi-Party Events: The system shall define and implement rules for issuing Private Participation Receipts when an EconomicEvent has multiple providers and/or multiple receivers.
  • REQ-MMF-20 – Attribution Semantics: PPR issuance shall support clear attribution of responsibility (e.g. which agents are credited or debited for the interaction), including optional weights and roles (e.g. delegate vs full group).
  • REQ-MMF-21 – Delegation Context in PPR: When an action is performed by a delegate on behalf of co-custodians, PPRs shall carry context (e.g. on_behalf_of, role_context) so that reputation and OVN accounting can attribute correctly to both the delegate and the group.
  • REQ-MMF-22 – Backward Compatibility of PPR: One-to-one flows shall continue to generate exactly two PPRs per interaction as in the current MVP; multi-party flows shall have a documented, deterministic PPR distribution rule.

4.6 Integration and Consistency

  • REQ-MMF-23 – Governance-as-Operator: Multi-party transfers and delegation shall integrate with the existing governance-as-operator architecture (resource zome requests transitions; governance zome evaluates and authorizes).
  • REQ-MMF-24 – Economic Processes: Use, Transport, Storage, and Repair processes shall be extensible to multi-party custody where applicable (e.g. many-to-one transfer to repair agent).
  • REQ-MMF-25 – Digital and Material: The same transfer patterns and delegation model shall apply to both material and digital resources (e.g. shared wallet, shared document list).

4.7 Documentation and Interoperability

  • REQ-MMF-26 – Extension Documentation: The ValueFlows extensions (n-ary providers/receivers, shared custody, delegation) shall be documented for interoperability and potential upstream contribution to ValueFlows or related standards.
  • REQ-MMF-27 – Migration Path: The design shall allow a clear migration path from current one-to-one-only data to the extended model without breaking existing records.

5. Relationship to Other Post-MVP Work

  • Versioning (see versioning.md): Versioning of resources and of the Nondominium hApp is independent but complementary; multi-party flows may apply to versioned resources and to forks.
  • Future architecture (P2P vs organizational) (see requirements.md section 11): Delegation in many-to-many flows aligns with organizational delegation (org → employee); resource-scoped delegation is a subset that can share concepts and data structures.
  • Digital Resource Integrity (see digital-resource-integrity.md): Shared custody and pool transfers may involve resources with integrity manifests; verification and attribution should remain consistent.

6. Post-MVP Status

These requirements are explicitly post-MVP. The first Nondominium proof-of-concept will implement only one-to-one custody transfers. Implementation of many-to-many flows, shared custody with weights/roles, resource-scoped delegation, and extended PPR distribution will follow in a later phase, in line with the plan above.

Resource Transport/Flow Protocol (RTP-FP) Specification

Version: 0.1 Date: 2025-11-07 Framework: Holochain HDK ^0.6.0 / hREA ValueFlows License: [Specify License]

Abstract

The Resource Transport/Flow Protocol (RTP-FP) is a multi-dimensional protocol designed to facilitate low-friction resource flows in commons-based economies. Unlike static transfer protocols focused on ownership change, RTP-FP emphasizes the continuous movement, mutualization, and co-stewardship of shared resources throughout their complete lifecycle.

1. Fundamental Concepts

1.1 Transport vs Transfer Paradigm

Traditional Transfer Protocol:

  • Linear ownership change: A → B
  • Static endpoint focus
  • Private ownership model
  • Single transaction view

Resource Transport/Flow Protocol:

  • Multi-dimensional flow: A ↔ Network ↔ B ↔ Network...
  • Continuous lifecycle perspective
  • Commons-based stewardship
  • Multi-agent participation view

1.2 Core Principles

  1. Non-Linear Resource Flows: Resources don't follow supply chains but participate in resource flows within commons networks
  2. Custodial Stewardship: Resources have custodians, not owners, with responsibilities and benefits
  3. Multi-Dimensional Tracking: Simultaneous tracking across physical, custodial, value, legal, and information dimensions
  4. Lifecycle Completeness: End-to-end management from creation through decommissioning
  5. Low-Friction Movement: Minimal transaction overhead for shared resource circulation

2. Multi-Dimensional Resource Flow Model

2.1 Five Transport Dimensions

2.1.1 Physical Dimension

  • Definition: Resource movement through space
  • Tracking: Location, environmental conditions, transport status
  • Data Sources: GPS, RFID, manual check-ins
  • Holochain Implementation: EconomicEvent with location metadata

2.1.2 Custodial Dimension

  • Definition: Resource changes hands/stewards
  • Tracking: Current custodian, custodial history, responsibility chains
  • Data Sources: PPR receipts, commitment fulfillment
  • Holochain Implementation: EconomicEvent with agent relationship links

2.1.3 Value Dimension

  • Definition: Resource's utility/purpose transforms
  • Tracking: Resource condition, value changes, usage patterns
  • Data Sources: Inspection reports, usage logs, performance metrics
  • Holochain Implementation: EconomicResource state updates with ResourceSpecification
  • Definition: Rights and responsibilities shift
  • Tracking: Access rights, usage permissions, compliance status
  • Data Sources: Smart contracts, governance rules, PPR compliance
  • Holochain Implementation: Commitment/claim validation with governance rules

2.1.5 Information Dimension

  • Definition: Data and metadata flows with the resource
  • Tracking: Documentation, history, provenance, maintenance records
  • Data Sources: Digital twins, blockchain entries, documentation
  • Holochain Implementation: Link-based information architecture using DHT

2.2 Non-Linear Flow Patterns

Traditional Supply Chain:
Producer → Distributor → Retailer → Consumer
     ↓          ↓           ↓         ↓
  Linear      Static     Point-to-Point   Endpoint

Resource Flow Network:
    Agent A ↔ Resource Hub ↔ Agent C
       ↕           ↕           ↕
    Resource    Resource    Resource
   Pool Alpha   Pool Beta   Pool Gamma
       ↕           ↕           ↕
    Agent B ↔ Resource Hub ↔ Agent D

Dynamic, Circular, Multi-path Resource Circulation

3. Protocol Architecture

3.1 Holochain Integration

3.1.1 DNA/Zome Distribution

  • zome_person: Agent identity, roles, custodial relationships
  • zome_resource: Resource specifications, lifecycle management
  • zome_gouvernance: PPR issuance, validation, governance rules

3.1.2 DHT Architecture Benefits

  • Agent-Centric Views: Each agent maintains their perspective of resource flows
  • Multi-Source Truth: No single point of failure, distributed validation
  • Cross-DNA Coordination: Multiple graphs in unified network
  • Privacy Preservation: Private entries with public validation capabilities

3.2 PPR Integration

3.2.1 Transport-Specific Receipts

3.2.1.1 Resource Creation & Validation

Generated Receipts (2 total):
1. Creator Agent: "successful resource contribution" receipt
2. Validator Agent: "network validation performed" receipt

3.2.1.2 Custody Transfer Events

Generated Receipts (2 total):
1. Outgoing Custodian: "responsible custody transfer" receipt
2. Incoming Custodian: "custody acceptance" receipt

3.2.1.3 Transport Service Events

Commitment Phase (2 receipts):
1. Transport Agent: "transport commitment accepted" receipt
2. Custodian Agent: "good faith transfer" receipt

Fulfillment Phase (2 receipts):
1. Transport Agent: "transport fulfillment completed" receipt
2. Resource Recipient: "custody acceptance" receipt

3.2.2 Role Chaining Support

  • Multi-role agents (transport + maintenance + storage credentials)
  • Action chaining (receive → transport → repair → transport → deliver)
  • Self-managed intermediate steps
  • Atomic transaction treatment

4. Protocol Operations

4.1 Resource Lifecycle Phases

4.1.1 Genesis Phase - Network Entry

  • Resource creation and validation
  • Initial PPR receipt generation
  • Resource specification registration
  • Commons pool assignment

4.1.2 Active Use Phase - Resource Circulation

  • Custody transfers between agents
  • Usage tracking and condition monitoring
  • Value exchange and compensation
  • Information flow maintenance

4.1.3 Service Phase - Maintenance & Enhancement

  • Maintenance service cycles
  • Repair and upgrade operations
  • Specialized service coordination
  • Quality assurance validation

4.1.4 End-of-Life Phase - Responsible Decommissioning

  • End-of-life declaration and validation
  • Multi-validator confirmation (2-3 experts)
  • Challenge period (7-14 days)
  • Final disposal or recycling

4.2 Low-Friction Design Patterns

4.2.1 Implicit Resource Validation

  • Resource validation implicit through agent validation
  • No separate validation receipts for standard transfers
  • PPR-based agent reliability assessment

4.2.2 Bi-directional Receipt Generation

  • Exactly 2 receipts per economic interaction
  • Mutual acknowledgment and responsibility
  • Cumulative reputation building

4.2.3 Good Faith Transfers

  • Resource transfer to service providers based on commitment
  • Minimal validation overhead for trusted agents
  • Atomic commitment/fulfillment cycles

5. Data Structures

5.1 Resource Flow Event

#![allow(unused)]
fn main() {
pub struct ResourceFlowEvent {
    // Core ValueFlows fields
    pub action: Action,
    pub resource: ResourceHash,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub has_point_in_time: Timestamp,
    pub has_duration: Option<Duration>,

    // Multi-dimensional tracking
    pub physical_location: Option<Location>,
    pub custodial_chain: Vec<AgentPubKey>,
    pub value_state: ResourceValueState,
    pub legal_context: LegalContext,
    pub information_flow: InformationFlow,

    // PPR integration
    pub participation_receipts: Vec<ReceiptHash>,
    pub commitment_fulfillment: Option<CommitmentHash>,
}
}

5.2 Resource Value State

#![allow(unused)]
fn main() {
pub struct ResourceValueState {
    pub condition: ResourceCondition,
    pub utilization_rate: f64,
    pub maintenance_status: MaintenanceStatus,
    pub current_valuation: Option<EconomicValue>,
    pub depreciation_factor: f64,
    pub usage_metrics: UsageMetrics,
}
}

5.3 Transport Path

#![allow(unused)]
fn main() {
pub struct TransportPath {
    pub resource: ResourceHash,
    pub journey_segments: Vec<JourneySegment>,
    pub current_status: TransportStatus,
    pub estimated_completion: Option<Timestamp>,
    pub risk_factors: Vec<RiskFactor>,
    pub environmental_conditions: Option<EnvironmentalData>,
}

pub struct JourneySegment {
    pub from_agent: AgentPubKey,
    pub to_agent: AgentPubKey,
    pub transport_method: TransportMethod,
    pub start_time: Timestamp,
    pub completion_time: Option<Timestamp>,
    pub conditions: SegmentConditions,
}
}

6. Security & Governance

6.1 Cryptographic Security

  • Bi-directional cryptographic signatures for all receipts
  • Private entries with public validation capabilities
  • Agent identity verification through Holochain's DHT
  • Tamper-evident audit trails

6.2 Governance Mechanisms

  • PPR-based reputation systems
  • Multi-validator consensus for critical operations
  • Challenge periods for disputed transactions
  • Role-based access control and credentials

6.3 Attack Vector Mitigation

  • End-of-life abuse prevention through multi-validator requirements
  • Resource monopolization detection through usage pattern analysis
  • Sybil attack resistance through agent validation
  • Double-spending prevention through commitment tracking

7. Performance & Scalability

7.1 Optimization Strategies

  • Implicit validation to reduce transaction overhead
  • Batch receipt generation for high-frequency operations
  • DHT sharding for large-scale resource networks
  • Caching strategies for frequently accessed resource states

7.2 Network Effects

  • Reputation-based network resilience
  • Trust propagation through PPR chains
  • Resource pool efficiency gains
  • Cross-pool resource circulation

8. Integration Points

8.1 ValueFlows Compliance

  • Standard EconomicEvent and EconomicResource structures
  • Action-based resource flow modeling
  • Commitment/fulfillment lifecycle management
  • Resource specification inheritance

8.2 External System Integration

  • IoT device data ingestion for physical tracking
  • ERP system integration for business process alignment
  • Payment system integration for value exchange
  • Regulatory reporting compliance

9. Use Cases & Applications

9.1 Tool Libraries & Makerspaces

  • Tool sharing and tracking across communities
  • Maintenance scheduling and responsibility allocation
  • Usage-based cost distribution
  • Skill-building through hands-on access

9.2 Transportation Pools

  • Vehicle sharing and fleet management
  • Maintenance scheduling and cost allocation
  • Route optimization and resource pooling
  • Environmental impact tracking

9.3 Equipment Rental & Sharing

  • Industrial equipment sharing networks
  • Condition monitoring and predictive maintenance
  • Insurance and liability management
  • Cross-organizational resource optimization

9.4 Digital Resource Commons

  • Software tool and service sharing
  • Digital infrastructure pooling
  • Knowledge and intellectual property commons
  • Collaborative development resources

10. Future Extensions

10.1 Advanced Features

  • AI-powered resource allocation optimization
  • Automated maintenance scheduling and predictive care
  • Smart contract integration for complex governance rules
  • Cross-chain interoperability with other distributed networks

10.2 Protocol Evolution

  • Resource type-specific extensions
  • Geographic region adaptations
  • Industry-specific compliance modules
  • Environmental impact tracking integration

11. Implementation Roadmap

Phase 1: Core Protocol (v0.1)

  • Basic multi-dimensional flow tracking
  • PPR integration for transport events
  • Holochain zome implementation
  • Basic governance rules

Phase 2: Advanced Features (v0.5)

  • Role chaining and service orchestration
  • Advanced reputation systems
  • External system integration APIs
  • Performance optimizations

Phase 3: Ecosystem Development (v1.0)

  • Cross-network interoperability
  • Advanced governance mechanisms
  • AI-assisted resource optimization
  • Industry-specific extensions

12. Conclusion

The Resource Transport/Flow Protocol represents a paradigm shift from static, ownership-based transfer protocols to dynamic, commons-based resource flow management. By leveraging Holochain's distributed architecture and PPR reputation systems, RTP-FP enables low-friction, multi-dimensional resource circulation that supports the emergence of sustainable sharing economies.

The protocol's emphasis on stewardship over ownership, combined with comprehensive lifecycle management and multi-agent coordination, provides the foundation for next-generation resource sharing networks that prioritize sustainability, accessibility, and collective benefit over individual accumulation.


This specification is a living document that will evolve through implementation experience and community feedback. Contributions and collaboration are welcomed to advance the protocol toward its vision of enabling truly sustainable and equitable resource sharing economies.

Versioning (Post-MVP)

Versioning in Nondominium is about variations of a Resource over time and across forks, and about expressing affiliations and evolutions of both:

  • Material resources (physical instances and their designs)
  • Digital resources (software, documents, CAD, manifests)
  • The Nondominium hApp itself, treated as a versioned Application Resource

This capability is explicitly post-MVP / future development. The first proof-of-concept will operate without full versioning semantics; these requirements describe how we want to extend the system later.

More on the OVN license: https://github.com/Sensorica/ovn-license/tree/v2.0
More on the OVN model: https://ovn.world/


1. Goals & Scope

  • G1 – Unified Versioning Model: Provide a single conceptual model that applies to:

    • Material resources (and their designs)
    • Digital resources (code, documentation, CAD, manifests)
    • The Nondominium hApp (application as a resource)
  • G2 – Affiliation & Evolution Graph: Represent resource evolution as a directed acyclic graph (DAG) of versions, including:

    • Linear evolution (v1 → v2 → v3)
    • Forks (branches)
    • Merges (reconciling branches)
    • Special relations (repair, augmentation, porting to a platform)
  • G3 – OVN-Compliant Contribution Propagation: Extend versioning beyond Git semantics to include:

    • Explicit tracking of who contributed to which version
    • Propagation of contribution value upstream in the version graph, in line with the OVN model and license.
  • G4 – Non-Breaking Addition: Implement versioning as an additional layer on top of existing:

    • EconomicResource / ResourceSpecification
    • Digital Resource Integrity manifests
    • Governance and PPR system

2. High-Level Requirements

2.1 Versioned Entity Model

  • R-VERS-01 – Base Identity vs Version Nodes
    The system shall distinguish between:

    • A base identity (“Versioned Entity”) that persists through its versions
    • Individual version nodes that represent specific states or variants
  • R-VERS-02 – Common Model for All Resource Types
    The same versioning model shall support:

    • Material resource instances (e.g. “CNC #42”)
    • Material resource designs (specifications, assemblies)
    • Digital resources (software releases, CAD, documents)
    • Application-level resources (Nondominium hApp itself)
  • R-VERS-03 – DAG of Versions
    The system shall represent versions as nodes in a DAG (no cycles), supporting:

    • Initial versions
    • EvolvedFrom (linear changes)
    • ForkedFrom (branches)
    • MergedFrom (multiple parents)
    • RepairedFrom, AugmentedFrom, PortedToPlatform, etc.

2.2 Material Resources

  • R-VERS-MAT-01 – Structural Changes as Versions
    For material resources, the system shall create new version nodes when there are structural or functional changes, such as:

    • Significant repairs
    • Augmentations (e.g. a stool to which one adds a backrest)
    • Upgrades (e.g. new motor, new controller)
  • R-VERS-MAT-02 – Simple Updates vs Versions
    Non-structural updates (quantity, location, temporary states) shall continue to use existing EconomicResourceUpdates and do not create new version nodes.

  • R-VERS-MAT-03 – Instance vs Design
    The system shall distinguish:

    • Versioning of the generic design (ResourceSpecification)
    • Versioning of a specific instance (EconomicResource) and must be able to link both graphs when appropriate.

2.3 Digital Resources

  • R-VERS-DIG-01 – Manifest-Backed Versions
    Each digital resource version shall be associated with a digital integrity manifest (Merkle root, chunk hashes, etc.) as specified in the Digital Resource Integrity requirements.

  • R-VERS-DIG-02 – Git Alignment (Optional)
    When a resource is developed in Git or a similar VCS, the versioning model shall be able to:

    • Store a reference to the Git commit/tag
    • Use Git semantics (branches, merges) as hints for version DAG construction
  • R-VERS-DIG-03 – Composite Digital Resources
    The system shall support composite digital resources whose versions depend on versions of sub-resources (libraries, modules, CAD sub-assemblies), aligning with the fractal/composable architecture.

2.4 Nondominium hApp as a Resource

  • R-VERS-APP-01 – Application as Versioned Entity
    The Nondominium hApp shall be modeled as a Versioned Entity of type “Application”, with:

    • A base identity (“Nondominium hApp”)
    • A set of ResourceVersion nodes representing releases (e.g. v1.0.0, v2.0.0-org).
  • R-VERS-APP-02 – Release Versioning
    Each release version of the hApp shall:

    • Reference its hApp manifest and/or DNA/Web hApp bundles
    • Have a semantic version label (e.g. v1.3.0-org)
    • Be linked via EvolvedFrom, ForkedFrom, etc. to previous versions
  • R-VERS-APP-03 – Forks & Flavors
    Forks of Nondominium (e.g. pure P2P vs ERP/Tiki-focused variants) shall:

    • Be created as new branches in the version DAG (or as new entities that ForkedFrom the original)
    • Maintain affiliation links required by the OVN license
  • R-VERS-APP-04 – Compatibility Metadata
    Application versions shall be able to describe:

    • Supported deployment contexts (Pure P2P, Organizational, Mixed)
    • Compatibility ranges for data formats and bridge protocols.

3. Version Graph & Affiliation Semantics

  • R-VERS-GRAPH-01 – Typed Relations
    The system shall support typed relations between versions, at minimum:

    • Initial
    • EvolvedFrom
    • ForkedFrom
    • MergedFrom
    • RepairedFrom
    • AugmentedFrom
    • PortedToPlatform (e.g. port to Tiki, ERP, other UI)
  • R-VERS-GRAPH-02 – Multiple Parents
    Version nodes shall support multiple parents (merge scenarios).

  • R-VERS-GRAPH-03 – Traversal
    The system shall allow:

    • Traversal from a version to its ancestors (provenance)
    • Traversal from a version to its descendants (evolution paths)
    • Extraction of full affiliation trees for OVN accounting.

4. Contribution Propagation (OVN Model)

  • R-VERS-OVN-01 – Version-Level Contributions
    The system shall be able to attach contribution records to specific versions, indicating:

    • Who contributed (Agent)
    • In what role (e.g. design, implementation, repair, integration, translation)
    • Links to relevant PPRs (Private Participation Receipts)
  • R-VERS-OVN-02 – Upstream Propagation
    OVN accounting processes shall be able to:

    • Walk the version graph upstream from a given version
    • Aggregate contribution information according to OVN rules
    • Respect the OVN license, ensuring appropriate recognition and value flow to previous contributors.
  • R-VERS-OVN-03 – License Integrity
    Versioning shall not allow “cutting off” affiliation; all forks and derived versions must retain:

    • Links to their ancestors
    • References to the OVN license and model.

5. Integration with Existing Nondominium Architecture

  • R-VERS-INT-01 – Non-Breaking Addition
    Versioning shall be implemented as an additional zome / module (e.g. zome_versioning) that:

    • References existing entries (EconomicResource, ResourceSpecification, manifests, etc.)
    • Does not change the core data model of existing zomes.
  • R-VERS-INT-02 – Event-Triggered Version Creation
    Certain EconomicEvents (e.g. repair, augmentation, major upgrade, new hApp release) shall be able to trigger:

    • Creation of a new version node
    • Linking to the corresponding process and PPRs.
  • R-VERS-INT-03 – ValueFlows Compatibility
    Version information shall:

    • Integrate cleanly with ValueFlows concepts (Resources, Events, Agents)
    • Respect the Knowledge / Plan / Observation layering.
  • R-VERS-INT-04 – Digital Resource Integrity Alignment
    For digital resources, versioning shall:

    • Reuse the manifest-based integrity model
    • Allow verification of specific versions through their manifests and Merkle roots.

6. UX & API Considerations (High-Level, Post-MVP)

  • R-VERS-UX-01 – Human-Friendly Version View
    Users shall be able to:

    • See a version history and fork graph for a given resource
    • Distinguish between minor updates and major forks.
  • R-VERS-UX-02 – Semantic Version Actions
    Beyond “update resource”, the UI/API shall support actions like:

    • “Declare new version (repair/augmentation)”
    • “Fork this resource / fork Nondominium”
    • “Merge branches” (where appropriate).
  • R-VERS-UX-03 – OVN-Aware Attribution View
    Users shall be able to:

    • Inspect who contributed to which versions
    • Understand how contributions propagate across forks and merges.

7. Post-MVP Status

  • These requirements are explicitly post-MVP and will be addressed after the first Nondominium proof-of-concept is complete.
  • Early implementation steps will likely focus on:
    • Treating the Nondominium hApp itself as a versioned Application Resource
    • Adding basic version tracking for key digital resources (code, manifests, critical designs)
    • Gradually extending to full material resource versioning and OVN-aware contribution propagation.

Nondominium itself is a Resource. People will be able to fork Nondominium to create versions that better match their use, within the constraints of the OVN license, and this versioning architecture is designed to make those forks explicit, accountable, and economically integrated.

ValueFlows DSL

Requirements Document for Nondominium

ProjectNondominium — ValueFlows-compliant Resource Sharing Holochain Application
OrganizationSensorica Open Value Network
AuthorsSacha Pignot (Soushi888), Tibi
StatusDraft — For Community Review
Version1.0 (2025-12-28)
Repositorygithub.com/sensorica/nondominium

Technical Specifications: See ValueFlows DSL Technical Specifications for implementation details, syntax specifications, and technical architecture.


Table of Contents

  1. Executive Summary
  2. Background and Context
  3. Goals and Objectives
  4. Target Users
  5. Use Cases
  6. Functional Requirements
  7. Non-Functional Requirements
  8. Technical Constraints
  9. Proposed Syntax Examples
  10. Implementation Roadmap
  11. Success Criteria
  12. Open Questions
  13. References

1. Executive Summary

This document specifies the requirements for a Domain-Specific Language (DSL) designed to express ValueFlows economic patterns within the Nondominium ecosystem. The DSL aims to provide power users, network administrators, and developers with a concise, human-readable scripting language for bootstrapping networks, bulk resource registration, process recipe definition, and automated economic coordination.

Nondominium is a ValueFlows-compliant Holochain application implementing distributed, agent-centric resource management with embedded governance. While a graphical user interface serves daily operations, complex administrative tasks—such as initializing a new commons network with dozens of resources, members, and governance rules—benefit significantly from a scriptable approach.

The proposed DSL bridges the gap between the formal ValueFlows ontology and practical operational needs, enabling reproducible configurations, version-controlled economic definitions, and automated workflows that would be tedious or error-prone through manual GUI interaction.


2. Background and Context

2.1 ValueFlows Overview

ValueFlows is an open vocabulary for distributed economic networks, built upon the Resource-Event-Agent (REA) accounting ontology. It provides a standardized way to describe economic activity across organizational boundaries, enabling coordination between agents who may use different software systems.

Core ValueFlows concepts include:

  • Agents — Persons, organizations, or ecological agents that perform economic activities
  • Resources — Economic resources tracked by specification (type) and optionally as inventoried instances
  • Events — Observed economic activities: produce, consume, use, transfer, modify, move, etc.
  • Processes — Transformations that take resource inputs and produce outputs
  • Commitments — Promised future economic events
  • Intents — Desired economic events not yet committed (offers and requests)
  • Recipes — Templates defining how processes transform inputs to outputs

2.2 Nondominium Architecture

Nondominium implements ValueFlows on Holochain through a three-zome architecture:

  • zome_person — Agent identity, profiles, roles, and capability-based access control
  • zome_resource — Resource specifications, economic resources, and lifecycle management
  • zome_gouvernance — State transition operator that evaluates governance rules and validates changes

This governance-as-operator design separates data management from business logic enforcement, allowing governance rules to be modified without changing resource data structures. The DSL must respect this separation while providing a unified scripting experience.

2.3 Problem Statement

Current limitations that the DSL addresses:

  • Manual repetition — Registering many resources or agents requires repetitive GUI interactions
  • No reproducibility — Network configurations cannot be version-controlled or replicated
  • Steep learning curve — Understanding ValueFlows requires navigating verbose JSON-LD or GraphQL structures
  • No automation — Recurring administrative tasks cannot be scripted
  • Testing complexity — Creating realistic test environments requires manual setup

3. Goals and Objectives

3.1 Primary Goals

  • Accessibility — Lower the barrier to working with ValueFlows patterns through readable, intuitive syntax
  • Efficiency — Enable bulk operations that would be impractical through GUI interaction
  • Reproducibility — Allow network configurations to be version-controlled, shared, and replicated
  • Correctness — Provide compile-time validation of economic logic before execution
  • Integration — Seamlessly compile to Nondominium's hREA zome calls

3.2 Secondary Goals

  • Contribution to ValueFlows ecosystem — Design the DSL to potentially benefit other ValueFlows implementations
  • Educational value — Help users understand ValueFlows concepts through practical usage
  • Extensibility — Support future additions to the ValueFlows vocabulary and Nondominium features

4. Target Users

4.1 Primary Users

Network Administrators — Individuals responsible for setting up and maintaining Nondominium networks for their organizations or communities. They need to:

  • Bootstrap new networks with initial agents, resources, and governance rules
  • Migrate existing data from legacy systems
  • Perform bulk updates across many resources
  • Define and update governance rules systematically

Developers — Technical contributors building on or extending Nondominium. They need to:

  • Create reproducible test environments
  • Script integration tests with realistic data
  • Generate demonstration scenarios
  • Debug issues by examining DSL-generated state

4.2 Secondary Users

Power Users — Technically inclined community members who prefer scripting over GUI interaction for:

  • Batch resource registration (e.g., cataloging an entire workshop)
  • Defining complex process recipes
  • Automating recurring administrative tasks

Other ValueFlows Implementers — Projects building ValueFlows-based systems who may adopt or adapt the DSL for their own use cases.


5. Use Cases

5.1 Network Bootstrapping

Scenario: A new fabrication commons wants to launch their Nondominium network with initial configuration.

Requirements:

  • Define the organization and founding members
  • Register resource specifications (equipment types, material categories)
  • Create initial inventory of resources
  • Establish governance rules for resource access and transfer
  • Set up standard process recipes for common workflows

5.2 Bulk Resource Registration

Scenario: An existing workshop joins the network and needs to register all their equipment.

Requirements:

  • Import from CSV or structured data sources
  • Apply common properties to groups of resources
  • Generate unique identifiers systematically
  • Validate data consistency before committing

5.3 Process Recipe Definition

Scenario: The network documents standard manufacturing processes for replication and planning.

Requirements:

  • Define input resources (consumed, used, cited)
  • Define output resources (produced)
  • Specify work requirements by skill type
  • Indicate process stages and dependencies
  • Support recipe scaling (multiplying quantities)

5.4 Governance Rule Configuration

Scenario: Administrators define access policies, booking limits, and approval workflows.

Requirements:

  • Define rules that apply to resource categories
  • Specify conditions, thresholds, and approvers
  • Update rules without affecting resource data
  • Validate rule consistency and coverage

5.5 Migration and Export

Scenario: Data moves between systems or needs backup/restore capability.

Requirements:

  • Export current network state as DSL scripts
  • Diff two states to generate migration scripts
  • Import from other ValueFlows implementations
  • Generate JSON-LD or GraphQL representations

6. Functional Requirements

6.1 Language Primitives

The DSL must support the following ValueFlows concepts as first-class language constructs:

6.1.1 Agents

  • Person agents with profile information
  • Organization agents (formal and informal)
  • Role assignments within organizations
  • Agent relationships (member-of, works-for, etc.)

6.1.2 Resources

  • Resource specifications (types/kinds)
  • Economic resources (inventoried instances)
  • Resource classifications (taxonomies)
  • Units of measure
  • Lot and serial number tracking

6.1.3 Flows

  • Intents (offers and requests)
  • Commitments (promises)
  • Economic events (observations)
  • Claims (reciprocal expectations)

6.1.4 Actions

All standard ValueFlows actions must be supported:

  • Process actions: produce, consume, use, cite, work, deliverService, modify
  • Transfer actions: transfer, transferAllRights, transferCustody
  • Movement actions: move, pickup, dropoff
  • Combination actions: combine, separate
  • Adjustment actions: raise, lower, copy

6.1.5 Processes and Recipes

  • Process specifications (types)
  • Process instances
  • Recipe definitions with input/output flows
  • Stage tracking for multi-step workflows

6.1.6 Governance (Nondominium-specific)

  • Access rules for resource types
  • Approval workflows
  • Booking and usage limits
  • Private Participation Receipts (PPR) configuration

6.2 Operations

6.2.1 CRUD Operations

  • Create new entities
  • Read/query existing entities
  • Update entity properties
  • Delete/archive entities

6.2.2 Bulk Operations

  • Create multiple entities from templates
  • Update entities matching criteria
  • Import from external data sources
  • Export to various formats

6.2.3 Validation

The DSL must provide comprehensive validation across multiple dimensions:

  • Syntax validation — Grammar compliance and structure checking
  • Type checking — Unit compatibility, resource specification matching
  • Reference integrity — Agent and resource existence verification
  • Economic logic — Process balance, valid action sequences
  • Governance compliance — Rule coverage, conflict detection

See technical specifications for detailed validation pipeline architecture.

6.3 CLI Interface

CommandDescription
nondom apply <script.vf>Execute a DSL script against the network
nondom validate <script.vf>Validate syntax and semantics without executing
nondom apply --dry-run <script.vf>Show what would change without applying
nondom export --format vfExport current state as DSL script
nondom import <file> --mapping <map.vf>Import from external format using mapping
nondom replInteractive shell for exploratory scripting

7. Non-Functional Requirements

7.1 Usability

  • Syntax should be readable by non-programmers familiar with ValueFlows concepts
  • Error messages must reference source locations and suggest corrections
  • Documentation with examples for all major use cases
  • Syntax highlighting support for common editors (VS Code, Vim, Emacs)

7.2 Performance

Target Performance Metrics:

OperationTargetNotes
Parse 1000 entities< 1 secondScript size
Validate typical script< 2 secondsAll validation phases
Create 100 resources< 10 secondsExcluding DHT latency
Export 1000 entities< 5 secondsTo DSL format
Bulk update 100 resources< 5 secondsWith where clause

Scalability:

  • Support scripts with 1000+ entity definitions
  • Memory usage < 100MB for typical operations
  • Batch operations optimize Holochain network calls

See technical specifications for detailed optimization strategies.

7.3 Reliability

  • Atomic execution — All-or-nothing application of changes
  • Idempotent operations — Repeated executions produce consistent results
  • Clear rollback semantics — Graceful failure recovery
  • No data corruption — Crash-safe operations

7.4 Extensibility

  • Support for custom attributes beyond core ValueFlows
  • Plugin architecture for additional compilation targets
  • Versioned language specification for backward compatibility

7.5 Security

The DSL must provide:

  • Agent authentication — Scripts execute with authenticated agent's permissions
  • Capability-based access control — All operations validated against capability tokens
  • Data privacy — Sensitive data handling respects Nondominium's privacy model
  • Audit logging — Comprehensive logging of all operations
  • Declarative-only execution — No arbitrary code execution or system access
  • Rate limiting — Abuse prevention for bulk operations

See technical specifications for detailed security model.


8. Technical Constraints

8.1 Technology Stack

  • Implementation language: Rust (to align with Nondominium's existing codebase)
  • Parser: pest or nom parser combinators
  • Primary target: Nondominium hREA zome calls
  • Secondary targets: JSON-LD export, GraphQL mutations, visualization

8.2 ValueFlows Compliance

  • DSL concepts must map cleanly to ValueFlows vocabulary
  • Terminology should align with ValueFlows documentation
  • Export to standard ValueFlows JSON-LD must be lossless

8.3 Holochain Integration

  • Respect Holochain's agent-centric security model
  • Work within DHT consistency constraints
  • Support capability-based access control

9. Proposed Syntax Examples

The following examples illustrate the proposed DSL syntax. Final syntax will be refined during implementation.

9.1 Network Bootstrap

# Network initialization script
network FabLabMontreal {
  created: 2025-01-15
  jurisdiction: Quebec
}

agents {
  organization Sensorica {
    type: OpenValueNetwork
    location: Montreal
  }

  person Alice { roles: [Founder, Steward] }
  person Bob { roles: [Technician, Member] }
}

9.2 Resource Registration

resource_specifications {
  Equipment {
    governance: commons_stewardship
    accounting: use_tracking
  }
  Material {
    governance: pool_contribution
    accounting: quantity_consumed
  }
}

resources {
  CNC_Router : Equipment {
    custodian: Sensorica
    location: "Main workshop"
    value_estimate: 15000 CAD
  }

  PLA_Filament : Material {
    quantity: 50 kg
    pool: shared_consumables
  }
}

9.3 Process Recipe

recipe MachinePart {
  inputs:
    Aluminum_Stock 0.5kg (consume)
    CNC_Machine 2h (use)

  work:
    Fabrication 2h

  outputs:
    Machined_Part 1 (produce)
}

9.4 Governance Rules

governance {
  rule EquipmentBooking {
    applies_to: Equipment
    max_advance_booking: 14 days
    requires_approval_above: 8h
    approvers: [Steward, Technician]
  }
}

9.5 Economic Events

# Recording actual events
event production_001 {
  action: produce
  provider: Alice
  output: Machined_Part
  quantity: 10
  at: 2025-01-20T14:30:00
}

# Fulfilling a commitment
fulfill order_123 {
  performed_by: Bob
  resource: Machined_Part
  quantity: 10
  to: Customer
}

9.6 Bulk Operations

# Register multiple similar resources
resources {
  3D_Printer_Fleet : Equipment * 5 {
    custodian: Sensorica
    model: "Prusa MK4"
    location: "Print farm"
    # Creates: 3D_Printer_Fleet_1 through 3D_Printer_Fleet_5
  }
}

# Update matching resources
update resources where type == Equipment {
  maintenance_schedule: monthly
}

See technical specifications for additional syntax examples and edge cases.


10. Implementation Roadmap

Phase 1: Core Language (MVP)

Duration: 4-6 weeks

  1. Parser implementation for core constructs
  2. Agent and resource registration
  3. Basic validation (syntax, types)
  4. CLI with apply and validate commands
  5. Compilation to Nondominium zome calls

Deliverables: Working DSL for basic agent and resource definitions

Phase 2: Completeness

Duration: 4-6 weeks

  1. Full ValueFlows action support
  2. Process and recipe definitions
  3. Governance rule configuration
  4. Import/export functionality
  5. Dry-run and diff capabilities

Deliverables: Complete DSL covering all major use cases

Phase 3: Tooling

Duration: 3-4 weeks

  1. Language server protocol (LSP) implementation
  2. VS Code extension
  3. REPL for interactive exploration
  4. Documentation and tutorial content

Deliverables: Developer-friendly tooling ecosystem

Phase 4: Ecosystem

Duration: Ongoing

  1. Additional compilation targets (GraphQL, visualization)
  2. Community feedback integration
  3. Coordination with ValueFlows community
  4. Template library for common patterns

Deliverables: Sustainable community-driven development


11. Success Criteria

11.1 Measurable Success Metrics

CriterionMeasurable TargetVerification Method
Network BootstrappingBootstrap 100-agent network in < 5 minutesTime full bootstrap script execution
Bulk RegistrationRegister 100 resources in < 10 secondsBenchmark bulk resource creation
Script ReviewabilityComprehend 200-line script in < 5 minutesUser testing with experienced administrators
Error ResolutionFix common errors in < 2 minutes using error messagesMeasure time-to-fix for typical errors
External Adoption2+ organizations using DSL in production by Q2 2026Track adoption through GitHub issues and community
Community Feedback80%+ positive sentiment on ValueFlows design alignmentSurvey ValueFlows community members
Parse PerformanceParse 1000-entity script in < 1 secondAutomated performance benchmarking
Validation Accuracy< 1% false positive rate in validation errorsTest suite with valid and invalid scripts
Documentation Coverage100% of language constructs documentedAutomated documentation completeness check
Test Coverage> 90% code coverage for DSL compilerAutomated test coverage reporting

11.2 User Acceptance Criteria

Network Administrators:

  • Can create bootstrap script without programming background
  • Successfully complete initial network setup in < 30 minutes
  • Understand error messages and fix issues independently
  • Export/import network state for backup purposes
  • Define governance rules using DSL syntax

Developers:

  • Create reproducible test environments with < 50 line scripts
  • Generate 100+ test resources in < 30 seconds
  • Debug issues using DSL-generated state exports
  • Integrate DSL into CI/CD pipelines
  • Extend DSL with custom attributes when needed

Power Users:

  • Register equipment inventory using bulk operations
  • Define complex process recipes for manufacturing
  • Automate recurring administrative tasks
  • Share scripts with community for reuse
  • Contribute governance rule templates

11.3 Technical Validation Criteria

Correctness:

  • All ValueFlows actions supported and tested
  • Economic logic validation prevents invalid states
  • Governance rules enforce correctly
  • Round-trip export/import preserves data 100%

Performance:

  • Parse 1000 entities in < 1 second
  • Validate typical script in < 2 seconds
  • Execute 100-entity script in < 30 seconds (excluding DHT)
  • Memory usage < 100MB for typical operations

Reliability:

  • Atomic transactions succeed or roll back completely
  • Idempotent operations produce consistent results
  • Error recovery gracefully handles failures
  • No data corruption in crash scenarios

Usability:

  • Error messages include line numbers and suggestions
  • Syntax highlighting available for VS Code, Vim, Emacs
  • Tutorial covers all common use cases
  • Example scripts for all major patterns
  • CLI help provides clear usage guidance

11.4 Ecosystem Integration Criteria

ValueFlows Alignment:

  • Terminology matches ValueFlows specification
  • Export to JSON-LD is lossless
  • Community review validates design approach
  • Contribution guidelines for upstream inclusion

Nondominium Integration:

  • Compiles to correct hREA zome calls
  • Respects capability-based access control
  • Works with existing GUI-created data
  • Governance rules integrate with zome_gouvernance

12. Open Questions

QuestionStatusResolution / Considerations
File extension⏳ OpenOptions: .vf (recommended), .nondom, .valueflows — Community feedback requested
Scripting capabilitiesRESOLVEDThree-tier progressive model (see technical specs) — MVP is declarative, T2 adds templates, T3 adds scripting
Temporal expressions⏳ OpenConsider ISO 8601 durations, cron-like schedules, natural language — Needs UX research
Module system⏳ Openinclude directive shown in examples, but dependency resolution TBD — Circular dependency prevention needed
Governance scopeRESOLVEDTightly integrated (see technical specs Section 3) — Full DSL syntax for governance rules with testing

12.1 Decision Log

Resolved: Scripting Capabilities (2025-01-15)

  • Decision: Three-tier progressive language model
  • Rationale: Allows MVP to remain simple while providing upgrade path
  • Impact: Most users only need Tier 1; Tier 3 can be added based on demand
  • Reference: Technical Specifications, Section 1.1

Resolved: Governance Scope (2025-01-15)

  • Decision: Governance rules are first-class DSL constructs
  • Rationale: Enables version-controlled, testable governance policies
  • Impact: Unified scripting experience for data and rules
  • Reference: Technical Specifications, Section 3

12.2 Questions Requiring Community Input

File Extension:

  • Proposed: .vf (short, memorable, indicates ValueFlows)
  • Alternatives: .nondom (project-specific), .valueflows (explicit but long)
  • Decision Target: Q1 2026, after MVP prototype testing

Temporal Expressions:

  • Use Cases: Booking durations, maintenance schedules, temporal governance rules
  • Options:
    1. ISO 8601: P1H (1 hour), P30M (30 minutes)
    2. Natural: 1h, 30min, 2days
    3. Cron: 0 9 * * 1-5 (9am weekdays)
  • Research Needed: User testing for readability and ease of use

Module System Design:

  • Requirements:
    • Import scripts by path
    • Circular dependency detection
    • Namespace isolation
    • Re-exports for library scripts
  • Open Issues: How to handle version mismatches between imported scripts?

13. References

  • ValueFlows Specification: https://www.valueflo.ws/
  • Nondominium Repository: https://github.com/sensorica/nondominium
  • hREA Project: https://github.com/h-REA/hREA
  • REA Ontology: https://wiki.p2pfoundation.net/Resource-Event-Agent_Model
  • Holochain Documentation: https://developer.holochain.org/
  • Technical Specifications: ValueFlows DSL Technical Specifications

Appendix A: ValueFlows Action Reference

ActionEffect on ResourceTypical Use
produceIncrements quantityManufacturing output
consumeDecrements quantityRaw material input
useNo quantity changeEquipment usage
citeNo quantity changeReference designs/docs
workN/A (effort)Labor contribution
deliverServiceN/A (service)Service delivery
modifyChanges propertiesRepair, upgrade
transferChanges custody + rightsFull ownership transfer
transferAllRightsChanges rights onlySell without delivery
transferCustodyChanges custody onlyLend, consign
moveChanges locationTransportation
pickupStart custody transferReceive shipment
dropoffComplete custody transferDeliver shipment
combineCreates containerPackaging, kitting
separateSplits containerUnpacking
raiseIncrements (adjustment)Inventory correction up
lowerDecrements (adjustment)Inventory correction down
copyCreates duplicateDigital resources

Appendix B: Glossary

TermDefinition
AgentA person, organization, or ecological entity that can participate in economic activity
CommitmentA promise to perform an economic event in the future
DHTDistributed Hash Table — Holochain's data storage mechanism
Economic EventAn observed change in resources or resource rights
Economic ResourceSomething of value that can be tracked and accounted for
hREAHolochain implementation of the REA accounting model
IntentA desired economic event that has not yet been committed to
PPRPrivate Participation Receipt — Nondominium's reputation tracking mechanism
ProcessA transformation that takes inputs and produces outputs
RecipeA template defining a repeatable process
REAResource-Event-Agent — An accounting ontology
Resource SpecificationA type or kind of resource (not an instance)
ValueFlowsA vocabulary for distributed economic coordination
ZomeA module in a Holochain application

Lobby DNA: Multi-Network Federation Requirements

Status: Post-MVP Design Document Created: 2026-04-14 Authors: Nondominium project Relates to: ndo_prima_materia.md, flowsta-integration.md, unyt-integration.md, many-to-many-flows.md, ../requirements.md §2.3


Table of Contents

  1. Purpose and scope
  2. Background: the multi-network problem
  3. Architecture overview
  4. Lobby DNA requirements
  5. Group DNA requirements
  6. NDO DNA extension requirements
  7. Cross-cutting requirements
  8. Governance layers
  9. Integration requirements
  10. Current state vs planned enforcement

1. Purpose and scope

This document specifies requirements for the Lobby DNA layer: the multi-network federation infrastructure that allows Nondominium agents to discover, join, coordinate around, and compose multiple independent NDO networks (each its own DHT) through a unified entry point.

It defines three new DNA-level components and one extension to the existing NDO DNA:

  1. Lobby DNA (zome_lobby): public registry for agents and NDO descriptors.
  2. Group DNA (zome_group): per-group coordination space (invite-only, per-DHT).
  3. NDO DNA extensions: new entry types in zome_gouvernance for hard links, contributions, and smart agreements.

This document is the normative requirements anchor. The companion architecture specification lives in documentation/specifications/post-mvp/lobby-architecture.md.


2. Background: the multi-network problem

The MVP NDO hApp operates as a single DHT: all agents, resources, and governance events share one network. As OVN (Open Value Network) communities grow, several problems emerge:

  • An agent participating in multiple OVN communities (Sensorica, Open Source Ecology, etc.) must manage separate identities and has no unified workspace for coordinating across them.
  • A Project NDO (e.g. an electronic device) needs to formally incorporate component NDOs (power supply, enclosure) in a way that is intrinsic to the DHT and OVN-license compliant.
  • Communities need discovery mechanisms that are not a public free-for-all (spam risk) but also not so private that new agents cannot find communities to join.
  • Work done at the group coordination level (informal logs) must have a clear pathway to becoming a validated Contribution recorded on the NDO DHT.

These gaps are addressed by the Lobby DNA layer defined in this document.


3. Architecture overview

Three-layer DHT model

Lobby DHT (public registry, canonical network_seed)
  |
  |-- Group DHTs (per-group, invite-only, one DHT per group)
  |     |-- Work logs, soft links, membership
  |
  |-- NDO DHTs (per-NDO, constitutional, one DHT per NDO)
        |-- Resources, events, contributions, hard links, smart agreements

Governance hierarchy (strictly ordered)

NDO governance (constitution, supersedes all)
  |
Group governance (coordination, agents only)
  |
Lobby (no governance, permissionless registry)

Soft links live in the Group DHT:

  • Created by any group member, permissionless
  • Invisible to the target NDO
  • Represent planning and coordination intent
  • Subject only to group governance

Hard links (NdoHardLink) live in the NDO DHT:

  • Created only on validated EconomicEvent Fulfillment
  • Require Accountable Agent authorization
  • Represent structural reality (what has actually been incorporated)
  • Intrinsic to the NDO, OVN-license compliant
  • Immutable and permanent

Agent identity layers

One physical agent produces multiple pubkeys across DHT layers. The Lobby, Group, and NDO layers each hold a distinct identity record for the same person:

  • LobbyAgentProfile (Lobby DHT) — ecosystem-wide public handle. One per agent, never modified by NDO joins. Stable cross-community identity anchor.
  • Person (NDO DHT, zome_person) — constitutional identity within one specific NDO. A fresh AgentPubKey is created per NDO join; the Person entry records roles, PPRs, and private data for that community.
  • GroupMembership.ndo_pubkey_map (Group DHT) — the MVP bridge linking lobby_pubkey to the per-NDO pubkeys, enabling cross-DHT identity resolution without Flowsta. Post-MVP, Flowsta IsSamePersonEntry supersedes this (REQ-LOBBY-INT-01).

For the full identity-layer diagram and implementer guidance, see documentation/specifications/post-mvp/lobby-architecture.md §2 "Agent identity layers".

Groups vs organization-NDOs

Groups and organization-NDOs are distinct concepts that must not be conflated:

  • A Group (Lobby layer) is a coordination space for agents. It has no NondominiumIdentity, no Layer 0 lifecycle, no PPRs, and cannot hold resource custody. It governs agents only: membership, work logs, and soft links.
  • An organization-NDO (NDO layer) is a NondominiumIdentity representing a collective entity. It has its own lifecycle, Agreement, AccountableAgents, and can accumulate Contributions and reputation. Post-MVP it can hold resource custody (AgentContext, REQ-AGENT-02).
  • A group typically creates and coordinates around an organization-NDO but does not become it. The two are always separate entities at separate DHT layers.
  • An agent does not need to be in a group to contribute to an organization-NDO. Group membership governs group-layer coordination only; NDO participation is governed by the NDO's own rules.

For the comparative table and worked example, see documentation/specifications/post-mvp/lobby-architecture.md §2 "Groups vs organization-NDOs".


4. Lobby DNA Requirements

4.1 Agent profile

  • REQ-LOBBY-01: Any agent may register a public LobbyAgentProfile in the Lobby DHT containing a handle, optional avatar, and optional bio. Registration is permissionless.
  • REQ-LOBBY-02: An agent may update only their own profile. Profiles cannot be deleted (permanent identity anchors in the Lobby DHT).
  • REQ-LOBBY-03: Agent profiles are discoverable via a global anchor (Path("lobby.agents")).

4.2 NDO descriptor registry

  • REQ-LOBBY-04: Any agent may register an NdoDescriptor entry in the Lobby DHT for an NDO they initiated. The descriptor contains: NDO name, DnaHash, network_seed, Layer 0 identity hash, lifecycle_stage, property_regime, resource_nature, and description.
  • REQ-LOBBY-05: Only the registrant may update a descriptor. Descriptors cannot be deleted (mirroring the permanent nature of NondominiumIdentity in the NDO DHT).
  • REQ-LOBBY-06: The only mutable field on a descriptor after registration is lifecycle_stage, which mirrors transitions on the NDO's NondominiumIdentity.
  • REQ-LOBBY-07: Descriptors are discoverable via global anchors and categorization paths by lifecycle stage, resource nature, and property regime.
  • REQ-LOBBY-08: Anti-spam: registration requires a valid DnaHash referencing an actual NDO cell. Ghost registrations (no deployed DNA) are detectable by peers who attempt to connect and find no DHT.

4.3 Discovery model

  • REQ-LOBBY-09: NDO descriptors are publicly discoverable in the Lobby DHT without any group membership or invitation.
  • REQ-LOBBY-10: Groups are NOT publicly discoverable. Group membership is invite-only. Agents discover groups through personal connections and out-of-band invite codes.
  • REQ-LOBBY-11: Canonical Lobby network seed ("nondominium-lobby-v1") is hardcoded in the hApp bundle to ensure all deployments share one global registry.

5. Group DNA Requirements

5.1 Group structure

  • REQ-GROUP-01: Each Group occupies its own DHT, instantiated with a unique network seed (the invite code or a random seed on creation). This provides natural isolation and makes group creation computationally non-trivial (anti-spam).
  • REQ-GROUP-02: On first launch, an agent's conductor automatically creates a "group-of-one" personal workspace. This solo group can later expand to accommodate new members without any structural migration.
  • REQ-GROUP-03: Groups are flat: no recursive group nesting, no groups of groups. The Lobby is the only shared coordination layer above groups.
  • REQ-GROUP-04: A GroupDescriptor entry is created by the founding agent (progenitor) and is immutable after creation.

5.2 Membership

  • REQ-GROUP-05: Group membership is invite-only. Joining requires a valid invite code (or, when running inside Moss, the Moss invite system).
  • REQ-GROUP-06: A GroupMembership entry records the joining agent's Group DHT pubkey and their per-NDO pubkey map (Vec<NdoPubkeyEntry>), following the Moss AppletToJoinedAgent identity pattern.
  • REQ-GROUP-07: An agent may update their ndo_pubkey_map after joining a new NDO DHT (i.e. after installing a new NDO clone cell). This is the MVP cross-DHT identity bridge.
  • REQ-GROUP-08: Group members can look up the NDO-DHT pubkey of any other group member for a given NDO, enabling cross-DHT agent resolution without Flowsta (MVP).

5.3 Work logs

  • REQ-GROUP-09: Any group member may create a WorkLog entry referencing an NDO, a process context, a description, and optional effort hours. Work logs are informal and pre-contribution; they are invisible to the NDO.
  • REQ-GROUP-10: Work logs serve as the group-level input to the contribution validation pipeline: an AccountableAgent of the NDO reviews the work log and, if accepted, promotes it to a Contribution entry on the NDO DHT.
  • REQ-GROUP-11: Any group member may create a SoftLink entry pointing to any NDO, without requiring that NDO's permission. Soft links are invisible to the target NDO.
  • REQ-GROUP-12: A soft link has one of three purposes: Incorporation (planning to structurally incorporate the target NDO into a parent NDO), Use (using the NDO as a tool or equipment), or Monitoring (observing the NDO lifecycle). These map to VfAction values Combine | Use | Cite respectively (see architecture spec SoftLink.planned_action).
  • REQ-GROUP-13: A soft link may optionally reference a Commitment action hash in the target NDO's DHT, associating the planning intent with a formal economic commitment.
  • REQ-GROUP-14: When an Incorporation soft link's associated Commitment is fulfilled (i.e. a hard link is created on the NDO DHT), the group deletes the soft link and displays it as "promoted" in the UI.
  • REQ-GROUP-15: Only the link creator or the group progenitor may delete a soft link.

5.5 Group governance

  • REQ-GROUP-16: Groups have their own governance rules, stored as GroupGovernanceRule entries. MVP: governance rules are flat string key-value pairs.
  • REQ-GROUP-17: Group governance governs group-internal concerns only: membership, coordination norms, and soft link management. Group governance does NOT govern contributions, benefit distribution, or smart agreements (these belong to NDO governance).
  • REQ-GROUP-18: NDO governance supersedes group governance. If an NDO's governance rules conflict with a group's rules, the NDO rules take precedence for any action on that NDO.

6. NDO DNA Extension Requirements

  • REQ-NDO-EXT-01: The NDO DNA (zome_gouvernance) shall support a NdoHardLink entry type representing a permanent, validated structural relationship between two NDOs.
  • REQ-NDO-EXT-02: A NdoHardLink may only be created by an agent holding the AccountableAgent or PrimaryAccountableAgent role in the originating NDO.
  • REQ-NDO-EXT-03: Every NdoHardLink must reference a valid EconomicEvent fulfillment hash in the originating NDO's DHT. This fulfillment is the cryptographic proof that the incorporation actually occurred.
  • REQ-NDO-EXT-04: NdoHardLink entries are immutable: no updates or deletions are permitted after creation. Hard links represent permanent historical reality (OVN license requirement).
  • REQ-NDO-EXT-05: Three NdoLinkType values are supported: Component (target is a structural component of the source), DerivedFrom (source was forked/adapted from target), Supersedes (source replaces target in the network).
  • REQ-NDO-EXT-06: Hard links are publicly discoverable on the NDO DHT via NdoToHardLinks anchor links and filterable by type.

NdoHardLink uses the same struct in both stages. No breaking change occurs between Stage 2 and Stage 3. The fields to_ndo_dna_hash: DnaHash and to_ndo_identity_hash: ActionHash change only in value, not in meaning:

Stage 2 (pre-Lobby DNA, clone_limit: 0): Both the source and target NDOs live in the same nondominium cell. to_ndo_dna_hash equals the shared nondominium DNA hash. to_ndo_identity_hash is the target NDO's NondominiumIdentity action hash. Resolving the link requires no cross-cell call — both hashes are local to the same DHT.

Stage 3 (post-Lobby DNA, clone_limit: 1024): Each NDO has its own cloned cell with a unique DnaHash (because each clone has a unique network_seed). to_ndo_dna_hash is the target NDO cell's unique hash. The UI resolves the link by connecting to CellId(to_ndo_dna_hash, agent_pubkey) and calling get_ndo(to_ndo_identity_hash). The Lobby's NdoDescriptor provides a human-readable index but is not required for resolution.

See documentation/specifications/post-mvp/lobby-architecture.md §6.1 for the full entry struct and §7.1 for the incorporation pipeline.

6.2 Contributions

  • REQ-NDO-EXT-07: The NDO DNA shall support a Contribution entry type representing a peer-validated record of work done on the NDO.
  • REQ-NDO-EXT-08: A Contribution is created by any agent but must be validated by at least one AccountableAgent of the NDO. The validated_by field records all validating agents.
  • REQ-NDO-EXT-09: A Contribution may optionally reference a WorkLog entry in a Group DHT (stored as DnaHash + ActionHash) for audit purposes. This reference is not validated on-chain (cross-DHT references are informational only).
  • REQ-NDO-EXT-10: When a work log is validated as a Contribution, the contributing agent's pubkey is discoverable via AgentToContributions links, making them appear in the NDO's contributor list.
  • REQ-NDO-EXT-11: A Contribution may optionally reference an EconomicEvent fulfillment hash when the work resulted in a structural change (i.e. hard link creation).

6.3 Smart agreements

Entry type name: Agreement (aligned with VF vocabulary vf:Agreement); referred to as "smart agreements" in this document to emphasise their benefit-distribution role.

  • REQ-NDO-EXT-12: The NDO DNA shall support an Agreement entry type defining benefit distribution rules for the NDO. Smart agreements are created and updated only by agents holding the AccountableAgent role.
  • REQ-NDO-EXT-13: A Agreement contains a list of BenefitClause entries, each specifying a beneficiary (agent or component NDO), a share percentage, and a benefit type (Monetary, GovernanceWeight, or AccessRight).
  • REQ-NDO-EXT-14: Smart agreements are versioned. Each update creates a new entry linked to the previous via AgreementUpdates. The full version history is preserved for audit purposes.
  • REQ-NDO-EXT-15: When a NdoHardLink of type Component is created, the originating NDO's smart agreement should be updated to include a cascade benefit rule to the component NDO, implementing the OVN license benefit cascade. (Automated post-MVP via Unyt; manual in MVP.)
  • REQ-NDO-EXT-16: BeneficiaryRef supports both Agent(AgentPubKey) and NdoComponent { ndo_dna_hash, ndo_identity_hash }, allowing benefits to flow recursively through the NDO composition graph.

7. Cross-cutting Requirements

7.1 Dual deployment

  • REQ-XCUT-01: The Nondominium hApp shall run as a standalone application (Lobby DNA + Group DNA + NDO DNA, all managed by one conductor) AND as a single Moss/The Weave Tool applet (Nondominium Lobby appears as one tile in the Moss sidebar; Moss handles agent invites and identity at the surface level).
  • REQ-XCUT-02: The NDO DNA is not modified between standalone and Moss deployments. The Lobby and Group DNAs are either used directly (standalone) or delegated to Moss equivalents (Moss integration).

7.2 Resources are organization-agnostic

  • REQ-XCUT-03: NDO resources (EconomicResource, NondominiumIdentity) are groups- and organizations-agnostic. A Group does not own an NDO. Multiple groups may soft-link to the same NDO. The NDO's governance is independent of any group that references it.

7.3 Solo agent model

  • REQ-XCUT-04: A solo agent who has not joined any multi-member group appears in the UI as an individual Agent. Internally, they operate via an auto-created group-of-one. This group-of-one can grow to accommodate new members without any structural migration.

8. Governance Layers

8.1 NDO governance (constitutional layer)

NDO governance is defined by the NDO's GovernanceRule entries and the AccountableAgent role set. It governs:

  • Who may create hard NDO-to-NDO links (AccountableAgents only)
  • Who may validate contributions (AccountableAgents only)
  • Who may create and update smart agreements (AccountableAgents only)
  • What EconomicEvent actions are valid for the NDO
  • NDO lifecycle stage transitions

NDO governance supersedes group governance for all actions that affect NDO state.

8.2 Group governance (coordination layer)

Group governance is defined by GroupGovernanceRule entries. MVP: flat key-value rules. It governs:

  • Who may join the group (invite code validation)
  • Who may create or delete soft links
  • Coordination norms and cultural rules

Group governance does NOT govern contributions, benefit distribution, or smart agreements.

8.3 Lobby (no governance)

The Lobby DHT is permissionless. Any agent may register a profile or NDO descriptor. The only implicit governance is the requirement that a registered NDO descriptor references an actual deployed DNA (discoverable by peers who attempt to connect).


9. Integration Requirements

9.1 Flowsta (post-MVP, Phase 1+3)

  • REQ-LOBBY-INT-01: Post-MVP, the MVP cross-DHT identity mechanism (per-NDO pubkey map in GroupMembership) shall be superseded by Flowsta IsSamePersonEntry attestations, enabling cross-conductor and cross-device identity federation.
  • REQ-LOBBY-INT-02: GroupMembership.ndo_pubkey_map is forward-compatible: the Flowsta DID can be added as an additional field without breaking existing records.
  • See flowsta-integration.md for full Flowsta requirements (REQ-NDO-CS-12 through CS-15).

9.2 Unyt (post-MVP)

  • REQ-LOBBY-INT-03: Post-MVP, Agreement rules with BenefitType::Monetary shall be activated via Unyt: validated Contributions trigger RAVE events, and NdoHardLink creation triggers benefit cascade through the NDO composition graph.
  • REQ-LOBBY-INT-04: The Lobby shall support monetary contributions to NDOs via Unyt (agents can donate to an NDO from the Lobby without joining a group).
  • See unyt-integration.md for full Unyt requirements.

9.3 Many-to-many flows (post-MVP)

  • REQ-LOBBY-INT-05: NdoHardLink creation currently requires a single AccountableAgent signature. Post-MVP, multi-party consent for structural incorporation shall be supported per REQ-MMF-* (many-to-many-flows.md).

10. Current State vs Planned Enforcement

As of the Nondominium MVP codebase:

  • Lobby DNA, Group DNA, and NDO DNA extensions are not yet implemented.
  • The existing NDO DNA (zome_person, zome_resource, zome_gouvernance) provides the constitutional layer for a single NDO DHT; the multi-network federation layer is absent.
  • NdoHardLink, Contribution, and Agreement entry types are specified but not yet present in the WASM.
  • The companion architecture specification (documentation/specifications/post-mvp/lobby-architecture.md) provides the full schema, coordinator API, validation rules, sequence diagrams, and ADRs for implementation.

For OVN-scale motivation (bridge nodes, multi-community agents, holonic layers) and the normative NDO requirements that this document extends, see ndo_prima_materia.md §6, §8, and §11. For the companion architecture design, see documentation/specifications/post-mvp/lobby-architecture.md.

Unyt Integration: Economic Closure for the Nondominium Object

Status: Post-MVP Design Document
Created: 2026-03-11
Authors: Nondominium project
Relates to: ndo_prima_materia.md, many-to-many-flows.md, versioning.md


Table of Contents

  1. Framing: The Generic NDO and Nondominium as Instantiation
  2. The Economic Closure Problem
  3. The NDO Economic Loop
  4. Unyt as Economic Operator
  5. Integration Architecture
  6. Alliance Design Patterns
  7. The Reputation-Credit Mechanism
  8. Economic Governance
  9. Generic NDO and Nondominium as Instantiation
  10. Integration Path
  11. Requirements

1. Framing: The Generic NDO and Nondominium as Instantiation

This document is written in the context of a conceptual shift in the Nondominium project's post-MVP trajectory. The Nondominium Object (NDO) — the three-layer DHT primitive described in ndo_prima_materia.md — is being recognised as generic infrastructure that should exist independently of any specific application domain.

The plan:

  • A new project (working name: NDO Commons) will implement the three-layer model (Identity, Specification, Process), the lifecycle state machine, the capability slot surface, the governance-as-operator architecture, and the PPR system as a generic, reusable Holochain hApp primitive
  • Nondominium (this project) will become one instantiation of that generic primitive: a peer resource-sharing economy built on top of NDO Commons, adding resource-domain-specific entry types, PPR categories, role structures, and economic configurations
  • Other projects can build their own NDO instantiations: fabrication networks, cooperative enterprises, local economic systems, digital commons — any community that needs a cryptographically-accountable, self-governing, lifecycle-aware object infrastructure

This document specifies how Unyt integrates with the generic NDO. The Unyt integration is designed to be:

  • Optional — the NDO functions without it; economic settlement is a capability communities activate when they need it, not a structural requirement
  • Modular — it connects to the NDO via the capability slot mechanism (Section 6 of ndo_prima_materia.md) and a standard GovernanceRule type, requiring no modifications to the NDO's core data model
  • Alliance-configurable — each NDO community defines its own Unyt Alliance: its unit of account, its credit limit algorithm, its Smart Agreement templates, its fee policy
  • Lifecycle-aware — economic terms can differ across NDO lifecycle stages; a resource under development may be accessed freely while the same resource in Active state requires economic settlement

Nondominium's specific Unyt configuration (resource-sharing currencies, Commons Alliance archetype, credit limit algorithm based on physical resource PPRs) is described in Section 9 as an instantiation example, not as the generic specification.


2. The Economic Closure Problem

The ValueFlows standard, on which the NDO is built, provides rigorous primitives for describing and observing economic activity: Resources, Events, Agents, Processes, Commitments, Claims. It is a complete accounting ontology — a language for observing what happens economically.

What ValueFlows does not provide is settlement. It accurately records who did what, with what resource, at what time. It does not close the loop by specifying what economic value subsequently flows to the people who contributed. The observation is complete; the consequence is absent.

This is the economic closure problem: a system that observes all economic activity but produces no economic consequence cannot sustain the incentive structures needed for long-term participation. Agents contribute, validate, steward, repair, transport — and the system records all of it — but nothing economically meaningful follows from the record. The loop is open.

Open loops break commons economies. The digital commons (FLOSS, Wikipedia) can survive on open loops because information is non-rivalrous: sharing a file costs nothing. Physical commons — shared tools, equipment, spaces, transport capacity, repair skill — are rivalrous. Physical stewardship has real costs: time, expertise, risk of damage to one's equipment, opportunity cost. A system that observes stewardship without rewarding it will reliably attract less of it, and will ultimately fail to retain the agents who are best at it.

The closure Unyt provides has four dimensions:

  1. Settlement — economic value flows as a direct consequence of observed events; the RAVE (Recorded Agreement Verifiably Executed) is the cryptographic proof that value flowed
  2. Currencies — communities define their own units of account, matched to the actual value their resources produce; credits earned through contribution can be spent on access, services, or governance
  3. Credit — participation history determines economic capacity; the past record of an agent becomes collateral for future engagement, without requiring financial deposits or social vouching
  4. Governance weight — economic standing feeds back into governance authority; those who have contributed most to the commons have the most legitimate standing to shape its rules

When all four dimensions are active, the loop closes. The sections that follow trace that loop in full.


3. The NDO Economic Loop

The NDO's three layers provide the structural basis for description and observation. Unyt provides the settlement layer that makes observation consequential. Together they define a complete, self-reinforcing economic loop.

┌──────────────────────────────────────────────────────────────────────────┐
│                        THE NDO ECONOMIC LOOP                             │
│                                                                           │
│  DESCRIPTION  (Layer 1)                                                   │
│    What the resource is. What governance rules apply.                     │
│    What economic terms govern access, contribution, and benefit.          │
│    ↓                                                                      │
│  OBSERVATION  (Layer 2)                                                   │
│    What happens: events, commitments, claims, quality receipts (PPRs).   │
│    Who did what, when, with what resource, at what quality.               │
│    ↓                                                                      │
│  SETTLEMENT  (Unyt Smart Agreement → RAVE)                                │
│    Value flows as a direct consequence of observed events.                │
│    Smart Agreement executed → RAVE produced → credits flow to stewards.  │
│    ↓                                                                      │
│  REPUTATION  (PPR + RAVE linkage)                                         │
│    The permanent record of participation quality and economic reliability.│
│    PPR: who did what, how well (quality proof).                           │
│    RAVE: who settled what, to whom, under what rules (economic proof).    │
│    Together: a complete, cross-verifiable agent economic identity.        │
│    ↓                                                                      │
│  CREDIT  (Compute Credit Limit Agreement)                                 │
│    Reputation → economic capacity in the commons.                         │
│    New agents: minimal credit (minimal track record).                     │
│    Reliable stewards: expanded credit (demonstrated trustworthiness).     │
│    The past record becomes collateral for future engagement.              │
│    ↓                                                                      │
│  ACCESS  (UnytAgreement enforcement + RAVE as precondition)               │
│    Credit + agreement execution → state transition approved.              │
│    Resources governed by their own economic terms, enforced by peers.     │
│    ↓                                                                      │
│  MOTIVATION                                                               │
│    Participation in the commons earns economic standing.                  │
│    Economic standing unlocks access to more of the commons.               │
│    The incentive to contribute aligns perfectly with the incentive        │
│    to participate: they are the same incentive.                           │
│    ↓                                                                      │
│  GOVERNANCE                                                               │
│    Economic standing → governance weight.                                 │
│    Those who have contributed most to the commons have the most          │
│    standing to shape its rules. Smart Agreements ARE governance rules.    │
│    ↓                                                                      │
│  DESCRIPTION  (Layer 1 — updated through governance)                     │
│    Governance decisions update economic terms.                            │
│    New Smart Agreements are endorsed as GovernanceRules.                  │
│    Credit limit algorithms are recalibrated.                              │
│    The resource's economic self-description evolves with the community.   │
│    [loop]                                                                 │
└──────────────────────────────────────────────────────────────────────────┘

Each element of the loop maps to specific technical primitives:

Loop elementNDO primitiveUnyt primitive
DescriptionLayer 1 (ResourceSpecification + GovernanceRule)EconomicAgreementRuleData (in GovernanceRule)
ObservationLayer 2 (EconomicEvent, Commitment, Claim, PPR)
SettlementUnyt Smart Agreement + RAVE
ReputationPrivateParticipationClaim (PPR)settlement_rave_hash field (on PPR)
CreditCompute Credit Limit Agreement (RHAI)
AccessGovernance zome (state transition)UnytAgreement enforcement + RAVE validation
MotivationCredit capacity as economic signal
GovernanceGovernanceRule + role-based accessSmart Agreements as economic governance rules

The loop is the architecture. Every design decision in the integration should be evaluated against how it strengthens or weakens the loop's coherence.


4. Unyt as Economic Operator

Unyt (unyt.co) is peer-to-peer accounting infrastructure built on Holochain. Each participant runs the application on their own device, maintains their own cryptographically-signed chain of records, and validates peers directly. There are no central servers, miners, or stakers. Like the NDO, it is agent-centric and DHT-based — both systems share the same foundational architecture.

This architectural compatibility is not incidental. It means:

  • The same agent key that signs NDO events also signs Unyt transactions. Cross-cell calls between the NDO cell and the Unyt cell share the same cryptographic identity without trust bridges or API integrations.
  • The NDO's agent-centric observation (Layer 2 events, PPRs on each agent's source chain) can be accessed by Unyt's credit limit algorithm via cross-DNA calls to the same node — no data replication, no synchronization protocol.
  • Both systems use Holochain's append-only DHT and source chain model, so RAVEs are as permanent and tamper-evident as PPRs; neither can be retroactively altered.

Unyt's key primitives in the NDO context:

Unyt Alliance — A configured deployment of the Unyt system. Each Alliance defines its own Base Unit (unit of account), credit limit algorithms, transaction fee policies, Smart Agreement templates, Service Networks (sub-communities), and governance. For the generic NDO: each NDO community that activates economic settlement configures a Unyt Alliance. The Alliance is the community's economic constitution, parallel to but separate from the NDO's governance constitution (GovernanceRules).

Smart Agreement — Programmable economic rules governing value flows, credit extension, and coordination. Validated by peers, not by central servers. For the NDO: Smart Agreements are the economic complement to GovernanceRules — where GovernanceRules specify who may take what action, Smart Agreements specify what economic consequence follows when they do.

RAVE (Recorded Agreement Verifiably Executed) — The immutable artifact produced when a Smart Agreement executes. Contains inputs used, the agreement reference, and outputs produced. Any participant can independently verify the execution. For the NDO: the RAVE is the economic proof that complements the PPR's participation proof. Together they constitute a complete, doubly-verifiable record that neither system alone can provide.

Compute Credit Limit Agreement — A configurable Smart Agreement (RHAI script) that dynamically calculates each agent's credit capacity. For the NDO: this is the bridge between observation and economic capacity. The agent's participation history, expressed through their ReputationSummary, becomes the primary input — making reputation the collateral for economic access.

Source Chain — Each agent's append-only, cryptographically-signed record of all their actions. In Holochain, this is the same structure in both the NDO cell and the Unyt cell. An agent's economic history in Unyt and their participation history in the NDO are both part of the same cryptographic identity — they are two aspects of a single coherent agent record.


5. Integration Architecture

The NDO-Unyt integration uses four coupling points, designed to be independently activatable across the three integration phases described in Section 10.

5.1 Capability Slot (Layer 0 — discovery surface)

The UnytAgreement(String) slot type in the SlotType enum (defined in ndo_prima_materia.md Section 8.3) is the permissionless discovery surface. Any Accountable Agent can attach a proposed Unyt Smart Agreement to any NDO's Layer 0 identity hash. This is informational — a proposal, a market signal, a community suggestion. Multiple competing proposals may coexist. The governance zome does not enforce Tier 1 slots.

The String parameter carries the Unyt Alliance network seed, allowing a single NDO to be referenced by agreements on different Alliance instances (for inter-community bridging or migration scenarios).

5.2 GovernanceRule — EconomicAgreement Type (Layer 1 — authoritative terms)

GovernanceRule entries of type EconomicAgreement are the authoritative economic terms. When a custodian or governance process creates this rule, it endorses a specific Unyt Smart Agreement as the economic condition for a set of VfAction events. The rule carries:

#![allow(unused)]
fn main() {
// New variant in GovernanceRuleType enum (zome_resource integrity)
pub enum GovernanceRuleType {
    // ... existing rule types ...
    EconomicAgreement, // rule_data: JSON-serialized EconomicAgreementRuleData
}

#[derive(Serialize, Deserialize)]
pub struct EconomicAgreementRuleData {
    pub unyt_alliance_id: String,         // Network seed of the Unyt Alliance
    pub smart_agreement_hash: String,      // Entry hash of the Unyt Smart Agreement
    pub trigger_actions: Vec<VfAction>,    // Which VfActions trigger settlement
    pub settlement_window_secs: u64,       // Max seconds between RAVE execution and transition
    pub note: Option<String>,              // Human-readable description of economic terms
}
}

This rule lives in Layer 1 alongside other GovernanceRules — access control, role requirements, validation schemes. It is the economic layer of the resource's governance specification.

5.3 State Transition Enforcement (Governance Zome — enforcement bridge)

When the governance zome processes a state transition whose VfAction matches a trigger_actions entry in an endorsed EconomicAgreement rule, the transition request must include a rave_hash. The governance zome:

  1. Confirms the transition's VfAction is in the rule's trigger_actions list
  2. Retrieves and validates the RAVE from the Unyt DHT (cross-DNA call)
  3. Confirms the RAVE was executed within settlement_window_secs
  4. Confirms RAVE inputs match the transition context (resource identity, provider, receiver, quantity or duration)
  5. Approves the transition and generates the PPR with settlement_rave_hash populated

This makes the governance zome's approval conditional on cryptographic proof of economic settlement — the resource does not move, change state, or transfer custody until the agreed value has flowed.

5.4 PPR + RAVE Linkage (Layer 2 — provenance chain closure)

The settlement_rave_hash field on PrivateParticipationClaim entries is the binding point between the NDO's participation record and Unyt's economic record:

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    // ... existing fields ...
    pub settlement_rave_hash: Option<String>, // Unyt RAVE hash; None if no economic rule triggered
}
}

This creates a complete, cross-verifiable provenance chain:

Commitment
  └─ (fulfilled by) EconomicEvent
       └─ (generates) PrivateParticipationClaim (PPR)
            ├── performance_metrics: { timeliness, quality, reliability, communication }
            ├── bilateral_signatures: (provider_sig, receiver_sig)
            └── settlement_rave_hash → Unyt RAVE
                     └─ (verifiable on Unyt DHT: inputs, agreement, outputs, executor)

The PPR is the participation proof: who did what, with what quality, in which role. The RAVE is the economic proof: what value flowed, to whom, under what rules, verified by Unyt peers. Together, they constitute a record of a resource interaction that is complete in both the participation and economic dimensions — and that feeds back into both the reputation system and the credit limit algorithm.

5.5 Unyt Alliance (external, per-community)

The Unyt Alliance is a separate Holochain cell (or Unyt Sandbox deployment) that the NDO cell interacts with via cross-DNA calls. It is not embedded in the NDO — it is federated alongside it. Each NDO community configures its own Alliance.

graph LR
    subgraph NDO_Cell ["NDO Cell"]
        L0["Layer 0 (Identity)"]
        L1["Layer 1 (Spec + GovernanceRules)"]
        L2["Layer 2 (Process + Events + PPRs)"]
        GZ["Governance Zome\n(state transition operator)"]
    end

    subgraph Unyt_Cell ["Unyt Alliance Cell"]
        UA["Alliance Config\n(Base Unit, fees, parameters)"]
        SA["Smart Agreements\n(RHAI templates + RAVEs)"]
        CL["Credit Limit Agreement\n(Compute Credit Limit RHAI)"]
    end

    L0 -->|"CapabilitySlot\n(UnytAgreement — Tier 1)"| SA
    L1 -->|"GovernanceRule\n(EconomicAgreement — Tier 2)"| SA
    GZ -->|"cross-DNA call\n(RAVE validation)"| SA
    L2 -->|"PPR.settlement_rave_hash"| SA
    L2 -->|"ReputationSummary\n(cross-DNA call)"| CL
    CL -->|"credit_limit result"| UA

6. Alliance Design Patterns

Different NDO communities have very different economic needs. The Unyt Alliance is configurable enough to support a broad spectrum. Three archetypes cover the most common patterns; communities can combine and extend them freely.

6.1 Gift Economy Alliance

When to use: Communities where sharing is unconditional, economic tracking is for awareness not enforcement. Time banks, mutual aid networks, close-knit cooperatives, family or neighbourhood resource sharing.

Base Unit: A contribution token (e.g. "GiftHour") with no monetary exchange value — a formal record of giving, not a claim on receiving. The unit's purpose is visibility, not pricing.

Credit limit: Generous and largely uniform. Participation history is tracked but does not gate access. Reputation is public and affirming, not exclusionary.

Smart Agreements: None that gate resource access. Optionally: Aggregate Payment agreements that route a fraction of activity-generated tokens to the NDO's governance pool (funding maintenance, shared infrastructure, community operations).

Fees: Zero. Always.

NDO Integration: UnytAgreement capability slots are informational only (Tier 1). No EconomicAgreement governance rules enforced. Settlement is voluntary, reciprocal, and community-normed rather than system-enforced.

Loop dynamics: In this archetype, Unyt's primary contribution is visibility and soft incentive, not enforcement. The observation → settlement → reputation path is active, but the credit → access gate is open. The loop is complete but runs on social rather than economic pressure.

6.2 Commons Alliance

When to use: Shared resources with real stewardship costs; access should be earned through contribution; non-contributing access-seekers should pay fees. Tool libraries, maker spaces, shared equipment pools, repair networks.

Base Unit: A commons credit (e.g. "CommonHour" or "FabCredit") earned through contribution, validation, and stewardship; spent on access and services.

Credit limit: Dynamically derived from ReputationSummary (see Section 7). New members get minimal credit (observer access only). Each validated contribution, stewardship event, or governance participation increases credit. Long-term reliable stewards have the highest credit capacity.

Smart Agreements:

  • Conditional Forward for access fees (non-contributors pay before access; contributors access freely within credit)
  • Aggregate Payment for stewardship compensation (custodian + maintenance fund + optional protocol treasury)
  • Proof of Service for service billing (transport, repair, storage providers automatically settled on validated Claim)

Fees: Small, directed entirely to the community's maintenance fund. No fees to Unyt as a platform — Unyt does not require fees to operate.

NDO Integration: Full integration across all three phases. EconomicAgreement governance rules enforce access and service settlement. PPR + RAVE linkage generates reputation. Credit limit derived from PPRs creates the graduation gradient.

Loop dynamics: This is the fully-closed loop archetype. Every element is active: description → observation → settlement → reputation → credit → access → motivation → governance → description. The commons is economically self-sustaining.

6.3 Cooperative Alliance

When to use: Productive communities with shared output and shared revenue; contributors should receive proportional benefit from what they collectively created. Open hardware design communities, fabrication networks, cooperative software projects, distributed manufacturing.

Base Unit: A contribution token tied to a revenue-distribution mechanism. The token is less a currency than an accounting ledger entry — a share in the cooperative's outputs.

Credit limit: Contribution depth. Agents who have produced more (validated commits, design iterations, test fabrications, governance participation) have higher standing and thus higher credit capacity.

Smart Agreements:

  • Aggregate Payment with proportional distribution: each contributor receives a share of revenue proportional to their verified Layer 2 contribution history
  • Revenue sharing tables managed by governance, updated as the community's understanding of contribution value evolves

Fees: Zero. All economic flows are internal to the cooperative; no platform extraction is appropriate.

NDO Integration: Full integration. The Layer 2 contribution tracking (EconomicEvents, PPRs) feeds directly into Unyt's revenue distribution algorithm. The NDO's observation layer is the distribution basis — there is no separate contribution ledger.

Loop dynamics: The loop here runs most visibly through the governance dimension: as contributors earn revenue shares, they become more invested in governance (they have economic skin in the game), which improves decision-making quality, which improves the product, which generates more revenue, which distributes to contributors — a virtuous cycle.


7. The Reputation-Credit Mechanism

The feedback from reputation to credit is the backbone of the self-sustaining commons. This section specifies it in full.

7.1 ReputationSummary as Credit Input

The NDO's governance zome derives ReputationSummary entries from an agent's accumulated PPRs. The Unyt integration adds one new field to this summary:

#![allow(unused)]
fn main() {
pub struct ReputationSummary {
    pub agent: AgentPubKey,
    pub period_start: Timestamp,
    pub period_end: Timestamp,

    // Existing fields
    pub average_performance_score: f64,  // Weighted avg across all PPR categories (0.0-1.0)
    pub creation_count: u32,             // ResourceCreation + ResourceValidation PPRs
    pub custody_count: u32,              // CustodyTransfer + CustodyAcceptance PPRs
    pub service_count: u32,              // Maintenance + Storage + Transport PPRs
    pub governance_count: u32,           // DisputeResolution + ValidationActivity + RuleCompliance PPRs

    // New field, enabled by Unyt integration
    pub economic_reliability_score: f64, // Fraction of settlement-required interactions settled
                                         // cleanly (RAVE within window, no disputes, no reclaims)
                                         // Range: 0.0 (never settled) to 1.0 (always settled)
}
}

The economic_reliability_score is the economic analogue of the existing quality metrics. It answers the question: when this agent was required to settle economically (access fee, service payment, custody bond), did they follow through? An agent with high quality scores but low economic reliability is a participation risk. An agent with both high quality and high economic reliability is the ideal steward.

This field is 0.0 for all agents before Unyt integration is active (no settlement records exist). It becomes meaningful as soon as an agent begins interacting with economically-governed resources.

7.2 Compute Credit Limit Agreement (RHAI)

The Unyt Alliance's Compute Credit Limit Agreement is a RHAI script that receives the agent's ReputationSummary as input (sourced from the NDO governance zome via cross-DNA call) and produces a credit limit as output.

A reference implementation suitable for the Commons Alliance archetype:

// Inputs provided by Unyt framework:
//   reputation (ReputationSummary), config (Alliance Global Config parameters)

let base_credit = config.base_credit_limit;

// Performance multiplier: quality of past interactions
let performance_bonus = base_credit
    * reputation.average_performance_score
    * config.performance_weight;

// Depth bonuses: breadth and depth of network contribution
let custody_bonus  = reputation.custody_count  * config.custody_credit_per_event;
let service_bonus  = reputation.service_count  * config.service_credit_per_event;
let governance_bonus = reputation.governance_count * config.governance_credit_per_event;

// Capacity before reliability adjustment
let capacity = base_credit + performance_bonus
    + custody_bonus + service_bonus + governance_bonus;

// Economic reliability multiplier: agents who settle cleanly get full capacity;
// agents who routinely fail to settle are capped at 50% of earned capacity.
// This is the most important guard against economic free-riding.
let reliability_multiplier = 0.5 + (0.5 * reputation.economic_reliability_score);

capacity * reliability_multiplier

All config.* parameters are set in the Alliance's Global Configuration and can be updated through community governance without modifying the RHAI script. The community tunes the model as it learns what parameter values produce the outcomes it wants.

7.3 The Graduation Gradient

New agents start with base_credit_limit and no bonuses. Their first interactions are therefore constrained — they can access resources with low economic requirements, but not those with high access fees or custody bonds. This is intentional: it protects the commons from agents with no track record.

As agents accumulate PPRs with RAVE linkage, their credit capacity grows continuously:

Agent standingTypical credit capacityEnabled interactions
New (no PPRs)Base credit onlyLow-cost access; observation; contribution proposals
Emerging (5–20 PPRs)Base + moderate bonusesStandard access; simple service commitments
Established (20+ PPRs, high quality)Full bonusesFull access; custody responsibility; complex service chains
Senior (50+ PPRs, specialist roles)Maximum creditHigh-value custody; governance weight; inter-alliance bridging

The gradient is a continuous function, not a hard gate. Agents grow into the commons economically as they demonstrate trustworthiness, reliability, and economic responsibility. The system never stops anyone permanently — it calibrates access to demonstrated track record.

A key property: this system is self-regulating without administrators. No human decides who gets how much credit. The RHAI script is the credit policy; PPRs are the evidence; peers validate both. The community designs the rules (through governance); the algorithm enforces them (through Unyt); the DHT records everything permanently.


8. Economic Governance

The deepest dimension of the Unyt integration is its role in governance. This is not simply about who pays for access. It is about who has the standing to shape the rules, and about making rule-setting itself consequential.

8.1 Smart Agreements as Governance Rules

The NDO's governance model separates governance-as-operator (the governance zome evaluates rules and approves transitions) from the data model (zome_resource stores the rules). Unyt extends this model: Smart Agreements are economic governance rules. They specify not just what may happen, but what must economically flow when it does.

A resource's complete governance constitution therefore has three layers:

  1. Access rulesGovernanceRule entries specifying who may take what action (role requirements, validation requirements, agent tier checks)
  2. Economic rulesGovernanceRule entries of type EconomicAgreement specifying what must settle before the action is approved
  3. Settlement logic — Unyt Smart Agreement RHAI scripts specifying exactly how value flows when settlement is triggered

Together, these three layers constitute a complete, peer-enforced, cryptographically-guaranteed economic constitution for the resource. No legal system, no platform, no administrator required. The rules are in the DHT; the enforcement is in the validation logic; the settlement is in Unyt. The "governance engine" is the network of peers running the same code.

This is the fullest expression of what ndo_prima_materia.md calls the governance-as-operator architecture: not just governance deciding who can act, but governance specifying the complete economic context of action — including consequences, settlement flows, and redistribution rules.

8.2 Economic Standing as Governance Weight

A commons governance system faces a persistent challenge: how do you weight decision-making authority? Options include one-agent-one-vote (ignores contribution depth), stake-weighted voting (replicates capital concentration), or delegated representation (reintroduces hierarchy).

The Unyt integration offers a fourth option: contribution-weighted governance. Because the NDO's PPR system tracks participation quality and the Unyt integration tracks economic reliability, the ReputationSummary is a natural, continuously-updated, peer-validated measure of an agent's depth of investment in the commons. This can serve as governance weight without requiring any additional infrastructure.

Specific governance applications in the NDO context:

  • N-of-M validation schemes: validators for lifecycle transitions (e.g. Prototype → Stable) can be weighted by their governance PPR count and economic reliability score, ensuring that the most engaged participants have the most influence over quality gates
  • Dispute resolution authority: access to DisputeResolutionParticipation PPR roles can require minimum credit standing, ensuring only economically embedded agents serve as dispute resolvers
  • Economic rule amendments: amendments to EconomicAgreement governance rules (changing payment terms, credit limit parameters) can require supermajority consent from agents above a minimum credit tier, preventing rule changes by agents with no stake in the outcome

These are optional governance configurations — not requirements of the generic NDO. Each NDO instantiation decides which governance weightings make sense for its community.

8.3 Commons Treasury and Protocol Economics

For communities that configure non-zero fees (Commons Alliance, Cooperative Alliance), accumulated fees constitute a commons treasury. Unyt's Service Network mechanism allows this treasury to be managed by a designated steward, a multisig group, or a DAO-style governance process.

The treasury's purpose is to make the commons economically self-sustaining: paying for maintenance and repair of physical infrastructure, funding development of shared digital resources, compensating governance work (validation, dispute resolution, rule-writing), and building bridge deposits for inter-alliance connectivity.

Critically: the treasury's distribution rules are themselves Unyt Smart Agreements — configurable by the community, enforced by Unyt, updatable through governance. No central administrator manages the treasury. The rules manage it.

8.4 Inter-NDO Economic Bridges

When multiple NDO communities (multiple Unyt Alliances) want to connect, Unyt's inter-Alliance bridging mechanism allows value to flow between them. This enables:

  • A hardware design commons and a regional fabrication network to exchange credits (design access in exchange for fabrication capacity)
  • A tool library and a repair cooperative to share economic infrastructure (repair credits earned by tool library members; tool access earned by repair members)
  • A network of local resource-sharing communities to maintain separate identities and governance while exchanging value

At the generic NDO level, inter-community bridging is an Alliance configuration decision. Each Alliance decides whether to enable bridging, with which Alliances, and at what conversion rates. The Layer 0 NDO identity hash provides a stable cross-network reference point — an NDO is always identifiable regardless of which Alliance is processing a transaction involving it.

Unyt's EVM blockchain bridge is the mechanism for communities that need to interface with the conventional monetary economy: paying for insurance, physical storage rent, online services, or participating in markets beyond the peer network. Organisations can lock real-world value (ETH, stablecoins) and mirror it into the commons network as credits; participants can redeem back out when needed.


9. Generic NDO and Nondominium as Instantiation

This section makes the generic/specific distinction concrete — what is part of the reusable NDO infrastructure and what is Nondominium's domain-specific contribution.

9.1 What the Generic NDO Infrastructure Provides (Unyt Layer)

The generic NDO project implements these Unyt integration points at the Holochain level:

  • UnytAgreement(String) variant in the SlotType enum
  • EconomicAgreement variant in the GovernanceRuleType enum with EconomicAgreementRuleData schema
  • settlement_rave_hash: Option<String> field on PrivateParticipationClaim
  • economic_reliability_score: f64 field on ReputationSummary
  • Cross-DNA call interface: get_reputation_summary(agent, period) -> ReputationSummary
  • Cross-DNA call interface: validate_ndo_context(resource_hash, provider, receiver, action) -> ValidationResult
  • Governance zome extension: EconomicAgreement rule detection and RAVE validation in evaluate_transition_request

The generic NDO does not implement:

  • Any specific Unyt Alliance configuration (currencies, credit algorithms, fee policies)
  • Any specific Smart Agreement templates (RHAI scripts)
  • Any specific resource domain types or PPR categories
  • Any specific governance weight calculations

9.2 What Nondominium Adds as an Instantiation

Nondominium (this project), built on the generic NDO, adds:

  • Resource domain types: the specific VfActions (AccessForUse, TransferCustody, etc.) and four economic processes (Transport, Storage, Repair, Use)
  • PPR category domain: the 16 ParticipationClaimType variants specific to physical resource sharing (see governance zome documentation)
  • Default Alliance configuration: Commons Alliance archetype, tuned for physical resource sharing economies
  • Standard Smart Agreement templates: the four value flow patterns defined in ndo_prima_materia.md Section 6.6 (Access Fee, Service Billing, Revenue Sharing, Custody Bond)
  • Credit limit algorithm: the RHAI script from Section 7.2, with parameter defaults tuned for physical resource stewardship economies
  • Role-based credit tiers: mapping SimpleAgent / AccountableAgent / PrimaryAccountableAgent role promotions onto credit gradient thresholds

9.3 The Separation

┌─────────────────────────────────────────────────────────────────┐
│                  GENERIC NDO INFRASTRUCTURE                      │
│  (implements ndo_prima_materia.md + this document's integration layer) │
│                                                                  │
│  • Three-layer model (L0, L1, L2)                               │
│  • Lifecycle state machine                                       │
│  • Capability slot surface (incl. UnytAgreement type)           │
│  • GovernanceRule framework (incl. EconomicAgreement type)      │
│  • PPR system (incl. settlement_rave_hash, economic_reliability) │
│  • Cross-DNA Unyt call interfaces                               │
│  • Governance zome RAVE validation                              │
└──────────────────────┬──────────────────────┬───────────────────┘
                       │                      │
            ┌──────────▼──────┐    ┌──────────▼──────────────────┐
            │  NONDOMINIUM    │    │  OTHER NDO INSTANTIATIONS    │
            │  (this project) │    │  (future)                    │
            │                 │    │                              │
            │  • Resource     │    │  • Fabrication network       │
            │    domain types │    │  • Local currency system     │
            │  • 16 PPR       │    │  • Cooperative enterprise    │
            │    categories   │    │  • Digital commons           │
            │  • Commons      │    │  • Art circulation network   │
            │    Alliance     │    │  • etc.                      │
            │    config       │    │                              │
            └────────┬────────┘    └─────────────────────────────┘
                     │
            ┌────────▼────────────────────────────────┐
            │  UNYT ALLIANCE (per NDO community)      │
            │                                          │
            │  • Base Unit (community currency)        │
            │  • Credit limit RHAI script + params     │
            │  • Smart Agreement templates             │
            │  • Fee policy (default: zero)            │
            │  • Service Networks                      │
            │  • Treasury management                   │
            │  • Inter-alliance bridge config          │
            └──────────────────────────────────────────┘

10. Integration Path

The integration is structured as four sequential phases. Each phase delivers independent value; none require rollback of prior work.

Phase 1 — NDO Foundation (Generic NDO project; no Unyt deployment needed)

Implement in the generic NDO project at the Holochain level:

  • UnytAgreement(String) in SlotType enum
  • EconomicAgreement in GovernanceRuleType enum with EconomicAgreementRuleData schema
  • settlement_rave_hash: Option<String> on PrivateParticipationClaim
  • economic_reliability_score: f64 on ReputationSummary (computed as 0.0 when no RAVE data exists)
  • Cross-DNA call stubs (return placeholder data until Phase 3)

What this delivers: The generic NDO is structurally Unyt-ready. Any NDO instantiation can inherit these integration points. No Unyt Alliance is required to run. The stubs ensure that zomes compile and pass validation; they just don't execute economic logic yet.

Phase 2 — Alliance Configuration (Per-community, parallel to Phase 1)

Configure Unyt Alliances for communities that want to activate economic settlement:

  • Deploy Unyt Sandbox for the community's Alliance
  • Define Base Unit (name, symbol, initial supply or mutual credit parameters)
  • Configure credit limit algorithm (RHAI script with initial parameters)
  • Create standard Smart Agreement templates using the Unyt Smart Agreement Library as starting point
  • Set fee policy
  • Register Alliance network seed in NDO capability slots (UnytAgreement Tier 1 links)

What this delivers: The Alliance exists and is functional. Agents can use it for voluntary payments and reputation-building before enforcement is active. Economic infrastructure is in place; it runs in parallel with the NDO without being coupled to it yet.

Phase 3 — Enforcement (zome_gouvernance changes)

Implement in the NDO governance zome:

  • evaluate_transition_request extended to detect EconomicAgreement governance rules
  • Cross-DNA call to Unyt cell implementing the RAVE validation sequence (Section 5.3)
  • rave_hash requirement in transition request payloads for governed resources
  • PPR generation updated to populate settlement_rave_hash on valid RAVEs
  • economic_reliability_score computation in ReputationSummary derivation

What this delivers: Full enforcement. Resources with economic terms are now automatically governed by them. The NDO economic loop is closed. A resource without a Unyt agreement is unaffected; a resource with one enforces it peer-to-peer.

Phase 4 — Ecosystem (post-basic integration)

  • Inter-Alliance bridging for multi-community NDO networks (bridging configuration in Alliance + NDO discovery via Layer 0 identity hashes)
  • Governance weight calculations using ReputationSummary + economic_reliability_score for weighted N-of-M validation and governance participation
  • Treasury management Smart Agreements for commons maintenance funding
  • EVM blockchain bridging for fiat/crypto on-off ramp (for communities requiring interface with the conventional economy)

What this delivers: The NDO network effect. Multiple communities sharing NDO infrastructure, exchanging value across Unyt Alliance bridges, with governance informed by cross-community economic standing.


11. Requirements

11.1 Generic NDO Integration Layer Requirements

  • REQ-UNYT-NDO-01: The generic NDO shall implement UnytAgreement(String) as a named SlotType variant where the String carries the Unyt Alliance network seed identifier.
  • REQ-UNYT-NDO-02: The generic NDO shall implement EconomicAgreement as a named GovernanceRuleType variant with EconomicAgreementRuleData as its structured rule_data schema, carrying unyt_alliance_id, smart_agreement_hash, trigger_actions, settlement_window_secs, and optional note.
  • REQ-UNYT-NDO-03: The PrivateParticipationClaim entry type shall include settlement_rave_hash: Option<String>. This field shall be None for all transitions where no EconomicAgreement rule was triggered.
  • REQ-UNYT-NDO-04: The ReputationSummary derived type shall include economic_reliability_score: f64, computed as the fraction of an agent's settlement-required interactions that were settled cleanly. The value shall be 0.0 for agents with no settlement history.
  • REQ-UNYT-NDO-05: The governance zome shall expose a cross-DNA-callable function get_reputation_summary(agent: AgentPubKey, period: Option<TimePeriod>) -> ReputationSummary for use by Unyt's Compute Credit Limit Agreement.
  • REQ-UNYT-NDO-06: The governance zome shall expose a cross-DNA-callable function validate_ndo_context(resource_hash: ActionHash, provider: AgentPubKey, receiver: AgentPubKey, action: VfAction) -> ValidationResult for use by Unyt RAVE input validation.
  • REQ-UNYT-NDO-07: Cross-DNA call stubs for Unyt interfaces shall be implemented in Phase 1 and shall return placeholder passing results until Phase 3 activates live Unyt connections.

11.2 Alliance Configuration Requirements

  • REQ-UNYT-AL-01: Each NDO community activating economic settlement shall configure a Unyt Alliance with at minimum: unyt_alliance_id, base_credit_limit, a Compute Credit Limit Agreement RHAI script accepting ReputationSummary as input, and at least one Smart Agreement template matching the community's primary economic interaction patterns.
  • REQ-UNYT-AL-02: The Alliance's Compute Credit Limit Agreement shall accept ReputationSummary as an input parameter, sourced from the NDO governance zome via cross-DNA call.
  • REQ-UNYT-AL-03: Alliance fee policies shall default to zero. Non-zero fees require explicit community configuration through Alliance governance. No fees to the Unyt platform are mandatory.
  • REQ-UNYT-AL-04: Alliance Global Configuration parameters (credit weights, bonus rates, reliability multiplier) shall be independently updatable through community governance, without modifying or redeploying the RHAI credit limit script.

11.3 State Transition Enforcement Requirements

  • REQ-UNYT-ENF-01: When the governance zome processes a state transition whose VfAction matches a trigger_actions entry in an endorsed EconomicAgreement governance rule, the transition request shall include a rave_hash. Requests without a required rave_hash shall be rejected with a SettlementRequired rejection reason.
  • REQ-UNYT-ENF-02: RAVE validation shall include: (a) retrieval from the Unyt DHT, (b) confirmation of execution within settlement_window_secs, (c) confirmation that RAVE inputs match the transition context (resource identity, provider, receiver, VfAction, quantity or duration within tolerance).
  • REQ-UNYT-ENF-03: Approved transitions with valid RAVEs shall generate PPRs with settlement_rave_hash populated for all participating agents. Approved transitions without economic rules shall generate PPRs with settlement_rave_hash: None.
  • REQ-UNYT-ENF-04: RAVE validation failures shall produce a GovernanceTransitionResult::Rejected with a specific rejection_reason indicating the settlement failure (RAVE not found, RAVE expired, context mismatch). The agent may re-execute the Unyt agreement and resubmit the transition request.

11.4 Economic Governance Requirements

  • REQ-UNYT-GOV-01: NDO instantiations may optionally use economic_reliability_score and PPR category counts as weights in N-of-M validation schemes. The generic NDO shall expose these through its governance query API without mandating their use.
  • REQ-UNYT-GOV-02: Amendments to EconomicAgreement governance rules shall require authorization by the role defined in the rule's enforced_by field, consistent with the governance-as-operator architecture (REQ-ARCH-07).
  • REQ-UNYT-GOV-03: The credit limit graduation gradient (base credit, bonus parameters, reliability multiplier) shall be community-configurable via Alliance Global Configuration parameters. Hard-coded credit tiers in the generic NDO code are not permitted.
  • REQ-UNYT-GOV-04: An NDO resource that has no endorsed EconomicAgreement governance rule shall be fully accessible according to its non-economic governance rules alone. Unyt integration shall be invisible and non-blocking for resources that have not opted into it.

This document is post-MVP. It describes the integration of Unyt as the economic settlement layer for the generic NDO primitive. The generic NDO project (implementing ndo_prima_materia.md as a standalone hApp) has not yet begun. When it is created, Nondominium (this project) will migrate to it as one instantiation, inheriting the Unyt integration layer described here. The integration path in Section 10 applies to the generic NDO project first, and to Nondominium thereafter.

Flowsta Integration: Cross-App Identity and Authentication for the NDO

Status: Post-MVP Design Document
Created: 2026-03-24
Authors: Nondominium project
Relates to: ndo_prima_materia.md, unyt-integration.md, documentation/archives/resources.md, documentation/archives/agent.md, documentation/archives/governance.md


Table of Contents

  1. Purpose and scope
  2. Rationale: why Flowsta, why a capability
  3. How Flowsta entered the foundational documents
  4. Architecture summary
  5. Relationship to Unyt and the foundational spec
  6. Integration path (three phases)
  7. Requirements traceability
  8. Current MVP vs planned enforcement

1. Purpose and scope

This document is the dedicated specification stub for integrating Flowsta — decentralized identity and authentication for Holochain apps (Vault, agent linking, W3C DIDs) — with the Nondominium Object (NDO) and the Nondominium hApp.

It serves three functions:

  1. Narrative home — explains the initial rationale for choosing Flowsta-shaped integration (cross-app identity, recovery, optional governance enforcement) in one place.
  2. Cross-document index — records where that rationale and mechanics were first woven into the project’s archive knowledge base (resources.md, agent.md, governance.md) and the normative requirements (ndo_prima_materia.md).
  3. Implementation pointer — aligns engineering work with REQ-NDO-CS-12 through REQ-NDO-CS-15, REQ-NDO-AGENT-07 / REQ-NDO-AGENT-08, and ndo_prima_materia.md Section 6.7 / Section 11.6.

Detailed cryptographic payloads, zome API listings, and UI copy should grow here over time; the authoritative structural spec remains ndo_prima_materia.md Section 6.7 until this file absorbs lower-level detail.


2. Rationale: why Flowsta, why a capability

2.1 Problems the NDO leaves open

The MVP NDO stack assumes long-lived Holochain signing keys and local-to-DHT reputation:

  • Person entries and PPRs are designed for permanence and auditability, but there is no deterministic key recovery in the core DNA: device loss can strand an agent from their source chain and private data.
  • Roles, PPR-derived ReputationSummary, and governance standing are not portable across other Holochain apps unless additional infrastructure provides a verifiable same-person link.
  • Multi-network participants (bridge nodes between OVNs or hApps) face repeated cold-start trust and sybil pressure at every network boundary if each conductor treats them as a unrelated keypair.

These gaps show up explicitly in the archive gap tables (e.g. resources.md §2.4, agent.md §2.6, governance.md §2.8).

2.2 Capability, not a mandatory layer

Cross-app identity must not be hard-coded as a third structural pillar or a registration gate on every agent. That would violate complexity-oriented programming (COP) and pay-as-you-grow: many communities only need AgentPubKey and local PPRs.

Flowsta is therefore integrated as an optional capability, parallel to Unyt:

  • Unyt answers who owes what to whom (settlement, RAVE, economic closure).
  • Flowsta answers who is who (DID, dual-signed linking, Vault recovery).

Communities may adopt one, both, or neither. Attachment is stigmergic: agents and custodians opt in through capability slots and (when desired) governance rules.

2.3 What Flowsta adds in one sentence

Flowsta provides Vault-mediated dual-signed IsSamePersonEntry attestations on the NDO DHT, a FlowstaIdentity capability slot on the agent’s Person entry hash pointing at that attestation, W3C DIDs for cross-app reference, and BIP39 / backup / CAL-aligned export for operational resilience — without changing the Person schema.


3. How Flowsta entered the foundational documents

The same design was introduced consistently but with document-specific emphasis: resources emphasize access and asset governance; agents emphasize identity and portability; governance emphasizes Tier 2 rules and the governance-as-operator path.

3.1 documentation/archives/resources.md

  • Header: flowsta-integration.md added to Relates to.
  • §2.4 Known gaps: rows for no cross-app identity / DID and no agent key recovery, with Flowsta as the planned mitigation (ndo_prima_materia.md Section 6.7).
  • §3.8 Flowsta Integration: roadmap summary — FlowstaIdentity on Person, two tiers, Vault recovery, PPR attribution to DID.
  • §4.5 Accessibility credentials: FlowstaIdentity-based dimension; Tier 1 voluntary link vs Tier 2 governance requirement (REQ-NDO-CS-14 / CS-15, Flowsta Phase 3).
  • §4.6 Transferability: clarifies attribution portability (via DID) claim transferability (PrivateParticipationClaim remains bound to local keys).
  • §5.1 / §5.3: mapped planned rows and cross-app identity verification gap row.
  • §6.6 (governance defaults TODO): two bullets — Tier 1 (Flowsta Phase 1; REQ-NDO-CS-12/CS-13) without Affiliation/ZKP infrastructure; Tier 2 (Flowsta Phase 3; REQ-NDO-CS-14/CS-15) for governance-enforced linking — distinct from AffiliationState / PortableCredential / ZKP dimensions.

3.2 documentation/archives/agent.md

  • Header: flowsta-integration.md in Relates to.
  • §2.6: OVN-framed gap rows for cross-app identity and deterministic recovery.
  • §3.2 CapabilitySlot on Agent Identity: Flowsta Auth as first concrete implementation — FlowstaIdentityIsSamePersonEntry, DID, forward reference to §3.5; pattern defined in ndo_prima_materia.md Section 6.5 (Person surface) and Section 6.7 (Flowsta).
  • §3.4 Credential portability: Flowsta DID as cross-app anchor for attributing ReputationSummary; complements NDO-native PortableCredential forward design in this file, Section 6.5 (not prima materia §6.5 — that section is the Person attachment surface in ndo_prima_materia.md).
  • §3.5 Flowsta Integration: agent linking zomes, Tier 1 / Tier 2 and Phase 1 / Phase 3, Vault, OAuth-only vs Vault path; pointers to ndo_prima_materia.md 6.7, 11.6, and resources.md §3.8.
  • §4.4 Identity architecture: near-term Flowsta bridge vs longer-term ZKP/VC depth; REQ-NDO-AGENT-08.
  • §5.1–5.3: planned rows; portability and credential/sybil rows extended with Flowsta complements.
  • §6.3 AgentProfile / §6.5 PortableCredential: forward-design sketch and portable-credential note tying issuers to Flowsta DID when a FlowstaIdentity slot exists.
  • §7: complexity economics — bridge nodes, Tier 1 vs Tier 2 and Bar-Yam-style matching.

3.3 documentation/archives/governance.md

  • Header: flowsta-integration.md and cross-links to other archives.
  • §1.2: stigmergy extended to agent Person hash and Tier 1 vs Tier 2 (Flowsta Phase 3 for Tier 2).
  • §2.8: gap row for governance-enforced cross-app identity; sybil row notes Flowsta Tier 2 as complement to vouching/PoP.
  • §3.2 → §3.7: Unyt subsection bridges to §3.7 Flowsta Integration — Identity Verification Governance: parallel UnytAgreement / EconomicAgreement / RAVE vs FlowstaIdentity / IdentityVerification / IsSamePersonEntry; REQ-NDO-CS-12–15; planned evaluate_transition_request alignment; MVP reality (GovernanceRule as strings; validate_agent_for_promotion / validate_agent_for_custodianship without Flowsta today).
  • §3.3 / §3.5 / §4.1 / §4.4 / §4.7 / §5.1 / §5.3 / §6.4 / §7: typed rules, mapped rows, sybil resolution, weight function, complexity — all aligned with IdentityVerification and Flowsta tiers.
  • Closing note: ndo_prima_materia.md §§6.6–6.7 and §§11.5–11.6 traceability.

Together, these documents implement a single architectural story: permissionless discovery (Tier 1), optional hard enforcement (Tier 2), and clear separation from economic closure (Unyt).


4. Architecture summary

The following is a condensed restatement of ndo_prima_materia.md Section 6.7; see there for diagrams and full prose.

ElementRole
Person entry hashAgent identity anchor; target for FlowstaIdentity CapabilitySlot links (REQ-NDO-AGENT-07).
flowsta-agent-linking zomesIntegrity + coordinator zomes in the DNA manifest; commit IsSamePersonEntry (dual-signed 78-byte payload: NDO agent key + Flowsta Vault key).
FlowstaIdentity slotTier 1: any agent may link their Person hash to an IsSamePersonEntry action hash (REQ-NDO-CS-12, REQ-NDO-CS-13).
W3C DIDe.g. did:flowsta:uhCAk... (or did:key:...) — cross-app stable identifier.
IdentityVerification governance ruleTier 2: conditions high-trust transitions (e.g. PrimaryAccountableAgent promotion, high-value custody) on REQ-NDO-CS-15 checks (REQ-NDO-CS-14).
Revocationrevoke_link on the Flowsta coordinator; Tier 2 validation must treat revoked links as invalid.
PPR / reputationWith a valid Tier 1 link, ReputationSummary is attributable to a DID; PortableCredential interoperability is anchored by the same DID (REQ-NDO-AGENT-08).

OAuth-only path (@flowsta/auth): convenient DID for web contexts while the app keeps separate Holochain keys; the Vault path is what produces IsSamePersonEntry on the NDO DHT (Flowsta docs “Option 1” vs “Option 2” — summarized in agent.md §3.5).


5. Relationship to Unyt and the prima materia

  • Prima materia Section 6.6 (Unyt) and Section 6.7 (Flowsta) are parallel two-tier models: slot (discoverable) + endorsed GovernanceRule (enforceable).
  • Section 11.5 (Unyt) and Section 11.6 (Flowsta) situate both in the Relationship to Other Post-MVP Work matrix.
  • When both are active, a Flowsta DID can anchor cross-app attribution of reputation signals that also feed Unyt credit and governance-weight narratives (see governance.md §3.5 and prima Section 6.7, Flowsta and Unyt).

6. Integration path (three phases)

Aligned with ndo_prima_materia.md Section 6.7:

PhaseFocusOutcome
1Capability surface + DNAFlowstaIdentity in SlotType; flowsta-agent-linking zomes; SDK wiring; Tier 1 linking without governance enforcement.
2Frontend / UXLink Flowsta flows, DID display, badges, Vault backup APIs (startAutoBackup, backupToVault, etc.).
3Governance zomeIdentityVerification (or equivalent) in typed governance rules; transition evaluation validates REQ-NDO-CS-15; complements Unyt Phase 3-style evaluate_transition_request extensions.

Phases are independent and cumulative — no rollback of earlier phases required.


7. Requirements traceability

IDSummary
REQ-NDO-CS-12FlowstaIdentity in SlotType; link target is IsSamePersonEntry from Flowsta coordinator.
REQ-NDO-CS-13Tier 1: any agent may attach slot on own Person hash; no extra governance requirement beyond standard capability governance (REQ-NDO-CS-03).
REQ-NDO-CS-14Governance supports IdentityVerification (or equivalent) conditioning promotions / high-value transitions on verified slot.
REQ-NDO-CS-15Tier 2 verification: slot exists; IsSamePersonEntry includes requestor AgentPubKey; not revoked.
REQ-NDO-AGENT-07Person hash as capability surface; Flowsta as first concrete implementation.
REQ-NDO-AGENT-08Portable credentials; Flowsta DID as cross-network identity anchor when combined with FlowstaIdentity.

8. Current MVP vs planned enforcement

As of the Nondominium MVP codebase:

  • GovernanceRule in zome_resource remains rule_type: String / rule_data: String — not a typed enum — and Flowsta zomes are not yet part of the shipped DNA unless explicitly added in a future milestone.
  • zome_gouvernance exposes flows such as validate_agent_for_promotion and validate_agent_for_custodianship for private-field validation, not for Flowsta IdentityVerification.

Therefore Tier 2 and Phase 3 are specified and documented but not yet implemented in WASM. This document and the archive sections describe target behavior; governance.md §3.7 states the folding of identity checks into unified transition evaluation explicitly.


For OVN-scale motivation (bridge nodes, governance equation, holonic layers), see documentation/archives/agent.md, documentation/archives/governance.md, and documentation/archives/resources.md in the sections cited above.

nondominium - Technical Specifications

1. Introduction

1.1 Purpose

This document provides the detailed technical specifications for the nondominium Holochain application (hApp). It is based on the requirements outlined in requirements.md and the architecture described in the nondominium project document. It is intended for Holochain developers.

1.2 Guiding Principles

  • Valueflows Compliance: Data structures will adhere to the Valueflows standard.
  • Agent-Centricity: All data is created and validated from the perspective of the individual agent.
  • Capability-Based Security: Access and permissions will be managed through Holochain's capability token mechanism.

2. Holochain DNA and Zome Structure

As per the project's architectural description, the hApp will be composed of three distinct zomes. This separation of concerns will enhance modularity and clarity.

  • zome_person: Handles agent identity, profiles, and roles.
  • zome_resource: Manages the lifecycle of Economic Resources and their Specifications.
  • zome_governance: Implements the logic for Commitments, Claims, and other governance-related actions.

3. Governance-as-Operator Architecture Overview

3.1 Architecture Principle

The nondominium system implements a governance-as-operator architecture where:

  • Resource Zome operates as a pure data model responsible for resource specifications, economic resources, and data persistence
  • Governance Zome operates as a state transition operator responsible for evaluating governance rules, validating state changes, and generating economic events

This separation enables independent evolution of data structures and governance rules while maintaining clear interfaces and responsibilities.

3.2 Cross-Zome Interface

The primary interface between zomes follows the governance operator pattern:

#![allow(unused)]
fn main() {
// Resource zome requests state transition
#[hdk_extern]
pub fn request_resource_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult>;

// Governance zome evaluates and decides
#[hdk_extern]
pub fn evaluate_state_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult>;
}

3.3 Data Flow Pattern

  1. State Change Request: Resource zome receives agent request
  2. Governance Evaluation: Cross-zome call to governance zome for decision
  3. State Application: Resource zome applies approved changes
  4. Event Generation: Economic events generated for audit trail

4. Data Structures (Integrity Zome Entries)

4.1. zome_person Entries

4.1.1. AgentProfile

Stores public-facing information about an agent.

  • Fields:
    • agent_pub_key: AgentPubKey: The public key of the agent.
    • name: String: The agent's chosen public name/pseudonym.
    • avatar_url: Option<String>
  • Links:
    • AllAgents -> AgentProfile: Anchor for discovering all agent profiles.

3.1.2. PrivateProfile

  • Description: Stores an agent's private Personal Identifiable Information (PII) as a Holochain private entry in the agent's source chain. The agent can grant access to this data on a case-by-case basis (see https://developer.holochain.org/build/entries/).
  • private_data: ... (fields like legal name, address, email, photo ID hash)
  • Links:
    • AgentProfile -> PrivateProfile: Links the public profile to the private data.

3.1.3. Role

Defines a specific role an agent can have (e.g., User, Repair, Transport, Storage).

  • Fields:
    • role_name: String
    • validated_by: Option<AgentPubKey>: The Accountable or Primary Accountable Agent who validated the role assignment (fulfills REQ-GOV-06).
    • validation_receipt: Option<ActionHash>: Link to the ValidationReceipt for this role assignment.
  • Links:
    • AgentProfile -> Role: Assigns a role to an agent. This link's tag could hold validation info (e.g., who validated the role).

4.2. zome_resource Entries

3.2.1. ResourceSpecification

A template for a class of resources.

  • Fields:
    • name: String
    • description: String
    • image_url: Option<String>
    • governance_rules: Vec<GovernanceRule>: Embedded rules for resource access and management. Fulfills REQ-GOV-06.
  • Links:
    • AllResourceSpecifications -> ResourceSpecification: Anchor for discovery.

3.2.2. GovernanceRule

A rule embedded within a ResourceSpecification that defines how resources can be accessed and managed.

  • Fields:
    • rule_type: String: e.g., "access_requirement", "usage_limit", "transfer_conditions"
    • rule_data: String: JSON-encoded rule parameters
    • enforced_by: Option<AgentRole>: Role required to enforce this rule

3.2.3. EconomicResource

A concrete instance of a resource.

  • Fields:
    • conforms_to: ActionHash: Link to the ResourceSpecification.
    • quantity: f64
    • unit: String
    • custodian: AgentPubKey: The Primary Accountable Agent holding the resource.
  • Links:
    • ResourceSpecification -> EconomicResource: Find all resources of a type.
    • AgentProfile -> EconomicResource (as Custodian): Link to the agent currently holding it. Tag: "custodian".

3.2.4. EconomicProcess

Represents structured activities that transform Economic Resources or provide ecosystem services in the nondominium network.

  • Fields:

    • process_type: String: The type of process ("Use", "Transport", "Storage", "Repair")
    • name: String: Human-readable name for the process instance
    • description: Option<String>: Optional description of the specific process
    • required_role: String: Agent role required to initiate this process
    • inputs: Vec<ActionHash>: Links to EconomicResources that are inputs to the process
    • outputs: Vec<ActionHash>: Links to EconomicResources that are outputs from the process
    • started_by: AgentPubKey: Agent who initiated the process
    • started_at: Timestamp: When the process was initiated
    • completed_at: Option<Timestamp>: When the process was completed (None if ongoing)
    • location: Option<String>: Physical or logical location where process occurs
    • status: ProcessStatus: Current status of the process
  • Links:

    • AllEconomicProcesses -> EconomicProcess: Discovery anchor for all processes
    • AgentProfile -> EconomicProcess: Processes initiated by an agent
    • EconomicResource -> EconomicProcess: Link resources to processes that use them
    • EconomicProcess -> EconomicEvent: Events that occur within a process

3.2.5. ProcessStatus

Enumeration representing the current state of an Economic Process.

  • Values:
    • Planned: Process is planned but not yet started
    • InProgress: Process is currently active
    • Completed: Process has finished successfully
    • Suspended: Process is temporarily paused
    • Cancelled: Process was cancelled before completion
    • Failed: Process failed to complete successfully

3.3. zome_governance Entries

3.3.1. EconomicEvent

Records a consummated action on a resource.

  • Fields:
    • action: VfAction: ValueFlows action enum (e.g., Transfer, Use, Produce, InitialTransfer, AccessForUse, TransferCustody)
    • provider: AgentPubKey
    • receiver: AgentPubKey
    • resource_inventoried_as: ActionHash: Link to the EconomicResource
    • affects: ActionHash: Link to the EconomicResource that is affected
    • resource_quantity: f64: Quantity of resource affected by the event
    • event_time: Timestamp: When the event occurred
    • note: Option<String>: Optional notes about the event
  • Links:
    • EconomicResource -> EconomicEvent: History of events for a resource
    • EconomicProcess -> EconomicEvent: Events that occur within a process context

3.3.2. Commitment

An intention to perform an EconomicEvent.

  • Fields:
    • action: VfAction: The intended ValueFlows action (e.g., AccessForUse, Transfer, Use)
    • provider: AgentPubKey
    • receiver: AgentPubKey
    • resource_inventoried_as: Option<ActionHash>: Link to specific resource if applicable
    • resource_conforms_to: Option<ActionHash>: Link to ResourceSpecification if general
    • input_of: Option<ActionHash>: Optional link to an EconomicProcess
    • due_date: Timestamp
    • note: Option<String>: Optional commitment notes
    • committed_at: Timestamp: When the commitment was made
  • Links:
    • AgentProfile -> Commitment: Agent's outgoing/incoming commitments
    • EconomicProcess -> Commitment: Commitments related to a process

3.3.3. Claim

Fulfills a Commitment (public governance record).

  • Fields:
    • fulfills: ActionHash: Link to the Commitment
    • fulfilled_by: ActionHash: Link to the resulting EconomicEvent
    • claimed_at: Timestamp: When the claim was created
    • note: Option<String>: Optional notes about the claim fulfillment
  • Links:
    • Commitment -> Claim: Shows a commitment has been actioned
  • Note: This is the public governance record. Private Participation Receipts (PPRs) are generated alongside Claims to track reputation privately.

3.3.4. ValidationReceipt

Records validation of resources, events, or agent promotions by Accountable Agents.

  • Fields:
    • validator: AgentPubKey: The agent performing the validation
    • validated_item: ActionHash: Link to the item being validated (Resource, Event, Role, or Agent promotion)
    • validation_type: String: e.g., "resource_approval", "process_validation", "identity_verification", "role_assignment", "agent_promotion"
    • approved: bool: Whether the validation was approved or rejected
    • notes: Option<String>: Optional validation notes
  • Links:
    • ValidatedItem -> ValidationReceipt: Track all validations for an item

3.3.5. ResourceValidation

Tracks the overall validation status of a resource requiring peer review.

  • Fields:
    • resource: ActionHash: Link to the EconomicResource being validated
    • validation_scheme: String: e.g., "2-of-3", "simple_majority"
    • required_validators: u32: Number of validators needed
    • current_validators: u32: Number of validators who have responded
    • status: String: "pending", "approved", "rejected"
  • Links:
    • EconomicResource -> ResourceValidation: One validation per resource

3.3.6. PrivateParticipationClaim (Private Entry)

A cryptographically signed receipt stored as a private entry that extends the ValueFlows Claim structure to track agent reliability and form the foundation for the reputation system.

  • Fields:

    • fulfills: ActionHash: Link to the Commitment fulfilled (standard ValueFlows)
    • fulfilled_by: ActionHash: Link to the resulting EconomicEvent (standard ValueFlows)
    • claimed_at: Timestamp: When the claim was created (standard ValueFlows)
    • claim_type: ParticipationClaimType: Type of participation being claimed
    • counterparty: AgentPubKey: The other agent involved in the bi-directional receipt
    • performance_metrics: PerformanceMetrics: Quantitative measures of performance
    • bilateral_signature: CryptographicSignature: Cryptographic proof of mutual agreement
    • interaction_context: String: Context of the interaction (e.g., "resource_creation", "custody_transfer", "maintenance_service")
    • role_context: Option<String>: Specific role context if applicable (e.g., "Transport", "Repair", "Storage")
    • resource_reference: Option<ActionHash>: Link to the resource involved in the interaction
  • Privacy: Stored as Holochain private entry accessible only to the owning agent

  • Links: None (private entries are not linked in DHT for privacy preservation)

3.3.7. ParticipationClaimType

Enumeration defining the types of participation claims that can be issued.

  • Values:
    • ResourceContribution: Receipt for successfully creating and getting a resource validated
    • NetworkValidation: Receipt for performing validation duties
    • ResponsibleTransfer: Receipt for properly transferring resource custody
    • CustodyAcceptance: Receipt for accepting resource custody responsibly
    • ServiceCommitmentAccepted: Receipt for accepting a service commitment
    • GoodFaithTransfer: Receipt for transferring resource in good faith for service
    • ServiceFulfillmentCompleted: Receipt for completing a service successfully
    • MaintenanceFulfillment: Receipt for completing maintenance service
    • StorageFulfillment: Receipt for completing storage service
    • TransportFulfillment: Receipt for completing transport service
    • EndOfLifeDeclaration: Receipt for declaring resource end-of-life
    • EndOfLifeValidation: Receipt for validating resource end-of-life
    • DisputeResolutionParticipation: Receipt for constructive dispute resolution participation
    • GovernanceCompliance: Receipt for consistent adherence to governance protocols

3.3.8. PerformanceMetrics

Quantitative measures of agent performance in economic interactions.

  • Fields:
    • timeliness_score: f64: How promptly the agent fulfilled commitments (0.0-1.0)
    • quality_score: f64: Quality of service provided (0.0-1.0)
    • reliability_score: f64: Consistency and dependability (0.0-1.0)
    • communication_score: f64: Effectiveness of communication (0.0-1.0)
    • completion_rate: f64: Percentage of commitments successfully completed
    • resource_condition_maintained: Option<bool>: Whether resource condition was maintained (for service roles)
    • additional_metrics: Option<String>: JSON-encoded additional context-specific metrics

3.3.9. CryptographicSignature

Cryptographic proof of mutual agreement between agents in bi-directional receipt issuance.

  • Fields:
    • signer: AgentPubKey: Agent who created the signature
    • signature: Signature: Cryptographic signature of the receipt data
    • signed_data_hash: ActionHash: Hash of the data that was signed
    • signature_algorithm: String: Algorithm used for signing (e.g., "Ed25519")
    • created_at: Timestamp: When the signature was created

3.3.10. ReputationSummary

Aggregated reputation metrics derived from an agent's Private Participation Claims.

  • Fields:
    • agent: AgentPubKey: The agent whose reputation is summarized
    • total_interactions: u32: Total number of completed economic interactions
    • average_timeliness: f64: Average timeliness score across all interactions
    • average_quality: f64: Average quality score across all interactions
    • average_reliability: f64: Average reliability score across all interactions
    • average_communication: f64: Average communication score across all interactions
    • completion_rate: f64: Overall percentage of commitments successfully completed
    • role_performance: std::collections::HashMap<String, RolePerformance>: Performance breakdown by role
    • recent_activity: Vec<RecentInteraction>: Summary of recent interactions (last 30 days)
    • calculated_at: Timestamp: When this summary was calculated

3.3.11. RolePerformance

Performance metrics for a specific role.

  • Fields:
    • role_name: String: The role (e.g., "Transport", "Repair", "Storage")
    • interaction_count: u32: Number of interactions in this role
    • average_performance: f64: Average performance score for this role
    • specialization_score: f64: How specialized/expert the agent is in this role
    • last_activity: Timestamp: Most recent activity in this role

3.3.12. RecentInteraction

Summary of a recent economic interaction for reputation display.

  • Fields:
    • interaction_type: String: Type of interaction (e.g., "custody_transfer", "repair_service")
    • counterparty: AgentPubKey: The other agent involved
    • performance_score: f64: Overall performance in this interaction
    • interaction_date: Timestamp: When the interaction occurred
    • resource_involved: Option<ActionHash>: Resource that was involved, if applicable

3.3.13. ProcessValidationRequirements

Defines validation requirements for a specific Economic Process type.

  • Fields:
    • process_type: String: The type of process (e.g., "Use", "Transport", "Repair", "Storage")
    • required_role: Option<String>: Role required to initiate this process
    • minimum_validators: u32: Minimum number of validators required
    • validation_scheme: String: Validation scheme to use (e.g., "simple_majority", "2-of-3")
    • completion_validation_required: bool: Whether completion needs separate validation
    • performance_thresholds: PerformanceThresholds: Minimum performance thresholds
    • special_requirements: Vec<String>: Any special requirements for this process type

3.3.14. PerformanceThresholds

Minimum performance thresholds for process validation.

  • Fields:
    • minimum_timeliness: f64: Minimum acceptable timeliness score
    • minimum_quality: f64: Minimum acceptable quality score
    • minimum_reliability: f64: Minimum acceptable reliability score
    • minimum_communication: f64: Minimum acceptable communication score
    • minimum_completion_rate: f64: Minimum acceptable completion rate

5. Cross-Zome Interface Types

5.1 Governance Transition Request

Interface for requesting state changes from the governance zome:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceTransitionRequest {
    /// The action the requesting agent wants to perform
    pub action: VfAction,
    /// Current state of the resource being modified
    pub resource: EconomicResource,
    /// Agent requesting the state change
    pub requesting_agent: AgentPubKey,
    /// Additional context for the transition
    pub context: TransitionContext,
}
}

5.2 Transition Context

Additional context information for state transitions:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TransitionContext {
    /// Target location for transport/move actions
    pub target_location: Option<String>,
    /// Quantity change for produce/consume actions
    pub quantity_change: Option<f64>,
    /// Target custodian for transfer actions
    pub target_custodian: Option<AgentPubKey>,
    /// Process notes and observations
    pub process_notes: Option<String>,
    /// Associated economic process if applicable
    pub process_context: Option<ActionHash>,
}
}

5.3 Governance Transition Result

Result structure returned by the governance zome:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct GovernanceTransitionResult {
    /// Whether the transition was approved
    pub success: bool,
    /// Updated resource state (if approved)
    pub new_resource_state: Option<EconomicResource>,
    /// Generated economic event for audit trail
    pub economic_event: Option<EconomicEvent>,
    /// Validation receipts from governance evaluation
    pub validation_receipts: Vec<ValidationReceipt>,
    /// Detailed reasons for rejection (if applicable)
    pub rejection_reasons: Option<Vec<String>>,
    /// Required next steps or additional validation needed
    pub next_steps: Option<Vec<String>>,
}
}

6. Zome Functions (Coordinator Zomes)

4.1. zome_person Functions

  • create_profile(name: String, avatar: Option<String>, private_profile: ...) -> Record
  • get_my_profile() -> (Record, Record)
  • get_agent_profile(agent: AgentPubKey) -> Option<Record>
  • assign_role(agent: AgentPubKey, role: String) -> ActionHash (Requires validation by Accountable Agent; for specialized roles, must follow REQ-GOV-06 validation process)
  • promote_agent_to_accountable(simple_agent: AgentPubKey, private_profile_hash: ActionHash) -> ValidationReceipt: Promotes a Simple Agent to Accountable Agent status after successful validation (REQ-GOV-08).
  • get_my_participation_claims() -> Vec<PrivateParticipationClaim>: Returns all private participation receipts for the calling agent.
    • Capability: general_access
  • get_reputation_summary() -> ReputationSummary: Calculates and returns aggregated reputation metrics based on participation claims.
    • Capability: general_access
  • get_participation_claims_by_type(claim_type: ParticipationClaimType) -> Vec<PrivateParticipationClaim>: Returns participation claims filtered by type.
    • Capability: general_access

4.2. zome_resource Functions

  • create_resource_spec(name: String, description: String, governance_rules: Vec<GovernanceRule>) -> Record: Creates a new resource specification with embedded governance rules. Fulfills REQ-GOV-06.
    • Capability: restricted_access (Only Accountable Agents can define new resource types)
  • create_economic_resource(spec_hash: ActionHash, quantity: f64, unit: String) -> Record: Creates a new Economic Resource. This is the first step for a Simple Agent (REQ-USER-S-05). Automatically triggers validation process (REQ-GOV-02).
    • Capability: general_access
  • get_all_resource_specs() -> Vec<Record>: Discovery function for all resource specifications.
    • Capability: general_access
  • get_resources_by_spec(spec_hash: ActionHash) -> Vec<Record>: Filtered discovery by specification.
    • Capability: general_access
  • get_my_resources() -> Vec<Record>: Returns resources where the calling agent is the custodian.
    • Capability: general_access
  • transfer_custody(resource_hash: ActionHash, new_custodian: AgentPubKey) -> Record: Transfers custody and creates an EconomicEvent via cross-zome call to zome_governance. Enforces governance rules (REQ-GOV-07).
    • Capability: restricted_access
  • check_first_resource_requirement(agent: AgentPubKey) -> bool: Checks if an agent has created at least one resource. Fulfills REQ-GOV-01.
    • Capability: general_access
  • initiate_economic_process(process_type: String, resource_hashes: Vec<ActionHash>, location: Option<String>) -> Record: Initiates an Economic Process (Use, Transport, Storage, Repair). Validates agent has required role for the process type.
    • Capability: restricted_access (Role-gated: requires specific credentials for Transport, Repair, Storage)
  • complete_economic_process(process_hash: ActionHash, output_resources: Vec<ActionHash>) -> Record: Completes an Economic Process and records any resource changes.
    • Capability: restricted_access
  • get_active_processes() -> Vec<Record>: Returns all active processes initiated by the calling agent.
    • Capability: general_access
  • get_process_by_resource(resource_hash: ActionHash) -> Vec<Record>: Returns all processes that have used a specific resource.
    • Capability: general_access

4.3. zome_governance Functions

  • propose_commitment(action: VfAction, resource_hash: ActionHash, provider: AgentPubKey, due: Timestamp) -> Record: Creates a future intention to act on a resource.
    • Capability: restricted_access
  • accept_commitment(commitment_hash: ActionHash) -> Record: Accepts a proposed commitment.
    • Capability: restricted_access
  • claim_commitment(commitment_hash: ActionHash, resource_id: ActionHash) -> Record: Fulfills a commitment and creates the corresponding EconomicEvent.
    • Capability: restricted_access
  • log_initial_transfer(resource_hash: ActionHash, receiver: AgentPubKey, quantity: f64) -> Record: A simplified function for a Simple Agent's first transaction (REQ-USER-S-07). This triggers the validation process for Simple Agent promotion (REQ-GOV-02).
    • Capability: general_access
  • validate_new_resource(resource_hash: ActionHash, validation_scheme: String) -> ValidationReceipt: Peer-validates a newly created Resource. Fulfills REQ-USER-A-07 and REQ-GOV-02. Supports configurable validation schemes (REQ-GOV-04).
    • Capability: restricted_access
  • validate_process_event(event_hash: ActionHash) -> ValidationReceipt: Validates an event related to a core process (e.g., Storage, Repair). Fulfills REQ-USER-A-08 and REQ-GOV-05.
    • Capability: restricted_access
  • validate_agent_identity(simple_agent: AgentPubKey, private_profile_hash: ActionHash) -> ValidationReceipt: Validates a Simple Agent's identity information and their first resource transfer, potentially promoting them to Accountable Agent status. Full validation requires access to the agent's private entry. Fulfills REQ-GOV-08.
    • Capability: restricted_access
  • check_validation_status(resource_hash: ActionHash) -> ResourceValidation: Returns the current validation status of a resource.
    • Capability: general_access
  • get_validation_history(item_hash: ActionHash) -> Vec<ValidationReceipt>: Returns all validation receipts for a given item.
    • Capability: general_access
  • validate_process_completion(process_hash: ActionHash) -> ValidationReceipt: Validates that an Economic Process was completed according to its specifications and governance rules.
    • Capability: restricted_access
  • get_process_validation_requirements(process_type: String) -> ProcessValidationRequirements: Returns the validation requirements for a specific process type.
    • Capability: general_access
  • issue_participation_receipts(commitment_hash: ActionHash, event_hash: ActionHash, counterparty: AgentPubKey, performance_metrics: PerformanceMetrics) -> (ActionHash, ActionHash): Issues bi-directional Private Participation Claims for both agents involved in an economic interaction. Returns the action hashes of both receipts.
    • Capability: restricted_access
  • sign_participation_claim(claim_hash: ActionHash, signature: CryptographicSignature) -> Record: Adds cryptographic signature to a participation claim to complete the bi-directional receipt process.
    • Capability: general_access
  • validate_participation_claim_signature(claim_hash: ActionHash) -> bool: Validates the cryptographic signature of a participation claim.
    • Capability: general_access

5. Security and Validation

  • Capability Tokens: Zome functions will be protected by capability grants. Simple Agents get a general token. Accountable Agents get a restricted token after their first validated transaction (REQ-SEC-01).
  • Validation Logic:
    • The zome_person integrity zome will validate that only an Accountable Agent can assign a Role, and that specialized roles (Transport, Repair, Storage) require validation by existing Primary Accountable Agents per REQ-GOV-04 (Specialized Role Validation).
    • The zome_person integrity zome will validate that promotion from Simple Agent to Accountable Agent requires validation by an Accountable or Primary Accountable Agent, following the process in REQ-GOV-03 (Agent Validation).
    • The zome_resource integrity zome ensures a resource cannot be created without a valid ResourceSpecification and enforces embedded governance rules (REQ-GOV-07).
    • The zome_resource integrity zome ensures that new resources start in a 'pending validation' state and are set to 'validated' upon successful peer review, as described in REQ-GOV-02 (Resource Validation).
    • The zome_governance integrity zome ensures a Claim matches its Commitment and validates all validation receipts for authenticity.
    • The system supports configurable validation schemes (e.g., 2-of-3, N-of-M reviewers) for Resource approval per REQ-GOV-06 (Multi-Reviewer Validation).
    • Certain types of validation are restricted to Agents with specific Roles per REQ-GOV-05 (Role-Gated Validation).
    • The zome_resource integrity zome validates that Economic Processes can only be initiated by agents with appropriate roles (Transport, Repair, Storage processes require specific credentials).
    • Economic Process validation ensures that:
      • Only agents with required roles can initiate specific process types
      • Process inputs and outputs are properly linked to existing Economic Resources
      • Process completion triggers appropriate Economic Events
      • Resource state changes are validated according to process type (e.g., Repair may change resource state, Transport preserves state)
  • Cross-Zome Calls: Functions will call other zomes to maintain transactional integrity (e.g., transfer_custody must create a valid EconomicEvent and enforce governance rules, initiate_economic_process must validate agent roles across zomes).
  • First Resource Requirement: The system enforces that Simple Agents must create at least one resource before accessing others (REQ-GOV-01), implemented through the check_first_resource_requirement function.
  • Process Role Enforcement: Economic Processes enforce role-based access control where specialized processes (Transport, Repair, Storage) require agents to hold appropriate validated credentials, while Use processes are accessible to all Accountable Agents.
  • Private Participation Receipt (PPR) Validation:
    • PPR issuance is automatically triggered for every completed economic interaction that involves a Commitment-Claim-Event cycle
    • Bi-directional receipt generation ensures both agents receive appropriate participation claims
    • Cryptographic signature validation ensures authenticity and prevents manipulation
    • Performance metrics are validated to be within acceptable ranges (0.0-1.0 for scores)
    • PPR claim types must correspond to the actual economic action performed
    • End-of-life declarations require multiple validator participation receipts with enhanced security measures
    • Private entry storage ensures receipt privacy while maintaining auditability for the owning agent

6. Future Development: Architecture Specifications for P2P and Organizational Contexts

6.1 Overview

This section specifies the technical architecture for supporting two distinct deployment contexts:

  • Pure P2P Context: Individual humans directly using Nondominium
  • Organizational Context: Organizations accessing Nondominium through bridge services (ERP, Tiki, etc.)

These specifications correspond to the future development requirements defined in REQ-FUT-* series.

6.2 Identity & Delegation Architecture

6.2.1 Organizational Agent Identity

SPEC-FUT-ID-01: Organizational Agent Entry

New entry type for representing organizational agents:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalAgent {
    /// Unique identifier for the organization
    pub org_id: AgentPubKey,
    /// Human-readable organization name
    pub org_name: String,
    /// Legal entity information (optional)
    pub legal_entity_info: Option<LegalEntityInfo>,
    /// Organization type (e.g., "cooperative", "corporation", "nonprofit")
    pub org_type: String,
    /// Root signing authority for the organization
    pub root_authority: AgentPubKey,
    /// Active delegation policy
    pub delegation_policy: DelegationPolicy,
    /// Created timestamp
    pub created_at: Timestamp,
}
}

SPEC-FUT-ID-02: Delegation Entry

Entry type for employee/member delegations:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Delegation {
    /// The organizational agent granting delegation
    pub delegator: AgentPubKey,
    /// The employee/member receiving delegation
    pub delegate: AgentPubKey,
    /// Scoped capabilities (e.g., ["Transport", "Use"])
    pub capabilities: Vec<String>,
    /// Monetary or quantity limits (optional)
    pub limits: Option<DelegationLimits>,
    /// Expiry timestamp (optional, None = no expiry)
    pub expires_at: Option<Timestamp>,
    /// Status: "active", "revoked", "expired"
    pub status: DelegationStatus,
    /// Created timestamp
    pub created_at: Timestamp,
    /// Revoked timestamp (if applicable)
    pub revoked_at: Option<Timestamp>,
}
}

SPEC-FUT-ID-03: Delegation Limits

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct DelegationLimits {
    /// Maximum transaction value
    pub max_value: Option<f64>,
    /// Maximum resource quantity
    pub max_quantity: Option<f64>,
    /// Allowed resource types
    pub allowed_resource_specs: Option<Vec<ActionHash>>,
    /// Geographic restrictions
    pub geographic_limits: Option<Vec<String>>,
}
}

SPEC-FUT-ID-04: Delegation Validation

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn validate_delegation(delegation_hash: ActionHash, action: VfAction) -> ExternResult<bool> {
    // Check delegation status (active/revoked/expired)
    // Verify capability scope includes requested action
    // Validate limits are not exceeded
    // Return authorization result
}
}

6.2.2 Delegation Zome Functions

SPEC-FUT-ID-05: Delegation Management Functions

#![allow(unused)]
fn main() {
// Create delegation for employee/member
#[hdk_extern]
pub fn create_delegation(
    delegate: AgentPubKey,
    capabilities: Vec<String>,
    limits: Option<DelegationLimits>,
    expires_at: Option<Timestamp>
) -> ExternResult<ActionHash>;

// Revoke delegation immediately
#[hdk_extern]
pub fn revoke_delegation(delegation_hash: ActionHash) -> ExternResult<()>;

// Get all active delegations for an organization
#[hdk_extern]
pub fn get_active_delegations(org_agent: AgentPubKey) -> ExternResult<Vec<Delegation>>;

// Check if delegate has specific capability
#[hdk_extern]
pub fn check_delegation_capability(
    delegate: AgentPubKey,
    capability: String
) -> ExternResult<bool>;
}

6.3 Organizational Reputation Architecture

6.3.1 Organizational PPR Aggregation

SPEC-FUT-REP-01: Organizational Participation Claim

Extended PPR structure for organizational context:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalParticipationClaim {
    /// Standard PPR fields
    pub base_claim: PrivateParticipationClaim,
    /// The delegate who performed the action
    pub performed_by: Option<AgentPubKey>,
    /// Internal attribution hash (for org audit)
    pub internal_attribution: Option<Hash>,
    /// Whether this was an organizational or personal action
    pub action_context: ActionContext,
}
}

SPEC-FUT-REP-02: Reputation Aggregation

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalReputationSummary {
    /// The organizational agent
    pub org_agent: AgentPubKey,
    /// Standard reputation metrics (external view)
    pub external_reputation: ReputationSummary,
    /// Internal attribution by delegate (private)
    pub delegate_performance: HashMap<AgentPubKey, ReputationSummary>,
    /// Aggregate organizational metrics
    pub org_metrics: OrganizationalMetrics,
}
}

SPEC-FUT-REP-03: Organizational Metrics

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalMetrics {
    /// Total active delegates
    pub active_delegates: u32,
    /// Organizational transaction volume
    pub transaction_volume: u32,
    /// Organizational reliability score
    pub org_reliability: f64,
    /// Resource pool size
    pub resource_pool_size: u32,
}
}

6.3.2 Reputation Functions

SPEC-FUT-REP-04: Organizational Reputation Functions

#![allow(unused)]
fn main() {
// Get organizational reputation (external view)
#[hdk_extern]
pub fn get_organizational_reputation(org_agent: AgentPubKey) -> ExternResult<OrganizationalReputationSummary>;

// Get delegate performance (organizational admin only)
#[hdk_extern]
pub fn get_delegate_performance(
    org_agent: AgentPubKey,
    delegate: AgentPubKey
) -> ExternResult<ReputationSummary>;

// Issue organizational PPR with internal attribution
#[hdk_extern]
pub fn issue_organizational_ppr(
    commitment_hash: ActionHash,
    event_hash: ActionHash,
    performed_by: AgentPubKey,
    performance_metrics: PerformanceMetrics
) -> ExternResult<ActionHash>;
}

6.4 Bridge Service Architecture

6.4.1 Node.js Bridge Service Specification

SPEC-FUT-BRG-01: Bridge Service Core Architecture

The bridge service acts as a RESTful interface between organizational systems (ERP, Tiki) and Holochain:

Organizational System (PHP/Python) <--HTTP/JSON--> Node.js Bridge <--WebSocket--> Holochain Conductor

Components:

  • REST API Layer: Express.js or Fastify for HTTP endpoints
  • Holochain Client: @holochain/client for WebSocket communication
  • Cache Layer: Redis for frequently accessed data
  • Queue Layer: Bull/BullMQ for async operations
  • Signal Handler: Real-time event forwarding to organizational systems

SPEC-FUT-BRG-02: Bridge Service Data Structures

// Bridge configuration
interface BridgeConfig {
  adminWsUrl: string;        // Holochain Admin WebSocket URL
  appWsUrl: string;          // Holochain App WebSocket URL
  appId: string;             // Nondominium hApp ID
  redisUrl: string;          // Redis connection URL
  orgWebhookUrl: string;     // Organizational system webhook endpoint
  webhookSecret: string;     // HMAC signature secret
  cacheEnabled: boolean;     // Enable/disable caching
  cacheTTL: number;          // Cache time-to-live (seconds)
}

// Bridge request format
interface BridgeRequest {
  dna_hash: string;          // Nondominium DNA hash
  agent_key: string;         // Organizational agent key
  zome: string;              // Target zome name
  function: string;          // Target function name
  payload: any;              // Function payload
  delegate?: string;         // Optional delegate agent key
}

// Bridge response format
interface BridgeResponse {
  success: boolean;
  data?: any;
  error?: string;
  cached?: boolean;
  timestamp: number;
}

SPEC-FUT-BRG-03: Bridge REST API Endpoints

Core endpoints that organizational systems interact with:

// Resource management
POST   /api/resources
GET    /api/resources/search
GET    /api/resources/:hash
POST   /api/resources/:hash/use
DELETE /api/resources/:hash

// Transaction management
POST   /api/commitments
GET    /api/commitments/:hash
POST   /api/events
GET    /api/events/by-resource/:resource_hash

// Reputation queries
GET    /api/reputation/:agent_id/summary
GET    /api/reputation/:agent_id/receipts

// Batch operations
POST   /api/batch

// Organizational management
POST   /api/org/delegations
DELETE /api/org/delegations/:hash
GET    /api/org/delegations/active
GET    /api/org/reputation

// Health and monitoring
GET    /health
GET    /metrics

SPEC-FUT-BRG-04: Signal Forwarding

Real-time signal forwarding from Holochain to organizational systems:

// Signal handler
class SignalForwarder {
  async handleSignal(signal: HolochainSignal): Promise<void> {
    // Transform Holochain signal to organizational format
    const orgEvent = this.transformSignal(signal);
    
    // POST to organizational webhook
    await this.postToWebhook(orgEvent);
  }
  
  private transformSignal(signal: HolochainSignal): OrganizationalEvent {
    return {
      type: signal.data.type,
      payload: signal.data.payload,
      timestamp: Date.now(),
      signature: this.generateHMAC(signal)
    };
  }
}

6.4.2 Organizational System Integration

SPEC-FUT-BRG-05: PHP Client Library

PHP library for Tiki and similar systems:

class NondominiumClient {
    private $bridge_url;
    private $org_agent_key;
    private $delegate_key;
    
    public function __construct($bridge_url, $org_agent_key, $delegate_key = null);
    
    // Resource operations
    public function createResource($spec_hash, $quantity, $unit);
    public function searchResources($query = null);
    public function initiateUse($resource_hash, $receiver, $start_time, $end_time);
    
    // Batch operations
    public function batchOperations($operations);
    
    // Reputation queries
    public function getOrganizationalReputation();
    public function getDelegatePerformance($delegate_agent);
    
    // Delegation management
    public function createDelegation($delegate, $capabilities, $limits = null);
    public function revokeDelegation($delegation_hash);
}

SPEC-FUT-BRG-06: Python Client Library

Python library for ERPLibre/Odoo:

class NondominiumBridgeClient:
    def __init__(self, bridge_url: str, org_agent_key: str, delegate_key: str = None):
        self.bridge_url = bridge_url
        self.org_agent_key = org_agent_key
        self.delegate_key = delegate_key
    
    # Resource operations
    def create_resource(self, spec_hash: str, quantity: float, unit: str) -> dict:
        pass
    
    def search_resources(self, query: str = None) -> list:
        pass
    
    # Batch operations
    def batch_operations(self, operations: list) -> list:
        pass
    
    # Webhook handling
    def handle_signal(self, signal: dict) -> None:
        pass

6.5 Organizational Governance Architecture

6.5.1 Policy-Driven Governance

SPEC-FUT-GOV-01: Organizational Governance Policy

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalGovernancePolicy {
    /// Organization this policy applies to
    pub org_agent: AgentPubKey,
    /// Automated approval rules
    pub approval_rules: Vec<ApprovalRule>,
    /// Multi-signature requirements
    pub multisig_requirements: Vec<MultiSigRequirement>,
    /// Policy version
    pub version: String,
    /// Policy effective date
    pub effective_at: Timestamp,
}
}

SPEC-FUT-GOV-02: Approval Rule

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ApprovalRule {
    /// Rule name
    pub name: String,
    /// Conditions for automatic approval
    pub conditions: Vec<Condition>,
    /// Actions this rule applies to
    pub applies_to: Vec<VfAction>,
    /// Whether approval is automatic or manual
    pub auto_approve: bool,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Condition {
    pub field: String,           // e.g., "resource_value", "borrower_reputation"
    pub operator: Operator,      // e.g., "greater_than", "less_than", "equals"
    pub value: String,           // Comparison value
}
}

SPEC-FUT-GOV-03: Multi-Signature Requirement

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct MultiSigRequirement {
    /// Transaction types requiring multi-sig
    pub transaction_types: Vec<String>,
    /// Minimum number of signatures required
    pub min_signatures: u32,
    /// Required roles for signers
    pub required_roles: Vec<String>,
    /// Value threshold for triggering multi-sig
    pub value_threshold: Option<f64>,
}
}

6.5.2 Governance Functions

SPEC-FUT-GOV-04: Organizational Governance Functions

#![allow(unused)]
fn main() {
// Set organizational governance policy
#[hdk_extern]
pub fn set_governance_policy(policy: OrganizationalGovernancePolicy) -> ExternResult<ActionHash>;

// Evaluate approval request against policy
#[hdk_extern]
pub fn evaluate_approval_request(
    action: VfAction,
    context: ApprovalContext
) -> ExternResult<ApprovalDecision>;

// Initiate multi-signature transaction
#[hdk_extern]
pub fn initiate_multisig_transaction(
    action: VfAction,
    resource_hash: ActionHash,
    required_signers: Vec<AgentPubKey>
) -> ExternResult<ActionHash>;

// Sign multi-signature transaction
#[hdk_extern]
pub fn sign_multisig_transaction(
    transaction_hash: ActionHash,
    signature: CryptographicSignature
) -> ExternResult<()>;

// Check multi-signature completion
#[hdk_extern]
pub fn check_multisig_status(transaction_hash: ActionHash) -> ExternResult<MultiSigStatus>;
}

6.6 Device & Session Management

6.6.1 Session Management Architecture

SPEC-FUT-DEV-01: Session Entry

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalSession {
    /// Session identifier
    pub session_id: String,
    /// Organizational agent
    pub org_agent: AgentPubKey,
    /// Delegate agent for this session
    pub delegate: AgentPubKey,
    /// Device identifier
    pub device_id: String,
    /// Session creation time
    pub created_at: Timestamp,
    /// Session expiry time
    pub expires_at: Timestamp,
    /// Session status
    pub status: SessionStatus,
    /// OAuth/SSO token reference (hashed)
    pub auth_token_hash: Option<Hash>,
}
}

SPEC-FUT-DEV-02: Device Registration

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct RegisteredDevice {
    /// Device identifier
    pub device_id: String,
    /// Organization this device belongs to
    pub org_agent: AgentPubKey,
    /// Device type (e.g., "tablet", "mobile", "workstation")
    pub device_type: String,
    /// Whether device is shared or personal
    pub is_shared: bool,
    /// Registered delegates for this device
    pub authorized_delegates: Vec<AgentPubKey>,
    /// Device registration time
    pub registered_at: Timestamp,
    /// Device status
    pub status: DeviceStatus,
}
}

6.6.2 Session Functions

SPEC-FUT-DEV-03: Session Management Functions

#![allow(unused)]
fn main() {
// Create organizational session
#[hdk_extern]
pub fn create_session(
    delegate: AgentPubKey,
    device_id: String,
    auth_token_hash: Option<Hash>
) -> ExternResult<String>; // Returns session_id

// Validate active session
#[hdk_extern]
pub fn validate_session(session_id: String) -> ExternResult<bool>;

// Terminate session
#[hdk_extern]
pub fn terminate_session(session_id: String) -> ExternResult<()>;

// Map OAuth token to Holochain capability
#[hdk_extern]
pub fn map_oauth_to_capability(
    oauth_token_hash: Hash,
    delegate: AgentPubKey
) -> ExternResult<CapabilityGrant>;

// Register organizational device
#[hdk_extern]
pub fn register_device(
    device_id: String,
    device_type: String,
    is_shared: bool
) -> ExternResult<ActionHash>;

// Revoke device access remotely
#[hdk_extern]
pub fn revoke_device_access(device_id: String) -> ExternResult<()>;
}

6.7 Custody vs Ownership Architecture

6.7.1 Organizational Resource Ownership

SPEC-FUT-OWN-01: Extended Resource Entry

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct OrganizationalEconomicResource {
    /// Standard resource fields
    pub base_resource: EconomicResource,
    /// Owner (may differ from custodian in org context)
    pub owner: AgentPubKey,
    /// Current physical location
    pub location: Option<LocationInfo>,
    /// Internal organizational tracking ID
    pub internal_id: Option<String>,
    /// Legal contract attachment (hashed)
    pub contract_hash: Option<Hash>,
}
}

SPEC-FUT-OWN-02: Location Tracking

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct LocationInfo {
    /// Location type (e.g., "warehouse", "service_truck", "customer_site")
    pub location_type: String,
    /// Location identifier
    pub location_id: String,
    /// Geographic coordinates (optional)
    pub coordinates: Option<(f64, f64)>,
    /// Updated timestamp
    pub updated_at: Timestamp,
}
}

SPEC-FUT-OWN-03: Internal Transfer Event

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct InternalTransferEvent {
    /// Resource being transferred
    pub resource: ActionHash,
    /// Organization owning the resource
    pub organization: AgentPubKey,
    /// Previous custodian (employee)
    pub from_custodian: AgentPubKey,
    /// New custodian (employee)
    pub to_custodian: AgentPubKey,
    /// Previous location
    pub from_location: Option<LocationInfo>,
    /// New location
    pub to_location: Option<LocationInfo>,
    /// Transfer timestamp
    pub transferred_at: Timestamp,
    /// Does NOT trigger ownership change
    pub is_internal: bool,
}
}

6.7.2 Ownership Functions

SPEC-FUT-OWN-04: Organizational Ownership Functions

#![allow(unused)]
fn main() {
// Internal custody transfer (within organization)
#[hdk_extern]
pub fn internal_custody_transfer(
    resource_hash: ActionHash,
    new_custodian: AgentPubKey,
    new_location: Option<LocationInfo>
) -> ExternResult<ActionHash>;

// Update resource location without custody change
#[hdk_extern]
pub fn update_resource_location(
    resource_hash: ActionHash,
    location: LocationInfo
) -> ExternResult<()>;

// Attach legal contract to commitment
#[hdk_extern]
pub fn attach_contract(
    commitment_hash: ActionHash,
    contract_hash: Hash
) -> ExternResult<()>;

// Reconcile organizational inventory
#[hdk_extern]
pub fn reconcile_inventory(
    org_agent: AgentPubKey,
    inventory_snapshot: Vec<ResourceInventoryItem>
) -> ExternResult<ReconciliationReport>;
}

6.8 Architecture Modularity Specifications

SPEC-FUT-ARCH-01: Context Detection

The system should automatically detect operational context:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum AgentContext {
    PureP2P,                              // Individual human agent
    Organizational(OrganizationalAgent),  // Organizational agent
    Delegate(AgentPubKey, AgentPubKey),  // Delegate acting for organization
}

// Determine agent context
#[hdk_extern]
pub fn get_agent_context(agent: AgentPubKey) -> ExternResult<AgentContext>;
}

SPEC-FUT-ARCH-02: Pluggable Governance

Governance logic should be modular and swappable:

#![allow(unused)]
fn main() {
pub trait GovernanceModule {
    fn evaluate_action(&self, action: VfAction, context: ActionContext) -> Result<ApprovalDecision>;
    fn get_validation_requirements(&self, action: VfAction) -> ValidationRequirements;
}

// P2P Governance Module
pub struct P2PGovernanceModule;
impl GovernanceModule for P2PGovernanceModule { /* ... */ }

// Organizational Governance Module
pub struct OrganizationalGovernanceModule;
impl GovernanceModule for OrganizationalGovernanceModule { /* ... */ }
}

SPEC-FUT-ARCH-03: Unified Reputation Framework

Reputation calculation should work across contexts:

#![allow(unused)]
fn main() {
pub trait ReputationCalculator {
    fn calculate_reputation(&self, agent: AgentPubKey) -> Result<ReputationSummary>;
    fn aggregate_pprs(&self, claims: Vec<PrivateParticipationClaim>) -> PerformanceMetrics;
}

// Works for both P2P and organizational agents
#[hdk_extern]
pub fn calculate_unified_reputation(agent: AgentPubKey) -> ExternResult<ReputationSummary> {
    let context = get_agent_context(agent)?;
    let calculator = match context {
        AgentContext::PureP2P => P2PReputationCalculator::new(),
        AgentContext::Organizational(_) => OrganizationalReputationCalculator::new(),
        AgentContext::Delegate(org, _) => OrganizationalReputationCalculator::new(),
    };
    calculator.calculate_reputation(agent)
}
}

6.9 Deployment Specifications

SPEC-FUT-DEPLOY-01: Docker Compose Architecture

Standard deployment for organizational integration:

services:
  holochain:
    image: holochain/holochain:latest
    ports:
      - "8000:8000"  # Admin WebSocket
      - "8888:8888"  # App WebSocket
  
  bridge:
    build: ./bridge-service
    environment:
      - HC_ADMIN_WS_URL=ws://holochain:8000
      - HC_APP_WS_URL=ws://holochain:8888
      - REDIS_URL=redis://redis:6379
    depends_on:
      - holochain
      - redis
  
  redis:
    image: redis:7-alpine
  
  organizational_system:
    # ERP, Tiki, or other organizational platform
    depends_on:
      - bridge

SPEC-FUT-DEPLOY-02: Bridge Service Health Monitoring

interface HealthStatus {
  status: 'healthy' | 'degraded' | 'unhealthy';
  holochain: {
    connected: boolean;
    latency: number;
  };
  redis: {
    connected: boolean;
    memory_usage: number;
  };
  queue: {
    jobs_pending: number;
    jobs_failed: number;
  };
  uptime: number;
  version: string;
}

// Health check endpoint
GET /health -> HealthStatus

6.10 Implementation Priorities

Phase 1 (Current): Pure P2P implementation

  • Focus: Individual agents, direct custody, simple governance

Phase 2 (Near-term Future Development):

  • Delegation pattern (SPEC-FUT-ID-01 through SPEC-FUT-ID-05)
  • Organizational reputation (SPEC-FUT-REP-01 through SPEC-FUT-REP-04)
  • Basic bridge service (SPEC-FUT-BRG-01 through SPEC-FUT-BRG-03)

Phase 3 (Long-term Future Development):

  • Multi-signature governance (SPEC-FUT-GOV-01 through SPEC-FUT-GOV-04)
  • Session & device management (SPEC-FUT-DEV-01 through SPEC-FUT-DEV-03)
  • Full organizational features (custody vs ownership, policy automation)

6.11 Migration Strategy

SPEC-FUT-MIGRATE-01: Backward Compatibility

New organizational features must not break existing P2P functionality:

  • P2P agents can interact with organizational agents seamlessly
  • Core ValueFlows data structures remain unchanged
  • Organizational features are additive, not breaking changes

SPEC-FUT-MIGRATE-02: Data Migration

When transitioning from P2P-only to organizational support:

  • Existing PPRs remain valid and portable
  • Existing resources can be claimed by organizations
  • Agent identities can be promoted to organizational agents

7. MVP UI Layer Specifications

Status: Implemented. Full design rationale in documentation/specifications/ui_architecture.md. Normative UI requirements in documentation/requirements/ui_design.md and documentation/requirements/requirements.md §4.5.

7.1 Shared Types — @nondominium/shared-types

The following interfaces are defined in packages/shared-types/src/resource.types.ts and consumed by both the service layer and Svelte components:

// NDO Layer 0 identity anchor
interface NdoDescriptor {
  name: string;
  property_regime: PropertyRegime;
  resource_nature: ResourceNature;
  lifecycle_stage: LifecycleStage;
  description?: string;
  initiator: AgentPubKey;        // base64-encoded
  created_at: Timestamp;
  successor_ndo_hash?: ActionHash;
  hibernation_origin?: LifecycleStage;
  action_hash: ActionHash;
  entry_hash: EntryHash;
}

// NDO creation payload (mirrors Rust NondominiumIdentityInput)
interface NdoInput {
  name: string;
  property_regime: PropertyRegime;
  resource_nature: ResourceNature;
  lifecycle_stage: LifecycleStage;
  description?: string;
}

// Lifecycle transition payload
interface UpdateLifecycleStageInput {
  ndo_original_action_hash: ActionHash;
  new_lifecycle_stage: LifecycleStage;
  transition_event_hash: ActionHash | null; // null in MVP
  successor_ndo_hash?: ActionHash;          // required for Deprecated
}

// Transition history entry
interface NdoTransitionHistoryEvent {
  from_stage: LifecycleStage;
  to_stage: LifecycleStage;
  agent: AgentPubKey;
  timestamp: Timestamp;
  event_hash: ActionHash;
}

// Group shell (localStorage-persisted in MVP)
interface GroupDescriptor {
  id: string;
  name: string;
  createdBy?: string;
  createdAt?: number;
  ndoHashes?: string[];         // base64 ActionHash[] of NDOs created in this group
  memberProfile?: GroupMemberProfile;
}

// Level 1 identity — Lobby user profile
interface LobbyUserProfile {
  nickname: string;              // required
  realName?: string;
  bio?: string;
  email?: string;
  phone?: string;
  address?: string;
}

// Level 2 identity — per-group disclosure preferences
interface GroupMemberProfile {
  isAnonymous: boolean;
  shownFields: (keyof Omit<LobbyUserProfile, 'nickname'>)[];
}

7.2 Service Layer

Services are Effect-TS Context.Tag / Layer values. All zome calls are wrapped via wrapZomeCallWithErrorFactory:

const wz = <T>(fnName: string, payload: unknown, context: string) =>
  wrapZomeCallWithErrorFactory<T, DomainError>(
    holochainClient, 'zome_name', fnName, payload, context,
    DomainError.fromError
  );

resource.service.ts — NDO-specific zome calls added for MVP:

FunctionZome call
createNdo(input)create_ndo
getNdo(hash)get_ndo
updateLifecycleStage(input)update_lifecycle_stage
getMyNdos()get_my_ndos
getNdosByLifecycleStage(stage)get_ndos_by_lifecycle_stage
getNdosByNature(nature)get_ndos_by_nature
getNdosByPropertyRegime(regime)get_ndos_by_property_regime
getNdoTransitionHistory(hash)get_ndo_transition_history

lobby.service.ts — localStorage-backed (Group DNA deferred):

FunctionBehaviour
getMyGroups()Reads localStorage[ndo_groups_v1]
createGroup(name, createdBy)Appends to localStorage; generates grp_<ts>_<rand> id
joinGroup(inviteCode)Decodes base64 invite, deduplicates by id
generateInviteLink(groupId)Returns btoa(JSON.stringify(group))

ndo.service.ts — higher-level aggregation:

FunctionBehaviour
getLobbyNdoDescriptors()Calls resource.getAllNdos()
createNdo(input, groupId)Calls resource.createNdo, then appends hash to group's ndoHashes in localStorage
getGroupNdoDescriptors(groupId)Filters all descriptors by group.ndoHashes
getNdoTransitionHistory(hash)Calls resource.getNdoTransitionHistory; returns [] gracefully on 404

7.3 Error Context Registry

New error context strings added to ui/src/lib/errors/error-contexts.ts:

RESOURCE_CONTEXTS.CREATE_NDO
RESOURCE_CONTEXTS.GET_NDO
RESOURCE_CONTEXTS.UPDATE_LIFECYCLE_STAGE
RESOURCE_CONTEXTS.GET_MY_NDOS
RESOURCE_CONTEXTS.GET_NDOS_BY_LIFECYCLE_STAGE
RESOURCE_CONTEXTS.GET_NDOS_BY_NATURE
RESOURCE_CONTEXTS.GET_NDOS_BY_PROPERTY_REGIME
RESOURCE_CONTEXTS.GET_NDO_TRANSITION_HISTORY

7.4 Store Specifications

app.context.svelte.ts

Module-level reactive state (Svelte 5 rune pattern). lobbyUserProfile is hydrated from localStorage at import time and persisted reactively:

// Initialised from localStorage at module load
let lobbyUserProfile = $state<LobbyUserProfile | null>(loadProfileFromStorage());
// Reactive setter — persists to localStorage on write

lobby.store.svelte.ts

StateTypeDescription
ndosNdoDescriptor[]All NDOs from DHT
filteredNdosNdoDescriptor[]ndos after activeFilters applied
groupsGroupDescriptor[]From LobbyService.getMyGroups()
activeFiltersActiveFilters{ lifecycleStages, natures, regimes }

Filter logic: OR within each dimension, AND across dimensions. Empty set = show all.

group.store.svelte.ts — new file

StateSource
grouplocalStorage lookup by groupId
groupNdosNdoService.getGroupNdoDescriptors(groupId)

loadGroupData(groupId) switches the store's active group context. createNdo(input) creates on DHT then reloads.

7.5 LifecycleStage State Machine

Allowed transitions enforced in both LifecycleTransitionModal.svelte (frontend) and zome_resource validation (Rust):

Ideation        → Specification | Deprecated | EndOfLife
Specification   → Development | Deprecated | EndOfLife
Development     → Prototype | Deprecated | EndOfLife
Prototype       → Stable | Deprecated | EndOfLife
Stable          → Distributed | Deprecated | EndOfLife
Distributed     → Active | Deprecated | EndOfLife
Active          → Hibernating | Deprecated | EndOfLife
Hibernating     → <hibernation_origin> | Deprecated | EndOfLife
Deprecated      → EndOfLife
EndOfLife       → (terminal, no transitions)

Special transition behaviours:

  • → Deprecated: successor_ndo_hash required; searched from lobbyStore.ndos by name.
  • → Hibernating: confirmation prompt shown; hibernation_origin = current stage preserved in entry.
  • transition_event_hash: passed as null in MVP; automatic EconomicEvent generation is deferred to backend Phase 2.3 (PPR system).

project: nondominium type: architecture status: active created: 2026-03-25 version: v1.0 design

Nondominium v1.0 — Architecture & Data Model Design

Design session: 2026-03-25 Basis: ValueFlows 1.0 ontology + NDO Prima Materia Scope: Three-zome Holochain DNA — data model, VF compliance, zome boundaries, coordinator signatures


1. Design Principles

1.0 Dual-DNA Architecture (Ground Rule)

Nondominium runs as a dual-DNA hApphrea DNA + ndo DNA, both registered as roles in happ.yaml. NDO does not re-implement VF entry types. All VF core types are owned by the hrea DNA. NDO coordinates governance, identity, and accountability on top of hREA via cross-DNA calls (CallTargetCell::OtherRole("hrea")).

Lives in hREA DNALives in NDO DNA
EconomicResource, EconomicEventNondominiumIdentity (Layer 0)
Commitment, Agreement, PlanGovernanceRule, CapabilitySlot
ResourceSpecification (VF core)PrivateParticipationClaim (PPR)
Process, Intent (post-v1.0)ValidationReceipt, ResourceValidation
ReaAgent, ReaUnitEncryptedProfile, Person
All VF 1.0 typesAll NDO governance/identity extensions

NDO zomes interact with hREA via:

  • call(CallTargetCell::OtherRole("hrea"), "hrea", fn_name, input) — from coordinator
  • Storing returned ActionHash values in NDO-side link structures for traversal

hREA dependency: NDO v1.0 depends on hREA reaching a target compliance state. See documentation/hREA/strategic-roadmap.md (Phase 1 gap closure) and documentation/hREA/valueflows-1.0-compliance.md for the full audit. P0 gaps (effortQuantity, vf:Claim) must land in hREA before NDO's full work-event and reciprocity workflows are available.

1.1 VF 1.0 as the Floor, NDO Innovations as the Extension

ValueFlows 1.0 defines the economic ontology. VF core classes are provided by the hREA DNA. Every VF class either:

  • Delegated to hREA — NDO calls hREA coordinator functions and stores returned hashes
  • Extended by NDO — NDO adds a companion entry type with NDO-specific fields linked to the hREA hash
  • Is deferred from v1.0 scope (Intent, vf:Claim as reciprocity — handled by hREA post-Phase 1)

NDO adds above the VF floor:

NDO ExtensionRelationship to VF
NondominiumIdentity (Layer 0)Not in VF — resource identity anchor
LifecycleStageNot in VF — resource maturity stages
OperationalStateReplaces VF's string state with typed enum
PropertyRegimeNot in VF — governance classification
ResourceNatureNot in VF — Digital/Physical/Hybrid
GovernanceRuleNot in VF — embedded Ostromian governance
CapabilitySlot surfaceNot in VF — stigmergic attachment
PrivateParticipationClaim (PPR)Extends vf:Claim with bilateral signatures

1.2 Governance-as-Operator (preserve)

zome_resource = pure data model. No business logic. zome_gouvernance = state transition operator. Reads resource state, evaluates rules, approves or rejects transitions, generates EconomicEvents.

This boundary is non-negotiable. It enables swappable governance without touching the data model.

1.3 Three-Layer NDO (new in v1.0)

Every resource begins as a Layer 0 identity anchor and grows in structural complexity as its social complexity demands:

Layer 2 — PROCESS (EconomicEvents, Commitments, PPRs)
     ↑ activated by NDOToProcess link
Layer 1 — SPECIFICATION (ResourceSpecification, GovernanceRules)
     ↑ activated by NDOToSpecification link
Layer 0 — IDENTITY (NondominiumIdentity — permanent, immutable name+regime+nature+lifecycle)

2. VF 1.0 Class Mapping

Legend: hREA = provided by hREA DNA (cross-DNA call from NDO) · NDO = native NDO entry type · NDO+hREA = NDO extends hREA with a companion entry

VF ClassDNAEntry / MechanismNDO Zomev1.0 StatusNotes
vf:AgenthREAReaAgent via cross-DNA callzome_personPartial — individual onlyNDO also stores AgentPubKey + Person
vf:EconomicResourcehREAReaEconomicResource via cross-DNAzome_resourceFull (via hREA)NDO stores returned hash; links to NondominiumIdentity
vf:ResourceSpecificationNDO+hREAReaResourceSpecification (hREA) + ResourceSpecification extension (NDO)zome_resourceFullNDO extension holds: category, tags, is_active, image
vf:EconomicEventhREAReaEconomicEvent via cross-DNAzome_gouvernanceFull (via hREA)NDO calls hREA; stores hash for PPR linkage
vf:CommitmenthREAReaCommitment via cross-DNAzome_gouvernanceFull (via hREA)NDO calls hREA; links PPR to hREA Commitment hash
vf:AgreementhREAReaAgreement via cross-DNAzome_gouvernanceFull (via hREA)NDO calls hREA post-Phase 1a (reciprocal fields)
vf:ClaimNDOFulfillment (Rust: Claim — ADR-004)zome_gouvernancePartialNDO fulfillment bridge; hREA vf:Claim = post-Phase 1c
vf:ProcesshREAReaProcess via cross-DNAzome_gouvernanceBasic (via hREA)NDO Layer 2 activation links to hREA Process hash
vf:UnitNDOUnitzome_resourceFullNDO-local for now; may delegate to hREA post-v1.0
vf:IntentPost-v1.0Valid VF 1.0 class — deferred; CapabilitySlot path
NDO: NondominiumIdentityNDONondominiumIdentityzome_resourceNewLayer 0 permanent identity anchor
NDO: GovernanceRuleNDOGovernanceRulezome_resourceEnhancedGovernanceRuleType enum (was String)
NDO: PPRNDOPrivateParticipationClaimzome_gouvernanceUnchangedBilateral cryptographic accountability

3. Complete Entry Type Specifications

3.1 zome_resource Integrity

Supporting Types (shared)

#![allow(unused)]
fn main() {
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub struct QuantityValue {
    pub has_numerical_value: f64,
    pub has_unit: ActionHash, // → Unit entry
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum PropertyRegime {
    Private,       // Full rights bundle; individual ownership
    Commons,       // Non-rivalrous; governance via licensing/attribution
    Collective,    // Cooperative/collective ownership
    Pool,          // Rivalrous shared; custody/scheduling/maintenance
    CommonPool,    // Rivalrous consumable; quota/depletion rules
    Nondominium,   // Uncapturable; contribution-based access; no alienation
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum ResourceNature {
    Digital,   // Software, data, design files, documents
    Physical,  // Material objects, equipment, spaces
    Hybrid,    // Digital twin of a physical resource
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize, Default)]
pub enum LifecycleStage {
    #[default]
    Ideation,       // Idea registered, no form yet
    Specification,  // Form defined; design or spec exists
    Development,    // Active work; not yet distributable
    Prototype,      // Working prototype; validation in progress
    Stable,         // Peer-validated; ready for active use
    Distributed,    // Actively used across multiple agents/locations
    Active,         // In active operational use
    Hibernating,    // Temporarily inactive; may be reactivated
    Deprecated,     // Superseded; has declared successor NDO
    EndOfLife,      // Permanently concluded; tombstone only
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize, Default)]
pub enum OperationalState {
    #[default]
    Available,         // No active process; ready for use
    PendingValidation, // Initial state; awaiting peer validation
    Reserved,          // Commitment accepted; process not yet started
    InTransit,         // Transport process active (Move/TransferCustody event open)
    InStorage,         // Storage service commitment active
    InMaintenance,     // Repair/modify process active
    InUse,             // Use event open; actively being used
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum GovernanceRuleType {
    AccessRequirement,    // Role/affiliation/capability required for access
    MaintenanceSchedule,  // Maintenance obligations and intervals
    RoleRequirement,      // Specific role required for a given VfAction
    UsageLimit,           // Quantity/time/frequency limits
    TransferCondition,    // Conditions for custody/ownership transfer
    IdentityVerification, // Requires Flowsta cross-app identity (Tier 2)
    EconomicAgreement,    // Unyt Smart Agreement binding (stub; Phase 3)
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct CapabilitySlotTag {
    pub slot_type: SlotType,
    pub attached_at: Timestamp,
    pub label: Option<String>,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum SlotType {
    Documentation,
    IssueTracker,
    FabricationQueue,
    GovernanceDAO,
    VersionGraph,
    DigitalAsset,
    WeaveWAL,
    FlowstaIdentity,        // IsSamePersonEntry action hash (Flowsta cross-app identity)
    UnytAgreement(String),  // Unyt Alliance network seed
    CustomApp(String),      // Extensible
}
}

Entry Types

#![allow(unused)]
fn main() {
// vf:Unit — first-class unit of measure
#[hdk_entry_helper]
pub struct Unit {
    pub label: String,          // "kilogram", "hour", "each", "piece"
    pub symbol: Option<String>, // "kg", "h", "ea"
}

// NDO Layer 0 — permanent identity anchor for every Nondominium Object
#[hdk_entry_helper]
pub struct NondominiumIdentity {
    pub name: String,
    pub description: Option<String>,
    pub initiator: AgentPubKey,        // Post-v1.0: AgentContext — supports Bot agents and composed collective agents (dual-face model: agent face references this NDO as resource face)
    pub property_regime: PropertyRegime,
    pub resource_nature: ResourceNature,
    pub lifecycle_stage: LifecycleStage, // Only field mutable after creation
    pub created_at: Timestamp,
}
// Immutability rules: initiator, property_regime, resource_nature, name, description = immutable.
// lifecycle_stage = only mutable field. Every update must reference a triggering EconomicEvent hash.
// Deletion: ALWAYS INVALID. NondominiumIdentity entries are permanent DHT records.

// vf:ResourceSpecification — Layer 1 form definition
#[hdk_entry_helper]
pub struct ResourceSpecification {
    pub name: String,
    pub description: String,
    pub category: String,
    pub image_url: Option<String>,
    pub tags: Vec<String>,
    pub is_active: bool,
    // VF 1.0 additions:
    pub default_unit_of_resource: Option<ActionHash>, // → Unit
    pub default_unit_of_effort: Option<ActionHash>,   // → Unit
    pub medium_of_exchange: bool,  // Is this a currency-like resource?
    pub substitutable: bool,       // Can instances be freely swapped?
}

// vf:EconomicResource — Layer 2 physical/digital instance
#[hdk_entry_helper]
pub struct EconomicResource {
    // VF 1.0 compliant fields:
    pub accounting_quantity: QuantityValue, // Committed/on-books quantity
    pub onhand_quantity: QuantityValue,     // Physically available quantity
    pub primary_accountable: AgentPubKey,  // Accountable agent (was: custodian)
    pub custodian: Option<AgentPubKey>,    // Physical custody (may differ from accountable)
    pub conforms_to: ActionHash,           // → ResourceSpecification (required, embedded)
    pub current_location: Option<String>,
    // NDO-specific:
    pub state: OperationalState,           // Was: ResourceState (now typed correctly)
    pub tracking_identifier: Option<String>, // Serial number, QR code, etc.
}

// Typed governance rule — replaces untyped String rule_type
#[hdk_entry_helper]
pub struct GovernanceRule {
    pub rule_type: GovernanceRuleType,  // Was: String — now typed enum
    pub rule_data: String,              // JSON-encoded parameters (typed per rule_type in Phase 2)
    pub enforced_by: Option<String>,    // Role name string (post-v1.0: GovernanceRoleRef)
}
}
#![allow(unused)]
fn main() {
#[hdk_link_types]
pub enum LinkTypes {
    // Existing discovery anchors (preserved):
    AllResourceSpecifications,
    AllEconomicResources,
    AllGovernanceRules,
    SpecificationToResource,
    CustodianToResource,           // → renamed to AccountableToResource in Phase 2
    SpecificationToGovernanceRule,
    AgentToOwnedSpecs,
    AgentToManagedResources,
    AgentToOwnedRules,
    SpecsByCategory,
    ResourcesByLocation,
    ResourcesByState,              // DEPRECATED → split below
    RulesByType,
    ResourceToValidation,
    ResourceSpecificationUpdates,
    EconomicResourceUpdates,
    GovernanceRuleUpdates,

    // NEW — NDO Three-Layer Links:
    AllNDOs,                   // Anchor → NondominiumIdentity
    NDOsByLifecycleStage,      // LifecyclePath → NondominiumIdentity
    NDOsByNature,              // NaturePath → NondominiumIdentity
    NDOsByRegime,              // RegimePath → NondominiumIdentity
    NDOLifecycleHistory,       // NondominiumIdentity → LifecycleEvent (audit trail)
    NDOToSpecification,        // NondominiumIdentity → ResourceSpecification (Layer 1 activation)
    NDOToProcess,              // NondominiumIdentity → Process (Layer 2 activation)
    NDOToComponent,            // NondominiumIdentity → NondominiumIdentity (holonic composition)

    // NEW — Capability Surface:
    CapabilitySlot,            // NondominiumIdentity → capability target (tag carries SlotType)

    // NEW — VF ResourceState split:
    ResourcesByOperationalState, // OperationalState → EconomicResource (replaces ResourcesByState)

    // NEW — Unit discovery:
    AllUnits,                  // Anchor → Unit
}
}

3.2 zome_gouvernance Integrity

New Entry Types

#![allow(unused)]
fn main() {
// vf:Process — Layer 2 anchor; records the economic activity around an NDO
#[hdk_entry_helper]
pub struct Process {
    pub name: String,
    pub note: Option<String>,
    pub in_scope_of: Option<AgentPubKey>, // Post-v1.0: AgentContext — collective variants carry NDO hash as resource-face reference (dual-face model)
    pub created_at: Timestamp,
    pub finished: bool,
}

// vf:Agreement — set of reciprocal commitments among agents
#[hdk_entry_helper]
pub struct Agreement {
    pub name: String,
    pub description: Option<String>,
    pub parties: Vec<AgentPubKey>,   // Post-v1.0: Vec<AgentContext> — collective variants carry NDO hash as resource-face reference (dual-face model)
    pub created_at: Timestamp,
    pub note: Option<String>,
}
}

Updated Entry Types

#![allow(unused)]
fn main() {
// vf:EconomicEvent — observed economic flow (updated for VF 1.0)
#[hdk_entry_helper]
pub struct EconomicEvent {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_inventoried_as: ActionHash,
    pub affects: ActionHash,
    pub resource_quantity: QuantityValue,  // Was: f64 — now VF-compliant QuantityValue
    pub effort_quantity: Option<QuantityValue>, // NEW: labor/effort measure
    pub event_time: Timestamp,
    pub note: Option<String>,
    pub at_location: Option<String>,            // NEW: event location
    pub to_location: Option<String>,            // NEW: destination (transport)
    // VF 1.0 relations:
    pub fulfills: Option<ActionHash>,           // NEW: → Commitment (direct VF link)
    pub realization_of: Option<ActionHash>,     // NEW: → Agreement
    pub triggered_claim: Option<ActionHash>,    // NEW: → Fulfillment (audit bridge)
}

// vf:Commitment — planned economic flow (updated for VF 1.0)
#[hdk_entry_helper]
pub struct Commitment {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_inventoried_as: Option<ActionHash>,
    pub resource_conforms_to: Option<ActionHash>,
    pub input_of: Option<ActionHash>,         // → Process
    pub due_date: Timestamp,
    pub note: Option<String>,
    pub committed_at: Timestamp,
    // VF 1.0 addition:
    pub clause_of: Option<ActionHash>,        // NEW: → Agreement
}

// NDO Fulfillment — fulfillment bridge (renamed from Claim for semantic clarity)
// Note: Keeps "Claim" as the Rust type name for backwards compatibility in this zome,
// but semantically acts as a VF fulfillment record.
#[hdk_entry_helper]
pub struct Claim {
    pub fulfills: ActionHash,     // → Commitment
    pub fulfilled_by: ActionHash, // → EconomicEvent
    pub claimed_at: Timestamp,
    pub note: Option<String>,
}

// Existing entries preserved:
// ValidationReceipt, ResourceValidation, PrivateParticipationClaim (PPR — unchanged)
}
#![allow(unused)]
fn main() {
#[hdk_link_types]
pub enum LinkTypes {
    // Existing (preserved):
    ValidatedItemToReceipt,
    ResourceToValidation,
    CommitmentToClaim,
    ResourceToEvent,
    AllValidationReceipts,
    AllEconomicEvents,
    AllCommitments,
    AllClaims,
    AllResourceValidations,
    AgentToPrivateParticipationClaims,
    EventToPrivateParticipationClaims,
    CommitmentToPrivateParticipationClaims,
    ResourceToPrivateParticipationClaims,

    // NEW:
    AllProcesses,              // Anchor → Process
    AllAgreements,             // Anchor → Agreement
    AgreementToCommitment,     // Agreement → Commitment (stipulates)
    AgreementToEvent,          // Agreement → EconomicEvent (realizes)
    ProcessToEvent,            // Process → EconomicEvent
    ProcessToCommitment,       // Process → Commitment
}
}

4. Three-Layer Activation Model

flowchart TD
    subgraph L0["NDO Layer 0 — IDENTITY · NDO-specific (no VF equivalent)"]
        NDO["NondominiumIdentity\nname · regime · nature · lifecycle_stage"]
    end

    subgraph L1["NDO Layer 1 — SPECIFICATION · VF: Knowledge Layer"]
        SPEC["ResourceSpecification\nname · description · category\ndefault_unit · substitutable · medium_of_exchange"]
        GRULE["GovernanceRule\nrule_type(enum) · rule_data · enforced_by"]
    end

    subgraph L2["NDO Layer 2 — PROCESS · VF: Plan + Observation Layers"]
        subgraph VFP["VF Plan Layer"]
            PROC["Process\nname · in_scope_of · finished"]
            COMMIT["Commitment\naction · provider · receiver\ndue_date · clause_of"]
            AGREE["Agreement\nname · parties"]
        end
        subgraph VFO["VF Observation Layer"]
            ERES["EconomicResource\naccounting_qty · onhand_qty\nprimary_accountable · conforms_to"]
            EEVENT["EconomicEvent\naction · provider · receiver\nresource_quantity · fulfills"]
            PPR["PrivateParticipationClaim\n(NDO extension of vf:Claim)\nbilateral signature · 16 categories"]
        end
    end

    Agent(["Agent · VF Observation Layer\nAgentPubKey + Person entry"])

    Agent -->|"create_ndo()"| NDO
    NDO -->|"NDOToSpecification\nactivate_layer1()"| SPEC
    SPEC -->|"SpecificationToGovernanceRule"| GRULE
    NDO -->|"NDOToProcess\nactivate_layer2()"| PROC
    PROC -->|"ProcessToResource"| ERES
    ERES -->|"conforms_to"| SPEC
    PROC -->|"ProcessToEvent"| EEVENT
    PROC -->|"ProcessToCommitment"| COMMIT
    COMMIT -->|"clause_of"| AGREE
    EEVENT -->|"fulfills"| COMMIT
    EEVENT -->|"realization_of"| AGREE
    EEVENT -->|"triggers"| PPR

    NDO -->|"NDOToComponent\n(holonic composition)"| NDO

Activation rules:

  • Layer 0 is created first; its ActionHash is the stable NDO identifier forever
  • Layer 1 activates via NDOToSpecification link — retroactive activation is supported
  • Layer 2 activates via NDOToProcess link — requires Layer 1 to be active first
  • EconomicResource instances link through the Process, never directly to Layer 0
  • An NDO can contain other NDOs via NDOToComponent (holonic composition)

Lifecycle Transition State Machine

stateDiagram-v2
    direction LR

    [*] --> Ideation : create_ndo()

    Ideation       --> Specification : Work\n(initiator)
    Specification  --> Development   : Work\n(initiator / AccountableAgent)
    Development    --> Prototype     : Modify\n(custodian + validation)
    Prototype      --> Stable        : Accept\n(N-of-M peer validation)
    Stable         --> Distributed   : Transfer\n(PrimaryAccountableAgent)
    Distributed    --> Active        : (operational use begins)

    Ideation      --> Hibernating : Lower
    Specification --> Hibernating : Lower
    Development   --> Hibernating : Lower
    Prototype     --> Hibernating : Lower
    Stable        --> Hibernating : Lower
    Distributed   --> Hibernating : Lower
    Active        --> Hibernating : Lower

    Hibernating --> Ideation      : Raise\n(return to prior stage)
    Hibernating --> Specification : Raise\n(return to prior stage)
    Hibernating --> Development   : Raise\n(return to prior stage)
    Hibernating --> Prototype     : Raise\n(return to prior stage)
    Hibernating --> Stable        : Raise\n(return to prior stage)
    Hibernating --> Distributed   : Raise\n(return to prior stage)
    Hibernating --> Active        : Raise\n(return to prior stage)
    Hibernating --> Active        : Raise\n(claim — any AccountableAgent\nif inactivity criteria met)

    Active      --> Deprecated : Cite\n(successor NDO required)
    Active      --> EndOfLife  : Consume\n(challenge period)
    Deprecated  --> EndOfLife  : Consume
    Hibernating --> EndOfLife  : Consume

    EndOfLife --> [*] : tombstone (permanent, never deleted)

Transition Authorization Table

TransitionAuthorized byVfAction trigger
Ideation → SpecificationInitiatorWork
Specification → DevelopmentInitiator or any Accountable AgentWork
Development → PrototypeCustodian + governance validationModify
Prototype → StableN-of-M peer validationAccept
Stable / Active → DistributedPrimary Accountable AgentTransfer
Any → HibernatingCurrent custodian(s)Lower
Hibernating → [prior stage]Current custodian(s)Raise
Hibernating → Active (custodian claim)Any AccountableAgent — inactivity criteria met (governance-configured threshold)Raise
Any → DeprecatedCustodian + successor NDO declaredCite
Any → EndOfLifeCustodian + challenge period elapsedConsume

5. Zome Responsibility Boundaries

hREA DNA — VF Core Layer

Owns: All VF 1.0 core types. Accessed via CallTargetCell::OtherRole("hrea").

  • Entry types: ReaEconomicResource, ReaEconomicEvent, ReaCommitment, ReaAgreement, ReaProcess, ReaResourceSpecification, ReaAgent, ReaUnit, + all other VF types
  • NDO interacts with hREA only through its coordinator public functions — never reads hREA's source chain directly
  • hREA Phase 1+2 roadmap: documentation/hREA/strategic-roadmap.md

zome_resource — NDO Identity & Extension Layer

Owns: NDO-specific resource data. No business logic. Cross-DNA calls to hREA for VF operations.

  • Entry types: Unit, NondominiumIdentity, ResourceSpecification (NDO extension — category, tags, image, is_active), GovernanceRule
  • Responsibility: Layer 0 identity anchors, NDO resource spec extensions, governance rule storage, capability slots
  • Cross-DNA calls: create_rea_resource_specification, create_rea_economic_resource (stores returned hashes)
  • Does NOT: Own VF core types, evaluate governance rules, issue PPRs, approve state transitions

zome_gouvernance — Operator & Accountability

Owns: NDO governance logic. NDO-specific accountability types. Orchestrates hREA economic events.

  • Entry types: Fulfillment (Rust: Claim — ADR-004), ValidationReceipt, ResourceValidation, PrivateParticipationClaim
  • Responsibility: Receive transition requests. Evaluate GovernanceRules. Call hREA to create EconomicEvents, Commitments, Agreements. Issue PPRs after hREA call succeeds.
  • Cross-DNA calls: create_rea_economic_event, create_rea_commitment, create_rea_agreement, create_rea_process
  • Does NOT: Create hREA entries without governance evaluation; own VF core types

zome_person — Identity & Privacy

Owns: Agent identity, capability grants, roles, devices.

  • No changes in v1.0.
  • Post-v1.0: Add AgentContext union type, AffiliationRecord.

Cross-DNA + Cross-Zome Call Pattern (governance-as-operator)

sequenceDiagram
    actor Agent
    participant ZR as zome_resource<br/>(NDO — identity/extension)
    participant ZG as zome_gouvernance<br/>(NDO — operator)
    participant ZP as zome_person<br/>(NDO — identity)
    participant HR as hREA DNA<br/>(VF core types)

    Agent->>ZR: request_resource_transition(input)
    ZR->>ZG: cross_zome_call("evaluate_transition", request)

    ZG->>ZR: cross_zome_call("get_governance_rules", spec_hash)
    ZR-->>ZG: Vec<GovernanceRule>

    ZG->>ZP: cross_zome_call("get_agent_capability_level", agent_pub_key)
    ZP-->>ZG: CapabilityLevel

    ZG->>ZG: evaluate rules against request + capability

    alt approved
        ZG->>HR: cross_dna_call("create_rea_economic_event", event_input)
        HR-->>ZG: ActionHash (hREA event hash)
        ZG->>ZR: cross_zome_call("update_resource_operational_state", new_state)
        ZR-->>ZG: ActionHash
        ZG->>ZG: issue_ppr(hrea_event_hash, participants)
        ZG-->>ZR: Ok(hrea_event_hash)
        ZR-->>Agent: Ok(hrea_event_hash)
    else rejected
        ZG-->>ZR: Err(GovernanceViolation)
        ZR-->>Agent: Err(GovernanceViolation)
    end

6. Coordinator Function Signatures (New & Updated)

zome_resource — New Functions

#![allow(unused)]
fn main() {
// Unit management
fn create_unit(input: CreateUnitInput) -> ExternResult<ActionHash>
fn get_unit(unit_hash: ActionHash) -> ExternResult<Option<Record>>
fn get_all_units() -> ExternResult<Vec<UnitRecord>>

// NDO Layer 0 management
fn create_ndo(input: CreateNDOInput) -> ExternResult<ActionHash>
fn get_ndo(ndo_hash: ActionHash) -> ExternResult<Option<Record>>
fn get_all_ndos() -> ExternResult<Vec<NDORecord>>
fn get_ndos_by_lifecycle_stage(stage: LifecycleStage) -> ExternResult<Vec<ActionHash>>
fn get_ndos_by_nature(nature: ResourceNature) -> ExternResult<Vec<ActionHash>>
fn get_ndos_by_regime(regime: PropertyRegime) -> ExternResult<Vec<ActionHash>>
fn update_ndo_lifecycle(input: UpdateNDOLifecycleInput) -> ExternResult<ActionHash>
// UpdateNDOLifecycleInput { original_hash, previous_hash, new_stage, transition_event_hash }

// Layer activation
fn activate_layer1(ndo_hash: ActionHash, spec_hash: ActionHash) -> ExternResult<()>
fn activate_layer2(ndo_hash: ActionHash, process_hash: ActionHash) -> ExternResult<()>
fn get_ndo_layer1(ndo_hash: ActionHash) -> ExternResult<Option<Record>> // latest ResourceSpec
fn get_ndo_layer2(ndo_hash: ActionHash) -> ExternResult<Option<Record>> // active Process

// Capability slots
fn add_capability_slot(input: AddCapabilitySlotInput) -> ExternResult<()>
// AddCapabilitySlotInput { ndo_hash, target_hash, slot_type, label }
fn get_capability_slots(ndo_hash: ActionHash) -> ExternResult<Vec<CapabilitySlotRecord>>
fn get_slots_by_type(ndo_hash: ActionHash, slot_type: SlotType) -> ExternResult<Vec<ActionHash>>
}

zome_resource — Updated Signatures

#![allow(unused)]
fn main() {
// ResourceSpecification now includes VF fields
fn create_resource_specification(input: CreateResourceSpecInput) -> ExternResult<ActionHash>
// CreateResourceSpecInput adds: default_unit_of_resource, default_unit_of_effort,
//   medium_of_exchange, substitutable

// EconomicResource now uses QuantityValue, primary_accountable, conforms_to
fn create_economic_resource(input: CreateEconomicResourceInput) -> ExternResult<ActionHash>
// CreateEconomicResourceInput: accounting_quantity: QuantityValue, onhand_quantity: QuantityValue,
//   primary_accountable: AgentPubKey, custodian: Option<AgentPubKey>,
//   conforms_to: ActionHash, current_location: Option<String>

// State update now uses OperationalState
fn update_economic_resource_operational_state(
    input: UpdateOperationalStateInput
) -> ExternResult<ActionHash>
// UpdateOperationalStateInput { original_hash, previous_hash, new_state: OperationalState,
//   triggering_event_hash: ActionHash }
}

zome_gouvernance — New Functions

#![allow(unused)]
fn main() {
// Process management
fn create_process(input: CreateProcessInput) -> ExternResult<ActionHash>
fn get_process(process_hash: ActionHash) -> ExternResult<Option<Record>>
fn get_all_processes() -> ExternResult<Vec<ProcessRecord>>
fn conclude_process(process_hash: ActionHash, terminal_event_hash: ActionHash) -> ExternResult<()>

// Agreement management
fn create_agreement(input: CreateAgreementInput) -> ExternResult<ActionHash>
fn get_agreement(agreement_hash: ActionHash) -> ExternResult<Option<Record>>
fn get_all_agreements() -> ExternResult<Vec<AgreementRecord>>
fn get_agreement_commitments(agreement_hash: ActionHash) -> ExternResult<Vec<ActionHash>>
fn get_agreement_events(agreement_hash: ActionHash) -> ExternResult<Vec<ActionHash>>
}

7. VfAction — Preserved + Context

The VfAction enum is unchanged in v1.0. NDO-specific extensions (InitialTransfer, AccessForUse, TransferCustody) are preserved. The semantic methods (requires_existing_resource, creates_resource, modifies_quantity, changes_custody) are preserved.

Post-v1.0 addition: corrects → EconomicEvent (correction events) — not yet in scope.


8. PPR System — Preserved Unchanged

The PrivateParticipationClaim (16-category bilateral cryptographic participation receipts) is unchanged in v1.0. It is not a VF class — it is an NDO innovation that extends VF's Claim concept with bilateral accountability.

The PPR PerformanceMetrics struct (timeliness, quality, reliability, communication weights) is unchanged.

ReputationSummary computation is unchanged.


9. Explicit Out-of-Scope for v1.0

FeatureReasonPhase
AgentContext union (collective, project, network, bot, external)Requires governance refactoring across all 3 zomes; collective variants use dual-face model — agent face (AgentContext) + resource face (NondominiumIdentity) linked by ActionHash; multi-sig collective actions post-v1.0Post-v1.0
AffiliationRecord + AffiliationState derivationDepends on AgentContextPost-v1.0
Flowsta Phase 2/3 (governance enforcement of identity verification)Stub in GovernanceRuleType; UI/governance integration separatePost-v1.0
Unyt Smart Agreement full integrationStub in GovernanceRuleType + SlotType; RAVE proof validation separatePost-v1.0
vf:IntentValid VF 1.0 class — deferred post-v1.0; extension path via CapabilitySlot surfacePost-v1.0
vf:Claim (reciprocity, settlement)NDO Fulfillment entry (Rust: Claim) has fulfillment semantics; VF reciprocity Claim = post-v1.0Post-v1.0
ProcessSpecificationNot yet neededPost-v1.0
Many-to-many flows (multi-custodian)Architecture requires AgentContextPost-v1.0
Versioning DAG / digital resource integritySeparate specificationPost-v1.0
Network and federation governance layersRequires holonic governance designPost-v1.0
Non-binary decision mechanisms (conviction voting, quadratic)Governance extensionPost-v1.0
ZKP proofs for affiliation privacyCryptographic infrastructurePost-v1.0
Dispute resolution mechanismBeyond PPR category placeholderPost-v1.0
Frontend updatesSeparate workSeparate
GovernanceRule typed rule_data schemas (per GovernanceRuleType)Phase 2 governance workPost-v1.0

10. Architecture Decision Records

ADR-001: QuantityValue as mandatory (not Option)

  • Status: Accepted
  • Decision: accounting_quantity and onhand_quantity are required fields on EconomicResource, not Optional. Unit entry must exist before EconomicResource creation.
  • Rationale: VF compliance. Optional quantity is meaningless for resource tracking. If quantity is unknown, use 0.0 with an appropriate unit.
  • Consequence: All EconomicResource creation call sites must be updated. Test fixtures need Unit entries created first.
  • Status: Accepted
  • Decision: EconomicResource.conforms_to: ActionHash is embedded in the entry, not expressed only via SpecificationToResource link.
  • Rationale: VF compliance. Bi-directional: embed on resource (resource knows its spec) + keep link from spec (spec knows its instances). Discovery works both ways.
  • Consequence: conforms_to is required on creation. Cannot have an EconomicResource without a ResourceSpecification.

ADR-003: GovernanceRule.rule_data remains String in v1.0

  • Status: Accepted
  • Decision: GovernanceRule.rule_type changes to GovernanceRuleType enum, but rule_data: String (JSON) remains untyped in v1.0.
  • Rationale: Defining typed schemas for each GovernanceRuleType variant (AccessRequirement params, MaintenanceSchedule params, etc.) is substantial design work beyond v1.0 scope. The enum gives us type-safety on the category without requiring complete schema for each.
  • Consequence: Runtime validation of rule_data remains the responsibility of the coordinator. Phase 2 will add typed rule_data per variant.

ADR-004: NDO's Claim entry retains name but repurposed as Fulfillment

  • Status: Accepted
  • Decision: The current Claim entry (fulfills → Commitment, fulfilled_by → EconomicEvent) is semantically a VF "fulfillment bridge." It is NOT VF's vf:Claim (reciprocity). Rust struct keeps name Claim; design docs call it "Fulfillment."
  • Rationale: Renaming the Rust type in v1.0 would be a larger refactor than the value it provides. VF compliance is achieved via EconomicEvent.fulfills → Commitment (direct field); the bridge entry becomes redundant but is kept for audit trail.
  • Consequence: Post-v1.0, the Claim entry may be renamed to Fulfillment and VF's reciprocity Claim added as a new entry type.

ADR-005: Process entry type lives in zome_gouvernance

  • Status: Accepted
  • Decision: Process entry type is defined in zome_gouvernance integrity, not zome_resource.
  • Rationale: Processes are governed economic activities. Layer 2 activation link (NDOToProcess) in zome_resource LinkTypes points to a Process entry hash in zome_gouvernance — cross-zome ActionHash references are valid in Holochain.
  • Consequence: The NDO Layer 2 activation is a cross-zome link. get_ndo_layer2(ndo_hash) in the resource coordinator must make a cross-zome call to retrieve the Process record.

ADR-006: VF core types delegated to hREA DNA, not reimplemented in NDO

  • Status: Accepted
  • Decision: NDO does not re-implement VF entry types (EconomicResource, EconomicEvent, Commitment, Agreement, Process, ResourceSpecification). All VF core types are owned by the hrea DNA (registered as OtherRole("hrea") in happ.yaml). NDO coordinator zomes call hREA functions and store returned ActionHash values.
  • Rationale: Avoids duplication and divergence. hREA is the canonical VF 1.0 implementation. NDO's value is in governance, identity, and accountability layers — not in reimplementing economic primitives. The vendor/hrea submodule is already a live runtime DNA in the bundle.
  • Consequence: NDO v1.0 capabilities are bounded by hREA's current compliance level (~65% VF 1.0). P0 gaps in hREA (effortQuantity, vf:Claim) must be resolved before NDO's work-event recording and claim-based reciprocity workflows are available. See documentation/hREA/strategic-roadmap.md for the Phase 1 gap closure plan.

11. Migration Notes (Current → v1.0)

Currentv1.0Migration
EconomicResource.quantity: f64accounting_quantity: QuantityValue + onhand_quantity: QuantityValueAll creation call sites; test fixtures need Unit entries
EconomicResource.unit: StringRemoved (unit is in QuantityValue)See above
EconomicResource.custodian: AgentPubKeyprimary_accountable: AgentPubKey + custodian: Option<AgentPubKey>Rename + add physical custody field
ResourceState enumOperationalState enum (on EconomicResource) + LifecycleStage (on NondominiumIdentity)State mapping: Active→Available, PendingValidation→PendingValidation, Maintenance→InMaintenance, Retired→EndOfLife, Reserved→Reserved
GovernanceRule.rule_type: StringGovernanceRule.rule_type: GovernanceRuleTypeAll coordinator match arms
EconomicEvent.resource_quantity: f64resource_quantity: QuantityValueSame as EconomicResource quantity migration
No AgreementAgreement entry in zome_gouvernanceNew entry type, new coordinator functions
No NondominiumIdentityNondominiumIdentity entry in zome_resourceNew entry type; no existing entries to migrate
No Process entryProcess entry in zome_gouvernanceNew entry type for Layer 2 activation
No Unit entryUnit entry in zome_resourceNew entry type; must be created before EconomicResource

Nondominium Architecture Components

  • Generated: 2025-10-30
  • Updated: 2025-11-23
  • Version: 3.0 (Improved mermaid diagrams)
  • Scope: Detailed component breakdown and interaction patterns

🎯 Executive Summary

Nondominium implements a sophisticated 3-zome Holochain architecture that enables distributed resource sharing with embedded governance, capability-based security, and cryptographically-secured reputation tracking. The system supports four structured Economic Processes (Use, Transport, Storage, Repair) with role-based access control and 14-category PPR reputation system for trustworthy agent interactions.


🏗️ System Architecture

High-Level System Architecture

graph TB
    subgraph "Frontend Layer"
        UI["Svelte 5.0 + TypeScript"]
        Client["holochain-client 0.19.0"]
    end

    subgraph "Holochain Runtime"
        WASM[WASM Compilation]
        DHT[DHT-based P2P Network]
        CapSec[Capability-Based Security]
    end

    subgraph "Zome Layer"
        Person["zome_person<br/>Identity and Access"]
        Resource["zome_resource<br/>Resource Management"]
        Gov["zome_gouvernance<br/>Governance and Reputation"]
    end

    UI --> Client
    Client --> WASM
    WASM --> DHT
    WASM --> CapSec

    Person --> DHT
    Resource --> DHT
    Gov --> DHT

Data Flow Architecture

sequenceDiagram
    participant Agent as Agent Request
    participant UI as UI Client
    participant Auth as Auth & Cap Check
    participant Role as Role Validation
    participant Zome as Zome Function
    participant PPR as PPR System

    Agent->>UI: Submit Request
    UI->>Auth: Validate Capability Token
    Auth->>Role: Check Role Permissions
    Role->>Zome: Execute Function
    Zome->>PPR: Issue PPR if Applicable
    PPR-->>Zome: PPR Issued
    Zome-->>Role: Function Result
    Role-->>Auth: Validation Complete
    Auth-->>UI: Access Granted
    UI-->>Agent: Response/Result

Core Technology Stack

┌─────────────────────────────────────────────────────────────┐
│                    FRONTEND LAYER                           │
├─────────────────────────────────────────────────────────────┤
│ Svelte 5.0 + TypeScript + Vite 6.2.5                        │
│ @holochain/client 0.19.0                                    │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                 HOLOCHAIN RUNTIME                           │
├─────────────────────────────────────────────────────────────┤
│ Rust (HDK ^0.6.0 / HDI ^0.7.0) → WASM Compilation            │
│ DHT-based peer-to-peer network                              │
│ Capability-based security & gossip                          │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                    ZOME LAYER                               │
├─────────────────────────────────────────────────────────────┤
│  zome_person    │  zome_resource  │  zome_gouvernance       │
│  (Identity)     │  (Resources)    │  (Governance)           │
└─────────────────────────────────────────────────────────────┘

🔐 Zome Components

1. zome_person - Identity & Access Management

Zome Person Architecture

graph TB
    subgraph "zome_person"
        subgraph "Agent Identity"
            Person[Person Entry<br/>Public Profile]
            EncProfile[EncryptedProfile<br/>Private Data]
            Discovery[Discovery Anchors<br/>Agent Directory]
        end

        subgraph "Capability System"
            CapToken["CapabilityToken<br/>Role-based Access"]
            CapProgress["CapabilityProgression<br/>Trust Advancement"]
            ACL["Access Control Lists<br/>Resource Permissions"]
        end

        subgraph "Private Data Sharing"
            DataReq["DataAccessRequest<br/>time-limited (max 30d)"]
            DataGrant["DataAccessGrant<br/>Field-specific Control"]
            PrivateData["PrivateDataEntry<br/>Encrypted Info"]
        end

        subgraph "Role Management"
            RoleAssign["RoleAssignment<br/>Validation Metadata"]
            RoleQual["RoleQualification<br/>Requirements Tracking"]
            RoleProgress["RoleProgression<br/>Advancement Criteria"]
        end
    end

    Person --> Discovery
    EncProfile --> DataGrant
    CapToken --> CapProgress
    DataReq --> DataGrant
    RoleAssign --> RoleQual

Core Components

┌─────────────────────────────────────────────────────────────┐
│                   zome_person                               │
├─────────────────────────────────────────────────────────────┤
│ 1.1 AGENT IDENTITY                                          │
│ ├── Person Entry (public profile)                           │
│ ├── EncryptedProfile Entry (private data)                   │
│ └── Discovery Anchors (findable agent directory)            │
│                                                             │
│ 1.2 CAPABILITY SYSTEM                                       │
│ ├── CapabilityToken Entry (role-based access)               │
│ ├── CapabilityProgression (trust advancement)               │
│ └── Access Control Lists (resource permissions)             │
│                                                             │
│ 1.3 PRIVATE DATA SHARING                                    │
│ ├── DataAccessRequest Entry (time-limited; max 30-day grants) │
│ ├── DataAccessGrant Entry (field-specific control)          │
│ └── PrivateDataEntry (encrypted personal information)       │
│                                                             │
│ 1.4 ROLE MANAGEMENT                                         │
│ ├── RoleAssignment Entry (with validation metadata)         │
│ ├── RoleQualification Entry (requirements tracking)         │
│ └── RoleProgression Entry (advancement criteria)            │
└─────────────────────────────────────────────────────────────┘

Key Functions

#![allow(unused)]
fn main() {
// Identity Management
create_person(PersonInput) -> PersonHash
get_person(PersonHash) -> Person
get_all_persons() -> Vec<Person>
update_person(PersonHash, PersonInput) -> PersonHash
delete_person(PersonHash) -> DeleteResult

// Capability Management
create_capability_token(CapabilityRequest) -> CapabilityTokenHash
get_agent_capability_level(AgentPubKey) -> CapabilityLevel
promote_agent_capability(AgentPubKey, PromotionCriteria) -> PromotionResult

// Private Data Sharing
request_private_data_access(DataAccessRequest) -> RequestHash
grant_private_data_access(RequestHash, GrantDetails) -> GrantHash
get_private_data(GrantHash, FieldList) -> PrivateData
revoke_private_data_access(GrantHash) -> RevokeResult

// Role Management
assign_role(AgentPubKey, RoleAssignment) -> RoleHash
get_agent_roles(AgentPubKey) -> Vec<RoleAssignment>
validate_role_requirements(AgentPubKey, RoleType) -> ValidationStatus
}

2. zome_resource - Resource Lifecycle Management

Zome Resource Architecture

graph TB
    subgraph "zome_resource"
        subgraph "Resource Specification"
            ResSpec[ResourceSpecification<br/>Type Definition]
            ResProp[ResourceProperty<br/>Custom Properties]
            SpecCat[SpecificationCategory<br/>Classification]
        end

        subgraph "Economic Resource"
            EconRes[EconomicResource<br/>Resource Instance]
            ResState[LifecycleStage + OperationalState<br/>State Tracking (TODO: split ResourceState)]
            ResHistory[ResourceHistory<br/>Audit Trail]
            ResCustody[ResourceCustody<br/>Custody Tracking]
        end

        subgraph "Economic Processes"
            UseProc[UseProcess<br/>Time-limited Access]
            TransProc[TransportProcess<br/>Location Movement]
            StorageProc[StorageProcess<br/>Preservation]
            RepairProc[RepairProcess<br/>Restoration]
        end

        subgraph "Economic Events"
            EconEvent[EconomicEvent<br/>State Changes]
            EventVal[EventValidation<br/>Validation Workflow]
            EventImpact[EventImpact<br/>Resource Impact]
        end
    end

    ResSpec --> EconRes
    ResProp --> ResSpec
    SpecCat --> ResSpec
    EconRes --> ResState
    EconRes --> ResHistory
    EconRes --> ResCustody

    UseProc --> EconEvent
    TransProc --> EconEvent
    StorageProc --> EconEvent
    RepairProc --> EconEvent

    EconEvent --> EventVal
    EconEvent --> EventImpact

Core Components

┌─────────────────────────────────────────────────────────────┐
│                  zome_resource                              │
├─────────────────────────────────────────────────────────────┤
│ 2.1 RESOURCE SPECIFICATION                                  │
│ ├── ResourceSpecification Entry (type definition)           │
│ ├── ResourceProperty Entry (custom properties)              │
│ └── SpecificationCategory Entry (classification)            │
│                                                             │
│ 2.2 ECONOMIC RESOURCE                                       │
│ ├── EconomicResource Entry (resource instance)              │
│ ├── LifecycleStage (on NondominiumIdentity) + OperationalState (on EconomicResource) │
│ │   TODO: split current ResourceState into these two enums  │
│ ├── ResourceHistory Entry (audit trail)                     │
│ └── ResourceCustody Entry (custody tracking)                │
│                                                             │
│ 2.3 ECONOMIC PROCESSES                                      │
│ ├── UseProcess Entry (time-limited access)                  │
│ ├── TransportProcess Entry (location movement)              │
│ ├── StorageProcess Entry (preservation)                     │
│ └── RepairProcess Entry (restoration)                       │
│                                                             │
│ 2.4 ECONOMIC EVENTS                                         │
│ ├── EconomicEvent Entry (state changes)                     │
│ ├── EventValidation Entry (validation workflow)             │
│ └── EventImpact Entry (resource impact tracking)            │
└─────────────────────────────────────────────────────────────┘

Key Functions

#![allow(unused)]
fn main() {
// Resource Specification
create_resource_specification(ResourceSpecInput) -> ResourceSpecHash
get_resource_specification(ResourceSpecHash) -> ResourceSpecification
update_resource_specification(ResourceSpecHash, ResourceSpecInput) -> ResourceSpecHash

// Economic Resource Management
create_economic_resource(ResourceInput) -> EconomicResourceHash
get_economic_resource(EconomicResourceHash) -> EconomicResource
update_economic_resource(EconomicResourceHash, ResourceUpdate) -> EconomicResourceHash
transfer_resource_custody(EconomicResourceHash, AgentPubKey) -> TransferResult

// Economic Process Management
initiate_use_process(UseProcessInput) -> UseProcessHash
initiate_transport_process(TransportProcessInput) -> TransportProcessHash
initiate_storage_process(StorageProcessInput) -> StorageProcessHash
initiate_repair_process(RepairProcessInput) -> RepairProcessHash

// Process Execution
complete_use_process(UseProcessHash, CompletionDetails) -> CompletionResult
complete_transport_process(TransportProcessHash, TransportDetails) -> CompletionResult
complete_storage_process(StorageProcessHash, StorageDetails) -> CompletionResult
complete_repair_process(RepairProcessHash, RepairDetails) -> CompletionResult
}

3. zome_gouvernance - Governance & Reputation

Zome Governance Architecture

graph TB
    subgraph "zome_gouvernance"
        subgraph "Commitment System"
            Commitment[Commitment<br/>Agreements & Obligations]
            CommitFulfill[CommitmentFulfillment<br/>Completion Tracking]
            CommitValidation[CommitmentValidation<br/>Validation Workflow]
        end

        subgraph "PPR Reputation System"
            PPR[PPR Entry<br/>14 Categories]
            PPRValidation[PPRValidation<br/>Crypto Verification]
            ReputationSummary[ReputationSummary<br/>Derived Metrics]
            PPRMilestone[PPRMilestone<br/>Advancement Criteria]
        end

        subgraph "Multi-Reviewer Validation"
            ValWorkflow[ValidationWorkflow<br/>Validation Setup]
            ValReview[ValidationReview<br/>Individual Assessments]
            ValConsensus[ValidationConsensus<br/>Consensus Determination]
            ValAppeal[ValidationAppeal<br/>Dispute Resolution]
        end

        subgraph "Agent Promotion"
            PromotionElig[PromotionEligibility<br/>Qualification Check]
            PromotionApp[PromotionApplication<br/>Advancement Request]
            PromotionDecision[PromotionDecision<br/>Approval/Rejection]
            PromotionHistory[PromotionHistory<br/>Audit Trail]
        end
    end

    Commitment --> CommitFulfill
    CommitFulfill --> CommitValidation
    PPR --> PPRValidation
    PPRValidation --> ReputationSummary
    ReputationSummary --> PPRMilestone

    ValWorkflow --> ValReview
    ValReview --> ValConsensus
    ValConsensus --> ValAppeal

    PromotionElig --> PromotionApp
    PromotionApp --> PromotionDecision
    PromotionDecision --> PromotionHistory

    PPRMilestone -.-> PromotionElig
    ValConsensus -.-> PPRValidation

Core Components

┌─────────────────────────────────────────────────────────────┐
│                 zome_gouvernance                            │
├─────────────────────────────────────────────────────────────┤
│ 3.1 COMMITMENT SYSTEM                                       │
│ ├── Commitment Entry (agreements & obligations)             │
│ ├── CommitmentFulfillment Entry (completion tracking)       │
│ └── CommitmentValidation Entry (validation workflow)        │
│                                                             │
│ 3.2 PPR REPUTATION SYSTEM                                   │
│ ├── PPR Entry (14 reputation categories)                    │
│ ├── PPRValidation Entry (cryptographic verification)        │
│ ├── ReputationSummary Entry (derived metrics)               │
│ └── PPRMilestone Entry (advancement criteria)               │
│                                                             │
│ 3.3 MULTI-REVIEWER VALIDATION                               │
│ ├── ValidationWorkflow Entry (validation setup)             │
│ ├── ValidationReview Entry (individual assessments)         │
│ ├── ValidationConsensus Entry (consensus determination)     │
│ └── ValidationAppeal Entry (dispute resolution)             │
│                                                             │
│ 3.4 AGENT PROMOTION                                         │
│ ├── PromotionEligibility Entry (qualification check)        │
│ ├── PromotionApplication Entry (advancement request)        │
│ ├── PromotionDecision Entry (approval/rejection)            │
│ └── PromotionHistory Entry (audit trail)                    │
└─────────────────────────────────────────────────────────────┘

PPR System Categories

#![allow(unused)]
fn main() {
pub enum PPRCategory {
    // Resource & Service Categories
    ResourceContribution,      // Resource creation and validation
    ResourceValidation,        // Resource quality assessment
    UseService,               // Use process participation
    TransportService,         // Transport service provision
    StorageService,           // Storage service provision
    RepairService,            // Repair service provision
    ServiceValidation,        // Service quality assessment

    // Governance & Community Categories
    CommitmentFulfillment,     // Commitment completion tracking
    GovernanceParticipation,   // Governance activity participation
    Custodianship,           // Resource custody responsibilities
    DisputeResolution,       // Conflict resolution participation
    CoordinationService,      // Coordination activities
    Mentorship,              // Knowledge sharing and guidance
    CommunityBuilding,       // Community development activities
}
}

Key Functions

#![allow(unused)]
fn main() {
// Commitment Management
create_commitment(CommitmentInput) -> CommitmentHash
get_commitment(CommitmentHash) -> Commitment
fulfill_commitment(CommitmentHash, FulfillmentDetails) -> FulfillmentResult
validate_commitment_fulfillment(CommitmentHash) -> ValidationResult

// PPR System
issue_ppr(PPRIssuanceRequest) -> PPRHash
get_ppr_summary(AgentPubKey, PPRCategory) -> PPRSummary
validate_ppr_eligibility(AgentPubKey, PPRCategory) -> EligibilityResult
derive_reputation_score(AgentPubKey) -> ReputationMetrics

// Multi-Reviewer Validation
create_validation_workflow(ValidationWorkflowInput) -> WorkflowHash
submit_validation_review(WorkflowHash, ValidationReview) -> ReviewHash
check_validation_consensus(WorkflowHash) -> ConsensusResult
appeal_validation_decision(WorkflowHash, AppealDetails) -> AppealHash

// Agent Promotion
evaluate_agent_promotion(AgentPubKey, PromotionType) -> EvaluationResult
promote_to_accountable_agent(AgentPubKey) -> PromotionResult
promote_to_primary_accountable_agent(AgentPubKey) -> PromotionResult
get_promotion_history(AgentPubKey) -> Vec<PromotionRecord>
}

🔄 Cross-Zome Integration Patterns

Cross-Zome Data Flow

graph LR
    subgraph "zome_person"
        Person[Person Entry]
        CapToken[Capability Token]
        RoleAssign[Role Assignment]
    end

    subgraph "zome_resource"
        ResSpec[Resource Spec]
        EconRes[Economic Resource]
        UseProc[Use Process]
        EconEvent[Economic Event]
    end

    subgraph "zome_gouvernance"
        PPR[PPR Entry]
        Commitment[Commitment]
        ValWorkflow[Validation Workflow]
        Promotion[Promotion]
    end

    Person --> CapToken
    CapToken --> RoleAssign
    RoleAssign -.-> UseProc
    ResSpec --> EconRes
    EconRes --> UseProc
    UseProc --> EconEvent
    EconEvent --> PPR
    PPR --> ValWorkflow
    ValWorkflow --> Promotion
    Promotion -.-> CapToken

1. Capability Progression Integration

sequenceDiagram
    participant Agent as Agent
    participant Person as zome_person
    participant Resource as zome_resource
    participant Gov as zome_gouvernance

    Agent->>Person: Request Process Access
    Person->>Person: Get Capability Level
    Person->>Gov: Get Reputation Score
    Gov-->>Person: Return Reputation
    Person->>Person: Validate Process Access
    alt Access Granted
        Person->>Resource: Authorize Process
        Resource->>Resource: Execute Economic Process
        Resource->>Gov: Trigger PPR Issuance
        Gov->>Gov: Update Agent Reputation
        Gov-->>Person: Promotion Eligibility
        Person-->>Agent: Process Complete
    else Access Denied
        Person-->>Agent: Access Denied
    end
#![allow(unused)]
fn main() {
// Cross-zome capability validation
fn validate_process_access(agent: AgentPubKey, process_type: EconomicProcess) -> bool {
    let capability = zome_person::get_agent_capability_level(agent)?;
    let reputation = zome_gouvernance::derive_reputation_score(agent)?;

    match process_type {
        EconomicProcess::Use => {
            // Accountable Agent (stewardship) or higher
            capability.level >= CapabilityLevel::Accountable
        },
        EconomicProcess::Transport | EconomicProcess::Storage | EconomicProcess::Repair => {
            // Primary Accountable Agent (coordination/governance) only
            capability.level >= CapabilityLevel::Primary &&
            reputation.exceeds_threshold(PROMOTION_THRESHOLD)
        }
    }
}
}

2. PPR Issuance Coordination

#![allow(unused)]
fn main() {
// PPR issuance coordination across zomes
fn coordinate_ppr_issuance(event: EconomicEvent) -> Vec<PPRIssuance> {
    let mut issuances = Vec::new();

    // Resource-based PPRs (zome_resource coordination)
    if let Some(resource) = event.affected_resource {
        if event.action == VfAction::Produce {
            issuances.push(PPRIssuance {
                recipient: event.provider,
                category: PPRCategory::ResourceContribution,
                evidence: resource.hash,
            });
        }
    }

    // Process-based PPRs (cross-zome coordination)
    if let Some(process) = event.process {
        match process.process_type {
            UseProcess => issuances.push(PPRIssuance {
                recipient: event.receiver,
                category: PPRCategory::UseService,
                evidence: process.hash,
            }),
            TransportProcess => issuances.push(PPRIssuance {
                recipient: event.provider,
                category: PPRCategory::TransportService,
                evidence: process.hash,
            }),
            // ... other process types
        }
    }

    issuances
}
}

3. Private Data Sharing with Economic Processes

#![allow(unused)]
fn main() {
// Private data access for economic processes
fn authorize_process_data_access(
    process: EconomicProcess,
    requesting_agent: AgentPubKey,
    required_fields: Vec<PrivateDataField>
) -> Result<DataAccessGrant, DataAccessError> {
    // Validate process participation
    let participation = validate_process_participation(process, requesting_agent)?;

    // Check role requirements
    let role = zome_person::get_agent_roles(requesting_agent)?
        .into_iter()
        .find(|r| r.matches_process_requirements(&process))
        .ok_or(DataAccessError::InsufficientRole)?;

    // Illustrative pseudocode — align grant duration with zome_person capability rules (30-day max).
    let grant = DataAccessGrant {
        requesting_agent,
        granting_agent: process.resource_owner,
        accessible_fields: required_fields,
        expires_at: sys_time()? + Duration::from_secs(7 * 24 * 60 * 60), // example: 7 days; cap 30 days in MVP metadata
        purpose: format!("Data access for {} process", process.process_type),
        process_context: process.hash,
    };

    Ok(grant)
}
}

🛡️ Security Architecture

Capability-Based Access Control Flow

graph TD
    subgraph "Trust Levels"
        Simple[Simple Agent<br/>Basic Member]
        Accountable[Accountable Agent<br/>Stewardship Role]
        Primary[Primary Accountable<br/>Coordination Role]
        Advanced[Advanced Agent<br/>Governance Role]
    end

    subgraph "Simple Agent Capabilities"
        S1[General Capability Token]
        S2[Create Resources]
        S3[Initial Transfer]
        S4[Basic PPR Eligibility]
    end

    subgraph "Accountable Agent Capabilities"
        A1[Restricted Capability Token<br/>Role-specific]
        A2[Access Resources]
        A3[Validate Others]
        A4[Initiate Use Processes]
        A5[Service PPR Eligibility]
    end

    subgraph "Primary Accountable Capabilities"
        P1[Full Capability Token<br/>Comprehensive Access]
        P2[Hold Custody]
        P3[Validate Specialized Roles]
        P4[Initiate All Processes]
        P5[All 16 PPR Categories<br/>Including Custodianship]
    end

    subgraph "Advanced Agent Capabilities"
        AD1[Advanced Governance Token]
        AD2[Dispute Resolution]
        AD3[End-of-Life Validation]
        AD4[System Leadership]
    end

    Simple --> S1 --> S2 --> S3 --> S4 --> Accountable
    Accountable --> A1 --> A2 --> A3 --> A4 --> A5 --> Primary
    Primary --> P1 --> P2 --> P3 --> P4 --> P5 --> Advanced
    Advanced --> AD1 --> AD2 --> AD3 --> AD4

1. Capability-Based Access Control

Trust Level Progression:
Simple Agent (member)
├── General Capability Token
├── Can: Create resources, make InitialTransfer
├── PPR Eligibility: ResourceContribution upon validation
└── Promotion Criteria: First validated transaction

Accountable Agent (stewardship)
├── Restricted Capability Token (role-specific)
├── Can: Access resources, validate others, initiate Use processes
├── PPR Eligibility: Service processes, validation activities
└── Promotion Criteria: PPR milestones + specialized role validation

Primary Accountable Agent (coordination/governance)
├── Full Capability Token (comprehensive access)
├── Can: Hold custody, validate specialized roles, initiate all processes
├── PPR Eligibility: All 16 categories including custodianship
└── Advanced: Dispute resolution, end-of-life validation

2. Cryptographic Reputation System

PPR Cryptographic Structure:
├── Issuer Signature (Ed25519)
├── Recipient Identity (AgentPubKey)
├── Category & Evidence (Process/Resource hash)
├── Timestamp & Expiration
├── Validation Metadata (Reviewer signatures)
└── Reputation Impact Calculation

Reputation Derivation:
├── PPR Collection (all categories)
├── Quality Scoring (reviewer assessments)
├── Temporal Weighting (recent > historical)
├── Category Diversity (balanced participation)
└── Cryptographic Proof (tamper-evident)

3. Private Data Protection

Data Access Control:
├── Field-Level Granularity (specific data elements)
├── Time-Limited Grants (30-day maximum per capability metadata)
├── Purpose Binding (process-specific usage)
├── Automatic Expiration (system-enforced)
├── Audit Trail (access logging)
└── Revocation Capability (immediate termination)

Encryption Strategy:
├── End-to-End Encryption (agent-to-agent)
├── Key Management (capability-based)
├── Secure Storage (encrypted entries)
├── Access Validation (real-time checks)
└── Secure Transmission (Holochain secure messaging)

📊 Economic Process Architecture

Economic Process Flow

graph TB
    subgraph "Economic Resources"
        Resource[Economic Resource<br/>Physical/Digital Asset]
        Spec[Resource Specification<br/>Type & Properties]
    end

    subgraph "Process Types"
        Use[Use Process<br/>Time-Limited Access]
        Transport[Transport Process<br/>Custody Transfer]
        Storage[Storage Process<br/>Preservation]
        Repair[Repair Process<br/>Restoration]
    end

    subgraph "Process Roles"
        User[User<br/>Accountable Agent]
        Provider[Provider<br/>Resource Owner]
        Transporter[Transporter<br/>Primary Accountable]
        StorageProvider[Storage Provider<br/>Primary Accountable]
        RepairProvider[Repair Provider<br/>Primary Accountable]
    end

    subgraph "Economic Events"
        CreateEvent[Create Event<br/>Resource Creation]
        UseEvent[Use Event<br/>Resource Access]
        TransferEvent[Transfer Event<br/>Custody Change]
        RepairEvent[Repair Event<br/>Resource Restoration]
    end

    Resource --> Use
    Resource --> Transport
    Resource --> Storage
    Resource --> Repair

    Use --> User
    Use --> Provider
    Transport --> Transporter
    Storage --> StorageProvider
    Repair --> RepairProvider

    Use --> UseEvent
    Transport --> TransferEvent
    Repair --> RepairEvent
    Resource --> CreateEvent

1. Use Process (Time-Limited Access)

sequenceDiagram
    participant User as User (Accountable Agent)
    participant Provider as Provider (Resource Owner)
    participant Resource as Resource System
    participant Gov as Governance (PPR System)

    User->>Provider: Request Resource Access
    Provider->>Resource: Check Resource Availability
    Resource-->>Provider: Availability Confirmed
    Provider->>User: Grant Access (Time-limited)
    User->>Resource: Use Resource
    Resource->>Resource: Track Usage
    Resource-->>User: Usage Complete

    User->>Gov: Report Service Quality
    Provider->>Gov: Report User Compliance
    Gov->>Gov: Issue PPRs to Both Parties
    Gov-->>User: PPR Issued (UseService)
    Gov-->>Provider: PPR Issued (ServiceValidation)
#![allow(unused)]
fn main() {
UseProcess {
    resource: EconomicResourceHash,
    user: AgentPubKey,
    provider: AgentPubKey,
    time_start: SystemTime,
    time_end: SystemTime,
    usage_terms: UsageAgreement,
    access_requirements: AccessConstraints,
    tracking_mechanism: UsageMonitoring,
}
}

Role Requirements:

  • User: Accountable Agent (stewardship role)
  • Provider: Resource owner or custodian
  • Validation: Service quality assessment possible

2. Transport Process (Custody Transfer)

#![allow(unused)]
fn main() {
TransportProcess {
    resource: EconomicResourceHash,
    transporter: AgentPubKey,
    from_location: Location,
    to_location: Location,
    custody_transfer: CustodyAgreement,
    tracking_requirements: TrackingProtocol,
    insurance_terms: InsuranceCoverage,
}
}

Role Requirements:

  • Transporter: Primary Accountable Agent (coordination role)
  • Custodian: Resource owner or appointed custodian
  • Validation: Transport service assessment possible

3. Storage Process (Preservation)

#![allow(unused)]
fn main() {
StorageProcess {
    resource: EconomicResourceHash,
    storage_provider: AgentPubKey,
    storage_location: Location,
    storage_conditions: PreservationRequirements,
    monitoring_protocol: ConditionMonitoring,
    access_during_storage: AccessPolicy,
}
}

Role Requirements:

  • Storage Provider: Primary Accountable Agent (coordination role)
  • Resource Owner: Maintains ultimate ownership
  • Validation: Storage service assessment possible

4. Repair Process (Restoration)

#![allow(unused)]
fn main() {
RepairProcess {
    resource: EconomicResourceHash,
    repair_provider: AgentPubKey,
    repair_specification: RepairPlan,
    quality_requirements: QualityStandards,
    cost_structure: CostAgreement,
    validation_requirements: QualityAssurance,
}
}

Role Requirements:

  • Repair Provider: Primary Accountable Agent (coordination role)
  • Quality Validator: Specialized validation role
  • Validation: Repair service assessment possible

🔄 Validation & Governance Workflows

PPR System Workflow

stateDiagram-v2
    [*] --> EventOccurrence: Economic Event
    EventOccurrence --> PPRIssuance: Trigger PPR Creation
    PPRIssuance --> ValidationRequired: Needs Verification
    ValidationRequired --> UnderReview: Assign Reviewers

    state UnderReview {
        [*] --> Reviewer1
        Reviewer1 --> Reviewer2
        Reviewer2 --> Reviewer3
        Reviewer3 --> ConsensusCheck
    }

    UnderReview --> ValidationApproved: Consensus Reached
    UnderReview --> ValidationRejected: No Consensus

    ValidationApproved --> PPRActive: Activate PPR
    ValidationRejected --> AppealProcess: Dispute Filed

    AppealProcess --> Reconsideration: Valid Appeal
    AppealProcess --> PPRRejected: Appeal Denied

    Reconsideration --> UnderReview: Re-validate
    PPRActive --> ReputationUpdate: Update Score
    ReputationUpdate --> [*]
    PPRRejected --> [*]

Multi-Reviewer Validation System

graph TB
    subgraph "Validation Workflow"
        ValType[Validation Type<br/>2-of-3, N-of-M, Majority]
        Subject[Validation Subject<br/>Resource/Service/Commitment]
        Reviewers[Required Reviewers<br/>Min 2, Max 5]
        Deadline[Review Deadline<br/>24-72 hours]
        Criteria[Validation Criteria<br/>Quality Rules]
    end

    subgraph "Review Process"
        Assign[Assign Reviewers<br/>Random Selection]
        Collect[Collect Reviews<br/>Parallel Process]
        Consensus[Consensus Check<br/>Threshold Analysis]
        Outcome[Validation Outcome<br/>Approved/Rejected]
    end

    subgraph "Appeal Process"
        Appeal[Appeal Initiation<br/>3-day Window]
        ReReview[Re-review Process<br/>New Reviewers]
        FinalDecision[Final Decision<br/>Binding Outcome]
    end

    ValType --> Assign
    Subject --> Assign
    Reviewers --> Assign
    Deadline --> Collect
    Criteria --> Collect

    Assign --> Collect
    Collect --> Consensus
    Consensus --> Outcome

    Outcome --> Appeal
    Appeal --> ReReview
    ReReview --> FinalDecision
#![allow(unused)]
fn main() {
ValidationWorkflow {
    workflow_type: ValidationType,  // 2-of-3, N-of-M, simple_majority
    subject: ValidationSubject,     // Resource, Service, Commitment
    required_reviewers: u32,
    review_deadline: SystemTime,
    validation_criteria: ValidationRules,
    appeal_process: AppealProcedure,
}
}

Validation Types:

  • 2-of-3 Validation: 3 reviewers, 2 required for consensus
  • N-of-M Validation: Custom reviewer numbers and consensus thresholds
  • Simple Majority: Democratic decision-making with minimum participation

2. Agent Promotion Workflow

graph TD
    subgraph "Promotion Levels"
        Simple[Simple Agent<br/>Base Access]
        Accountable[Accountable Agent<br/>Stewardship Role]
        Primary[Primary Accountable<br/>Coordination Role]
        Advanced[Advanced Agent<br/>Governance Role]
    end

    subgraph "Simple → Accountable"
        S1[First Validated Transaction]
        S2[Basic PPR Earned]
        S3[Identity Verified]
    end

    subgraph "Accountable → Primary"
        A1[Multiple PPR Categories<br/>3+ Categories]
        A2[Specialized Validation<br/>Process Expertise]
        A3[Community Standing<br/>Reputation Threshold]
    end

    subgraph "Primary → Advanced"
        P1[Governance Participation<br/>Commitment Fulfillment]
        P2[Dispute Resolution<br/>Mediation Experience]
        P3[System Leadership<br/>Coordination Excellence]
    end

    Simple --> S1 --> S2 --> S3 --> Accountable
    Accountable --> A1 --> A2 --> A3 --> Primary
    Primary --> P1 --> P2 --> P3 --> Advanced
#![allow(unused)]
fn main() {
PromotionWorkflow {
    current_level: CapabilityLevel,
    target_level: CapabilityLevel,
    eligibility_criteria: PromotionRequirements,
    evaluation_period: Duration,
    required_ppr_categories: Vec<PPRCategory>,
    milestone_achievements: Vec<PPRMilestone>,
    review_board: Vec<AgentPubKey>,
}
}

Promotion Criteria:

  • Simple → Accountable: First validated transaction + basic PPR
  • Accountable → Primary: Multiple PPR categories + specialized validation
  • Primary → Advanced: Governance participation + dispute resolution experience

3. Dispute Resolution Process

#![allow(unused)]
fn main() {
DisputeResolution {
    dispute_type: DisputeCategory,
    parties_involved: Vec<AgentPubKey>,
    evidence_collection: Vec<EvidenceHash>,
    mediation_process: MediationProcedure,
    resolution_options: ResolutionOptions,
    enforcement_mechanism: EnforcementStrategy,
}
}

Dispute Categories:

  • Resource Quality: Resource not meeting specifications
  • Service Quality: Service not meeting agreed standards
  • Access Violations: Unauthorized resource access or use
  • Contract Disputes: Commitment fulfillment disagreements
  • Reputation Challenges: PPR validity disputes

📈 Performance & Scalability Architecture

1. DHT Optimization Strategies

Anchor Pattern Optimization:
├── Resource Discovery Anchors (category-based indexing)
├── Agent Discovery Anchors (role-based indexing)
├── Process Type Anchors (process-based indexing)
└── Geographic Anchors (location-based indexing)

Link Traversal Optimization:
├── Efficient Link Creation (minimal link overhead)
├── Cached Link Queries (reduced DHT calls)
├── Batch Link Operations (reduced network traffic)
└── Link Cleanup Strategies (DHT maintenance)

2. Reputation System Performance

PPR Calculation Optimization:
├── Incremental Updates (only calculate changes)
├── Cached Reputation Scores (periodic refresh)
├── Category-Specific Caching (domain-specific optimization)
└── Asynchronous Validation (non-blocking reputation updates)

Scalability Considerations:
├── PPR Rate Limiting (prevents reputation spam)
├── Validation Pool Management (efficient reviewer assignment)
├── Reputation Decay (historical relevance weighting)
└── Distributed Calculation (peer-to-peer reputation consensus)

3. Private Data Access Performance

Access Control Optimization:
├── Capability Token Caching (reduced validation overhead)
├── Grant Status Indexing (fast access validation)
├── Field-Level Access Caching (optimized data retrieval)
└── Expiration Queue Management (automatic cleanup)

Encryption Performance:
├── Symmetric Encryption for Data (efficient encryption/decryption)
├── Asymmetric Encryption for Keys (secure key exchange)
├── Key Derivation Optimization (efficient key management)
└── Secure Storage Compression (reduced storage overhead)

🔮 Future Architecture Extensions

1. Advanced Governance Features

  • Dynamic Rule Updates: Community-driven governance rule modifications
  • Delegated Validation: Hierarchical validation delegation systems
  • Cross-Community Coordination: Inter-hApp governance coordination
  • Automated Dispute Resolution: AI-assisted dispute mediation

2. Enhanced Economic Processes

  • Process Composition: Complex multi-process workflows
  • Resource Bundling: Package deals and combined services
  • Subscription Models: Recurring access and service arrangements
  • Market Integration: External market price discovery and integration

3. Advanced Reputation Systems

  • Skill-Based Reputation: Domain-specific expertise tracking
  • Temporal Reputation Patterns: Time-based reputation analysis
  • Network Reputation: Relationship-based reputation scoring
  • Privacy-Preserving Reputation: Zero-knowledge reputation proofs

4. Performance & Scalability Enhancements

  • Sharding Strategies: Horizontal scaling through network partitioning
  • Caching Layers: Multi-level caching for frequently accessed data
  • Compression Algorithms: Advanced data compression for storage efficiency
  • Load Balancing: Intelligent request routing and resource allocation

📋 Architecture Decision Records (ADRs)

ADR-001: Three-Zome Architecture

Decision: Implement 3-zome architecture (person, resource, governance) Rationale: Clear separation of concerns, focused responsibility domains Alternatives Considered: Single monolithic zome, 5+ specialized zomes Impact: Simplified development, clear API boundaries, cross-zome coordination complexity

ADR-002: PPR-Based Reputation System

Decision: Implement 14-category PPR reputation system with cryptographic proofs Rationale: Comprehensive reputation tracking, fraud resistance, privacy preservation Alternatives Considered: Simple scoring system, centralized reputation database Impact: Complex implementation, strong trust foundations, computational overhead

ADR-003: Four Economic Processes

Decision: Standardize on Use, Transport, Storage, Repair processes Rationale: Covers common sharing scenarios, clear role definitions, structured workflows Alternatives Considered: Unlimited process types, minimal process structure Impact: Standardized workflows, limited flexibility, easier validation

ADR-004: Capability-Based Security Model

Decision: Progressive capability tokens with role-based restrictions Rationale: Gradual trust building, principle of least privilege, automated advancement Alternatives Considered: All-or-nothing access, centralized authorization Impact: Complex access control, strong security, user-friendly progression


🎯 Architecture Quality Metrics

Performance Targets

  • Zome Function Response Time: < 500ms for common operations
  • PPR Calculation Time: < 2s for reputation score derivation
  • Validation Workflow Time: < 24h for standard validations
  • Private Data Access Time: < 1s for authorized access requests

Security Metrics

  • Capability Token Security: Cryptographically secure, non-repudiable
  • PPR System Integrity: Tamper-evident, cryptographically verifiable
  • Private Data Protection: End-to-end encryption, field-level access control
  • Access Control Compliance: 100% enforcement of capability restrictions

Scalability Targets

  • Concurrent Users: Support 1000+ concurrent agents
  • Resource Management: 10,000+ concurrent economic resources
  • Process Throughput: 100+ concurrent economic processes
  • Reputation Queries: 10,000+ concurrent reputation calculations

Reliability Requirements

  • System Availability: 99.9% uptime for critical functions
  • Data Consistency: Strong consistency for all economic transactions
  • Backup Recovery: Complete data recovery from any network state
  • Error Recovery: Graceful handling of network partitions and failures

This architecture document represents the current state of the Nondominium system as of October 30, 2025. It is a living document that evolves with the implementation and community feedback.

Nondominium UI Architecture

Status: MVP implemented (see documentation/IMPLEMENTATION_STATUS.md for current status).
Cross-references: documentation/requirements/ui_design.md (normative UI requirements), documentation/requirements/requirements.md (REQ-USER-* stories).


1. Overview

The Nondominium frontend is a SvelteKit application using Svelte 5 runes, Effect-TS for async state management, and UnoCSS for styling. It exposes the three-zome Holochain backend through a typed service + store layer and renders a three-level navigational hierarchy:

Lobby  →  Group  →  NDO

This hierarchy maps to the three concentric organizational scopes in ui_design.md:

  • Lobby — the entry point: all NDOs visible to any connected agent, Groups listed in sidebar.
  • Group — organizational context: NDOs scoped to a group, where new NDOs are created.
  • NDO — the resource identity detail view: Layer 0 metadata, lifecycle transitions, fork friction.

2. Technology Stack

LayerTechnology
FrameworkSvelteKit 2 + Svelte 5 runes ($state, $derived, $effect)
LanguageTypeScript (strict mode)
StylingUnoCSS (atomic CSS, preset-wind)
Headless componentsMelt UI next-gen (melt)
Async / error handlingEffect-TS (effect package) — Context.Tag, Layer, E.gen
Holochain client@holochain/client 0.19.0
Shared types@nondominium/shared-types (workspace package)
BuildVite 6.2.5

3. Layer Architecture

┌──────────────────────────────────────────────────────────────────┐
│ ROUTES                                                            │
│ /   (LobbyView)  /group/[id]  /ndo/[hash]  /ndo/new             │
└──────────────────────────────────────────────────────────────────┘
                                ↓
┌──────────────────────────────────────────────────────────────────┐
│ COMPONENTS                                                        │
│ lobby/: LobbyView, GroupSidebar, NdoBrowser, NdoCard,            │
│         UserProfileForm                                           │
│ group/: GroupView, NdoCreateModal, GroupProfileModal, MemberList  │
│ ndo/:   NdoView, NdoIdentityLayer, LifecycleTransitionModal,      │
│         TransitionHistoryPanel, ForkNdoModal                      │
│ shell/: Sidebar (global nav)                                      │
└──────────────────────────────────────────────────────────────────┘
                                ↓
┌──────────────────────────────────────────────────────────────────┐
│ STORES (Svelte 5 $state + Effect-TS)                              │
│ app.context.svelte.ts   — cross-view app state                    │
│ lobby.store.svelte.ts   — Lobby-level NDOs, groups, filters       │
│ group.store.svelte.ts   — Group-scoped NDOs                       │
│ resource.store.svelte.ts — ResourceSpecification list             │
└──────────────────────────────────────────────────────────────────┘
                                ↓
┌──────────────────────────────────────────────────────────────────┐
│ SERVICES (Effect-TS Context.Tag / Layer)                          │
│ person.service.ts    — PersonServiceTag / PersonServiceLive        │
│ resource.service.ts  — ResourceServiceTag / ResourceServiceLive   │
│ governance.service.ts — GovernanceServiceTag / Live               │
│ ndo.service.ts       — NdoServiceTag / NdoServiceLive             │
│ lobby.service.ts     — LobbyServiceTag / LobbyServiceLive         │
│ group.service.ts     — GroupServiceTag / GroupServiceLive (stub)  │
└──────────────────────────────────────────────────────────────────┘
                                ↓
┌──────────────────────────────────────────────────────────────────┐
│ HOLOCHAIN CLIENT                                                  │
│ holochain.service.svelte.ts — HolochainClientServiceTag           │
│ wrapZomeCallWithErrorFactory — wz<T>(fnName, payload, ctx)        │
└──────────────────────────────────────────────────────────────────┘
                                ↓
┌──────────────────────────────────────────────────────────────────┐
│ HOLOCHAIN CONDUCTOR (3-Zome DNA)                                  │
│ zome_person · zome_resource · zome_gouvernance                    │
└──────────────────────────────────────────────────────────────────┘

4. Three-Level Identity Model (MVP)

The MVP UI introduces three distinct identity layers that do not require DHT writes for the outer two, enabling permissionless browsing and progressive disclosure.

Level 1 — Lobby (LobbyUserProfile, localStorage)

interface LobbyUserProfile {
  nickname: string;       // required
  realName?: string;
  bio?: string;
  email?: string;
  phone?: string;
  address?: string;
}
  • Stored in localStorage key ndo_lobby_profile_v1.
  • Hydrated into appContext.lobbyUserProfile ($state) on first module load.
  • Created/edited via UserProfileForm.svelte (modal on first launch, page-mode for edits).
  • No DHT entry. Exists before any Person entry is created.

Level 2 — Group (GroupMemberProfile, localStorage)

interface GroupMemberProfile {
  isAnonymous: boolean;
  shownFields: (keyof Omit<LobbyUserProfile, 'nickname'>)[];
}
  • Stored alongside GroupDescriptor in localStorage key ndo_groups_v1.
  • Prompted once per group via GroupProfileModal.svelte on first group entry.
  • Agent controls which LobbyUserProfile fields are visible to other group members.

Level 3 — NDO/Agent (Person entry, zome_person DHT)

  • Written to the DHT when an agent performs their first DHT-active action (create NDO, accept commitment).
  • Linked to AgentPubKey on-chain.
  • Required for governance participation, custodianship, specialised process access.
  • Documented in documentation/requirements/agent.md §2.1.

5. Group Architecture (MVP Shell)

Groups are the mandatory context for NDO creation. In the MVP, Group DNA does not yet exist; groups are persisted as GroupDescriptor[] in localStorage (key ndo_groups_v1).

interface GroupDescriptor {
  id: string;          // generated: grp_<timestamp>_<random>
  name: string;
  createdBy?: string;  // LobbyUserProfile.nickname
  createdAt?: number;
  ndoHashes?: string[];        // ActionHash[]  (base64) of NDOs created in this group
  memberProfile?: GroupMemberProfile;
}

Invite links encode the GroupDescriptor as btoa(JSON.stringify(group)) in a URL query parameter.

When Group DNA lands, only LobbyService.createGroup / joinGroup and the GroupDescriptor persistence need to change. All component and store logic remains identical.


6. Component Reference

Lobby Level

ComponentFileDescription
LobbyViewlobby/LobbyView.svelteRoot lobby layout: profile bar, sidebar, NdoBrowser
UserProfileFormlobby/UserProfileForm.svelteLobby profile create/edit (modal or page mode)
GroupSidebarlobby/GroupSidebar.svelteGroups list, Create Group form, Join Group form, My Profile link
NdoBrowserlobby/NdoBrowser.svelteFilter chip bar (3 groups × multi-select) + NdoCard grid
NdoCardlobby/NdoCard.svelteCompact NDO summary card with lifecycle/nature/regime badges

Group Level

ComponentFileDescription
GroupViewgroup/GroupView.svelteGroup header, Create NDO button, group-scoped NdoBrowser, MemberList stub
NdoCreateModalgroup/NdoCreateModal.svelte5-field NDO creation form (name, regime, nature, stage, description)
GroupProfileModalgroup/GroupProfileModal.sveltePer-group profile presentation choice (first entry only)

NDO Level

ComponentFileDescription
NdoViewndo/NdoView.svelteNDO detail: header, tab navigation, Fork button
NdoIdentityLayerndo/NdoIdentityLayer.svelteLayer 0 identity panel: badges, initiator link, transition button, history
LifecycleTransitionModalndo/LifecycleTransitionModal.svelteState machine transitions with special Deprecated / Hibernating handling
TransitionHistoryPanelndo/TransitionHistoryPanel.svelteCollapsible history of lifecycle transitions
ForkNdoModalndo/ForkNdoModal.svelteInformational fork friction modal with copy-pubkey CTA

Shell

ComponentFileDescription
Sidebarshell/Sidebar.svelteGlobal nav — "Browse NDOs", context-aware "New NDO" link

7. State Management

app.context.svelte.ts

Cross-view singleton. All $state variables are module-level (Svelte 5 rune pattern):

FieldTypePersisted
myAgentPubKeyAgentPubKey | nullNo
myPersonPerson | nullNo
currentView'lobby' | 'group' | 'ndo'No
selectedGroupIdstring | nullNo
selectedNdoIdActionHash | nullNo
lobbyUserProfileLobbyUserProfile | nullYes — localStorage

lobby.store.svelte.ts

Effect-TS E.gen store instantiated once at module load via E.runSync.

Reactive fieldDerives from
ndosNdoServiceTag.getLobbyNdoDescriptors()
filteredNdosndos + activeFilters (client-side OR-within/AND-across)
groupsLobbyServiceTag.getMyGroups()
activeFiltersMutations via setFilters() / clearFilters()
myPersonPersonServiceTag.getMyPersonProfile()

group.store.svelte.ts

Singleton per-session; loadGroupData(groupId) switches context:

FieldSource
grouplocalStorage (ndo_groups_v1)
groupNdosNdoServiceTag.getGroupNdoDescriptors(groupId)

8. Service Layer

Pattern

All services use the wz<T> factory:

const wz = <T>(fnName: string, payload: unknown, context: string) =>
  wrapZomeCallWithErrorFactory<T, DomainError>(
    holochainClient, 'zome_name', fnName, payload, context, DomainError.fromError
  );

ndo.service.ts — NdoServiceTag

MethodDelegates to
getLobbyNdoDescriptors()resource.getAllResourceSpecifications() + resource.getAllNdos() joined by name
getNdoDescriptorForSpecActionHash(hash)Same join, filtered by hash
createNdo(input, groupId)resource.createNdo(input) + localStorage group link
updateLifecycleStage(input)resource.updateLifecycleStage(input)
getNdoTransitionHistory(hash)resource.getNdoTransitionHistory(hash) (returns [] gracefully)
getGroupNdoDescriptors(groupId)All descriptors filtered by group's ndoHashes

lobby.service.ts — LobbyServiceTag (localStorage-backed)

MethodStorage
getMyGroups()localStorage[ndo_groups_v1]
createGroup(name, createdBy)Appends to localStorage[ndo_groups_v1]
joinGroup(inviteCode)Decodes base64 invite, appends if not already present
generateInviteLink(groupId)btoa(JSON.stringify(group)) → URL param

9. Routing

RouteComponentNotes
/LobbyViewLobby entry point; shows all NDOs
/group/[id]GroupViewGroup-scoped view; ?createNdo=1 auto-opens modal
/ndo/[hashB64]NdoViewNDO detail (hash is base64-encoded ActionHash)
/ndo/newRedirect pageRedirects to active group or shows explanation
  • "New NDO" link in Sidebar: if appContext.selectedGroupId is set → /group/{id}?createNdo=1; else → /ndo/new (explanation screen).
  • Group navigation: GroupSidebar.svelte calls goto('/group/{id}') after create/join.
  • Post-NDO-creation: NdoCreateModal.svelte calls goto('/ndo/{hashB64}') on success.

10. NDO Lifecycle State Machine (Frontend Mirror)

LifecycleTransitionModal.svelte encodes the same state machine as the Rust validation in zome_resource. Allowed transitions:

FromAllowed next stages
IdeationSpecification, Deprecated, EndOfLife
SpecificationDevelopment, Deprecated, EndOfLife
DevelopmentPrototype, Deprecated, EndOfLife
PrototypeStable, Deprecated, EndOfLife
StableDistributed, Deprecated, EndOfLife
DistributedActive, Deprecated, EndOfLife
ActiveHibernating, Deprecated, EndOfLife
Hibernatinghibernation_origin stage, Deprecated, EndOfLife
DeprecatedEndOfLife

Special handling:

  • Deprecated: requires successor NDO selection (autocomplete from lobbyStore.ndos).
  • Hibernating: confirmation message shown; hibernation_origin preserved in entry.
  • Transition button visible to initiator only (descriptor.initiator === encodeHashToBase64(myAgentPubKey)).
  • transition_event_hash is passed as null in MVP (automatic EconomicEvent generation is a post-MVP backend task).

11. Filter Architecture (NdoBrowser)

Three independent chip groups with multi-select:

GroupOptionsLogic
LifecycleStage10 variantsOR within group
ResourceNature5 variantsOR within group
PropertyRegime6 variantsOR within group

Cross-group logic: AND (an NDO must match at least one selection in every active group). Default: all filters empty = show all NDOs. Chip colors: match the badge colors in NdoIdentityLayer.svelte color maps.


12. Fork Friction Pattern

Fork requests are intentionally non-trivial by design (see ui_design.md Fork section). The MVP implements:

  • Informational modal only (ForkNdoModal.svelte): explains negotiation → consensus → Unyt stake (post-MVP) flow.
  • CTA: copy initiator's AgentPubKey (base64) to clipboard for out-of-band contact.
  • Visibility: Fork button visible to any authenticated user (anyone with myAgentPubKey set).
  • Full fork submission (claim, vote, Unyt stake) is post-MVP.

13. Post-MVP UI Tracks

The following UI capabilities are documented but not yet implemented:

TrackTriggerDesign reference
Group DNA backendWhen zome_group lands — replace LobbyService localStorage impllobby-dna.md, lobby-architecture.md
NDO cell cloningPer-NDO DHT once Holochain cloning stabilisesndo_prima_materia.md §4
PPR / Reputation dashboardAfter PPR zome functions are complete (#14–#21)specifications/governance/private-participation-receipt.md
Economic Process workflowsAfter Phase 2.2 process infrastructure landsrequirements.md §4.2, implementation_plan.md §5 Phase 2.2
Person management componentsAfter enhanced private data sharing (#40)requirements.md §4.1, issue #8
Role management UIAfter agent promotion workflow (#33, #34)requirements.md §4.3
Moss WeAppletPost-MVP deployment targetimplementation_plan.md §12.6
Unyt / Flowsta integration UIPhases 12.2–12.3 in implementation planpost-mvp/unyt-integration.md, post-mvp/flowsta-integration.md

14. Effect-TS Patterns

Service injection

// Resolved layer for direct component use
export const NdoServiceResolved: Layer.Layer<NdoServiceTag> =
  NdoServiceLive.pipe(Layer.provide(ResourceServiceResolved));

// Usage in a Svelte $effect or onMount
const exit = await E.runPromiseExit(
  pipe(
    E.gen(function* () {
      const svc = yield* NdoServiceTag;
      return yield* svc.getLobbyNdoDescriptors();
    }),
    E.provide(NdoServiceResolved)
  )
);

Store instantiation (Svelte 5 rune + Effect pattern)

// Module-level $state variables (top-level only — Svelte 5 rune constraint)
let ndos = $state<NdoDescriptor[]>([]);

// Store created synchronously with E.runSync; Effect only provides dependencies
export const lobbyStore = pipe(
  createLobbyStore(),         // E.Effect<LobbyStore, never, Services>
  E.provide(LobbyStoreServicesResolved),
  E.runSync                   // services are pure/synchronous; no async at creation time
);

Error handling

All zome errors are domain-tagged (ResourceError, PersonError, etc.) with context strings for debugging. Effects that may fail are run with E.runPromiseExit, and Exit.isSuccess(exit) guards all state mutations.

VfAction Usage Guide

Overview

The VfAction enum provides type-safe representation of ValueFlows actions in the nondominium system, supporting structured Economic Processes, role-based access control, and comprehensive governance workflows. It replaces the previous string-based approach with a strongly-typed enum that ensures compile-time validation, better documentation, and seamless integration with the Private Participation Receipt (PPR) system.

Available Actions

Standard ValueFlows Actions

Transfer Actions

  • Transfer - Transfer ownership/custody between agents
  • Move - Move a resource from one location to another (used in Transport processes)

Production/Consumption Actions

  • Use - Core nondominium process: use a resource without consuming it (accessible to all Accountable Agents)
  • Consume - Consume/destroy a resource (used in end-of-life processes)
  • Produce - Create/produce a new resource
  • Work - Apply work/labor to a resource (used in Transport and Storage processes, requires specialized roles)

Modification Actions

  • Modify - Modify an existing resource, applies to the Repair Process, accessible by Agents that have credencials for the Repair role.

Quantity Adjustment Actions

  • Raise - Increase quantity/value of a resource
  • Lower - Decrease quantity/value of a resource

Citation/Reference Actions

  • Cite - Reference or cite a resource
  • Accept - Accept delivery or responsibility

nondominium-Specific Actions

  • InitialTransfer - First transfer by a Simple Agent (triggers agent promotion process)
  • AccessForUse - Request access to use a resource (creates commitment for Use process)
  • TransferCustody - Transfer custody between Primary Accountable Agents (nondominium specific)

VfAction in Economic Processes

The nondominium system implements four structured Economic Processes that use specific VfAction combinations:

Process-Action Mappings

Use Process (Core nondominium process)

  • Primary Action: Use
  • Access: All Accountable Agents
  • Resource Effect: Resource unchanged
  • PPR Generated: Service process receipts

Transport Process (Material resource movement)

  • Primary Actions: Move, Work
  • Access: Agents with Transport role credentials only
  • Resource Effect: Resource location changed, otherwise unchanged
  • PPR Generated: Transport-specific service receipts

Storage Process (Temporary custody)

  • Primary Actions: Work, TransferCustody
  • Access: Agents with Storage role credentials only
  • Resource Effect: Resource unchanged
  • PPR Generated: Storage-specific service receipts

Repair Process (Resource maintenance)

  • Primary Actions: Modify, Work
  • Access: Agents with Repair role credentials only
  • Resource Effect: Resource state may change (broken → functional)
  • PPR Generated: Repair-specific service receipts

Governance-as-Operator Pattern Examples

Cross-Zome State Transition Examples

The governance-as-operator pattern requires explicit cross-zome calls for state changes:

Resource Transfer with Governance Evaluation

#![allow(unused)]
fn main() {
use zome_gouvernance_integrity::VfAction;

// Transfer resource custody through governance operator
pub fn transfer_resource_with_governance(
    resource_hash: ActionHash,
    new_custodian: AgentPubKey,
    notes: Option<String>,
) -> ExternResult<GovernanceTransitionResult> {

    // 1. Get current resource state
    let resource = get_economic_resource(resource_hash)?;
    let agent_info = agent_info()?;

    // 2. Create governance transition request
    let transition_request = GovernanceTransitionRequest {
        action: VfAction::TransferCustody,
        resource: resource.clone(),
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            target_custodian: Some(new_custodian),
            process_notes: notes,
            ..Default::default()
        },
    };

    // 3. Call resource zome to handle state transition
    let result: GovernanceTransitionResult = call(
        CallTargetCell::Local,
        "zome_resource",
        "request_resource_transition".into(),
        None,
        &transition_request,
    )?;

    // 4. Handle result
    if result.success {
        println!("Transfer approved by governance");
        if let Some(event) = result.economic_event {
            println!("Economic event generated: {:?}", event);
        }
    } else {
        println!("Transfer rejected: {:?}", result.rejection_reasons);
    }

    Ok(result)
}
}

Use Process with Governance Validation

#![allow(unused)]
fn main() {
// Use process with governance operator pattern
pub fn request_resource_use_with_governance(
    resource_hash: ActionHash,
    use_notes: Option<String>,
) -> ExternResult<GovernanceTransitionResult> {

    let resource = get_economic_resource(resource_hash)?;
    let agent_info = agent_info()?;

    let use_request = GovernanceTransitionRequest {
        action: VfAction::Use,
        resource: resource,
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            process_notes: use_notes,
            ..Default::default()
        },
    };

    let result: GovernanceTransitionResult = call(
        CallTargetCell::Local,
        "zome_resource",
        "request_resource_transition".into(),
        None,
        &use_request,
    )?;

    // Check if specific validation was required
    if let Some(next_steps) = result.next_steps {
        println!("Additional validation required: {:?}", next_steps);
    }

    Ok(result)
}
}

Transport Process with Role Validation

#![allow(unused)]
fn main() {
// Transport process requiring Transport role validation
pub fn transport_resource_with_governance(
    resource_hash: ActionHash,
    destination: String,
    transport_notes: Option<String>,
) -> ExternResult<GovernanceTransitionResult> {

    let resource = get_economic_resource(resource_hash)?;
    let agent_info = agent_info()?;

    let transport_request = GovernanceTransitionRequest {
        action: VfAction::Move,
        resource: resource,
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            target_location: Some(destination),
            process_notes: transport_notes,
            ..Default::default()
        },
    };

    let result: GovernanceTransitionResult = call(
        CallTargetCell::Local,
        "zome_resource",
        "request_resource_transition".into(),
        None,
        &transport_request,
    )?;

    // Transport generates both Move and Work events
    if result.success {
        if let Some(event) = result.economic_event {
            match event.action {
                VfAction::Move => println!("Transport move event generated"),
                VfAction::Work => println!("Transport work event generated"),
                _ => println!("Other event type: {:?}", event.action),
            }
        }
    }

    Ok(result)
}
}

Repair Process with State Change Validation

#![allow(unused)]
fn main() {
// Repair process with state transition validation
// TODO: update new_operational_state parameter type from ResourceState to OperationalState
// once the ResourceState split is implemented (see ndo_prima_materia.md Section 5, REQ-NDO-OS-01).
// The repair process sets OperationalState::InMaintenance on the EconomicResource instance,
// while LifecycleStage on NondominiumIdentity remains unchanged.
pub fn repair_resource_with_governance(
    resource_hash: ActionHash,
    repair_details: String,
    new_operational_state: Option<ResourceState>, // TODO: → Option<OperationalState>
) -> ExternResult<GovernanceTransitionResult> {

    let resource = get_economic_resource(resource_hash)?;
    let agent_info = agent_info()?;

    let repair_request = GovernanceTransitionRequest {
        action: VfAction::Modify,
        resource: resource,
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            process_notes: Some(repair_details),
            metadata: new_operational_state.map(|state| {
                let mut metadata = HashMap::new();
                metadata.insert("target_operational_state".to_string(), state.to_string());
                metadata
            }).unwrap_or_default(),
            ..Default::default()
        },
    };

    let result: GovernanceTransitionResult = call(
        CallTargetCell::Local,
        "zome_resource",
        "request_resource_transition".into(),
        None,
        &repair_request,
    )?;

    // Verify resource state was updated as expected
    if result.success {
        if let (Some(expected_state), Some(actual_state)) = (new_state, result.new_resource_state.as_ref()) {
            if actual_state.state == expected_state {
                println!("Resource state correctly updated to: {:?}", expected_state);
            } else {
                warn!("Resource state mismatch: expected {:?}, got {:?}", expected_state, actual_state.state);
            }
        }
    }

    Ok(result)
}
}

Batch Processing with Governance

#![allow(unused)]
fn main() {
// Batch multiple state transitions efficiently
pub fn batch_process_transitions(
    requests: Vec<GovernanceTransitionRequest>,
) -> ExternResult<Vec<GovernanceTransitionResult>> {

    // Validate batch size
    if requests.len() > 50 {
        return Err(WasmError::Guest(
            "Batch size too large, maximum 50 requests".to_string()
        ).into());
    }

    // Group requests by resource specification for efficiency
    let mut grouped_requests: HashMap<ActionHash, Vec<GovernanceTransitionRequest>> = HashMap::new();
    for request in requests {
        let spec_hash = request.resource.conforms_to;
        grouped_requests.entry(spec_hash)
            .or_insert_with(Vec::new)
            .push(request);
    }

    // Process each group through resource zome
    let mut all_results = Vec::new();
    for group_requests in grouped_requests.values() {
        let group_results: Vec<GovernanceTransitionResult> = call(
            CallTargetCell::Local,
            "zome_resource",
            "batch_state_transitions".into(),
            None,
            &group_requests,
        )?;
        all_results.extend(group_results);
    }

    Ok(all_results)
}

// Example batch usage
pub async fn example_batch_transfers() -> ExternResult<()> {
    let transfers = vec![
        create_transfer_request("resource_1", "agent_2"),
        create_transfer_request("resource_2", "agent_3"),
        create_transfer_request("resource_3", "agent_1"),
    ];

    let results = batch_process_transitions(transfers)?;

    for (index, result) in results.iter().enumerate() {
        match result.success {
            true => println!("Transfer {} approved", index + 1),
            false => println!("Transfer {} rejected: {:?}", index + 1, result.rejection_reasons),
        }
    }

    Ok(())
}

fn create_transfer_request(resource_id: &str, target_agent: &str) -> GovernanceTransitionRequest {
    let resource_hash = resource_id.parse().expect("Invalid resource ID");
    let target_custodian = target_agent.parse().expect("Invalid agent ID");

    GovernanceTransitionRequest {
        action: VfAction::TransferCustody,
        resource: get_economic_resource(resource_hash).unwrap(),
        requesting_agent: agent_info().unwrap().agent_initial_pubkey,
        context: TransitionContext {
            target_custodian: Some(target_custodian),
            ..Default::default()
        },
    }
}
}

Usage Examples

Economic Process Workflows

Simple Agent First Transaction

#![allow(unused)]
fn main() {
use zome_gouvernance_integrity::VfAction;

// Simple Agent's first transfer (triggers promotion)
let initial_transfer_event = LogEconomicEventInput {
    action: VfAction::InitialTransfer,
    provider: simple_agent_pubkey,
    receiver: accountable_agent_pubkey,
    resource_inventoried_as: new_resource_hash,
    resource_quantity: 1.0,
    note: Some("First resource transfer triggering agent promotion".to_string()),
};

// This automatically triggers:
// 1. Resource validation by receiving agent
// 2. Simple Agent promotion to Accountable Agent
// 3. Bi-directional PPR issuance (ResourceContribution + NetworkValidation)
}

Use Process (Core nondominium)

#![allow(unused)]
fn main() {
// Creating commitment for Use process
let use_commitment = Commitment {
    action: VfAction::Use,
    provider: resource_custodian,
    receiver: requesting_agent,
    resource_inventoried_as: Some(resource_hash),
    input_of: Some(use_process_hash),
    due_date: future_timestamp,
    note: Some("Resource use under governance rules".to_string()),
    committed_at: sys_time()?,
};

// Economic event upon completion
let use_event = LogEconomicEventInput {
    action: VfAction::Use,
    provider: resource_custodian,
    receiver: requesting_agent,
    resource_inventoried_as: resource_hash,
    resource_quantity: 1.0,
    note: Some("Resource used according to embedded governance rules".to_string()),
};
}

Transport Process (Specialized role required)

#![allow(unused)]
fn main() {
// Transport process commitment (requires Transport role)
let transport_commitment = Commitment {
    action: VfAction::Work, // Transport is a Work action
    provider: transport_agent_with_credentials,
    receiver: destination_agent,
    resource_inventoried_as: Some(resource_hash),
    input_of: Some(transport_process_hash),
    due_date: delivery_deadline,
    note: Some("Transport resource to new location".to_string()),
    committed_at: sys_time()?,
};

// Movement event during transport
let move_event = LogEconomicEventInput {
    action: VfAction::Move,
    provider: transport_agent,
    receiver: destination_agent,
    resource_inventoried_as: resource_hash,
    resource_quantity: 1.0,
    note: Some("Resource moved from origin to destination".to_string()),
};
}

Repair Process (Modifies resource state)

#![allow(unused)]
fn main() {
// Repair commitment (requires Repair role)
let repair_commitment = Commitment {
    action: VfAction::Modify,
    provider: repair_agent_with_credentials,
    receiver: resource_owner,
    resource_inventoried_as: Some(broken_resource_hash),
    input_of: Some(repair_process_hash),
    due_date: repair_completion_date,
    note: Some("Repair resource from broken to functional state".to_string()),
    committed_at: sys_time()?,
};

// Repair completion event
let repair_event = LogEconomicEventInput {
    action: VfAction::Modify,
    provider: repair_agent,
    receiver: resource_owner,
    resource_inventoried_as: broken_resource_hash,
    resource_quantity: 1.0,
    note: Some("Resource repaired: broken → functional".to_string()),
};
}

Process Chaining (Multi-role agent)

#![allow(unused)]
fn main() {
// Agent with Transport + Repair roles chaining actions
let chained_commitment = Commitment {
    action: VfAction::Work, // Represents entire chain
    provider: multi_role_agent,
    receiver: final_recipient,
    resource_inventoried_as: Some(resource_hash),
    input_of: Some(chained_process_hash),
    due_date: completion_deadline,
    note: Some("Transport → Repair → Transport delivery chain".to_string()),
    committed_at: sys_time()?,
};

// Single completion event for entire chain
let chain_completion_event = LogEconomicEventInput {
    action: VfAction::Work,
    provider: multi_role_agent,
    receiver: final_recipient,
    resource_inventoried_as: resource_hash,
    resource_quantity: 1.0,
    note: Some("Completed transport + repair + delivery chain".to_string()),
};
}

TypeScript (UI) - Process Management

import type { VfAction, EconomicEvent, Commitment } from "./types";

// Process initiation helper
const initiateProcess = (
  processType: "Use" | "Transport" | "Storage" | "Repair",
  resourceHash: string,
  agentHasRole: boolean,
): Commitment => {
  if (!agentHasRole && processType !== "Use") {
    throw new Error(`Agent lacks required role for ${processType} process`);
  }

  const actionMap: Record<string, VfAction> = {
    Use: "Use",
    Transport: "Work",
    Storage: "Work",
    Repair: "Modify",
  };

  return {
    action: actionMap[processType],
    provider: agentPubKey,
    receiver: recipientPubKey,
    resource_inventoried_as: resourceHash,
    input_of: `${processType.toLowerCase()}_process_${Date.now()}`,
    due_date: Date.now() + 24 * 60 * 60 * 1000, // 24 hours
    note: `${processType} process commitment`,
    committed_at: Date.now(),
  };
};

// Usage examples
const useCommitment = initiateProcess("Use", resourceHash, true); // All Accountable Agents can use
const transportCommitment = initiateProcess(
  "Transport",
  resourceHash,
  hasTransportRole,
);
const repairCommitment = initiateProcess("Repair", resourceHash, hasRepairRole);

// PPR generation tracking
const trackPPRGeneration = (commitment: Commitment, event: EconomicEvent) => {
  // When claim links commitment to event, bi-directional PPRs are automatically generated
  console.log(
    `PPRs will be issued for ${commitment.action} process completion`,
  );

  // Example PPR types generated:
  // - ServiceCommitmentAccepted (when commitment created)
  // - ServiceFulfillmentCompleted (when event recorded)
  // - Corresponding counterparty receipts
};

Action Properties & Role Requirements

The VfAction enum includes helper methods to understand action behavior and governance requirements:

#![allow(unused)]
fn main() {
use zome_gouvernance_integrity::VfAction;

let action = VfAction::Work; // Used in Transport/Storage processes

// Check if action requires existing resource
if action.requires_existing_resource() {
    // Validate resource exists before allowing action
    let resource_exists = verify_resource_exists(resource_hash)?;
}

// Check if action creates new resource
if action.creates_resource() {
    // Handle resource creation logic and trigger validation
    let validation_required = action == VfAction::Produce;
}

// Check if action modifies quantity
if action.modifies_quantity() {
    // Update resource quantity and validate changes
    update_resource_quantity(resource_hash, new_quantity)?;
}

// Check if action changes custody
if action.changes_custody() {
    // Update custodian information and generate custody PPRs
    transfer_custody_with_pprs(current_custodian, new_custodian)?;
}

// NEW: Check if action requires specialized role
fn requires_specialized_role(action: &VfAction, process_type: &str) -> Option<String> {
    match (action, process_type) {
        (VfAction::Work, "Transport") => Some("Transport".to_string()),
        (VfAction::Work, "Storage") => Some("Storage".to_string()),
        (VfAction::Modify, "Repair") => Some("Repair".to_string()),
        (VfAction::Use, _) => None, // Accessible to all Accountable Agents
        _ => None,
    }
}

// NEW: Check if action triggers PPR generation
fn triggers_ppr_generation(action: &VfAction) -> bool {
    match action {
        VfAction::InitialTransfer => true, // ResourceContribution + NetworkValidation
        VfAction::Use => true,            // Service process receipts
        VfAction::Work => true,           // Transport/Storage service receipts
        VfAction::Modify => true,         // Repair service receipts
        VfAction::TransferCustody => true, // ResponsibleTransfer + CustodyAcceptance
        _ => false,
    }
}

// NEW: Get process validation requirements
fn get_validation_requirements(action: &VfAction, process_type: &str) -> ValidationRequirements {
    match (action, process_type) {
        (VfAction::InitialTransfer, _) => ValidationRequirements {
            requires_resource_validation: true,
            requires_agent_validation: true,
            minimum_validators: 1,
            validation_scheme: "simple_majority".to_string(),
        },
        (VfAction::Work, "Transport") => ValidationRequirements {
            requires_process_validation: true,
            minimum_validators: 1,
            validation_scheme: "simple_approval".to_string(),
        },
        (VfAction::Modify, "Repair") => ValidationRequirements {
            requires_process_validation: true,
            requires_state_change_validation: true,
            minimum_validators: 1,
            validation_scheme: "simple_approval".to_string(),
        },
        _ => ValidationRequirements::default(),
    }
}

// Example usage in process validation
let transport_action = VfAction::Work;
if let Some(required_role) = requires_specialized_role(&transport_action, "Transport") {
    let agent_has_role = check_agent_role(agent_pubkey, &required_role)?;
    if !agent_has_role {
        return Err(ProcessError::InsufficientRole(required_role));
    }
}

if triggers_ppr_generation(&transport_action) {
    // Prepare for automatic PPR issuance upon process completion
    prepare_ppr_generation(commitment_hash, process_type)?;
}
}

Role-Action Matrix

ActionUse ProcessTransport ProcessStorage ProcessRepair ProcessRole Required
Use✓ (Primary)---Accountable Agent
Work-✓ (Primary)✓ (Primary)✓ (Secondary)Transport/Storage Role
Modify---✓ (Primary)Repair Role
Move-✓ (Secondary)--Transport Role
TransferCustody-✓ (Final)✓ (Final)✓ (Final)Process Role + Custodian

Migration from String-Based Actions

Before (String-based)

#![allow(unused)]
fn main() {
// Old approach - error-prone
let event = EconomicEvent {
    action: "initial-transfer".to_string(), // Could have typos
    // ...
};
}

After (Enum-based)

#![allow(unused)]
fn main() {
// New approach - type-safe
let event = EconomicEvent {
    action: VfAction::InitialTransfer, // Compile-time validation
    // ...
};
}

Benefits

Core Development Benefits

  1. Type Safety: Compile-time validation prevents typos and invalid actions
  2. IDE Support: Better autocomplete and refactoring support
  3. Documentation: Self-documenting code with clear action definitions
  4. ValueFlows Compliance: Ensures actions match standard vocabulary
  5. Maintainability: Easier to add new actions and understand existing code

Governance Integration Benefits

  1. Role-Based Access Control: Automatic validation of agent roles for specialized processes
  2. PPR Integration: Seamless Private Participation Receipt generation for reputation tracking
  3. Process Validation: Built-in support for Economic Process validation requirements
  4. Cross-Zome Consistency: Unified action handling across person, resource, and governance zomes
  5. Audit Trail Completeness: Every action properly logged with governance context

Economic Process Benefits

  1. Process Chaining Support: Enable complex multi-step service delivery
  2. State Management: Proper resource state transitions based on action type
  3. Validation Automation: Automatic triggering of appropriate validation workflows
  4. Performance Tracking: Built-in performance metrics for service quality assessment

Security & Privacy Benefits

  1. Capability Enforcement: Actions respect progressive agent capability levels
  2. End-to-End Validation: From commitment through completion with cryptographic signatures
  3. Dispute Resolution Support: Clear action history for conflict resolution
  4. Privacy Preservation: PPR generation respects private entry storage patterns

Future Extensions

The VfAction enum is designed for extensibility to support advanced governance features:

Phase 2 Action Extensions

#![allow(unused)]
fn main() {
pub enum VfAction {
    // ... existing actions

    // Advanced governance actions
    Delegate,        // Delegate responsibility to another agent
    Revoke,          // Revoke access or role assignment
    Audit,           // Formal audit process initiation
    Mediate,         // Dispute mediation action
    Escalate,        // Escalate dispute to higher governance level
}
}

Phase 3 Network Actions

#![allow(unused)]
fn main() {
pub enum VfAction {
    // ... existing actions

    // Cross-network actions
    Bridge,          // Bridge resource to another network
    Federate,        // Federate governance across networks
    Synchronize,     // Synchronize state across federated networks
    Migrate,         // Migrate resource between networks
}
}

Integration Requirements for New Actions

When adding new VfAction variants:

  1. Update Helper Methods: Extend requires_existing_resource(), creates_resource(), etc.
  2. Define Role Requirements: Specify which agent roles can perform the action
  3. PPR Integration: Define what PPR types should be generated
  4. Validation Rules: Specify validation requirements and schemes
  5. Process Integration: Define how action fits into Economic Processes
  6. TypeScript Types: Update UI types for consistency

Example: Adding a Delegate Action

#![allow(unused)]
fn main() {
// 1. Add to enum
pub enum VfAction {
    // ... existing actions
    Delegate,  // Delegate responsibility to another agent
}

// 2. Update helper methods
impl VfAction {
    pub fn requires_delegation_capability(&self) -> bool {
        match self {
            VfAction::Delegate => true,
            _ => false,
        }
    }
}

// 3. Define role requirements
fn requires_specialized_role(action: &VfAction, process_type: &str) -> Option<String> {
    match (action, process_type) {
        // ... existing matches
        (VfAction::Delegate, _) => Some("Primary Accountable Agent".to_string()),
        _ => None,
    }
}

// 4. PPR integration
fn triggers_ppr_generation(action: &VfAction) -> bool {
    match action {
        // ... existing matches
        VfAction::Delegate => true, // DelegationAccepted + ResponsibilityTransferred
        _ => false,
    }
}

// 5. TypeScript update
export type VfAction =
  // ... existing actions
  | "Delegate"; // Delegate responsibility to another agent
}

Action Design Principles

New actions should follow these principles:

  • ValueFlows Alignment: Maintain compatibility with ValueFlows standard
  • Role-Based Access: Clear role requirements for governance
  • PPR Generation: Automatic reputation tracking integration
  • Process Awareness: Integration with Economic Process workflows
  • Validation Support: Built-in validation and compliance checking
  • Privacy Preservation: Respect private entry patterns for sensitive operations

Remember to update all three layers (Rust integrity, Rust coordinator, TypeScript UI) when adding new actions to maintain type consistency and governance integration across the entire stack.

Protocol Bridge Specifications for Nondominium

Executive Summary

This document outlines the technical requirements for integrating Nondominium's Holochain-based resource sharing protocol with external platforms using a Bun Bridge Service powered by the official @holochain/client library. This approach provides full-featured, real-time integration while allowing each platform (Tiki Wiki, Odoo/ERPLibre, Dolibarr, etc.) to maintain its familiar workflow.

The architecture separates concerns into two layers:

  1. Protocol Bridge (generic, reusable): Bun/TypeScript service translating REST/JSON to Holochain WebSocket
  2. Platform Integration Layer (per-platform): Business logic, data mapping, and UI specific to each platform

1. Architecture Overview

1.1 Two-Layer Architecture (Protocol Bridge + Platform Module)

graph TB
    subgraph "Platform Layer (per-platform)"
        PlatformUI[Platform Web Interface]
        PlatformBackend[Platform Backend]
        MobileApp[Mobile Application]
    end

    subgraph "Bun Bridge Service"
        BridgeAPI[REST API Layer]
        HoloClient[@holochain/client]
        Cache[Redis Cache]
        Queue[Job Queue]
        SignalHandler[Signal Handler]
    end

    subgraph "Holochain Infrastructure"
        Conductor[Holochain Conductor]
        DNA[Nondominium DNA]
        DHT[Distributed Hash Table]
    end

    PlatformUI --> PlatformBackend
    PlatformBackend --> BridgeAPI
    MobileApp --> BridgeAPI
    BridgeAPI --> HoloClient
    HoloClient <--> Conductor
    SignalHandler --> PlatformBackend
    BridgeAPI --> Cache
    BridgeAPI --> Queue
    Conductor <--> DNA
    DNA <--> DHT

1.2 Component Specifications

1. Bun Bridge Service

  • Purpose: Official WebSocket-based bridge between platform backends and Holochain
  • Technology: Bun with @holochain/client library and Hono framework
  • Key Features:
    • RESTful API for platform modules (PHP, Python, Java, etc.)
    • Full WebSocket connectivity to Holochain Conductor
    • Real-time signal subscription and forwarding
    • Request batching and caching (Redis)
    • Async job queue for long-running operations
    • Proper zome call signing and capability management
    • Health monitoring and logging

Why Bun + Hono?

  • Consistency: The main nondominium repo already uses Bun as its runtime
  • Official Support: @holochain/client is maintained by Holochain core team and works with Bun
  • Full Features: Real-time signals, proper signing, batch operations
  • Performance: Bun's fast startup, native WebSocket, and low memory footprint; Hono's lightweight routing
  • Built-in TypeScript: No transpilation step needed
  • RESTful Interface: Clean Hono API for any platform to consume
  • Caching & Queuing: Performance optimization built-in

2. Holochain Conductor

  • Purpose: Run Nondominium hApp and manage agent keys
  • Deployment: Docker containerized
  • Configuration:
    • Admin WebSocket on port 8000
    • App WebSocket on port 8888
    • Support for multiple concurrent agents (organizations)
    • Automatic conductor configuration via bridge service

3. Platform Integration Layer

  • Purpose: Connect platform user accounts to Holochain agents
  • Requirements (per-platform):
    • Platform session token validation
    • Holochain agent key generation and management
    • Role-based access control mapping
    • Secure credential storage
    • Single Sign-On (SSO) compatibility

1.3 Organization-as-Agent Model

Based on the ERP-Holochain bridge analysis, platforms operate in an Organizational Context with the following implications:

Identity Architecture

  • Platform Group/Organization -> Holochain Organization Agent
  • Platform User -> Delegate Key (with scoped permissions)
  • Delegation Pattern: Required for all zome calls signed by users on behalf of organizations

Reputation Aggregation

  • External PPRs accrue to the Organization
  • Internal attribution tracked via performed_by metadata
  • New users inherit the organization's reputation (trust by association)

Governance Model

  • Policy-Driven: Automated rules based on platform group permissions
  • Multi-Sig Support: High-value transactions require multiple delegate approvals
  • Automated Approval: ERP-style workflows (e.g., "Auto-approve Use requests < $500")

Custody vs. Ownership

  • Organization owns the resource
  • Individual users (employees) hold temporary custody
  • Internal transfers (between users in same org) may not trigger DHT events

Device Management

  • Shared Terminals: Warehouse tablets used by multiple staff members
  • Session Management: Rapid login/logout of different delegates
  • SSO Integration: Map platform session tokens to Holochain capability tokens

1.4 Why Bun Bridge (Not HTTP Gateway)?

The Bun Bridge Service using @holochain/client is the only recommended approach for production platform-Nondominium integration:

Key Advantages:

  • Official Library: @holochain/client is maintained by Holochain core team
  • Full Features: Real-time signals, proper zome call signing, batch operations
  • Production-Ready: Built-in connection management, retry logic, health checks
  • Performance: Persistent WebSocket connection, Redis caching, job queues
  • Clean API: RESTful interface familiar to developers of all platforms

HTTP Gateway Alternative (Not Recommended for Production):

  • GET-only requests with Base64-encoded payloads
  • No native signal support for real-time updates
  • Limited batch operations and session management
  • Performance constraints (connection overhead per request)

Note: The hc-http-gw HTTP Gateway is suitable for PoC/prototyping. See the nondominium-erp-bridge repository for a Python PoC reference implementation using hc-http-gw with 101 tests.


2. Integration API Specifications

2.1 Bridge Architecture

The Bun Bridge Service architecture provides a clean RESTful interface for any platform's backend code:

Architecture:

Platform Backend <--HTTP/JSON--> Bun Bridge (@holochain/client) <--WebSocket--> Holochain Conductor <--> Nondominium DHT

How It Works:

  1. Platform modules make standard HTTP requests to the Bun Bridge REST API
  2. Bun Bridge maintains persistent WebSocket connection to Holochain
  3. Bridge handles zome call signing, capability tokens, and signal subscriptions
  4. Real-time signals from Holochain pushed to platforms via webhooks
  5. Redis caching for frequently accessed data (resource lists, reputation scores)
  6. Job queue for async operations (batch syncs, long-running processes)

Benefits:

  • Clean Interface: Platform developers work with familiar REST/JSON
  • Full Features: Access to all Holochain capabilities (signals, signing, etc.)
  • Performance: Caching, batching, connection pooling
  • Reliability: Built-in retry logic, error handling, health checks
  • Real-time: WebSocket signals forwarded to platforms instantly

2.2 Core REST API Endpoints

Bun Bridge REST API

# Resource Discovery
POST /api/resources
GET  /api/resources/{resource_id}
GET  /api/resources/search?query=CNC

# Resource Operations
POST   /api/resources
PUT    /api/resources/{resource_id}
DELETE /api/resources/{resource_id}
PATCH  /api/resources/{resource_id}/state

# Transaction Management
POST /api/commitments
GET  /api/commitments/{commitment_id}
POST /api/events
GET  /api/events/by-resource/{resource_id}

# Reputation System
GET /api/reputation/{agent_id}/summary
GET /api/reputation/{agent_id}/receipts

# Batch Operations
POST /api/batch

2.3 Bun Bridge Service Implementation

// bridge-service.js
import { AppWebsocket, AdminWebsocket } from '@holochain/client';
import { Hono } from 'hono';
import { createClient } from 'redis';

class NondominiumBridgeService {
  constructor(config) {
    this.appWs = null;
    this.adminWs = null;
    this.redis = createClient({ url: config.redisUrl });
    this.config = config;
  }

  async connect() {
    // Connect to Holochain Admin API
    this.adminWs = await AdminWebsocket.connect({
      url: new URL(this.config.adminWsUrl),
      wsClientOptions: { origin: 'nondominium-bridge' }
    });

    // Connect to App WebSocket
    const token = await this.adminWs.issueAppAuthenticationToken({
      installed_app_id: this.config.appId
    });

    this.appWs = await AppWebsocket.connect({
      url: new URL(this.config.appWsUrl),
      token: token.token,
      wsClientOptions: { origin: 'nondominium-bridge' }
    });

    // Subscribe to signals
    this.appWs.on('signal', this.handleSignal.bind(this));

    await this.redis.connect();
    console.log('Bridge connected to Holochain and Redis');
  }

  async handleSignal(signal) {
    console.log('Received signal:', signal);
    // Push signal to registered webhook endpoints
    await this.notifyWebhooks(signal);
  }

  async notifyWebhooks(signal) {
    // POST to registered platform webhook endpoints
    for (const [url, config] of this.webhooks) {
      const response = await fetch(url, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-Nondominium-Signature': this.generateSignature(signal)
        },
        body: JSON.stringify({
          type: signal.data.type,
          payload: signal.data.payload
        })
      });
      console.log(`Notified ${url}:`, response.status);
    }
  }

  async callZome(cellId, zomeName, fnName, payload) {
    const cacheKey = `zome:${zomeName}:${fnName}:${JSON.stringify(payload)}`;

    // Check cache for read operations
    if (fnName.startsWith('get_')) {
      const cached = await this.redis.get(cacheKey);
      if (cached) return JSON.parse(cached);
    }

    try {
      const result = await this.appWs.callZome({
        cell_id: cellId,
        zome_name: zomeName,
        fn_name: fnName,
        payload: payload
      }, 30000);

      // Cache read operations
      if (fnName.startsWith('get_')) {
        await this.redis.setEx(cacheKey, 300, JSON.stringify(result));
      }

      return result;
    } catch (error) {
      console.error('Zome call failed:', error);
      throw error;
    }
  }

  generateSignature(data) {
    // HMAC signature for webhook authentication
    return crypto.createHmac('sha256', this.config.webhookSecret)
      .update(JSON.stringify(data))
      .digest('hex');
  }
}

// Initialize bridge
const bridge = new NondominiumBridgeService({
  adminWsUrl: process.env.HC_ADMIN_WS_URL || 'ws://localhost:8000',
  appWsUrl: process.env.HC_APP_WS_URL || 'ws://localhost:8888',
  appId: process.env.HC_APP_ID || 'nondominium',
  redisUrl: process.env.REDIS_URL || 'redis://localhost:6379',
  webhookSecret: process.env.WEBHOOK_SECRET
});

await bridge.connect();

// Hono API
const app = new Hono();

function getCellId(body: any, query: any) {
  return [body?.dna_hash || query?.dna_hash, body?.agent_key || query?.agent_key];
}

// Resource Management
app.post('/api/resources', async (c) => {
  try {
    const body = await c.req.json();
    const cellId = getCellId(body, null);
    const result = await bridge.callZome(cellId, 'zome_resource', 'create_economic_resource', {
      spec_hash: body.spec_hash,
      quantity: body.quantity,
      unit: body.unit,
      custodian: body.custodian
    });
    return c.json({ success: true, data: result });
  } catch (error) {
    return c.json({ success: false, error: error.message }, 500);
  }
});

app.get('/api/resources/search', async (c) => {
  try {
    const query = c.req.query();
    const cellId = getCellId(null, query);
    const resources = await bridge.callZome(cellId, 'zome_resource', 'get_all_economic_resources', {
      query: query.query
    });
    return c.json({ success: true, data: resources });
  } catch (error) {
    return c.json({ success: false, error: error.message }, 500);
  }
});

// Batch operations
app.post('/api/batch', async (c) => {
  try {
    const body = await c.req.json();
    const cellId = getCellId(body, null);
    const results = await Promise.all(
      body.operations.map((op: any) =>
        bridge.callZome(cellId, op.zome, op.function, op.payload)
      )
    );
    return c.json({ success: true, data: results });
  } catch (error) {
    return c.json({ success: false, error: error.message }, 500);
  }
});

app.get('/health', (c) => {
  return c.json({
    status: 'ok',
    holochain: bridge.appWs ? 'connected' : 'disconnected',
    redis: bridge.redis.isOpen ? 'connected' : 'disconnected'
  });
});

const PORT = process.env.PORT || 3000;
export default { port: PORT, fetch: app.fetch };

3. Data Model Reference

3.1 Nondominium Zome Functions

The Nondominium hApp exposes three zomes. For the complete function reference, see the ERP Bridge Technical Specifications (Sections 4.3-4.4), which documents all coordinator functions for zome_person, zome_resource, and zome_gouvernance.

Summary of available zomes:

ZomePurposeKey Functions
zome_personAgent identity, profiles, roles, capabilitiescreate_person, assign_person_role, store_private_person_data, grant_private_data_access
zome_resourceResource specs, economic resources, governance rulescreate_resource_specification, create_economic_resource, transfer_custody, create_governance_rule
zome_gouvernanceCommitments, events, validation, PPRpropose_commitment, log_economic_event, issue_participation_receipts, create_validation_receipt

3.2 Critical Naming Conventions

Pydantic/JSON field names must match Rust zome field names exactly (Holochain uses JSON transcoding):

Correct Field NameNOT the REA/ValueFlows NameContext
spec_hashconforms_toEconomicResourceInput — links resource to its specification
categorydefault_unitResourceSpecification — category string, not a unit

Enum Values (PascalCase strings):

  • ResourceState: "PendingValidation", "Active", "Maintenance", "Retired", "Reserved"
  • VfAction: 16 variants — "Transfer", "Use", "InitialTransfer", "TransferCustody", etc.
  • ParticipationClaimType: 16 variants — "ResourceProvider", "ResourceReceiver", "Custodian", etc.

Reference: The nondominium-erp-bridge Pydantic v2 models in bridge/models.py serve as the authoritative source for field names and types.


4. User Story Implementation Flow

4.1 Phase 1: Resource Discovery & Registration

sequenceDiagram
    participant UserA as User A (Org A)
    participant Platform as Platform UI
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    UserA->>Platform: Login to platform
    Platform->>Bridge: Validate session + get agent keys
    Bridge->>Conductor: authenticate_agent()
    Conductor->>DNA: Return agent_pub_key

    UserA->>Platform: Register resource (e.g., CNC machine)
    Platform->>Bridge: POST /api/resources
    Bridge->>Conductor: create_economic_resource()
    Conductor->>DNA: Resource entry created
    DNA-->>Conductor: resource_hash
    Conductor-->>Bridge: Resource created
    Bridge-->>Platform: Resource details + QR code
    Platform-->>UserA: Resource registered successfully

4.2 Phase 2: Multi-Party Transaction Process

sequenceDiagram
    participant UserB as User B (Org B)
    participant Platform as Platform UI
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    UserB->>Platform: Search for equipment
    Platform->>Bridge: GET /api/resources/search
    Bridge->>Conductor: get_all_economic_resources()
    Conductor->>DNA: Query resources
    DNA-->>Conductor: Available resources
    Conductor-->>Bridge: Resource list + governance rules
    Bridge-->>Platform: Formatted resource data
    Platform-->>UserB: Display available resources

    UserB->>Platform: Submit access request
    Platform->>Bridge: POST /api/commitments
    Bridge->>Conductor: propose_commitment()
    Conductor->>DNA: Create commitment
    DNA-->>Conductor: commitment_hash
    Conductor-->>Bridge: Commitment created
    Bridge-->>Platform: Request submitted for approval

4.3 Phase 3: Custody Transfer with QR Codes

sequenceDiagram
    participant UserA as User A (Org A)
    participant UserB as User B (Org B)
    participant Mobile as Mobile App
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    Note over UserA,UserB: Physical transfer at location
    UserA->>Mobile: Scan QR code on resource
    Mobile->>Bridge: POST /api/transport/qr-scan
    Bridge->>Conductor: initiate_transfer_custody()
    Conductor->>DNA: Create TransferCustody event

    UserB->>Mobile: Scan confirmation QR code
    Mobile->>Bridge: POST /api/transport/confirm
    Bridge->>Conductor: complete_transfer_custody()
    Conductor->>DNA: Update custodian field
    DNA->>Conductor: Generate PPR receipts
    Conductor->>Bridge: Transfer complete + PPRs
    Bridge-->>Mobile: Success confirmation

5. Mobile Application Requirements

QR Code Scanning Features

interface QRCodeData {
  resourceId: string;
  resourceHash: string;
  location: {
    latitude: number;
    longitude: number;
  };
  timestamp: string;
  custodianPubKey: string;
  sessionId: string;
}

// Scan result processing
function processQRScan(qrData: QRCodeData): Promise<TransferResult> {
  // Validate QR code authenticity
  // Initiate custody transfer
  // Generate cryptographic signatures
  // Update real-time status
}

Offline Capabilities

  • Cache critical resource data for offline access
  • Queue custody transfer operations when connectivity lost
  • Synchronize pending operations when connection restored
  • Local storage of QR code scan history

Push Notifications

// Real-time transaction updates
interface NotificationPayload {
  type: "transaction_update" | "resource_available" | "ppr_update";
  title: string;
  message: string;
  data: any;
  priority: "high" | "normal" | "low";
}

6. Security & Authentication

Identity Bridge Architecture

Based on the Organizational Context from the ERP bridge analysis, platforms operate in a delegated agency model where:

  • Platform organizations are represented as Holochain agents
  • Individual platform users act as delegates/representatives of the organization
  • Delegation requires scope, expiry, and revocation mechanisms

Key Security Concepts

  1. Organization Agent Key: Generated via Holochain Admin API, stored securely server-side
  2. Delegate Key: Per-user signing key for acting on behalf of the organization
  3. Capability Grants: Scoped, time-limited permissions granted to delegate keys
  4. Webhook Signatures: HMAC-SHA256 signatures for verifying signal authenticity

Data Privacy Controls

// Privacy settings per resource
interface ResourcePrivacy {
  resourceId: string;
  publicFields: ("name" | "location" | "specifications")[];
  privateFields: ("owner_details" | "usage_history" | "maintenance_records")[];
  accessControl: "public" | "organization_only" | "approved_agents_only";
}

Organizational vs. P2P Context

AspectOrganizational (ERP/Platform)Pure P2P
Identity ModelPlatform Group = Org Agent, Users = Delegates1 Human = 1 Agent Key
Signing AuthorityDelegated (users sign on behalf of org)Direct (individual signs)
ReputationAccrues to organization, internal attributionAccrues to individual
GovernancePolicy-driven, automated rulesAd-hoc, social negotiation
Device UsageShared terminals, SSO integrationPersonal devices

7. Performance Requirements

Response Time Targets

  • Resource Search: < 2 seconds for basic queries
  • Transaction Updates: < 500ms for status changes
  • QR Code Processing: < 3 seconds end-to-end
  • Real-time Synchronization: < 1 second for webhook delivery
  • Authentication: < 1 second for user validation

Scalability Requirements

concurrent_users:
  target: 1000
  peak: 5000

resource_transactions:
  daily_volume: 10000
  peak_concurrent: 500

api_throughput:
  requests_per_second: 1000
  burst_capacity: 5000

data_storage:
  resources_per_organization: 10000
  transaction_history: 7_years

Caching Strategy

// Multi-level caching
interface CacheConfiguration {
  level1_memory: {
    user_sessions: "15 minutes";
    resource_metadata: "1 hour";
    reputation_scores: "30 minutes";
  };

  level2_redis: {
    search_results: "5 minutes";
    transaction_status: "real-time";
    availability_data: "2 minutes";
  };

  level3_cdn: {
    static_assets: "24 hours";
    api_responses: "5 minutes";
    qr_codes: "1 hour";
  };
}

8. Integration Workflow Requirements

Data Synchronization

Master Data Management

// Platform <-> Holochain sync mapping
interface SyncMapping {
  platformUser: HolochainAgent;
  platformResource: EconomicResource;
  platformTransaction: Commitment + EconomicEvent[];
  platformProfile: Person + EncryptedProfile;
}

// Bidirectional sync rules
const SYNC_RULES = {
  // Platform -> Holochain
  userRegistration: "create_holochain_agent",
  resourceCreation: "create_economic_resource",
  transactionInitiation: "create_commitment",

  // Holochain -> Platform
  reputationUpdates: "update_user_profile",
  transactionCompletion: "update_transaction_status",
  custodyTransfers: "update_resource_custodian"
};

Conflict Resolution

interface ConflictResolution {
  strategy:
    | "holochain_master"
    | "platform_master"
    | "timestamp_win"
    | "manual_review";
  rules: {
    resource_metadata: "holochain_master";
    user_preferences: "platform_master";
    transaction_status: "timestamp_win";
    reputation_data: "holochain_master";
  };
}

Error Handling & Recovery

Transaction Rollback

interface RollbackStrategy {
  commitment_creation: [
    "delete_commitment_entry",
    "release_resource_reservation",
    "notify_stakeholders",
  ];

  custody_transfer: [
    "reverse_custody_update",
    "invalidate_ppr_receipts",
    "notify_transport_parties",
  ];
}

Fallback Procedures

// Service degradation handling
const FALLBACK_PROCEDURES = {
  bridge_service_down: "cache_operations + retry_exponential_backoff",
  conductor_unavailable: "read_only_mode + queue_operations",
  network_partition: "local_validation + sync_when_available",
  high_load: "request_throttling + background_processing",
};

9. Testing Requirements

Integration Test Scenarios

End-to-End User Journey Tests

describe("Platform-Nondominium Integration", () => {
  test("Complete resource sharing workflow", async () => {
    // 1. User A registers resource through platform
    // 2. User B discovers resource via platform search
    // 3. Transaction negotiation through platform UI
    // 4. QR code-based custody transfer
    // 5. Usage tracking and PPR generation
    // 6. Return process and reputation updates
  });

  test("Multi-organization resource discovery", async () => {
    // 1. Multiple organizations register resources
    // 2. Cross-organization search functionality
    // 3. Trust validation between organizations
    // 4. Compliance with governance rules
  });
});

Performance & Load Testing

interface LoadTestConfiguration {
  concurrent_users: [100, 500, 1000, 5000];
  scenarios: [
    "resource_search",
    "transaction_creation",
    "qr_scan",
    "real_time_sync",
  ];
  duration: "10 minutes per scenario";
  success_criteria: {
    response_time_p95: "< 2 seconds";
    error_rate: "< 0.1%";
    throughput: "> 500 requests/second";
  };
}

Security Testing

interface SecurityTests {
  authentication_tests: [
    "invalid_session_token",
    "cross_organization_access",
    "privilege_escalation_attempts",
  ];

  data_privacy: [
    "sensitive_data_encryption",
    "access_control_enforcement",
    "audit_trail_completeness",
  ];

  api_security: [
    "rate_limiting_effectiveness",
    "input_validation",
    "sql_injection_prevention",
    "xss_protection",
  ];
}

10. Deployment Architecture

Each organization runs its own full stack:

┌─────────────────────────┐     ┌─────────────────────────┐
│ Org A Server            │     │ Org B Server            │
│ ┌─────────────────────┐ │     │ ┌─────────────────────┐ │
│ │ Platform + Module   │ │     │ │ Platform + Module   │ │
│ ├─────────────────────┤ │     │ ├─────────────────────┤ │
│ │ Bun Bridge      │ │     │ │ Bun Bridge      │ │
│ ├─────────────────────┤ │     │ ├─────────────────────┤ │
│ │ Holochain Node      │ │     │ │ Holochain Node      │ │
│ │ (Org A Agent)       │ │     │ │ (Org B Agent)       │ │
│ └─────────────────────┘ │     │ └─────────────────────┘ │
└───────────┬─────────────┘     └───────────┬─────────────┘
            │                               │
            └───────────────────────────────┘
                        DHT Network

Generic Docker Compose Template

# docker-compose.yml (template - adapt for your platform)
services:
  platform:
    # Your platform (Tiki, Odoo, Dolibarr, etc.)
    depends_on:
      - bridge

  holochain:
    image: holochain/holochain:latest
    # NO public ports - internal only
    volumes:
      - ./nondominium.happ:/happ/nondominium.happ
      - holochain_data:/data
    command: holochain -c /data/conductor-config.yml

  bridge:
    build: ./bridge-service
    # NO public ports - internal only
    environment:
      - HC_ADMIN_WS_URL=ws://holochain:8000
      - HC_APP_WS_URL=ws://holochain:8888
      - HC_APP_ID=nondominium
      - REDIS_URL=redis://redis:6379
      - WEBHOOK_SECRET=${WEBHOOK_SECRET}
    depends_on:
      - holochain
      - redis

  redis:
    image: redis:7-alpine

volumes:
  holochain_data:

Bridge Service Dockerfile

# bridge-service/Dockerfile
FROM oven/bun:latest

WORKDIR /app

COPY package.json bun.lockb ./
RUN bun install --production

COPY . .

EXPOSE 3000

CMD ["bun", "run", "index.ts"]

Shared Bridge Service (Managed) — Alternative

For organizations preferring managed infrastructure:

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Platform A  │     │ Platform B  │     │ Platform C  │
│ Org A       │     │ Org B       │     │ Org C       │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │                   │                   │
       └───────────────────┼───────────────────┘
                           │
                  ┌────────▼────────┐
                  │ Managed Bridge  │  ← Multi-tenant
                  │ Service         │     API key per org
                  └────────┬────────┘
                           │
             ┌─────────────┼─────────────┐
             │             │             │
      ┌──────▼──────┐ ┌────▼─────┐ ┌──────▼──────┐
      │ Org A Node  │ │Org B Node│ │ Org C Node  │
      └─────────────┘ └──────────┘ └─────────────┘

11. Compliance & Governance

Data Protection

  • GDPR compliance for European users
  • PII encryption at rest and in transit
  • Right to be forgotten implementation
  • Audit trail for all resource transactions

Regulatory Compliance

  • Equipment insurance validation integration
  • Transport certification verification
  • Safety protocol compliance tracking
  • Tax reporting for resource usage fees

Governance Framework

  • Multi-stakeholder governance council
  • Dispute resolution mechanism
  • Protocol amendment process
  • Emergency response procedures

Appendix A: Tiki Wiki Platform Example

This appendix contains Tiki Wiki/PHP-specific implementation examples demonstrating how a PHP-based platform integrates with the Bun Bridge Service.

A.1 PHP Client

<?php
// Tiki module calling Bun Bridge Service

class NondominiumClient {
    private $bridge_url;
    private $dna_hash;
    private $agent_key;

    public function __construct($bridge_url, $dna_hash, $agent_key) {
        $this->bridge_url = $bridge_url;
        $this->dna_hash = $dna_hash;
        $this->agent_key = $agent_key;
    }

    /**
     * Search for resources
     */
    public function searchResources($query = null, $category = null) {
        $response = $this->makeRequest('GET', '/api/resources/search', [
            'query' => ['query' => $query, 'category' => $category, 'dna_hash' => $this->dna_hash, 'agent_key' => $this->agent_key]
        ]);
        return $response['data'];
    }

    /**
     * Create a new resource
     */
    public function createResource($spec_hash, $quantity, $unit) {
        $response = $this->makeRequest('POST', '/api/resources', [
            'json' => [
                'dna_hash' => $this->dna_hash,
                'agent_key' => $this->agent_key,
                'spec_hash' => $spec_hash,
                'quantity' => $quantity,
                'unit' => $unit,
                'custodian' => $this->agent_key
            ]
        ]);
        return $response['data'];
    }

    /**
     * Initiate use process
     */
    public function initiateUse($resource_hash, $receiver, $start_time, $end_time) {
        $response = $this->makeRequest('POST', "/api/resources/{$resource_hash}/use", [
            'json' => [
                'dna_hash' => $this->dna_hash,
                'agent_key' => $this->agent_key,
                'receiver' => $receiver,
                'start_time' => $start_time,
                'end_time' => $end_time
            ]
        ]);
        return $response['data'];
    }

    private function makeRequest($method, $path, $options = []) {
        $url = $this->bridge_url . $path;

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

        if (isset($options['query'])) {
            $url .= '?' . http_build_query($options['query']);
            curl_setopt($ch, CURLOPT_URL, $url);
        }

        if (isset($options['json'])) {
            $json = json_encode($options['json']);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
            curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
        }

        $response = curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        if ($http_code !== 200) {
            throw new Exception("Bridge request failed: HTTP {$http_code}");
        }

        return json_decode($response, true);
    }
}

A.2 Tiki Module Integration

<?php
/**
 * Tiki Module: mod-nondominium_resources.php
 * Display available resources from Nondominium
 */

require_once('lib/nondominium/NondominiumBridge.php');

function module_nondominium_resources_info() {
    return [
        'name' => tr('Nondominium Resources'),
        'description' => tr('Display available shared resources from Nondominium network'),
        'prefs' => ['feature_nondominium'],
        'params' => [
            'max' => [
                'required' => false,
                'name' => tr('Maximum number of resources'),
                'description' => tr('Maximum number of resources to display'),
                'default' => 10,
            ],
        ],
    ];
}

function module_nondominium_resources($mod_reference_values) {
    global $prefs;

    $bridge = new NondominiumBridge(
        $prefs['nondominium_gateway_url'],
        $prefs['nondominium_dna_hash']
    );

    try {
        $resources = $bridge->searchResources();

        // Filter and format for Tiki display
        $smarty = TikiLib::lib('smarty');
        $smarty->assign('resources', array_slice($resources, 0, $mod_reference_values['max']));

        return $smarty->fetch('modules/mod-nondominium_resources.tpl');
    } catch (Exception $e) {
        return '<div class="alert alert-danger">' . tr('Error loading resources: ') . $e->getMessage() . '</div>';
    }
}

A.3 Tiki Tracker Integration

<?php
/**
 * Sync Tiki Tracker items with Nondominium resources
 */

class TikiNondominiumSync {
    private $bridge;
    private $tracker_id;

    public function __construct($bridge, $tracker_id) {
        $this->bridge = $bridge;
        $this->tracker_id = $tracker_id;
    }

    /**
     * Publish a Tiki Tracker item as a Nondominium resource
     */
    public function publishTrackerItem($item_id) {
        $trklib = TikiLib::lib('trk');
        $item = $trklib->get_tracker_item($item_id);

        // Map Tiki fields to Nondominium structure
        $resource_data = [
            'name' => $item['fields']['name'],
            'description' => $item['fields']['description'],
            'quantity' => $item['fields']['quantity'],
            'unit' => $item['fields']['unit'],
            'location' => $item['fields']['location']
        ];

        // Create ResourceSpecification in Nondominium
        $spec = $this->bridge->callZome('resource', 'create_resource_specification', [
            'name' => $resource_data['name'],
            'description' => $resource_data['description']
        ]);

        // Create EconomicResource
        $resource = $this->bridge->createResource(
            $spec['hash'],
            $resource_data['quantity'],
            $resource_data['unit'],
            $this->getCurrentUserAgentKey()
        );

        // Store Nondominium hash in Tiki tracker field
        $trklib->modify_field($item_id, 'nondominium_hash', $resource['hash']);

        return $resource;
    }

    /**
     * Sync Nondominium events back to Tiki
     */
    public function syncEventsToTiki($resource_hash) {
        $events = $this->bridge->callZome('gouvernance', 'get_events_by_resource', [
            'resource_hash' => $resource_hash
        ]);

        foreach ($events as $event) {
            // Log event in Tiki activity stream
            TikiLib::lib('logs')->add_log('nondominium_event', sprintf(
                'Resource %s: %s by %s',
                $resource_hash,
                $event['action'],
                $event['provider']
            ));
        }
    }

    private function getCurrentUserAgentKey() {
        global $user;
        $userlib = TikiLib::lib('user');
        return $userlib->get_user_preference($user, 'nondominium_agent_key');
    }
}

A.4 Webhooks (PHP Handler)

<?php
/**
 * webhook_nondominium.php
 * Handle real-time updates from Nondominium via webhooks
 */

// Authenticate webhook (verify signature)
function validate_webhook_signature($payload, $signature) {
    global $prefs;
    $expected = hash_hmac('sha256', $payload, $prefs['nondominium_webhook_secret']);
    return hash_equals($expected, $signature);
}

// Main webhook handler
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_NONDOMINIUM_SIGNATURE'] ?? '';

if (!validate_webhook_signature($payload, $signature)) {
    http_response_code(401);
    exit('Invalid signature');
}

$data = json_decode($payload, true);

switch ($data['type']) {
    case 'commitment.updated':
        handle_commitment_update($data);
        break;

    case 'resource.availability':
        handle_resource_availability($data);
        break;

    case 'reputation.updated':
        handle_reputation_update($data);
        break;

    default:
        http_response_code(400);
        exit('Unknown event type');
}

function handle_commitment_update($data) {
    $trklib = TikiLib::lib('trk');

    // Find Tiki tracker item by commitment hash
    $items = $trklib->list_items($tracker_id = get_commitment_tracker_id(), 0, -1, '', [
        'nondominium_hash' => $data['commitmentId']
    ]);

    if (!empty($items['data'])) {
        $item_id = $items['data'][0]['itemId'];

        // Update status field
        $trklib->modify_field($item_id, 'status', $data['status']);

        // Send notification to user
        send_tiki_notification(
            $item_id,
            'Commitment Status Updated',
            sprintf('Your resource request is now: %s', $data['status'])
        );
    }
}

function handle_resource_availability($data) {
    // Update Tiki tracker item availability status
    // Trigger intertracker reference updates if needed
}

function handle_reputation_update($data) {
    global $user;
    $userlib = TikiLib::lib('user');

    // Update user's reputation score in Tiki profile
    $userlib->set_user_preference(
        $user,
        'nondominium_reputation_score',
        $data['newScore']
    );

    // Display notification
    TikiLib::lib('smarty')->display_notification([
        'title' => 'Reputation Updated',
        'message' => sprintf('Your reputation score is now: %.2f', $data['newScore'])
    ]);
}

http_response_code(200);
echo json_encode(['status' => 'ok']);

A.5 Identity Bridge (PHP)

<?php
/**
 * TikiHolochainAuth.php
 * Manage identity mapping between Tiki users and Holochain agents
 */

class TikiHolochainAuth {
    /**
     * Generate or retrieve Holochain agent key for organization
     */
    public function getOrganizationAgentKey($org_id) {
        global $prefs;

        // Check if organization already has agent key
        $existing_key = $this->getOrgPreference($org_id, 'holochain_agent_key');

        if ($existing_key) {
            return $existing_key;
        }

        // Generate new agent key via Holochain admin API
        $admin_client = new HolochainAdminClient($prefs['holochain_admin_url']);
        $agent_key = $admin_client->generateAgentPubKey();

        // Store in Tiki
        $this->setOrgPreference($org_id, 'holochain_agent_key', $agent_key);

        return $agent_key;
    }

    /**
     * Create delegation for a Tiki user to act on behalf of organization
     */
    public function createDelegation($user, $org_id, $permissions, $expiry_days = 90) {
        $bridge = new NondominiumBridge(
            $GLOBALS['prefs']['nondominium_gateway_url'],
            $GLOBALS['prefs']['nondominium_dna_hash']
        );

        // Get organization's agent key
        $org_agent_key = $this->getOrganizationAgentKey($org_id);

        // Generate delegate key for this user
        $delegate_key = $this->getUserDelegateKey($user);

        // Create capability grant in Holochain
        $cap_grant = $bridge->callZome('person', 'grant_signing_key', [
            'cell_id' => [$GLOBALS['prefs']['nondominium_dna_hash'], $org_agent_key],
            'functions' => $permissions, // e.g., ['Transport', 'Use']
            'signing_key' => $delegate_key,
            'expiry' => time() + ($expiry_days * 86400)
        ]);

        // Store delegation in Tiki
        $this->storeDelegation([
            'user' => $user,
            'org_id' => $org_id,
            'delegate_key' => $delegate_key,
            'cap_secret' => $cap_grant['cap_secret'],
            'permissions' => json_encode($permissions),
            'expires_at' => time() + ($expiry_days * 86400)
        ]);

        return $cap_grant;
    }

    /**
     * Validate user's delegation and return signing credentials
     */
    public function validateDelegation($user, $org_id) {
        $delegation = $this->getDelegation($user, $org_id);

        if (!$delegation) {
            throw new Exception('No delegation found for user');
        }

        if ($delegation['expires_at'] < time()) {
            throw new Exception('Delegation has expired');
        }

        return [
            'org_agent_key' => $this->getOrganizationAgentKey($org_id),
            'delegate_key' => $delegation['delegate_key'],
            'cap_secret' => $delegation['cap_secret'],
            'permissions' => json_decode($delegation['permissions'], true)
        ];
    }

    /**
     * Revoke delegation (e.g., when user leaves organization)
     */
    public function revokeDelegation($user, $org_id) {
        $delegation = $this->getDelegation($user, $org_id);

        if ($delegation) {
            $bridge = new NondominiumBridge(
                $GLOBALS['prefs']['nondominium_gateway_url'],
                $GLOBALS['prefs']['nondominium_dna_hash']
            );

            // Revoke capability in Holochain
            $bridge->callZome('person', 'revoke_signing_key', [
                'cap_secret' => $delegation['cap_secret']
            ]);

            // Remove from Tiki database
            $this->deleteDelegation($user, $org_id);
        }
    }

    private function getUserDelegateKey($user) {
        $userlib = TikiLib::lib('user');
        $existing = $userlib->get_user_preference($user, 'holochain_delegate_key');

        if ($existing) {
            return $existing;
        }

        // Generate new delegate keypair
        $keypair = sodium_crypto_sign_keypair();
        $public_key = sodium_crypto_sign_publickey($keypair);

        // Store in user preferences (encrypted)
        $userlib->set_user_preference($user, 'holochain_delegate_key', base64_encode($public_key));
        $userlib->set_user_preference($user, 'holochain_delegate_keypair', base64_encode($keypair));

        return base64_encode($public_key);
    }

    private function storeDelegation($data) {
        global $tiki_p_nondominium_delegations;
        TikiDb::get()->query(
            "INSERT INTO `$tiki_p_nondominium_delegations`
            (`user`, `org_id`, `delegate_key`, `cap_secret`, `permissions`, `expires_at`)
            VALUES (?, ?, ?, ?, ?, ?)",
            [
                $data['user'],
                $data['org_id'],
                $data['delegate_key'],
                $data['cap_secret'],
                $data['permissions'],
                $data['expires_at']
            ]
        );
    }

    private function getDelegation($user, $org_id) {
        global $tiki_p_nondominium_delegations;
        return TikiDb::get()->getOne(
            "SELECT * FROM `$tiki_p_nondominium_delegations` WHERE `user` = ? AND `org_id` = ?",
            [$user, $org_id]
        );
    }

    private function deleteDelegation($user, $org_id) {
        global $tiki_p_nondominium_delegations;
        TikiDb::get()->query(
            "DELETE FROM `$tiki_p_nondominium_delegations` WHERE `user` = ? AND `org_id` = ?",
            [$user, $org_id]
        );
    }
}

A.6 Organizational Delegation Workflow

<?php
/**
 * Example: Tiki user Alice requests to transport a resource on behalf of Acme Corp
 */

$auth = new TikiHolochainAuth();
$bridge = new NondominiumBridge($gateway_url, $dna_hash);

// Step 1: Validate Alice's delegation
try {
    $credentials = $auth->validateDelegation('alice', $org_id = 123); // Acme Corp

    // Alice has permissions: ['Transport', 'Use']
    if (!in_array('Transport', $credentials['permissions'])) {
        throw new Exception('User not authorized for Transport');
    }

} catch (Exception $e) {
    die('Authorization failed: ' . $e->getMessage());
}

// Step 2: Sign the transport request with delegate key
$transport_payload = [
    'resource_hash' => $resource_hash,
    'from_location' => 'Warehouse A',
    'to_location' => 'Client Site B',
    'scheduled_date' => '2025-12-20'
];

// The zome call is signed by Alice's delegate key on behalf of Acme Corp
$result = $bridge->callZome('resource', 'initiate_transport_process', array_merge(
    $transport_payload,
    [
        'provenance' => $credentials['org_agent_key'], // Acme Corp's identity
        'performed_by' => $credentials['delegate_key']  // Alice's delegate key
    ]
));

// Step 3: Track internal attribution
// The organization (Acme Corp) gets the external PPR, but Tiki tracks that Alice performed it
TikiLib::lib('logs')->add_log('nondominium_transport', sprintf(
    'Transport initiated by %s on behalf of organization %d',
    'alice',
    $org_id
));

A.7 Capability-Based Access Control (PHP)

<?php
/**
 * Role-based permissions mapping for Tiki-Nondominium integration
 */

class NondominiumRoleManager {
    const ROLE_PERMISSIONS = [
        'Resource Coordinator' => ['view', 'request_access', 'transfer_custody'],
        'Technical Manager' => ['view', 'request_access', 'use_resource'],
        'Transport Specialist' => ['transfer_custody', 'view_transport_logs'],
        'Warehouse Manager' => ['view', 'create_resource', 'update_inventory'],
    ];

    /**
     * Get Holochain permissions for a Tiki group/role
     */
    public function getHolochainPermissions($tiki_role) {
        return self::ROLE_PERMISSIONS[$tiki_role] ?? [];
    }

    /**
     * Automatically delegate permissions when user joins a Tiki group
     */
    public function onUserAddedToGroup($user, $group, $org_id) {
        $auth = new TikiHolochainAuth();

        $permissions = $this->getHolochainPermissions($group);

        if (!empty($permissions)) {
            try {
                $auth->createDelegation($user, $org_id, $permissions);

                TikiLib::lib('logs')->add_log('nondominium_delegation', sprintf(
                    'Delegation created for user %s in group %s',
                    $user,
                    $group
                ));
            } catch (Exception $e) {
                TikiLib::lib('logs')->add_log('nondominium_error', $e->getMessage());
            }
        }
    }

    /**
     * Revoke delegation when user leaves group
     */
    public function onUserRemovedFromGroup($user, $group, $org_id) {
        $auth = new TikiHolochainAuth();
        $auth->revokeDelegation($user, $org_id);
    }
}

A.8 Docker Compose (Tiki-Specific)

# docker-compose.yml (Tiki Wiki deployment)
version: '3.8'

services:
  tiki:
    image: tiki/tiki:latest
    ports:
      - "80:80"
    environment:
      - DB_HOST=mysql
      - DB_NAME=tiki
      - DB_USER=tiki
      - DB_PASS=tiki
    volumes:
      - ./tiki_nondominium_plugin:/var/www/html/lib/nondominium
    depends_on:
      - mysql
      - bridge

  holochain:
    image: holochain/holochain:latest
    ports:
      - "8000:8000"  # Admin WebSocket
      - "8888:8888"  # App WebSocket
    volumes:
      - ./nondominium.happ:/happ/nondominium.happ
      - holochain_data:/data
    command: holochain -c /data/conductor-config.yml

  bridge:
    build: ./bridge-service
    ports:
      - "3000:3000"
    environment:
      - HC_ADMIN_WS_URL=ws://holochain:8000
      - HC_APP_WS_URL=ws://holochain:8888
      - HC_APP_ID=nondominium
      - REDIS_URL=redis://redis:6379
      - TIKI_WEBHOOK_URL=http://tiki/tiki/nondominium/webhook
      - WEBHOOK_SECRET=${WEBHOOK_SECRET}
    depends_on:
      - holochain
      - redis

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"

  mysql:
    image: mysql:8
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=tiki
      - MYSQL_USER=tiki
      - MYSQL_PASSWORD=tiki
    volumes:
      - mysql_data:/var/lib/mysql

volumes:
  holochain_data:
  mysql_data:

A.9 Implementation Roadmap (Tiki-Specific)

Phase 1: Foundation (4 weeks)

  • Set up development environment (Docker Compose)
  • Deploy Holochain Conductor and Nondominium hApp
  • Implement Bun Bridge Service with @holochain/client
  • Create REST API endpoints for Tiki integration
  • Create organizational delegation system (TikiHolochainAuth.php)
  • Develop Tiki plugin skeleton with NondominiumClient.php

Phase 2: Core Features (6 weeks)

  • Implement resource discovery and search (via PHP Bridge)
  • Build transaction workflow with delegation signing
  • Develop QR code scanning with performed_by attribution
  • Create webhook handlers for real-time updates (webhook_nondominium.php)
  • Implement organizational PPR aggregation and display
  • Integrate Tiki Tracker items with Nondominium resources (TikiNondominiumSync.php)

Phase 3: Mobile & Advanced Features (4 weeks)

  • Develop mobile application with QR scanning
  • Implement push notifications
  • Add offline capability support
  • Create advanced analytics dashboard
  • Implement multi-language support

Phase 4: Testing & Optimization (3 weeks)

  • Comprehensive integration testing
  • Performance optimization
  • Security audit and penetration testing
  • User acceptance testing with pilot organizations
  • Documentation and training materials

Phase 5: Production Deployment (2 weeks)

  • Production environment setup
  • Data migration from pilot systems
  • Go-live with monitoring and support
  • Post-launch optimization and bug fixes

A.10 Tiki-Specific Sequence Diagrams (Original User Story Versions)

These are the original sequence diagrams using the Tiki-specific participants (Sarah/Sensorica, Marco/FabLab) from the user story.

Resource Registration (Sarah/Sensorica)

sequenceDiagram
    participant Sarah as Sarah (Sensorica)
    participant Tiki as Tiki Wiki
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    Sarah->>Tiki: Login to Tiki Wiki
    Tiki->>Bridge: Validate session + get agent keys
    Bridge->>Conductor: authenticate_agent()
    Conductor->>DNA: Return agent_pub_key

    Sarah->>Tiki: Register CNC machine
    Tiki->>Bridge: POST /api/resources
    Bridge->>Conductor: create_economic_resource()
    Conductor->>DNA: Resource entry created
    DNA-->>Conductor: resource_hash
    Conductor-->>Bridge: Resource created
    Bridge-->>Tiki: Resource details + QR code
    Tiki-->>Sarah: Resource registered successfully

Resource Discovery (Marco/FabLab)

sequenceDiagram
    participant Marco as Marco (FabLab)
    participant Tiki as Tiki Wiki
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    Marco->>Tiki: Search CNC equipment
    Tiki->>Bridge: GET /api/resources/search
    Bridge->>Conductor: get_all_economic_resources()
    Conductor->>DNA: Query resources
    DNA-->>Conductor: Available resources
    Conductor-->>Bridge: Resource list + governance rules
    Bridge-->>Tiki: Formatted resource data
    Tiki-->>Marco: Display available CNC machines

    Marco->>Tiki: Submit access request
    Tiki->>Bridge: POST /api/commitments
    Bridge->>Conductor: propose_commitment()
    Conductor->>DNA: Create commitment
    DNA-->>Conductor: commitment_hash
    Conductor-->>Bridge: Commitment created
    Bridge-->>Tiki: Request submitted for approval

Custody Transfer (Sarah & Marco)

sequenceDiagram
    participant Sarah as Sarah (Sensorica)
    participant Marco as Marco (FabLab)
    participant Mobile as Mobile App
    participant Bridge as Bun Bridge Service
    participant Conductor as Holochain Conductor
    participant DNA as Nondominium DNA

    Note over Sarah,Marco: Physical transfer at location
    Sarah->>Mobile: Scan QR code on CNC machine
    Mobile->>Bridge: POST /api/transport/qr-scan
    Bridge->>Conductor: initiate_transfer_custody()
    Conductor->>DNA: Create TransferCustody event

    Marco->>Mobile: Scan confirmation QR code
    Mobile->>Bridge: POST /api/transport/confirm
    Bridge->>Conductor: complete_transfer_custody()
    Conductor->>DNA: Update custodian field
    DNA->>Conductor: Generate PPR receipts
    Conductor->>Bridge: Transfer complete + PPRs
    Bridge-->>Mobile: Success confirmation

Appendix B: Odoo/ERPLibre Platform Example

B.1 PoC Reference Implementation

The Python PoC reference implementation is maintained in the nondominium-erp-bridge repository. It provides:

  • Pydantic v2 models (bridge/models.py): Authoritative source for field names and types mapping 1:1 to Rust zome types. Covers zome_resource and zome_gouvernance (25+ governance types).
  • Typed gateway client (bridge/gateway_client.py): HTTP client wrapping zome functions as typed Python methods (32+ methods across 2 zomes).
  • 101 tests: Comprehensive test suite covering model serialization, gateway client URL construction, ERP-to-Nondominium mapping, cross-org discovery, sync pipeline idempotency, governance models, and use process orchestration.
  • Development scripts: setup_conductor.sh, smoke_test.py, sync_inventory.py, demo_full_flow.py.

The PoC uses hc-http-gw (HTTP GET with base64url-encoded payloads). In production (Phase 2), this repo evolves into or is replaced by the Bun Protocol Bridge described in this specification.

B.2 Odoo Addon

The Odoo nondominium_connector addon is maintained in a separate repository: odoo-addons-nondominium. It provides:

  • Docker Compose setup (Odoo 17 + PostgreSQL)
  • Product sync from Odoo UI to Nondominium
  • Configuration views for hc-http-gw connection settings

For the PoC, the addon calls hc-http-gw directly — this is acceptable given the PoC scope (each repo is self-contained). In production (Phase 2), the addon will be refactored to call the Bun Protocol Bridge REST API instead.

B.3 PoC vs Production Approach

AspectPoC (current)Production (Phase 2)
Protocol Bridgehc-http-gw (HTTP GET)Bun with @holochain/client (WebSocket)
Python repo roleReference impl, Pydantic models, test suiteEvolves into or replaced by Bun bridge
Odoo addonCalls hc-http-gw directlyCalls Bun bridge REST API
Sync directionERP -> NondominiumBidirectional
Real-timePollingSignals + Webhooks

References

Holochain Integration

Nondominium & ValueFlows

ERP Bridge Reference Implementation

Platform-Specific Resources


This protocol bridge specification enables any Web2 platform to become a gateway for Holochain-based resource sharing, maintaining platform familiarity while introducing trust and transparency capabilities through the Nondominium protocol. The Bun Bridge Service (using Hono for routing and @holochain/client for Holochain connectivity) provides full-featured, production-ready integration with real-time signals, proper zome call signing, and organizational delegation patterns.

Nondominium API Reference

Generated: 2025-12-17 Version: 3.0 (Updated with Current Implementation) Scope: Complete function documentation for all zomes based on actual codebase


🎯 API Overview

Nondominium implements a comprehensive REST-like API through Holochain zome functions, organized into three main zomes with distinct responsibilities. All functions follow consistent patterns for input validation, error handling, and DHT integration.

API Conventions

  • Input Types: Structured input parameters with validation
  • Return Types: ExternResult<T> with comprehensive error handling
  • Authentication: Agent identity automatically verified via agent_info()
  • Authorization: Role-based access control enforced at function level
  • Auditing: All operations create immutable audit trails

🔐 zome_person - Identity & Access Management

Person Profile Management

create_person(input: PersonInput) -> ExternResult<Record>

Purpose: Create a new agent profile with discovery anchors Authorization: Any agent can create their own profile Input:

#![allow(unused)]
fn main() {
pub struct PersonInput {
    pub name: String,
    pub avatar_url: Option<String>,
    pub bio: Option<String>,
}
}

Returns: Record containing the created Person entry Side Effects:

  • Creates Person entry with agent public key
  • Creates discovery anchor links for agent findability
  • Links agent pubkey to person entry Error Cases:
  • PersonError::PersonExists - Agent already has a profile
  • Network/DHT errors during entry creation

get_latest_person_record(original_action_hash: ActionHash) -> ExternResult<Option<Record>>

Purpose: Retrieve the most recent version of a person record Authorization: Public access (person data is public) Input: ActionHash of the original person entry Returns: Latest Record entry or None if not found Error Cases:

  • PersonError::PersonNotFound - No person entry found
  • Network/DHT errors during retrieval

get_latest_person(original_action_hash: ActionHash) -> ExternResult<Person>

Purpose: Retrieve the most recent version of a person entry Authorization: Public access (person data is public) Input: ActionHash of the original person entry Returns: Latest Person entry with all current fields Error Cases:

  • PersonError::PersonNotFound - No person entry found
  • PersonError::SerializationError - Record parsing failed

update_person(input: UpdatePersonInput) -> ExternResult<Record>

Purpose: Update an existing person profile Authorization: Only profile owner can update Input:

#![allow(unused)]
fn main() {
pub struct UpdatePersonInput {
    pub original_action_hash: ActionHash,
    pub name: Option<String>,
    pub avatar: Option<String>,
    pub bio: Option<String>,
    pub location: Option<String>,
    pub tags: Option<Vec<String>>,
}
}

Returns: Updated Record with new version Side Effects:

  • Creates new entry version with update links
  • Updates discovery anchors if needed
  • Maintains audit trail of changes Error Cases:
  • PersonError::Unauthorized - Not profile owner
  • PersonError::PersonNotFound - Original entry not found

get_all_persons(()) -> ExternResult<GetAllPersonsOutput>

Purpose: Discover all agents in the network Authorization: Public access for discovery Returns:

#![allow(unused)]
fn main() {
pub struct GetAllPersonsOutput {
    pub persons: Vec<PersonProfile>,
}
}

Performance: Uses anchor-based traversal for efficient discovery

get_person_profile(agent_pubkey: AgentPubKey) -> ExternResult<PersonProfileOutput>

Purpose: Get comprehensive profile information for a specific agent Authorization: Public access Returns:

#![allow(unused)]
fn main() {
pub struct PersonProfileOutput {
    pub person: Option<Person>,
    pub role: Option<PersonRole>,
    pub capability_level: String,
}
}

get_my_person_profile(()) -> ExternResult<PersonProfileOutput>

Purpose: Get current agent's complete profile Authorization: Current agent only Returns: Full profile including private information Performance: Optimized for current agent access patterns

Purpose: Get all links between an agent and person entries Authorization: Public access Returns: Vector of links showing agent-person relationships Use Case: Multi-device support and relationship management

get_agent_person(agent_pubkey: AgentPubKey) -> ExternResult<Option<ActionHash>>

Purpose: Get the primary person associated with an agent Authorization: Public access Returns: ActionHash of person entry if association exists Use Case: Agent-to-person lookup for profile access

get_person_agents(person_hash: ActionHash) -> ExternResult<Vec<AgentPubKey>>

Purpose: Get all agents associated with a person Authorization: Public access Returns: Vector of agent public keys Use Case: Multi-device support and agent management

add_agent_to_person(input: (AgentPubKey, ActionHash)) -> ExternResult<bool>

Purpose: Associate an additional agent with a person (multi-device support) Authorization: Person owner only Input: Tuple of (agent_pubkey, person_hash) Returns: Success status Use Case: Adding new devices to existing person profile

remove_agent_from_person(input: (AgentPubKey, ActionHash)) -> ExternResult<bool>

Purpose: Remove agent association from a person Authorization: Person owner only Input: Tuple of (agent_pubkey, person_hash) Returns: Success status Use Case: Removing lost or deactivated devices

is_agent_associated_with_person(input: (AgentPubKey, ActionHash)) -> ExternResult<bool>

Purpose: Check if agent is associated with person Authorization: Public access Input: Tuple of (agent_pubkey, person_hash) Returns: Boolean indicating association status Use Case: Authorization checks and validation

get_hrea_agents(hashes: Vec<ActionHash>) -> ExternResult<Vec<Option<Record>>>

Purpose: Retrieve ReaAgent records from the hREA DNA by action hashes Authorization: Public access Input: Vector of ActionHash values (typically from Person.hrea_agent_hash) Returns: Vector of optional Records (None if a hash is not found in hREA) Use Case: Resolve agent names and avatars from hREA without duplicating data in the Nondominium DNA. Part of the Phase 1 hREA bridge — see hREA/integration-strategy.md Pattern 5.

promote_agent_to_accountable(input: PromoteAgentInput) -> ExternResult<String>

Purpose: Promote an agent to accountable status with validation Authorization: Governance role required Input:

#![allow(unused)]
fn main() {
pub struct PromoteAgentInput {
    pub agent: AgentPubKey,
    pub first_resource_hash: ActionHash,
}
}

Returns: String indicating new capability level Use Case: Agent promotion workflow


Private Data Management

store_private_person_data(input: PrivatePersonDataInput) -> ExternResult<Record>

Purpose: Store private personal data with encryption Authorization: Current agent only Input:

#![allow(unused)]
fn main() {
pub struct PrivatePersonDataInput {
    pub legal_name: String,
    pub email: String,
    pub phone: Option<String>,
    pub address: Option<String>,
    pub emergency_contact: Option<String>,
    pub time_zone: Option<String>,
    pub location: Option<String>,
}
}

Returns: Encrypted Record with private data Security: Data encrypted before storage in DHT

update_private_person_data(input: UpdatePrivatePersonDataInput) -> ExternResult<Record>

Purpose: Update existing private personal data Authorization: Current agent only Input: Similar to PrivatePersonDataInput with optional fields for updates Returns: Updated encrypted Record Security: Data encrypted before storage in DHT

get_my_private_person_data(()) -> ExternResult<Option<PrivatePersonData>>

Purpose: Retrieve current agent's private data Authorization: Current agent only Returns: Decrypted private data if available Security: Automatic decryption for authorized access

`get_agent_private_data(

agent_pubkey: AgentPubKey,
required_fields: Vec<String>,

) -> ExternResult<Option>` Purpose: Access another agent's private data with authorization Authorization: Requires valid capability grant Input: Tuple of (agent_pubkey, required_fields) Returns: Private data if access authorized Security: Enforces capability-based access control


Device Management

register_device_for_person(input: RegisterDeviceInput) -> ExternResult<Record>

Purpose: Register a new device for a person (multi-device support) Authorization: Device owner or person representative Input:

#![allow(unused)]
fn main() {
pub struct RegisterDeviceInput {
    pub device_id: String,
    pub device_name: String,
    pub device_type: String, // "mobile", "desktop", "tablet", "web", "server"
    pub person_hash: ActionHash,
}
}

Returns: Created Device entry record Side Effects: Creates device-person relationship links

get_devices_for_person(person_hash: ActionHash) -> ExternResult<Vec<DeviceInfo>>

Purpose: Get all devices registered for a specific person Authorization: Person owner or authorized agent Returns: Vector of device information structures Use Case: Multi-device management and security

get_device_info(device_id: String) -> ExternResult<Option<DeviceInfo>>

Purpose: Get detailed information about a specific device Authorization: Device owner or authorized agent Returns: Device information if device exists Use Case: Device verification and management

update_device_activity(device_id: String) -> ExternResult<bool>

Purpose: Update the last active timestamp for a device Authorization: Any authenticated request for the device Returns: Success status Use Case: Device activity tracking and security monitoring

deactivate_device(device_id: String) -> ExternResult<bool>

Purpose: Deactivate a device (revoke access) Authorization: Device owner or person representative Returns: Success status Security: Prevents further access from deactivated device

get_my_devices(()) -> ExternResult<Vec<DeviceInfo>>

Purpose: Get all devices for the current agent Authorization: Current agent only Returns: Vector of device information for current agent Use Case: Device management interface for users


Capability-Based Sharing

grant_private_data_access(input: GrantPrivateDataAccessInput) -> ExternResult<GrantPrivateDataAccessOutput>

Purpose: Grant another agent access to specific private data fields Authorization: Data owner only Input:

#![allow(unused)]
fn main() {
pub struct GrantPrivateDataAccessInput {
    pub agent_to_grant: AgentPubKey,
    pub fields_allowed: Vec<String>,
    pub context: String,
    pub expires_in_days: Option<u32>,
}
}

Returns:

#![allow(unused)]
fn main() {
pub struct GrantPrivateDataAccessOutput {
    pub grant_hash: ActionHash,
    pub cap_secret: CapSecret,
}
}

Security: Creates granular, field-level access control

create_private_data_cap_claim(input: CreatePrivateDataCapClaimInput) -> ExternResult<Record>

Purpose: Create capability claim for private data access (for grantee) Authorization: Any agent can create claims Input:

#![allow(unused)]
fn main() {
pub struct CreatePrivateDataCapClaimInput {
    pub grantor: AgentPubKey,
    pub fields: Vec<String>,
    pub purpose: String,
    pub expires_at: Option<Timestamp>,
}
}

Returns: Capability claim record Security: Creates cryptographically secure capability claim

get_private_data_with_capability(input: GetPrivateDataWithCapabilityInput) -> ExternResult<FilteredPrivateData>

Purpose: Access private data using capability claim Authorization: Valid capability claim required Input:

#![allow(unused)]
fn main() {
pub struct GetPrivateDataWithCapabilityInput {
    pub target_agent: AgentPubKey,
    pub cap_claim: CapClaim,
    pub cap_secret: CapSecret,
    pub requested_fields: Vec<String>,
}
}

Returns: Filtered private data based on authorized fields Security: Cryptographic verification of capability claim

get_my_capability_grants(()) -> ExternResult<Vec<PrivateDataCapabilityMetadata>>

Purpose: List all active capability grants issued by current agent Authorization: Current agent only Returns: List of capability grants with metadata Utility: For managing and revoking access permissions

create_transferable_private_data_access(input: CreateTransferableAccessInput) -> ExternResult<Record>

Purpose: Create transferable access capability for delegation Authorization: Data owner only Input:

#![allow(unused)]
fn main() {
pub struct CreateTransferableAccessInput {
    pub agent_pubkey: AgentPubKey,
    pub fields: Vec<String>,
    pub context: String,
    pub expires_at: Option<Timestamp>,
}
}

Security: Enables controlled delegation of access rights Use Case: Service providers needing temporary access to client data

revoke_private_data_access(grant_hash: ActionHash) -> ExternResult<()>

Purpose: Revoke previously granted private data access Authorization: Grant owner only Input: ActionHash of the capability grant to revoke Security: Immediately terminates access permissions Use Case: Security incident response and access management

validate_capability_grant(grant_hash: ActionHash) -> ExternResult<bool>

Purpose: Validate if a capability grant is still active and valid Authorization: Public access Input: ActionHash of the capability grant to validate Returns: Boolean indicating grant validity Use Case: Pre-access validation and security checks

grant_role_based_private_data_access(input: RoleBasedAccessInput) -> ExternResult<Record>

Purpose: Grant private data access based on role assignment Authorization: System or governance role required Input:

#![allow(unused)]
fn main() {
pub struct RoleBasedAccessInput {
    pub role_name: String,
    pub fields: Vec<String>,
    pub context: String,
    pub expires_at: Option<Timestamp>,
}
}

Security: Role-based access control for private data Use Case: Organizational data access policies

validate_agent_private_data(input: ValidationDataRequest) -> ExternResult<ValidationResult>

Purpose: Validate an agent's request for private data access Authorization: Validation service or authorized validator Input:

#![allow(unused)]
fn main() {
pub struct ValidationDataRequest {
    pub requesting_agent: AgentPubKey,
    pub target_agent: AgentPubKey,
    pub requested_fields: Vec<String>,
    pub context: String,
}
}

Returns:

#![allow(unused)]
fn main() {
pub struct ValidationResult {
    pub is_valid: bool,
    pub granted_fields: Vec<String>,
    pub reason: Option<String>,
}
}

Security: Structured validation with reasoning

validate_agent_private_data_with_grant(input: ValidationWithGrantRequest) -> ExternResult<ValidationResult>

Purpose: Validate private data access with specific capability grant Authorization: Validation service or authorized validator Input: Validation request with specific grant information Returns: Validation result with grant-specific reasoning Security: Grant-specific validation for audit trails


Role Management

assign_person_role(input: PersonRoleInput) -> ExternResult<Record>

Purpose: Assign a role to an agent Authorization: System or governance role required Input:

#![allow(unused)]
fn main() {
pub struct PersonRoleInput {
    pub agent_pubkey: AgentPubKey,
    pub role_name: String,
    pub description: Option<String>,
}
}

Returns: Role assignment record Security: Role assignments create capability implications

get_latest_person_role_record(original_action_hash: ActionHash) -> ExternResult<Option<Record>>

Purpose: Retrieve the most recent version of a person role record Authorization: Public access for role verification Returns: Latest role record or None if not found Use Case: Role history and validation

get_latest_person_role(original_action_hash: ActionHash) -> ExternResult<PersonRole>

Purpose: Retrieve the most recent version of a person role Authorization: Public access for role verification Returns: Latest PersonRole entry Error Cases: Role not found, record parsing failed

update_person_role(input: UpdatePersonRoleInput) -> ExternResult<Record>

Purpose: Update an existing person role Authorization: System or governance role required Input:

#![allow(unused)]
fn main() {
pub struct UpdatePersonRoleInput {
    pub original_action_hash: ActionHash,
    pub previous_action_hash: ActionHash,
    pub role_name: Option<String>,
    pub description: Option<String>,
}
}

Returns: Updated role assignment record Security: Maintains audit trail of role changes

get_person_roles(agent_pubkey: AgentPubKey) -> ExternResult<GetPersonRolesOutput>

Purpose: Retrieve all roles assigned to an agent Authorization: Public access for role verification Returns:

#![allow(unused)]
fn main() {
pub struct GetPersonRolesOutput {
    pub roles: Vec<PersonRole>,
}
}

get_my_person_roles(()) -> ExternResult<GetPersonRolesOutput>

Purpose: Get current agent's roles with validation details Authorization: Current agent only Returns: Complete role information including validation metadata

get_person_capability_level(agent_pubkey: AgentPubKey) -> ExternResult<String>

Purpose: Determine agent's capability level based on roles Authorization: Public access for capability verification Returns: String capability level ("Simple Agent", "Accountable Agent", "Primary Accountable Agent", etc.) Logic:

  • "Simple Agent" - Basic agent capabilities
  • "Accountable Agent" - Resource access and management
  • "Primary Accountable Agent" - Process initiation and coordination
  • Specialized roles: "Transport Agent", "Repair Agent", "Storage Agent"

has_person_role_capability(input: (AgentPubKey, String)) -> ExternResult<bool>

Purpose: Check if agent has specific role capability Authorization: Public access for role verification Input: Tuple of (agent_pubkey, role_name) Returns: Boolean indicating role presence


Role Promotion Workflow

promote_agent_with_validation(input: PromoteAgentInput) -> ExternResult<Record>

Purpose: Promote an agent with validation and PPR generation Authorization: Governance role required Input:

#![allow(unused)]
fn main() {
pub struct PromoteAgentInput {
    pub agent: AgentPubKey,
    pub first_resource_hash: ActionHash,
}
}

Returns: Role promotion record with validation metadata Side Effects: Generates PPRs for promotion validation Security: Comprehensive validation with reputation assessment

request_role_promotion(input: RolePromotionRequest) -> ExternResult<ActionHash>

Purpose: Request role promotion for current agent Authorization: Any agent can request promotion Input:

#![allow(unused)]
fn main() {
pub struct RolePromotionRequest {
    pub desired_role: String,
    pub evidence: Option<String>,
    pub context: String,
}
}

Returns: ActionHash of the promotion request Use Case: Self-initiated promotion requests

approve_role_promotion(input: ApprovePromotionInput) -> ExternResult<Record>

Purpose: Approve a role promotion request Authorization: Governance role required Input:

#![allow(unused)]
fn main() {
pub struct ApprovePromotionInput {
    pub request_hash: ActionHash,
    pub validator_notes: Option<String>,
    pub assigned_role: String,
}
}

Returns: Approved role promotion record Side Effects: Creates PPRs for successful promotion Security: Multi-validator approval process


🏗️ zome_resource - Resource Lifecycle Management

NDO (NondominiumIdentity) Layer 0 Management

create_ndo(input: NdoInput) -> ExternResult<NdoOutput>

Purpose: Create a new Nondominium Identity (Layer 0 anchor) for a resource Authorization: Any agent Input:

#![allow(unused)]
fn main() {
pub struct NdoInput {
    pub name: String,
    pub property_regime: PropertyRegime,
    pub resource_nature: ResourceNature,
    pub lifecycle_stage: LifecycleStage, // any non-terminal stage
    pub description: Option<String>,
}
}

Returns: NdoOutput { action_hash, entry }action_hash is the permanent Layer 0 identity Side Effects: Creates AllNdos, AgentToNdo, NdoByLifecycleStage, NdoByNature, and NdoByPropertyRegime links Error Cases: Empty name, terminal initial stage (Hibernating, Deprecated, EndOfLife)

get_ndo(original_action_hash: ActionHash) -> ExternResult<Option<NondominiumIdentity>>

Purpose: Retrieve the latest version of an NDO by its stable Layer 0 identity hash Authorization: Public Returns: Latest NondominiumIdentity entry or None if not found on DHT

update_lifecycle_stage(input: UpdateLifecycleStageInput) -> ExternResult<ActionHash>

Purpose: Transition an NDO's lifecycle stage through the state machine Authorization: Initiator only Input:

#![allow(unused)]
fn main() {
pub struct UpdateLifecycleStageInput {
    pub original_action_hash: ActionHash,
    pub new_stage: LifecycleStage,
    pub successor_ndo_hash: Option<ActionHash>,    // required when new_stage == Deprecated
    pub transition_event_hash: Option<ActionHash>, // optional EconomicEvent reference
}
}

Returns: New ActionHash (original remains the stable Layer 0 identity) Side Effects: Moves NdoByLifecycleStage link to new stage anchor; conditionally creates NdoToSuccessor and NdoToTransitionEvent links Error Cases: Unauthorized, invalid state machine transition, missing successor_ndo_hash when entering Deprecated

get_all_ndos(()) -> ExternResult<GetAllNdosOutput>

Purpose: Discover all NDOs in the network Authorization: Public Returns: GetAllNdosOutput { ndos: Vec<NdoOutput> } — resolved to latest versions; unavailable entries silently skipped

get_my_ndos(()) -> ExternResult<GetAllNdosOutput>

Purpose: Retrieve all NDOs created by the calling agent Authorization: Any agent (scoped to caller) Returns: GetAllNdosOutput { ndos: Vec<NdoOutput> } — resolved to latest versions; unavailable entries silently skipped

get_ndos_by_lifecycle_stage(stage: LifecycleStage) -> ExternResult<GetAllNdosOutput>

Purpose: Query NDOs currently at a specific lifecycle stage Authorization: Public Returns: GetAllNdosOutput { ndos: Vec<NdoOutput> } — uses NdoByLifecycleStage anchor; silently skips unavailable entries Requirements: REQ-NDO-L0-05, REQ-NDO-L0-07

get_ndos_by_nature(nature: ResourceNature) -> ExternResult<GetAllNdosOutput>

Purpose: Query NDOs of a specific resource nature Authorization: Public Returns: GetAllNdosOutput { ndos: Vec<NdoOutput> } — uses NdoByNature anchor; silently skips unavailable entries Requirements: REQ-NDO-L0-05, REQ-NDO-L0-07

get_ndos_by_property_regime(regime: PropertyRegime) -> ExternResult<GetAllNdosOutput>

Purpose: Query NDOs under a specific property regime Authorization: Public Returns: GetAllNdosOutput { ndos: Vec<NdoOutput> } — uses NdoByPropertyRegime anchor; silently skips unavailable entries Requirements: REQ-NDO-L0-05, REQ-NDO-L0-07


Resource Specification Management

create_resource_specification(input: ResourceSpecificationInput) -> ExternResult<Record>

Purpose: Define new resource type with properties and governance rules Authorization: Any agent can create resource specifications Input:

#![allow(unused)]
fn main() {
pub struct ResourceSpecificationInput {
    pub name: String,
    pub description: String,
    pub resource_class: String,
    pub default_unit: String,
    pub custom_properties: HashMap<String, PropertyValue>,
    pub behavior: Option<String>,
    pub conforming: bool,
    pub image: Option<String>,
    pub category: Option<String>,
    pub tags: Vec<String>,
    pub governance_rules: Vec<ActionHash>,
}
}

Returns: Created ResourceSpecification entry Side Effects:

  • Creates specification entry with discovery anchors
  • Links to governance rules for compliance
  • Creates category and tag-based discovery links

get_latest_resource_specification(original_action_hash: ActionHash) -> ExternResult<ResourceSpecification>

Purpose: Retrieve most recent resource specification version Authorization: Public access Returns: Latest ResourceSpecification with all properties Error Cases: Specification not found, record corruption

update_resource_specification(input: UpdateResourceSpecificationInput) -> ExternResult<Record>

Purpose: Update resource specification with version tracking Authorization: Specification owner only Input:

#![allow(unused)]
fn main() {
pub struct UpdateResourceSpecificationInput {
    pub original_action_hash: ActionHash,
    pub name: Option<String>,
    pub description: Option<String>,
    pub resource_class: Option<String>,
    pub default_unit: Option<String>,
    pub custom_properties: Option<HashMap<String, PropertyValue>>,
    pub behavior: Option<String>,
    pub conforming: Option<bool>,
    pub image: Option<String>,
    pub category: Option<String>,
    pub tags: Option<Vec<String>>,
    pub governance_rules: Option<Vec<ActionHash>>,
}
}

Returns: Updated specification with version tracking

get_all_resource_specifications(()) -> ExternResult<GetAllResourceSpecificationsOutput>

Purpose: Discover all resource specifications in network Authorization: Public access Returns: GetAllResourceSpecificationsOutput { specifications, action_hashes } — parallel vectors of same length and order. action_hashes[i] is the original creation ActionHash for specifications[i], suitable for use as a stable route identifier (e.g. /ndo/[id]).

get_resource_specification_profile(action_hash: ActionHash) -> ExternResult<ResourceSpecificationProfile>

Purpose: Get comprehensive specification profile with metadata Authorization: Public access Returns: Specification with creation metadata and governance rules

get_resource_specifications_by_category(category: String) -> ExternResult<Vec<Record>>

Purpose: Find specifications by category classification Authorization: Public access Performance: Category-based anchor traversal for efficiency

get_resource_specifications_by_tag(tag: String) -> ExternResult<Vec<Record>>

Purpose: Find specifications with specific tags Authorization: Public access Utility: Tag-based resource discovery

Purpose: List specifications created by current agent Authorization: Current agent only Returns: Links to created specifications


Economic Resource Management

create_economic_resource(input: EconomicResourceInput) -> ExternResult<Record>

Purpose: Create resource instance from specification Authorization: Any agent can create resources Input:

#![allow(unused)]
fn main() {
pub struct EconomicResourceInput {
    pub resource_specification: ActionHash,
    pub name: String,
    pub accounting_quantity: Option<f64>,
    pub unit_of_effort: Option<String>,
    pub current_quantity: f64,
    pub primary_accountable: AgentPubKey,
    pub classified_as: Vec<String>,
    pub unit_of_resource: String,
    pub stage: Option<String>,
    pub state: Option<String>,
    pub location: Option<String>,
    pub note: Option<String>,
    pub image: Option<String>,
}
}

Returns: Created EconomicResource entry Side Effects:

  • Creates resource with lifecycle tracking
  • Links to specification for type validation
  • Establishes custody relationships
  • Creates economic event for resource creation

get_latest_economic_resource(original_action_hash: ActionHash) -> ExternResult<EconomicResource>

Purpose: Retrieve most recent resource state Authorization: Public access for resource discovery Returns: Current EconomicResource with state and metadata

update_economic_resource(input: UpdateEconomicResourceInput) -> ExternResult<Record>

Purpose: Update resource properties and state Authorization: Primary accountable agent or authorized role Input:

#![allow(unused)]
fn main() {
pub struct UpdateEconomicResourceInput {
    pub original_action_hash: ActionHash,
    pub name: Option<String>,
    pub accounting_quantity: Option<f64>,
    pub unit_of_effort: Option<String>,
    pub current_quantity: Option<f64>,
    pub primary_accountable: Option<AgentPubKey>,
    pub classified_as: Option<Vec<String>>,
    pub unit_of_resource: Option<String>,
    pub stage: Option<String>,
    pub state: Option<String>,
    pub location: Option<String>,
    pub note: Option<String>,
    pub image: Option<String>,
}
}

Returns: Updated resource with audit trail Security: Role-based authorization for resource updates

get_all_economic_resources(()) -> ExternResult<GetAllEconomicResourcesOutput>

Purpose: Discover all economic resources in network Authorization: Public access Performance: Anchor-based discovery with pagination support

get_economic_resource_profile(action_hash: ActionHash) -> ExternResult<EconomicResourceProfile>

Purpose: Get comprehensive resource profile with history Authorization: Public access Returns: Resource with specification details and lifecycle events

get_resources_by_specification(spec_hash: ActionHash) -> ExternResult<Vec<Record>>

Purpose: Find all resources of a specific type Authorization: Public access Utility: Resource browsing and discovery

Purpose: List resources where current agent has custody or ownership Authorization: Current agent only Returns: Links to resources with relationship metadata

Purpose: List resources associated with specific agent Authorization: Public access Returns: Resources where agent has accountability or custody

update_resource_state(input: UpdateResourceStateInput) -> ExternResult<Record>

Purpose: Update resource state with validation Authorization: Primary accountable agent or authorized role Input:

#![allow(unused)]
fn main() {
pub struct UpdateResourceStateInput {
    pub resource_hash: ActionHash,
    pub new_state: String,
    pub stage: Option<String>,
    pub location: Option<String>,
    pub note: Option<String>,
}
}

Returns: State update record with economic event Validation: State transitions validated against specification rules


Governance Rules Management

create_governance_rule(input: GovernanceRuleInput) -> ExternResult<Record>

Purpose: Create governance rule for resource or process compliance Authorization: Governance role required Input:

#![allow(unused)]
fn main() {
pub struct GovernanceRuleInput {
    pub name: String,
    pub description: String,
    pub rule_type: String,
    pub resource_specification: Option<ActionHash>,
    pub economic_process: Option<String>,
    pub condition_expression: String,
    pub action_required: String,
    pub validation_method: String,
    pub active: bool,
    pub priority: u32,
}
}

Returns: Created GovernanceRule entry Purpose: Embed compliance rules directly in resource definitions

get_latest_governance_rule(original_action_hash: ActionHash) -> ExternResult<GovernanceRule>

Purpose: Retrieve governance rule details Authorization: Public access for compliance verification Returns: Complete governance rule with validation logic

update_governance_rule(input: UpdateGovernanceRuleInput) -> ExternResult<Record>

Purpose: Update governance rule with version tracking Authorization: Governance role required Returns: Updated rule with audit trail

get_all_governance_rules(()) -> ExternResult<GetAllGovernanceRulesOutput>

Purpose: Discover all governance rules Authorization: Public access Returns: Array of all active governance rules

get_governance_rules_by_type(rule_type: String) -> ExternResult<Vec<Record>>

Purpose: Find governance rules by type classification Authorization: Public access Utility: Rule discovery and compliance checking


🏛️ zome_gouvernance - Governance & Reputation

Commitment Management

get_all_commitments(()) -> ExternResult<Vec<Commitment>>

Purpose: Retrieve all commitments in the network Authorization: Public access for commitment discovery Returns: Array of all commitment entries Use Case: Finding available commitment opportunities

get_commitments_for_agent(agent: AgentPubKey) -> ExternResult<Vec<Commitment>>

Purpose: Find commitments involving specific agent Authorization: Public access Returns: Commitments where agent is provider or receiver Utility: Agent reputation and capability assessment


Claim Management

get_all_claims(()) -> ExternResult<Vec<Claim>>

Purpose: Retrieve all claims in the network Authorization: Public access Returns: Array of all claim entries Purpose: Claim discovery and verification

get_claims_for_commitment(commitment_hash: ActionHash) -> ExternResult<Vec<Claim>>

Purpose: Find claims related to specific commitment Authorization: Public access Returns: Claims providing evidence for commitment fulfillment Use Case: Commitment validation and reputation assessment


Economic Event Management

get_all_economic_events(()) -> ExternResult<Vec<EconomicEvent>>

Purpose: Retrieve all economic events for transparency Authorization: Public access Returns: Array of all economic events Purpose: Complete economic activity audit trail

get_events_for_resource(resource_hash: ActionHash) -> ExternResult<Vec<EconomicEvent>>

Purpose: Get economic history of specific resource Authorization: Public access Returns: Events affecting resource state and ownership Utility: Resource lifecycle tracking and provenance

get_events_for_agent(agent: AgentPubKey) -> ExternResult<Vec<EconomicEvent>>

Purpose: Get economic activity for specific agent Authorization: Public access Returns: Events where agent participated as provider or receiver Use Case: Agent economic reputation and activity assessment


PPR (Private Participation Receipt) System

get_my_participation_claims(input: GetMyParticipationClaimsInput) -> ExternResult<ParticipationClaimBundle>

Purpose: Retrieve current agent's PPR claims for reputation assessment Authorization: Current agent only Input:

#![allow(unused)]
fn main() {
pub struct GetMyParticipationClaimsInput {
    pub categories: Option<Vec<ParticipationClaimType>>,
    pub time_range: Option<TimeRange>,
    pub include_expired: bool,
}
}

Returns:

#![allow(unused)]
fn main() {
pub struct ParticipationClaimBundle {
    pub claims: Vec<ParticipationClaim>,
    pub summary: ReputationSummary,
    pub verification_contexts: Vec<VerificationContext>,
}
}

Security: Cryptographic verification of all PPR claims

create_service_commitment_pprs(commitment_hash: ActionHash) -> ExternResult<Vec<Record>>

Purpose: Automatically issue PPRs when service commitments are created Authorization: System function based on commitment creation Returns: Created PPR entries for commitment initiation Logic: Issues PPRs to both provider and potential receivers

create_service_fulfillment_pprs(commitment_hash: ActionHash) -> ExternResult<Vec<Record>>

Purpose: Issue PPRs upon successful commitment fulfillment Authorization: System function triggered by fulfillment validation Returns: PPR entries documenting successful service delivery Categories: Service-specific PPR categories based on commitment type


Validation System

create_validation_receipt(input: CreateValidationReceiptInput) -> ExternResult<Record>

Purpose: Create validation receipt for resource, service, or commitment Authorization: Validator role required Input:

#![allow(unused)]
fn main() {
pub struct CreateValidationReceiptInput {
    pub validated_item: ActionHash,
    pub validation_type: String,
    pub validator: AgentPubKey,
    pub assessment: String,
    pub confidence: f64,
    pub evidence: Option<String>,
    pub metrics: Option<HashMap<String, f64>>,
}
}

Returns: Validation receipt with cryptographic signature Purpose: Create evidence for PPR issuance and reputation building

get_validation_history(item_hash: ActionHash) -> ExternResult<Vec<ValidationReceipt>>

Purpose: Retrieve complete validation history for any item Authorization: Public access Returns: All validation receipts for the specified item Use Case: Multi-reviewer validation and quality assessment

get_all_validation_receipts(()) -> ExternResult<Vec<ValidationReceipt>>

Purpose: Discover all validation receipts in network Authorization: Public access Returns: Array of all validation receipts Utility: Validator discovery and reputation assessment

create_resource_validation(input: CreateResourceValidationInput) -> ExternResult<Record>

Purpose: Create comprehensive resource validation with multi-reviewer process Authorization: Resource owner or authorized validator Input:

#![allow(unused)]
fn main() {
pub struct CreateResourceValidationInput {
    pub resource_hash: ActionHash,
    pub validation_type: String,
    pub required_reviewers: u32,
    pub validation_criteria: String,
    pub deadline: Option<u64>,
    pub incentive: Option<f64>,
}
}

Returns: Resource validation workflow setup Process: Initiates multi-reviewer validation workflow


Private Data Validation

get_validation_requirements(process_type: String) -> ExternResult<Vec<String>>

Purpose: Get required private data fields for economic process validation Authorization: Public access Returns: List of required private data fields Use Case: Process compliance and data access planning

create_validation_with_private_data(input: CreateValidationWithPrivateDataInput) -> ExternResult<Record>

Purpose: Create validation that requires access to private data Authorization: Authorized validator with capability grants Input:

#![allow(unused)]
fn main() {
pub struct CreateValidationWithPrivateDataInput {
    pub validated_item: ActionHash,
    pub validation_type: String,
    pub required_private_data: Vec<String>,
    pub validator: AgentPubKey,
    pub assessment: String,
    pub confidence: f64,
    pub data_access_grants: Vec<CapClaim>,
}
}

Returns: Validation with private data access verification Security: Requires valid capability grants for all accessed private data


NDO Federation Extensions

Added in PR #103. Implements REQ-NDO-EXT-01–16 from post-mvp/lobby-dna.md.

create_ndo_hard_link(input: CreateNdoHardLinkInput) -> ExternResult<ActionHash>

Purpose: Create a permanent, immutable OVN-licensed structural link between two NDOs Authorization: Any agent (immutability enforced at integrity layer) Input:

#![allow(unused)]
fn main() {
pub struct CreateNdoHardLinkInput {
    pub from_ndo_identity_hash: ActionHash,
    pub to_ndo_dna_hash: DnaHash,
    pub to_ndo_identity_hash: ActionHash,
    pub link_type: NdoLinkType, // Component | DerivedFrom | Supersedes
    pub fulfillment_hash: ActionHash,
}
}

Returns: ActionHash of the new NdoHardLink entry Use Case: Recording that one NDO is a component of, fork of, or supersedes another NDO

get_ndo_hard_links(ndo_identity_hash: ActionHash) -> ExternResult<Vec<NdoHardLinkRecord>>

Purpose: Retrieve all hard links originating from an NDO Authorization: Any agent (public DHT) Returns: Vec<NdoHardLinkRecord> via NdoToHardLinks anchor

Purpose: Retrieve hard links filtered by NdoLinkType Authorization: Any agent (public DHT) Returns: Filtered Vec<NdoHardLinkRecord>

validate_contribution(input: ValidateContributionInput) -> ExternResult<ActionHash>

Purpose: Record and peer-validate a work contribution (Work | Modify | Cite) on an NDO Authorization: Any agent; calling agent becomes first validator Input:

#![allow(unused)]
fn main() {
pub struct ValidateContributionInput {
    pub provider: AgentPubKey,
    pub action: VfAction,      // Work | Modify | Cite only
    pub ndo_identity_hash: ActionHash,
    pub note: String,
    pub effort_quantity: Option<f64>,
    pub has_point_in_time: Timestamp,
    // ... optional work log / process / fulfillment references
}
}

Returns: ActionHash of the Contribution entry Use Case: Recording that an agent performed design, development, or citation work on an NDO

get_ndo_contributions(ndo_identity_hash: ActionHash) -> ExternResult<Vec<ContributionRecord>>

Purpose: Retrieve all contributions for a given NDO Authorization: Any agent (public DHT) Returns: Vec<ContributionRecord> via NdoToContributions anchor

get_agent_contributions(provider: AgentPubKey) -> ExternResult<Vec<ContributionRecord>>

Purpose: Retrieve all contributions from a given provider agent Authorization: Any agent (public DHT) Returns: Vec<ContributionRecord> via AgentToContributions anchor

create_agreement(input: CreateAgreementInput) -> ExternResult<ActionHash>

Purpose: Create the first benefit redistribution Agreement (v1) for an NDO Authorization: Any agent; primary_accountable list declares governance signatories Input:

#![allow(unused)]
fn main() {
pub struct CreateAgreementInput {
    pub ndo_identity_hash: ActionHash,
    pub clauses: Vec<BenefitClause>,
    pub primary_accountable: Vec<AgentPubKey>,
}
}

Returns: ActionHash of the Agreement entry Use Case: Defining how economic benefits (monetary, governance weight, access rights) are distributed among NDO contributors

update_agreement(input: UpdateAgreementInput) -> ExternResult<ActionHash>

Purpose: Update an existing Agreement, incrementing version monotonically Authorization: Any agent; integrity enforces version = previous + 1 Returns: ActionHash of the updated Agreement entry

get_current_agreement(ndo_identity_hash: ActionHash) -> ExternResult<Option<AgreementRecord>>

Purpose: Retrieve the latest version of the Agreement for an NDO Authorization: Any agent (public DHT) Returns: Option<AgreementRecord> resolving the full update chain


Lobby DNA Functions (zome_lobby_coordinator)

Global discovery and federation layer. Uses canonical network_seed: nondominium-lobby-v1.

Agent Profile Functions

upsert_lobby_agent_profile(input: LobbyAgentProfileInput) -> ExternResult<ActionHash>

Purpose: Create or update the calling agent's Lobby profile (upsert pattern via update chain) Authorization: Any agent Returns: ActionHash of the new or updated entry Note: Creates two links on first call — global AllLobbyAgents (path anchor) and per-agent AgentToLobbyProfile (agent pubkey anchor, used for lookup and update detection)

get_lobby_agent_profile(agent: AgentPubKey) -> ExternResult<Option<LobbyAgentProfile>>

Purpose: Retrieve a specific agent's current Lobby profile (resolves update chain) Authorization: Any agent (public DHT) Returns: Option<LobbyAgentProfile>

get_all_lobby_agents(_: ()) -> ExternResult<Vec<LobbyAgentProfileRecord>>

Purpose: Retrieve all Lobby agent profiles via global path anchor Authorization: Any agent (public DHT) Returns: Vec<LobbyAgentProfileRecord>

NDO Announcement Functions

announce_ndo(input: AnnounceNdoInput) -> ExternResult<ActionHash>

Purpose: Announce an NDO to the global Lobby DHT for cross-network discovery Authorization: Any agent Returns: ActionHash of the NdoAnnouncement entry

get_all_ndo_announcements(_: ()) -> ExternResult<Vec<NdoAnnouncementRecord>>

Purpose: Retrieve all NDO announcements via global path anchor Authorization: Any agent (public DHT)

get_my_ndo_announcements(_: ()) -> ExternResult<Vec<NdoAnnouncementRecord>>

Purpose: Retrieve NDO announcements registered by the calling agent Authorization: Any agent (public DHT)

get_ndo_announcements_by_lifecycle(stage: String) -> ExternResult<Vec<NdoAnnouncementRecord>>

Purpose: Retrieve NDO announcements filtered by lifecycle stage Authorization: Any agent (public DHT) Input: Lifecycle stage string matching LifecycleStage::Display (e.g. "active", "stable") Returns: Vec<NdoAnnouncementRecord> via NdoAnnouncementByLifecycle lifecycle-path anchor

update_ndo_announcement(input: UpdateNdoAnnouncementInput) -> ExternResult<ActionHash>

Purpose: Advance the lifecycle stage of an existing NdoAnnouncement Authorization: Original registrant only (enforced in coordinator; integrity enforces field immutability) Input:

#![allow(unused)]
fn main() {
pub struct UpdateNdoAnnouncementInput {
    pub original_action_hash: ActionHash,
    pub new_lifecycle_stage: LifecycleStage,
}
}

Returns: ActionHash of the updated entry; creates a NdoAnnouncementUpdates chain link

Group Functions (Stub)

get_my_groups(_: ()) -> ExternResult<Vec<GroupDescriptorStub>>

Purpose: Return the calling agent's group memberships (stub until Group DNA ships in issue #101) Returns: Always returns a single solo workspace GroupDescriptorStub


🔗 Cross-Zome Integration Functions

Agent Capability Assessment

These functions combine data from multiple zomes to provide comprehensive capability assessment:

#![allow(unused)]
fn main() {
// Combined capability evaluation (pseudo-code)
fn evaluate_agent_capability(agent: AgentPubKey) -> CapabilityAssessment {
    let person_info = zome_person::get_person_capability_level(agent)?;
    let reputation = zome_gouvernance::get_my_participation_claims(agent)?;
    let resources = zome_resource::get_agent_economic_resources(agent)?;

    CapabilityAssessment {
        level: person_info.capability_level,
        reputation_score: reputation.summary.overall_score,
        resource_count: resources.len(),
        eligible_processes: calculate_eligible_processes(person_info, reputation),
    }
}
}

Economic Process Validation

Cross-zome validation ensures process compliance across all domains:

#![allow(unused)]
fn main() {
// Process authorization validation (pseudo-code)
fn validate_process_authorization(
    agent: AgentPubKey,
    process_type: EconomicProcess
) -> AuthorizationResult {
    let capability = zome_person::get_person_capability_level(agent)?;
    let reputation = zome_gouvernance::derive_reputation_score(agent)?;

    match process_type {
        UseProcess => {
            require_capability_level(capability, "stewardship")?;
            validate_reputation_threshold(reputation, USE_PROCESS_THRESHOLD)?;
        },
        TransportProcess | StorageProcess | RepairProcess => {
            require_capability_level(capability, "coordination")?;
            validate_reputation_threshold(reputation, ADVANCED_PROCESS_THRESHOLD)?;
            validate_specialized_role(agent, process_type)?;
        }
    }
}
}

🛡️ Security & Authorization Patterns

1. Capability-Based Access Control

All API functions enforce capability-based authorization:

#![allow(unused)]
fn main() {
// Standard authorization pattern
fn check_authorization(agent: AgentPubKey, required_level: &str) -> Result<(), AuthorizationError> {
    let current_level = get_person_capability_level(agent)?;
    if !capability_sufficient(&current_level, required_level) {
        return Err(AuthorizationError::InsufficientCapability);
    }
    Ok(())
}
}

2. Private Data Protection

Private data functions implement field-level access control:

#![allow(unused)]
fn main() {
// Private data access pattern
fn authorize_private_data_access(
    requestor: AgentPubKey,
    target: AgentPubKey,
    fields: Vec<String>
) -> Result<DataAccessGrant, AccessError> {
    let grant = validate_capability_claim(requestor, target, fields)?;
    ensure_grant_not_expired(&grant)?;
    ensure_field_authorized(&grant, fields)?;
    Ok(grant)
}
}

3. PPR Cryptographic Verification

PPR functions implement cryptographic verification:

#![allow(unused)]
fn main() {
// PPR verification pattern
fn verify_ppr_authenticity(ppr: &ParticipationClaim) -> Result<VerificationResult, VerificationError> {
    let signature_valid = verify_signature(&ppr.signature, &ppr.issuer, &ppr.content)?;
    let context_valid = verify_verification_context(&ppr.verification_context)?;
    let not_expired = check_expiration(&ppr.expires_at)?;

    Ok(VerificationResult {
        signature_valid,
        context_valid,
        not_expired,
        overall_trust_score: calculate_trust_score(ppr),
    })
}
}

📊 Performance & Optimization

DHT Optimization Patterns

  • Anchor-Based Discovery: All discovery functions use anchor paths for efficient DHT traversal
  • Link Caching: Frequently accessed link queries are cached at the conductor level
  • Batch Operations: Multi-entry operations minimize DHT round trips

Memory Management

  • Lazy Loading: Large data structures are loaded on-demand
  • Reference Counting: Shared data structures use reference counting to prevent memory leaks
  • Cleanup Strategies: Expired capabilities and outdated entries are periodically cleaned up

Network Efficiency

  • Compression: Large data payloads are compressed before DHT storage
  • Validation Caching: Validation results are cached to reduce redundant computations
  • Async Processing: Long-running operations use async patterns to prevent blocking

🔮 API Evolution & Extensibility

Versioning Strategy

  • Semantic Versioning: API versions follow semantic versioning (MAJOR.MINOR.PATCH)
  • Backward Compatibility: Deprecated functions remain supported for at least one major version
  • Migration Paths: Clear migration guidelines provided for breaking changes

Extension Points

  • Custom Validation: Pluggable validation modules for domain-specific requirements
  • New PPR Categories: Extensible PPR system for new reputation dimensions
  • Process Types: Economic process system supports new process type definitions

Integration APIs

Future API extensions will include:

  • External System Integration: Webhook and event streaming capabilities
  • Analytics APIs: Advanced reputation and economic analytics
  • Governance APIs: Dynamic rule management and democratic governance features

📋 Error Handling Reference

Common Error Types

#![allow(unused)]
fn main() {
// Person Management Errors (actual implementation)
pub enum PersonError {
    PersonAlreadyExists,
    PersonNotFound(String),
    PrivateDataNotFound,
    RoleNotFound(String),
    NotAuthor,
    SerializationError(String),
    EntryOperationFailed(String),
    LinkOperationFailed(String),
    InvalidInput(String),
    InsufficientCapability(String),
}

// Resource Management Errors (actual implementation)
pub enum ResourceError {
    ResourceSpecNotFound(String),
    EconomicResourceNotFound(String),
    GovernanceRuleNotFound(String),
    NotAuthor,
    NotCustodian,
    SerializationError(String),
    EntryOperationFailed(String),
    LinkOperationFailed(String),
    InvalidInput(String),
    GovernanceViolation(String),
}

// Governance Errors (actual implementation)
pub enum GovernanceError {
    ValidationReceiptNotFound(String),
    EconomicEventNotFound(String),
    ResourceValidationNotFound(String),
    CommitmentNotFound(String),
    NotAuthorizedValidator,
    InsufficientCapability(String),
    ValidationAlreadyExists(String),
    InvalidValidationScheme(String),
    SerializationError(String),
    EntryOperationFailed(String),
    LinkOperationFailed(String),
    InvalidInput(String),
    CrossZomeCallFailed(String),
}
}

Error Response Format

All API functions return ExternResult<T> with comprehensive error information:

#![allow(unused)]
fn main() {
pub struct ErrorDetails {
    pub error_type: String,
    pub error_code: u32,
    pub message: String,
    pub details: Option<String>,
    pub retry_possible: bool,
    pub suggested_actions: Vec<String>,
}
}

This API reference represents the complete current functionality of the Nondominium system based on actual codebase analysis. Function signatures and behaviors evolve with implementation improvements and community feedback.

🔄 Updates in Version 3.0 (2025-12-17)

Major Corrections:

  • PersonInput structure: Corrected avataravatar_url, removed non-existent location and tags fields
  • Function signatures: Updated all function signatures to match actual implementation
  • Error types: Replaced with actual error enums from the codebase

New Function Categories Added:

  • 🆕 Device Management (6 functions): Multi-device support with registration, deactivation, activity tracking
  • 🆕 Advanced Capability Sharing (4 functions): Grant revocation, validation, role-based access
  • 🆕 Role Promotion Workflow (3 functions): Request/approve/promotion with PPR integration

Missing Functions Now Included:

  • Person Management: Added 8 missing functions for agent-person relationships and promotion
  • Private Data: Added store_private_person_data and corrected get_agent_private_data signature
  • Capability System: Added grant_private_data_access, revoke_private_data_access, validation functions

Accuracy Improvements:

  • Capability Levels: Updated to reflect actual role types ("Simple Agent", "Accountable Agent", etc.)
  • Security Patterns: Corrected to match actual implementation patterns
  • Data Structures: All input/output structures now match actual code

Governance in nondominium

Overview

This document outlines the comprehensive governance system implemented in the nondominium project, built on Holochain and using ValueFlows vocabulary and patterns. The governance system spans across three zomes (zome_person, zome_resource, zome_governance) and provides the infrastructure for managing economic activities, validation, accountability, and reputation tracking in a decentralized sharing economy.

The governance system implements a complete agent lifecycle from Simple Agent through Accountable Agent to Primary Accountable Agent, with embedded governance rules, comprehensive validation schemes, structured Economic Processes, and a cryptographically-secured Private Participation Receipt (PPR) system for reputation tracking.

Core Governance Concepts

1. REA Pattern (Resources, Events, Agents)

The governance system is built on the ValueFlows REA (Resource, Event, Agent) ontology:

  • Agents: Individual persons with progressive capability levels (Simple → Accountable → Primary Accountable) who perform Economic Events affecting Economic Resources
  • Economic Events: Actions using VfAction enum that produce, modify, use, or transfer Economic Resources within structured Economic Processes
  • Economic Resources: Material and digital assets with embedded governance rules, managed lifecycle states, and custodian tracking
  • Economic Processes: Structured activities (Use, Transport, Storage, Repair) that transform Economic Resources or provide ecosystem services with role-based access control

2. Multi-Layered Ontology

The governance system operates across three levels as defined in ValueFlows:

  • Knowledge Level: Embedded governance rules, validation schemes, process requirements, and agent role definitions stored in ResourceSpecifications and process templates
  • Plan Level: Commitments with VfAction types, process initiation requests, and validation workflows linking agents to future economic activities
  • Observation Level: Completed Economic Events, fulfilled Claims, issued ValidationReceipts, and Private Participation Receipts (PPRs) providing cryptographically-signed reputation tracking

3. Agent Capability Progression

The governance system implements a progressive trust model through three agent types:

  • Simple Agent: Entry-level with general capability token, can create Resources and make first transaction
  • Accountable Agent: Validated agent with restricted capability token, can access Resources, validate others, and participate in specialized Economic Processes
  • Primary Accountable Agent (Custodian): Advanced agent with full capability token, holds physical custody of Resources, can validate role requests, and participate in dispute resolution

TODO (G1, REQ-GOV-16 — post-MVP): Agent capability progression currently models only individual human agents. Post-MVP: Collective, Project, Network, and Bot agents must be supported as governance actors. For Collective/Project/Network agents, governance actions are signed by the designated PrimaryAccountableAgent representative of the collective NDO. For Bot agents, governance actions are limited to declared capabilities in AgentEntityType::Bot { capabilities }. See governance.md §3.6 and §6.6.

Governance Structures

1. Validation System

The validation system implements comprehensive peer review and verification across all governance activities, supporting configurable validation schemes and role-based access control.

ValidationReceipt

#![allow(unused)]
fn main() {
pub struct ValidationReceipt {
    pub validator: AgentPubKey,  // TODO (G1, REQ-GOV-16 — post-MVP): replace with AgentContext.
                                 // Post-MVP, collective agent and bot validators must be supported
                                 // within their declared scope.
    pub validated_item: ActionHash,
    pub validation_type: String,
    pub approved: bool,
    pub notes: Option<String>,
    pub validated_at: Timestamp,
}
}

Purpose: Records validation decisions made by Accountable and Primary Accountable agents on resources, events, processes, agent promotions, and role assignments.

Validation Types:

  • resource_approval: Validating new Resources during first access events
  • process_validation: Validating Economic Process completions and outcomes
  • identity_verification: Confirming agent identities for Simple Agent promotion
  • role_assignment: Validating specialized role requests (Transport, Repair, Storage)
  • agent_promotion: Validating Simple Agent promotion to Accountable Agent
  • end_of_life_validation: Validating Resource end-of-life declarations

ResourceValidation

#![allow(unused)]
fn main() {
pub struct ResourceValidation {
    pub resource: ActionHash,
    pub validation_scheme: String,
    pub required_validators: u32,
    pub current_validators: u32,
    pub status: String,
    pub created_at: Timestamp,
    pub updated_at: Timestamp,
}
}

Purpose: Manages validation workflows for resources requiring multiple validators.

Validation Schemes:

  • "simple_majority": More than 50% of required validators must approve
  • "2-of-3": Exactly 2 out of 3 designated validators must approve
  • "N-of-M": N validators out of M designated validators must approve
  • "consensus": All required validators must approve

Status Values:

  • "pending": Validation in progress, awaiting validator responses
  • "approved": Sufficient validators have approved
  • "rejected": Validation failed or was explicitly rejected

2. Economic Event Tracking

EconomicEvent

#![allow(unused)]
fn main() {
pub struct EconomicEvent {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_inventoried_as: ActionHash,
    pub affects: ActionHash,
    pub resource_quantity: f64,
    pub event_time: Timestamp,
    pub note: Option<String>,
}
}

Purpose: Records all economic activities and resource flows in the system.

Governance Functions:

  • Audit Trail: Complete record of all economic activities
  • Provenance Tracking: Following resource flows forward and backward
  • Compliance Monitoring: Ensuring activities follow governance rules
  • Performance Analysis: Supporting accountability and transparency

3. Commitment and Claim System

Commitment

#![allow(unused)]
fn main() {
pub struct Commitment {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_inventoried_as: Option<ActionHash>,
    pub resource_conforms_to: Option<ActionHash>,
    pub input_of: Option<ActionHash>,
    pub due_date: Timestamp,
    pub note: Option<String>,
    pub committed_at: Timestamp,
}
}

Purpose: Represents agreed-upon future actions between agents.

Governance Functions:

  • Contractual Agreements: Formalizing promises between agents
  • Planning and Coordination: Supporting operational planning
  • Accountability: Creating clear expectations and obligations
  • Dispute Resolution: Providing basis for conflict resolution

Claim

#![allow(unused)]
fn main() {
pub struct Claim {
    pub fulfills: ActionHash,
    pub fulfilled_by: ActionHash,
    pub claimed_at: Timestamp,
    pub note: Option<String>,
}
}

Purpose: Links commitments to their fulfillment through economic events (public governance record).

Governance Functions:

  • Obligation Tracking: Monitoring fulfillment of commitments
  • Reciprocal Claims: Managing reciprocal obligations in exchanges
  • Dispute Resolution: Supporting claims and counter-claims
  • Performance Measurement: Tracking agent reliability and performance
  • PPR Generation: Triggers automatic Private Participation Receipt issuance for reputation tracking

3. Economic Process Management

The governance system manages structured Economic Processes that provide ecosystem services with role-based access control and comprehensive validation.

EconomicProcess

#![allow(unused)]
fn main() {
pub struct EconomicProcess {
    pub process_type: String,
    pub name: String,
    pub description: Option<String>,
    pub required_role: String,
    pub inputs: Vec<ActionHash>,
    pub outputs: Vec<ActionHash>,
    pub started_by: AgentPubKey,
    pub started_at: Timestamp,
    pub completed_at: Option<Timestamp>,
    pub location: Option<String>,
    pub status: ProcessStatus,
}
}

Process Types & Role Requirements:

  • Use: Core nondominium process accessible to all Accountable Agents
  • Transport: Material Resource movement between locations (requires Transport role)
  • Storage: Temporary Resource custody until new Agent requests access (requires Storage role)
  • Repair: Resource maintenance and restoration, may change Resource state (requires Repair role)

Process Status Values:

  • Planned: Process is planned but not yet started
  • InProgress: Process is currently active
  • Completed: Process finished successfully with validation
  • Suspended: Process temporarily paused
  • Cancelled: Process cancelled before completion
  • Failed: Process failed to complete successfully

Governance Functions:

  • Role Enforcement: Only agents with appropriate roles can initiate specialized processes
  • Process Chaining: Agents with multiple roles can chain actions (transport → repair → transport)
  • State Management: Proper Resource state transitions based on process type
  • Validation Requirements: Process completion validation according to process-specific criteria

4. Private Participation Receipt (PPR) System

The governance system implements a comprehensive reputation tracking mechanism through cryptographically-signed Private Participation Receipts stored as private entries.

PrivateParticipationClaim

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    // Standard ValueFlows fields
    pub fulfills: ActionHash,
    pub fulfilled_by: ActionHash,
    pub claimed_at: Timestamp,

    // PPR-specific extensions
    pub claim_type: ParticipationClaimType,
    pub counterparty: AgentPubKey,
    pub performance_metrics: PerformanceMetrics,
    pub bilateral_signature: CryptographicSignature,
    pub interaction_context: String,
    pub role_context: Option<String>,
    pub resource_reference: Option<ActionHash>,
}
}

PPR Issuance Categories:

Genesis Role - Network Entry:

  • ResourceContribution: Receipt for successfully creating and validating a Resource
  • NetworkValidation: Receipt for performing validation duties

Core Usage Role - Custodianship:

  • ResponsibleTransfer: Receipt for properly transferring Resource custody
  • CustodyAcceptance: Receipt for accepting Resource custody responsibly

Intermediate Roles - Specialized Services:

  • ServiceCommitmentAccepted: Receipt for accepting service commitments (Transport, Repair, Storage)
  • GoodFaithTransfer: Receipt for transferring Resource in good faith for service
  • ServiceFulfillmentCompleted: Receipt for completing services successfully
  • MaintenanceFulfillment, StorageFulfillment, TransportFulfillment: Service-specific completion receipts

Network Governance:

  • DisputeResolutionParticipation: Receipt for constructive participation in conflict resolution
  • GovernanceCompliance: Receipt for consistent adherence to governance protocols

Resource End-of-Life:

  • EndOfLifeDeclaration: Receipt for declaring Resource end-of-life
  • EndOfLifeValidation: Receipt for validating Resource end-of-life (enhanced security)

PPR Governance Principles:

  • Bi-directional Issuance: Every economic interaction generates exactly 2 receipts between participating agents
  • Cryptographic Integrity: All receipts are cryptographically signed for authenticity
  • Privacy Preservation: Stored as Holochain private entries accessible only to owning agent
  • Performance Tracking: Quantitative metrics (timeliness, quality, reliability, communication scores)
  • Reputation Derivation: Agents can calculate and selectively share reputation summaries

Agent Roles and Permissions

1. Simple Agent

  • Capabilities: General capability token
  • Permissions:
    • Search and discover nondominium resources
    • Create new nondominium resources
    • Complete identity verification
    • Make first transaction to become Accountable Agent

2. Accountable Agent

  • Capabilities: Restricted capability token
  • Permissions:
    • All Simple Agent permissions
    • Signal intent to access resources
    • Acquire specialized roles (Repair, Transport, Storage)
    • Validate other agents and resources
    • Participate in validation workflows

3. Primary Accountable Agent (Custodian)

  • Capabilities: Full capability token
  • Permissions:
    • All Accountable Agent permissions
    • Hold custody of material resources
    • Apply governance rules programmatically
    • Hold shared credentials with access conditions
    • Validate other agents for specialized roles

Governance Rules and Validation

1. Access Control Rules

  • Permissionless Access: Anyone can access resources under defined rules
  • Role-Based Access: Different permissions based on agent roles
  • Validation Requirements: Resources may require validation before access
  • Custody Transfer: Rules for transferring resource custody between agents

2. Validation Schemes

  • Simple Validation: Single validator approval
  • Multi-Signature: Multiple validators required
  • Majority Rule: Simple majority of validators
  • Consensus: All validators must approve

3. Governance Rule Types

  • Access Requirements: Who can access resources and under what conditions
  • Usage Limits: Restrictions on how resources can be used
  • Transfer Conditions: Rules for transferring resources between agents
  • Maintenance Obligations: Requirements for resource maintenance and care

TODO (post-MVP — temporal governance, governance.md §4.8): GovernanceRule entries must support an optional expires_at: Timestamp field for time-limited rules. Rules with an expiry become inactive after the deadline without requiring a manual update. The governance evaluation engine must skip expired rules during evaluate_transition.

TODO (post-MVP — configurable processes, governance.md §6.2): Economic Process types (Use, Transport, Storage, Repair) are currently hardcoded. Post-MVP, they must become configurable GovernanceProcess entries that communities can extend with custom process types, role requirements, and validation schemes. See governance.md §6.2.

TODO (post-MVP — EconomicAgreement rule type, ndo_prima_materia.md §6.6): Add EconomicAgreement to the GovernanceRuleType enum for Unyt Smart Agreement integration. When present, the governance zome requires a valid Unyt RAVE before approving state transitions for the configured trigger_actions. See ndo_prima_materia.md §6.6 and REQ-NDO-CS-09.

4. Role-Specific Validation Rules

Agents seeking to acquire specialized roles such as Transport, Repair, and Storage must undergo additional validation, as defined in the nondominium governance model (Sensorica nondominium):

  • Eligibility: Only Accountable Agents or Primary Accountable Agents may request these roles.
  • Validation Process:
    1. The agent submits a request to acquire a specialized role (Transport, Repair, or Storage).
    2. The request is reviewed by one or more existing Primary Accountable Agents who already hold the relevant role.
    3. The reviewing agents validate the applicant's credentials, history, and, if required, their identity and prior actions.
    4. Upon successful validation, a ValidationReceipt is issued, and the role is granted to the agent.
    5. The system may require a minimum number of validators (e.g., 2-of-3 or majority) depending on the resource or process sensitivity.
  • Criteria for Validation:
    • Demonstrated trustworthiness and accountability (e.g., successful prior transactions, positive validation history)
    • Sufficient knowledge or credentials for the requested role
    • Compliance with any additional governance rules or obligations (e.g., maintenance standards for Storage, safety for Transport)
  • Revocation: Roles can be revoked if the agent violates governance rules, as determined by a validation process involving other Primary Accountable Agents.

These validation rules ensure that only qualified and trusted agents can access and perform critical roles, supporting the self-governance, capture resistance, and accountability principles of the nondominium system.

Economic Actions (VfAction)

The governance system supports almost all ValueFlows economic actions:

Standard ValueFlows Actions

  • Transfer: Transfer ownership/custody
  • Move: Move resources between locations
  • Use: Use resources without consuming
  • Produce: Create/produce new resources
  • Work: Apply work/labor to resources
  • Modify: Modify existing resources
  • Combine: Combine multiple resources
  • Separate: Separate resources into multiple
  • Raise: Increase resource quantity/value
  • Lower: Decrease resource quantity/value
  • Cite: Reference or cite resources
  • Accept: Accept delivery or responsibility

nondominium-Specific Actions

  • InitialTransfer: First transfer by a Simple Agent
  • AccessForUse: Request access to use a resource
  • TransferCustody: Transfer custody (nondominium specific)

Economic Processes (VfAction)

The governance system supports the following Nondominium-specific processes:

  • Use: This is the core Nondominium process, a Resource is used by agents acording to its rules and in accordance to the network governance.
  • Transport: A material Economic Resource is moved from one location to another. The process is only accessible by Agents that hold credencials (capability tokens) for the Transport role. The Economic Resource is unchanged by the process.
  • Storage: A material Economic Resource is placed in storage until a new Accountable Agent request access. The process is only accessible by Agents that hold credencials (capability tokens) for the Storage role. The Economic Resource is unchanged by the process.
  • Repair: A material Economic Resource is repaired. The Economic Resource is changed by the process, perhaps from a broken state to a working/functional state.

These processes apply to material Economic Resources and are seen as part of ecosystem services, provided by agents in intermediate roles, gated by their credencials.

Dispute Resolution

Resolve disputes at the edge of the network, among agents that have interacted in the past and are about to interact. Avoid the creation of super users or admin roles. Disputes arise during custodian transfer events, for example when a Resource is stolen (made unavailable) by an agent, i.e. when a current custodian doesn't fulfill its role and responsibility vis avi the Nondominium Resource.

  • Any Accountable Agent makes a request to access a Resource listed as available.
  • The current Custodian of the said Resource is non responsive.
  • The said Accountable Agent raises a red flag, which triggers a dispute resolution process.
  • The Resource metadata can be access to reveal its past custodian transfers (transactions).
  • The last agents, up to the last fourth, that have interacted in the past with the current Custodian are notified to participate in the dispute resolution process. All these agents must have access to the current Custodian private data, which allows them to physically locate the person in the role of current Custodian. This can trigger legal procedures, since the current Custodian has committed to legal obligations (contract) when has acquired the Resource. At least one of the said agents can pursue the dispute resolution process.
  • If none of these agents want to pursue the dispute resolution process their profile is marked as having missed to fulfill their responsibility of defending or protecting the Nondomonium network, which is a data entry in their reputation metadata.

Governance Workflows

1. Resource Creation and Validation

  1. Simple or Accountable Agent creates new nondominium resource
  2. Resource enters "pending_validation" state
  3. Accountable Agents validate resource
  4. Resource becomes available for access

2. Access Request and Approval

  1. Accountable Agent signals intent to access resource
  2. Primary Accountable Agent (custodian) reviews request
  3. Governance rules are applied programmatically
  4. Access is granted or denied based on rules and validation

3. Custody Transfer

Custodianship Transfer Flow

  1. Current Primary Accountable Agent (custodian) initiates transfer
  2. New custodian accepts responsibility
  3. Transfer event is recorded
  4. Links are updated to reflect new custody

4. Validation Workflows

  1. Resource requires validation
  2. Validation scheme determines required validators
  3. Validators review and approve/reject
  4. Validation status is updated
  5. Resource becomes available or rejected

5. Agent Onboarding and Progression

Simple Agent to Accountable Agent Promotion

  1. Simple Agent creates their first nondominium Resource with embedded governance rules
  2. Simple Agent initiates first transaction (Initial Transfer) to interested Accountable Agent
  3. Receiving Accountable Agent validates both the Resource and the Simple Agent's identity (private entry access)
  4. Upon successful validation:
    • ValidationReceipt issued for both Resource and Agent promotion
    • Simple Agent promoted to Accountable Agent with restricted capability token
    • Bi-directional PPRs issued (ResourceContribution + NetworkValidation)
  5. Resource state changes from "pending_validation" to "validated"

Specialized Role Acquisition

  1. Accountable Agent requests specialized role (Transport, Repair, Storage)
  2. Request reviewed by existing Primary Accountable Agents holding the relevant role
  3. Validators assess credentials, history, and compliance with role requirements
  4. ValidationReceipt issued upon approval, role granted
  5. PPRs issued for validation participation

6. Economic Process Workflows

Process Initiation and Completion

  1. Accountable Agent with appropriate role initiates Economic Process
  2. Commitment created with specific VfAction and process details
  3. Process status tracked (Planned → InProgress → Completed)
  4. Process completion validated according to process-specific requirements
  5. Economic Event recorded upon completion
  6. Claim created linking Commitment to Economic Event
  7. Bi-directional PPRs automatically issued based on process type

Process Chaining Example (Transport + Repair)

  1. Agent with Transport + Repair roles creates single Commitment for chained actions
  2. Process initiated: receive → transport → repair → transport → deliver
  3. Internal process status updates managed by executing agent
  4. Final delivery triggers completion validation
  5. Bi-directional PPRs issued: "Transport + Repair fulfillment completed" + "custody acceptance"

7. Resource End-of-Life Management

  1. Agent declares Resource end-of-life with evidence documentation
  2. Multiple expert validators required (minimum 2-3, depending on Resource value)
  3. Past custodians notified, challenge period initiated (7-14 days)
  4. Expert validators review evidence and Resource condition
  5. If no challenges raised, Resource moved to final disposal/storage
  6. Enhanced PPRs issued with strict validation requirements
  7. Resource state updated to "decommissioned"

8. Dispute Resolution

  1. Accountable Agent requests access to available Resource
  2. Current custodian becomes non-responsive or refuses access improperly
  3. Requesting agent raises dispute flag
  4. System identifies last four agents who interacted with current custodian
  5. Past interaction partners notified (must have custodian's private data access)
  6. At least one past partner must pursue dispute resolution
  7. Failure to participate impacts reputation through negative PPR entries
  8. Resolution process can trigger legal procedures based on custodian contracts

Implementation Details

1. Zome Structure

The governance system spans across three integrated zomes:

zome_person

  • Entry Types: Person, PrivatePersonData, PersonRole, DataAccessGrant, DataAccessRequest
  • Functions: Agent identity management, role assignment, reputation tracking, private data sharing
  • Capabilities: PPR storage and retrieval, reputation summary calculation

zome_resource

  • Entry Types: ResourceSpecification, EconomicResource, GovernanceRule, EconomicProcess, ProcessStatus
  • Functions: Resource lifecycle management, process initiation and completion, embedded rule enforcement
  • Capabilities: Process chaining, role-based access control, state management

zome_governance

  • Entry Types: ValidationReceipt, EconomicEvent, Commitment, Claim, ResourceValidation, PrivateParticipationClaim
  • Functions: Validation workflows, PPR issuance, cross-zome validation, dispute resolution support
  • Capabilities: Multi-signature validation, cryptographic signature verification, reputation derivation

2. Cross-Zome Integration

  • Role Validation: zome_person validates agent roles before zome_resource allows process initiation
  • Governance Enforcement: zome_resource calls zome_governance for validation and PPR issuance
  • Identity Verification: zome_governance accesses zome_person private entries for agent validation
  • Transactional Integrity: All economic interactions span multiple zomes with atomic operations

3. Security and Privacy

  • Capability-based security: Progressive access control through capability tokens (general → restricted → full)
  • Role-based access control: Economic Processes enforce specialized role requirements with validated credentials
  • Private entries: Sensitive information (PII, PPRs) stored as Holochain private entries in agent's source chain
  • Cryptographic integrity: All PPRs cryptographically signed for authenticity and non-repudiation
  • Selective disclosure: Agents control sharing of private data and reputation summaries
  • Audit trails: Complete record of all economic activities, validations, and governance actions
  • End-of-life security: Enhanced validation requirements prevent resource theft through false end-of-life claims

Governance Principles

1. Decentralized Authority

  • No single point of control or super-users in the network
  • Governance distributed among network participants through progressive trust model
  • Rules embedded in ResourceSpecifications and enforced programmatically
  • Edge-based dispute resolution involving recent interaction partners

2. Transparency and Accountability

  • All economic activities recorded as Economic Events with complete audit trails
  • Public governance rules and validation schemes machine-readable and transparent
  • Clear validation processes with cryptographically-signed ValidationReceipts
  • Comprehensive reputation tracking through Private Participation Receipts

3. Inclusive Participation

  • Permissionless entry under defined governance rules (Simple Agent level)
  • Progressive capability model enabling advancement through validated participation
  • Multiple specialized roles supporting diverse ecosystem services
  • Stakeholder-driven governance through peer validation and role-based access

4. Capture Resistance

  • Resources cannot be monopolized due to embedded governance rules
  • Distributed validation prevents capture by single actors
  • End-of-life security measures prevent resource theft
  • Multi-reviewer validation schemes ensure no single point of failure

5. Privacy-Preserving Accountability

  • Private Participation Receipts enable reputation without compromising privacy
  • Selective disclosure allows agents to control information sharing
  • Cryptographic signatures ensure authenticity while preserving autonomy
  • Private entries protect sensitive information while enabling governance

6. Process-Aware Governance

  • Structured Economic Processes with role-based access control
  • Process chaining enables complex service delivery
  • State management ensures proper Resource lifecycle tracking
  • Performance metrics support quality assurance and continuous improvement

Future Enhancements

Phase 2 Enhancements (Building on Current Foundation)

  • Advanced Governance Rule Engine: Conditional logic and smart contract-like governance rules
  • Automated Validation Workflows: AI-assisted validation and anomaly detection
  • Enhanced Dispute Resolution: Formal mediation protocols and reputation-weighted resolution
  • Cross-Network Resource Sharing: Federation with other nondominium networks
  • Economic Incentive Mechanisms: Value accounting and contribution-based incentives

Phase 3 Enhancements (Advanced Network Features)

  • Integration with External Governance: Legal system integration and compliance frameworks
  • Advanced Reputation Algorithms: Machine learning-based trust prediction and recommendation systems
  • Scalable Validation Schemes: Optimized validation for large-scale networks
  • Multi-Network Identity: Cross-platform agent identity and reputation portability
  • Automated Compliance Checking: Real-time governance rule compliance monitoring

10. Governance-as-Operator Architecture Implementation

The nondominium governance system implements a modular architecture following REQ-ARCH-07, separating data management from business logic enforcement:

This modular design enables:

  • Independent evolution of resource data structures and governance rules
  • Swappable governance schemes for different resource types
  • Comprehensive testing of governance logic in isolation
  • Clear separation of concerns between data persistence and business rule enforcement

References

Governance-as-Operator Architecture Specification

1. Overview

The governance-as-operator architecture establishes a clear separation between data management and business logic enforcement in the nondominium system. This design enables independent evolution of resource data structures and governance rules, providing a foundation for modular, maintainable, and extensible decentralized resource management.

1.1 Core Principles

  • Resource Zome: Pure data model responsible for resource specification management, economic resource lifecycle, and data persistence
  • Governance Zome: State transition operator responsible for evaluating governance rules, validating state changes, and generating economic events
  • Cross-Zome Interface: Well-defined communication protocol for state transition requests and decisions
  • Event-Driven Architecture: All state changes generate corresponding economic events for audit trails and reputation tracking

1.2 Business Benefits

  • Modularity: Independent evolution of data structures and governance logic
  • Testability: Governance logic can be unit tested independently of data management
  • Swappability: Different governance schemes can be applied to the same resource types
  • Maintainability: Clear separation of concerns reduces system complexity

1.3 Related specifications (post-MVP NDO & integrations)

Typed governance evaluation is specified to grow toward a single evaluate_transition_request path that can read:

  • Economic closure (Unyt): endorsed EconomicAgreement rules, transition rave_hash, RAVE validation — documentation/requirements/ndo_prima_materia.md §6.6, REQ-NDO-CS-07–CS-11; design narrative in documentation/requirements/post-mvp/unyt-integration.md.
  • Cross-app identity (Flowsta): IdentityVerification (or equivalent) rules and FlowstaIdentity slot checks per REQ-NDO-CS-14–CS-15 — ndo_prima_materia.md §6.7; documentation/requirements/post-mvp/flowsta-integration.md.
  • Agent / resource ontology context: documentation/archives/governance.md §3.7 (parallel Unyt vs Flowsta operator pattern).

MVP code may still use separate coordinator entry points (e.g. validate_agent_for_promotion); the target architecture folds these into unified transition evaluation as the generic NDO matures.

2. Cross-Zome Interface Specifications

2.1 State Transition Request

The primary interface for resource state changes follows this structure:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceTransitionRequest {
    /// The action the requesting agent wants to perform
    pub action: VfAction,
    /// Current state of the resource being modified
    pub resource: EconomicResource,
    /// Agent requesting the state change
    /// TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
    /// For collective/bot agents, the signing authority is the designated operator key.
    /// The governance evaluation must resolve AgentContext → effective AgentPubKey
    /// before capability token validation.
    pub requesting_agent: AgentPubKey,
    /// Additional context for the transition
    pub context: TransitionContext,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TransitionContext {
    /// Target location for transport/move actions
    pub target_location: Option<String>,
    /// Quantity change for produce/consume actions
    pub quantity_change: Option<f64>,
    /// Target custodian for transfer actions
    /// TODO (G1, REQ-AGENT-02): replace Option<AgentPubKey> with Option<AgentContext> post-MVP
    /// to support custody transfer to Collective, Project, Network, and Bot agents.
    /// AgentContext = union of AgentPubKey | CollectiveAgentHash.
    pub target_custodian: Option<AgentPubKey>,
    /// Process notes and observations
    pub process_notes: Option<String>,
    /// Associated economic process if applicable
    pub process_context: Option<ActionHash>,
}
// TODO (G2, REQ-AGENT-03, REQ-AGENT-05): extend governance evaluation to query AffiliationState.
// The validate_agent_permissions function in GovernanceEngine must be extended post-MVP to:
//   1. Cross-zome call zome_person to retrieve the requesting agent's AffiliationRecord entries
//   2. Derive the agent's current AffiliationState (UnaffiliatedStranger | CloseAffiliate |
//      ActiveAffiliate | CoreAffiliate | InactiveAffiliate)
//   3. Compare AffiliationState against GovernanceRule.rule_data["min_affiliation"] condition
// This enables affiliation-gated resource access without storing affiliation as a declared field.
}

2.2 State Transition Result

The governance zome returns detailed results for each transition request:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct GovernanceTransitionResult {
    /// Whether the transition was approved
    pub success: bool,
    /// Updated resource state (if approved)
    pub new_resource_state: Option<EconomicResource>,
    /// Generated economic event for audit trail
    pub economic_event: Option<EconomicEvent>,
    /// Validation receipts from governance evaluation
    pub validation_receipts: Vec<ValidationReceipt>,
    /// Detailed reasons for rejection (if applicable)
    pub rejection_reasons: Option<Vec<String>>,
    /// Required next steps or additional validation needed
    pub next_steps: Option<Vec<String>>,
}
}

2.3 Resource State Change

Detailed resource state changes tracked by the system:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ResourceStateChange {
    /// Hash of the original resource state
    pub original_resource_hash: ActionHash,
    /// Hash of the new resource state
    pub new_resource_hash: ActionHash,
    /// Action that triggered the state change
    pub triggering_action: VfAction,
    /// Agent who initiated the change
    /// TODO (G1, REQ-GOV-16): replace with AgentContext post-MVP.
    pub initiated_by: AgentPubKey,
    /// Governance decision that authorized the change
    pub governance_decision: GovernanceDecision,
    /// Economic event recording the change
    pub economic_event: EconomicEvent,
    /// Timestamp when the change occurred
    pub changed_at: Timestamp,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceDecision {
    /// Whether the change was approved
    pub approved: bool,
    /// Governance rules that were evaluated
    pub evaluated_rules: Vec<ActionHash>,
    /// Role-based permission check results
    pub role_permissions: Vec<RolePermissionResult>,
    /// Additional validation constraints
    pub validation_constraints: Vec<ValidationConstraint>,
    /// Decision rationale
    pub rationale: String,
}
}

TODO (post-MVP — governance weight dampening, governance.md §6.4): When governance_weight(agent) incorporates unyt_credit_capacity from the Unyt credit system, apply logarithmic dampening (e.g., log(1 + credit_capacity)) to prevent a feedback loop where high reputation → high credit → higher governance weight → even higher reputation. Without dampening, early participants accumulate runaway influence. See governance.md §6.4.

3. Modular Design Patterns

3.1 Pure Function Governance

Governance logic is implemented as pure functions that evaluate state transitions without side effects:

#![allow(unused)]
fn main() {
impl GovernanceEngine {
    /// Pure function: evaluates state transition without side effects
    pub fn evaluate_transition(
        request: GovernanceTransitionRequest,
        rules: Vec<GovernanceRule>,
        agent_permissions: AgentPermissions,
    ) -> ExternResult<TransitionEvaluation> {

        // 1. Validate agent permissions
        let permission_result = validate_agent_permissions(
            &request.requesting_agent,
            &request.action,
            &agent_permissions,
        )?;

        // 2. Evaluate applicable governance rules
        let rule_results = evaluate_governance_rules(
            &request.resource,
            &request.action,
            &rules,
        )?;

        // 3. Check state transition validity
        let state_validity = validate_state_transition(
            &request.resource.state,
            &request.action,
            &request.context,
        )?;

        // 4. Combine all evaluations into final decision
        Ok(TransitionEvaluation {
            allowed: permission_result.allowed && rule_results.all_passed && state_validity.valid,
            new_state: calculate_new_state(&request.resource, &request.action, &request.context)?,
            required_events: generate_required_events(&request.action),
            validation_notes: combine_validation_notes(permission_result, rule_results, state_validity),
        })
    }
}
}

3.2 State Management Isolation

Resource state management is isolated from governance evaluation:

#![allow(unused)]
fn main() {
// Resource zome: manages state but delegates decision making
impl ResourceManager {
    pub fn request_state_change(
        &self,
        request: GovernanceTransitionRequest,
    ) -> ExternResult<GovernanceTransitionResult> {

        // 1. Get current resource state
        let current_resource = self.get_resource(request.resource_hash)?;

        // 2. Call governance operator for decision
        let governance_result = call GovernanceZome::evaluate_transition(
            GovernanceTransitionRequest {
                action: request.action,
                resource: current_resource,
                requesting_agent: request.requesting_agent,
                context: request.context,
            }
        )?;

        // 3. Apply state change if approved
        if governance_result.success {
            if let Some(new_state) = governance_result.new_resource_state {
                self.update_resource_state(new_state)?;
            }

            if let Some(event) = governance_result.economic_event {
                self.record_economic_event(event)?;
            }
        }

        Ok(governance_result)
    }
}
}

3.3 Event Generation Patterns

All state changes generate corresponding economic events:

#![allow(unused)]
fn main() {
impl EventGenerator {
    pub fn generate_state_change_event(
        action: VfAction,
        resource_before: &EconomicResource,
        resource_after: Option<&EconomicResource>,
        requesting_agent: AgentPubKey,
        governance_decision: &GovernanceDecision,
    ) -> ExternResult<EconomicEvent> {

        Ok(EconomicEvent {
            action,
            provider: resource_before.custodian,
            receiver: requesting_agent,
            resource_inventoried_as: resource_before.conforms_to,
            affects: get_action_hash(resource_before)?,
            resource_quantity: calculate_quantity_change(resource_before, resource_after)?,
            event_time: sys_time()?,
            note: Some(format!(
                "State change approved: {}",
                governance_decision.rationale
            )),
        })
    }
}
}

4. Implementation Guidelines

4.1 Cross-Zome Call Patterns

Efficient cross-zome communication patterns:

#![allow(unused)]
fn main() {
// Resource zome: synchronous governance evaluation
#[hdk_extern]
pub fn request_resource_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult> {

    // 1. Prepare cross-zome call
    let governance_input = request.clone();

    // 2. Call governance zome
    let result: GovernanceTransitionResult = call(
        CallTargetCell::Local,
        "zome_gouvernance",
        "evaluate_state_transition".into(),
        None,
        &governance_input,
    )?;

    // 3. Handle result and update local state
    if result.success {
        update_resource_state(result.new_resource_state)?;
        create_economic_event(result.economic_event)?;
    }

    Ok(result)
}

// Governance zome: pure function evaluation
#[hdk_extern]
pub fn evaluate_state_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult> {

    // 1. Load applicable governance rules
    let rules = get_applicable_rules(&request.resource)?;

    // 2. Evaluate using pure function
    let evaluation = GovernanceEngine::evaluate_transition(
        request,
        rules,
        get_agent_permissions(&request.requesting_agent)?,
    )?;

    // 3. Generate economic event if approved
    let economic_event = if evaluation.allowed {
        Some(generate_economic_event(&request, &evaluation)?)
    } else {
        None
    };

    Ok(GovernanceTransitionResult {
        success: evaluation.allowed,
        new_resource_state: evaluation.new_state,
        economic_event,
        validation_receipts: evaluation.validation_receipts,
        rejection_reasons: evaluation.rejection_reasons,
        next_steps: evaluation.next_steps,
    })
}
}

4.2 Error Handling Strategies

Robust error handling across zome boundaries:

#![allow(unused)]
fn main() {
#[derive(Debug, Serialize, Deserialize)]
pub enum GovernanceError {
    PermissionDenied(String),
    RuleViolation(String),
    InvalidStateTransition(String),
    ResourceNotFound(String),
    CrossZomeCallFailed(String),
}

// Resource zome error handling
pub fn handle_governance_result(
    result: Result<GovernanceTransitionResult, GovernanceError>
) -> ExternResult<()> {
    match result {
        Ok(transition_result) => {
            if transition_result.success {
                // Apply approved changes
                apply_state_changes(transition_result)?;
            } else {
                // Log rejection for audit trail
                log_governance_rejection(transition_result)?;
            }
            Ok(())
        }
        Err(GovernanceError::CrossZomeCallFailed(msg)) => {
            // Log error but don't fail completely
            warn!("Governance evaluation failed: {}", msg);
            Err(WasmError::Guest(format!("Governance unavailable: {}", msg)).into())
        }
        Err(error) => {
            // Log other errors
            error!("Governance error: {:?}", error);
            Err(WasmError::Guest(error.to_string()).into())
        }
    }
}
}

4.3 Validation Separation

Clear separation between data validation and governance validation:

#![allow(unused)]
fn main() {
// Resource zome: data integrity validation
impl ResourceValidator {
    pub fn validate_resource_data(
        resource: &EconomicResource,
    ) -> ExternResult<()> {
        // Pure data validation
        if resource.quantity <= 0.0 {
            return Err(ResourceError::InvalidQuantity.into());
        }

        if resource.unit.trim().is_empty() {
            return Err(ResourceError::InvalidUnit.into());
        }

        // Check specification exists
        let _spec = get(resource.conforms_to, GetOptions::default())?
            .ok_or(ResourceError::SpecificationNotFound)?;

        Ok(())
    }
}

// Governance zome: business rule validation
impl GovernanceValidator {
    pub fn validate_governance_rules(
        request: &GovernanceTransitionRequest,
        rules: &[GovernanceRule],
    ) -> ExternResult<Vec<RuleValidationResult>> {
        rules.iter()
            .map(|rule| evaluate_rule(request, rule))
            .collect()
    }
}
}

5. Testing Strategy

5.1 Unit Testing Governance Logic

Isolated testing of governance evaluation logic:

#![allow(unused)]
fn main() {
#[cfg(test)]
mod governance_tests {
    use super::*;

    #[test]
    fn test_transfer_approval() {
        let request = create_transfer_request();
        let rules = create_test_rules();
        let permissions = create_test_permissions();

        let result = GovernanceEngine::evaluate_transition(
            request,
            rules,
            permissions,
        ).unwrap();

        assert!(result.allowed);
        assert!(result.new_state.is_some());
        assert!(!result.validation_receipts.is_empty());
    }

    #[test]
    fn test_unauthorized_role_rejection() {
        let request = create_repair_request();
        let permissions = AgentPermissions {
            roles: vec!["Transport".to_string()], // No Repair role
            ..Default::default()
        };

        let result = GovernanceEngine::evaluate_transition(
            request,
            vec![],
            permissions,
        ).unwrap();

        assert!(!result.allowed);
        assert!(result.rejection_reasons.unwrap().iter()
            .any(|reason| reason.contains("Insufficient role")));
    }
}
}

5.2 Cross-Zome Integration Testing

Testing interaction between resource and governance zomes:

#![allow(unused)]
fn main() {
#[cfg(test)]
mod cross_zome_tests {
    use super::*;

    #[test]
    fn test_end_to_end_state_transition() {
        // Setup test environment
        let (conductor_config, _dna_file) = setup_test_environment().await;
        let alice_agent = setup_agent(conductor_config.clone()).await;
        let bob_agent = setup_agent(conductor_config).await;

        // Create test resource
        let resource_hash = alice_agent.call::<CreateResourceOutput>(
            "create_economic_resource",
            create_test_resource_input(),
        ).await?.resource_hash;

        // Request state change
        let transition_request = GovernanceTransitionRequest {
            action: VfAction::Transfer,
            resource: get_resource(resource_hash).await?,
            requesting_agent: bob_agent.agent_pub_key().clone(),
            context: TransitionContext {
                target_custodian: Some(bob_agent.agent_pub_key().clone()),
                ..Default::default()
            },
        };

        // Process transition
        let result = alice_agent.call::<GovernanceTransitionResult>(
            "request_resource_transition",
            transition_request,
        ).await?;

        assert!(result.success);
        assert!(result.economic_event.is_some());
    }
}
}

5.3 Mock Governance for Resource Testing

Mock governance for isolated resource zome testing:

#![allow(unused)]
fn main() {
pub struct MockGovernanceZome {
    approval_mode: ApprovalMode,
}

#[derive(Debug)]
pub enum ApprovalMode {
    ApproveAll,
    RejectAll,
    RoleBased(Vec<String>),
    Conditional(Box<dyn Fn(&GovernanceTransitionRequest) -> bool>),
}

impl MockGovernanceZome {
    pub fn evaluate_transition(
        &self,
        request: GovernanceTransitionRequest,
    ) -> ExternResult<GovernanceTransitionResult> {
        let approved = match &self.approval_mode {
            ApprovalMode::ApproveAll => true,
            ApprovalMode::RejectAll => false,
            ApprovalMode::RoleBased(allowed_roles) => {
                // Mock role checking logic
                false // Simplified for example
            }
            ApprovalMode::Conditional(validator) => validator(&request),
        };

        Ok(GovernanceTransitionResult {
            success: approved,
            new_resource_state: if approved {
                Some(calculate_new_state(&request))
            } else {
                None
            },
            economic_event: if approved {
                Some(generate_test_event(&request))
            } else {
                None
            },
            validation_receipts: vec![],
            rejection_reasons: if approved {
                None
            } else {
                Some(vec!["Mock rejection".to_string()])
            },
            next_steps: None,
        })
    }
}
}

6. Performance Considerations

6.1 Cross-Zome Call Optimization

Strategies for efficient cross-zome communication:

#![allow(unused)]
fn main() {
// Batch multiple state changes
#[hdk_extern]
pub fn batch_state_transitions(
    requests: Vec<GovernanceTransitionRequest>,
) -> ExternResult<Vec<GovernanceTransitionResult>> {

    // Group requests by governance rules needed
    let mut grouped_requests = HashMap::new();
    for request in requests {
        let rule_set = determine_required_rules(&request);
        grouped_requests.entry(rule_set)
            .or_insert_with(Vec::new)
            .push(request);
    }

    // Process each group with single governance call
    let mut results = Vec::new();
    for (rule_set, group_requests) in grouped_requests {
        let group_results = evaluate_transition_group(rule_set, group_requests)?;
        results.extend(group_results);
    }

    Ok(results)
}
}

6.2 State Management Efficiency

Efficient state management patterns:

#![allow(unused)]
fn main() {
// Lazy evaluation of governance rules
pub struct LazyRuleEvaluator {
    cached_rules: LruCache<String, Vec<GovernanceRule>>,
    rule_loader: Box<dyn Fn(&str) -> ExternResult<Vec<GovernanceRule>>>,
}

impl LazyRuleEvaluator {
    pub fn get_rules_for_resource(
        &mut self,
        resource_spec: &ActionHash,
    ) -> ExternResult<&Vec<GovernanceRule>> {
        let cache_key = format!("{}", resource_spec);

        if !self.cached_rules.contains(&cache_key) {
            let rules = (self.rule_loader)(&cache_key)?;
            self.cached_rules.put(cache_key.clone(), rules);
        }

        Ok(self.cached_rules.get(&cache_key).unwrap())
    }
}
}

This architecture specification provides the technical foundation for implementing the governance-as-operator pattern, ensuring clear separation of concerns while maintaining efficient cross-zome communication and comprehensive state management.

Governance Operator Implementation Guide

1. Technical Architecture Overview

1.1 Resource Zome Data Model

The resource zome operates as a pure data model responsible for:

  • Resource specification management
  • Economic resource lifecycle operations
  • Data persistence and retrieval
  • Discovery and query functions

Key Characteristics:

  • No business logic or validation rules
  • Pure CRUD operations on data structures
  • Cross-zome calls for governance decisions
  • Event generation after approved changes

1.2 Governance Zome Operator Functions

The governance zome operates as a state transition operator responsible for:

  • Evaluating governance rules and policies
  • Validating agent permissions and roles
  • Authorizing or rejecting state transitions
  • Generating economic events for audit trails

Key Characteristics:

  • Pure function evaluation logic
  • No direct data persistence
  • Comprehensive validation frameworks
  • Integration with reputation system

1.3 Cross-Zome Communication Patterns

Communication follows the operator pattern with these key patterns:

  1. Request-Evaluate-Apply Pattern

    • Resource zome requests state change
    • Governance zome evaluates and decides
    • Resource zome applies approved changes
  2. Event-Driven Auditing

    • Every state transition generates economic events
    • Complete audit trail maintained
    • Reputation system integration
  3. Error Handling Propagation

    • Clear error boundaries between zomes
    • Graceful degradation when governance unavailable
    • Comprehensive error reporting

2. Implementation Details

2.1 Cross-Zome Interface Implementation

Resource Zome Implementation:

#![allow(unused)]
fn main() {
use crate::ResourceError;
use hdk::prelude::*;
use zome_resource_integrity::*;
use zome_gouvernance_integrity::*;

// Cross-zome interface structures
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceTransitionRequest {
    pub action: VfAction,
    pub resource: EconomicResource,
    pub requesting_agent: AgentPubKey,
    pub context: TransitionContext,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GovernanceTransitionResult {
    pub success: bool,
    pub new_resource_state: Option<EconomicResource>,
    pub economic_event: Option<EconomicEvent>,
    pub validation_receipts: Vec<ValidationReceipt>,
    pub rejection_reasons: Option<Vec<String>>,
    pub next_steps: Option<Vec<String>>,
}

// Primary interface function for resource state changes
#[hdk_extern]
pub fn request_resource_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult> {

    // 1. Validate input data integrity
    validate_transition_request(&request)?;

    // 2. Call governance zome for evaluation
    let governance_result = call(
        CallTargetCell::Local,
        "zome_gouvernance",
        "evaluate_state_transition".into(),
        None,
        &request,
    )?;

    // 3. Handle governance decision
    match governance_result.success {
        true => {
            // 3a. Apply approved state changes
            if let Some(new_state) = governance_result.new_resource_state.clone() {
                update_resource_state(new_state)?;
            }

            // 3b. Record economic event
            if let Some(event) = governance_result.economic_event.clone() {
                create_economic_event(event)?;
            }

            // 3c. Update state transition links
            update_state_transition_links(&request, &governance_result)?;

            Ok(governance_result)
        }
        false => {
            // 4a. Log rejection for audit trail
            log_governance_rejection(&request, &governance_result)?;

            // 4b. Return decision to caller
            Ok(governance_result)
        }
    }
}

// Validate transition request before governance evaluation
fn validate_transition_request(
    request: &GovernanceTransitionRequest,
) -> ExternResult<()> {
    // Validate resource exists
    let _resource_record = get(
        get_action_hash(&request.resource)?,
        GetOptions::default()
    )?.ok_or(ResourceError::EconomicResourceNotFound(
        "Resource not found".to_string()
    ))?;

    // Validate agent permissions basic checks
    let agent_info = agent_info()?;
    if agent_info.agent_initial_pubkey != request.requesting_agent {
        return Err(ResourceError::NotAuthor.into());
    }

    // Validate action compatibility with resource state
    validate_action_state_compatibility(&request.action, &request.resource.state)?;

    Ok(())
}

// Helper function to get action hash from resource
fn get_action_hash(resource: &EconomicResource) -> ExternResult<ActionHash> {
    // This would typically be stored alongside the resource
    // For implementation, this depends on how resources are tracked
    todo!("Implement action hash retrieval")
}

// Validate that action is compatible with current resource state
fn validate_action_state_compatibility(
    action: &VfAction,
    current_state: &ResourceState,
) -> ExternResult<()> {
    match (current_state, action) {
        (ResourceState::Retired, _) => {
            return Err(ResourceError::InvalidInput(
                "Cannot perform actions on retired resource".to_string()
            ).into());
        }
        (ResourceState::Reserved, VfAction::Use) => {
            return Err(ResourceError::InvalidInput(
                "Cannot use reserved resource".to_string()
            ).into());
        }
        _ => Ok(()), // Valid combination
    }
}
}

Governance Zome Implementation:

#![allow(unused)]
fn main() {
use hdk::prelude::*;
use zome_gouvernance_integrity::*;

// Governance evaluation engine
#[hdk_extern]
pub fn evaluate_state_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult> {

    // 1. Load applicable governance rules
    let governance_rules = load_applicable_rules(&request.resource)?;

    // 2. Check agent permissions and roles
    let agent_permissions = check_agent_permissions(
        &request.requesting_agent,
        &request.action,
    )?;

    // 3. Evaluate state transition using pure function
    let evaluation = GovernanceEngine::evaluate_transition(
        &request,
        &governance_rules,
        &agent_permissions,
    )?;

    // 4. Generate economic event if approved
    let economic_event = if evaluation.allowed {
        Some(generate_economic_event(&request, &evaluation)?)
    } else {
        None
    };

    // 5. Generate validation receipts
    let validation_receipts = generate_validation_receipts(
        &request,
        &evaluation,
    )?;

    // 6. Return comprehensive result
    Ok(GovernanceTransitionResult {
        success: evaluation.allowed,
        new_resource_state: evaluation.new_state,
        economic_event,
        validation_receipts,
        rejection_reasons: evaluation.rejection_reasons,
        next_steps: evaluation.next_steps,
    })
}

// Load governance rules applicable to resource and action
fn load_applicable_rules(
    resource: &EconomicResource,
) -> ExternResult<Vec<GovernanceRule>> {
    // 1. Get resource specification
    let spec_record = get(
        resource.conforms_to,
        GetOptions::default()
    )?.ok_or(GovernanceError::ResourceSpecificationNotFound)?;

    let spec: ResourceSpecification = spec_record.entry().ok_or(
        GovernanceError::InvalidEntryType
    )?;

    // 2. Get governance rules from specification
    let mut rules = Vec::new();
    for rule_hash in spec.governance_rules {
        let rule_record = get(rule_hash, GetOptions::default())?
            .ok_or(GovernanceError::GovernanceRuleNotFound)?;
        let rule: GovernanceRule = rule_record.entry().ok_or(
            GovernanceError::InvalidEntryType
        )?;
        rules.push(rule);
    }

    // 3. Add system-wide rules
    rules.extend(load_system_governance_rules()?);

    Ok(rules)
}

// Check agent permissions and role requirements
fn check_agent_permissions(
    agent_pubkey: &AgentPubKey,
    action: &VfAction,
) -> ExternResult<AgentPermissions> {
    // 1. Get agent profile and roles
    let agent_profile = get_agent_profile(agent_pubkey)?;
    let agent_roles = get_agent_roles(agent_pubkey)?;

    // 2. Check basic permissions
    let has_basic_access = agent_roles.iter()
        .any(|role| role.role_name == "Accountable Agent" || role.role_name == "Simple Agent");

    if !has_basic_access {
        return Ok(AgentPermissions {
            allowed: false,
            required_roles: vec!["Accountable Agent".to_string()],
            role_status: "Insufficient role".to_string(),
        });
    }

    // 3. Check role-specific requirements
    let required_roles = get_required_roles_for_action(action);
    let has_required_roles = required_roles.iter().all(|required_role| {
        agent_roles.iter().any(|role| role.role_name == *required_role)
    });

    Ok(AgentPermissions {
        allowed: has_required_roles,
        required_roles,
        role_status: if has_required_roles {
            "Authorized".to_string()
        } else {
            "Insufficient role".to_string()
        },
    })
}

// Get roles required for specific actions
fn get_required_roles_for_action(action: &VfAction) -> Vec<String> {
    match action {
        VfAction::Use => vec!["Accountable Agent".to_string()],
        VfAction::Transfer => vec!["Accountable Agent".to_string()],
        VfAction::TransferCustody => vec!["Accountable Agent".to_string()],
        VfAction::InitialTransfer => vec!["Simple Agent".to_string()],
        VfAction::Move | VfAction::Work => vec!["Transport".to_string()],
        VfAction::Modify => vec!["Repair".to_string()],
        VfAction::Consume | VfAction::Produce => vec!["Accountable Agent".to_string()],
        _ => vec!["Accountable Agent".to_string()],
    }
}
}

2.2 State Transition Logic

Pure Function Governance Engine:

#![allow(unused)]
fn main() {
pub struct GovernanceEngine;

impl GovernanceEngine {
    /// Pure function: evaluates state transition without side effects
    pub fn evaluate_transition(
        request: &GovernanceTransitionRequest,
        rules: &[GovernanceRule],
        agent_permissions: &AgentPermissions,
    ) -> ExternResult<TransitionEvaluation> {

        // 1. Check agent permissions first
        if !agent_permissions.allowed {
            return Ok(TransitionEvaluation {
                allowed: false,
                new_state: None,
                required_events: vec![],
                validation_receipts: vec![],
                rejection_reasons: Some(vec![
                    format!("Permission denied: {}", agent_permissions.role_status)
                ]),
                next_steps: Some(vec![
                    "Acquire required role".to_string(),
                    "Contact system administrator".to_string(),
                ]),
            });
        }

        // 2. Evaluate governance rules
        let rule_results = evaluate_governance_rules(request, rules)?;

        // 3. Check if all rules passed
        let all_rules_passed = rule_results.iter().all(|result| result.passed);

        if !all_rules_passed {
            let failed_rules = rule_results.iter()
                .filter(|result| !result.passed)
                .collect::<Vec<_>>();

            return Ok(TransitionEvaluation {
                allowed: false,
                new_state: None,
                required_events: vec![],
                validation_receipts: vec![],
                rejection_reasons: Some(failed_rules.iter()
                    .map(|result| result.reason.clone())
                    .collect()),
                next_steps: Some(vec![
                    "Address governance rule violations".to_string(),
                    "Modify request to comply with rules".to_string(),
                ]),
            });
        }

        // 4. Calculate new resource state
        let new_state = calculate_new_state(
            &request.resource,
            &request.action,
            &request.context,
        )?;

        // 5. Determine required events
        let required_events = generate_required_events(&request.action);

        Ok(TransitionEvaluation {
            allowed: true,
            new_state: Some(new_state),
            required_events,
            validation_receipts: vec![],
            rejection_reasons: None,
            next_steps: None,
        })
    }
}

#[derive(Debug)]
pub struct TransitionEvaluation {
    pub allowed: bool,
    pub new_state: Option<EconomicResource>,
    pub required_events: Vec<String>,
    pub validation_receipts: Vec<ValidationReceipt>,
    pub rejection_reasons: Option<Vec<String>>,
    pub next_steps: Option<Vec<String>>,
}

#[derive(Debug)]
pub struct AgentPermissions {
    pub allowed: bool,
    pub required_roles: Vec<String>,
    pub role_status: String,
}

#[derive(Debug)]
pub struct RuleEvaluationResult {
    pub rule_hash: ActionHash,
    pub rule_type: String,
    pub passed: bool,
    pub reason: String,
}

// Evaluate all applicable governance rules
fn evaluate_governance_rules(
    request: &GovernanceTransitionRequest,
    rules: &[GovernanceRule],
) -> ExternResult<Vec<RuleEvaluationResult>> {
    let mut results = Vec::new();

    for rule in rules {
        let result = evaluate_single_rule(request, rule)?;
        results.push(result);
    }

    Ok(results)
}

// Evaluate a single governance rule
fn evaluate_single_rule(
    request: &GovernanceTransitionRequest,
    rule: &GovernanceRule,
) -> ExternResult<RuleEvaluationResult> {
    let rule_hash = hash_entry(rule)?;

    let (passed, reason) = match rule.rule_type.as_str() {
        "access_requirement" => evaluate_access_requirement(request, rule)?,
        "usage_limit" => evaluate_usage_limit(request, rule)?,
        "transfer_conditions" => evaluate_transfer_conditions(request, rule)?,
        "custody_requirement" => evaluate_custody_requirement(request, rule)?,
        "location_restriction" => evaluate_location_restriction(request, rule)?,
        _ => (true, "Unknown rule type, auto-approving".to_string()),
    };

    Ok(RuleEvaluationResult {
        rule_hash,
        rule_type: rule.rule_type.clone(),
        passed,
        reason,
    })
}
}

2.3 Economic Event Generation

Event Generation Logic:

#![allow(unused)]
fn main() {
// Generate economic events for approved transitions
fn generate_economic_event(
    request: &GovernanceTransitionRequest,
    evaluation: &TransitionEvaluation,
) -> ExternResult<EconomicEvent> {

    Ok(EconomicEvent {
        action: request.action.clone(),
        provider: request.resource.custodian,
        receiver: request.requesting_agent.clone(),
        resource_inventoried_as: Some(request.resource.conforms_to),
        affects: get_action_hash(&request.resource)?,
        resource_quantity: calculate_quantity_change(
            &request.resource,
            &request.action,
            &request.context,
        )?,
        event_time: sys_time()?,
        note: Some(format!(
            "State transition: {:?} approved",
            request.action
        )),
    })
}

// Calculate quantity changes for different actions
fn calculate_quantity_change(
    resource: &EconomicResource,
    action: &VfAction,
    context: &TransitionContext,
) -> ExternResult<f64> {
    match action {
        VfAction::Produce => {
            context.quantity_change.unwrap_or(1.0)
        }
        VfAction::Consume => {
            -context.quantity_change.unwrap_or(resource.quantity)
        }
        VfAction::Raise => {
            context.quantity_change.unwrap_or(0.0)
        }
        VfAction::Lower => {
            -context.quantity_change.unwrap_or(0.0)
        }
        _ => 0.0, // No quantity change for transfer, move, use, etc.
    }
}

// Generate required events based on action type
fn generate_required_events(action: &VfAction) -> Vec<String> {
    match action {
        VfAction::Transfer | VfAction::InitialTransfer => {
            vec!["CustodyTransfer".to_string(), "ReceiptGeneration".to_string()]
        }
        VfAction::Use => {
            vec!["ResourceUse".to_string(), "ServiceProcess".to_string()]
        }
        VfAction::Move => {
            vec!["ResourceTransport".to_string(), "LocationChange".to_string()]
        }
        VfAction::Modify => {
            vec!["ResourceRepair".to_string(), "StateChange".to_string()]
        }
        _ => vec![],
    }
}
}

2.4 Error Handling Patterns

Comprehensive Error Handling:

#![allow(unused)]
fn main() {
#[derive(Debug, thiserror::Error)]
pub enum GovernanceOperatorError {
    #[error("Permission denied: {0}")]
    PermissionDenied(String),

    #[error("Rule violation: {0}")]
    RuleViolation(String),

    #[error("Invalid state transition: {0}")]
    InvalidStateTransition(String),

    #[error("Cross-zome communication failed: {0}")]
    CrossZomeError(String),

    #[error("Data validation failed: {0}")]
    ValidationError(String),
}

// Error handling wrapper for cross-zome calls
pub fn handle_governance_call<T>(
    call_result: Result<T, WasmError>,
    fallback_action: Option<T>,
) -> Result<T, GovernanceOperatorError> {
    match call_result {
        Ok(result) => Ok(result),
        Err(wasm_error) => {
            error!("Governance call failed: {:?}", wasm_error);

            match fallback_action {
                Some(fallback) => {
                    warn!("Using fallback action due to governance unavailability");
                    Ok(fallback)
                }
                None => {
                    Err(GovernanceOperatorError::CrossZomeError(
                        wasm_error.to_string()
                    ))
                }
            }
        }
    }
}

// Resource zome error handling with fallback
#[hdk_extern]
pub fn request_resource_transition_with_fallback(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult> {

    // Try governance evaluation
    let governance_result = handle_governance_call(
        call(
            CallTargetCell::Local,
            "zome_gouvernance",
            "evaluate_state_transition".into(),
            None,
            &request,
        ),
        Some(create_fallback_approval(&request)),
    )?;

    // Apply changes if approved
    if governance_result.success {
        apply_approved_changes(&request, &governance_result)?;
    }

    Ok(governance_result)
}

// Fallback approval for when governance is unavailable
fn create_fallback_approval(request: &GovernanceTransitionRequest) -> GovernanceTransitionResult {
    match request.action {
        VfAction::Use | VfAction::Transfer => {
            // Allow basic actions without governance
            GovernanceTransitionResult {
                success: true,
                new_resource_state: Some(request.resource.clone()),
                economic_event: Some(create_basic_event(request)),
                validation_receipts: vec![],
                rejection_reasons: None,
                next_steps: Some(vec![
                    "Governance validation pending".to_string(),
                    "Manual review recommended".to_string(),
                ]),
            }
        }
        _ => {
            // Reject complex actions without governance
            GovernanceTransitionResult {
                success: false,
                new_resource_state: None,
                economic_event: None,
                validation_receipts: vec![],
                rejection_reasons: Some(vec![
                    "Governance service unavailable".to_string(),
                    "Complex action requires governance approval".to_string(),
                ]),
                next_steps: Some(vec![
                    "Retry later".to_string(),
                    "Contact system administrator".to_string(),
                ]),
            }
        }
    }
}
}

3. Code Examples

3.1 Resource State Transitions

Complete Resource Transfer Example:

#![allow(unused)]
fn main() {
// Transfer custody of a resource
pub async fn transfer_resource_example() -> Result<(), Box<dyn std::error::Error>> {
    let agent = Agent::new().await?;

    // 1. Create transfer request
    let transfer_request = GovernanceTransitionRequest {
        action: VfAction::TransferCustody,
        resource: get_resource("resource_hash").await?,
        requesting_agent: agent.agent_pubkey().clone(),
        context: TransitionContext {
            target_custodian: Some("new_custodian_pubkey".parse()?),
            process_notes: Some("Resource transfer for maintenance".to_string()),
            ..Default::default()
        },
    };

    // 2. Request state transition
    let result: GovernanceTransitionResult = agent.call(
        "request_resource_transition",
        transfer_request,
    ).await?;

    // 3. Handle result
    if result.success {
        println!("Transfer approved");
        if let Some(event) = result.economic_event {
            println!("Economic event generated: {:?}", event);
        }
    } else {
        println!("Transfer rejected: {:?}", result.rejection_reasons);
    }

    Ok(())
}
}

3.2 Governance Rule Evaluation

Custom Rule Implementation:

#![allow(unused)]
fn main() {
// Example: Location-based access rule
fn evaluate_location_restriction(
    request: &GovernanceTransitionRequest,
    rule: &GovernanceRule,
) -> ExternResult<(bool, String)> {

    // Parse rule parameters
    let rule_params: LocationRuleParams = serde_json::from_str(&rule.rule_data)?;

    // Get current resource location
    let current_location = request.resource.current_location.as_deref().unwrap_or("");

    // Check if action requires location compliance
    let requires_location_check = matches!(request.action,
        VfAction::Use | VfAction::Transfer | VfAction::Move
    );

    if !requires_location_check {
        return Ok((true, "Location restriction not applicable".to_string()));
    }

    // Check if current location is in allowed list
    let location_allowed = rule_params.allowed_locations.contains(&current_location.to_string());

    if location_allowed {
        Ok((true, format!("Location '{}' is allowed", current_location)))
    } else {
        Ok((false, format!(
            "Location '{}' not in allowed locations: {:?}",
            current_location,
            rule_params.allowed_locations
        )))
    }
}

#[derive(Deserialize)]
struct LocationRuleParams {
    allowed_locations: Vec<String>,
    requires_approval: bool,
    notification_required: bool,
}
}

3.3 Economic Event Generation

Complex Event Generation:

#![allow(unused)]
fn main() {
// Generate events for multi-step process chains
pub fn generate_process_chain_events(
    request: &GovernanceTransitionRequest,
    process_chain: &Vec<VfAction>,
) -> ExternResult<Vec<EconomicEvent>> {
    let mut events = Vec::new();
    let mut current_resource = request.resource.clone();

    for (index, action) in process_chain.iter().enumerate() {
        let event = EconomicEvent {
            action: action.clone(),
            provider: current_resource.custodian,
            receiver: request.requesting_agent.clone(),
            resource_inventoried_as: Some(current_resource.conforms_to),
            affects: get_action_hash(&current_resource)?,
            resource_quantity: calculate_quantity_for_action(action, &current_resource)?,
            event_time: sys_time()?,
            note: Some(format!(
                "Step {} of process chain: {:?}",
                index + 1,
                action
            )),
        };

        events.push(event);

        // Update resource state for next step
        current_resource = apply_action_to_resource(&current_resource, action)?;
    }

    Ok(events)
}
}

3.4 Complete Workflow Examples

End-to-End Resource Lifecycle:

#![allow(unused)]
fn main() {
// Complete example: Resource creation through use
pub async fn complete_resource_lifecycle() -> Result<(), Box<dyn std::error::Error>> {
    let agent = Agent::new().await?;

    // Step 1: Create resource specification
    let spec_hash = agent.call::<ActionHash>(
        "create_resource_spec",
        CreateResourceSpecInput {
            name: "3D Printer".to_string(),
            description: "Industrial 3D printer for prototyping".to_string(),
            category: "Equipment".to_string(),
            governance_rules: vec![create_usage_limit_rule()],
        },
    ).await?;

    // Step 2: Create economic resource
    let resource_hash = agent.call::<CreateResourceOutput>(
        "create_economic_resource",
        EconomicResourceInput {
            spec_hash,
            quantity: 1.0,
            unit: "unit".to_string(),
            current_location: Some("Workshop A".to_string()),
        },
    ).await?.resource_hash;

    // Step 3: Use resource (requires governance approval)
    let use_result: GovernanceTransitionResult = agent.call(
        "request_resource_transition",
        GovernanceTransitionRequest {
            action: VfAction::Use,
            resource: get_resource(resource_hash).await?,
            requesting_agent: agent.agent_pubkey().clone(),
            context: TransitionContext {
                process_notes: Some("Prototype development".to_string()),
                ..Default::default()
            },
        },
    ).await?;

    // Step 4: Handle result
    match use_result.success {
        true => {
            println!("Resource use approved");

            // Step 5: Record usage completion
            if let Some(event) = use_result.economic_event {
                let _completion_receipt = agent.call::<ActionHash>(
                    "record_usage_completion",
                    event,
                ).await?;
            }
        }
        false => {
            println!("Resource use denied: {:?}", use_result.rejection_reasons);
        }
    }

    Ok(())
}
}

4. Testing Patterns

4.1 Mock Governance for Resource Testing

Mock Implementation for Testing:

#![allow(unused)]
fn main() {
#[cfg(test)]
pub struct MockGovernanceEngine {
    approval_mode: ApprovalMode,
    rule_results: HashMap<String, bool>,
}

#[derive(Debug, Clone)]
pub enum ApprovalMode {
    ApproveAll,
    RejectAll,
    RoleBased(Vec<String>),
    Conditional(Box<dyn Fn(&GovernanceTransitionRequest) -> bool>),
    RuleBased(HashMap<String, bool>),
}

impl MockGovernanceEngine {
    pub fn evaluate_transition(
        &self,
        request: GovernanceTransitionRequest,
    ) -> ExternResult<GovernanceTransitionResult> {

        let approved = match &self.approval_mode {
            ApprovalMode::ApproveAll => true,
            ApprovalMode::RejectAll => false,
            ApprovalMode::RoleBased(allowed_roles) => {
                // Mock role checking
                allowed_roles.contains(&"Accountable Agent".to_string())
            }
            ApprovalMode::Conditional(validator) => validator(&request),
            ApprovalMode::RuleBased(results) => {
                // Mock rule evaluation
                self.rule_results.values().all(|&result| *result)
            }
        };

        let new_state = if approved {
            Some(calculate_new_state(&request))
        } else {
            None
        };

        Ok(GovernanceTransitionResult {
            success: approved,
            new_resource_state,
            economic_event: if approved {
                Some(generate_test_event(&request))
            } else {
                None
            },
            validation_receipts: vec![],
            rejection_reasons: if approved {
                None
            } else {
                Some(vec!["Mock rejection".to_string()])
            },
            next_steps: None,
        })
    }
}
}

Testing Resource Zome with Mock Governance:

#![allow(unused)]
fn main() {
#[cfg(test)]
mod resource_tests {
    use super::*;

    #[tokio::test]
    async fn test_resource_creation_with_mock_governance() {
        let mock_engine = MockGovernanceEngine {
            approval_mode: ApprovalMode::ApproveAll,
            rule_results: HashMap::new(),
        };

        // Create test request
        let create_request = GovernanceTransitionRequest {
            action: VfAction::Produce,
            resource: create_test_resource(),
            requesting_agent: create_test_agent(),
            context: TransitionContext {
                quantity_change: Some(1.0),
                ..Default::default()
            },
        };

        // Test with mock governance
        let result = mock_engine.evaluate_transition(create_request).unwrap();

        assert!(result.success);
        assert!(result.new_resource_state.is_some());
        assert!(result.economic_event.is_some());
    }

    #[tokio::test]
    async fn test_role_based_rejection() {
        let mock_engine = MockGovernanceEngine {
            approval_mode: ApprovalMode::RoleBased(vec!["Transport".to_string()]),
            rule_results: HashMap::new(),
        };

        let repair_request = GovernanceTransitionRequest {
            action: VfAction::Modify, // Requires Repair role
            resource: create_test_resource(),
            requesting_agent: create_test_agent_with_role("Transport".to_string()),
            context: Default::default(),
        };

        let result = mock_engine.evaluate_transition(repair_request).unwrap();

        assert!(!result.success);
        assert!(result.rejection_reasons.is_some());
        assert!(result.rejection_reasons.unwrap().iter()
            .any(|reason| reason.contains("Insufficient role")));
    }
}
}

4.2 Governance Logic Unit Testing

Pure Function Testing:

#![allow(unused)]
fn main() {
#[cfg(test)]
mod governance_tests {
    use super::*;

    #[test]
    fn test_permission_evaluation() {
        let agent_permissions = AgentPermissions {
            allowed: true,
            required_roles: vec!["Accountable Agent".to_string()],
            role_status: "Authorized".to_string(),
        };

        let evaluation = TransitionEvaluation {
            allowed: true,
            new_state: None,
            required_events: vec![],
            validation_receipts: vec![],
            rejection_reasons: None,
            next_steps: None,
        };

        assert!(agent_permissions.allowed);
        assert_eq!(agent_permissions.required_roles.len(), 1);
        assert!(evaluation.allowed);
    }

    #[test]
    fn test_rule_evaluation() {
        let rule = GovernanceRule {
            rule_type: "access_requirement".to_string(),
            rule_data: r#"{"min_agent_level": "Accountable Agent"}"#.to_string(),
            enforced_by: None,
            created_by: AgentPubKey::random(),
            created_at: sys_time().unwrap(),
        };

        let request = create_test_request();
        let result = evaluate_single_rule(&request, &rule).unwrap();

        assert!(result.passed);
        assert_eq!(result.rule_type, "access_requirement");
    }

    #[test]
    fn test_state_transition_validation() {
        let resource = EconomicResource {
            conforms_to: ActionHash::random(),
            quantity: 1.0,
            unit: "unit".to_string(),
            custodian: AgentPubKey::random(),
            created_by: AgentPubKey::random(),
            created_at: sys_time().unwrap(),
            current_location: Some("Workshop".to_string()),
            state: ResourceState::Active,
        };

        // Valid transition
        assert!(validate_action_state_compatibility(
            &VfAction::Transfer,
            &resource.state
        ).is_ok());

        // Invalid transition
        assert!(validate_action_state_compatibility(
            &VfAction::Use,
            &ResourceState::Reserved
        ).is_err());
    }
}
}

4.3 Cross-Zome Integration Testing

Integration Test Setup:

#![allow(unused)]
fn main() {
#[cfg(test)]
mod integration_tests {
    use super::*;

    #[tokio::test]
    async fn test_end_to_end_state_transition() {
        // Setup test environment
        let test_env = TestEnvironment::new().await;
        let resource_agent = test_env.create_agent("resource_owner").await;
        let request_agent = test_env.create_agent("requester").await;

        // Create test resource
        let resource_hash = resource_agent.call::<ActionHash>(
            "create_economic_resource",
            EconomicResourceInput {
                spec_hash: create_test_spec(),
                quantity: 1.0,
                unit: "unit".to_string(),
                current_location: Some("Test Location".to_string()),
            },
        ).await;

        // Request state transition
        let transfer_request = GovernanceTransitionRequest {
            action: VfAction::Transfer,
            resource: resource_agent.call::<EconomicResource>(
                "get_economic_resource",
                resource_hash,
            ).await,
            requesting_agent: request_agent.agent_pubkey().clone(),
            context: TransitionContext {
                target_custodian: Some(request_agent.agent_pubkey().clone()),
                ..Default::default()
            },
        };

        // Process through resource zome
        let result: GovernanceTransitionResult = resource_agent.call(
            "request_resource_transition",
            transfer_request,
        ).await;

        // Verify outcome
        assert!(result.success);
        assert!(result.economic_event.is_some());

        // Verify state changed in DHT
        let updated_resource = resource_agent.call::<EconomicResource>(
            "get_economic_resource",
            resource_hash,
        ).await;

        assert_eq!(updated_resource.custodian, request_agent.agent_pubkey());
    }

    #[tokio::test]
    async fn test_governance_rule_enforcement() {
        let test_env = TestEnvironment::new().await;
        let agent = test_env.create_agent("test_agent").await;

        // Create resource with strict governance rules
        let spec_hash = agent.call::<ActionHash>(
            "create_resource_spec",
            CreateResourceSpecInput {
                name: "Restricted Resource".to_string(),
                description: "Resource with strict access rules".to_string(),
                category: "Restricted".to_string(),
                governance_rules: vec![
                    GovernanceRule {
                        rule_type: "access_requirement".to_string(),
                        rule_data: r#"{"requires_approval": true, "min_agent_level": "Accountable Agent"}"#.to_string(),
                        enforced_by: Some("System".to_string()),
                        created_by: AgentPubKey::random(),
                        created_at: sys_time().unwrap(),
                    }
                ],
            },
        ).await;

        // Create resource
        let resource_hash = agent.call::<ActionHash>(
            "create_economic_resource",
            EconomicResourceInput {
                spec_hash,
                quantity: 1.0,
                unit: "unit".to_string(),
                current_location: Some("Test Location".to_string()),
            },
        ).await;

        // Try to use resource with Simple Agent role
        let simple_agent = test_env.create_simple_agent("simple_agent").await;
        let use_request = GovernanceTransitionRequest {
            action: VfAction::Use,
            resource: agent.call::<EconomicResource>(
                "get_economic_resource",
                resource_hash,
            ).await,
            requesting_agent: simple_agent.agent_pubkey().clone(),
            context: Default::default(),
        };

        let result: GovernanceTransitionResult = agent.call(
            "request_resource_transition",
            use_request,
        ).await;

        // Should be rejected due to insufficient role
        assert!(!result.success);
        assert!(result.rejection_reasons.is_some());
    }
}
}

5. Performance Considerations

5.1 Cross-Zome Call Optimization

Batch Processing Pattern:

#![allow(unused)]
fn main() {
// Process multiple state transitions efficiently
#[hdk_extern]
pub fn batch_state_transitions(
    requests: Vec<GovernanceTransitionRequest>,
) -> ExternResult<Vec<GovernanceTransitionResult>> {

    // Group requests by resource specification for efficient rule loading
    let mut grouped_requests: HashMap<ActionHash, Vec<GovernanceTransitionRequest>> = HashMap::new();

    for request in requests {
        let spec_hash = request.resource.conforms_to;
        grouped_requests.entry(spec_hash)
            .or_insert_with(Vec::new)
            .push(request);
    }

    // Process each group
    let mut all_results = Vec::new();
    for (spec_hash, group_requests) in grouped_requests {
        // Load governance rules once per group
        let governance_rules = load_governance_rules_for_spec(&spec_hash)?;

        // Process all requests in the group
        let group_results = process_request_group(group_requests, &governance_rules)?;
        all_results.extend(group_results);
    }

    Ok(all_results)
}
}

5.2 State Management Efficiency

Lazy Loading and Caching:

#![allow(unused)]
fn main() {
use std::collections::HashMap;
use lru::LruCache;

pub struct EfficientGovernanceEngine {
    rule_cache: LruCache<ActionHash, Vec<GovernanceRule>>,
    permission_cache: LruCache<AgentPubKey, AgentPermissions>,
    cache_ttl: Duration,
}

impl EfficientGovernanceEngine {
    pub fn new() -> Self {
        Self {
            rule_cache: LruCache::new(std::num::NonZeroUsize::new(100)),
            permission_cache: LruCache::new(std::num::NonZeroUsize::new(200)),
            cache_ttl: Duration::from_secs(300), // 5 minutes
        }
    }

    pub fn get_rules_cached(
        &mut self,
        spec_hash: &ActionHash,
    ) -> ExternResult<&Vec<GovernanceRule>> {
        let cache_key = spec_hash.clone();

        if !self.rule_cache.contains(&cache_key) {
            let rules = load_governance_rules_for_spec(spec_hash)?;
            self.rule_cache.put(cache_key, rules);
        }

        Ok(self.rule_cache.get(&cache_key).unwrap())
    }

    pub fn get_permissions_cached(
        &mut self,
        agent_pubkey: &AgentPubKey,
        action: &VfAction,
    ) -> ExternResult<&AgentPermissions> {
        let cache_key = format!("{}-{:?}", agent_pubkey, action);
        let cache_key_hash = hash_string(&cache_key);

        if !self.permission_cache.contains(&cache_key_hash) {
            let permissions = check_agent_permissions(agent_pubkey, action)?;
            self.permission_cache.put(cache_key_hash, permissions);
        }

        Ok(self.permission_cache.get(&cache_key_hash).unwrap())
    }
}
}

This implementation guide provides comprehensive technical details for implementing the governance-as-operator architecture, with practical examples, testing patterns, and performance optimizations for production deployment.

Cross-Zome API Specification

Cross-zome contracts described here reflect the MVP split: zome_resource holds data; zome_gouvernance evaluates transitions. Post-MVP, typed rules for Unyt (EconomicAgreement, RAVE) and Flowsta (IdentityVerification) are specified in documentation/requirements/ndo_prima_materia.md §§6.6–6.7 and the integration stubs under documentation/requirements/post-mvp/ — see also governance-operator-architecture.md §1.3.

1. Resource Zome API

1.1 Data Access Functions

get_economic_resource

Retrieves a specific economic resource by its action hash.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_economic_resource(
    resource_hash: ActionHash,
) -> ExternResult<EconomicResource>
}

Parameters:

  • resource_hash: ActionHash - The action hash of the resource to retrieve

Returns:

  • EconomicResource - The resource data structure

Errors:

  • WasmErrorGuest - If resource not found or access denied

Example:

#![allow(unused)]
fn main() {
let resource = call(
    CallTargetCell::Local,
    "zome_resource",
    "get_economic_resource".into(),
    None,
    &resource_hash,
)?;
}

get_economic_resource_with_state

Retrieves resource with full state transition history.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_economic_resource_with_state(
    resource_hash: ActionHash,
) -> ExternResult<ResourceWithState>
}

Parameters:

  • resource_hash: ActionHash - Resource action hash

Returns:

  • ResourceWithState - Resource with state history

1.2 State Change Requests

request_resource_transition

Primary interface for requesting state changes through governance evaluation.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn request_resource_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult>
}

Parameters:

  • request: GovernanceTransitionRequest - Complete transition request

Returns:

  • GovernanceTransitionResult - Governance decision and results

Request Structure:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceTransitionRequest {
    /// The action the requesting agent wants to perform
    pub action: VfAction,
    /// Current state of the resource being modified
    pub resource: EconomicResource,
    /// Agent requesting the state change
    pub requesting_agent: AgentPubKey,
    /// Additional context for the transition
    pub context: TransitionContext,
}
}

Result Structure:

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct GovernanceTransitionResult {
    /// Whether the transition was approved
    pub success: bool,
    /// Updated resource state (if approved)
    pub new_resource_state: Option<EconomicResource>,
    /// Generated economic event for audit trail
    pub economic_event: Option<EconomicEvent>,
    /// Validation receipts from governance evaluation
    pub validation_receipts: Vec<ValidationReceipt>,
    /// Detailed reasons for rejection (if applicable)
    pub rejection_reasons: Option<Vec<String>>,
    /// Required next steps or additional validation needed
    pub next_steps: Option<Vec<String>>,
}
}

batch_state_transitions

Process multiple state transitions efficiently in a single call.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn batch_state_transitions(
    requests: Vec<GovernanceTransitionRequest>,
) -> ExternResult<Vec<GovernanceTransitionResult>>
}

Parameters:

  • requests: Vec<GovernanceTransitionRequest> - Multiple transition requests

Returns:

  • Vec<GovernanceTransitionResult> - Results for each request in order

1.3 Query Functions

get_my_resources

Retrieves all resources where the calling agent is the custodian.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_my_resources() -> ExternResult<Vec<EconomicResource>>
}

Returns:

  • Vec<EconomicResource> - Resources owned by the calling agent

get_resources_by_specification

Retrieves all resources conforming to a specific specification.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_resources_by_specification(
    spec_hash: ActionHash,
) -> ExternResult<Vec<EconomicResource>>
}

Parameters:

  • spec_hash: ActionHash - Specification action hash

Returns:

  • Vec<EconomicResource> - Resources conforming to the specification

get_resources_by_state

Retrieves resources in a specific state.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_resources_by_state(
    state: ResourceState,
) -> ExternResult<Vec<EconomicResource>>
}

Parameters:

  • state: ResourceState - State to filter by

Returns:

  • Vec<EconomicResource> - Resources in the specified state

2. Governance Zome API

2.1 State Transition Evaluation

evaluate_state_transition

Evaluates a state transition request and returns governance decision.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn evaluate_state_transition(
    request: GovernanceTransitionRequest,
) -> ExternResult<GovernanceTransitionResult>
}

Parameters:

  • request: GovernanceTransitionRequest - Transition request to evaluate

Returns:

  • GovernanceTransitionResult - Governance evaluation result

Evaluation Process:

  1. Load applicable governance rules
  2. Check agent permissions and roles
  3. Evaluate all applicable rules
  4. Determine if transition is allowed
  5. Generate economic events if approved

2.2 Rule Processing

get_applicable_rules

Retrieves governance rules applicable to a specific resource and action.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_applicable_rules(
    resource_hash: ActionHash,
    action: VfAction,
) -> ExternResult<Vec<GovernanceRule>>
}

Parameters:

  • resource_hash: ActionHash - Resource to get rules for
  • action: VfAction - Action being performed

Returns:

  • Vec<GovernanceRule> - Applicable governance rules

evaluate_rule

Evaluates a single governance rule against a transition request.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn evaluate_rule(
    request: GovernanceTransitionRequest,
    rule_hash: ActionHash,
) -> ExternResult<RuleEvaluationResult>
}

Parameters:

  • request: GovernanceTransitionRequest - Transition request
  • rule_hash: ActionHash - Rule to evaluate

Returns:

  • RuleEvaluationResult - Rule evaluation result

2.3 Economic Event Generation

generate_economic_event

Generates an economic event for a completed state transition.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn generate_economic_event(
    request: GovernanceTransitionRequest,
    evaluation_result: &TransitionEvaluation,
) -> ExternResult<EconomicEvent>
}

Parameters:

  • request: GovernanceTransitionRequest - Original transition request
  • evaluation_result: TransitionEvaluation - Internal evaluation result

Returns:

  • EconomicEvent - Generated economic event

2.4 Agent Permission Management

check_agent_permissions

Checks if an agent has permission to perform a specific action.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn check_agent_permissions(
    agent_pubkey: AgentPubKey,
    action: VfAction,
) -> ExternResult<AgentPermissions>
}

Parameters:

  • agent_pubkey: AgentPubKey - Agent to check permissions for
  • action: VfAction - Action to check permissions for

Returns:

  • AgentPermissions - Permission check results

get_agent_roles

Retrieves all roles assigned to an agent.

#![allow(unused)]
fn main() {
#[hdk_extern]
pub fn get_agent_roles(
    agent_pubkey: AgentPubKey,
) -> ExternResult<Vec<Role>>
}

Parameters:

  • agent_pubkey: AgentPubKey - Agent to get roles for

Returns:

  • Vec<Role> - Agent's assigned roles

3. Interface Types

3.1 Request/Response Structures

GovernanceTransitionRequest

Complete request for state transition evaluation.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct GovernanceTransitionRequest {
    /// The action the requesting agent wants to perform
    pub action: VfAction,
    /// Current state of the resource being modified
    pub resource: EconomicResource,
    /// Agent requesting the state change
    pub requesting_agent: AgentPubKey,
    /// Additional context for the transition
    pub context: TransitionContext,
}
}

TransitionContext

Additional context information for state transitions.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct TransitionContext {
    /// Target location for transport/move actions
    pub target_location: Option<String>,
    /// Quantity change for produce/consume actions
    pub quantity_change: Option<f64>,
    /// Target custodian for transfer actions
    pub target_custodian: Option<AgentPubKey>,
    /// Process notes and observations
    pub process_notes: Option<String>,
    /// Associated economic process if applicable
    pub process_context: Option<ActionHash>,
    /// Additional metadata
    pub metadata: HashMap<String, String>,
}
}

GovernanceTransitionResult

Comprehensive result from governance evaluation.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct GovernanceTransitionResult {
    /// Whether the transition was approved
    pub success: bool,
    /// Updated resource state (if approved)
    pub new_resource_state: Option<EconomicResource>,
    /// Generated economic event for audit trail
    pub economic_event: Option<EconomicEvent>,
    /// Validation receipts from governance evaluation
    pub validation_receipts: Vec<ValidationReceipt>,
    /// Detailed reasons for rejection (if applicable)
    pub rejection_reasons: Option<Vec<String>>,
    /// Required next steps or additional validation needed
    pub next_steps: Option<Vec<String>>,
    /// Processing metadata
    pub metadata: TransitionMetadata,
}
}

TransitionMetadata

Metadata about the transition processing.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct TransitionMetadata {
    /// Timestamp when evaluation started
    pub evaluation_started: Timestamp,
    /// Timestamp when evaluation completed
    pub evaluation_completed: Timestamp,
    /// Number of rules evaluated
    pub rules_evaluated: u32,
    /// Processing duration in milliseconds
    pub processing_duration_ms: u64,
    /// Governance engine version
    pub engine_version: String,
}
}

3.2 Validation Structures

RuleEvaluationResult

Result of evaluating a single governance rule.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct RuleEvaluationResult {
    /// Hash of the evaluated rule
    pub rule_hash: ActionHash,
    /// Type of governance rule
    pub rule_type: String,
    /// Whether the rule was passed
    pub passed: bool,
    /// Detailed reason for evaluation result
    pub reason: String,
    /// Rule-specific evaluation data
    pub evaluation_data: Option<serde_json::Value>,
    /// Timestamp of evaluation
    pub evaluated_at: Timestamp,
}
}

AgentPermissions

Permission check results for agent and action.

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub struct AgentPermissions {
    /// Whether the permission was granted
    pub allowed: bool,
    /// Roles required for this action
    pub required_roles: Vec<String>,
    /// Current status of permission check
    pub status: String,
    /// Permission expiration (if applicable)
    pub expires_at: Option<Timestamp>,
    /// Additional permission constraints
    pub constraints: Vec<String>,
}
}

3.3 Error Handling

GovernanceError

Comprehensive error types for governance operations.

#![allow(unused)]
fn main() {
#[derive(Debug, thiserror::Error, Serialize, Deserialize)]
pub enum GovernanceError {
    #[error("Permission denied: {0}")]
    PermissionDenied(String),

    #[error("Rule violation: {0}")]
    RuleViolation(String),

    #[error("Invalid state transition: {0}")]
    InvalidStateTransition(String),

    #[error("Agent not found: {0}")]
    AgentNotFound(String),

    #[error("Resource not found: {0}")]
    ResourceNotFound(String),

    #[error("Governance rule not found: {0}")]
    GovernanceRuleNotFound(String),

    #[error("Insufficient role: {0}")]
    InsufficientRole(String),

    #[error("Evaluation timeout: {0}ms")]
    EvaluationTimeout(u64),

    #[error("Cross-zome communication failed: {0}")]
    CrossZomeError(String),

    #[error("Data validation failed: {0}")]
    ValidationError(String),

    #[error("Configuration error: {0}")]
    ConfigurationError(String),
}
}

4. Usage Examples

4.1 Basic Resource Transfer

// TypeScript (Frontend) example
const transferResource = async (
  resourceHash: string,
  newCustodian: string,
  notes: string
) => {
  const request: GovernanceTransitionRequest = {
    action: "TransferCustody",
    resource: await getResource(resourceHash),
    requestingAgent: await getMyAgentPubKey(),
    context: {
      targetCustodian: newCustodian,
      processNotes: notes,
    },
  };

  const result = await callZome<GovernanceTransitionResult>(
    "zome_resource",
    "request_resource_transition",
    request
  );

  if (result.success) {
    console.log("Transfer approved");
    return result;
  } else {
    console.log("Transfer rejected:", result.rejectionReasons);
    throw new Error("Transfer failed");
  }
};

4.2 Complex Process Chain

#![allow(unused)]
fn main() {
// Rust backend example for process chaining
pub async fn execute_transport_repair_chain(
    resource_hash: ActionHash,
    repair_location: String,
    final_destination: String,
) -> ExternResult<Vec<EconomicEvent>> {

    let agent_info = agent_info()?;
    let resource = get_economic_resource(resource_hash)?;

    // Step 1: Transport to repair location
    let transport_request = GovernanceTransitionRequest {
        action: VfAction::Move,
        resource: resource.clone(),
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            target_location: Some(repair_location),
            process_notes: Some("Transport for repair".to_string()),
            ..Default::default()
        },
    };

    let transport_result = request_resource_transition(transport_request)?;
    if !transport_result.success {
        return Err(GovernanceError::RuleViolation(
            format!("Transport failed: {:?}", transport_result.rejection_reasons)
        ).into());
    }

    // Step 2: Repair the resource
    let repair_request = GovernanceTransitionRequest {
        action: VfAction::Modify,
        resource: transport_result.new_resource_state.unwrap(),
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            target_location: Some(repair_location),
            process_notes: Some("Maintenance repair".to_string()),
            ..Default::default()
        },
    };

    let repair_result = request_resource_transition(repair_request)?;
    if !repair_result.success {
        return Err(GovernanceError::RuleViolation(
            format!("Repair failed: {:?}", repair_result.rejection_reasons)
        ).into());
    }

    // Step 3: Transport to final destination
    let final_transport_request = GovernanceTransitionRequest {
        action: VfAction::Move,
        resource: repair_result.new_resource_state.unwrap(),
        requesting_agent: agent_info.agent_initial_pubkey,
        context: TransitionContext {
            target_location: Some(final_destination),
            process_notes: Some("Transport after repair".to_string()),
            ..Default::default()
        },
    };

    let final_result = request_resource_transition(final_transport_request)?;
    if !final_result.success {
        return Err(GovernanceError::RuleViolation(
            format!("Final transport failed: {:?}", final_result.rejection_reasons)
        ).into());
    }

    // Collect all generated events
    let mut events = Vec::new();
    if let Some(event) = transport_result.economic_event {
        events.push(event);
    }
    if let Some(event) = repair_result.economic_event {
        events.push(event);
    }
    if let Some(event) = final_result.economic_event {
        events.push(event);
    }

    Ok(events)
}
}

4.3 Batch Processing

// TypeScript batch processing example
const batchUpdateResources = async (
  updates: Array<{
    resourceHash: string;
    action: VfAction;
    context: TransitionContext;
  }>
) => {
  const requests = updates.map(update => ({
    action: update.action,
    resource: await getResource(update.resourceHash),
    requestingAgent: await getMyAgentPubKey(),
    context: update.context,
  }));

  const results = await callZome<GovernanceTransitionResult[]>(
    "zome_resource",
    "batch_state_transitions",
    requests
  );

  // Process results
  const successful = results.filter(r => r.success);
  const failed = results.filter(r => !r.success);

  console.log(`Processed ${results.length} requests`);
  console.log(`Successful: ${successful.length}`);
  console.log(`Failed: ${failed.length}`);

  if (failed.length > 0) {
    console.error("Failed transitions:", failed);
  }

  return results;
};

5. Performance and Scalability

5.1 Rate Limiting

Rate limiting is enforced at the governance zome level:

#![allow(unused)]
fn main() {
// Rate limiting configuration
pub const RATE_LIMITS: HashMap<&'static str, u32> = hashmap! {
    "evaluate_state_transition" => 100, // Per minute
    "check_agent_permissions" => 500,    // Per minute
    "get_applicable_rules" => 200,     // Per minute
};
}

5.2 Batch Processing

For high-volume operations, use batch processing:

#![allow(unused)]
fn main() {
// Recommended batch sizes
const OPTIMAL_BATCH_SIZE: usize = 10;
const MAX_BATCH_SIZE: usize = 50;

// Implementation validates and adjusts batch sizes
pub fn validate_batch_size(size: usize) -> usize {
    if size > MAX_BATCH_SIZE {
        warn!("Batch size {size} exceeds maximum, truncating to {MAX_BATCH_SIZE}");
        MAX_BATCH_SIZE
    } else {
        size.max(OPTIMAL_BATCH_SIZE)
    }
}
}

5.3 Caching Strategy

Cache frequently accessed data to improve performance:

#![allow(unused)]
fn main() {
// Cache configuration
pub const CACHE_TTL_SECONDS: u64 = 300; // 5 minutes
pub const RULE_CACHE_SIZE: usize = 100;
pub const PERMISSION_CACHE_SIZE: usize = 200;
}

This API specification provides a comprehensive reference for implementing cross-zome communication in the governance-as-operator architecture, with detailed examples and performance considerations for production deployment.

Private Participation Receipts (PPR)

Overview

Private Participation Receipts are cryptographically signed, cumulative records stored as private entries in an agent's source chain. They serve as proof of reliable participation in the nondominium network and form the foundation for a generative reputation system.

Core Principles

  • Bi-directional Issuance: Receipts are issued between agents involved in each economic interaction
  • Cryptographic Integrity: All receipts are cryptographically signed for authenticity
  • Multi-role Support: Agents can accumulate receipts across multiple roles simultaneously
  • Privacy Preservation: Receipt details remain private while enabling reputation derivation
  • ValueFlows Compliance: Modeled as specialized Claims within the ValueFlows ontology

Fundamental Concepts

Commitments and Fulfillments

  • Commitments: Actions (resource creation, transfer, maintenance) are formally committed by agents
  • Validations: Fulfillments that confirm commitments have been properly executed
  • Good Faith Usage: Users commit to honest usage practices (reporting damage, avoiding monopolization)

Receipt Generation Logic

  • Two Receipts Per Action: Each economic interaction generates exactly 2 bi-directional receipts between participating agents
  • Implicit Resource Validation: Resource validation is implicit through agent validation (except for creation events)
  • Agent-Focused: Receipts track agent behavior and reliability, not resource state changes

TODO (G1, REQ-GOV-16 — post-MVP): The counterparty field in PrivateParticipationClaim currently assumes an individual agent (AgentPubKey). Post-MVP, custody transfer to a collective agent (e.g., a project NDO) will require counterparty: AgentContext. Bot agents generate PPRs with their operator's AgentPubKey as the accountable counterparty.

PPR Issuance Categories

1. Genesis Role - Network Entry

Resource Creation Events

1.1 Resource Creation & Validation (Single Transaction)

  • Trigger: A resource is registered on the network and validated by another agent
  • Generated Receipts (2 total):
    1. Creator Agent: Receives "successful resource contribution" receipt
    2. Validator Agent: Receives "network validation performed" receipt
  • Special Case: Resource creation is an event requiring explicit validation receipts, as it establishes the resource's entry into the network

2. Core Usage Role - Custodianship

Custody Transfer Events

2.1 Resource Custody Transfer

  • Trigger: Resource custody is transferred between agents
  • Generated Receipts (2 total):
    1. Outgoing Custodian: Receives "responsible custody transfer" receipt
    2. Incoming Custodian: Receives "custody acceptance" receipt
  • Note: Resource validation is implicit through the custodian agents' reliability; no separate validation receipts needed

3. Intermediate Roles - Specialized Services

Specialized Service Receipts

Participant Structure: Involves 2 or 3 agents (original custodian, intermediate service provider, final recipient).Thus, the Resource is transferred from original custodian (User) to intermediate service provider, back to another or the same User.

3.1 Maintenance Service

  • Commitment Phase: Service provider commits to maintenance duties
  • Generated Receipts (2 total):
    1. Maintenance Agent: Receives "maintenance commitment accepted" receipt
    2. Custodian Agent: Receives "Good faith transfer" receipt
  • Fulfillment Phase: Commitment is fulfilled through completed maintenance and resource available again
  • Generated Receipts (2 total):
    1. Maintenance Agent: Receives "maintenance fulfillment completed" receipt
    2. Resource Recipient: Receives "custody acceptance" receipt

3.2 Storage Service

  • Commitment Phase: Service provider commits to storage duties
  • Generated Receipts (2 total):
    1. Storage Agent: Receives "storage commitment accepted" receipt
    2. Custodian Agent: Receives "Good faith transfer" receipt
  • Fulfillment Phase: Commitment is fulfilled through resource custodian transfer
  • Generated Receipts (2 total):
    1. Storage Agent: Receives "storage fulfillment completed" receipt
    2. Resource Recipient: Receives "custody acceptance" receipt

3.3 Transport Service

  • Commitment Phase: Service provider commits to transport duties
  • Generated Receipts (2 total):
    1. Transport Agent: Receives "transport commitment accepted" receipt
    2. Custodian Agent: Receives "Good faith transfer" receipt
  • Fulfillment Phase: Commitment is fulfilled through completed transport and resource delivery
  • Generated Receipts (2 total):
    1. Transport Agent: Receives "transport fulfillment completed" receipt
    2. Resource Recipient: Receives "custody acceptance" receipt

Role Chaining Mechanics

  • Multi-role Agents: Agents can hold multiple intermediate roles simultaneously, ex. they can hold credencials for transport, maintenance and storage at the same time.
  • Action Chaining: Service Agents can chain multiple actions (transport → repair → transport) within a single commitment
  • Self-Managed Chains: Intermediate steps don't require external validation
  • Atomic Transactions: Entire chain treated as single commitment/fulfillment cycle

Example Workflow: Transport + Repair Service

Initial State: Lynn (custodian) → Resource needs repair
Service Request: Lynn requests Bob (transport + repair credentials) to service resource

Commitment Phase:
1. Bob commits to: receive → transport → repair → transport → deliver
2. Mutual signatures create bi-directional receipts:
   - Lynn → Bob: "Service commitment accepted" receipt
   - Bob → Lynn: "Good faith transfer" receipt

Execution Phase:
3. Bob executes action chain without intermediate validation
4. Internal status changes (transport → repair → transport) for the resource are self-managed, pending validation.

Completion Phase:
5. Resource delivered to final recipient (Lynn or another recipient agent)
6. Final bi-directional receipts:
   - Bob → Recipient: "custody acceptance" receipt
   - Recipient → Bob: "Transport + Repair fulfillment completed" receipt

Additional PPR Contexts

4. Network Governance

  • Dispute Resolution Participation: Receipts for constructive participation in conflict resolution
  • Validation Activities: Receipts for performing validation duties beyond specific transactions
  • Rule Compliance: Receipts for consistent adherence to governance protocols

5. Quality Assurance

  • Economic Event Completion: Receipts for successfully completing any EconomicEvent
  • Commitment Fulfillment: Receipts when claims properly link commitments to their fulfillment
  • Performance Standards: Receipts for meeting or exceeding quality thresholds

ValueFlows Integration

PPRs are implemented as specialized PrivateParticipationClaim entries that extend the standard ValueFlows Claim structure:

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    // Standard ValueFlows fields
    pub fulfills: ActionHash,           // References the commitment fulfilled
    pub fulfilled_by: ActionHash,       // References the economic event
    pub claimed_at: Timestamp,

    // PPR-specific extensions
    pub claim_type: ParticipationClaimType,
    pub performance_metrics: PerformanceMetrics,
    pub bilateral_signature: CryptographicSignature,
}
}

This design maintains ValueFlows compliance while enabling the cumulative reputation system essential for nondominium governance.

Resource End-of-Life Management

6. Resource Decommissioning

Critical Lifecycle Completion

Resources require formal end-of-life processing to prevent abuse vectors and maintain network integrity.

6.1 Resource End-of-Life Declaration

  • Trigger: Resource becomes permanently unusable, damaged beyond repair, or deliberately retired
  • Security Concern: This event is a potential attack vector where agents might claim resources are "destroyed" to steal or monopolize them
  • Generated Receipts (2 total):
    1. Declaring Agent: Receives "end-of-life declaration submitted" receipt
    2. Validator Agent: Receives "end-of-life validation performed" receipt

Strict Validation Requirements

To prevent end-of-life abuse:

  • Multiple Validators Required: Minimum 2-3 validators must confirm end-of-life status
  • The number of validators required can be adjusted based on the resource's value and sensitivity
  • The declarator agent can't be a validator and even less than the disposal agent
  • The validators must be experts (maintainers) that can validate the resource's condition and authenticity
  • Evidence Documentation: Physical evidence (photos, inspection reports) required
  • Validator Accountability: Validators become liable for false end-of-life approvals
  • Historical Review: Past custodians notified and can challenge the declaration
  • Time-Delayed Finalization: 7-14 day challenge period before final decommissioning
  • Reputation Impact: False end-of-life declarations severely impact declaring agent's reputation
  • Resource final transfer: Resource can not stay with the declaring agent. Validators can transfer the resource to a storage for broken resource in waiting for reparation attempt or definitively decommission it.

Complete Resource Lifecycle

Genesis → Active Use → Service Cycles → End-of-Life → Decommissioned
   ↓         ↓             ↓              ↓             ↓
Creation  Transfers   Maintenance    Declaration   Validation
Receipt   Receipts    Receipts       Receipt       Receipt

This comprehensive lifecycle ensures complete accountability from resource creation through final decommissioning, with enhanced security measures protecting against end-of-life abuse vectors.

PPR Process Flow Diagram

flowchart TB
    subgraph Genesis["Genesis Phase"]
        RC["Resource Creation"]
        Creator["Creator Agent"]
        Validator1["Validator Agent"]
        CreatorReceipt["Receipt: Resource Contribution"]
        ValidatorReceipt["Receipt: Network Validation"]

        RC --> Creator
        RC --> Validator1
        Creator --> CreatorReceipt
        Validator1 --> ValidatorReceipt
    end

    subgraph ActiveUse["Active Use Phase"]
        Transfer["Custody Transfer"]
        CustodianOut["Outgoing Custodian"]
        CustodianIn["Incoming Custodian"]
        OutReceipt["Receipt: Responsible Transfer"]
        InReceipt["Receipt: Custody Acceptance"]

        Transfer --> CustodianOut
        Transfer --> CustodianIn
        CustodianOut --> OutReceipt
        CustodianIn --> InReceipt
    end

    subgraph ServicePhase["Service Phase"]
        ServiceCommitment["Service Commitment"]
        ServiceFulfillment["Service Fulfillment"]
        ServiceAgent["Service Provider"]
        CustodianAgent["Custodian Agent"]
        ResourceRecipient["Resource Recipient"]

        CommitmentReceipt1["Receipt: Commitment Accepted"]
        CommitmentReceipt2["Receipt: Good Faith Transfer"]
        FulfillmentReceipt1["Receipt: Fulfillment Completed"]
        FulfillmentReceipt2["Receipt: Custody Acceptance"]

        ServiceCommitment --> ServiceAgent
        ServiceCommitment --> CustodianAgent
        ServiceAgent --> CommitmentReceipt1
        CustodianAgent --> CommitmentReceipt2

        ServiceFulfillment --> ServiceAgent
        ServiceFulfillment --> ResourceRecipient
        ServiceAgent --> FulfillmentReceipt1
        ResourceRecipient --> FulfillmentReceipt2
    end

    subgraph EndOfLife["End-of-Life Phase"]
        EOLDeclaration["End-of-Life Declaration"]
        DeclaringAgent["Declaring Agent"]
        ExpertValidator["Expert Validator<br/>(2-3 Required)"]
        PastCustodians["Past Custodians<br/>Notification"]
        ChallengePeriod["7-14 Day<br/>Challenge Period"]
        FinalDisposal["Final Disposal/Storage"]
        ValidationReview["Validation Review"]
        EOLReceipt["Receipt: EOL Declaration"]
        ValidationReceipt["Receipt: EOL Validation"]

        EOLDeclaration --> DeclaringAgent
        EOLDeclaration --> ExpertValidator
        EOLDeclaration --> PastCustodians

        ExpertValidator --> ChallengePeriod
        ChallengePeriod -->|No Challenges| FinalDisposal
        ChallengePeriod -->|Challenge Raised| ValidationReview

        DeclaringAgent --> EOLReceipt
        ExpertValidator --> ValidationReceipt
    end

    RC -->|Validated| Transfer
    Transfer -->|May Need Service| ServiceCommitment
    ServiceCommitment --> ServiceFulfillment
    ServiceFulfillment -->|Return to Use| Transfer
    Transfer -->|End of Lifecycle| EOLDeclaration

Key Process Features

  • Bi-directional Receipts: Each economic interaction generates exactly 2 receipts between agents
  • Security Constraints: Multi-validator requirement (2-3 experts) and challenge period for end-of-life restrictions
  • Validation Requirements: Shows expert validators needed and time-based challenge periods
  • Lifecycle Loops: Service phase can cycle multiple times during active resource utilization
  • Complete Accountability: Every phase tracked with appropriate cryptographic receipts

Security Highlights

  • Multi-Validator System: 2-3 expert validators required for end-of-life declarations
  • Challenge Period: 7-14 day window for contesting end-of-life claims
  • Past Custodian Notification: Historical custodians informed of end-of-life events
  • Evidence Documentation: Physical evidence requirements for validation
  • Reputation Impact: False declarations severely impact agent reputation

Post-MVP: Governance Ceremony PPRs

TODO (G6, REQ-GOV-15 — post-MVP): The AffiliationRecord signing ceremony generates a new PPR category. When an agent signs an AffiliationRecord (Terms of Participation, Nondominium & Custodian agreement, Benefit Redistribution Algorithm), the Commitment/EconomicEvent/Claim cycle in zome_governance produces an AffiliationRecordSigned PPR.

AffiliationRecordSigned PPR Properties

  • Bilateral: The witness AgentPubKey countersigns if present at the ceremony
  • Non-transferable and private: Stored as a private entry; cannot be reassigned to another agent
  • Affiliation trigger: The presence of this PPR is the evidence that AffiliationState derivation returns ActiveAffiliate for the signing agent
  • New ParticipationClaimType variant: AffiliationRecordSigned (see governance_zome.md ParticipationClaimType for the full TODO)

Governance Ceremony Flow (Post-MVP)

  1. Agent calls create_affiliation_record() in zome_governance
  2. A Commitment is created: agent commits to Terms of Participation
  3. An EconomicEvent records the signing as a completed governance action
  4. A Claim fulfils the Commitment, producing the AffiliationRecordSigned PPR
  5. AffiliationState derivation in zome_person reads DHT for AffiliationRecord entry → returns ActiveAffiliate for this agent
  6. Agent can now participate in governance processes gated by min_affiliation: ActiveAffiliate (see REQ-GOV-14 and governance.md §3.6.2)

PPR System Security Implementation

Overview

This document outlines the cryptographic security enhancements implemented in the Private Participation Receipt (PPR) system to address the security recommendations from the analysis of GitHub issue #30. Note that the PPR system was inspired by Mark Lizar's work on Digital Notice Consent at the OPN lab https://github.com/0PN-lab

Security Improvements Implemented

1. Cryptographically Secure Hashing

Previous Implementation:

#![allow(unused)]
fn main() {
// Used non-cryptographic DefaultHasher
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
}

Enhanced Implementation:

#![allow(unused)]
fn main() {
// Uses BLAKE2b-256 for cryptographically secure hashing
use hdk::hash::hash_blake2b;

fn create_secure_hash(data: &[u8]) -> ExternResult<[u8; 32]> {
    // Use BLAKE2b-256 for cryptographically secure hashing (32 bytes output)
    let hash_output = hash_blake2b(data.to_vec(), 32)?;

    // Convert Vec<u8> to [u8; 32] array
    if hash_output.len() != 32 {
        return Err(wasm_error!(WasmErrorInner::Guest(
            "Hash output is not 32 bytes".into()
        )));
    }

    let mut hash_array = [0u8; 32];
    hash_array.copy_from_slice(&hash_output);

    Ok(hash_array)
}
}

Security Benefits:

  • BLAKE2b is cryptographically secure and resistant to collision attacks
  • 256-bit output provides excellent security margin
  • Deterministic output for identical inputs
  • Fast performance in WASM environment

2. Enhanced Ed25519 Signature Generation

Previous Implementation:

#![allow(unused)]
fn main() {
// Used placeholder signatures with minimal security
fn create_placeholder_signature() -> ExternResult<Signature> {
    let agent_info = agent_info()?;
    let placeholder_data = b"placeholder_signature_data";
    sign(agent_info.agent_initial_pubkey, placeholder_data.to_vec())
}
}

Enhanced Implementation:

#![allow(unused)]
fn main() {
// Uses proper Ed25519 signing with contextual data
use hdk::ed25519::sign;

// Create provider-specific signing context
fn create_provider_signing_context(
    input: &IssueParticipationReceiptsInput,
    base_data: &[u8],
) -> ExternResult<Vec<u8>> {
    let mut context_data = Vec::new();

    // Add role identifier for context separation
    context_data.extend_from_slice(b"PROVIDER_PPR_SIGNATURE");

    // Add base signing data
    context_data.extend_from_slice(base_data);

    // Add provider-specific context
    context_data.extend_from_slice(&input.provider.get_raw_39());
    context_data.extend_from_slice(&input.receiver.get_raw_39());

    // Add claim type for additional context
    if !input.claim_types.is_empty() {
        context_data.extend_from_slice(format!("{:?}", input.claim_types[0]).as_bytes());
    }

    Ok(context_data)
}
}

Security Benefits:

  • Uses Ed25519 digital signature algorithm (industry standard)
  • Context separation prevents signature reuse attacks
  • Includes participant identity in signing context
  • Timestamp inclusion prevents replay attacks

3. Bilateral Authentication System

Enhanced Bilateral Signature Structure:

#![allow(unused)]
fn main() {
pub struct CryptographicSignature {
    /// Signature from the agent receiving the PPR
    pub recipient_signature: Signature,

    /// Signature from the counterparty agent
    pub counterparty_signature: Signature,

    /// Hash of the data that was signed (for verification)
    pub signed_data_hash: [u8; 32],

    /// Timestamp when the signatures were created
    pub signed_at: Timestamp,
}
}

Implementation Features:

  • Both parties must cryptographically sign the PPR
  • Each party signs with their own private key
  • Different signing contexts prevent cross-contamination
  • Mutual authentication ensures non-repudiation

4. Enhanced Signature Verification

Legacy Verification (Maintained for Compatibility):

#![allow(unused)]
fn main() {
pub fn validate_participation_claim_signature(
    input: ValidateParticipationClaimSignatureInput,
) -> ExternResult<bool> {
    // Verify against signed data hash
    let owner_valid = verify_signature(
        input.owner.clone(),
        input.signature.recipient_signature.clone(),
        input.signature.signed_data_hash.to_vec(),
    )?;

    let counterparty_valid = verify_signature(
        input.counterparty.clone(),
        input.signature.counterparty_signature.clone(),
        input.signature.signed_data_hash.to_vec(),
    )?;

    Ok(owner_valid && counterparty_valid)
}
}

Enhanced Verification with Full Context:

#![allow(unused)]
fn main() {
pub fn validate_participation_claim_signature_enhanced(
    input: EnhancedValidateParticipationClaimSignatureInput,
) -> ExternResult<bool> {
    // Get verification contexts from the integrity zome
    let (owner_context, counterparty_context) = input.signature.get_verification_context(
        &input.owner,
        &input.counterparty,
        &input.original_signing_data,
        &input.owner_claim_type,
        &input.counterparty_claim_type,
    );

    // Verify with full context reconstruction
    let owner_valid = verify_signature(
        input.owner.clone(),
        input.signature.recipient_signature.clone(),
        owner_context,
    )?;

    let counterparty_valid = verify_signature(
        input.counterparty.clone(),
        input.signature.counterparty_signature.clone(),
        counterparty_context,
    )?;

    Ok(owner_valid && counterparty_valid)
}
}

Security Architecture

Context Separation Strategy

The implementation uses context separation to prevent signature reuse and cross-contamination:

  1. Role-Based Contexts:

    • PROVIDER_PPR_SIGNATURE: For providers of services/resources
    • RECEIVER_PPR_SIGNATURE: For receivers of services/resources
    • BILATERAL_PPR_CLAIM: For general bilateral claims
  2. Participant Identity Integration:

    • Signer's public key included in context
    • Counterparty's public key included in context
    • Role-specific claim types included
  3. Temporal Protection:

    • Timestamp inclusion prevents replay attacks
    • Each signature is temporally unique
    • Clock skew tolerance through timestamp validation

Cryptographic Primitives Used

ComponentAlgorithmKey SizeSecurity Level
Digital SignaturesEd2551932 bytes~128 bits
HashingBLAKE2b256 bits256 bits
Key GenerationEd2551932 bytes~128 bits

Security Properties Achieved

  1. Authenticity: Ed25519 signatures ensure message authenticity
  2. Integrity: BLAKE2b hashing detects any data tampering
  3. Non-repudiation: Both parties must sign, preventing denial
  4. Context Binding: Signatures tied to specific contexts
  5. Replay Protection: Timestamp inclusion prevents replay attacks
  6. Forward Security: Private keys never leave secure keystore

Testing and Validation

Cryptographic Test Suite

The implementation includes comprehensive cryptographic tests:

  1. Signature Generation Tests:

    • Validates unique signature generation
    • Tests context separation
    • Verifies timestamp inclusion
  2. Hash Function Tests:

    • Validates BLAKE2b deterministic output
    • Tests collision resistance properties
    • Verifies 256-bit output length
  3. Bilateral Authentication Tests:

    • Tests mutual signature validation
    • Verifies counterparty authentication
    • Tests signature tampering detection
  4. Context Separation Tests:

    • Validates different contexts produce different signatures
    • Tests role-based context separation
    • Verifies participant identity binding

Security Test Results

Test CategoryTest CountPass RateSecurity Level
Signature Generation5100%High
Hash Validation3100%High
Bilateral Auth4100%High
Context Separation3100%High
Tampering Detection2100%High

Performance Impact

Cryptographic Performance Metrics

OperationPrevious (ms)Enhanced (ms)Overhead
Signature Generation~1~2-32-3x
Hash Generation~0.1~0.55x
Signature Verification~1~2-32-3x
PPR Creation~5~10-152-3x

Performance Optimizations

  1. Batch Operations: Multiple signatures processed together
  2. Context Caching: Signing contexts cached when possible
  3. Hash Reuse: Identical data hashes reused within session
  4. Lazy Verification: Verification only when explicitly requested

Migration Strategy

Backward Compatibility

The implementation maintains backward compatibility through:

  1. Legacy Verification Methods: Old verification API preserved
  2. Graceful Degradation: Falls back to hash-only verification if needed
  3. Incremental Adoption: Enhanced verification is opt-in

Migration Path

  1. Phase 1: Deploy enhanced cryptography alongside legacy
  2. Phase 2: Migrate new PPRs to enhanced signatures
  3. Phase 3: Gradually migrate existing PPRs (optional)
  4. Phase 4: Deprecate legacy methods after validation period

Security Recommendations

Production Deployment

  1. Key Management:

    • Ensure lair keystore is properly configured
    • Regular key rotation policies
    • Secure key backup procedures
  2. Monitoring:

    • Log signature failures for security analysis
    • Monitor for unusual signature patterns
    • Track verification performance metrics
  3. Updates:

    • Regular security updates for cryptographic libraries
    • Monitor for algorithm deprecation announcements
    • Implement algorithm agility for future migrations

Operational Security

  1. Verification Requirements:

    • Always verify signatures before trusting PPRs
    • Use enhanced verification for critical operations
    • Implement signature expiration policies
  2. Audit Trail:

    • Maintain logs of all signature operations
    • Track verification results for compliance
    • Regular security audits of PPR integrity
  3. Incident Response:

    • Procedures for handling signature failures
    • Compromise detection and response
    • Recovery procedures for key compromise

Future Enhancements

Planned Improvements

  1. Zero-Knowledge Proofs: For enhanced privacy-preserving reputation
  2. Threshold Signatures: For multi-party PPR validation
  3. Post-Quantum Cryptography: Preparation for quantum-resistant algorithms
  4. Hardware Security Modules: For enhanced key protection

Monitoring and Metrics

  1. Security Metrics:

    • Signature failure rates
    • Verification performance
    • Attack detection rates
  2. Performance Metrics:

    • Average signature generation time
    • Verification throughput
    • Storage overhead
  3. Compliance Metrics:

    • Audit trail completeness
    • Key rotation compliance
    • Security policy adherence

Conclusion

The enhanced PPR cryptographic implementation provides robust security through:

  • Industry-standard Ed25519 digital signatures
  • Cryptographically secure BLAKE2b hashing
  • Bilateral authentication with context separation
  • Comprehensive testing and validation
  • Backward compatibility and migration support

This implementation addresses all critical security recommendations while maintaining performance and usability for the nondominium resource sharing network.


project: nondominium type: architecture status: active created: 2026-04-14 scope: post-mvp

Nondominium Lobby DNA — Architecture Design

Design session: 2026-04-14 Basis: Requirements discovery session + Moss/Weave ecosystem research Scope: Lobby DNA + Group DNA (new) + NDO DNA extensions (zome_gouvernance) Requirements: documentation/requirements/post-mvp/lobby-dna.md


Table of Contents

  1. System context (C4 L1)
  2. Container architecture (C4 L2)
  3. hApp DNA manifest
  4. Lobby DNA schema
  5. Group DNA schema
  6. NDO DNA extensions
  7. Key pipelines
  8. UI component architecture
  9. Moss integration contract
  10. Architecture decision records
  11. Post-MVP extension points

1. System Context (C4 L1)

graph TB
    Agent["Agent (OVN Participant)\n--\nBrowser / Electron / Moss"]
    Lobby["Nondominium hApp\n--\nLobby + Groups + NDOs"]
    Moss["Moss / The Weave\n(optional host runtime)"]
    Flowsta["Flowsta\n(post-MVP)\nCross-app DID + Vault"]
    Unyt["Unyt\n(post-MVP)\nRAVE + Token settlement"]

    Agent -->|"creates/joins groups,\nnavigates NDOs"| Lobby
    Lobby -.->|"Tool applet (optional)"| Moss
    Lobby -.->|"IsSamePersonEntry (post-MVP)"| Flowsta
    Lobby -.->|"RAVE cascade (post-MVP)"| Unyt

Design principle: Nondominium runs fully standalone. Moss, Flowsta, and Unyt are optional integration layers that can be adopted independently (pay-as-you-grow). The same DNA code powers both standalone and Moss-hosted modes.


2. Container Architecture (C4 L2)

Agent identity layers

One physical agent has multiple pubkeys — one per DHT they join. The three-layer model produces three distinct identity records for the same person, bridged by the Group DHT:

Lobby DHT               Group DHT                    NDO DHT
────────────────────    ─────────────────────────    ────────────────────
LobbyAgentProfile       GroupMembership              Person (zome_person)
lobby_pubkey  ────────→ ndo_pubkey_map          ───→ (key that authored
(handle, avatar, bio)   [{ndo_dna_hash,               Person entry)
                          ndo_pubkey}]
LobbyAgentProfilePerson
WhereLobby DHT (one global)Per-NDO DHT (one per community joined)
Pubkeylobby_pubkeyFresh key per NDO DHT
PurposeCross-NDO public faceConstitutional identity within one NDO
GovernsEcosystem-wide handleRoles, PPRs, private data in that NDO

GroupMembership.ndo_pubkey_map is the MVP bridge: it records lobby_pubkey → ndo_pubkey for each NDO so the group can resolve cross-DHT identity without Flowsta. Post-MVP, Flowsta IsSamePersonEntry replaces this with a cryptographic attestation (REQ-LOBBY-INT-01; see flowsta-integration.md).

Implication for implementers: joining an NDO always produces a new AgentPubKey in that DHT and a new Person entry. The LobbyAgentProfile is never modified by NDO joins — it is the stable public handle. GroupMembership is what links the two.


Groups vs organization-NDOs

Groups and organization-NDOs are distinct concepts at different layers and must not be conflated.

A collective entity (cooperative, open value network, project-organisation) has two faces in the Nondominium model: an agent face (AgentContext) through which it participates in economic events, and a resource face (NondominiumIdentity) which is its digital twin as a Resource. The table below describes the resource face; see agent.md §3.1 for the dual-face model and the role of the agent face.

GroupOrganization-NDO (resource face)
What it isLobby-layer coordination spaceThe NondominiumIdentity that is the collective's digital twin as a Resource
Has Layer 0 identityNoYes — lifecycle, property regime, governance
GovernsAgents: membership, work logs, soft linksHow agents interact with the collective as a Resource
Can hold custodyNoNo — custody is held by the collective's agent face (AgentContext as primary_accountable, post-MVP)
Accumulates reputationNoNo — reputation (EconomicEvents, PPRs) accrues to the agent face. Contribution links record individuals' association with the NDO.
Governance layerFlat group rules (coordination, cultural)Full NDO governance (AccountableAgents, lifecycle, Agreement)
PermanentNo — can be abandonedYes — NondominiumIdentity is immutable and permanent

A group typically creates and coordinates around an organization-NDO but does not become it:

Group (coordination layer)
  ├── members: [Alice, Bob, Carol]
  ├── soft links: planned_action=Combine → [SensoricanNDO, LabSpaceNDO]
  └── work logs → SensoricanNDO

SensoricanNDO (org-NDO resource face, its own DHT)
  ├── NondominiumIdentity { regime: Collective, lifecycle: Active }
  ├── AccountableAgents: [Alice, Bob]       ← individual agents
  ├── Agreement { clauses: [...] }
  └── Contributions from Carol, Dave, and other agents (not necessarily group members)

AgentContext { agent_type: Network(sensorica_ndo_hash) }  ← agent face; participates in EconomicEvents

Key architectural rule: an agent does not need to be in a group to contribute to an organization-NDO. Group membership governs group-layer coordination only. NDO membership (joining the NDO DHT) is governed by the NDO's own rules and is independent of any group.

Post-MVP gap (REQ-AGENT-02): EconomicResource.custodian: AgentPubKey currently accepts only individual agent keys. Post-MVP, the AgentContext extension allows the collective's agent face to act as primary_accountable — collective custody, not NDO-as-resource custody.


Three-layer DHT model

graph TB
    subgraph Conductor["Agent's Conductor (one device)"]
        LC["Lobby Cell\nzome_lobby_integrity\nzome_lobby_coordinator"]
        GC1["Group Cell A\nzome_group_integrity\nzome_group_coordinator"]
        GC2["Group Cell B (solo)\nzome_group_integrity\nzome_group_coordinator"]
        NC1["NDO Cell: Electronic Device\nzome_person + zome_resource\n+ zome_gouvernance"]
        NC2["NDO Cell: Power Supply\nzome_person + zome_resource\n+ zome_gouvernance"]
    end

    subgraph LobbyDHT["Lobby DHT (canonical network_seed, global)"]
        LA["LobbyAgentProfile entries"]
        ND["NdoDescriptor entries (public registry)"]
    end

    subgraph GroupDHTs["Group DHTs (per-group, invite-only)"]
        GD1["Group A DHT\nMembership + WorkLogs + SoftLinks"]
        GD2["Group B DHT (solo)\nPersonal workspace"]
    end

    subgraph NdoDHTs["NDO DHTs (per-NDO, constitutional)"]
        ND1["NDO 1: Electronic Device DHT"]
        ND2["NDO 2: Power Supply DHT"]
    end

    LC --> LobbyDHT
    GC1 --> GD1
    GC2 --> GD2
    NC1 --> ND1
    NC2 --> ND2

    GD1 -. "SoftLink (planning, group-governed,\ninvisible to NDO)" .-> ND1
    GD1 -. "SoftLink" .-> ND2
    ND1 == "NdoHardLink (on fulfillment,\nNDO-governed, OVN-licensed,\nimmutable)" ==> ND2

Trust boundaries

LayerTrust modelData storedAnti-spam
Lobby DHTZero-trust, publicAgent handles, NDO metadata stubsValid DnaHash required
Group DHTInvite-trustMembership, work logs, soft links, rulesDHT cost + invite gate
NDO DHTConstitution-trustResources, events, contributions, hard links, smart agreementsAccountable Agent gate

3. hApp DNA Manifest

Standalone deployment

# happ.yaml
manifest_version: '1'
name: nondominium
description: Nondominium OVN resource sharing network

roles:
  - name: lobby
    dna:
      path: ./lobby/lobby.dna
      modifiers:
        network_seed: "nondominium-lobby-v1"  # canonical, hardcoded
    # No cloning: one global Lobby DHT

  - name: group
    dna:
      path: ./group/group.dna
    cloning_limit: 255
    # Cloned per group: network_seed = invite code (or random on create)

  - name: nondominium
    dna:
      path: ./nondominium/nondominium.dna
    cloning_limit: 1024
    # Cloned per NDO: network_seed random on create, shared via NdoDescriptor

New workspace structure

dnas/
  lobby/
    workdir/dna.yaml
    zomes/
      integrity/zome_lobby_integrity/src/lib.rs   # NEW
      coordinator/zome_lobby_coordinator/src/lib.rs  # NEW
  group/
    workdir/dna.yaml
    zomes/
      integrity/zome_group_integrity/src/lib.rs   # NEW
      coordinator/zome_group_coordinator/src/lib.rs  # NEW
  nondominium/                                     # EXISTING, extended
    zomes/
      coordinator/zome_gouvernance/src/hard_link.rs   # NEW file
      coordinator/zome_gouvernance/src/contribution.rs  # NEW file
      coordinator/zome_gouvernance/src/agreement.rs       # NEW file (VF: vf:Agreement)
      integrity/zome_gouvernance/src/lib.rs        # +NdoHardLink, +Contribution, +Agreement

4. Lobby DNA Schema

4.1 Entry types

#![allow(unused)]
fn main() {
/// Public profile for an agent in the Lobby DHT. Permissionless.
#[hdk_entry_helper]
pub struct LobbyAgentProfile {
    pub handle: String,                    // max 64 chars, non-empty
    pub avatar_url: Option<String>,        // must be https:// if present
    pub bio: Option<String>,               // max 500 chars
    pub lobby_pubkey: AgentPubKey,         // must equal action.author
    pub created_at: Timestamp,
}

/// Public descriptor for a registered NDO. Mirrors NondominiumIdentity key fields.
/// Registered by the NDO initiator; lifecycle_stage is the only mutable field.
/// Cannot be deleted (mirrors permanence of NondominiumIdentity).
#[hdk_entry_helper]
pub struct NdoDescriptor {
    pub ndo_name: String,
    pub ndo_dna_hash: DnaHash,
    pub network_seed: String,
    pub ndo_identity_hash: ActionHash,     // Layer 0 anchor inside the NDO DHT
    pub lifecycle_stage: LifecycleStage,
    pub property_regime: PropertyRegime,
    pub resource_nature: ResourceNature,
    pub description: Option<String>,
    pub registered_by: AgentPubKey,        // must equal action.author
    pub registered_at: Timestamp,
}
}
#![allow(unused)]
fn main() {
#[hdk_link_types]
pub enum LinkTypes {
    AllLobbyAgents,           // Path("lobby.agents") -> LobbyAgentProfile
    AgentProfileUpdates,      // LobbyAgentProfile -> LobbyAgentProfile (versioning)
    AllNdoDescriptors,        // Path("lobby.ndos") -> NdoDescriptor
    NdoDescriptorByLifecycle, // Path("lobby.ndo.lifecycle.{Stage}") -> NdoDescriptor
    NdoDescriptorByNature,    // Path("lobby.ndo.nature.{Nature}") -> NdoDescriptor
    NdoDescriptorByRegime,    // Path("lobby.ndo.regime.{Regime}") -> NdoDescriptor
    AgentToRegisteredNdos,    // registered_by pubkey -> NdoDescriptor
    NdoDescriptorUpdates,     // NdoDescriptor -> NdoDescriptor (lifecycle chain)
}
}

4.3 Coordinator API

#![allow(unused)]
fn main() {
// Agent profiles
pub fn upsert_lobby_agent_profile(input: LobbyAgentProfileInput) -> ExternResult<ActionHash>;
pub fn get_lobby_agent_profile(agent: AgentPubKey) -> ExternResult<Option<LobbyAgentProfile>>;
pub fn get_all_lobby_agents(_: ()) -> ExternResult<Vec<LobbyAgentProfileRecord>>;

// NDO descriptor registry
pub fn register_ndo_descriptor(input: RegisterNdoInput) -> ExternResult<ActionHash>;
pub fn update_ndo_descriptor_lifecycle(input: UpdateNdoLifecycleInput) -> ExternResult<ActionHash>;
pub fn get_all_ndo_descriptors(_: ()) -> ExternResult<Vec<NdoDescriptorRecord>>;
pub fn get_ndo_descriptors_by_lifecycle(stage: LifecycleStage) -> ExternResult<Vec<NdoDescriptorRecord>>;
pub fn get_ndo_descriptors_by_nature(nature: ResourceNature) -> ExternResult<Vec<NdoDescriptorRecord>>;
pub fn get_ndo_descriptors_by_regime(regime: PropertyRegime) -> ExternResult<Vec<NdoDescriptorRecord>>;
pub fn get_my_registered_ndos(_: ()) -> ExternResult<Vec<NdoDescriptorRecord>>;
}

4.4 Validation rules

create LobbyAgentProfile:
  handle non-empty, max 64 chars
  lobby_pubkey == action.author
  avatar_url starts with "https://" if present

update LobbyAgentProfile:
  author == original.lobby_pubkey (self-only)
  lobby_pubkey field immutable

delete LobbyAgentProfile: INVALID (permanent anchor)

create NdoDescriptor:
  registered_by == action.author
  ndo_name non-empty
  lifecycle_stage not Deprecated or EndOfLife at registration

update NdoDescriptor:
  author == original.registered_by
  only lifecycle_stage may change
  follows NondominiumIdentity state machine rules

delete NdoDescriptor: INVALID (mirrors Layer 0 permanence)

5. Group DNA Schema

5.1 Entry types

#![allow(unused)]
fn main() {
/// Immutable group descriptor. Created by the progenitor on first launch.
#[hdk_entry_helper]
pub struct GroupDescriptor {
    pub name: String,                      // max 128 chars
    pub description: Option<String>,
    pub progenitor: AgentPubKey,           // must equal action.author
    pub is_solo: bool,                     // true = personal group-of-one
    pub created_at: Timestamp,
}
// Immutable after creation.

/// Per-agent membership. Stores the cross-DHT pubkey map (Moss pattern).
#[hdk_entry_helper]
pub struct GroupMembership {
    pub agent_pubkey: AgentPubKey,         // must equal action.author
    pub invited_by: Option<AgentPubKey>,
    pub ndo_pubkey_map: Vec<NdoPubkeyEntry>, // cross-DHT identity bridge (MVP)
    pub joined_at: Timestamp,
}

/// Maps group pubkey to NDO-DHT pubkey for one NDO. Stored inside GroupMembership.
#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub struct NdoPubkeyEntry {
    pub ndo_dna_hash: DnaHash,
    pub ndo_pubkey: AgentPubKey,
    pub joined_ndo_at: Timestamp,
}

/// Informal work record. Lives in Group DHT only. Invisible to target NDO.
/// VF alignment: maps to vf:Intent (expressed desire to perform work before committing).
///   `provider`     = VF provider (the intending agent)
///   `action`       = VF action (Work, Modify, Use, etc.)
///   `effort_quantity` = VF effortQuantity (hours as numeric value)
///   `note`         = VF note (human-readable description)
///   `input_of`     = VF inputOf (string label for MVP; ActionHash of vf:Process post-MVP)
#[hdk_entry_helper]
pub struct WorkLog {
    pub provider: AgentPubKey,             // VF: provider; must equal action.author
    pub action: VfAction,                  // VF: action (typically Work, Modify, Use)
    pub ndo_dna_hash: DnaHash,
    pub ndo_identity_hash: ActionHash,
    pub input_of: Option<String>,          // VF: inputOf — process label ("maintenance", "development")
                                           // Post-MVP: becomes Option<ActionHash> referencing vf:Process
    pub note: String,                      // VF: note — max 2000 chars
    pub effort_quantity: Option<f64>,      // VF: effortQuantity — hours; range [0.0, 10000.0]
    pub attachments: Vec<String>,
    pub has_point_in_time: Timestamp,      // VF: hasPointInTime
}

/// Soft link: group-level planning relationship to an NDO. Permissionless.
/// Invisible to target NDO. Subject to group governance only.
/// VF alignment: maps to a group-side record of a vf:Intent toward an NDO.
///   `planned_action` = the VF action being planned (Combine, Use, Cite).
///   `fulfills`       = optional reference to a vf:Commitment on the NDO DHT once created.
#[hdk_entry_helper]
pub struct SoftLink {
    pub from_ndo_dna_hash: Option<DnaHash>,
    pub from_ndo_identity_hash: Option<ActionHash>,
    pub to_ndo_dna_hash: DnaHash,
    pub to_ndo_identity_hash: ActionHash,
    /// VF action this link is planning toward:
    ///   Combine  — structural incorporation (Incorporation intent)
    ///   Use      — tool/equipment use
    ///   Cite     — lifecycle monitoring only
    pub planned_action: VfAction,
    pub fulfills: Option<ActionHash>,      // VF: fulfills — NDO DHT Commitment hash when created
    pub created_by: AgentPubKey,           // must equal action.author
    pub created_at: Timestamp,
    pub note: Option<String>,              // VF: note
}

/// Group governance rule (flat string MVP; typed enum post-MVP).
#[hdk_entry_helper]
pub struct GroupGovernanceRule {
    pub rule_name: String,
    pub rule_data: String,
    pub created_by: AgentPubKey,           // must be progenitor (MVP)
    pub created_at: Timestamp,
}
}
#![allow(unused)]
fn main() {
#[hdk_link_types]
pub enum LinkTypes {
    AllMembers,          // Path("group.members") -> GroupMembership
    MembershipUpdates,   // GroupMembership -> GroupMembership (ndo_pubkey_map updates)
    AgentToMembership,   // AgentPubKey -> GroupMembership (fast self-lookup)
    AllWorkLogs,         // Path("group.worklogs") -> WorkLog
    AgentToWorkLogs,     // AgentPubKey -> WorkLog
    NdoToWorkLogs,       // ndo_identity_hash -> WorkLog
    AllSoftLinks,        // Path("group.softlinks") -> SoftLink
    SoftLinkToNdo,       // ndo_identity_hash -> SoftLink (by target NDO)
    AllGovernanceRules,  // Path("group.rules") -> GroupGovernanceRule
    GovernanceRuleUpdates, // GroupGovernanceRule -> GroupGovernanceRule
}
}

5.3 Coordinator API

#![allow(unused)]
fn main() {
// Initialization
pub fn init_group(input: InitGroupInput) -> ExternResult<ActionHash>;
pub fn get_group_descriptor(_: ()) -> ExternResult<Option<GroupDescriptor>>;

// Membership
pub fn join_group(input: JoinGroupInput) -> ExternResult<ActionHash>;
pub fn update_ndo_pubkey_map(input: UpdateNdoPubkeyMapInput) -> ExternResult<ActionHash>;
pub fn get_all_members(_: ()) -> ExternResult<Vec<GroupMembershipRecord>>;
pub fn get_member_ndo_pubkey(input: GetMemberNdoPubkeyInput) -> ExternResult<Option<AgentPubKey>>;

// Work logs
pub fn log_work(input: LogWorkInput) -> ExternResult<ActionHash>;
pub fn get_work_logs(ndo_filter: Option<DnaHash>) -> ExternResult<Vec<WorkLogRecord>>;
pub fn get_my_work_logs(_: ()) -> ExternResult<Vec<WorkLogRecord>>;

// Soft links
pub fn create_soft_link(input: CreateSoftLinkInput) -> ExternResult<ActionHash>;
pub fn delete_soft_link(soft_link_hash: ActionHash) -> ExternResult<()>;
pub fn get_all_soft_links(_: ()) -> ExternResult<Vec<SoftLinkRecord>>;
pub fn get_soft_links_to_ndo(ndo_identity_hash: ActionHash) -> ExternResult<Vec<SoftLinkRecord>>;

// Governance
pub fn add_governance_rule(rule: GroupGovernanceRule) -> ExternResult<ActionHash>;
pub fn get_governance_rules(_: ()) -> ExternResult<Vec<GroupGovernanceRuleRecord>>;
}

5.4 Validation rules

create GroupDescriptor:
  progenitor == action.author
  name non-empty, max 128 chars
update GroupDescriptor: INVALID (immutable)

create GroupMembership:
  agent_pubkey == action.author

create WorkLog:
  provider == action.author
  note non-empty, max 2000 chars
  effort_quantity if present in [0.0, 10000.0]
  action must be a valid VfAction (Work, Modify, Use, etc.)

create SoftLink:
  created_by == action.author
  to_ndo_dna_hash non-empty
  planned_action must be Combine | Use | Cite
  if planned_action == Combine: from_ndo_* fields must both be Some

delete SoftLink:
  author == original.created_by OR author == progenitor

create GroupGovernanceRule:
  MVP: author must be progenitor
  rule_name non-empty

6. NDO DNA Extensions

New entry types and coordinator functions added to the existing zome_gouvernance. All existing entry types are unchanged.

6.1 New entry types

#![allow(unused)]
fn main() {
/// Permanent, validated structural link between two NDOs.
/// Created only on EconomicEvent Fulfillment. Immutable and undeletable.
/// Intrinsic to the NDO DHT (OVN license requirement).
#[hdk_entry_helper]
pub struct NdoHardLink {
    pub from_ndo_identity_hash: ActionHash, // Layer 0 hash of this (parent) NDO
    pub to_ndo_dna_hash: DnaHash,
    pub to_ndo_identity_hash: ActionHash,   // Layer 0 hash of the component NDO
    pub link_type: NdoLinkType,
    pub fulfillment_hash: ActionHash,       // EconomicEvent backing this link
    pub created_by: AgentPubKey,            // must be AccountableAgent
    pub created_at: Timestamp,
}

#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum NdoLinkType {
    Component,    // target is a structural component of source
    DerivedFrom,  // source was derived/forked from target
    Supersedes,   // source formally replaces target in the network
}

/// Peer-validated work contribution. Created after AccountableAgent acceptance.
/// VF alignment: a validated vf:EconomicEvent (action: Work or Modify) with NDO-specific
/// validation metadata. Field names follow VF vocabulary directly:
///   `provider`        = VF provider (contributing agent)
///   `action`          = VF action (Work, Modify, etc.)
///   `effort_quantity` = VF effortQuantity
///   `note`            = VF note
///   `input_of`        = VF inputOf (Process ActionHash)
///   `fulfills`        = VF fulfills (Commitment ActionHash, when applicable)
#[hdk_entry_helper]
pub struct Contribution {
    pub provider: AgentPubKey,             // VF: provider (the contributing agent)
    pub action: VfAction,                  // VF: action — typically Work or Modify
    pub work_log_group_dna_hash: Option<DnaHash>,  // NDO extension: off-chain WorkLog reference
    pub work_log_action_hash: Option<ActionHash>,  // NDO extension: off-chain WorkLog reference
    pub ndo_identity_hash: ActionHash,
    pub input_of: Option<ActionHash>,      // VF: inputOf — Process ActionHash (NDO DHT)
    pub note: String,                      // VF: note
    pub effort_quantity: Option<f64>,      // VF: effortQuantity (hours)
    pub validated_by: Vec<AgentPubKey>,    // NDO extension: AccountableAgent validators (min 1)
    pub fulfills: Option<ActionHash>,      // VF: fulfills — Commitment ActionHash if applicable
    pub has_point_in_time: Timestamp,      // VF: hasPointInTime (when work was done)
    pub validated_at: Timestamp,           // NDO extension: when AccountableAgents accepted
}

/// Benefit redistribution agreement. AccountableAgent-controlled. Versioned.
/// VF alignment: extends vf:Agreement. The `clauses` field is an NDO extension —
/// VF Agreement does not prescribe internal structure; NDO uses typed clauses for
/// benefit distribution, which Unyt will execute as RAVE flows post-MVP.
#[hdk_entry_helper]
pub struct Agreement {                     // VF: vf:Agreement
    pub ndo_identity_hash: ActionHash,
    pub version: u32,                      // NDO extension: monotonic version counter
    pub clauses: Vec<BenefitClause>,       // NDO extension: typed benefit distribution rules
    pub primary_accountable: Vec<AgentPubKey>, // VF: primaryAccountable (who governs this agreement)
    pub created_by: AgentPubKey,
    pub created_at: Timestamp,
}

/// One benefit distribution clause within an Agreement.
/// NDO extension on VF — not in VF core. Executed via Unyt RAVE post-MVP.
#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub struct BenefitClause {
    pub receiver: BeneficiaryRef,          // VF: receiver (agent or component NDO)
    pub share_percent: f64,                // 0.0 to 100.0 (NDO: proportion of total benefit)
    pub benefit_type: BenefitType,         // NDO extension: Monetary | GovernanceWeight | AccessRight
    pub note: Option<String>,              // VF: note (conditions, rationale)
}

#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub enum BeneficiaryRef {
    Agent(AgentPubKey),
    NdoComponent { ndo_dna_hash: DnaHash, ndo_identity_hash: ActionHash },
}

#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub enum BenefitType {
    Monetary,                 // Unyt token distribution (post-MVP)
    GovernanceWeight,         // voting weight in NDO governance
    AccessRight(String),      // e.g. "use_equipment", "read_design"
}
}
#![allow(unused)]
fn main() {
// Add to existing zome_gouvernance_integrity LinkTypes:
NdoToHardLinks,         // from_ndo_identity_hash -> NdoHardLink
HardLinkByType,         // Path("ndo.hardlink.{NdoLinkType}") -> NdoHardLink
NdoToContributions,     // ndo_identity_hash -> Contribution
AgentToContributions,   // VF: provider AgentPubKey -> Contribution
ContributionToEvent,    // VF: Contribution -> EconomicEvent (the fulfilling event)
NdoToAgreement,         // ndo_identity_hash -> Agreement (latest)  [VF: vf:Agreement]
AgreementUpdates,       // Agreement -> Agreement (version chain)
}

6.3 New coordinator functions

#![allow(unused)]
fn main() {
// hard_link.rs
pub fn create_ndo_hard_link(input: CreateNdoHardLinkInput) -> ExternResult<ActionHash>;
pub fn get_ndo_hard_links(_: ()) -> ExternResult<Vec<NdoHardLinkRecord>>;
pub fn get_ndo_hard_links_by_type(link_type: NdoLinkType) -> ExternResult<Vec<NdoHardLinkRecord>>;

// contribution.rs
pub fn validate_contribution(input: ValidateContributionInput) -> ExternResult<ActionHash>;
pub fn get_ndo_contributions(_: ()) -> ExternResult<Vec<ContributionRecord>>;
pub fn get_agent_contributions(provider: AgentPubKey) -> ExternResult<Vec<ContributionRecord>>;

// agreement.rs  (VF: vf:Agreement — renamed from smart_agreement.rs)
pub fn create_agreement(input: CreateAgreementInput) -> ExternResult<ActionHash>;
pub fn update_agreement(input: UpdateAgreementInput) -> ExternResult<ActionHash>;
pub fn get_current_agreement(_: ()) -> ExternResult<Option<AgreementRecord>>;
}

6.4 Validation rules

create NdoHardLink:
  author must hold AccountableAgent or PrimaryAccountableAgent role (cross-zome check)
  fulfillment_hash must resolve to valid EconomicEvent in this DHT
  event.action must be Work | Produce | Combine | Modify
  from_ndo_identity_hash must exist in this DHT

update NdoHardLink: INVALID (hard links are immutable)
delete NdoHardLink: INVALID (hard links are permanent, OVN license requirement)

create Contribution:
  validated_by must be non-empty (at least one AccountableAgent)
  provider == action.author OR a delegated AccountableAgent
  note non-empty
  effort_quantity if present in [0.0, 10000.0]
  action must be Work | Modify | Combine | Produce

create Agreement:
  author must hold AccountableAgent or PrimaryAccountableAgent role (cross-zome check)
  primary_accountable non-empty
  all clause.share_percent in [0.0, 100.0]
  sum of clause.share_percent <= 100.0

update Agreement:
  author must hold AccountableAgent or PrimaryAccountableAgent role (cross-zome check)
  version must equal previous.version + 1
  ndo_identity_hash immutable

delete Agreement: INVALID (versioned history must be preserved; supersede via update)

7. Key Pipelines

sequenceDiagram
    participant GM as Group Member
    participant GD as Group DHT
    participant ND as NDO DHT (Device)
    participant AA as Accountable Agent

    GM->>GD: create_soft_link(planned_action: Combine, PowerSupplyNdo)
    Note over GD: SoftLink created (dashed in UI)

    GM->>ND: create_commitment(action: Combine, DeviceNdo, PowerSupplyRef)
    GM->>GD: update soft_link.fulfills = commitment_hash

    GM->>ND: propose EconomicEvent (like a pull request)

    AA->>ND: validate_contribution(work_log_ref, event_hash)
    Note over ND: Contribution created

    AA->>ND: create_ndo_hard_link(PowerSupplyNdo, fulfillment_hash)
    Note over ND: NdoHardLink created (solid, OVN-licensed, immutable)

    AA->>ND: update_agreement (add BenefitClause: receiver = PowerSupplyNdo, X%)
    Note over ND: Agreement updated: cascade clause to PowerSupplyNdo

    GM->>GD: delete_soft_link (promoted)

7.2 Process pipeline (Work Log to Contribution)

sequenceDiagram
    participant GM as Group Member
    participant GD as Group DHT
    participant ND as NDO DHT (Equipment)
    participant AA as Accountable Agent

    GM->>GD: create_soft_link(Use, EquipmentNdo)
    GM->>GD: log_work(EquipmentNdo, "maintenance", 3h)
    Note over GD: WorkLog: informal, invisible to NDO

    GM->>ND: propose EconomicEvent(Work, Maintenance)
    Note over ND: NDO state: Active -> InMaintenance

    AA->>ND: validate_contribution(work_log_ref, event_hash)
    Note over ND: Contribution created; agent in contributor list

    AA->>ND: update_lifecycle_stage(Active)
    Note over ND: NDO state: InMaintenance -> Active

7.3 Group join pipeline (with identity map)

sequenceDiagram
    participant Bob
    participant LC as Lobby Cell
    participant GC as Group Cell
    participant NC as NDO Cell

    Bob->>LC: get_all_ndo_descriptors() [browse freely]
    Note over Bob: finds group via invite code out-of-band

    Bob->>GC: join_group(invite_code, ndo_pubkey_map=[])
    Note over GC: GroupMembership created

    Bob->>NC: [install nondominium.dna with NDO network_seed]
    Note over NC: New AgentPubKey in this NDO DHT

    Bob->>GC: update_ndo_pubkey_map({EquipmentNdo: bob_ndo_pubkey})
    Note over GC: Identity bridge: group_pubkey -> ndo_pubkey stored

8. UI Component Architecture

Built with Svelte 5 + UnoCSS + Melt UI (matching existing stack).

App.svelte
  conductorClient: AppClient
  activeCells: Map<string, CellId>    // lobby, group-N, ndo-N

LobbyView.svelte
  GroupSidebar.svelte
    GroupCard.svelte          { name, member count, NDO count, solo badge }
    CreateGroupModal.svelte
    JoinGroupModal.svelte     { invite code input }
  NdoBrowser.svelte
    NdoFilter.svelte          { lifecycle, nature, regime }
    NdoCard.svelte            { name, lifecycle badge (color-coded), regime chip }
  LobbyAgentProfile.svelte

GroupView.svelte
  GroupHeader.svelte          { name, member count, rules }
  MemberList.svelte
  NdoLinkList.svelte
    SoftLinkCard.svelte       { border-dashed, purpose badge, commitment status }
    PromotedLinkCard.svelte   { border-solid green, hard link confirmed }
    AddNdoLinkModal.svelte    { planned_action: Combine | Use | Cite }
  WorkLogFeed.svelte
    WorkLogCard.svelte        { author, NDO, hours, status: pending|submitted|validated }
    LogWorkModal.svelte
  CommitmentBoard.svelte      { Kanban: Planned -> Submitted -> Validated }

NdoView.svelte
  NdoHeader.svelte            { name, lifecycle badge, regime, nature, description }
  CompositionGraph.svelte     { D3: NDO nodes + hard link edges, zoomable }
    NdoNode.svelte            { color = lifecycle stage }
    HardLinkEdge.svelte       { solid line, NdoLinkType label }
  ProcessTimeline.svelte      { EconomicEvents, state transitions }
  ContributorList.svelte      { validated agents, contribution counts }
  AgreementPanel.svelte       { benefit clauses (VF: Agreement), read-only for non-AccountableAgents }
  GovernancePanel.svelte      { AccountableAgents, rules, create hard link action }

Visual conventions

ElementStyleMeaning
Soft link cardborder-dashed border-gray-400Planning, not yet real
Promoted linkborder-solid border-green-500Hard link confirmed
Hard link edgeSolid 2px blue strokePermanent, OVN-licensed
AccountableAgent actionbg-amber-100 buttonGovernance-gated

9. Moss Integration Contract

When deployed inside Moss, Nondominium appears as one Tool applet. Moss handles: group invites, agent identity at the surface, and the app sidebar. Nondominium owns its internal complexity (Group DHTs, NDO DHTs, hard links, smart agreements).

Moss vs standalone feature map

FeatureStandaloneInside Moss
Group creationLobby DNA (new DHT)Moss group (Moss DHT)
Invite codesGroup DNAMoss invite system
Agent identity (lobby)LobbyAgentProfileMoss profile
Cross-NDO identityGroupMembership.ndo_pubkey_mapAppletToJoinedAgent links
NDO registryLobby DHTNondominium Lobby Tool DHT
Cross-tool asset refsN/AWAL (Weave Asset Locator)
NDO DHTsCloned cellsCloned cells (same)

Moss Tool entry point (TypeScript)

// ui/src/we-applet.ts
export default {
  async appletServices(weaveClient: WeaveClient): Promise<AppletServices> {
    return {
      search: async (filter: string) => {
        const ndos = await weaveClient.callZome(
          { role: 'lobby', zome: 'zome_lobby_coordinator' },
          'get_all_ndo_descriptors', null
        );
        return ndos
          .filter(ndo => ndo.entry.ndo_name.toLowerCase().includes(filter.toLowerCase()))
          .map(ndo => ({
            hrl: [ndo.entry.ndo_dna_hash, ndo.action_hash],
            context: { type: 'ndo', lifecycle: ndo.entry.lifecycle_stage },
          }));
      },
      getAssetInfo: async (hrl) => { /* resolve HRL to NDO metadata */ },
      openAsset: (hrl) => { /* navigate to NdoView */ },
    };
  },
};

10. Architecture Decision Records

ADR-01: Group-per-DHT

Status: Accepted

Decision: Each Group occupies its own DHT (like Moss groups), not entries in the Lobby DHT.

Rationale: DHT isolation gives each group independent governance and natural anti-spam (creating a DHT has computational cost). Invite-only means no public spam registration. NDO discoverability is graph-based (through group relationships).

Trade-off: Conductor manages N group cells. Acceptable at expected OVN community scale.


Status: Accepted

Decision: Soft links live entirely in the Group DHT. NDOs are never aware of who links to them.

Rationale: Permissionless linking is safe when the NDO has zero awareness of it. NDO state changes require explicit AccountableAgent validation regardless. Groups can monitor any NDO freely without creating governance burden on the NDO.


Status: Accepted

Decision: NdoHardLink entries are created only on validated EconomicEvent Fulfillment. Commitments create soft links (planning). Fulfillments create hard links (reality).

Rationale: OVN license requirement: hard links represent what has actually happened, not what was planned. A hard link is cryptographically backed by a specific EconomicEvent.


ADR-04: Lobby network seed is canonical and hardcoded

Status: Accepted

Decision: network_seed: "nondominium-lobby-v1" is hardcoded in happ.yaml.

Rationale: All users must share one global Lobby DHT. A fork with a different seed creates a fragmented network. The canonical seed is the authoritative Nondominium network identifier.

Consequence: Seed changes require a coordinated migration; old Lobby DHT remains readable.


ADR-05: MVP identity via conductor bridge calls; Flowsta post-MVP

Status: Accepted

Decision: MVP uses GroupMembership.ndo_pubkey_map per Moss's AppletToJoinedAgent pattern. Same conductor holds all cells; bridge calls resolve identity intra-conductor.

Rationale: Sufficient for single-conductor use (one device, one user). Multi-device and multi-conductor federation requires Flowsta IsSamePersonEntry.

Forward compatibility: ndo_pubkey_map schema allows Flowsta DID addition without breaking existing records.


Status: Accepted

Decision: No updates or deletions permitted on NdoHardLink entries.

Rationale: OVN license semantics: if a power supply was incorporated into a device at time T, that historical fact is permanent even if the device is later disassembled. Allowing deletion would enable retroactive manipulation of contribution history and benefit attribution. The Agreement can be updated to change future benefit flows; the historical link stands.


ADR-07: Agreement is versioned, not replaced

Status: Accepted

Decision: Agreement (VF: vf:Agreement) updates create a new versioned entry linked via AgreementUpdates. Full history preserved. version: u32 enables fast "is this latest?" checks without full chain traversal.

Rationale: Contribution attribution at time T should reference the Agreement version active at T. Full audit history supports OVN accounting and Unyt RAVE integration.


11. Post-MVP Extension Points

Flowsta integration (REQ-NDO-CS-12 through CS-15)

Replace GroupMembership.ndo_pubkey_map with FlowstaIdentity capability slots on Person entries. Each agent's lobby, group, and NDO pubkeys are linked via IsSamePersonEntry dual-signed attestations. W3C DID becomes the stable cross-network identity anchor.

See documentation/requirements/post-mvp/flowsta-integration.md.

Unyt integration (benefit cascade)

Agreement.clauses with BenefitType::Monetary activate via Unyt:

  • Validated Contribution triggers a RAVE event in the Unyt cell
  • NdoHardLink of type Component triggers cascade: parent NDO RAVE distributions include a percentage flowing to the component NDO's Agreement
  • Monetary contributions routed via Lobby: donate_to_ndo(ndo_dna_hash, amount)

See documentation/requirements/post-mvp/unyt-integration.md.

Many-to-many flows (REQ-MMF-*)

NdoHardLink creation currently requires one AccountableAgent signature. Post-MVP: multi-party consent for structural incorporation per documentation/requirements/post-mvp/many-to-many-flows.md.

Typed group governance

GroupGovernanceRule.rule_data: String (JSON MVP) evolves to a typed enum matching the NDO GovernanceRule pattern, enabling programmatic group governance evaluation.

ValueFlows DSL - Technical Specifications

Companion document to ValueFlows DSL Requirements


Table of Contents

  1. Language Syntax and Grammar
  2. Validation Pipeline
  3. Governance Rule DSL
  4. Security Model
  5. Performance Optimization
  6. Migration and Versioning
  7. Testing Framework
  8. CLI Interface Specification
  9. Parser Architecture
  10. Compilation Pipeline

1. Language Syntax and Grammar

1.1 Language Design Philosophy

The DSL follows a progressive enhancement strategy with three tiers:

Tier 1: Pure Declarative (MVP)

  • Entity definitions with properties
  • Static relationships and references
  • Template-based bulk operations
  • No variables or control flow
  • Target: Network administrators bootstrapping networks

Tier 2: Template-Based Operations (Phase 2)

  • Bulk operations with wildcards (* 5 syntax)
  • Conditional updates with where clauses
  • Template inheritance and composition
  • Basic expression evaluation
  • Target: Power users managing dynamic inventories

Tier 3: Full Scripting (Future)

  • Variables and constants
  • Loops and iteration
  • Conditionals and branching
  • Function definitions
  • Target: Developers creating complex automation

1.2 Grammar Specification (EBNF-like)

<program> ::= <statement>*

<statement> ::= <network_decl>
              | <agents_decl>
              | <resources_decl>
              | <resource_specs_decl>
              | <governance_decl>
              | <recipe_decl>
              | <event_decl>
              | <transaction_decl>

<entity_decl> ::= <identifier> ':' <type> '{' <property_list> '}'

<property_list> ::= <property>*
<property> ::= <identifier> ':' <value>

<value> ::= <string>
          | <number>
          | <boolean>
          | <identifier>  # reference
          | <list>
          | <duration>

<duration> ::= <number> <unit>
<unit> ::= 's' | 'm' | 'h' | 'd' | 'w'

1.3 Core Language Constructs

1.3.1 Network Declaration

network <identifier> {
  created: <date>
  jurisdiction: <string>
  [optional properties...]
}

Example:

network FabLabMontreal {
  created: 2025-01-15
  jurisdiction: Quebec
}

1.3.2 Agent Declaration

agents {
  organization <name> {
    type: <org_type>
    location: <string>
    [...]
  }

  person <name> {
    roles: [<role>, ...]
    [...]
  }
}

Organization Types:

  • OpenValueNetwork
  • Cooperative
  • NonProfit
  • ForProfit
  • Informal

1.3.3 Resource Specification Declaration

resource_specifications {
  <spec_name> {
    governance: <governance_model>
    accounting: <accounting_method>
    [...]
  }
}

Governance Models:

  • commons_stewardship - Shared resource managed by stewards
  • pool_contribution - Contributory pooling
  • private_ownership - Individual or group ownership
  • shared_custody - Joint custody arrangement

Accounting Methods:

  • use_tracking - Track usage events
  • quantity_consumed - Track consumed quantities
  • transfer_tracking - Track transfers
  • none - No accounting

1.3.4 Resource Declaration

resources {
  <resource_name> : <specification> {
    custodian: <agent>
    location: <string>
    quantity: <number> <unit>?
    [...]
  }

  # Bulk creation
  <fleet_name> : <specification> * <count> {
    [...]
  }
}

1.3.5 Governance Rule Declaration

See Section 3: Governance Rule DSL for complete syntax.

1.3.6 Recipe Declaration

recipe <name> {
  inputs:
    <resource> <quantity> <unit>? (<action>)
    [...]

  work:
    <work_type> <duration>
    [...]

  outputs:
    <resource> <quantity> <unit>? (<action>)
    [...]
}

Action Types:

  • consume - Resource consumed in process
  • use - Resource used without consumption
  • cite - Referenced but not used
  • produce - Resource produced by process

2. Validation Pipeline

2.1 Five-Phase Validation

The DSL implements a comprehensive validation pipeline:

Phase 1: Syntax Validation (Parse-Time)

  • Grammar compliance checking
  • Token and structural validation
  • Immediate feedback with line/column numbers

Phase 2: Semantic Validation (Type Checking)

  • Unit compatibility (e.g., cannot assign "hours" to "kilograms")
  • Resource specification matching
  • Agent role compatibility
  • Data type validation

Phase 3: Reference Integrity (Existence Checks)

  • Agent references must exist or be defined in script
  • Resource specification references must be valid
  • Location and organization references verified
  • Forward references allowed within same script

Phase 4: Economic Logic Validation

  • Process input/output balance checking
  • Valid action sequences (e.g., cannot consume before produce)
  • Quantity conservation laws
  • Temporal consistency (events in chronological order)

Phase 5: Governance Compliance

  • Rule coverage analysis (are all resources covered?)
  • Conflict detection between rules
  • Access control validation
  • Approval workflow completeness

2.2 Error Handling Strategy

Error TypeSeverityRecoveryExample
Syntax ErrorFatalMust fixMissing closing brace
Type MismatchFatalMust fixAssigning "kg" to time field
Unknown ReferenceFatalMust fix or createAgent not found
Logic WarningWarningOptional fixProcess doesn't balance
Style IssueInfoOptional fixInconsistent naming

2.3 Validation Commands

nondom validate --strict script.vf    # Treat warnings as errors
nondom validate --phase 2 script.vf   # Stop after semantic validation
nondom validate --explain script.vf   # Detailed explanations

2.4 Error Message Format

$ nondom validate script.vf

error[E0301]: unknown agent reference
  --> script.vf:25:12
   |
25 |     custodian: UnknownOrg
   |                ^^^^^^^^^^ agent not found
   |
   = hint: create agent first or use `or_default` fallback
   = help: see https://docs.nondominium.org/dsl/errors/E0301

warning[W0201]: process doesn't balance
  --> script.vf:42:5
   |
42 | recipe MakePart { ... }
   |    ---- outputs exceed inputs by 2 units
   |
   = note: this may be intentional for additive manufacturing

3. Governance Rule DSL

3.1 Rule Definition Syntax

governance {
  rule <name> {
    # Basic properties
    applies_to: <resource_spec>
    requires_role: <role>
    max_booking_duration: <duration>
    requires_approval_when: <condition>
    approvers: [<role>, ...]

    # Temporal constraints
    valid_from: <date>
    valid_until: <date>

    # Condition composition
    conditions {
      operating_hours: <time_range>
      excluded_days: [<day>, ...]
    }
  }
}

3.2 Rule Composition Operators

3.2.1 Logical Operators

rule AdvancedEquipment {
  applies_to: Equipment AND category == "Precision"
  requires: (role == Member OR role == Technician)
  NOT blacklisted
}

Operators:

  • AND - Both conditions must be true
  • OR - At least one condition must be true
  • NOT - Condition must be false
  • Parentheses () for grouping

3.2.2 Priority Specification

governance {
  rule BasicAccess { priority: 100 }
  rule EmergencyOverride { priority: 1000 }  # Higher wins
}

Conflict Resolution Order:

  1. Priority ordering (higher wins)
  2. Most specific rule (more conditions wins)
  3. Most recent definition
  4. Explicit combination via combine_with

3.2.3 Rule Inheritance and Composition

# Base rule template
template EquipmentRule {
  requires_role: Member
  max_booking: 4h
}

# Specialized rules inherit from template
rule CNC_Machines : EquipmentRule {
  applies_to: CNC_Router
  requires_approval_when: duration > 2h
  approvers: [Senior_Technician]
}

rule BasicTools : EquipmentRule {
  applies_to: HandTools
  requires_approval: false  # Override
}

3.3 Temporal Validity and Scheduling

rule SeasonalEquipment {
  applies_to: Outdoor_Equipment

  # Season-based availability
  schedule {
    available: April-September
    unavailable: October-March
  }

  # Time-of-day restrictions
  time_windows {
    weekday: 9am-9pm
    weekend: 10am-6pm
  }
}

3.4 Rule Testing and Validation

# Test cases can be embedded
governance {
  rule EquipmentBooking {
    # ... rule definition ...
  }

  test "Weekend booking requires approval" {
    given: EquipmentBooking
    when: agent.role == Member AND day == Saturday
    then: requires_approval == true
  }
}

4. Security Model

4.1 Authentication and Authorization

Agent Authentication:

  • Scripts execute with the permissions of the authenticated agent
  • Agent identity verified through Holochain's signature system
  • Cross-agent operations require explicit capability grants
# Script can declare required permissions
permissions {
  require: [create_resource, transfer_resource]
  as_agent: Alice
  delegate_to: Bob  # Allow Bob to act on behalf
}

4.2 Capability-Based Access Control

Capability Token Validation:

  • All operations validated against Nondominium's capability tokens
  • Role-based access enforced at zome level
  • Temporary capabilities for time-limited operations
# Request specific capabilities for script execution
capabilities {
  create_resources: 100          # Max 100 resources
  duration: 1h                   # Session timeout
  renewable: false               # One-time execution
}

4.3 Data Privacy and Sensitive Information

Private Data Handling:

  • Encrypted profile fields never exported in plain text
  • PII (Personally Identifiable Information) redacted from logs
  • Audit trails respect privacy settings
# Privacy-aware export
nondom export --privacy-mode minimal  # Exclude private fields
nondom export --privacy-mode full     # Include all accessible data

4.4 Audit Logging

# Enable detailed audit logging
nondom apply script.vf --audit --log-level debug

Log Contents:

  • Script hash and timestamp
  • Agent identity and capabilities used
  • All zome calls performed
  • Resource modifications (before/after)
  • Governance rule evaluations

4.5 Sandboxing and Execution Safety

Declarative-Only Guarantee:

  • No arbitrary code execution possible
  • No filesystem access beyond script I/O
  • No network access except to Holochain conductor
  • No shell command execution
# Script can request resource limits
limits {
  max_entities: 1000
  max_execution_time: 5min
  max_memory: 100MB
}

4.6 Rate Limiting and Abuse Prevention

Bulk Operation Limits:

  • Rate limits on resource creation (e.g., 100/minute)
  • Detection of bulk deletion patterns
  • Require confirmation for destructive operations
# Interactive confirmation for dangerous operations
$ nondom apply mass_delete.vf
Warning: This script will delete 50 resources. Continue? [y/N]

5. Performance Optimization

5.1 Performance Metrics

Parsing Performance:

Script SizeParse Time TargetComplexity
Small (~50 entities)< 100msO(n)
Medium (~500 entities)< 500msO(n)
Large (~1000+ entities)< 1sO(n)

Validation Performance:

Validation PhaseTime TargetComplexity
SyntaxO(n)< 100ms typical
SemanticO(n²) worst-case< 500ms typical
Reference IntegrityO(n)Dependent on DHT
Economic LogicO(n)< 500ms typical
GovernanceO(n×m)n=entities, m=rules

Execution Performance:

OperationTargetNotes
Create 100 resources< 10sExcluding DHT latency
Bulk update (where clause)< 5sFor 100 resources
Export 1000 entities< 5sTo DSL format
Diff two states< 3sFor 500-entity networks

5.2 Resource Limits

Memory Usage:

  • Parser: < 10MB per 1000 entities
  • Validation: < 50MB peak
  • Execution: < 100MB (excluding DHT)

Script Size Limits:

  • Maximum entities: 10,000 (configurable)
  • Maximum file size: 5MB
  • Maximum nesting depth: 10 levels

5.3 Optimization Strategies

Parallel Entity Creation:

#![allow(unused)]
fn main() {
// Order-independent entities created in parallel
let (agents, resources, governance) = tokio::join!(
    create_agents(agent_batch),
    create_resources(resource_batch),
    create_governance(governance_batch)
);
}

Batch DHT Operations:

# Configure batch size
nondom apply script.vf --batch-size 100
# Larger batches = fewer round-trips but higher memory

Lazy Validation:

# Skip expensive checks for trusted scripts
nondom apply script.vf --validation quick  # Syntax + basic semantic only
nondom apply script.vf --validation full   # All phases (default)

5.4 Progress Reporting

$ nondom apply bootstrap.vf
Processing: [████████░░░░░░░] 45% (450/1000 entities)
Created: 450 agents, 300 resources, 50 governance rules
ETA: 2s

5.5 Caching Strategy

Parse Cache:

# Cache parsed AST for repeated validation
nondom validate script.vf --cache
# Second run is instantaneous

Validation Cache:

# Cache validation results for unchanged scripts
nondom validate script.vf --incremental
# Only re-validates changed sections

DHT Query Cache:

  • Cache reference integrity checks for 5 minutes
  • Invalidation on entity updates
  • LRU cache with 1000-entry limit

6. Migration and Versioning

6.1 State Export and Import

Export Format:

# Export entire network state
nondom export --format vf --output network_state.vf

# Export specific entity types
nondom export resources,governance --output partial.vf

# Export with filtering
nondom export --where "created > 2025-01-01" --output recent.vf

State Representation:

# Exported state script includes version metadata
# Generated: 2025-01-15T10:30:00Z
# Network: FabLabMontreal
# Version: 1.0

metadata {
  export_date: 2025-01-15T10:30:00Z
  dsl_version: "1.0"
  network_hash: "abc123..."
}

# ... full entity definitions ...

6.2 State Diff and Migration

# Compare current state with exported baseline
nondom diff baseline.vf --output migration.vf

# Preview changes before applying
nondom diff baseline.vf --dry-run

# Generate detailed change report
nondom diff baseline.vf --report changes.md

Diff Output Format:

# Auto-generated migration script
# Changes: +15 resources, -3 resources, ~8 resources

# ADDED resources
resources {
  New_Laser_Cutter : Equipment {
    custodian: Sensorica
    location: "Room 201"
    added: 2025-01-15
  }
}

# REMOVED resources
remove resource Old_3D_Printer  # Deprecated

# MODIFIED resources
update resource CNC_Router {
  location: "Room 101"  # Changed from "Room 100"
}

6.3 Version Compatibility

DSL Versioning Strategy:

DSL VersionStatusMigration Path
1.0CurrentN/A
0.9Deprecatednondom migrate --from 0.9 --to 1.0
0.8UnsupportedManual migration required

Backward Compatibility Guarantees:

  • Scripts written in DSL 1.0 will work with DSL 1.x (minor versions)
  • Breaking changes require major version increment (1.0 → 2.0)
  • Migration tools provided for at least 2 previous major versions

Version Detection:

# Scripts declare required DSL version
#!/usr/bin/env nondom
# @version "1.0"

network MyNetwork { ... }

7. Testing Framework

7.1 Unit Testing Individual Constructs

# test/unit/resource_creation.vf
test "Create resource with minimal properties" {
  input: {
    resources { TestResource : Equipment { custodian: TestOrg } }
  }
  expect: {
    created: 1
    type: Equipment
    has_property: custodian
  }
}

7.2 Integration Testing

# test/integration/full_workflow.vf
test "Complete resource lifecycle" {
  setup: {
    # Create agents, specifications, governance
  }
  script: {
    # Create resources, transfer, consume, produce
  }
  verify: {
    # Check DHT state
    # Verify governance rules applied
    # Validate economic events
  }
  cleanup: {
    # Remove test data
  }
}

7.3 Golden File Testing

# Generate golden files
nondom compile test.vf --output test.golden.json

# Regression testing
nondom test --golden test.vf
# Compiles and compares with test.golden.json

7.4 Property-Based Testing

#![allow(unused)]
fn main() {
// Rust-based property tests
proptest!(|(resources: Vec<Resource>)| {
    let script = compile_to_dsl(resources);
    let result = nondom_apply(&script);
    prop_assert!(result.is_valid());
});
}

Properties to Test:

  • Idempotency: Running script twice produces same result
  • Commutativity: Order of entity creation doesn't matter (where possible)
  • Round-trip: Export → Import preserves data

7.5 Test Organization

tests/
├── unit/              # Single feature tests
│   ├── agent_creation.vf
│   ├── resource_spec.vf
│   └── governance_rules.vf
├── integration/       # Cross-feature tests
│   ├── full_workflow.vf
│   └── multi_agent.vf
├── golden/           # Expected compiler outputs
│   └── *.golden.json
└── snapshots/        # Governance evaluation results
    └── *.snap.vf

7.6 Continuous Integration

# .github/workflows/dsl-tests.yml
test:
  - bun run test:unit # Fast unit tests
  - bun run test:integration # Integration tests
  - bun run test:golden # Regression testing
  - bun run test:property # Property-based tests

8. CLI Interface Specification

8.1 Command Reference

CommandDescription
nondom apply <script.vf>Execute a DSL script against the network
nondom validate <script.vf>Validate syntax and semantics without executing
nondom apply --dry-run <script.vf>Show what would change without applying
nondom export --format vfExport current state as DSL script
nondom import <file> --mapping <map.vf>Import from external format using mapping
nondom replInteractive shell for exploratory scripting
nondom diff <baseline.vf>Compare states and generate migration script
nondom migrate --from <ver> --to <ver>Migrate scripts between DSL versions

8.2 Common Options

# Validation options
--strict                # Treat warnings as errors
--phase <number>        # Stop at specific validation phase
--explain               # Provide detailed explanations

# Execution options
--dry-run              # Preview changes without applying
--batch-size <number>   # Configure DHT operation batching
--validation <mode>     # quick | full
--interactive           # Prompt for confirmation on each change

# Performance options
--cache                # Enable parse caching
--incremental          # Use incremental validation
--profile              # Show performance breakdown
--chunk-size <number>  # Process large scripts in chunks

# Output options
--output <file>        # Specify output file
--format <format>      # vf | json | graphql
--privacy-mode <mode>  # minimal | full
--audit                # Enable audit logging
--log-level <level>    # debug | info | warn | error

9. Parser Architecture

9.1 Technology Stack

  • Implementation Language: Rust (aligns with Nondominium codebase)
  • Parser Library: pest or nom parser combinators
  • AST Representation: Serde-serializable structs
  • Error Reporting: Custom diagnostic types with span information

9.2 Parser Components

#![allow(unused)]
fn main() {
// Core parser structure
pub struct DslParser {
    lexer: pest::Parser<Rule>,
    ast_builder: AstBuilder,
    error_collector: ErrorCollector,
}

impl DslParser {
    pub fn parse(&mut self, input: &str) -> Result<Program, ParseError> {
        // Tokenization -> AST construction -> Validation
    }
}
}

9.3 AST Definition

#![allow(unused)]
fn main() {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Program {
    pub version: Option<String>,
    pub statements: Vec<Statement>,
    pub metadata: Metadata,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum Statement {
    Network(NetworkDecl),
    Agents(AgentsDecl),
    Resources(ResourcesDecl),
    Governance(GovernanceDecl),
    Recipe(RecipeDecl),
    Transaction(TransactionBlock),
    // ...
}
}

9.4 Error Reporting

#![allow(unused)]
fn main() {
#[derive(Debug)]
pub struct ParseError {
    pub kind: ErrorKind,
    pub span: Span,
    pub context: String,
    pub hints: Vec<String>,
}

pub type Span = std::ops::Range<usize>;
}

10. Compilation Pipeline

10.1 Compilation Stages

DSL Source Code
       ↓
   [Lexer] → Tokens
       ↓
 [Parser] → AST
       ↓
[Validator] → Validated AST
       ↓
[Compiler] → hREA Function Calls
       ↓
[Executor] → Holochain DHT Operations

10.2 Target: hREA Zome Calls

The DSL compiles to Nondominium's zome function calls:

#![allow(unused)]
fn main() {
// DSL: resources { CNC : Equipment { custodian: Sensorica } }
//
// Compiles to:
zome_resource::functions::create_resource(CreateResourceInput {
    resource_spec_id: "Equipment",
    custodian: "Sensorica",
    // ...
})
}

10.3 Secondary Compilation Targets

JSON-LD Export:

nondom compile script.vf --target jsonld --output script.jsonld

GraphQL Mutations:

nondom compile script.vf --target graphql --output mutations.graphql

Appendix A: Error Codes

CodeCategoryDescription
E0101-E0199SyntaxGrammar and parsing errors
E0201-E0299SemanticType checking and validation
E0301-E0399ReferenceUnknown entity references
E0401-E0499Economic LogicBalance and conservation errors
E0501-E0599GovernanceRule conflicts and violations

Nondominium Architecture Overview

This document provides a comprehensive overview of the Nondominium Holochain application architecture, focusing on the cross-zome integration patterns, shared infrastructure, and development status. It reflects the implementation of resource management, Private Participation Receipt (PPR) reputation system, capability-based private data sharing, and governance workflows.

System Architecture

Nondominium is a 3-zome Holochain hApp implementing ValueFlows-compliant resource sharing with embedded governance rules, cryptographically-secured reputation tracking through Private Participation Receipts (PPRs), and agent capability progression:

  • zome_person: Agent identity, profiles, roles, capability-based private data sharing, PPR integration, access control
  • zome_resource: Resource specifications, Economic Resources, governance rules, lifecycle management, custody transfers
  • zome_gouvernance: Economic events, commitments, claims, validation workflows, PPR issuance, agent validation. NDO federation extensions (PR #103) added three entry types: NdoHardLink (immutable OVN-licensed cross-NDO link backed by an EconomicEvent), Contribution (peer-validated work record; VF: vf:EconomicEvent/Work), and Agreement (versioned benefit redistribution agreement; VF: vf:Agreement). See documentation/zomes/governance_zome.md §NDO Federation Extensions for API details.
  • zome_lobby (Lobby DNA, separate network seed nondominium-lobby-v1): Global NDO discovery, agent presence, group membership stubs. Entry types: LobbyAgentProfile, NdoAnnouncement.

Technology Foundation

  • Backend: Rust (Holochain HDK ^0.6.0 / HDI ^0.7.0), WASM compilation
  • Data Model: Agent-centric with public/private separation, progressive trust model (Simple → Accountable → Primary Accountable Agent)
  • Security: Progressive capability-based access using Holochain capability tokens (general → restricted → full) with automatic advancement based on PPR milestones
  • Compliance: ValueFlows standard for economic resource management with nondominium extensions (VfAction enum, Economic Processes)
  • Governance: Embedded rules, multi-reviewer validation (2-of-3, N-of-M, simple_majority), cryptographically-signed reputation tracking through PPRs
  • Economic Processes: Four structured workflows (Use, Transport, Storage, Repair) with role-based access control and specialized validation requirements
  • Private Data Sharing: Request/grant workflows with time-limited grants (30-day maximum per capability metadata; shorter UI defaults possible), field-specific control, and Economic Process coordination integration
  • Reputation System: 16 PPR categories, bi-directional receipt issuance, cryptographic signatures, privacy-preserving reputation derivation

Cross-Zome Integration Patterns

Enhanced Agent Capability Progression System

#![allow(unused)]
fn main() {
// Progressive trust model integration across all zomes with PPR milestone tracking
let agent_capability = get_person_capability_level(agent_pubkey)?;
let agent_reputation = derive_reputation_summary(agent_pubkey)?;

match agent_capability.as_str() {
    "member" => {
        // Simple Agent: general capability token
        // Can create resources, make first transaction (InitialTransfer)
        // PPR eligibility: ResourceContribution upon resource validation
        // Promotion path: First transaction validation → Accountable Agent
    },
    "stewardship" => {
        // Accountable Agent: restricted capability token
        // Can access resources, validate others, initiate Use processes
        // PPR eligibility: Service processes, validation activities
        // Promotion path: PPR milestones + specialized role validation → Primary Accountable Agent
    },
    "coordination" | "governance" => {
        // Primary Accountable Agent: full capability token
        // Can hold custody, validate specialized roles, initiate all processes (Transport, Storage, Repair)
        // PPR eligibility: All 16 categories, including custodianship and governance participation
        // Advanced capabilities: Dispute resolution, end-of-life validation
    }
}

// Automatic capability token advancement based on PPR milestones
if agent_reputation.total_interactions >= 5 && agent_reputation.completion_rate >= 0.8 {
    // Trigger capability token upgrade
    upgrade_capability_token(agent_pubkey, "restricted_access")?;
}
}

Enhanced Economic Process Role Enforcement

#![allow(unused)]
fn main() {
// Cross-zome role validation for specialized processes with validation history
let process_type = "Transport"; // Use, Transport, Storage, Repair
let required_role = match process_type {
    "Use" => None, // Accessible to all Accountable Agents
    "Transport" => Some("Transport"),
    "Storage" => Some("Storage"),
    "Repair" => Some("Repair"),
    _ => return Err(ProcessError::InvalidProcessType),
};

if let Some(role) = required_role {
    // Check specialized role capability
    let has_role = has_person_role_capability((agent_pubkey, role.to_string()))?;
    if !has_role {
        return Err(ProcessError::InsufficientRole(role.to_string()));
    }

    // Validate role was properly validated by governance
    let role_validation = call(
        CallTargetCell::Local,
        "zome_gouvernance",
        "get_specialized_role_validation".into(),
        None,
        &GetRoleValidationInput {
            agent: agent_pubkey,
            role: role.to_string(),
        },
    )?;

    if !role_validation.is_valid_and_current() {
        return Err(ProcessError::InvalidRoleValidation(role.to_string()));
    }
}

// Additional Economic Process workflow integration
let process_creation_result = call(
    CallTargetCell::Local,
    "zome_resource",
    "initiate_economic_process".into(),
    None,
    &EconomicProcessInput {
        process_type: process_type.to_string(),
        name: format!("{} process for resource", process_type),
        resource_hashes: vec![resource_hash],
        location: Some(resource_location),
    },
)?;
}

Enhanced Private Data Sharing Integration

#![allow(unused)]
fn main() {
// Automatic private data coordination for Economic Processes
pub fn coordinate_process_private_data(
    process_hash: ActionHash,
    participants: Vec<AgentPubKey>,
    process_type: &str,
) -> ExternResult<Vec<ActionHash>> {
    let mut coordination_requests = Vec::new();

    for participant in participants {
        // Determine required coordination fields based on process type
        let required_fields = match process_type {
            "Transport" => vec!["email", "phone", "location"],
            "Storage" => vec!["email", "phone", "emergency_contact"],
            "Repair" => vec!["email", "phone", "time_zone"],
            "Use" => vec!["email"], // Minimal coordination for use processes
            _ => vec![],
        };

        if !required_fields.is_empty() {
            let request = call(
                CallTargetCell::Local,
                "zome_person",
                "request_private_data_access".into(),
                None,
                &DataAccessRequestInput {
                    requested_from: participant,
                    fields_requested: required_fields.iter().map(|s| s.to_string()).collect(),
                    context: format!("{}_process_coordination", process_type),
                    resource_hash: Some(resource_hash),
                    justification: format!("Coordination required for {} process", process_type),
                },
            )?;
            coordination_requests.push(request.request_hash);
        }
    }

    Ok(coordination_requests)
}

// Automatic grant approval for trusted Economic Process participants
pub fn auto_approve_process_coordination(
    request_hash: ActionHash,
    requester: AgentPubKey,
) -> ExternResult<Option<ActionHash>> {
    // Check requester reputation and role validation
    let reputation = call(
        CallTargetCell::Local,
        "zome_gouvernance",
        "derive_reputation_summary".into(),
        None,
        &DeriveReputationSummaryInput {
            time_range: None,
            role_filter: None,
            include_recent_activity: false,
        },
    )?;

    // Auto-approve for high-reputation, validated agents
    if reputation.completion_rate >= 0.9 && reputation.total_interactions >= 10 {
        let grant = call(
            CallTargetCell::Local,
            "zome_person",
            "respond_to_data_request".into(),
            None,
            &RespondToDataRequestInput {
                request_hash,
                approve: true,
                duration_days: Some(7), // Standard Economic Process coordination period
            },
        )?;
        return Ok(grant);
    }

    Ok(None) // Requires manual approval
}
}

Enhanced PPR Integration Pattern

#![allow(unused)]
fn main() {
// Comprehensive PPR generation with 16 categories and bilateral signatures
let ppr_result = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "issue_participation_receipts".into(),
    None,
    &IssueParticipationReceiptsInput {
        commitment_hash: commitment.hash(),
        event_hash: economic_event.hash(),
        counterparty: commitment.receiver,
        performance_metrics: calculate_performance_metrics(&commitment, &event)?,
        interaction_context: determine_interaction_context(&commitment.action, &process_context)?,
        role_context: get_role_context(&process_context)?,
    },
)?;

// Bi-directional PPR issuance with cryptographic signatures
let provider_ppr = PrivateParticipationClaim {
    fulfills: commitment_hash,
    fulfilled_by: event_hash,
    claimed_at: sys_time()?,
    claim_type: determine_provider_claim_type(&commitment.action, &process_context)?,
    counterparty: commitment.receiver,
    performance_metrics: ppr_result.provider_metrics,
    bilateral_signature: ppr_result.provider_signature,
    interaction_context: ppr_result.interaction_context,
    role_context: ppr_result.role_context,
    resource_reference: Some(commitment.resource_inventoried_as),
};

let receiver_ppr = PrivateParticipationClaim {
    fulfills: commitment_hash,
    fulfilled_by: event_hash,
    claimed_at: sys_time()?,
    claim_type: determine_receiver_claim_type(&commitment.action, &process_context)?,
    counterparty: commitment.provider,
    performance_metrics: ppr_result.receiver_metrics,
    bilateral_signature: ppr_result.receiver_signature,
    interaction_context: ppr_result.interaction_context,
    role_context: ppr_result.role_context,
    resource_reference: Some(commitment.resource_inventoried_as),
};

// PPRs stored as private entries, accessible only to owning agents
// No DHT links created for privacy preservation
}

PPR Category Determination Logic

#![allow(unused)]
fn main() {
// Comprehensive PPR category assignment based on Economic Process context
pub fn determine_ppr_categories(
    action: &VfAction,
    process_type: &str,
    agent_role: &str,
    interaction_context: &str,
) -> (ParticipationClaimType, ParticipationClaimType) {
    match (action, process_type, agent_role, interaction_context) {
        // Genesis Role - Network Entry
        (VfAction::InitialTransfer, _, "Simple Agent", "resource_creation") => (
            ParticipationClaimType::ResourceContribution,
            ParticipationClaimType::NetworkValidation,
        ),

        // Core Usage Role - Custodianship
        (VfAction::TransferCustody, _, _, "custody_transfer") => (
            ParticipationClaimType::ResponsibleTransfer,
            ParticipationClaimType::CustodyAcceptance,
        ),

        // Specialized Economic Processes
        (VfAction::Use, "Use", _, _) => (
            ParticipationClaimType::ServiceCommitmentAccepted,
            ParticipationClaimType::ServiceFulfillmentCompleted,
        ),
        (VfAction::Work, "Transport", "Transport", _) => (
            ParticipationClaimType::TransportFulfillment,
            ParticipationClaimType::ServiceCommitmentAccepted,
        ),
        (VfAction::Work, "Storage", "Storage", _) => (
            ParticipationClaimType::StorageFulfillment,
            ParticipationClaimType::ServiceCommitmentAccepted,
        ),
        (VfAction::Modify, "Repair", "Repair", _) => (
            ParticipationClaimType::MaintenanceFulfillment,
            ParticipationClaimType::ServiceFulfillmentCompleted,
        ),

        // Network Governance
        (_, _, _, "validation_activity") => (
            ParticipationClaimType::NetworkValidation,
            ParticipationClaimType::GovernanceCompliance,
        ),
        (_, _, _, "end_of_life") => (
            ParticipationClaimType::EndOfLifeDeclaration,
            ParticipationClaimType::EndOfLifeValidation,
        ),
        (_, _, _, "dispute_resolution") => (
            ParticipationClaimType::DisputeResolutionParticipation,
            ParticipationClaimType::GovernanceCompliance,
        ),

        // Default case
        _ => (
            ParticipationClaimType::ServiceCommitmentAccepted,
            ParticipationClaimType::ServiceFulfillmentCompleted,
        ),
    }
}
}

Resource-Governance Integration

#![allow(unused)]
fn main() {
// Resource validation triggering governance workflows
let resource_validation = ResourceValidation {
    resource: resource_hash,
    validation_scheme: "2-of-3".to_string(),
    required_validators: 2,
    current_validators: 0,
    status: "pending".to_string(),
};

// Cross-zome validation coordination
let governance_result = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "initiate_resource_validation".into(),
    None,
    &resource_validation,
)?;

// Automatic PPR issuance for validation participation
let validation_pprs = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "issue_validation_participation_receipts".into(),
    None,
    &ValidationPPRInput {
        resource_hash,
        validator: agent_pubkey,
        validation_type: "resource_approval".to_string(),
    },
)?;
}

Shared Infrastructure

Signal Architecture

Enhanced Multi-Zome Signals

#![allow(unused)]
fn main() {
pub enum Signal {
    // Resource lifecycle signals
    EntryCreated { action, app_entry },
    EntryUpdated { action, app_entry, original_app_entry },
    EntryDeleted { action, original_app_entry },
    LinkCreated { action, link_type },
    LinkDeleted { action, link_type },

    // Economic Process signals
    ProcessInitiated { process_hash, process_type, agent },
    ProcessCompleted { process_hash, completion_event, performance_metrics },
    ProcessValidated { process_hash, validator, approved },

    // PPR system signals
    PPRIssued { recipient, claim_type, counterparty },
    ReputationUpdated { agent, new_summary },

    // Governance workflow signals
    ValidationRequired { item_hash, validation_type, scheme },
    ValidationCompleted { item_hash, result, validators },
    AgentPromoted { agent, from_level, to_level },
}
}

Real-time Updates: Enables UI reactivity to all system changes Cross-Zome Coordination: Supports complex workflows spanning multiple zomes PPR Integration: Real-time reputation updates and participation tracking Process Management: Live updates on Economic Process status and completion

Discovery Performance

Anchor Path Strategy

  • Categorized Discovery: O(1) lookup by category/tag
  • Agent-Centric Queries: Direct agent -> owned resources links
  • Versioning: Efficient latest version resolution
  • Bulk Operations: Optimized for large result sets
#![allow(unused)]
fn main() {
// Category-based discovery with tag metadata
create_link(
    category_path.path_entry_hash()?,
    spec_hash.clone(),
    LinkTypes::SpecsByCategory,
    LinkTag::new(category_name.as_str()),
)?;
}

Performance: Link tags enable efficient filtering without record retrieval

Common Patterns

Entry Creation Pattern

All zomes follow this standardized pattern for creating entries:

#![allow(unused)]
fn main() {
// Standard entry creation with discovery links
let entry = EntryType {
    field: value,
    agent_pub_key: agent_info.agent_initial_pubkey,
    created_at: sys_time()?,
};
let hash = create_entry(&EntryTypes::EntryType(entry.clone()))?;

// Create discovery anchor links
let path = Path::from("anchor_name");
create_link(path.path_entry_hash()?, hash.clone(), LinkTypes::AnchorType, LinkTag::new("tag"))?;
}

Versioning Pattern

#![allow(unused)]
fn main() {
// Update pattern with version history tracking
let updated_entry = update_entry(input.previous_action_hash, &updated_data)?;
create_link(
    input.original_action_hash,
    updated_entry.clone(),
    LinkTypes::EntryUpdates,
    (),
)?;
}

Discovery Pattern

#![allow(unused)]
fn main() {
// Efficient anchor-based discovery
let path = Path::from("discovery_anchor");
let links = get_links(
    GetLinksInputBuilder::try_new(path.path_entry_hash()?, LinkTypes::DiscoveryType)?.build(),
)?;
}

Privacy Architecture

Four-Layer Privacy Model

1. Public Data Layer

  • Person entries: Name, avatar, bio (discoverable by all agents)
  • Role assignments: Role name, assignment metadata (auditable governance)
  • Resource specifications: Name, description, category (community discovery)
  • Economic events: Public record of economic activities (audit trail)
  • Validation receipts: Public governance validation records

2. Private Data Layer

  • PrivatePersonData entries: PII, contact info (owner-only access)
  • PrivateParticipationClaims: Cryptographically-signed reputation receipts (private entries)
  • Holochain Security: Private entry visibility enforced by conductor

3. Access-Controlled Layer

  • Role-based permissions: Capability-driven resource access
  • Governance rules: Community-managed access controls
  • Custodian permissions: Resource-specific access rights
  • Process validation: Specialized role validation for Economic Processes

4. Derived Data Layer

  • Reputation summaries: Calculated from private PPRs, selectively shared
  • Performance metrics: Aggregated from participation claims
  • Trust scores: Derived reputation indicators for decision-making

Access Control Implementation

#![allow(unused)]
fn main() {
// Four-tier access pattern with PPR integration
match access_level {
    Public => {
        // Anyone can read public entries
        get_public_data(entry_hash)
    },
    Private => {
        // Only owner can access private entries (PPRs, PII)
        if caller == owner {
            get_private_data(entry_hash)
        } else {
            Err(NotAuthorized)
        }
    },
    RoleBased => {
        // Check role-based permissions for processes
        let has_permission = check_role_capability(caller, required_role)?;
        if has_permission {
            get_controlled_data(entry_hash)
        } else {
            Err(InsufficientCapability)
        }
    },
    ReputationBased => {
        // Access based on derived reputation metrics
        let reputation = get_agent_reputation_summary(caller)?;
        if reputation.meets_threshold(required_threshold) {
            get_reputation_gated_data(entry_hash)
        } else {
            Err(InsufficientReputation)
        }
    }
}
}

Private Participation Receipt (PPR) System

PPR Infrastructure Architecture

#![allow(unused)]
fn main() {
// PPR lifecycle: automatic generation for every economic interaction
pub struct PPRGenerationWorkflow {
    // 1. Commitment created
    commitment: Commitment,

    // 2. Economic event occurs
    event: EconomicEvent,

    // 3. Claim links commitment to event (public governance record)
    claim: Claim,

    // 4. Bi-directional PPRs automatically generated (private entries)
    provider_ppr: PrivateParticipationClaim,
    receiver_ppr: PrivateParticipationClaim,
}

// Cross-zome PPR coordination
impl PPRGenerationWorkflow {
    pub fn execute(&self) -> ExternResult<(ActionHash, ActionHash)> {
        // 1. Generate performance metrics
        let metrics = self.calculate_performance_metrics()?;

        // 2. Create cryptographic signatures
        let signatures = self.create_bilateral_signatures()?;

        // 3. Store PPRs as private entries in zome_person
        let provider_ppr_hash = self.store_provider_ppr(metrics.clone(), signatures.provider)?;
        let receiver_ppr_hash = self.store_receiver_ppr(metrics, signatures.receiver)?;

        // 4. Update agent reputation caches
        self.update_reputation_summaries()?;

        // 5. Emit signals for real-time UI updates
        self.emit_ppr_signals()?;

        Ok((provider_ppr_hash, receiver_ppr_hash))
    }
}
}

PPR Categories and Issuance Patterns

#![allow(unused)]
fn main() {
// PPR issuance based on economic interaction context
pub fn determine_ppr_category(
    action: &VfAction,
    process_type: &str,
    agent_role: &str,
) -> Vec<ParticipationClaimType> {
    match (action, process_type, agent_role) {
        // Simple Agent first transaction
        (VfAction::InitialTransfer, _, "Simple Agent") => vec![
            ParticipationClaimType::ResourceContribution,
            ParticipationClaimType::NetworkValidation,
        ],

        // Core Use process
        (VfAction::Use, "Use", _) => vec![
            ParticipationClaimType::ServiceCommitmentAccepted,
            ParticipationClaimType::ServiceFulfillmentCompleted,
        ],

        // Specialized Transport process
        (VfAction::Work, "Transport", "Transport") => vec![
            ParticipationClaimType::TransportFulfillment,
            ParticipationClaimType::CustodyAcceptance,
        ],

        // Specialized Repair process
        (VfAction::Modify, "Repair", "Repair") => vec![
            ParticipationClaimType::MaintenanceFulfillment,
            ParticipationClaimType::ServiceFulfillmentCompleted,
        ],

        // Custody transfer
        (VfAction::TransferCustody, _, _) => vec![
            ParticipationClaimType::ResponsibleTransfer,
            ParticipationClaimType::CustodyAcceptance,
        ],

        // Validation activities
        (_, _, "Validator") => vec![
            ParticipationClaimType::NetworkValidation,
            ParticipationClaimType::GovernanceCompliance,
        ],

        _ => vec![], // No PPR generation for this combination
    }
}
}

Reputation Derivation and Selective Sharing

#![allow(unused)]
fn main() {
// Privacy-preserving reputation calculation
pub fn calculate_reputation_summary(agent: AgentPubKey) -> ExternResult<ReputationSummary> {
    // Access agent's private PPR collection
    let pprs = get_my_participation_claims()?;

    let mut summary = ReputationSummary {
        agent,
        total_interactions: pprs.len() as u32,
        average_timeliness: 0.0,
        average_quality: 0.0,
        average_reliability: 0.0,
        average_communication: 0.0,
        completion_rate: 0.0,
        role_performance: HashMap::new(),
        recent_activity: Vec::new(),
        calculated_at: sys_time()?,
    };

    // Aggregate metrics from private claims
    for ppr in pprs {
        summary.aggregate_metrics(&ppr.performance_metrics)?;
        summary.update_role_performance(&ppr)?;
        summary.track_recent_activity(&ppr)?;
    }

    summary.finalize_calculations();
    Ok(summary)
}

// Selective reputation sharing
pub fn share_reputation_summary(
    target_agent: AgentPubKey,
    sharing_scope: ReputationSharingScope,
) -> ExternResult<SelectiveReputationShare> {
    let full_summary = calculate_reputation_summary(agent_info()?.agent_initial_pubkey)?;

    match sharing_scope {
        ReputationSharingScope::Basic => {
            // Share only overall scores and completion rate
            SelectiveReputationShare::basic(full_summary)
        },
        ReputationSharingScope::RoleSpecific(role) => {
            // Share detailed metrics for specific role
            SelectiveReputationShare::role_specific(full_summary, role)
        },
        ReputationSharingScope::Comprehensive => {
            // Share detailed breakdown (requires higher trust level)
            SelectiveReputationShare::comprehensive(full_summary)
        },
    }
}
}

ValueFlows Compliance

Enhanced Agent-Centric Model

  • Agents as Economic Actors: Every participant is an autonomous economic agent with progressive capability levels
  • Identity and Reputation: Comprehensive agent profiles with role-based capabilities and cryptographically-signed reputation tracking
  • Decentralized Coordination: No central authority, community-governed resource sharing with embedded governance rules
  • Process-Aware Interactions: All economic activities occur within structured Economic Processes

Comprehensive Economic Resource Management

  • Resource Specifications: Templates defining resource types, embedded governance rules, and process requirements
  • Economic Resources: Actual resource instances with clear custodianship and lifecycle tracking
  • Economic Processes: Structured activities (Use, Transport, Storage, Repair) with role-based access control
  • Economic Events: VfAction-based event tracking with automatic PPR generation
  • Governance Rules: Community-defined access and usage policies enforced programmatically

VfAction Enum Implementation

#![allow(unused)]
fn main() {
// Type-safe ValueFlows action representation with nondominium extensions
#[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub enum VfAction {
    // Standard ValueFlows actions
    Transfer, Move, Use, Consume, Produce, Work, Modify,
    Combine, Separate, Raise, Lower, Cite, Accept,

    // nondominium-specific extensions
    InitialTransfer,    // Simple Agent first transaction
    AccessForUse,       // Request access commitment
    TransferCustody,    // Primary Accountable Agent custody transfer
}

impl VfAction {
    // Process-aware action classification
    pub fn requires_specialized_role(&self, process_type: &str) -> Option<String> {
        match (self, process_type) {
            (VfAction::Work, "Transport") => Some("Transport".to_string()),
            (VfAction::Work, "Storage") => Some("Storage".to_string()),
            (VfAction::Modify, "Repair") => Some("Repair".to_string()),
            (VfAction::Use, _) => None, // Accessible to all Accountable Agents
            _ => None,
        }
    }

    // PPR integration
    pub fn triggers_ppr_generation(&self) -> bool {
        matches!(self,
            VfAction::InitialTransfer | VfAction::Use |
            VfAction::Work | VfAction::Modify |
            VfAction::TransferCustody
        )
    }
}
}

Enhanced Compliance Implementation

#![allow(unused)]
fn main() {
// Comprehensive ValueFlows compliance with nondominium extensions
pub struct EconomicResource {
    pub conforms_to: ActionHash,         // ResourceSpecification compliance
    pub quantity: f64,                   // Measurable resource quantity
    pub unit: String,                   // Standard measurement unit
    pub custodian: AgentPubKey,         // Primary Accountable Agent
    pub current_location: Option<String>, // Resource location tracking
    // TODO: split into LifecycleStage (NondominiumIdentity Layer 0) + OperationalState (EconomicResource Layer 2)
    pub state: ResourceState,           // Currently conflated; pending split per ndo_prima_materia.md Section 5
    pub governance_rules: Vec<GovernanceRule>, // Embedded governance
    pub validation_status: String,      // Peer validation status
    pub process_history: Vec<ActionHash>, // Economic Process audit trail
}

pub struct EconomicProcess {
    pub process_type: String,           // Use, Transport, Storage, Repair
    pub required_role: String,          // Role-based access control
    pub inputs: Vec<ActionHash>,        // Input resources
    pub outputs: Vec<ActionHash>,       // Output resources
    pub status: ProcessStatus,          // Process lifecycle state
    pub validation_requirements: ProcessValidationRequirements,
}

pub struct EconomicEvent {
    pub action: VfAction,               // Type-safe ValueFlows action
    pub provider: AgentPubKey,          // Agent providing
    pub receiver: AgentPubKey,          // Agent receiving
    pub resource_inventoried_as: ActionHash, // Affected resource
    pub input_of: Option<ActionHash>,   // Parent Economic Process
    pub ppr_generated: bool,            // Automatic PPR issuance flag
}
}

Multi-Layered Ontology Support

#![allow(unused)]
fn main() {
// ValueFlows three-layer ontology implementation
pub enum OntologyLayer {
    Knowledge {
        // Resource specifications, governance rules, process templates
        resource_specs: Vec<ResourceSpecification>,
        governance_rules: Vec<GovernanceRule>,
        process_templates: Vec<ProcessTemplate>,
    },
    Plan {
        // Commitments, process initiations, validation workflows
        commitments: Vec<Commitment>,
        planned_processes: Vec<EconomicProcess>,
        validation_schemes: Vec<ValidationScheme>,
    },
    Observation {
        // Economic events, completed processes, issued PPRs
        economic_events: Vec<EconomicEvent>,
        completed_processes: Vec<CompletedProcess>,
        validation_receipts: Vec<ValidationReceipt>,
        participation_claims: Vec<PrivateParticipationClaim>,
    },
}
}

Development Status

Phase 1: Foundation Layer ✅ COMPLETED (Existing Working Code)

  • Agent Identity & Role System: Comprehensive identity with sophisticated three-tier privacy layers and 8-level role hierarchy
  • Progressive Capability System: Complete Simple → Accountable → Primary Accountable Agent progression
  • Resource Specifications: ValueFlows-compliant resource templates with embedded governance rules and process requirements
  • Discovery Patterns: Optimized anchor-based queries with performance optimization and multi-dimensional filtering
  • Governance Foundation: Multi-reviewer validation schemes (2-of-3, N-of-M, simple_majority) and rule enforcement framework
  • Cross-Zome Integration: Complete authorization and capability checking across all three zomes
  • VfAction Enum: Type-safe ValueFlows action implementation with nondominium extensions and helper methods
  • Economic Resource Lifecycle: Complete resource instance management with state tracking and custody transfers
  • Basic Governance Infrastructure: ValidationReceipt creation, economic event logging, cross-zome validation functions

Phase 2: Enhanced Governance & Process Integration ✅ COMPLETED

  • Enhanced Private Data Sharing: Complete DataAccessRequest/Grant workflows with time-limited grants (30-day cap) and field-specific control
  • Economic Process Infrastructure: Four structured processes (Use, Transport, Storage, Repair) with role-based access control
  • Private Participation Receipt (PPR) System: Complete 14-category PPR system with bi-directional receipt issuance
  • Agent Capability Progression: Complete Simple → Accountable → Primary Accountable Agent advancement with PPR integration
  • Cross-Zome Coordination: Seamless coordination across person, resource, and governance zomes for complete workflows
  • Validation Workflows: Resource validation, agent promotion, and specialized role validation fully operational
  • Cryptographic Integrity: All PPRs cryptographically signed with bilateral authentication
  • Performance Metrics Integration: Quantitative performance tracking embedded in all economic interactions
  • Role-Based Process Access: Specialized roles (Transport, Repair, Storage) enabling restricted Economic Process participation
  • Process-Aware Governance: Economic Process validation with quality assurance and completion validation
  • Reputation Derivation: Privacy-preserving reputation calculation with selective disclosure control
  • Economic Event Integration: Complete VfAction-based event tracking with automatic PPR generation

Phase 3: Advanced Security & Cross-Zome Coordination 🔄 IN PROGRESS

  • 🔄 Progressive Capability Tokens: Automatic capability token progression based on PPR milestones (implementation underway)
  • 🔄 Economic Process Access Control: Role-validated access to specialized processes with reputation influence
  • 🔄 Transaction Consistency: Atomic operations across all three zomes with comprehensive rollback mechanisms
  • 📋 Advanced Validation Schemes: PPR-weighted validator selection and reputation-based consensus
  • 📋 Dispute Resolution: Edge-based conflict resolution with PPR context and private data coordination

Phase 3 — Agent Ontology Expansion 📋 PLANNED (see documentation/archives/agent.md)

TODO: The following agent-layer gaps were identified against the OVN wiki ontology (15 years of commons-based peer production practice). The current implementation models only individual agents. The items below must be incorporated into Phase 3 planning. See documentation/zomes/person_zome.md Future Enhancements section and documentation/implementation_plan.md Phase 3 for detailed task breakdowns.

Phase 3 Agent Items:

  • 📋 [G1] AgentEntityType field: Distinguish Individual, Collective, Project, Network, Bot, ExternalOrganisation agents (REQ-AGENT-01)
  • 📋 [G15] CapabilitySlot on Person: Stigmergic attachment surface for DID documents, credential wallets, reputation oracles (REQ-AGENT-11)
  • 📋 [G3] Composable AgentProfile view: Assembled from Person + ReputationSummary + Roles + CapabilitySlots + affiliations (REQ-AGENT-07)
  • 📋 [G4] AgentRelationship link type: Bidirectional typed private peer relationships (REQ-AGENT-08)
  • 📋 [G5] Network affiliation links: Cross-NDO membership from Person hash to NDO instance hashes (REQ-AGENT-09)
  • 📋 [G14] Configurable role taxonomy: Replace closed RoleType enum with a community-configurable role registry (REQ-AGENT-06)

Phase 2 Agent Items (earlier priority):

  • 📋 [G13] Fix request_role_promotion stub: Real queryable RolePromotionRequest entry with discovery links (REQ-AGENT-16)
  • 📋 [G6] AffiliationRecord entry: Formal Terms of Participation ceremony (REQ-AGENT-05)
  • 📋 [G2] Derived affiliation state: Computed from PPR activity — UnaffiliatedStranger → CloseAffiliate → ActiveAffiliate → CoreAffiliate → InactiveAffiliate (REQ-AGENT-04)

Phase 4: Network Maturity & Advanced Features 📋 PLANNED

  • 📋 Advanced Process Workflows: Multi-step process chaining with automated agent selection based on PPR reputation
  • 📋 AI-Enhanced Reputation: Machine learning-based trust prediction and context-aware weighting
  • 📋 Cross-Network Integration: PPR portability and federated identity management across multiple nondominium networks
  • 📋 Performance Optimization: Large-scale network operation with predictive scaling and efficiency optimization
  • 📋 Community Governance: Reputation-weighted validation and automated role progression based on performance metrics

Phase 4 Agent Items (see documentation/implementation_plan.md Phase 4):

  • 📋 [G8] PortableCredential: Bilaterally-signed, cross-network verifiable credential export (REQ-AGENT-12)
  • 📋 [G7] ZKP capability proofs: Prove eligibility without raw data disclosure (REQ-AGENT-13)
  • 📋 [G9] Sybil resistance: Social vouching / Proof-of-Personhood configurable membrane proof (REQ-AGENT-15)
  • 📋 [G10] Pseudonymous participation mode: Ephemeral key contribution, unlinkable to Person (REQ-AGENT-14)
  • 📋 [G11] AI/bot delegation: DelegatedAgent relationship for scoped AI/bot acting on behalf of Person (REQ-AGENT-03)
  • 📋 [G12] AgentNeedsWants: Optional profile extension for resource matching (REQ-AGENT-10)

Performance Considerations

Scalability Patterns

  • Anchor-Based Discovery: O(1) category and tag lookups
  • Agent-Centric Links: Direct ownership queries without scanning
  • Lazy Loading: On-demand data retrieval for large datasets
  • Batch Operations: Efficient bulk data processing

Optimization Strategies

  • Link Tag Metadata: Rich link information without record retrieval
  • Caching Strategies: Strategic data caching for frequent queries
  • Pagination Support: Large result set management
  • Selective Loading: Component-based data loading

Security Model

Holochain Security Features

  • Agent Identity: Cryptographic agent verification
  • Entry Validation: Comprehensive validation rules per entry type
  • Private Entries: Conductor-enforced privacy
  • Capability Tokens: Fine-grained access control (planned)

Application Security Layers

  • Role-Based Authorization: Hierarchical capability system
  • Governance Rule Validation: Community-enforced access controls
  • Cross-Zome Verification: Multi-zome authorization checks
  • Audit Trails: Complete action history and attribution

Error Handling Strategy

Comprehensive Error Types

Each zome implements domain-specific error enums with:

  • Descriptive Messages: Clear error descriptions for debugging
  • Error Categories: Logical grouping of related failures
  • Recovery Guidance: Information for error resolution
  • Cross-Zome Compatibility: Consistent error handling patterns

Error Propagation Pattern

#![allow(unused)]
fn main() {
// Standardized error handling across zomes
match operation_result {
    Ok(data) => Ok(data),
    Err(domain_error) => {
        error!("Operation failed: {:?}", domain_error);
        Err(WasmError::from(domain_error))
    }
}
}

Testing Architecture

Comprehensive Four-Layer Testing Strategy

  1. Foundation Tests: Basic zome function calls, connectivity, and individual component validation
  2. Integration Tests: Cross-zome interactions, multi-agent scenarios, and PPR generation workflows
  3. Scenario Tests: Complete user journeys, Economic Process workflows, and governance validation cycles
  4. Performance Tests: Load and stress testing for large-scale deployment (in progress)

Test Coverage Areas

  • Person Management: Profiles, roles, privacy controls, PPR storage and retrieval
  • Identity Storage: Public/private data separation, selective sharing mechanisms
  • Role Assignment: Capability validation, specialized role validation, agent progression
  • Resource Management: Specifications, Economic Resources, lifecycle management, embedded governance
  • Governance Processes: Rule enforcement, validation workflows, multi-reviewer schemes
  • Economic Processes: Use, Transport, Storage, Repair processes with role-based access control
  • PPR System: Bi-directional receipt generation, cryptographic signatures, reputation derivation
  • Agent Progression: Simple Agent promotion workflows, validation participation
  • 🔄 End-of-Life Management: Resource decommissioning with enhanced security validation
  • 🔄 Dispute Resolution: Edge-based conflict resolution mechanisms
  • 📋 Performance Optimization: Large-scale network behavior and efficiency testing

This comprehensive architecture provides a production-ready, sophisticated foundation for ValueFlows-compliant resource sharing with advanced governance capabilities, Economic Process management, and privacy-preserving reputation tracking, including:

Core System Capabilities

  • Progressive Trust Model: Three-tier agent capability system (Simple → Accountable → Primary Accountable Agent) with automatic PPR-based advancement
  • Economic Process Management: Four structured workflows (Use, Transport, Storage, Repair) with role-based access control and specialized validation requirements
  • Privacy-Preserving Reputation: 14-category PPR system with cryptographically-signed bilateral receipts enabling trust without compromising privacy
  • Enhanced Private Data Sharing: Request/grant workflows with time-limited grants (30-day cap), field-specific control, and Economic Process coordination integration
  • Embedded Governance: Community-defined rules enforced programmatically across all interactions with multi-reviewer validation schemes
  • Cross-Zome Integration: Seamless coordination between identity, resource, and governance systems with atomic transaction support

Advanced Features

  • Type-Safe Operations: VfAction enum with helper methods ensuring ValueFlows compliance with compile-time validation
  • Cryptographic Integrity: All PPRs cryptographically signed with bilateral authentication for authenticity and non-repudiation
  • Performance Metrics Integration: Quantitative performance tracking embedded in all economic interactions for quality assurance
  • Scalable Infrastructure: Optimized discovery patterns, efficient anchor-based queries, and performance considerations for large-scale deployment
  • Comprehensive Audit Trails: Complete tracking of all economic activities, governance decisions, and agent progression with privacy preservation
  • Process-Aware Governance: Economic Process validation with completion requirements, state change validation, and automatic PPR generation

Production-Ready Implementation

The system demonstrates how decentralized, agent-centric architectures can support sophisticated governance models while maintaining the core principles of nondominium resources: organization-agnostic, capture-resistant, and permissionless access under transparent community governance.

With the completion of Phase 2, the system provides a comprehensive ecosystem for:

  • Decentralized Resource Sharing with embedded governance and Economic Process support
  • Privacy-Preserving Accountability through the PPR reputation system with selective disclosure
  • Progressive Agent Capability advancement based on validated performance and community participation
  • Sophisticated Economic Coordination through structured processes with role-based access control
  • Cross-Zome Transaction Integrity ensuring atomic operations and comprehensive error handling
  • Community-Driven Validation with configurable schemes and reputation-weighted participation

The nondominium hApp represents a mature, comprehensive implementation of ValueFlows principles extended with Economic Process management, private reputation tracking, and sophisticated governance workflows, providing a robust foundation for decentralized commons-based resource management at scale.

Person Zome (zome_person) Documentation

The Person zome provides the foundational identity, privacy, and access control infrastructure for the nondominium ecosystem. It implements Person-centric identity management, role-based access control, capability-based private data sharing, multi-device support, and integration with the Private Participation Receipt (PPR) reputation system.

Architecture Overview

The Person zome follows a Person-Centric Link Strategy with the relationship pattern: Agent → Person → Data

This architecture enables:

  • Multi-device support: Multiple agents can represent the same person across different devices
  • Unified identity: All data and roles are linked to the Person, not individual Agent devices
  • Simplified link management: Single coherent strategy replacing multiple redundant approaches
  • Scalable access control: Person-based permissions work across all devices

Core Data Structures

Person Entry

#![allow(unused)]
fn main() {
pub struct Person {
    pub name: String,                // Public display name
    pub avatar_url: Option<String>,  // Optional avatar URL (validated HTTP/HTTPS)
    pub bio: Option<String>,         // Optional biography
}
}

TODO (G1 — AgentEntityType): Add an agent_entity_type: AgentEntityType field to this struct (or to a companion AgentContext entry). This field distinguishes Individual, Collective, Project, Network, Bot, and ExternalOrganisation agents. Currently all agents are implicitly modelled as individual humans. See agent.md §6.1 and REQ-AGENT-01.

TODO (G15 — CapabilitySlot on Agent): The Person entry hash should serve as a stigmergic attachment surface — analogous to the NondominiumIdentity CapabilitySlot in ndo_prima_materia.md §6. External credential wallets, DID documents, and reputation oracles should be attachable via typed DHT links from the Person hash without modifying this entry. Flowsta is the first specified consumer: FlowstaIdentity slot → IsSamePersonEntry (ndo_prima_materia.md §6.5–6.7, REQ-NDO-CS-12–CS-15; documentation/requirements/post-mvp/flowsta-integration.md). See documentation/archives/agent.md §3.2, §3.5 and REQ-AGENT-11.

Privacy: Public entry, discoverable by all agents Validation: Name required (1-100 chars), avatar URL format validation

PrivatePersonData Entry

#![allow(unused)]
fn main() {
pub struct PrivatePersonData {
    pub legal_name: String,              // Full legal name
    pub email: String,                   // Contact email (validated)
    pub phone: Option<String>,           // Optional phone number
    pub address: Option<String>,         // Physical address
    pub emergency_contact: Option<String>, // Emergency contact info
    pub time_zone: Option<String>,       // Time zone preference
    pub location: Option<String>,        // Location/city
}
}

Privacy: Private entry, only accessible by owner Validation: Legal name and valid email required

Device Management Entries

AgentPersonRelationship Entry

#![allow(unused)]
fn main() {
pub struct AgentPersonRelationship {
    pub agent_pubkey: AgentPubKey,     // Agent representing the person
    pub person_hash: ActionHash,       // Person entry hash
    pub device_type: String,           // Device type (mobile, desktop, web, etc.)
    pub device_name: Option<String>,   // User-friendly device name
    pub created_at: Timestamp,         // When relationship was created
    pub is_active: bool,               // Whether device is currently active
}
}

Purpose: Links Agents to Persons, enabling multi-device scenarios Validation: One-to-one Agent-Person relationship prevents ambiguity

Device Entry

#![allow(unused)]
fn main() {
pub struct Device {
    pub device_id: String,             // Unique device identifier
    pub device_type: String,           // Device category
    pub device_name: String,           // User-friendly name
    pub person_hash: ActionHash,       // Associated person
    pub created_at: Timestamp,         // Device registration time
    pub last_active: Timestamp,        // Last activity timestamp
    pub capabilities: Vec<String>,     // Device-specific capabilities
}
}

Purpose: Physical device management for security and access control Features: Activity tracking, capability management, device lifecycle

DeviceSession Entry

#![allow(unused)]
fn main() {
pub struct DeviceSession {
    pub device_id: String,             // Device identifier
    pub session_start: Timestamp,      // Session start time
    pub session_end: Option<Timestamp>, // Session end time (optional for active sessions)
    pub ip_address: Option<String>,    // Network location
    pub user_agent: Option<String>,    // Client information
}
}

Purpose: Session tracking for security and audit purposes Security: Enables device-based security policies and monitoring

PersonRole Entry

#![allow(unused)]
fn main() {
pub struct PersonRole {
    pub role_name: String,        // Role name from RoleType enum
    pub description: Option<String>, // Role description
    pub assigned_to: AgentPubKey, // Agent receiving the role
    pub assigned_by: AgentPubKey, // Agent assigning the role
    pub assigned_at: Timestamp,   // Assignment timestamp
}
}

Governance: Only predefined role types allowed Authorization: Role assignment tracked with metadata

Role Types Hierarchy

#![allow(unused)]
fn main() {
pub enum RoleType {
    SimpleAgent,             // Simple Agent capabilities
    AccountableAgent,        // Accountable Agent level
    PrimaryAccountableAgent, // Primary Accountable Agent level
    Transport,               // Transport process access
    Repair,                  // Repair process access
    Storage,                 // Storage process access
}
}

TODO (G14 — Configurable Role Taxonomy): This enum is currently closed — only these six role types exist and communities cannot define their own. The OVN model requires that roles emerge from community needs, not from infrastructure decisions. Post-MVP, RoleType should become either an open string-tagged enum or a configurable registry of role entries defined per network. These six roles become sensible defaults, not constraints. See agent.md §5.3 and REQ-AGENT-06.

Agent Capability Progression:

  • Simple Agent (Entry Level): Default capabilities
  • Accountable Agent (Validated): Enhanced capabilities after resource validation
  • Primary Accountable Agent (Custodian): Full governance rights and physical custody
  • Specialized Roles: Transport, Repair, Storage for specific service types

Capability-Based Private Data Sharing

PrivateDataCapabilityMetadata Entry

#![allow(unused)]
fn main() {
pub struct PrivateDataCapabilityMetadata {
    pub grant_hash: ActionHash,          // Hash of the capability grant
    pub granted_to: AgentPubKey,         // Agent granted access
    pub granted_by: AgentPubKey,         // Agent granting access (data owner)
    pub fields_allowed: Vec<String>,     // Specific fields accessible
    pub context: String,                 // Context for the access
    pub expires_at: Timestamp,           // When access expires
    pub created_at: Timestamp,           // When grant was created
    pub cap_secret: CapSecret,           // Capability secret for validation
}
}

FilteredPrivateData Structure

#![allow(unused)]
fn main() {
pub struct FilteredPrivateData {
    pub legal_name: Option<String>,      // Never shared for privacy
    pub email: Option<String>,           // Email if granted
    pub phone: Option<String>,           // Phone if granted
    pub address: Option<String>,         // Address if granted
    pub emergency_contact: Option<String>, // Emergency contact if granted
    pub time_zone: Option<String>,       // Time zone if granted
    pub location: Option<String>,        // Location if granted
}
}

Capability Access Patterns:

  • Field-Level Control: Granular access to specific private data fields
  • Time-Limited Access: Automatic expiration with configurable duration (max 30 days)
  • Context-Aware Grants: Access linked to specific purposes and resource transfers
  • Holochain Native Security: Uses CapGrant/CapClaim system for cryptographic access control

API Functions

Person Management

create_person(input: PersonInput) -> ExternResult<Record>

Creates a new person profile for the calling agent.

Input:

#![allow(unused)]
fn main() {
pub struct PersonInput {
    pub name: String,
    pub avatar_url: Option<String>,
    pub bio: Option<String>,
}
}

Business Logic:

  • Validates one person per agent through AgentPersonRelationship (prevents duplicates)
  • Creates discovery links for efficient queries
  • Establishes Person-centric identity foundation

Links Created:

  • persons anchor -> person_hash (global discovery)
  • agent_pubkey -> person_hash (via AgentPersonRelationship)
  • person_hash -> agent_pubkey (reverse lookup for device management)

update_person(input: UpdatePersonInput) -> ExternResult<Record>

Updates an existing person profile with versioning support.

Authorization: Only the person's author can update Versioning: Creates update links for version history

get_latest_person(original_action_hash: ActionHash) -> ExternResult<Person>

Retrieves the latest version of a person profile.

Pattern: Follows update chain via PersonUpdates links Performance: Optimized with timestamp-based latest selection

get_all_persons() -> ExternResult<GetAllPersonsOutput>

Discovers all person profiles in the network.

Discovery Pattern: Queries the persons anchor path Output: Array of all public person profiles

get_person_profile(agent_pubkey: AgentPubKey) -> ExternResult<PersonProfileOutput>

Gets public profile information for a specific agent.

Privacy: Returns only public Person data, no private information

get_my_person_profile() -> ExternResult<PersonProfileOutput>

Gets complete profile information for the calling agent.

Privacy: Includes both public Person and private PrivatePersonData

Private Data Management

store_private_person_data(input: PrivatePersonDataInput) -> ExternResult<Record>

Stores private personal information for the calling agent.

Security: Private entry visibility enforced by Holochain Linking: Automatically links to person profile if it exists

update_private_person_data(input: UpdatePrivatePersonDataInput) -> ExternResult<Record>

Updates private personal information.

Authorization: Private entry visibility ensures only owner can update

get_my_private_person_data() -> ExternResult<Option<PrivatePersonData>>

Retrieves private data for the calling agent.

Security: Only accessible by the data owner

Device Management

register_device_for_person(input: RegisterDeviceInput) -> ExternResult<Record>

Registers a new device for the calling agent's person.

Input:

#![allow(unused)]
fn main() {
pub struct RegisterDeviceInput {
    pub device_type: String,           // Device category (mobile, desktop, web, etc.)
    pub device_name: String,           // User-friendly device name
    pub capabilities: Vec<String>,     // Device-specific capabilities
}
}

Business Logic:

  • Links device to agent's existing person profile
  • Creates AgentPersonRelationship for device tracking
  • Automatically generates unique device identifier
  • Supports device-specific capability management

Multi-Device Support: Enables same person across multiple devices

get_my_devices() -> ExternResult<GetMyDevicesOutput>

Retrieves all devices registered for the calling agent's person.

Output:

#![allow(unused)]
fn main() {
pub struct GetMyDevicesOutput {
    pub devices: Vec<Device>,
}
}

Security: Only accessible by the person who owns the devices Features: Returns device metadata, activity status, and capabilities

update_device_activity(device_id: String) -> ExternResult<()>

Updates the last activity timestamp for a device.

Usage: Called automatically during user interactions to maintain device activity tracking Security: Only device owner can update activity Purpose: Enables device-based security policies and session management

get_agent_person(agent_pubkey: AgentPubKey) -> ExternResult<Option<ActionHash>>

Retrieves the person hash associated with a specific agent.

Cross-Zome Usage: Essential for other zomes to resolve Agent → Person relationships Person-Centric Pattern: Core function enabling unified data access across devices Returns: Person hash if Agent-Person relationship exists, None otherwise

Capability-Based Private Data Sharing

grant_private_data_access(input: GrantPrivateDataAccessInput) -> ExternResult<GrantPrivateDataAccessOutput>

Creates a Holochain-native capability grant for private data access.

Input:

#![allow(unused)]
fn main() {
pub struct GrantPrivateDataAccessInput {
    pub agent_to_grant: AgentPubKey,
    pub fields_allowed: Vec<String>,    // ["email", "phone", "location", "time_zone", "emergency_contact", "address"]
    pub context: String,
    pub expires_in_days: Option<u32>,    // Default 7 days, max 30 days
}
}

Output:

#![allow(unused)]
fn main() {
pub struct GrantPrivateDataAccessOutput {
    pub grant_hash: ActionHash,
    pub cap_secret: CapSecret,
    pub expires_at: Timestamp,
}
}

Security: Uses Holochain's native CapGrant system Validation: Only allowed fields can be granted Automatic Enforcement: Holochain runtime validates capability claims

create_private_data_cap_claim(input: CreatePrivateDataCapClaimInput) -> ExternResult<CreatePrivateDataCapClaimOutput>

Creates a capability claim to access private data.

Usage: Required before accessing protected data Validation: Automatic Holochain capability checking

get_private_data_with_capability(input: GetPrivateDataWithCapabilityInput) -> ExternResult<FilteredPrivateData>

Accesses private data using a valid capability claim.

Protection: Automatically validated by Holochain capability system Field Filtering: Only returns fields included in the capability grant Privacy: Legal name never included in shared data

grant_role_based_private_data_access(input: GrantRoleBasedAccessInput) -> ExternResult<GrantPrivateDataAccessOutput>

Creates capability grants based on predefined role configurations.

Role Configurations:

  • Simple Agent: email only, 7 days
  • Accountable Agent: email + phone, 14 days
  • Primary Accountable Agent: email + phone + location, 30 days
  • Transport/Repair/Storage: email + phone + location + time_zone, 21 days

create_transferable_private_data_access(input: CreateTransferableAccessInput) -> ExternResult<TransferableCapabilityOutput>

Creates transferable capability grants that can be shared between agents.

Use Case: Guest access, temporary coordination, flexible sharing Security: Shorter duration for transferable capabilities

revoke_private_data_access(grant_hash: ActionHash) -> ExternResult<()>

Revokes a previously granted data access.

Authorization: Only the granting agent can revoke

get_my_capability_grants() -> ExternResult<Vec<PrivateDataCapabilityMetadata>>

Gets all capability grants created by the calling agent.

validate_capability_grant(grant_hash: ActionHash) -> ExternResult<bool>

Validates whether a capability grant is still valid and not expired.

Role Management

assign_person_role(input: PersonRoleInput) -> ExternResult<Record>

Assigns a role to an agent in the community.

Input:

#![allow(unused)]
fn main() {
pub struct PersonRoleInput {
    pub agent_pubkey: AgentPubKey,
    pub role_name: String,        // Must match RoleType enum
    pub description: Option<String>,
}
}

Validation: Role name must be from predefined RoleType enum Cross-Zome Integration: For specialized roles, calls governance zome for validation Metadata: Tracks who assigned the role and when

get_person_roles(agent_pubkey: AgentPubKey) -> ExternResult<GetPersonRolesOutput>

Retrieves all roles assigned to a specific agent.

Pattern: Follows AgentToPerson -> PersonToRoles link chain Versioning: Gets latest version of each role

get_my_person_roles() -> ExternResult<GetPersonRolesOutput>

Gets all roles for the calling agent.

has_person_role_capability(input: (AgentPubKey, String)) -> ExternResult<bool>

Checks if an agent has a specific role capability.

Usage: Access control validation in other zomes Performance: Optimized boolean check

get_person_capability_level(agent_pubkey: AgentPubKey) -> ExternResult<String>

Determines the highest capability level for an agent based on their roles.

Returns: "governance" | "coordination" | "stewardship" | "member" Logic: Hierarchical evaluation of role capabilities

Agent Promotion and Validation

promote_agent_to_accountable(input: PromoteAgentInput) -> ExternResult<String>

Promotes a Simple Agent to Accountable Agent status through governance validation.

Input:

#![allow(unused)]
fn main() {
pub struct PromoteAgentInput {
    pub agent: AgentPubKey,
    pub first_resource_hash: ActionHash,
}
}

Cross-Zome Integration: Calls zome_gouvernance.validate_agent_identity Governance: Implements agent validation workflow Agent Progression: Transitions Simple Agent → Accountable Agent after validation

promote_agent_with_validation(input: PromoteAgentInput) -> ExternResult<Record>

Promotes an agent with comprehensive validation workflow.

Process: Multi-step validation with governance integration Validation: Creates validation receipt and triggers PPR generation

request_role_promotion(input: RolePromotionRequest) -> ExternResult<ActionHash>

Requests promotion to a higher role level.

Workflow: Creates request for existing agents to validate and approve

approve_role_promotion(input: ApprovePromotionInput) -> ExternResult<Record>

Approves a role promotion request.

Authorization: Only existing Primary Accountable Agents can approve promotions

Cross-Zome Integration Functions

validate_agent_private_data(input: ValidationDataRequest) -> ExternResult<ValidationResult>

Validates agent private data for governance workflows.

Purpose: Enables governance zome to validate agent identity and private data Privacy: Requires explicit consent for private data access

validate_agent_private_data_with_grant(input: ValidationDataRequestWithGrant) -> ExternResult<ValidationResult>

Validates agent private data using existing capability grant.

Usage: Optimized validation when access has already been granted

The Person-Centric Link Strategy uses a unified Agent → Person → Data pattern that simplifies access while enabling multi-device scenarios.

  • AllPersons: persons anchor -> person_hash - Global person discovery
  • AgentToPerson: agent_pubkey -> person_hash - Agent-to-Person relationship lookup
  • PersonToAgent: person_hash -> agent_pubkey - Reverse lookup for device management
  • PersonToPrivateData: person_hash -> private_data_hash - Primary private data access
  • PrivateDataUpdates: original_hash -> updated_hash - Private data version history

Key Improvement: Simplified from 3 redundant strategies to 1 unified Person-centric approach

  • PersonToRoles: person_hash -> role_hash - Person role queries (works across all devices)
  • RoleUpdates: original_hash -> updated_hash - Role version history

Multi-Device Benefit: Roles are assigned to Persons, not individual Agents, so they work across all devices

  • PersonUpdates: original_hash -> updated_hash - Person version history
  • PersonToDevices: person_hash -> device_hash - All devices belonging to a person
  • DeviceToSessions: device_id -> session_hash - Device session tracking
  • AgentToRelationship: agent_pubkey -> relationship_hash - AgentPersonRelationship tracking
  • AgentToCapabilityMetadata: agent_pubkey -> grant_hash - Track grants created by agent
  • RevokedGrantAnchor: Anchor for revoked capability grants

Cross-Zome Integration Pattern

#![allow(unused)]
fn main() {
// Other zomes use this pattern for Person-centric access
let person_hash = call(
    CallTargetCell::Local,
    "zome_person",
    "get_agent_person".into(),
    None,
    &agent_pubkey,
)?;

if let Some(person) = person_hash {
    // Access Person's data, roles, resources
    let roles = call("zome_person", "get_person_roles", None, &person_hash)?;
    let resources = call("zome_resource", "get_person_resources", None, &person_hash)?;
}
}

Error Handling

PersonError Types

PersonError is defined in crates/utils/src/errors.rs and imported by zome_person.

#![allow(unused)]
fn main() {
pub enum PersonError {
    PersonAlreadyExists,           // One person per agent restriction
    PersonNotFound(String),        // Person lookup failures
    PrivateDataNotFound,          // Private data access failures
    RoleNotFound(String),         // Role lookup failures
    NotAuthor,                    // Authorization failures
    SerializationError(String),   // Data serialization issues
    EntryOperationFailed(String), // DHT operation failures
    LinkOperationFailed(String),  // Link operation failures
    InvalidInput(String),         // Input validation failures
    InsufficientCapability(String), // Capability level restrictions
}
}

Pattern: Comprehensive error coverage with descriptive messages Integration: Converts to WasmError for Holochain compatibility via From<PersonError> for WasmError in nondominium_utils::errors

Privacy Model

Public Data Layer

  • Person entries: Name, avatar, bio (discoverable)
  • Role assignments: Role name, assignment metadata (auditable)
  • Capability metadata: Grant information for audit trails

Private Data Layer

  • PrivatePersonData entries: PII, contact info (owner-only access)
  • Holochain Security: Private entry visibility enforced by conductor

Controlled Sharing Layer

  • Capability grants: Time-limited, field-specific access grants
  • Allowed Fields: email, phone, location, time_zone, emergency_contact, address
  • Grant Duration: Maximum 30 days, configurable by data owner
  • Context-Aware: Grants linked to specific purposes and resource transfers

Integration with Other Zomes

The Person-Centric architecture provides a unified integration pattern for all zomes.

Person-Centric Access Pattern

#![allow(unused)]
fn main() {
// RESOLUTION PATTERN: Agent → Person → Data
let person_hash = call(
    CallTargetCell::Local,
    "zome_person",
    "get_agent_person".into(),
    None,
    &agent_pubkey,
)?;

if let Some(person) = person_hash {
    // Access Person's unified data across all their devices
    let roles = call("zome_person", "get_person_roles", None, &person_hash)?;
    let private_data = call("zome_person", "get_person_private_data", None, &person_hash)?;
    let resources = call("zome_resource", "get_person_resources", None, &person_hash)?;
}
}

Cross-Zome Role Validation (Person-Centric)

#![allow(unused)]
fn main() {
// Check if PERSON (not agent) has required role for operation
let person_hash = call("zome_person", "get_agent_person", None, &agent_pubkey)?;
if let Some(person) = person_hash {
    let has_capability = call(
        CallTargetCell::Local,
        "zome_person",
        "has_person_role_capability".into(),
        None,
        &(person, "required_role".to_string()),
    )?;
}
}

Multi-Device Benefit: Role validation works consistently across all user devices

Agent Capability Level Validation

#![allow(unused)]
fn main() {
// Check PERSON's capability level (unified across devices)
let person_hash = call("zome_person", "get_agent_person", None, &agent_pubkey)?;
if let Some(person) = person_hash {
    let capability_level = call(
        CallTargetCell::Local,
        "zome_person",
        "get_person_capability_level".into(),
        None,
        &person,
    )?;
}
}

Private Data Validation for Governance

#![allow(unused)]
fn main() {
// Governance zome accessing PERSON's private data (not agent-specific)
let person_hash = call("zome_person", "get_agent_person", None, &agent_pubkey)?;
if let Some(person) = person_hash {
    let validation_result = call(
        CallTargetCell::Local,
        "zome_person",
        "validate_agent_private_data".into(),
        None,
        &ValidationDataRequest {
            agent_to_validate: agent_pubkey,
            validation_type: "agent_promotion".to_string(),
            requesting_validator: validator_pubkey,
            validation_context: validation_hash,
        },
    )?;
}
}

Resource Zome Integration

#![allow(unused)]
fn main() {
// Resources linked to PERSON, not individual agents
let person_hash = call("zome_person", "get_agent_person", None, &agent_pubkey)?;
if let Some(person) = person_hash {
    // Get all resources belonging to this person (across all devices)
    let resources = call("zome_resource", "get_person_resources", None, &person_hash)?;

    // Create new resource linked to person
    let resource = call("zome_resource", "create_resource", None, &ResourceInput {
        person_hash: person,
        // ... other fields
    })?;
}
}

Implementation Status

Completed Features

  • Person-Centric Architecture: Unified Agent → Person → Data relationship pattern
  • Multi-Device Support: Complete device management with AgentPersonRelationship tracking
  • Person Profile Management: Public identity with name, avatar, bio
  • Private Data Management: Simplified Person-centric private data access (1 unified strategy)
  • Role-Based Access Control: 6-level role hierarchy with Person-centric assignment
  • Capability-Based Sharing: Holochain native CapGrant/CapClaim system for private data
  • Device Management: Complete device registration, tracking, and session management
  • Agent Promotion Workflows: Simple Agent → Accountable Agent promotion with governance validation
  • Cross-Zome Integration: Person-centric role and capability validation for all zomes
  • Versioning Support: Complete update history for persons, roles, and devices
  • Privacy Controls: Four-layer privacy model with Person-centric access control
  • Validation Functions: Private data validation for governance workflows

🚀 New Person-Centric Capabilities

  • Simplified Link Management: Reduced from 3 redundant strategies to 1 unified approach
  • Multi-Device Identity: Same Person can operate across multiple devices seamlessly
  • Unified Data Access: All data (roles, resources, private info) accessed through Person
  • Device Security Policies: Device-based access control and session management
  • Cross-Device Consistency: Roles and permissions work consistently across all devices

🔧 Current Limitations

  • No Economic Processes: Specialized roles (Transport, Repair, Storage) defined but not fully integrated with process workflows
  • Basic PPR Integration: PPR system exists but integration with person zome is primarily through validation workflows
  • No Role Delegation: Temporary role assignments and delegation workflows not implemented
  • Limited Audit Features: Capability grant tracking exists but comprehensive audit trails need enhancement

Agent Ontology Gaps (identified against OVN wiki — see documentation/archives/agent.md §2.6):

GapGap IDOVN RelevanceImpact
Only individual agents modelledG1OVN: groups, projects, networks, bots are also agentsCannot model collective agency, AI participants, or network-level actors
Binary in/out membershipG2OVN: UnaffiliatedStranger/Close/Active/Core/Inactive affiliation spectrumCannot determine governance eligibility algorithmically; 1-9-90 engagement reality is invisible
No composable AgentProfileG3OVN: profile aggregates roles, contributions, relations, credentialsPerson, ReputationSummary, and Roles are separate and unconnected
No social graphG4OVN: social relations are part of profile and social capitalCannot surface network wealth or organisational reach
No network affiliationsG5OVN: agents participate simultaneously in multiple networksSingle-network only; agents cannot be bridge nodes
No AffiliationRecordG6OVN: formal ToP ceremony creates accountability for active affiliatesNo formal onboarding; no machine-readable agreement to Terms of Participation
request_role_promotion stubbedG13Promotion requests cannot be queried or trackedApprovers cannot discover pending requests; workflow is broken
Roles are predefined/closedG14OVN: roles emerge from community needsCommunities cannot extend the role taxonomy

📋 Future Enhancement Opportunities

The following items map directly to the gap IDs in documentation/archives/agent.md and the REQ-AGENT-* requirements in documentation/requirements/requirements.md:

Phase 2 (Near-term):

  • [G13] Fix request_role_promotion stub: Create a real queryable RolePromotionRequest entry with bidirectional discovery links so approvers can find and act on pending requests (see REQ-AGENT-16).
  • [G6] AffiliationRecord entry: Implement formal Terms of Participation ceremony — agent cryptographically signs acknowledgement of ToP, Nondominium & Custodian agreement, and Benefit Redistribution Algorithm (see REQ-AGENT-05).
  • [G2] Derived affiliation state: Implement get_affiliation_state(agent) as a computed query over existing PPR + contribution data — f(person_exists, contributions_count, last_contribution_ts, reputation_summary, affiliation_record_exists)UnaffiliatedStranger | CloseAffiliate | ActiveAffiliate | CoreAffiliate | InactiveAffiliate (see REQ-AGENT-04).

Phase 3 (Medium-term):

  • [G1] AgentEntityType field: Add agent_entity_type: AgentEntityType to agent context (Individual, Collective, Project, Network, Bot, ExternalOrganisation). Collective agents reference an NDO hash rather than a Person entry (see REQ-AGENT-01, REQ-AGENT-02).
  • [G15] CapabilitySlot on Person: Implement typed DHT links from Person hash to external capabilities — DID documents, credential wallets, reputation oracles — without modifying the Person entry (see REQ-AGENT-11).
  • [G3] Composable AgentProfile view: Implement get_agent_profile(agent) that assembles Person + ReputationSummary + PersonRole list + active commitment count + economic event counts + CapabilitySlot attachments + network affiliations into one queryable output (see REQ-AGENT-07).
  • [G4] AgentRelationship link type: Bidirectional, typed (colleague, collaborator, trusted, voucher), private peer relationship links. Social capital must be legible to governance (see REQ-AGENT-08).
  • [G5] Network affiliation links: Typed links from Person hash to NDO instance hashes, modelling cross-network membership (see REQ-AGENT-09).
  • [G14] Configurable role taxonomy: Replace closed RoleType enum with a configurable role registry defined per network; predefined roles become defaults (see REQ-AGENT-06).

Phase 4 (Long-term):

  • [G8] PortableCredential structure: Bilaterally signed credential export (issuer + agent signatures) verifiable by other Holochain networks. Types: RoleCredential, ReputationCredential, CompetencyCredential, AffiliationCredential (see REQ-AGENT-12).
  • [G7] ZKP capability proofs: Integration of ZKP library or ZKP-compatible VC layer; prove_capability(condition) without raw data disclosure — e.g., "I have ≥10 completed maintenance commitments" without revealing counterparties or timestamps (see REQ-AGENT-13).
  • [G9] Sybil resistance: Social vouching (existing agents vouch for new agents), biometric opt-in, or Proof-of-Personhood integration as configurable membrane proof (see REQ-AGENT-15).
  • [G10] Pseudonymous participation mode: Allow contribution under a temporary ephemeral key without linking to Person. Contribution is recorded but unlinkable to physical identity (see REQ-AGENT-14).
  • [G11] AI/bot delegation: DelegatedAgent relationship allowing a Person to authorise an AI or bot to act within defined scope and duration (see REQ-AGENT-03).
  • [G12] AgentNeedsWants profile extension: Optional profile extension declaring what resources the agent needs and what they can offer, enabling network-level matching (see REQ-AGENT-10).
  • Cross-Network Identity: Federated identity management using PortableCredential + Holochain membrane proofs.
  • Device Trust Scoring: Reputation-based device security policies.
  • Advanced Session Management: Multi-device session coordination and security.

The Person zome provides the foundational identity and privacy infrastructure for the nondominium ecosystem, enabling secure agent interactions with comprehensive role-based governance and sophisticated private data sharing capabilities.

Resource Zome (zome_resource) Documentation

The Resource zome implements the core resource management infrastructure for the nondominium ecosystem, providing ValueFlows-compliant resource specification management, Economic Resource lifecycle tracking, governance rule enforcement, and custody transfer workflows. It serves as the foundation for all resource-related activities and supports the Private Participation Receipt (PPR) reputation system through comprehensive audit trails.

NDO Layer 0 (NondominiumIdentity) is implemented — see ### NondominiumIdentity Entry (Layer 0) below.

TODO (post-MVP — NDO Layers 1 & 2, ndo_prima_materia.md §§4, 8, 10): Cross-layer link types not yet implemented:

  • NDOToSpecification — Layer 0 identity hash to ResourceSpecification (Layer 1 activation)
  • NDOToProcess — Layer 0 identity hash to Process (Layer 2 activation)
  • NDOToComponent — Layer 0 identity hash to child NDO identity hash (holonic composition)
  • CapabilitySlot — Layer 0 identity hash to capability targets (stigmergic attachment surface)

Unyt (post-MVP): endorsed economic terms use typed EconomicAgreement GovernanceRule data (ndo_prima_materia.md §6.6, REQ-NDO-CS-09–CS-11; documentation/requirements/post-mvp/unyt-integration.md).

Core Data Structures

NondominiumIdentity Entry (Layer 0)

Permanent identity anchor for any resource. Exists from the moment of conception through end-of-life. The original ActionHash from create_ndo is the stable Layer 0 identity — it never changes even as lifecycle_stage evolves.

#![allow(unused)]
fn main() {
pub struct NondominiumIdentity {
    pub name: String,
    pub initiator: AgentPubKey,          // immutable after creation
    pub property_regime: PropertyRegime, // immutable after creation
    pub resource_nature: ResourceNature, // immutable after creation
    pub lifecycle_stage: LifecycleStage, // mutable — changes on every transition
    pub created_at: Timestamp,           // immutable after creation
    pub description: Option<String>,     // immutable after creation
    pub successor_ndo_hash: Option<ActionHash>, // set once on → Deprecated (REQ-NDO-LC-06)
    pub hibernation_origin: Option<LifecycleStage>, // set on → Hibernating, cleared on exit
}
}

LifecycleStage (10 stages):

PhaseStages
EmergenceIdeationSpecificationDevelopmentPrototype
MaturityStableDistributed
OperationActive
Suspension (reversible)Hibernating
TerminalDeprecatedEndOfLife

State machine transitions are enforced by the integrity zome (see ndo_prima_materia.md §5.3). Hibernating is a memory-preserving pause — it resumes to the exact stage that was paused, not necessarily Active. Deprecated and EndOfLife are terminal (REQ-NDO-LC-04). Any non-terminal stage may enter Hibernating, Deprecated, or EndOfLife.

PropertyRegime (6 variants): Private, Commons, Collective, Pool, CommonPool, Nondominium

ResourceNature (5 variants): Physical, Digital, Service, Hybrid, Information

Mutability (three conditionally-mutable fields):

FieldRule
lifecycle_stageChanges on every transition
successor_ndo_hashSet exactly once when entering Deprecated; immutable after
hibernation_originSet to the paused stage when entering Hibernating; cleared on exit

All other fields are permanently immutable after creation. Delete is always Invalid — Layer 0 is permanent.

Design note — NDO as identifier, not chronicle: lifecycle_stage at creation reflects the resource's actual state at registration time, not a claim about when it was originally conceived. An existing physical resource registered into the system is created at its true current stage (e.g. Active), not forced through a synthetic Ideation entry. The NDO identity anchor behaves like a DOI or ISBN: it is assigned at the moment of system registration, which may be well after the resource began its life. Forcing Ideation-only initial stages would require fabricating DHT history for brownfield resources and block migration of existing EconomicResource entries when Layers 1/2 activate.

Discovery links: AllNdos (global anchor "ndo_identities" path → action hashes), AgentToNdo (initiator pubkey → action hashes), NdoByLifecycleStage / NdoByNature / NdoByPropertyRegime (categorization anchors — path pattern "ndo.lifecycle.{Stage:?}" etc. → action hashes, REQ-NDO-L0-05)

Lifecycle links: NdoToSuccessor (deprecated NDO → successor NDO, REQ-NDO-LC-06), NdoToTransitionEvent (NDO → triggering EconomicEvent, REQ-NDO-L0-05)

ResourceSpecification Entry

#![allow(unused)]
fn main() {
pub struct ResourceSpecification {
    pub name: String,                     // Resource specification name
    pub description: String,              // Detailed description
    pub category: String,                 // Category for efficient queries
    pub image_url: Option<String>,        // Optional resource image
    pub tags: Vec<String>,               // Flexible discovery tags
    pub governance_rules: Vec<ActionHash>, // Embedded governance
    pub created_by: AgentPubKey,         // Creator agent
    pub created_at: Timestamp,           // Creation timestamp
    pub is_active: bool,                 // Active/inactive filter
}
}

ValueFlows: Compliant with resource specification standards Governance: Embedded rules for access and usage control Discovery: Category and tag-based efficient queries

EconomicResource Entry

#![allow(unused)]
fn main() {
pub struct EconomicResource {
    pub conforms_to: ActionHash,    // Link to ResourceSpecification
    pub quantity: f64,              // Resource quantity
    pub unit: String,              // Unit of measurement
    pub custodian: AgentPubKey,    // Primary Accountable Agent
    // TODO (G1, REQ-AGENT-02): replace custodian: AgentPubKey with custodian: AgentContext
    // post-MVP to support Collective, Project, Network, and Bot agents as Primary Accountable
    // Agents. AgentContext = union of AgentPubKey | CollectiveAgentHash. The same change is
    // needed in TransitionContext.target_custodian (governance-operator-architecture.md) and
    // NondominiumIdentity.initiator (ndo_prima_materia.md Section 8.1).
    pub created_by: AgentPubKey,   // Resource creator
    pub created_at: Timestamp,     // Creation timestamp
    pub current_location: Option<String>, // Physical/virtual location
    // TODO: split into two fields:
    //   pub lifecycle_stage: LifecycleStage,    // lives on NondominiumIdentity (Layer 0)
    //   pub operational_state: OperationalState, // lives on EconomicResource (Layer 2)
    pub state: ResourceState,      // Current resource state (pending split — see ndo_prima_materia.md Section 5)
}
}

ValueFlows: Compliant economic resource implementation Custody: Clear custodianship with Primary Accountable Agent pattern State Management: Comprehensive resource lifecycle tracking

ResourceState Enum (pending replacement)

TODO: Split ResourceState into two orthogonal enums per ndo_prima_materia.md Section 5 and REQ-NDO-OS-01 through REQ-NDO-OS-06.

#![allow(unused)]
fn main() {
// CURRENT (conflated — to be replaced):
pub enum ResourceState {
    PendingValidation,  // → OperationalState::PendingValidation
    Active,            // → LifecycleStage::Active + OperationalState::Available
    Maintenance,       // → OperationalState::InMaintenance (LifecycleStage unchanged)
    Retired,          // → LifecycleStage::Deprecated or EndOfLife
    Reserved,         // → OperationalState::Reserved (LifecycleStage unchanged)
}

// IMPLEMENTED — LifecycleStage (on NondominiumIdentity, Layer 0, REQ-NDO-LC-01–07):
pub enum LifecycleStage {
    Ideation,      // spark of an idea, Layer 0 anchor only
    Specification, // design/requirements being written
    Development,   // active construction / prototyping
    Prototype,     // proof-of-concept, not yet production-ready
    Stable,        // production-ready, design is replicable
    Distributed,   // being actively fabricated/used across the network
    Active,        // in normal use
    Hibernating,   // dormant but recoverable (reversible)
    Deprecated,    // superseded; successor NDO required
    EndOfLife,     // permanently concluded; Layer 0 tombstone
}

// TARGET — OperationalState (on EconomicResource, Layer 2):
pub enum OperationalState {
    PendingValidation, Available, Reserved,
    InTransit, InStorage, InMaintenance, InUse,
}
}

Key principle: Transport, storage, and maintenance are processes that act on a resource at any lifecycle stage. A Development resource can be InTransit between R&D labs. An Active resource can be InMaintenance. These are operational conditions, not lifecycle milestones.

Lifecycle: LifecycleStage tracks maturity/evolution (advances rarely, almost irreversibly) Operational: OperationalState tracks active processes (cycles frequently, reset to Available when process ends) Transitions: All state changes governed by the governance zome; each transition references a valid EconomicEvent

GovernanceRule Entry

#![allow(unused)]
fn main() {
pub struct GovernanceRule {
    pub rule_type: String,           // Rule category (access, usage, transfer)
    pub rule_data: String,          // JSON-encoded rule parameters
    pub enforced_by: Option<String>, // Role required for enforcement
    pub created_by: AgentPubKey,    // Rule creator
    pub created_at: Timestamp,      // Creation timestamp
    // TODO (post-MVP, governance.md §4.8): add `expires_at: Option<Timestamp>` for temporal
    // governance. Rules with an expiry become inactive after the deadline without requiring a
    // manual update. Enables sunset clauses and time-limited access grants.
    // TODO (post-MVP): add `EconomicAgreement` to typed `GovernanceRuleType` for Unyt Smart
    // Agreement integration. See ndo_prima_materia.md §6.6, REQ-NDO-CS-07–CS-11, and
    // documentation/specifications/governance/governance.md (EconomicAgreement TODO).
}
}

Flexibility: JSON-encoded parameters for complex rule logic Enforcement: Role-based rule enforcement delegation Governance: Community-driven rule creation and management

API Functions

NDO Layer 0 Management

create_ndo(input: NdoInput) -> ExternResult<NdoOutput>

Creates a new NondominiumIdentity. Sets initiator from agent_info and created_at from sys_time. Creates two discovery links.

Input: NdoInput { name, property_regime, resource_nature, lifecycle_stage, description } Output: NdoOutput { action_hash, entry }action_hash is the stable Layer 0 identity. Links created: AllNdos (global anchor "ndo_identities" → action hash), AgentToNdo (initiator pubkey → action hash), NdoByLifecycleStage (stage anchor → action hash), NdoByNature (nature anchor → action hash), NdoByPropertyRegime (regime anchor → action hash). Nature and regime anchors are immutable and never moved. Validation: name must not be empty. Initial stage: Any non-terminal stage is valid at creation (Hibernating, Deprecated, EndOfLife are rejected). Use the resource's actual current stage — do not fabricate a synthetic Ideation entry for resources that pre-date system registration (see design note above).

get_ndo(original_action_hash: ActionHash) -> ExternResult<Option<NondominiumIdentity>>

Returns the latest version of a NondominiumIdentity by resolving the HDK update chain. Always provide the original action hash — the function handles chain traversal internally.

update_lifecycle_stage(input: UpdateLifecycleStageInput) -> ExternResult<ActionHash>

Transitions the lifecycle_stage of a NondominiumIdentity. Only the initiator may call this. Enforced in both the coordinator (pre-flight check) and the integrity zome (state machine validation).

Input:

#![allow(unused)]
fn main() {
UpdateLifecycleStageInput {
    original_action_hash: ActionHash,
    new_stage: LifecycleStage,
    successor_ndo_hash: Option<ActionHash>,    // required when new_stage == Deprecated
    transition_event_hash: Option<ActionHash>, // triggering EconomicEvent (REQ-NDO-L0-05)
}
}

Authorization: caller must equal entry.initiator.

State machine: The integrity zome enforces the §5.3 transition allowlist. Invalid transitions (e.g. EndOfLife → Ideation, Deprecated → Active) return a validation error.

Returns: new action hash. The original_action_hash remains the stable Layer 0 identity.

Links created / moved (conditional):

  • NdoToSuccessor (original_action_hashsuccessor_ndo_hash) — only when new_stage == Deprecated (REQ-NDO-LC-06)
  • NdoToTransitionEvent (original_action_hashtransition_event_hash) — when transition_event_hash is Some (REQ-NDO-L0-05; full cross-zome event validation deferred)
  • NdoByLifecycleStage link is moved: the old stage's link is deleted and a new link is created at the new stage anchor (only when stage actually changes).

get_all_ndos(_: ()) -> ExternResult<GetAllNdosOutput>

Returns the latest version of all NondominiumIdentity entries via the global "ndo_identities" anchor. Entries unavailable on the DHT or failing deserialization are silently skipped (eventual consistency). Output: GetAllNdosOutput { ndos: Vec<NdoOutput> }.

get_my_ndos(_: ()) -> ExternResult<GetAllNdosOutput>

Returns all NondominiumIdentity entries created by the calling agent, resolved to their latest versions. Uses AgentToNdo links. Entries unavailable on the DHT or failing deserialization are silently skipped (eventual consistency). Output: GetAllNdosOutput { ndos: Vec<NdoOutput> }.

get_ndos_by_lifecycle_stage(stage: LifecycleStage) -> ExternResult<GetAllNdosOutput>

Returns all NDOs currently at the given LifecycleStage. Uses the NdoByLifecycleStage categorization anchor (path "ndo.lifecycle.{stage:?}"). The anchor is maintained by create_ndo and update_lifecycle_stage. Entries unavailable on the DHT or failing deserialization are silently skipped. REQ-NDO-L0-05, REQ-NDO-L0-07.

get_ndos_by_nature(nature: ResourceNature) -> ExternResult<GetAllNdosOutput>

Returns all NDOs of the given ResourceNature. Uses the NdoByNature categorization anchor (path "ndo.nature.{nature:?}"). The anchor is immutable — it is set at creation time and never moved. Entries unavailable on the DHT or failing deserialization are silently skipped. REQ-NDO-L0-05, REQ-NDO-L0-07.

get_ndos_by_property_regime(regime: PropertyRegime) -> ExternResult<GetAllNdosOutput>

Returns all NDOs under the given PropertyRegime. Uses the NdoByPropertyRegime categorization anchor (path "ndo.regime.{regime:?}"). The anchor is immutable — it is set at creation time and never moved. Entries unavailable on the DHT or failing deserialization are silently skipped. REQ-NDO-L0-05, REQ-NDO-L0-07.

Resource Specification Management

create_resource_specification(input: CreateResourceSpecificationInput) -> ExternResult<Record>

Creates a new resource specification template.

Input:

#![allow(unused)]
fn main() {
pub struct CreateResourceSpecificationInput {
    pub name: String,
    pub description: String,
    pub category: String,
    pub image_url: Option<String>,
    pub tags: Vec<String>,
    pub governance_rules: Vec<ActionHash>,
}
}

Business Logic:

  • Validates required fields (name, description, category)
  • Creates discovery links by category and tags
  • Links to governance rules for embedded control

Links Created:

  • category anchor -> spec_hash (category discovery)
  • tag anchors -> spec_hash (tag discovery)
  • all_specs anchor -> spec_hash (global discovery)

update_resource_specification(input: UpdateResourceSpecificationInput) -> ExternResult<Record>

Updates an existing resource specification.

Authorization: Only the specification author can update Versioning: Creates update links for version history

get_latest_resource_specification(original_action_hash: ActionHash) -> ExternResult<ResourceSpecification>

Retrieves the latest version of a resource specification.

Pattern: Follows update chain via version links Performance: Optimized with timestamp-based latest selection

get_all_resource_specifications() -> ExternResult<GetAllResourceSpecificationsOutput>

Discovers all resource specifications in the network.

Discovery Pattern: Queries the resource_specifications anchor path Output: GetAllResourceSpecificationsOutput — two parallel vectors of the same length and order:

  • specifications: Vec<ResourceSpecification> — all active resource specifications
  • action_hashes: Vec<ActionHash> — the original creation ActionHash of each spec (from the anchor link target); stable identity for routing (e.g. /ndo/[id])

get_resource_specifications_by_category(category: String) -> ExternResult<Vec<Record>>

Finds resource specifications by category.

Pattern: Efficient category-based discovery via anchor links Use Case: Browse resources by type (tools, materials, services)

get_resource_specifications_by_tag(tag: String) -> ExternResult<Vec<Record>>

Finds resource specifications by tag.

Pattern: Tag-based discovery for flexible filtering Use Case: Find resources with specific attributes

get_resource_specification_with_rules(spec_hash: ActionHash) -> ExternResult<ResourceSpecificationWithRules>

Gets resource specification with associated governance rules.

Integration: Fetches linked governance rules for complete context Use Case: Understand resource access requirements before creation

Economic Resource Management

create_economic_resource(input: CreateEconomicResourceInput) -> ExternResult<Record>

Creates a new economic resource instance.

Input:

#![allow(unused)]
fn main() {
pub struct CreateEconomicResourceInput {
    pub conforms_to: ActionHash,    // Resource specification
    pub quantity: f64,
    pub unit: String,
    pub current_location: Option<String>,
}
}

Business Logic:

  • Validates caller has appropriate capability level
  • Links resource to specification for compliance
  • Sets initial state to PendingValidation
  • Creates custody links to custodian

Authorization: Requires Accountable Agent capability level Validation: Cross-zome validation with governance zome

update_economic_resource(input: UpdateEconomicResourceInput) -> ExternResult<Record>

Updates an existing economic resource.

Authorization: Only resource custodian can update Fields Updateable: Quantity, location, state (with validation)

get_latest_economic_resource(original_action_hash: ActionHash) -> ExternResult<EconomicResource>

Retrieves the latest version of an economic resource.

Pattern: Follows update chain via version links Use Case: Get current resource state and attributes

get_all_economic_resources() -> ExternResult<GetAllEconomicResourcesOutput>

Discovers all economic resources in the network.

Privacy: Returns only public resource information Access Control: Respects resource visibility settings

Gets resources created or custodied by the calling agent.

Pattern: Queries agent's resource links Use Case: Agent's personal resource inventory

Gets resources associated with a specific agent.

Pattern: Agent-centric resource discovery Use Case: View another agent's resource portfolio

get_resources_by_specification(spec_hash: ActionHash) -> ExternResult<Vec<Record>>

Finds all economic resources conforming to a specification.

Pattern: Specification to resource discovery Use Case: Find all instances of a particular resource type

get_economic_resource_profile(resource_hash: ActionHash) -> ExternResult<EconomicResourceProfile>

Gets complete resource profile with specification and governance rules.

Integration: Combines resource data with specification and rules Use Case: Full resource context for decision making

check_first_resource_requirement(agent_pub_key: AgentPubKey) -> ExternResult<bool>

Checks if an agent has created their first resource yet.

Use Case: Validation for Simple Agent promotion requirements Business Logic: Used in agent progression workflows

Custody Transfer Management

transfer_custody(input: TransferCustodyInput) -> ExternResult<TransferCustodyOutput>

Transfers custody of an economic resource to another agent.

Input:

#![allow(unused)]
fn main() {
pub struct TransferCustodyInput {
    pub resource_hash: ActionHash,
    pub new_custodian: AgentPubKey,
    pub transfer_note: Option<String>,
}
}

Authorization: Only current custodian can transfer Validation: Validates new custodian capability level Integration: Creates economic event for PPR generation

Business Logic:

  • Validates transfer permissions
  • Updates resource custodian
  • Creates economic event (TransferCustody)
  • Triggers validation workflow if required

update_resource_state(input: UpdateResourceStateInput) -> ExternResult<Record>

TODO: Replace with two separate functions per REQ-NDO-OS-01:

  • update_lifecycle_stage(input: UpdateLifecycleStageInput) — transitions on NondominiumIdentity; requires an EconomicEvent hash as proof of triggering action
  • update_operational_state(input: UpdateOperationalStateInput) — transitions on EconomicResource; called by governance zome when processes begin/end

Updates the state of an economic resource.

Input:

#![allow(unused)]
fn main() {
// CURRENT (pending split):
pub struct UpdateResourceStateInput {
    pub resource_hash: ActionHash,
    pub new_state: ResourceState,  // TODO: split into lifecycle_stage / operational_state
    pub reason: Option<String>,
}
}

Authorization: Governance zome only (via governance-as-operator pattern) Validation: All transitions require a corresponding EconomicEvent reference Integration: Creates economic events for PPR generation

Governance Rule Management

create_governance_rule(input: GovernanceRuleInput) -> ExternResult<Record>

Creates a new governance rule.

Input:

#![allow(unused)]
fn main() {
pub struct GovernanceRuleInput {
    pub rule_type: String,
    pub rule_data: String,
    pub enforced_by: Option<String>,
}
}

Business Logic:

  • Validates rule format and structure
  • Links rule to creator for accountability
  • Creates discovery links for rule lookup

update_governance_rule(input: UpdateGovernanceRuleInput) -> ExternResult<Record>

Updates an existing governance rule.

Authorization: Only rule creator can update Validation: Ensures rule data remains valid JSON

get_all_governance_rules() -> ExternResult<GetAllGovernanceRulesOutput>

Discovers all governance rules in the network.

Discovery Pattern: Queries the governance_rules anchor path Use Case: Understand community governance framework

get_governance_rules_by_type(rule_type: String) -> ExternResult<Vec<Record>>

Finds governance rules by type.

Pattern: Type-based rule discovery Use Case: Find all access rules, usage rules, etc.

get_governance_rule_profile(rule_hash: ActionHash) -> ExternResult<GovernanceRuleProfile>

Gets governance rule with creator information.

Integration: Links rule to creator agent profile Use Case: Understand rule context and authority

  • AllSpecs: resource_specifications anchor -> spec_hash - Global discovery
  • CategoryLinks: category anchor -> spec_hash - Category discovery
  • TagLinks: tag anchor -> spec_hash - Tag discovery
  • SpecificationUpdates: original_hash -> updated_hash - Version history
  • AllResources: economic_resources anchor -> resource_hash - Global discovery
  • SpecificationToResources: spec_hash -> resource_hash - Specification to instances
  • AgentToResources: agent_pubkey -> resource_hash - Agent resource portfolio
  • CustodyLinks: custodian -> resource_hash - Current custodian tracking
  • ResourceUpdates: original_hash -> updated_hash - Version history
  • AllGovernanceRules: governance_rules anchor -> rule_hash - Global discovery
  • RuleTypeLinks: rule_type anchor -> rule_hash - Type-based discovery
  • RuleUpdates: original_hash -> updated_hash - Version history
  • SpecificationToRules: spec_hash -> rule_hash - Embedded governance
  • ResourceToEvents: resource_hash -> event_hash - Economic event tracking

Signal Architecture

The Resource zome emits signals for real-time UI updates:

#![allow(unused)]
fn main() {
pub enum Signal {
    EntryCreated { action, app_entry },
    EntryUpdated { action, app_entry, original_app_entry },
    EntryDeleted { action, original_app_entry },
    LinkCreated { action, link_type },
    LinkDeleted { action, link_type },
}
}

Real-time Updates: Enables UI reactivity to resource changes Cross-Zome Coordination: Supports complex workflows with other zomes

Error Handling

ResourceError Types

ResourceError is defined in crates/utils/src/errors.rs and imported by zome_resource.

#![allow(unused)]
fn main() {
pub enum ResourceError {
    ResourceSpecNotFound(String),      // Specification lookup failures
    EconomicResourceNotFound(String),  // Resource lookup failures
    GovernanceRuleNotFound(String),    // Rule lookup failures
    NotAuthor,                         // Authorization failures
    NotCustodian,                      // Custody validation failures
    SerializationError(String),        // Data serialization issues
    EntryOperationFailed(String),     // DHT operation failures
    LinkOperationFailed(String),      // Link operation failures
    InvalidInput(String),             // Input validation failures
    GovernanceViolation(String),      // Rule enforcement failures
}
}

Pattern: Comprehensive error coverage with descriptive messages Integration: Converts to WasmError for Holochain compatibility

Privacy and Access Control

Public Resource Information

  • Resource Specifications: Name, description, category, tags (discoverable)
  • Resource Status: Active status and basic availability (public)
  • Governance Rules: Rule types and basic requirements (transparent)

Private Resource Information

  • Resource Details: Specific locations, quantities, custodians (access-controlled)
  • Economic Events: Detailed transaction history (participant access)
  • Custody Transfers: Transfer details and participants (participant access)

Access Control Patterns

#![allow(unused)]
fn main() {
// Public resource discovery
get_all_economic_resources() -> Basic resource info

// Agent's own resources (full access)
get_my_economic_resources() -> Complete resource details

// Resource access by permission
get_economic_resource_profile(resource_hash) -> Requires custodian permission
}

Integration with Other Zomes

Cross-Zome Validation

#![allow(unused)]
fn main() {
// Validate agent has required capability level
let capability_level = call(
    CallTargetCell::Local,
    "zome_person",
    "get_person_capability_level".into(),
    None,
    &agent_pubkey,
)?;

if capability_level != "governance" && capability_level != "coordination" {
    return Err(ResourceError::GovernanceViolation("Insufficient capability".to_string()));
}
}

Economic Event Integration

#![allow(unused)]
fn main() {
// Create economic event for custody transfer
let event_output = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "log_economic_event".into(),
    None,
    &LogEconomicEventInput {
        action: VfAction::TransferCustody,
        provider: current_custodian,
        receiver: new_custodian,
        resource_inventoried_as: resource_hash,
        affects: resource_hash,
        resource_quantity: resource.quantity,
        note: transfer_note,
    },
)?;
}

Governance Rule Enforcement

#![allow(unused)]
fn main() {
// Check resource access against governance rules
let rules = get_governance_rules_by_type("access".to_string())?;
for rule in rules {
    if rule_applies_to_operation(&rule, &operation, &agent_roles) {
        enforce_rule(&rule)?;
    }
}
}

Implementation Status

Completed Features

  • Resource Specification Management: Complete CRUD operations with discovery
  • Economic Resource Lifecycle: Full resource creation, updates, and tracking
  • Custody Transfer System: Secure custody transfers with validation
  • Governance Rule Integration: Embedded rules for access control
  • State Management: Complete resource state transitions
  • Discovery System: Category and tag-based efficient resource discovery
  • Cross-Zome Integration: Role validation and economic event creation
  • Signal System: Real-time updates for UI reactivity
  • Versioning Support: Complete update history for specifications and resources

🔧 Current Limitations

  • No Economic Processes: Structured process workflows (Use, Transport, Storage, Repair) not implemented
  • Basic Resource Validation: Simple validation without multi-reviewer schemes
  • No Resource Dependencies: Resource relationships and dependencies not tracked
  • Limited Location Support: Basic location tracking without spatial features

📋 Future Enhancement Opportunities

  • Economic Process Integration: Implement structured process workflows
  • Advanced Validation: Multi-reviewer validation schemes (2-of-3, N-of-M)
  • Resource Relationships: Dependency tracking and resource bundling
  • Spatial Features: Location-based resource discovery and services
  • Resource Analytics: Usage statistics and availability optimization
  • Automated Governance: AI-assisted rule creation and enforcement

TODO (post-MVP — PropertyRegime-driven governance defaults, resources.md §6.6): Implement a GovernanceDefaultsEngine that derives default governance rule templates from PropertyRegime + ResourceNature classification. For example, a Nondominium physical resource gets default rules for custody rotation, maintenance obligations, and access-for-use; a Commons digital resource gets default rules for attribution and remix licensing. The defaults are suggestions populated into ResourceSpecification.governance_rules at creation time; custodians can override them. See resources.md §6.6.

The Resource zome provides the foundational resource management infrastructure for the nondominium ecosystem, enabling ValueFlows-compliant resource sharing with embedded governance and comprehensive lifecycle tracking.

Governance Zome (zome_gouvernance) Documentation

The Governance zome implements the core economic coordination and validation infrastructure for the nondominium ecosystem, providing ValueFlows-compliant economic event logging, commitment management, Private Participation Receipt (PPR) reputation system, and comprehensive agent validation workflows. It serves as the governance backbone enabling decentralized resource sharing with embedded accountability and cryptographically-secured reputation tracking.

Post-MVP (target architecture): unified transition evaluation is specified to optionally enforce Unyt economic closure (EconomicAgreement rules, rave_hash; documentation/requirements/ndo_prima_materia.md §6.6) and Flowsta identity checks (IdentityVerification, FlowstaIdentity; §6.7). See documentation/archives/governance.md §3.7, documentation/requirements/post-mvp/unyt-integration.md, and documentation/requirements/post-mvp/flowsta-integration.md. MVP coordinator paths (e.g. promotion validation) precede that consolidation.

Core Data Structures

VfAction Enum

#![allow(unused)]
fn main() {
pub enum VfAction {
    // Standard ValueFlows transfer actions
    Transfer,        // Transfer ownership/custody
    Move,           // Move a resource from one location to another

    // Standard ValueFlows production/consumption actions
    Use,            // Use a resource without consuming it
    Consume,        // Consume/destroy a resource
    Produce,        // Create/produce a new resource
    Work,           // Apply work/labor to a resource

    // Standard ValueFlows modification actions
    Modify,         // Modify an existing resource
    Combine,        // Combine multiple resources
    Separate,       // Separate one resource into multiple

    // Standard ValueFlows quantity adjustment actions
    Raise,          // Increase quantity/value of a resource
    Lower,          // Decrease quantity/value of a resource

    // Standard ValueFlows citation/reference actions
    Cite,           // Reference or cite a resource
    Accept,         // Accept delivery or responsibility

    // nondominium-specific actions
    InitialTransfer, // First transfer by a Simple Agent
    AccessForUse,    // Request access to use a resource
    TransferCustody, // Transfer custody (nondominium specific)
}
}

ValueFlows Compliance: Complete economic action vocabulary supporting all standard and nondominium-specific actions Type Safety: Replaces string-based actions with compile-time validation Helper Methods: Resource validation, quantity modification, custody change detection

VfAction Helper Methods

#![allow(unused)]
fn main() {
impl VfAction {
    pub fn requires_existing_resource(&self) -> bool;  // Resource validation
    pub fn creates_resource(&self) -> bool;            // New resource detection
    pub fn modifies_quantity(&self) -> bool;           // Quantity change detection
    pub fn changes_custody(&self) -> bool;             // Custody transfer detection
}
}

ValidationReceipt Entry

#![allow(unused)]
fn main() {
pub struct ValidationReceipt {
    pub validator: AgentPubKey,           // Agent providing validation
                                          // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
                                          // For collective/bot validators, the signing authority is the designated
                                          // operator key. The governance evaluation must resolve AgentContext →
                                          // effective AgentPubKey before capability token validation.
    pub validated_item: ActionHash,       // Item being validated (Resource, Event, etc.)
    pub validation_type: String,          // Type: "resource_approval", "agent_promotion", "role_validation"
    pub approved: bool,                   // Validation result
    pub notes: Option<String>,            // Optional validation notes
    pub validated_at: Timestamp,          // Validation timestamp
}
}

Governance: Core validation infrastructure for all governance workflows Audit Trail: Complete tracking of all community validations Flexibility: Supports multiple validation types with contextual notes

EconomicEvent Entry

#![allow(unused)]
fn main() {
pub struct EconomicEvent {
    pub action: VfAction,                 // Economic action performed
    pub provider: AgentPubKey,            // Agent providing the resource/service
                                          // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
    pub receiver: AgentPubKey,            // Agent receiving the resource/service
                                          // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
    pub resource_inventoried_as: ActionHash, // Link to the EconomicResource
    pub affects: ActionHash,              // Link to the affected EconomicResource
    pub resource_quantity: f64,           // Quantity involved in the event
    pub event_time: Timestamp,            // When the event occurred
    pub note: Option<String>,             // Optional event description
}
}

ValueFlows Compliance: Complete economic event specification Resource Tracking: Links to affected resources for audit trails Action Integration: Uses type-safe VfAction enum

Commitment Entry

#![allow(unused)]
fn main() {
pub struct Commitment {
    pub action: VfAction,                 // Economic action committed to
    pub provider: AgentPubKey,            // Provider of the commitment
                                          // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
    pub receiver: AgentPubKey,            // Receiver of the commitment
                                          // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
    pub resource_inventoried_as: Option<ActionHash>, // Specific resource if applicable
    pub resource_conforms_to: Option<ActionHash>,    // Resource specification if general
    pub input_of: Option<ActionHash>,     // Optional link to a Process
    pub due_date: Timestamp,              // Commitment due date
    pub note: Option<String>,             // Optional commitment description
    pub committed_at: Timestamp,          // When commitment was made
}
}

Planning: Economic planning and commitment tracking Flexibility: Supports both specific and general resource commitments Due Date Management: Time-bound commitments with expiry

Claim Entry

#![allow(unused)]
fn main() {
pub struct Claim {
    pub fulfills: ActionHash,             // References the Commitment
    pub fulfilled_by: ActionHash,         // References the resulting EconomicEvent
    pub claimed_at: Timestamp,            // When claim was made
    pub note: Option<String>,             // Optional claim description
}
}

Fulfillment Tracking: Links commitments to their actual execution Accountability: Creates audit trail of promise vs. delivery Performance Data: Basis for reputation calculation

ResourceValidation Entry

#![allow(unused)]
fn main() {
pub struct ResourceValidation {
    pub resource: ActionHash,             // Link to the EconomicResource being validated
    pub validation_scheme: String,        // e.g., "2-of-3", "simple_majority"
    pub required_validators: u32,         // Number of validators required
    pub current_validators: u32,          // Number of validators who have validated
    pub status: String,                   // "pending", "approved", "rejected"
    pub created_at: Timestamp,            // Validation creation time
    pub updated_at: Timestamp,            // Last update time
}
}

Multi-Reviewer Validation: Support for complex validation schemes Progress Tracking: Monitor validation progress in real-time Configurable Schemes: Flexible validation requirements

Private Participation Receipt (PPR) System

ParticipationClaimType Enum

#![allow(unused)]
fn main() {
pub enum ParticipationClaimType {
    // Genesis Role - Network Entry
    ResourceCreation,         // Creator receives this for successful resource contribution
    ResourceValidation,       // Validator receives this for network validation performed

    // Core Usage Role - Custodianship
    CustodyTransfer,         // Outgoing custodian receives this for responsible custody transfer
    CustodyAcceptance,       // Incoming custodian receives this for custody acceptance

    // Intermediate Roles - Specialized Services
    MaintenanceCommitmentAccepted, // Maintenance agent receives this for accepted commitment
    MaintenanceFulfillmentCompleted, // Maintenance agent receives this for completed fulfillment
    StorageCommitmentAccepted,     // Storage agent receives this for accepted commitment
    StorageFulfillmentCompleted,   // Storage agent receives this for completed fulfillment
    TransportCommitmentAccepted,   // Transport agent receives this for accepted commitment
    TransportFulfillmentCompleted, // Transport agent receives this for completed fulfillment
    GoodFaithTransfer,            // Custodian receives this for good faith transfer to service provider

    // Network Governance
    DisputeResolutionParticipation, // For constructive participation in conflict resolution
    ValidationActivity,            // For performing validation duties beyond specific transactions
    RuleCompliance,               // For consistent adherence to governance protocols

    // Resource End-of-Life Management
    EndOfLifeDeclaration,         // Declaring agent receives this for end-of-life declaration
    EndOfLifeValidation,          // Expert validator receives this for end-of-life validation

    // TODO (G6, REQ-GOV-15 — post-MVP): add new claim types for governance ceremonies:
    //   AffiliationRecordSigned,   // Issued when agent signs AffiliationRecord (ToP ceremony)
    //   GovernanceRoleGranted,     // Issued when collective agent is granted a governance role
    // These extend PPR tracking to cover formal governance participation beyond economic events.
}
}

Comprehensive Coverage: 16 claim types covering all economic interactions Role-Based Categories: Claims organized by agent roles and interaction types Reputation Foundation: Each claim type contributes to reputation calculation

PerformanceMetrics Structure

#![allow(unused)]
fn main() {
pub struct PerformanceMetrics {
    pub timeliness: f64,              // Punctuality score (0.0 to 1.0)
    pub quality: f64,                 // Task quality score (0.0 to 1.0)
    pub reliability: f64,             // Commitment fulfillment reliability (0.0 to 1.0)
    pub communication: f64,           // Communication effectiveness (0.0 to 1.0)
    pub overall_satisfaction: f64,    // Counterparty satisfaction (0.0 to 1.0)
    pub notes: Option<String>,        // Optional contextual notes
}
}

Quantitative Assessment: Numerical scores for objective reputation calculation Weighted Average: Customizable weights for different aspects of performance Validation: All scores must be within valid range (0.0 to 1.0)

CryptographicSignature Structure

#![allow(unused)]
fn main() {
pub struct CryptographicSignature {
    pub recipient_signature: Signature,     // Signature from PPR owner
    pub counterparty_signature: Signature,   // Signature from counterparty
    pub signed_data_hash: [u8; 32],        // Hash of signed data for verification
    pub signed_at: Timestamp,              // When signatures were created
}
}

Bilateral Authentication: Both parties sign to acknowledge the interaction Cryptographic Security: Tamper-evident signatures for reputation integrity Verification Support: Complete context for signature verification

PrivateParticipationClaim Entry

#![allow(unused)]
fn main() {
pub struct PrivateParticipationClaim {
    // Standard ValueFlows fields
    pub fulfills: ActionHash,           // References the commitment fulfilled
    pub fulfilled_by: ActionHash,       // References the economic event
    pub claimed_at: Timestamp,

    // PPR-specific extensions
    pub claim_type: ParticipationClaimType,
    pub performance_metrics: PerformanceMetrics,
    pub bilateral_signature: CryptographicSignature,

    // Additional context
    pub counterparty: AgentPubKey,      // The other agent involved in the interaction
                                        // TODO (G1, REQ-GOV-16): replace AgentPubKey with AgentContext post-MVP.
                                        // Bot agents generate PPRs with their operator's AgentPubKey as the
                                        // accountable counterparty.
    pub resource_hash: Option<ActionHash>, // Optional link to the resource involved
    pub notes: Option<String>,          // Optional contextual notes
}
}

Privacy: Stored as private entry, accessible only to the claim owner Complete Context: Links commitment, event, performance, and cryptographic proof Reputation Data: Foundation for trust and reputation calculation

ReputationSummary Structure

#![allow(unused)]
fn main() {
pub struct ReputationSummary {
    pub total_claims: u32,              // Total number of participation claims
    pub average_performance: f64,       // Average performance score across all claims
    pub creation_claims: u32,           // Resource creation and validation claims
    pub custody_claims: u32,            // Custody-related claims
    pub service_claims: u32,            // Service provision claims
    pub governance_claims: u32,          // Governance participation claims
    pub end_of_life_claims: u32,        // End-of-life management claims
    pub period_start: Timestamp,        // Time period this summary covers
    pub period_end: Timestamp,          // End of time period
    pub agent: AgentPubKey,             // Agent this summary belongs to
    pub generated_at: Timestamp,        // When summary was generated
}
}

Privacy-Preserving: Share reputation without revealing individual claims Category Breakdown: Reputation scores by interaction type Time-Period Based: Configurable time windows for reputation calculation

API Functions

Economic Event Management

log_economic_event(input: LogEconomicEventInput) -> ExternResult<LogEconomicEventOutput>

Logs an economic event to the distributed ledger.

Input:

#![allow(unused)]
fn main() {
pub struct LogEconomicEventInput {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_inventoried_as: ActionHash,
    pub affects: ActionHash,
    pub resource_quantity: f64,
    pub note: Option<String>,
}
}

Business Logic:

  • Validates action compatibility with resource state
  • Creates economic event with timestamp
  • Links to affected resource for audit trail
  • Triggers PPR generation if applicable

Integration: Automatically generates appropriate PPR claims Validation: Cross-zome validation with resource and person zomes

log_initial_transfer(input: LogInitialTransferInput) -> ExternResult<LogEconomicEventOutput>

Special function for Simple Agent's first resource transfer.

Business Logic: Handles special case for agent progression Validation: Validates this is the agent's first transfer Integration: May trigger Simple Agent promotion workflow

get_all_economic_events() -> ExternResult<Vec<EconomicEvent>>

Retrieves all economic events (with appropriate access control).

Privacy: Filters events based on participant access rights Performance: Efficient query via economic event anchors

get_events_for_resource(resource_hash: ActionHash) -> ExternResult<Vec<EconomicEvent>>

Gets all economic events affecting a specific resource.

Pattern: Follows resource-to-events link chain Use Case: Complete resource lifecycle and history

get_events_for_agent(agent: AgentPubKey) -> ExternResult<Vec<EconomicEvent>>

Gets all economic events involving a specific agent.

Pattern: Queries agent participation in economic activities Use Case: Agent's economic activity history

Commitment Management

propose_commitment(input: ProposeCommitmentInput) -> ExternResult<ProposeCommitmentOutput>

Creates a new economic commitment.

Input:

#![allow(unused)]
fn main() {
pub struct ProposeCommitmentInput {
    pub action: VfAction,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub resource_conforms_to: Option<ActionHash>,
    pub input_of: Option<ActionHash>,
    pub due_date: Timestamp,
    pub note: Option<String>,
}
}

Business Logic:

  • Validates commitment feasibility
  • Creates commitment with automatic expiration
  • Links to resource specification if applicable
  • Sets up claim fulfillment tracking

Integration: Creates framework for PPR generation upon fulfillment

get_all_commitments() -> ExternResult<Vec<Commitment>>

Retrieves all commitments (with appropriate access control).

Privacy: Filters commitments based on participant access rights

get_commitments_for_agent(agent: AgentPubKey) -> ExternResult<Vec<Commitment>>

Gets all commitments involving a specific agent.

Pattern: Queries agent as provider or receiver Use Case: Agent's commitment portfolio and obligations

claim_commitment(input: ClaimCommitmentInput) -> ExternResult<ClaimCommitmentOutput>

Claims fulfillment of a commitment, creating the link to an economic event.

Business Logic:

  • Validates economic event fulfills commitment requirements
  • Creates claim linking commitment to event
  • Triggers PPR generation for both parties
  • Updates reputation metrics

Integration: Core mechanism for PPR generation

get_all_claims() -> ExternResult<Vec<Claim>>

Retrieves all claims (with appropriate access control).

get_claims_for_commitment(commitment_hash: ActionHash) -> ExternResult<Vec<Claim>>

Gets all claims for a specific commitment.

Pattern: Track commitment fulfillment history Use Case: Commitment performance analysis

Validation System

create_validation_receipt(input: CreateValidationReceiptInput) -> ExternResult<Record>

Creates a validation receipt for any validated item.

Input:

#![allow(unused)]
fn main() {
pub struct CreateValidationReceiptInput {
    pub validated_item: ActionHash,
    pub validation_type: String,
    pub approved: bool,
    pub notes: Option<String>,
}
}

Business Logic:

  • Records validator's assessment
  • Links to validated item for audit trail
  • Creates validation history
  • May trigger PPR generation for validation activity

get_validation_history(item_hash: ActionHash) -> ExternResult<Vec<ValidationReceipt>>

Gets complete validation history for an item.

Pattern: Follows validated_item_to_receipt links Use Case: Comprehensive validation audit trail

get_all_validation_receipts() -> ExternResult<Vec<ValidationReceipt>>

Retrieves all validation receipts (with appropriate access control).

create_resource_validation(input: CreateResourceValidationInput) -> ExternResult<Record>

Creates a resource validation workflow.

Input:

#![allow(unused)]
fn main() {
pub struct CreateResourceValidationInput {
    pub resource: ActionHash,
    pub validation_scheme: String,        // "2-of-3", "simple_majority", etc.
    pub required_validators: u32,
}
}

Business Logic:

  • Creates validation workflow with specified scheme
  • Tracks validation progress
  • Manages validator assignments
  • Determines final validation outcome

check_validation_status(validation_hash: ActionHash) -> ExternResult<String>

Checks the current status of a validation workflow.

Returns: "pending" | "approved" | "rejected" Use Case: Monitor validation progress

validate_new_resource(input: ValidateNewResourceInput) -> ExternResult<ValidationResult>

Validates a new resource according to community standards.

Cross-Zome Integration: Works with resource zome for validation Validation Logic: Applies governance rules and community standards Outcome: May approve resource or require further validation

Agent Validation and Promotion

validate_agent_identity(input: ValidateAgentIdentityInput) -> ExternResult<ValidationResult>

Validates agent identity and private information for promotion.

Input:

#![allow(unused)]
fn main() {
pub struct ValidateAgentIdentityInput {
    pub agent: AgentPubKey,
    pub resource_hash: ActionHash,
    pub private_data_hash: Option<ActionHash>,
}
}

Business Logic:

  • Cross-zome call to person zome for private data access
  • Validates agent meets promotion requirements
  • Creates validation receipt for audit trail
  • May trigger agent promotion workflow

Privacy: Respects private data access controls

validate_agent_for_promotion(input: ValidateAgentForPromotionInput) -> ExternResult<ValidationResult>

Comprehensive validation for agent promotion to higher capability levels.

Validation Logic:

  • Checks resource creation requirements
  • Validates community participation
  • Evaluates PPR-based reputation
  • Assesses governance understanding

validate_agent_for_custodianship(input: ValidateAgentForCustodianshipInput) -> ExternResult<ValidationResult>

Validates agent suitability for resource custodianship.

Validation Logic:

  • Capability level validation
  • PPR reputation assessment
  • Custody history review
  • Community standing evaluation

validate_specialized_role(input: ValidateSpecializedRoleInput) -> ExternResult<ValidationResult>

Validates agent for specialized roles (Transport, Repair, Storage).

Role-Specific Validation:

  • Technical capability assessment
  • Equipment/facility requirements
  • Safety and compliance validation
  • Performance history review

Private Participation Receipt (PPR) System

issue_participation_receipts(input: IssueParticipationReceiptsInput) -> ExternResult<IssueParticipationReceiptsOutput>

Issues PPRs to both parties involved in an economic interaction.

Input:

#![allow(unused)]
fn main() {
pub struct IssueParticipationReceiptsInput {
    pub fulfills: ActionHash,
    pub fulfilled_by: ActionHash,
    pub provider: AgentPubKey,
    pub receiver: AgentPubKey,
    pub claim_types: Vec<ParticipationClaimType>,
    pub provider_metrics: PerformanceMetrics,
    pub receiver_metrics: PerformanceMetrics,
    pub resource_hash: Option<ActionHash>,
    pub notes: Option<String>,
}
}

Business Logic:

  • Creates private PPR entries for both parties
  • Generates bilateral cryptographic signatures
  • Links to commitment and economic event
  • Stores performance metrics for reputation calculation

Privacy: Private entries accessible only to respective owners Security: Cryptographic signatures prevent tampering

sign_participation_claim(input: SignParticipationClaimInput) -> ExternResult<SignParticipationClaimOutput>

Signs a participation claim with bilateral authentication.

Cryptography: Creates cryptographic signatures for both parties Verification: Supports signature verification for authenticity Integration: Used in PPR creation and validation workflows

validate_participation_claim_signature(input: ValidateParticipationClaimSignatureInput) -> ExternResult<bool>

Validates the cryptographic signatures on a participation claim.

Security: Ensures claim authenticity and integrity Verification: Supports cross-agent claim verification

validate_participation_claim_signature_enhanced(input: ValidateParticipationClaimSignatureInput) -> ExternResult<EnhancedValidationResult>

Enhanced signature validation with detailed verification results.

Additional Features:

  • Signature timestamp validation
  • Agent verification status
  • Claim context validation
  • Detailed security assessment

get_my_participation_claims(filter: Option<PPRFilter>) -> ExternResult<Vec<PrivateParticipationClaim>>

Retrieves the calling agent's participation claims.

Privacy: Only returns claims owned by the calling agent Filtering: Optional filtering by claim type, time period, counterparty Use Case: Agent's reputation portfolio and history

derive_reputation_summary(input: DeriveReputationSummaryInput) -> ExternResult<ReputationSummary>

Derives a privacy-preserving reputation summary from participation claims.

Input:

#![allow(unused)]
fn main() {
pub struct DeriveReputationSummaryInput {
    pub period_start: Timestamp,
    pub period_end: Timestamp,
    pub include_categories: Option<Vec<String>>, // Optional category filtering
}
}

Business Logic:

  • Calculates weighted average performance scores
  • Categorizes claims by type
  • Generates privacy-preserving summary
  • Supports time-period based analysis

Privacy: Can be shared without revealing individual claim details

Private Data Validation

request_agent_validation_data(input: AgentValidationInput) -> ExternResult<ValidationResult>

Requests private data validation for agent validation workflows.

Input:

#![allow(unused)]
fn main() {
pub struct AgentValidationInput {
    pub agent_to_validate: AgentPubKey,
    pub validation_type: String,
    pub requesting_validator: AgentPubKey,
    pub validation_context: ActionHash,
}
}

Business Logic:

  • Cross-zome call to person zome for private data access
  • Validates specific data requirements based on validation type
  • Creates validation receipt for audit trail
  • Respects privacy and consent requirements

create_validation_with_private_data(input: CreateValidationWithPrivateDataInput) -> ExternResult<Record>

Creates validation with explicit private data access.

Privacy: Requires explicit consent for private data access Security: Creates audit trail of private data access Compliance: Ensures privacy requirements are met

NDO Federation Extensions

Added in PR #103. These three coordinator modules implement the NDO-to-NDO hard links, peer-validated contributions, and benefit redistribution agreements specified in documentation/requirements/post-mvp/lobby-dna.md (REQ-NDO-EXT-01–16).

create_ndo_hard_link(input: CreateNdoHardLinkInput) -> ExternResult<ActionHash>

Creates a permanent, immutable OVN-licensed structural link between two NDOs. The link is backed by a real EconomicEvent (its hash is stored and verified at creation time).

Input:

#![allow(unused)]
fn main() {
pub struct CreateNdoHardLinkInput {
    pub from_ndo_identity_hash: ActionHash,
    pub to_ndo_dna_hash: DnaHash,
    pub to_ndo_identity_hash: ActionHash,
    pub link_type: NdoLinkType, // Component | DerivedFrom | Supersedes
    pub fulfillment_hash: ActionHash, // must resolve to a record in this DHT
}
}

Business Logic:

  • Verifies fulfillment_hash resolves to an existing record
  • Creates a NdoHardLink entry (immutable, undeletable per OVN license requirement)
  • Creates NdoToHardLinks anchor from from_ndo_identity_hash for global discovery
  • Creates HardLinkByType anchor from Path("ndo.hardlink.{type}") for filtered queries

get_ndo_hard_links(ndo_identity_hash: ActionHash) -> ExternResult<Vec<NdoHardLinkRecord>>

Returns all hard links originating from a given NDO identity hash. Resolves the latest update of each entry before returning.

Returns hard links filtered by NdoLinkType. Calls get_ndo_hard_links internally and filters client-side.

Input:

#![allow(unused)]
fn main() {
pub struct GetNdoHardLinksByTypeInput {
    pub ndo_identity_hash: ActionHash,
    pub link_type: NdoLinkType,
}
}

Contributions (contribution.rs)

validate_contribution(input: ValidateContributionInput) -> ExternResult<ActionHash>

Records and peer-validates a work contribution on an NDO. The calling agent is recorded as the first validator in validated_by. The action field is constrained to Work | Modify | Cite by integrity validation.

Input:

#![allow(unused)]
fn main() {
pub struct ValidateContributionInput {
    pub provider: AgentPubKey,
    pub action: VfAction,               // Must be Work, Modify, or Cite
    pub work_log_group_dna_hash: Option<DnaHash>,
    pub work_log_action_hash: Option<ActionHash>,
    pub ndo_identity_hash: ActionHash,
    pub input_of: Option<ActionHash>,
    pub note: String,
    pub effort_quantity: Option<f64>,   // hours [0.0, 10000.0]
    pub fulfills: Option<ActionHash>,
    pub has_point_in_time: Timestamp,
}
}

Business Logic:

  • Creates a Contribution entry with the calling agent as validated_by[0]
  • Creates NdoToContributions anchor from ndo_identity_hash
  • Creates AgentToContributions anchor from input.provider (not the validator)

get_ndo_contributions(ndo_identity_hash: ActionHash) -> ExternResult<Vec<ContributionRecord>>

Returns all contributions for a given NDO identity hash via the NdoToContributions anchor.

get_agent_contributions(provider: AgentPubKey) -> ExternResult<Vec<ContributionRecord>>

Returns all contributions from a given agent (provider) via the AgentToContributions anchor.


Agreements (agreement.rs)

create_agreement(input: CreateAgreementInput) -> ExternResult<ActionHash>

Creates the first benefit redistribution Agreement (version 1) for an NDO. Agreements are versioned (monotonic), undeletable, and linked to the NDO identity hash.

Input:

#![allow(unused)]
fn main() {
pub struct CreateAgreementInput {
    pub ndo_identity_hash: ActionHash,
    pub clauses: Vec<BenefitClause>,
    pub primary_accountable: Vec<AgentPubKey>,
}
}

Integrity validation:

  • primary_accountable must be non-empty
  • Each clause.share_percent must be in [0.0, 100.0]
  • Sum of all share_percent values must not exceed 100.0

update_agreement(input: UpdateAgreementInput) -> ExternResult<ActionHash>

Updates an existing Agreement, incrementing its version monotonically. Creates an AgreementUpdates chain link from the previous hash to the new one.

Input:

#![allow(unused)]
fn main() {
pub struct UpdateAgreementInput {
    pub original_action_hash: ActionHash,
    pub clauses: Vec<BenefitClause>,
    pub primary_accountable: Vec<AgentPubKey>,
}
}

Integrity validation: version must equal previous.version + 1 (enforced by HDI).

get_current_agreement(ndo_identity_hash: ActionHash) -> ExternResult<Option<AgreementRecord>>

Returns the latest version of the Agreement for a given NDO by walking the AgreementUpdates chain from the NdoToAgreement anchor.


  • AllEconomicEvents: economic_events anchor -> event_hash - Global discovery
  • ResourceToEvents: resource_hash -> event_hash - Resource history
  • AgentToEvents: agent_pubkey -> event_hash - Agent participation
  • EventToPrivateParticipationClaims: event_hash -> claim_hash - PPR generation
  • AllCommitments: commitments anchor -> commitment_hash - Global discovery
  • CommitmentToClaims: commitment_hash -> claim_hash - Fulfillment tracking
  • CommitmentToPrivateParticipationClaims: commitment_hash -> claim_hash - PPR tracking
  • AllValidationReceipts: validation_receipts anchor -> receipt_hash - Global discovery
  • ValidatedItemToReceipt: validated_item -> receipt_hash - Validation history
  • ResourceToValidation: resource_hash -> validation_hash - Resource validation
  • AllResourceValidations: resource_validations anchor -> validation_hash - Validation discovery
  • AgentToPrivateParticipationClaims: agent_pubkey -> claim_hash - Agent PPR portfolio
  • EventToPrivateParticipationClaims: event_hash -> claim_hash - Event to PPR mapping
  • CommitmentToPrivateParticipationClaims: commitment_hash -> claim_hash - Commitment to PPR mapping
  • ResourceToPrivateParticipationClaims: resource_hash -> claim_hash - Resource to PPR mapping

Signal Architecture

The Governance zome emits signals for real-time UI updates:

#![allow(unused)]
fn main() {
pub enum Signal {
    LinkCreated { action },
    LinkDeleted { action },
    EntryCreated { action },
    EntryUpdated { action },
    EntryDeleted { action },
}
}

Real-time Updates: Enables UI reactivity to governance changes Cross-Zome Coordination: Supports complex workflows with other zomes

Error Handling

GovernanceError Types

GovernanceError is defined in crates/utils/src/errors.rs and imported by zome_gouvernance.

#![allow(unused)]
fn main() {
pub enum GovernanceError {
    ValidationReceiptNotFound(String),     // Validation lookup failures
    EconomicEventNotFound(String),       // Event lookup failures
    ResourceValidationNotFound(String),  // Resource validation lookup failures
    CommitmentNotFound(String),          // Commitment lookup failures
    NotAuthorizedValidator,              // Authorization failures
    InsufficientCapability(String),      // Capability level restrictions
    ValidationAlreadyExists(String),     // Duplicate validation prevention
    InvalidValidationScheme(String),     // Validation scheme validation
    SerializationError(String),          // Data serialization issues
    EntryOperationFailed(String),       // DHT operation failures
    LinkOperationFailed(String),        // Link operation failures
    InvalidInput(String),               // Input validation failures
    CrossZomeCallFailed(String),        // Cross-zome communication failures
}
}

Pattern: Comprehensive error coverage with descriptive messages Integration: Converts to WasmError for Holochain compatibility

Privacy and Security Model

Private Data Protection

  • Private Participation Claims: Stored as private entries, owner-only access
  • Performance Metrics: Only accessible to claim owner
  • Signature Verification: Cryptographic proof without revealing private data
  • Reputation Summaries: Privacy-preserving reputation sharing

Cryptographic Security

  • Bilateral Signatures: Both parties authenticate each interaction
  • Tamper Evidence: Cryptographic hashes prevent undetected modifications
  • Non-Repudiation: Agents cannot deny their participation in interactions
  • Verification Support: Complete context for signature verification

Access Control

  • Role-Based Access: Different functions require different capability levels
  • Cross-Zome Validation: Private data access requires explicit validation
  • Context-Aware Permissions: Access granted based on specific contexts and needs
  • Audit Trails: Complete logging of all validation and access requests

Integration with Other Zomes

Resource Zome Integration

#![allow(unused)]
fn main() {
// Create economic event for resource custody transfer
let event_output = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "log_economic_event".into(),
    None,
    &LogEconomicEventInput {
        action: VfAction::TransferCustody,
        provider: current_custodian,
        receiver: new_custodian,
        resource_inventoried_as: resource_hash,
        affects: resource_hash,
        resource_quantity: 1.0,
        note: Some("Custody transfer completed".to_string()),
    },
)?;
}

Person Zome Integration

#![allow(unused)]
fn main() {
// Validate agent private data for promotion
let validation_result = call(
    CallTargetCell::Local,
    "zome_gouvernance",
    "validate_agent_identity".into(),
    None,
    &ValidateAgentIdentityInput {
        agent: agent_to_validate,
        resource_hash: first_resource_hash,
        private_data_hash: Some(private_data_hash),
    },
)?;
}

Implementation Status

Completed Features

  • Economic Event Logging: Complete ValueFlows-compliant economic event system
  • Commitment Management: Full commitment lifecycle with claim tracking
  • Validation System: Comprehensive validation workflows with receipt tracking
  • PPR System: Complete Private Participation Receipt system with 16 claim types
  • Reputation Management: Privacy-preserving reputation calculation and sharing
  • Agent Validation: Comprehensive agent promotion and capability validation
  • Cryptographic Security: Bilateral signatures and tamper-evident claims
  • Private Data Protection: Secure private data validation workflows
  • Cross-Zome Integration: Full integration with person and resource zomes

🔧 Current Limitations

  • Basic Validation Schemes: Limited to simple approval, no complex multi-reviewer schemes
  • No Economic Processes: Structured process workflows not implemented
  • Limited Governance Rules: Basic rule enforcement without complex logic
  • No Dispute Resolution: Structured dispute resolution workflows not implemented

📋 Future Enhancement Opportunities

  • Advanced Validation Schemes: Implementation of 2-of-3, N-of-M, weighted voting
  • Economic Process Integration: Structured workflows for Use, Transport, Storage, Repair
  • Dispute Resolution System: Formal dispute resolution with mediator selection
  • Smart Contract Integration: Automated rule enforcement and trigger conditions
  • Reputation Analytics: Advanced reputation analysis and prediction
  • Multi-Network Reputation: Cross-network reputation portability and validation

TODO (post-MVP — configurable GovernanceProcess, governance.md §6.2): Economic Process types (Use, Transport, Storage, Repair) are currently hardcoded strings. Post-MVP, introduce a GovernanceProcess entry type so communities can define custom process types with their own role requirements, validation schemes, and operational state transitions. The current four process types become default instances, not compile-time constants.

TODO (post-MVP — temporal governance, governance.md §4.8): Extend GovernanceRule with an optional expires_at: Timestamp field. The governance evaluation engine must skip expired rules during evaluate_transition. Enables sunset clauses, seasonal access, and time-limited governance experiments.

TODO (post-MVP — governance weight dampening, governance.md §6.4): When governance_weight(agent) incorporates unyt_credit_capacity, apply logarithmic dampening (e.g., log(1 + credit_capacity)) to prevent a feedback loop where high reputation → high credit → higher governance weight → even higher reputation.

The Governance zome provides the foundational economic coordination infrastructure for the nondominium ecosystem, enabling ValueFlows-compliant resource sharing with comprehensive validation, cryptographically-secured reputation tracking, and sophisticated governance workflows.


Post-MVP Governance Architecture Gaps

The following TODOs summarise all governance-related post-MVP structural changes identified across governance.md, agent.md, and the requirements suite. Use these as the canonical cross-reference index when implementing each phase.

Gap IDDescriptionAffected Field(s)Requirement(s)governance.md ref
G1Collective/Bot agent governanceValidationReceipt.validator, EconomicEvent.provider/receiver, Commitment.provider/receiver, PrivateParticipationClaim.counterparty, GovernanceTransitionRequest.requesting_agent, ResourceStateChange.initiated_byREQ-GOV-16§3.6.1, §6.6
G2AffiliationState governance gateGovernanceRule.rule_data["min_affiliation"]; governance evaluate_transitionREQ-GOV-14§3.6.2, §6.4
G6AffiliationRecord ceremonyNew create_affiliation_record() + AffiliationRecordSigned PPR claim typeREQ-GOV-15§3.6.3, §4.4
G9Sybil resistance for governanceRole promotion: N-of-M vouching or proof-of-personhoodREQ-GOV-17§5.3
G10Pseudonymous governance participationPseudonymous path to ActiveAffiliate; block from legal-accountability rolesREQ-GOV-18§5.3
G11Bot governance scopeBot participation limited to declared capabilities; operator is accountable§6.6

All fields marked with TODO (G1, REQ-GOV-16) inline above must be migrated to AgentContext in Phase 3 of the implementation plan. See implementation_plan.md §Phase 3 — Governance Agent Ontology Integration for detailed checklists.

hREA Documentation

This folder contains documentation related to hREA, the Holochain implementation of the ValueFlows economic vocabulary. It covers Nondominium's integration strategy, the long-term maintainership roadmap, and a field-level compliance audit of hREA against the ValueFlows 1.0 ontology.

Documents

DocumentDescription
Integration StrategyHow Nondominium integrates hREA as its ValueFlows backend engine: architecture, cross-DNA call patterns, migration plan
Strategic RoadmapPhase 1+2 maintainership proposal: VF 1.0 gap closure, stub validation implementation, JSON-LD interoperability API
ValueFlows 1.0 Compliance AnalysisField-by-field audit of hREA main-0.6 against VF 1.0 (~65% compliance), with P0/P1/P2 gap prioritization

Context

hREA serves as Nondominium's economic primitive layer. Nondominium's three zomes (person, resource, governance) delegate core ValueFlows types (EconomicResource, EconomicEvent, Agent, Commitment) to hREA via cross-DNA calls, keeping Nondominium focused on its specialized concerns: governance, privacy, and the PPR reputation system.

NDO v1.0's full capabilities depend on hREA reaching the compliance targets described in the strategic roadmap. The P0 gaps (vf:Claim, effortQuantity) in hREA must land before Nondominium's work-event recording and claim-based reciprocity workflows are available.

hREA Integration Strategy for Nondominium

Executive Summary

This document outlines the comprehensive integration strategy for incorporating hREA (Holochain Resource-Event-Agent) into Nondominium's architecture. The approach positions hREA as a backend economic engine while maintaining Nondominium's specialized focus on governance, privacy, and the Private Participation Receipt (PPR) system.

Key Decision: Use git submodule + cross-DNA calls via the Holochain HDK call() function to integrate hREA directly at the Rust/zome level. This bypasses hREA's GraphQL API entirely; integration happens in the backend, not the UI.

hREA Repository: https://github.com/h-REA/hREA (branch: main-0.6) Architecture: Single DNA (hrea) with separate coordinator + integrity zomes


Architecture Vision

Strategic Positioning

┌─────────────────────────────────────────────────────────────┐
│                    TrueCommon - Peer Production             │
│  (Broader application using Nondominium as core engine)     │
└─────────────────────┬───────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────┐
│                  Nondominium - Peer Sharing                 │
│                (Specialized Engine - 3 Zomes)               │
│  ┌─────────────────┬─────────────────┬─────────────────┐    │
│  │   Person        │    Resource     │   Governance    │    │
│  │  (Encrypted     │  (Delegates to  │  (PPR, Rules,   │    │
│  │   Profile +     │   hREA for core │  Validation —   │    │
│  │   ReaAgent)     │   VF types)     │   all custom)   │    │
│  └─────────────────┴─────────────────┴─────────────────┘    │
│          Cross-DNA calls via CallTargetCell::OtherRole      │
└─────────────────────┬───────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────┐
│                     hREA DNA                                │
│        (Standard ValueFlows Implementation)                 │
│  ┌───────────┬──────────────┬───────────────┬────────────┐  │
│  │ ReaAgent  │ EcoResource  │ ReaCommitment │  ReaEco    │  │
│  │           │ (rich model) │ (full VF)     │  Event     │  │
│  └───────────┴──────────────┴───────────────┴────────────┘  │
│  ┌───────────┬──────────────┬───────────────┬────────────┐  │
│  │ ReaProcess│ ResourceSpec │  ReaAgreement │  ReaIntent │  │
│  │           │              │               │            │  │
│  └───────────┴──────────────┴───────────────┴────────────┘  │
└─────────────────────────────────────────────────────────────┘

Why Zome-Level Integration (Not GraphQL)

hREA exposes a GraphQL API intended for UI consumption. For Nondominium, integration must happen at the Rust/HDK layer because:

  1. Business logic integrity: Governance rules and PPR generation must fire atomically with economic events; this cannot be guaranteed through a UI-level API roundtrip
  2. Capability security: Cross-zome calls within the same conductor maintain Holochain's capability-based access model; GraphQL calls would bypass this
  3. Performance: Same-conductor bridge calls (~5-10ms) vs network roundtrips (~100-500ms)
  4. Atomicity: Creating a Commitment + generating a PPR claim must happen in the same zome call context

Gap Analysis: Current Nondominium vs hREA

Entity Comparison

EconomicResource

FieldNondominium (current)hREA ReaEconomicResource
quantityf64 (single field)accounting_quantity: Option<QuantityValue> + onhand_quantity: Option<QuantityValue> (two separate quantities)
unitStringunit_of_effort: Option<ActionHash> (Unit is a first-class entry)
custodianAgentPubKey (direct)primary_accountable: Option<ActionHash> (links to ReaAgent entry)
locationOption<String>current_location: Option<String> (same)
stateResourceState enumstate: Option<String> (string-based)
spec linkvia SpecificationToResource linkconforms_to: Option<ActionHash> (embedded)
missingcontained_in: Option<ActionHash> (nested resources)
missingstage: Option<ActionHash> (lifecycle stage entry)
missinglot: Option<String> (batch tracking)
missingname: Option<String>
missingimage: Option<String>
missingtracking_identifier: Option<String>

Key gap: Nondominium's EconomicResource uses a single quantity: f64 and a String unit. hREA uses QuantityValue { has_numerical_value: f64, has_unit: ActionHash } and tracks both accounting quantity (committed) and on-hand quantity (physically available) separately. This distinction is fundamental to ValueFlows and currently missing.

Also critical: hREA automatically updates onhand_quantity and accounting_quantity when an economic event is created, based on the action type's ActionEffect. Nondominium has no equivalent automatic quantity update system.


EconomicEvent

FieldNondominium (current)hREA ReaEconomicEvent
actionVfAction (custom Rust enum)rea_action: String (standard VF string + vf_actions crate)
providerAgentPubKey (direct)provider: Option<ActionHash> (links to ReaAgent)
receiverAgentPubKey (direct)receiver: Option<ActionHash> (links to ReaAgent)
resourceresource_inventoried_as: ActionHashresource_inventoried_as: Option<ActionHash>
affectsaffects: ActionHash (duplicate?)to_resource_inventoried_as: Option<ActionHash> (destination resource)
quantityresource_quantity: f64resource_quantity: Option<QuantityValue>
timeevent_time: Timestamphas_point_in_time: Option<Timestamp> + has_beginning + has_end
missinginput_of: Option<ActionHash> (Process)
missingoutput_of: Option<ActionHash> (Process)
missingfulfills: Option<Vec<ActionHash>> (Commitment links)
missingsatisfies: Option<Vec<ActionHash>> (Intent links)
missingrealization_of: Option<ActionHash> (Agreement)
missingtriggered_by: Option<ActionHash> (triggering Event)
missingcorrects: Option<ActionHash> (correction chain)

Key gap: The Nondominium EconomicEvent has a field called affects which appears to duplicate resource_inventoried_as. hREA's to_resource_inventoried_as is the correct field for the destination resource in a transfer (a different concept). More critically, the entire fulfills relationship (Event fulfills Commitment) is absent from Nondominium's model.


Commitment

FieldNondominium (current)hREA ReaCommitment
actionVfAction enumrea_action: Option<String>
providerAgentPubKeyprovider: Option<ActionHash> (ReaAgent)
receiverAgentPubKeyreceiver: Option<ActionHash> (ReaAgent)
resourceresource_inventoried_as: Option<ActionHash>same field name
specresource_conforms_to: Option<ActionHash>resource_conforms_to: Option<ActionHash> (same)
processinput_of: Option<ActionHash> (stub, always None)input_of: Option<ActionHash> + output_of: Option<ActionHash>
due datedue_date: Timestampdue: Option<Timestamp>
missingeffort_quantity: Option<QuantityValue>
missingresource_quantity: Option<QuantityValue>
missinghas_beginning / has_end / has_point_in_time
missingclause_of: Option<ActionHash> (Agreement)
missingplanned_within: Option<ActionHash> (Plan)
missingsatisfies: Option<ActionHash> (Intent)
missingfinished: Option<bool>

ResourceSpecification

FieldNondominium (current)hREA ReaResourceSpecification
nameStringString (same, required)
descriptionString(missing — hREA is simpler here)
categoryString(missing — Nondominium extension)
image_urlOption<String>image: Option<String>
tagsVec<String>(missing — Nondominium extension)
is_activebool(missing — Nondominium extension)
missingdefault_unit_of_effort: Option<ActionHash>
missingdefault_unit_of_resource: Option<ActionHash>

Note: For ResourceSpecification, Nondominium has more fields than hREA (category, tags, description, is_active). This is a case where the hybrid approach makes sense.


VfAction vs hREA Actions

Nondominium defines a custom Rust enum:

#![allow(unused)]
fn main() {
pub enum VfAction { Transfer, Move, Use, Consume, Produce, Work, Modify, Combine,
                    Separate, Raise, Lower, Cite, Accept, InitialTransfer,
                    AccessForUse, TransferCustody }
}

hREA uses rea_action: String with standardized ValueFlows action names:

  • "transfer", "move", "use", "consume", "produce", "work", "modify", "combine", "separate", "raise", "lower", "cite", "accept", "dropAll", "pickup"

hREA's vf_actions crate maps action strings to ActionEffect variants that control how resource quantities change on event creation. Nondominium's custom enum lacks this system.


Concepts Entirely Missing from Nondominium

hREA TypePurposePriority
ReaProcessGroups events/commitments into production flowsMedium (Phase 3)
ReaAgreementMulti-party coordination frameworkLow (Phase 4)
ReaProposal / ReaIntentWhat agents want to do / offerLow (Phase 4)
ReaPlanPlanned value flowsLow (Phase 4)
ReaFulfillmentExplicit Event-fulfills-Commitment linkHigh (Phase 2)
QuantityValue structTyped quantity with unit referenceHigh (Phase 2)
Unit entriesFirst-class unit of measureHigh (Phase 2)
Auto quantity updateResource quantities auto-update on eventHigh (Phase 2)

Nondominium Types With No hREA Equivalent (Keep Custom)

These are Nondominium's unique innovations and must remain fully custom:

TypeReason
PrivateParticipationClaim (PPR)Core Nondominium innovation; no VF equivalent
GovernanceRuleGovernance-as-operator pattern; Nondominium-specific
ResourceValidationCommunity validation flow; Nondominium-specific
ValidationReceiptValidator attestation; Nondominium-specific
EncryptedProfilePrivate PII layer; hREA has no privacy model
Role-based access controlCapability grants tied to governance roles

Decision Matrix

EntityDecisionImplementation
EconomicResourceUse hREACall create_economic_event_with_resource in hREA; store returned hash in Nondominium link
EconomicEventUse hREACall create_rea_economic_event in hREA; PPR generation fires after in Nondominium
CommitmentUse hREACall create_rea_commitment; link to PPR claims via Nondominium-side links
ResourceSpecificationHybridCreate ReaResourceSpecification in hREA for VF compliance; extend with a Nondominium ResourceSpecificationExtension entry (category, tags, description, is_active) linked to hREA hash
VfAction enumReplace with hREA stringsUse hREA action strings ("transfer", "use", etc.); map custom actions (InitialTransfer, AccessForUse, TransferCustody) to hREA-compatible strings or extensions
PrivateParticipationClaimKeep customNo hREA equivalent; core innovation
GovernanceRuleKeep customNo hREA equivalent; governance-as-operator pattern
ValidationReceipt / ResourceValidationKeep customNo hREA equivalent
Person / AgentHybridReaAgent in hREA DNA (public identity); EncryptedProfile stays in Nondominium DNA

Cross-DNA Call Patterns (Rust / HDK)

All calls from Nondominium zomes to hREA use CallTargetCell::OtherRole("hrea".into()). The hREA coordinator zome name is also "hrea".

Helper: Generic hREA Bridge Call

#![allow(unused)]
fn main() {
// In a shared utilities module accessible to coordinator zomes
use hdk::prelude::*;

pub fn call_hrea<I, O>(fn_name: &str, payload: &I) -> ExternResult<O>
where
    I: serde::Serialize + std::fmt::Debug,
    O: serde::de::DeserializeOwned + std::fmt::Debug,
{
    let response = call(
        CallTargetCell::OtherRole("hrea".into()),
        "hrea",
        fn_name.into(),
        None,
        payload,
    )?;

    match response {
        ZomeCallResponse::Ok(extern_io) => extern_io.decode::<O>().map_err(|e| {
            wasm_error!(WasmErrorInner::Guest(format!(
                "hREA response decode error for {}: {:?}",
                fn_name, e
            )))
        }),
        ZomeCallResponse::Unauthorized(_, _, fn_name, _) => {
            Err(wasm_error!(WasmErrorInner::Guest(format!(
                "hREA call unauthorized: {}",
                fn_name
            ))))
        }
        ZomeCallResponse::NetworkError(e) => {
            Err(wasm_error!(WasmErrorInner::Guest(format!(
                "hREA network error: {}",
                e
            ))))
        }
        ZomeCallResponse::CountersigningSession(e) => {
            Err(wasm_error!(WasmErrorInner::Guest(format!(
                "hREA countersigning error: {}",
                e
            ))))
        }
    }
}
}

Pattern 1: Creating a Resource + Event (atomic)

hREA provides create_economic_event_with_resource which creates both in one call and automatically sets up quantities. Use this for resource registration:

#![allow(unused)]
fn main() {
// zome_resource coordinator — registers a new resource in hREA
pub fn register_resource_in_hrea(
    hrea_agent_hash: ActionHash,
    hrea_spec_hash: ActionHash,
    quantity: f64,
    unit_hash: ActionHash,
) -> ExternResult<ActionHash> {
    #[derive(Serialize, Deserialize, Debug)]
    struct QuantityValue {
        has_numerical_value: f64,
        has_unit: ActionHash,
    }

    #[derive(Serialize, Deserialize, Debug)]
    struct ReaEconomicResource {
        id: Option<ActionHash>,
        conforms_to: Option<ActionHash>,
        primary_accountable: Option<ActionHash>,
        accounting_quantity: Option<QuantityValue>,
        onhand_quantity: Option<QuantityValue>,
        // other fields as None...
    }

    #[derive(Serialize, Deserialize, Debug)]
    struct ReaEconomicEvent {
        id: Option<ActionHash>,
        rea_action: String,
        provider: Option<ActionHash>,
        receiver: Option<ActionHash>,
        resource_quantity: Option<QuantityValue>,
        has_point_in_time: Option<Timestamp>,
    }

    #[derive(Serialize, Deserialize, Debug)]
    struct EconomicEventWithResource {
        economic_event: ReaEconomicEvent,
        resource: ReaEconomicResource,
    }

    let qty = QuantityValue {
        has_numerical_value: quantity,
        has_unit: unit_hash,
    };

    let input = EconomicEventWithResource {
        economic_event: ReaEconomicEvent {
            id: None,
            rea_action: "produce".to_string(),
            provider: Some(hrea_agent_hash.clone()),
            receiver: Some(hrea_agent_hash.clone()),
            resource_quantity: Some(QuantityValue {
                has_numerical_value: quantity,
                has_unit: unit_hash.clone(),
            }),
            has_point_in_time: Some(sys_time()?),
        },
        resource: ReaEconomicResource {
            id: None,
            conforms_to: Some(hrea_spec_hash),
            primary_accountable: Some(hrea_agent_hash),
            accounting_quantity: Some(qty),
            onhand_quantity: None, // set by hREA from event
        },
    };

    let record: Record = call_hrea("create_economic_event_with_resource", &input)?;
    Ok(record.action_address().clone())
}
}

Pattern 2: Creating a Commitment in hREA

#![allow(unused)]
fn main() {
// zome_gouvernance coordinator — creates a commitment in hREA
pub fn propose_commitment_in_hrea(
    rea_action: &str,
    provider_hrea_hash: ActionHash,
    receiver_hrea_hash: ActionHash,
    resource_hash: Option<ActionHash>,
    resource_spec_hash: Option<ActionHash>,
    quantity: f64,
    unit_hash: ActionHash,
    due: Option<Timestamp>,
) -> ExternResult<ActionHash> {
    #[derive(Serialize, Deserialize, Debug)]
    struct QuantityValue { has_numerical_value: f64, has_unit: ActionHash }

    #[derive(Serialize, Deserialize, Debug)]
    struct ReaCommitment {
        id: Option<ActionHash>,
        rea_action: Option<String>,
        provider: Option<ActionHash>,
        receiver: Option<ActionHash>,
        resource_inventoried_as: Option<ActionHash>,
        resource_conforms_to: Option<ActionHash>,
        resource_quantity: Option<QuantityValue>,
        due: Option<Timestamp>,
        finished: Option<bool>,
    }

    let input = ReaCommitment {
        id: None,
        rea_action: Some(rea_action.to_string()),
        provider: Some(provider_hrea_hash),
        receiver: Some(receiver_hrea_hash),
        resource_inventoried_as: resource_hash,
        resource_conforms_to: resource_spec_hash,
        resource_quantity: Some(QuantityValue {
            has_numerical_value: quantity,
            has_unit: unit_hash,
        }),
        due,
        finished: Some(false),
    };

    let record: Record = call_hrea("create_rea_commitment", &input)?;
    Ok(record.action_address().clone())
}
}

Pattern 3: Recording an Economic Event (fulfills Commitment)

When a commitment is fulfilled, create an economic event in hREA that references both the resource and the commitment. hREA automatically updates resource quantities.

#![allow(unused)]
fn main() {
// zome_gouvernance coordinator — records fulfillment of a commitment
pub fn record_economic_event_in_hrea(
    rea_action: &str,
    provider_hrea_hash: ActionHash,
    receiver_hrea_hash: ActionHash,
    resource_hash: ActionHash,
    to_resource_hash: Option<ActionHash>,
    quantity: f64,
    unit_hash: ActionHash,
    fulfills: Vec<ActionHash>,      // hREA commitment hashes
) -> ExternResult<ActionHash> {
    #[derive(Serialize, Deserialize, Debug)]
    struct QuantityValue { has_numerical_value: f64, has_unit: ActionHash }

    #[derive(Serialize, Deserialize, Debug)]
    struct ReaEconomicEvent {
        id: Option<ActionHash>,
        rea_action: String,
        provider: Option<ActionHash>,
        receiver: Option<ActionHash>,
        resource_inventoried_as: Option<ActionHash>,
        to_resource_inventoried_as: Option<ActionHash>,
        resource_quantity: Option<QuantityValue>,
        has_point_in_time: Option<Timestamp>,
        fulfills: Option<Vec<ActionHash>>,
    }

    let input = ReaEconomicEvent {
        id: None,
        rea_action: rea_action.to_string(),
        provider: Some(provider_hrea_hash),
        receiver: Some(receiver_hrea_hash),
        resource_inventoried_as: Some(resource_hash),
        to_resource_inventoried_as: to_resource_hash,
        resource_quantity: Some(QuantityValue {
            has_numerical_value: quantity,
            has_unit: unit_hash,
        }),
        has_point_in_time: Some(sys_time()?),
        fulfills: if fulfills.is_empty() { None } else { Some(fulfills) },
    };

    let record: Record = call_hrea("create_rea_economic_event", &input)?;
    Ok(record.action_address().clone())
}
}

Pattern 4: Capability Grants for Cross-Role Calls

Depending on the hREA DNA's capability configuration, cross-role calls may need explicit unrestricted grants. Add to hREA DNA's init if required, or configure in the happ.yaml:

#![allow(unused)]
fn main() {
// In zome_gouvernance or zome_resource init() — grant hREA functions
#[hdk_extern]
pub fn init(_: ()) -> ExternResult<InitCallbackResult> {
    let mut fns: BTreeSet<(ZomeName, FunctionName)> = BTreeSet::new();
    fns.insert(("hrea".into(), "create_rea_economic_event".into()));
    fns.insert(("hrea".into(), "create_economic_event_with_resource".into()));
    fns.insert(("hrea".into(), "create_rea_commitment".into()));
    fns.insert(("hrea".into(), "get_latest_rea_economic_resource".into()));

    create_cap_grant(CapGrantEntry {
        tag: "nondominium-hrea-bridge".into(),
        access: CapAccess::Unrestricted,
        functions: GrantedFunctions::Listed(fns),
    })?;

    Ok(InitCallbackResult::Pass)
}
}

Pattern 5: Person / Agent Hybrid

When creating a Person in Nondominium, also create a ReaAgent in hREA and store the cross-reference:

#![allow(unused)]
fn main() {
// zome_person coordinator — create_person now creates in both DNAs
pub fn create_person_with_hrea_agent(
    name: String,
    avatar_url: Option<String>,
    private_data: Option<EncryptedProfileData>,
) -> ExternResult<PersonWithHreaRecord> {
    #[derive(Serialize, Deserialize, Debug)]
    struct ReaAgent {
        id: Option<ActionHash>,
        name: String,
        agent_type: String,
        image: Option<String>,
        classified_as: Option<Vec<String>>,
        note: Option<String>,
    }

    // 1. Create ReaAgent in hREA DNA
    let hrea_agent_input = ReaAgent {
        id: None,
        name: name.clone(),
        agent_type: "Person".to_string(),
        image: avatar_url.clone(),
        classified_as: None,
        note: None,
    };
    let hrea_record: Record = call_hrea("create_rea_agent", &hrea_agent_input)?;
    let hrea_agent_hash = hrea_record.action_address().clone();

    // 2. Create Nondominium Person entry (stores reference to hREA agent)
    let person = Person {
        name,
        avatar_url,
        hrea_agent_hash: Some(hrea_agent_hash.clone()),
        created_at: sys_time()?,
    };
    let person_hash = create_entry(&EntryTypes::Person(person.clone()))?;

    // 3. Create EncryptedProfile if private data provided
    let encrypted_profile_hash = if let Some(private) = private_data {
        Some(create_entry(&EntryTypes::EncryptedProfile(private))?)
    } else {
        None
    };

    Ok(PersonWithHreaRecord {
        person_hash,
        hrea_agent_hash,
        encrypted_profile_hash,
    })
}
}

hApp Bundle Configuration

happ.yaml (dual-DNA setup)

manifest_version: "1"
name: nondominium
description: Nondominium peer-sharing hApp with hREA economic backend
roles:
  - name: nondominium
    provisioning:
      strategy: create
      deferred: false
    dna:
      bundled: nondominium.dna
      modifiers:
        network_seed: ~
        properties: ~
  - name: hrea
    provisioning:
      strategy: create
      deferred: false
    dna:
      bundled: hrea.dna
      modifiers:
        network_seed: ~
        properties: ~

The role name "hrea" in happ.yaml is what gets passed to CallTargetCell::OtherRole("hrea".into()) in coordinator zome code.


Git Submodule Setup

# Add hREA as a submodule (pin to stable main-0.6 branch commit)
git submodule add -b main-0.6 https://github.com/h-REA/hREA.git vendor/hrea
cd vendor/hrea
git checkout fc3b5e78e749e84b8738dc4813bba9037afd17bc
cd ../..
git add vendor/hrea .gitmodules
git commit -m "add hREA as submodule (main-0.6 branch)"

Cargo.toml Workspace

[workspace]
members = [
    "dnas/nondominium/zomes/coordinator/*",
    "dnas/nondominium/zomes/integrity/*",
    # hREA zomes compiled separately via their own build system
]

# If sharing types directly (advanced integration):
[workspace.dependencies]
hrea_integrity = { path = "vendor/hrea/dnas/hrea/zomes/integrity/hrea" }

Note: The struct definitions in the call patterns above use local inline structs to avoid coupling Nondominium's crate graph to hREA's. For tighter integration, use hrea_integrity as a workspace dependency and import types directly.


Migration Strategy

Holochain DHT entries are immutable: existing entries cannot be deleted or migrated in-place. The migration path respects this constraint.

Phase 2 Migration (Current)

Goal: Route all new entry creation through hREA; existing entries remain valid.

  1. No changes to existing entries: Existing Commitment, EconomicEvent, and EconomicResource entries on the DHT remain as-is and continue to be queryable
  2. New entries use hREA: All new function calls in coordinator zomes call hREA via bridge, then store the returned ActionHash in Nondominium-side link structures
  3. Cross-reference links: Add a HreaResourceHash link type in zome_resource_integrity linking EconomicResource original hash → hREA ReaEconomicResource hash
  4. Dual-read query layer: get_all_economic_resources() returns both legacy custom entries and hREA-backed entries, normalized through a shared response type

Dual-Read Response Type

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug)]
pub enum ResourceResponse {
    // Legacy custom entry (Phase 1 data)
    Legacy {
        hash: ActionHash,
        resource: EconomicResource,
    },
    // hREA-backed entry (Phase 2+ data)
    HreaBackd {
        nondominium_hash: ActionHash,
        hrea_hash: ActionHash,
        // normalized fields
        quantity: f64,
        custodian: AgentPubKey,
    },
}
}

Phase 3: Type Deprecation

Once Phase 2 has been running for a defined period and all active resources are hREA-backed:

  • Stop creating new zome_gouvernance::Commitment entries; use only ReaCommitment via hREA
  • Stop creating new zome_gouvernance::EconomicEvent entries; use only ReaEconomicEvent via hREA
  • Keep the integrity types (they cannot be removed without breaking DHT validation of old entries)
  • Mark coordinator functions as deprecated in documentation

Privacy Architecture

hREA's Privacy Model

hREA has no custom privacy implementation. All entries are public by design:

  • ReaAgent entries contain only public-facing information
  • ReaEconomicResource entries are fully public
  • No encrypted or private entry types exist

Nondominium's Complementary Privacy Layer

Nondominium's EncryptedProfile system fills exactly the gap hREA leaves:

LayerWhatWhere
Public identityReaAgent (name, avatar, type)hREA DNA — discoverable by all
Private PIIEncryptedProfile (email, phone, address)Nondominium DNA — capability-gated
Economic coordinationReaEconomicResource, ReaCommitmenthREA DNA — public ValueFlows
Participation trackingPrivateParticipationClaim (PPR)Nondominium DNA — private to agent

This is not a conflict; it is a clean division of concerns:

  • hREA handles economic visibility (what resources exist, what commitments are made)
  • Nondominium handles relational privacy (who you are, what you've privately contributed)

Testing Strategy

Dual-DNA Tryorama Setup

// tests/src/multi-dna/hrea-integration.test.ts
import { runScenario, dhtSync } from "@holochain/tryorama";

describe("Nondominium-hREA integration", () => {
  test("creating a resource creates ReaEconomicResource in hREA DNA", async () => {
    await runScenario(async (scenario) => {
      const appBundleSource = {
        type: "path",
        value: "workdir/nondominium.webhapp", // includes both DNAs
      };

      const [alice, bob] = await scenario.addPlayersWithApps([
        { appBundleSource },
        { appBundleSource },
      ]);

      // Create resource via Nondominium interface
      const resourceResult = await alice.appWs.callZome({
        role_name: "nondominium",
        zome_name: "zome_resource",
        fn_name: "create_economic_resource",
        payload: {
          spec_hash: someSpecHash,
          quantity: 1.0,
          unit: "piece",
          current_location: null,
        },
      });

      await dhtSync([alice, bob], alice.cells[0].cell_id[0]);

      // Verify ReaEconomicResource exists in hREA DNA
      const hreaResource = await alice.appWs.callZome({
        role_name: "hrea",
        zome_name: "hrea",
        fn_name: "get_latest_rea_economic_resource",
        payload: resourceResult.hrea_resource_hash,
      });

      expect(hreaResource).toBeTruthy();
      expect(hreaResource.entry.conforms_to).toEqual(someHreaSpecHash);
    });
  });

  test("PPR claim generated after economic event", async () => {
    await runScenario(async (scenario) => {
      // ... setup

      // Record event (creates in hREA AND generates PPR in Nondominium)
      const eventResult = await alice.appWs.callZome({
        role_name: "nondominium",
        zome_name: "zome_gouvernance",
        fn_name: "create_economic_event",
        payload: {
          rea_action: "use",
          resource_hash: resourceHash,
          quantity: 1.0,
          // ...
        },
      });

      // Verify event exists in hREA
      const hreaEvent = await alice.appWs.callZome({
        role_name: "hrea",
        zome_name: "hrea",
        fn_name: "get_latest_rea_economic_event",
        payload: eventResult.hrea_event_hash,
      });
      expect(hreaEvent).toBeTruthy();

      // Verify PPR claim generated in Nondominium (private — only Alice can see)
      const pprClaims = await alice.appWs.callZome({
        role_name: "nondominium",
        zome_name: "zome_gouvernance",
        fn_name: "get_my_participation_claims",
        payload: null,
      });
      expect(pprClaims.length).toBeGreaterThan(0);
    });
  });
});

Performance Considerations

Call Latency Hierarchy

Call TypeApproximate LatencyWhen to Use
Cross-zome, same DNA~1msIntra-Nondominium calls
Cross-DNA bridge (same conductor)~5-10msNondominium → hREA
DHT get (local)~1-5msReading own-authored entries
DHT get (remote)~100-500msReading peer-authored entries
Remote agent call~200-1000msAgent-to-agent direct calls

The bridge call overhead (~5-10ms) is acceptable because hREA integration happens at write time (creating resources/events), not at read time for every UI render.

Optimization Patterns

  1. Cache hREA hashes: Store returned hREA ActionHash values in Nondominium links so reads don't need to re-query hREA
  2. Batch event creation: Where multiple events are logically grouped, consider a single create_economic_event_with_resource call over multiple separate calls
  3. Lazy hREA sync: For non-critical metadata (e.g., updating ReaAgent image), defer the hREA call to a background signal rather than blocking the main operation

Implementation Roadmap

Phase 1: Foundation (Person Zome — CURRENT TARGET)

  • Set up hREA git submodule (vendor/hrea, main-0.6 branch)
  • Configure happ.yaml with nondominium and hrea roles
  • Build hREA DNA and include in .webhapp bundle
  • Add hrea_agent_hash: Option<ActionHash> field to Person integrity entry
  • Implement create_rea_agent bridge call in zome_person coordinator
  • Update create_person to create ReaAgent in hREA first
  • Write Tryorama tests for dual-DNA person creation
  • Validate get_rea_agents_from_action_hashes cross-DNA read

Phase 2: Resource Lifecycle

  • Add hrea_resource_hash: Option<ActionHash> field or link to resource entries
  • Implement create_economic_event_with_resource bridge call
  • Implement create_rea_resource_specification bridge call
  • Implement ResourceSpecificationExtension hybrid pattern
  • Re-enable cross-zome governance call (currently commented out in economic_resource.rs)
  • Write dual-DNA resource lifecycle tests

Phase 3: Governance Integration

  • Implement create_rea_commitment bridge call
  • Implement create_rea_economic_event bridge call (with fulfills field)
  • Wire PPR generation to fire after hREA event creation
  • Implement dual-read query layer for legacy + hREA resources
  • Write commitment → event → PPR end-to-end scenario tests

Phase 4: Production Readiness

  • Security audit of cross-DNA capability grants
  • Performance benchmarks for bridge call overhead at scale
  • Submodule version pinning and upgrade process
  • Community deployment guide

Risk Assessment

RiskLikelihoodImpactMitigation
hREA main-0.6 branch API changesMediumHighPin to a specific commit hash, not a branch pointer
Cross-DNA call capability issuesMediumHighTest cap grants early in Phase 1
hREA DNA build incompatibility (HDK version mismatch)LowHighConfirmed: both use HDK ^0.6.0 / HDI ^0.7.0 on holonix main-0.6
Performance degradation from bridge callsLowMediumBenchmark early; cache hREA hashes in Nondominium links
Migration query complexity (dual-read layer)MediumLowKeep migration period short; prioritize hREA-backed data

Future: PPR System as hREA Enhancement

Nondominium's PPR system has no current hREA equivalent. It could eventually be contributed to hREA as a governance extension:

  1. Prove the pattern: Demonstrate PPR value in Nondominium production
  2. Document the spec: Formalize PrivateParticipationClaim as a ValueFlows extension
  3. Propose to community: Submit to ValueFlows spec and hREA governance
  4. Upstream contribution: Contribute proven patterns back to hREA once validated

Conclusion

Nondominium's integration strategy uses hREA as the economic data layer (EconomicResource, EconomicEvent, Commitment, Agent) while keeping Nondominium's governance and privacy layer entirely custom (PPR, GovernanceRule, ValidationReceipt, EncryptedProfile).

The bridge pattern (call(CallTargetCell::OtherRole("hrea"), "hrea", fn_name, ...)) is the mechanism that makes this work at the Rust/zome level without touching hREA's GraphQL API.

Key outcomes:

  • ValueFlows compliance: hREA's battle-tested VF model handles all economic data correctly
  • Privacy preserved: EncryptedProfile + PPR system layers over hREA's public economic data
  • Governance innovation intact: PPR system remains Nondominium's unique contribution
  • Migration safe: DHT immutability respected; legacy entries remain valid indefinitely
  • Ecosystem interoperability: Other hREA-based apps can interoperate with Nondominium's economic data directly through the shared hREA DNA

Document Version: 2.0 Last Updated: 2026-03-02 Status: Implementation Ready hREA Source: https://github.com/h-REA/hREA (branch: main-0.6, commit: fc3b5e78)

hREA Strategic Roadmap

Phases 1 and 2: Stabilization, VF 1.0 Alignment, and Interoperability

Status: Draft, March 2026 Repository: github.com/h-REA/hREA

This document proposes Phases 1 and 2 for an hREA maintainership transition. Phase 3 (ValueFlows DSL) and Phase 4 (ADAM integration) are mentioned briefly as potential future directions but are out of scope for this proposal.


Context

hREA is the Holochain implementation of the ValueFlows economic vocabulary, built on the REA (Resource-Event-Agent) accounting ontology. Its GraphQL API layer has been effectively abandoned, leaving the zome API as the de facto interface, but without adequate documentation, stabilization, or alignment with ValueFlows v1.0.

This document proposes a two-phase roadmap: foundational stabilization with full VF 1.0 alignment, followed by an interoperability layer that makes hREA a first-class citizen of the distributed ValueFlows ecosystem. Phase 2 presents an open question for community discussion: whether to revive the existing GraphQL API or adopt a JSON-LD approach.


Phase 1: Stabilization and ValueFlows v1.0 Alignment

Immediate priority

Goals

  • Bring hREA's zome API into stable, documented shape
  • Close all known gaps against the ValueFlows v1.0 ontology
  • Enforce correctness at the DHT validation layer
  • Make direct zome-to-zome and DNA-to-DNA calls a first-class integration pattern

Work Items

ValueFlows v1.0 gap closure

A full compliance audit against the VF 1.0 TTL ontology (https://w3id.org/valueflows/ont/vf#) identified hREA main-0.6 at approximately 65% compliance. The following gaps are to be closed in priority order:

  • P0 (Critical): Add vf:Claim entry type (coordinator + integrity zomes); add settles field to ReaEconomicEvent. Required for contribution accounting and invoicing workflows.
  • P0 (Critical): Add effortQuantity to ReaEconomicEvent. Required for all work and deliverService action events, the primary use case in Open Value Networks.
  • P1: Add reciprocalRealizationOf to ReaEconomicEvent; reciprocalClauseOf to ReaCommitment. Required for bilateral exchange event recording.
  • P1: Add mediumOfExchange and substitutable to ReaResourceSpecification. Required for currency token and fungibility workflows.
  • P1: Add purpose to ReaProposal (offer/request distinction). Required for Requests and Offers filtering.
  • P2: vf:SpatialThing as a proper entry type (replace Option<String> location fields); vf:BatchLotRecord; missing Action effect dimensions (locationEffect, stageEffect, stateEffect, containedEffect, createResource, eventQuantity).

Full field-by-field gap analysis: hREA VF 1.0 Compliance Analysis

Stub validation implementation

Every integrity zome validation function is currently a stub returning ValidateCallbackResult::Valid with a // TODO comment. This is the most consequential correctness gap: invalid entries can be written to the DHT by any non-compliant client. Phase 1 implements, at minimum:

  • Action input/output constraint on EconomicEvent creation (using get_builtin_action())
  • Temporal consistency: has_beginning < has_end where both are present
  • Quantity positivity check
  • provider/receiver presence validation for transfer actions

This serves both the VF community (spec compliance) and any existing hREA users in production, meaning external communities who cannot absorb silent data corruption during the transition.

Zome API documentation

With GraphQL retired as the primary interface, the zome call surface becomes the public API. It needs to be documented as such: function signatures, input/output types, capability grant requirements, and cross-zome call patterns. A concise reference guide targeting Holochain developers building on hREA.

Direct call promotion

Actively promote zome calls as the integration pattern for:

  • Cross-zome calls within the same DNA (same-network composition)
  • Cross-DNA bridge calls (composing hREA with other hApps)
  • UI-direct calls via Holochain's conductor API

This removes the GraphQL indirection entirely for native Holochain consumers, reducing latency and eliminating a maintenance surface.

Test coverage and CI

Stabilization without tests is fragile. This phase introduces or restores comprehensive integration tests against the Holochain conductor and a robust CI pipeline.


Phase 2: Semantic Interoperability

An invitation to the community

The Question

Phase 1 establishes a clean, documented zome API for native Holochain consumers. Phase 2 asks a broader question: how should hREA present itself to the wider semantic web?

The ValueFlows vocabulary is grounded in RDF and W3C linked data standards. hREA implements that vocabulary on an agent-centric substrate. The opportunity in Phase 2 is to make that implementation legible to the outside world, whether that means other ValueFlows nodes, external applications, or federated social and economic networks. The right approach depends on where the ecosystem is heading and where effort is best spent. This section presents three directions and invites community discussion before any Phase 2 work begins.


Option A: Maintain and Improve the GraphQL API

The existing GraphQL layer already exists as a codebase surface, and parts of the ecosystem may depend on it. Reviving it would mean:

  • Auditing and updating the schema to match the Phase 1 VF 1.0 additions
  • Restoring CI coverage for the GraphQL layer
  • Continuing to maintain a translation layer between Holochain's entry model and GraphQL types

Tradeoffs: familiar to existing integrators, compatible with tools that already target the hREA GraphQL schema. Carries ongoing maintenance overhead. Does not provide semantic interoperability with non-GraphQL ValueFlows nodes.


Option B: JSON-LD Serialization Layer

Retire GraphQL as the primary external interface and replace it with a JSON-LD serialization layer grounded in the official ValueFlows vocabulary.

Tradeoffs: aligns with W3C linked data standards, enables federation with non-Holochain VF implementations, supports SPARQL querying and Solid pod interop. Requires migrating existing integrators away from GraphQL. A larger upfront investment than reviving the existing API.

On the transport layer: the Holochain Foundation's hc-http-gw (and Holo's Web Bridge for hosted deployments) already provides a ready-made HTTP-to-zome bridge, eliminating the need to build a custom gateway process. The architecture then reduces to building the translation zome only. External clients send an HTTP request, the gateway dispatches it as a zome call, and the translation zome returns a well-formed JSON-LD document directly.

External client
    ↓  HTTP GET
hc-http-gw / Holo Web Bridge
    ↓  zome call
vf_jsonld translation zome  ←  the only custom component
    ↓  JSON-LD string
hc-http-gw (passes through)
    ↓  HTTP response
External client receives JSON-LD

The full architecture for the translation zome and compliance versioning mechanism is specified below as a concrete reference, should the community choose this direction.


Option C: ActivityPub Federation

The ValueFlows community outside Holochain is already building federation through ActivityPub. Bonfire (the Fediverse platform) supports ValueFlows as an ActivityPub extension, and active Fediverse Enhancement Proposals (FEPs) address federated marketplaces and work coordination using the ValueFlows vocabulary. ActivityPub serializes natively in JSON-LD.

This path does not require building a new gateway or serialization layer. It means implementing the ActivityPub protocol on top of hREA's data, joining an existing and growing federation network.

Tradeoffs: strong community momentum, JSON-LD native, interoperable with the entire Fediverse. Requires ActivityPub protocol implementation, a meaningful additional scope. hREA would need to speak both its native zome API and ActivityPub.


The options are not mutually exclusive. A combination (for example, Option B as a read layer and Option C as a federation layer) is worth discussing. The goal of Phase 2 is not to select an architecture in isolation but to align with where the ValueFlows and Holochain communities are heading together.


Option B Reference Architecture

This section specifies the JSON-LD approach in detail as a concrete proposal. It is presented for community review, not as a decided direction.

Translation Zome (the only custom component)

A vf_jsonld coordinator zome inside the hREA DNA. Core functions:

#![allow(unused)]
fn main() {
get_as_jsonld(hash: ActionHash) -> ExternResult<String>
get_vf_context(_: ()) -> ExternResult<String>
get_vf_compliance(_: ()) -> ExternResult<VfCompliance>
}

The zome reads any entry by hash, applies the official VF @context, and returns a well-formed JSON-LD document. Agent-controlled, meaning no external party can alter how the agent's data is expressed. Every Phase 1 addition (new fields, new entry types) propagates to JSON-LD output automatically because the serialization logic lives in the same codebase as the structs.

VF Compliance Versioning

VF compliance is not a semantic version number, it is an enumerable field mapping. The compliance analysis proves this: every implemented and missing VF 1.0 property is known precisely. The versioning mechanism makes this machine-readable.

Three artifacts working together:

1. A VF_CONTEXT_URI constant in the DNA

#![allow(unused)]
fn main() {
// In coordinator/hrea/src/lib.rs
pub const VF_CONTEXT_URI: &str =
    "https://hrea.io/contexts/hrea-0.6_vf-1.0.jsonld";
}

The URI encodes both the hREA version and the VF version targeted. When structs change (new DNA), the constant changes. When VF updates, the constant changes. Both the translation zome and the external gateway read this single constant and cannot diverge during version transitions.

2. A versioned context document published at that URI

Generated directly from the compliance analysis. null values are explicit about gaps, not silent:

{
  "@context": {
    "vf": "https://w3id.org/valueflows/ont/vf#",
    "hrea_version": "0.6",
    "vf_version": "1.0.0",
    "compliance_level": "partial",
    "EconomicEvent": "vf:EconomicEvent",
    "action": "vf:action",
    "effortQuantity": null,
    "settles": null
  }
}

3. A get_vf_compliance() coordinator function

Returns the full compliance profile at runtime: hREA version, VF version, compliance level, context URI, and the explicit list of missing fields. Any consuming system can inspect this before connecting.

When VF updates arrive: update the constant, publish a new context document at the new versioned URI. No consistency gap between the translation zome and the gateway.

URI Strategy

Holochain action hashes are content-addressed and globally unique, making them natural JSON-LD subject URIs:

hc://[dna-hash]/[action-hash]

Resolvable by any node with the DNA installed, preserving agent-centric semantics while providing the stable identity that JSON-LD requires.

What This Unlocks

  • Cross-implementation federation: Holochain-based and non-Holochain ValueFlows nodes can exchange EconomicEvent records because they share JSON-LD context
  • SPARQL querying: Aggregate ValueFlows data across a network for reporting and analysis
  • Application bridges: Any application can consume and produce hREA data via standard linked data patterns without custom protocol translation
  • Solid interop: ValueFlows data expressed as Linked Data Notifications flows naturally into Solid pods

Potential Future Directions

Phases 1 and 2 constitute the full scope of this proposal. Two directions are on the horizon as potential future evolutions, each subject to separate community discussion: a ValueFlows DSL (a human-writable scripting language compiling to native zome calls and JSON-LD) and ADAM integration (registering hREA data as traversable Perspectives in an agent-centric graph layer, made natural by the JSON-LD foundation from Phase 2).


Governance and Community

Taking on hREA maintainership is not only a technical commitment. It is a position of stewardship in the ValueFlows and Holochain ecosystems. The following principles should guide this work:

Upstream coordination: Changes that affect ValueFlows compliance should be discussed with the ValueFlows specification maintainers and community before implementation. hREA is an implementation of a shared vocabulary, not a fork.

Open maintainership: The goal is not to control hREA but to revive it. Active solicitation of co-maintainers, clear contribution guides, and a public roadmap support a healthy transition. Struct changes in Phase 1 (adding vf:Claim, effortQuantity, location type migration) are breaking changes for existing hREA users. Clear migration guides and a deprecation window are part of the stabilization commitment, not an afterthought.

Reference implementations: Active use of hREA in production hApps provides the most concrete test of the zome API's real-world fitness. Feedback flows upstream: what breaks in practice gets fixed in hREA. The compliance analysis at valueflows-1.0-compliance.md is the living source of truth for Phase 1 gap closure and the generator of the Phase 2 context documents.

Multi-hApp composition: hApps building on hREA should benefit from these improvements. The interoperability work should be designed with multi-hApp composition in mind from the start.


Summary Timeline

PhaseFocusScope
1Stabilization + VF 1.0 gap closure + stub validationThis proposal
2Semantic interoperability (GraphQL, JSON-LD, or ActivityPub: open community discussion)This proposal
3ValueFlows DSLFuture discussion
4ADAM integrationFuture discussion

References

hREA ValueFlows 1.0 Compliance Analysis

Branch: vendor/hrea — detached HEAD at fc3b5e78 VF Spec Version: 1.0.0 (CC-BY-SA 4.0) VF Ontology source: https://w3id.org/valueflows/ont/vf# Analysis date: 2026-03-25 Analysts: Soushi888, SoushAI


Table of Contents

  1. Executive Summary
  2. Methodology
  3. Overall Compliance Score
  4. Missing Entity Types
  5. Field-Level Gaps by Entity
  6. Action Model Gaps
  7. Validation Gaps
  8. Naming and Structural Observations
  9. Recommendations
  10. Appendix: Full Field Mapping Tables

Executive Summary

hREA main-0.6 implements the structural core of the ValueFlows 1.0 ontology competently: the foundational economic flow cycle (Agent, EconomicResource, EconomicEvent, Process) is present and linked correctly. The planning layer (Intent, Commitment, Plan, Proposal) and the knowledge layer (ResourceSpecification, ProcessSpecification, Recipe*) are scaffolded with correct relational structure.

However, five VF 1.0 entity classes are entirely absent, the Action model covers only 4 of 10 effect dimensions, all entry validation functions are stubs with no business rule enforcement, and several field-level gaps break round-trip interoperability with other VF-compliant systems (e.g., Bonfire).

Overall estimated compliance: ~65%

The most consequential gap for immediate interoperability is the absence of vf:Claim and the missing effortQuantity on EconomicEvent. The most consequential gap for long-term correctness is the wholesale absence of validation logic.


Methodology

Analysis performed by:

  1. Reading the VF 1.0 TTL ontology via the HTML rendering at http://ontprox.dev.opensourceecology.de/?uri=https://codeberg.org/valueflows/pages/raw/branch/main/assets/all_vf.TTL extracting all class definitions, properties, ranges, and named individuals.

  2. Reading every Rust integrity zome struct in vendor/hrea/dnas/hrea/zomes/integrity/hrea/src/ cataloguing all fields and their types.

  3. Reading the coordinator zome public function signatures in vendor/hrea/dnas/hrea/zomes/coordinator/hrea/src/

  4. Reading the action builtins in vendor/hrea/dnas/hrea/zomes/coordinator/hrea/vf_actions/src/builtins.rs

  5. Cross-referencing hREA struct fields against VF 1.0 property names and ranges.

No compilation or runtime testing was performed. All findings are structural (type-level) only.


Overall Compliance Score

DomainScoreNotes
Core entity presence15/205 entities absent
Field coverage (present entities)~75%See per-entity tables below
Action model4/10 effectsMissing 6 effect dimensions
Validation / business rules0%All stubs
Overall~65%

Missing Entity Types

These VF 1.0 classes have no corresponding entry type in hREA main-0.6.

1. vf:Claim (P0 — Critical)

VF 1.0 definition: "A claim for future economic event(s) in reciprocity for events already occurred."

Key properties:

  • vf:triggeredBy (EconomicEvent) — the event that triggers the claim
  • vf:settles on EconomicEvent — the event that settles an open claim

Impact on hREA: ReaEconomicEvent has no settles field. Any VF workflow using claim-based reciprocity (invoicing, contribution tracking in OVNs) cannot be expressed. This breaks Nondominium's planned contribution accounting workflow.

Implementation path: Add ReaClaim integrity entry type; add settles: Option<Vec<ActionHash>> to ReaEconomicEvent.


2. vf:SpatialThing (P1)

VF 1.0 definition: "Data locating something relative to Earth, usually fixed location."

Key properties: latitude, longitude, altitude, mappableAddress, hasDetailedGeometry

Current hREA state: All location fields across all entry types (ReaEconomicEvent.at_location, ReaEconomicResource.current_location, ReaProcess implied) are Option<String>. This is a plain text field, not a structured location object.

Impact: Interoperability with location-aware VF clients or Bonfire's SpatialThing support is broken. Cross-system queries on location cannot be typed.

Implementation path: Add ReaSpatialThing entry type. Replace *_location: Option<String> fields with *_location: Option<ActionHash> referencing a ReaSpatialThing.


3. vf:BatchLotRecord (P2)

VF 1.0 definition: "Document containing detail related to production of particular batch or lot."

Key properties: batchLotCode (string), expirationDate (dateTimeStamp)

Current hREA state: ReaEconomicResource.lot: Option<String> — stores just a code string. Expiration date is not present.

Impact: Perishable goods tracking, pharmaceutical lot tracking, and any time-bounded batch workflow cannot express lot expiration.

Implementation path: Add ReaBatchLotRecord entry type. Change lot: Option<String> to of_batch_lot: Option<ActionHash> on ReaEconomicResource.


4. vf:AgreementBundle (P2)

VF 1.0 definition: "Grouping of agreements for bundled line item reciprocity."

Current hREA state: No equivalent. ReaAgreement has no bundledIn field.

Impact: Multi-party trade agreements with line items cannot be grouped. Nondominium's multi-resource governance commitments may require this.

Implementation path: Add ReaAgreementBundle entry type; add bundled_in: Option<ActionHash> to ReaAgreement.


5. vf:ProposalList (P2)

VF 1.0 definition: "Grouping of proposals for publishing."

Current hREA state: No equivalent. ReaProposal has no listed_in field.

Impact: Marketplace-style proposal catalogues (e.g., hAppenings Requests & Offers grouped by category) cannot be expressed at the VF ontology level.

Implementation path: Add ReaProposalList entry type; add listed_in: Option<ActionHash> to ReaProposal.


Field-Level Gaps by Entity

vf:EconomicEvent / ReaEconomicEvent

VF 1.0 PropertyhREA FieldStatusNotes
vf:actionrea_action: StringPRESENTNaming differs (rea_ prefix)
vf:providerprovider: Option<ActionHash>PRESENT
vf:receiverreceiver: Option<ActionHash>PRESENT
vf:resourceInventoriedAsresource_inventoried_as: Option<ActionHash>PRESENT
vf:toResourceInventoriedAsto_resource_inventoried_as: Option<ActionHash>PRESENT
vf:resourceQuantityresource_quantity: Option<QuantityValue>PRESENT
vf:effortQuantity(absent)MISSINGP0 — needed for work/service events
vf:hasBeginninghas_beginning: Option<Timestamp>PRESENT
vf:hasEndhas_end: Option<Timestamp>PRESENT
vf:hasPointInTimehas_point_in_time: Option<Timestamp>PRESENT
vf:toLocationat_location: Option<String>PARTIALString only, not SpatialThing
vf:fulfillsfulfills: Option<Vec<ActionHash>>PRESENT
vf:satisfiessatisfies: Option<Vec<ActionHash>>PRESENT
vf:realizationOfrealization_of: Option<ActionHash>PRESENT
vf:reciprocalRealizationOf(absent)MISSINGNeeded for bilateral exchange events
vf:correctscorrects: Option<ActionHash>PRESENT
vf:settles(absent)MISSINGBlocked by missing Claim entity
vf:triggeredBytriggered_by: Option<ActionHash>PRESENTCausal event chain
vf:inScopeOfin_scope_of: Option<Vec<ActionHash>>PRESENT
vf:inputOfinput_of: Option<ActionHash>PRESENT
vf:outputOfoutput_of: Option<ActionHash>PRESENT

Gaps: effortQuantity (P0), reciprocalRealizationOf (P1), settles (blocked by Claim). Extra hREA field: agreed_in: Option<String> — not in VF 1.0 ontology.


vf:EconomicResource / ReaEconomicResource

VF 1.0 PropertyhREA FieldStatusNotes
vf:conformsToconforms_to: Option<ActionHash>PRESENT
vf:trackingIdentifiertracking_identifier: Option<String>PRESENT
vf:accountingQuantityaccounting_quantity: Option<QuantityValue>PRESENT
vf:onhandQuantityonhand_quantity: Option<QuantityValue>PRESENT
vf:currentLocationcurrent_location: Option<String>PARTIALString, not SpatialThing
vf:currentVirtualLocation(absent)MISSINGURI field for digital resources
vf:currentCurrencyLocation(absent)MISSINGString field for financial assets
vf:primaryAccountableprimary_accountable: Option<ActionHash>PRESENT
vf:containedIncontained_in: Option<ActionHash>PRESENT
vf:ofBatchLotlot: Option<String>PARTIALStored as string; BatchLotRecord absent
vf:unitOfEffortunit_of_effort: Option<ActionHash>PRESENT
vf:resourceClassifiedAsresource_classified_as (via conforms_to)PARTIAL
vf:stagestage: Option<ActionHash>PRESENT
vf:statestate: Option<String>PRESENT

Extra hREA fields: name, image, note — supplementary, not in VF core ontology.


vf:Commitment / ReaCommitment

VF 1.0 PropertyhREA FieldStatusNotes
vf:actionrea_action: Option<String>PRESENTNote: optional in hREA, implied required in VF
vf:providerprovider: Option<ActionHash>PRESENT
vf:receiverreceiver: Option<ActionHash>PRESENT
vf:resourceInventoriedAsresource_inventoried_as: Option<ActionHash>PRESENT
vf:resourceQuantityresource_quantity: Option<QuantityValue>PRESENT
vf:effortQuantityeffort_quantity: Option<QuantityValue>PRESENT
vf:hasBeginninghas_beginning: Option<Timestamp>PRESENT
vf:hasEndhas_end: Option<Timestamp>PRESENT
vf:duedue: Option<Timestamp>PRESENT
vf:clauseOfclause_of: Option<ActionHash>PRESENT
vf:reciprocalClauseOf(absent)MISSINGNeeded for bilateral agreement commitments
vf:independentDemandOfindependent_demand_of: Option<ActionHash>PRESENT
vf:satisfiessatisfies: Option<ActionHash>PRESENT
vf:finishedfinished: Option<bool>PRESENT
vf:inScopeOfin_scope_of: Option<Vec<ActionHash>>PRESENT

Gap: reciprocalClauseOf (P1).


vf:Agent / ReaAgent

VF 1.0 PropertyhREA FieldStatusNotes
vf:primaryLocation(absent)MISSINGLocation of the agent
Subclasses: Person, Organization, EcologicalAgentagent_type: StringPARTIALFlat string instead of proper subclassing

Extra hREA fields: name (required), image, classified_as, note.

Structural observation: VF 1.0 defines Agent as an abstract class with three concrete subclasses. hREA uses a single ReaAgent with agent_type: String (e.g., "Person", "Organization"). This is pragmatic for Holochain (avoids three entry types with near-identical structure), but breaks strict ontology alignment. A VF-compliant GraphQL layer must map these correctly.


vf:ResourceSpecification / ReaResourceSpecification

VF 1.0 PropertyhREA FieldStatusNotes
vf:defaultUnitOfResourcedefault_unit_of_resource: Option<ActionHash>PRESENT
vf:defaultUnitOfEffortdefault_unit_of_effort: Option<ActionHash>PRESENT
vf:mediumOfExchange(absent)MISSINGBoolean — is this resource a currency?
vf:substitutable(absent)MISSINGBoolean — fungible with same spec?

Impact: Currency tokens and fungibility cannot be expressed. Nondominium's Unyt integration (§6.6 in NDO spec) depends on mediumOfExchange.


vf:Intent / ReaIntent

VF 1.0 PropertyhREA FieldStatusNotes
vf:actionrea_action: StringPRESENT
vf:providerprovider: Option<ActionHash>PRESENT
vf:receiverreceiver: Option<ActionHash>PRESENT
vf:resourceQuantityresource_quantity: Option<QuantityValue>PRESENT
vf:effortQuantityeffort_quantity: Option<QuantityValue>PRESENT
vf:availableQuantityavailable_quantity: Option<QuantityValue>PRESENT
vf:minimumQuantityminimum_quantity: Option<QuantityValue>PRESENT
vf:hasBeginninghas_beginning: Option<Timestamp>PRESENT
vf:hasEndhas_end: Option<Timestamp>PRESENT
vf:duedue: Option<Timestamp>PRESENT
vf:finishedfinished: Option<bool>PRESENT

Intent is one of the more complete implementations. Extra hREA fields: image, agreed_in, in_scope_of.


vf:Proposal / ReaProposal

VF 1.0 PropertyhREA FieldStatusNotes
vf:publishespublishes: Option<Vec<ActionHash>>PRESENT
vf:reciprocalreciprocal: Option<Vec<ActionHash>>PRESENT
vf:unitBasedunit_based: Option<bool>PRESENT
vf:proposedToproposed_to: Option<Vec<ActionHash>>PRESENT
vf:purpose(absent)MISSINGProposalPurpose enum (offer/request)
vf:eligibleLocation(absent)MISSINGSpatialThing — geographic eligibility
vf:listedIn(absent)MISSINGProposalList reference

Extra hREA fields: name, has_beginning, has_end, created, note.


vf:Agreement / ReaAgreement

VF 1.0 PropertyhREA FieldStatusNotes
vf:stipulates(via links)PARTIALRelationship exists via Commitment.clauseOf
vf:stipulatesReciprocal(absent)MISSINGSecond side of bilateral agreement
vf:realizes(via links)PARTIALInverse: EconomicEvent.realizationOf
vf:realizesReciprocal(absent)MISSINGSecond side of bilateral realization
vf:bundledIn(absent)MISSINGAgreementBundle reference

hREA ReaAgreement has only name, created, note. Agreement is severely under-specified relative to VF 1.0. Bilateral exchange workflows (standard in OVN contexts) cannot be fully expressed.


vf:Plan / ReaPlan

VF 1.0 PropertyhREA FieldStatusNotes
vf:planIncludes (Process)(via links)PRESENTReaPlanToReaProcesses link
vf:planIncludes (Commitment)(via links)PRESENTReaPlanToReaCommitments link
vf:hasIndependentDemandindependent_demand_of (inverse)PRESENTExpressed on Commitment side

Plan is relatively well-implemented. Extra hREA fields: name, due, note, in_scope_of, created.


vf:Process / ReaProcess

VF 1.0 PropertyhREA FieldStatusNotes
vf:basedOnbased_on: Option<ActionHash>PRESENT
vf:hasInput(via links)PRESENTReaProcessToReaEconomicEventInputs
vf:hasOutput(via links)PRESENTReaProcessToReaEconomicEventOutputs
vf:inScopeOfin_scope_of: Option<Vec<ActionHash>>PRESENT
vf:hasBeginninghas_beginning: Option<Timestamp>PRESENT
vf:hasEndhas_end: Option<Timestamp>PRESENT
vf:finishedfinished: Option<bool>PRESENT

Process is well-implemented. Extra hREA fields: before, after, classified_as, planned_within, note.


vf:RecipeProcess / ReaRecipeProcess

VF 1.0 PropertyhREA FieldStatusNotes
vf:hasRecipeInput(via links)PRESENT
vf:hasRecipeOutput(via links)PRESENT
vf:hasDuration(absent)MISSINGMeasure — planned process duration
vf:processConformsToprocess_conforms_to: Option<ActionHash>PRESENT
vf:processClassifiedAs(absent)MISSINGClassification URI

vf:Unit / ReaUnit

VF 1.0 PropertyhREA FieldStatusNotes
vf:symbolsymbol: StringPRESENT
vf:omUnitIdentifierom_unit_identifier: StringPRESENT

Extra hREA field: label (human-readable name) — not in VF core but harmless.


Action Model Gaps

VF 1.0 defines the vf:Action class with 10 effect properties. hREA implements 4.

VF 1.0 Effect PropertyhREA FieldStatusMeaning
vf:accountingEffectaccounting_effect (ActionEffect enum)PRESENTChange to rights/accounting
vf:onhandEffectonhand_effect (ActionEffect enum)PRESENTChange to physical custody
vf:inputOutputinput_output (ProcessType enum)PRESENTInput / Output / NotApplicable
vf:pairsWithpairs_with: StringPRESENTReciprocal action ID
vf:accountableEffect(absent)MISSINGChange to accountability
vf:locationEffect(absent)MISSINGChange to current location
vf:stageEffect(absent)MISSINGChange to stage/specification
vf:stateEffect(absent)MISSINGChange to state string
vf:containedEffect(absent)MISSINGChange to containedIn
vf:createResource(absent)MISSINGWhether this action creates a new resource
vf:eventQuantity(absent)MISSINGWhat quantity field(s) are used

Impact: The missing action effects mean that rule-based resource mutation (auto-updating location, stage, state, containment when an event is recorded) cannot be derived from the action definition alone. Systems consuming hREA must hardcode these rules outside the action model.

This is particularly impactful for transfer_custody (no locationEffect to auto-update current_location) and modify/accept (no stageEffect or stateEffect).


Validation Gaps

Every integrity zome validation function in vendor/hrea that should enforce VF business rules is a stub:

#![allow(unused)]
fn main() {
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}

This affects all entry types for create, update, and delete operations.

Specific rules that are absent at the DHT validation level:

RuleVF RequirementCurrent State
Action input/output constraintproduce must have output_of; consume must have input_ofUnenforced
Temporal consistencyhas_beginning must be before has_endUnenforced
Quantity signQuantities must be positiveUnenforced
Inventory effect on eventCreating a produce event should increment resource quantityNot auto-applied
Transfer agent consistencytransfer requires both provider and receiverUnenforced
Commitment satisfactionA satisfied commitment must reference a real intentUnenforced
Claim settlementA settled claim must match the original triggering eventUnenforced (Claim absent)
Action validityrea_action string must reference a known actionUnenforced at integrity level

Architectural note: Holochain's validation layer (integrity zome) is the correct place for these rules because validation runs deterministically on every peer. Leaving these as stubs means: (a) corrupted state can be written to the DHT by non-compliant clients, and (b) hREA cannot claim DHT-level VF correctness guarantees.


Naming and Structural Observations

These are not gaps but noteworthy observations for maintainers.

rea_ prefix vs vf: namespace. All hREA types use a ReaX / rea_x naming convention. This is internal to the Holochain zome layer and is correctly abstracted away by the GraphQL module. The GraphQL types should map to VF names (EconomicEvent, not ReaEconomicEvent). Verify this mapping is complete in modules/vf-graphql-holochain/.

agreed_in: Option<String> on EconomicEvent and Commitment. This field does not appear in the VF 1.0 ontology. It appears to be a legacy field or a custom extension. Its semantics overlap with realization_of (Agreement). Clarify intent and either map it to a proper VF property or document it as an hREA extension.

Proposal embeds publishes and reciprocal inline. VF 1.0 expresses these as relationships via ProposedIntent (vf:publishedIn). hREA stores them as Vec<ActionHash> directly on Proposal. This is a denormalized approach that works but diverges from the VF graph model. ProposedIntent as a separate entity is missing.

RecipeExchange vs Recipe. VF 1.0 defines a vf:Recipe class (with recipeIncludes and primaryOutput) distinct from vf:RecipeExchange. hREA's ReaRecipeExchange maps to VF's RecipeExchange but there is no equivalent of VF's Recipe wrapper class in hREA. If recipes need a primary output specification, this wrapper is needed.


Recommendations

P0 — Critical (breaks core VF workflows)

P0-1: Add vf:Claim entry type

  • Create integrity/hrea/src/rea_claim.rs with triggeredBy: ActionHash (required) and standard CRUD
  • Add settles: Option<Vec<ActionHash>> to ReaEconomicEvent
  • Add coordinator functions: create_rea_claim, get_latest_rea_claim, get_claims_triggered_by_event
  • Required for: contribution accounting in Nondominium, invoicing workflows in hAppenings

P0-2: Add effortQuantity to ReaEconomicEvent

  • Add effort_quantity: Option<QuantityValue> to the ReaEconomicEvent struct
  • Required for: all work and deliverService action events, which are the primary use case in OVN contribution tracking

P1 — Important (breaks interoperability with other VF systems)

P1-1: Add reciprocalRealizationOf to ReaEconomicEvent

  • Add reciprocal_realization_of: Option<ActionHash> referencing a ReaAgreement
  • Required for: bilateral exchange event recording (standard trade)

P1-2: Add reciprocalClauseOf to ReaCommitment

  • Add reciprocal_clause_of: Option<ActionHash> referencing a ReaAgreement
  • Required for: bilateral agreement clauses (the "I commit to X in exchange for Y" pattern)

P1-3: Add mediumOfExchange and substitutable to ReaResourceSpecification

  • Add medium_of_exchange: Option<bool> and substitutable: Option<bool>
  • Required for: Nondominium Unyt integration (§6.6 NDO spec) and hAppenings fungible offer matching

P1-4: Implement core validation rules in integrity zome

  • At minimum: action input/output constraint validation on ReaEconomicEvent creation
  • Temporal constraint: has_beginning < has_end where both present
  • The validate_create_rea_economic_event already validates foreign keys — extend it with action-based process link validation using get_builtin_action()

P1-5: Add purpose to ReaProposal

  • Add purpose: Option<String> (using a string enum: "offer" / "request") or a proper ProposalPurpose entry type
  • Required for: hAppenings Requests & Offers UI distinction between offers and requests

P2 — Significant (completes the ontology)

P2-1: Add vf:SpatialThing entry type and replace string location fields

  • Create ReaSpatialThing with mappable_address, lat, lon, alt fields
  • Replace at_location: Option<String> with at_location: Option<ActionHash> everywhere
  • This is a breaking change — requires migration logic or a versioned approach

P2-2: Add vf:BatchLotRecord entry type

  • Create ReaBatchLotRecord with batch_lot_code: String, expiration_date: Option<Timestamp>
  • Replace lot: Option<String> on ReaEconomicResource with of_batch_lot: Option<ActionHash>

P2-3: Add missing Action effect fields

  • Add location_effect, stage_effect, state_effect, contained_effect, create_resource, event_quantity to the Action struct
  • Update builtins.rs with values from VF 1.0 spec for each action
  • This enables rule-based resource mutation derivation from action definitions

P2-4: Add hasDuration and processClassifiedAs to ReaRecipeProcess

  • Add has_duration: Option<QuantityValue> (time measure) and process_classified_as: Option<Vec<String>>

P2-5: Add vf:AgreementBundle and expand ReaAgreement

  • Create ReaAgreementBundle entry type
  • Add bundled_in: Option<ActionHash> to ReaAgreement

P2-6: Add primaryLocation to ReaAgent

  • Add primary_location: Option<ActionHash> (or Option<String> if SpatialThing not yet implemented)

Appendix: Full Field Mapping Tables

Actions — 18 built-in actions present

Action IDAccounting EffectOnhand EffectI/OPairs With
dropoffDecrementDecrementOutputpickup
pickupIncrementIncrementInputdropoff
consumeDecrementDecrementInputnotApplicable
useNoEffectNoEffectInputnotApplicable
workNoEffectNoEffectInputnotApplicable
citeNoEffectNoEffectInputnotApplicable
produceIncrementIncrementOutputnotApplicable
acceptNoEffectDecrementInputmodify
modifyNoEffectIncrementOutputaccept
passNoEffectNoEffectOutputaccept
failNoEffectNoEffectOutputaccept
deliver-serviceNoEffectNoEffectOutputnotApplicable
transfer-all-rightsDecrementIncrementNoEffectNotApplicablenotApplicable
transfer-custodyNoEffectDecrementIncrementNotApplicablenotApplicable
transferDecrementIncrementDecrementIncrementNotApplicablenotApplicable
moveDecrementIncrementDecrementIncrementNotApplicablenotApplicable
raiseIncrementIncrementNotApplicablenotApplicable
lowerDecrementDecrementNotApplicablenotApplicable

All 18 VF 1.0 built-in actions are present. Action effect dimensions are missing (see Action Model Gaps above).

Entry Types — Presence Summary

VF 1.0 ClasshREA Entry TypePresent
vf:AgentReaAgentYES
vf:EconomicResourceReaEconomicResourceYES
vf:EconomicEventReaEconomicEventYES
vf:ProcessReaProcessYES
vf:CommitmentReaCommitmentYES
vf:IntentReaIntentYES
vf:AgreementReaAgreementYES
vf:PlanReaPlanYES
vf:ProposalReaProposalYES
vf:ResourceSpecificationReaResourceSpecificationYES
vf:ProcessSpecificationReaProcessSpecificationYES
vf:RecipeFlowReaRecipeFlowYES
vf:RecipeProcessReaRecipeProcessYES
vf:RecipeExchangeReaRecipeExchangeYES
vf:UnitReaUnitYES
vf:Claim(absent)NO
vf:SpatialThing(absent)NO
vf:BatchLotRecord(absent)NO
vf:AgreementBundle(absent)NO
vf:ProposalList(absent)NO

hREA defines 56 link types in the integrity zome covering: update chains (immutable), discovery anchors (AllX), process I/O links, agent-to-flow links, planning links (agreement/plan/commitment), satisfaction/fulfillment links, and recipe structure links. These are implementation-level constructs; VF 1.0 expresses these as object properties on the classes. No significant link-level gaps were identified beyond those caused by missing entry types.

nondominium Implementation Plan

1. Executive Summary

This plan details the phased implementation of the nondominium hApp, a decentralized, organization-agnostic resource management system built on Holochain and ValueFlows. The implementation builds incrementally on the existing working foundation to deliver Economic Processes, Private Participation Receipt (PPR) reputation, agent capability progression, and cross-zome coordination, while aligning with the generic Nondominium Object (NDO) model where that work is scheduled.

MVP vs post-MVP (normative boundary): Per requirements.md §2.3, the current MVP in this repository is the combination of ResourceSpecification, EconomicResource, and GovernanceRule with governance-as-operator patterns. NDO-wide requirements (three-layer model, lifecycle versus operational state, capability slots, migration, REQ-NDO-) live in ndo_prima_materia.md and are not implied by the MVP DNA until explicitly implemented. Phases 2–4 below are mostly MVP core delivery; the NDO model and migration track extends or refactors that foundation when scheduled. Post-MVP agent ontology (REQ-AGENT-, REQ-NDO-AGENT-*) is specified in requirements.md §4.4, with background analysis in archives/agent.md.

1.1 Requirements map (normative sources)

SourceRole
requirements.mdPRD; REQ-USER-, REQ-RES-, REQ-GOV-, REQ-PROC-, REQ-AGENT-* (§4.4 post-MVP agent ontology)
ndo_prima_materia.mdNDO layers (L0/L1/L2), lifecycle and operational state, capability surface, COP framing; REQ-NDO-* (§9), migration (§10)
ui_design.mdUI specifications (complements specifications/ui_architecture.md)
post-mvp/unyt-integration.mdUnyt / RAVE / economic agreement slots (REQ-NDO-CS-07–CS-11)
post-mvp/flowsta-integration.mdFlowsta identity slots and Tier 1/2 governance (REQ-NDO-CS-12–CS-15)
post-mvp/many-to-many-flows.mdN-ary custody and ValueFlows events; plan after shared custody / AgentContext model matures
post-mvp/versioning.mdVersion DAG for resources and app-as-resource; complements REQ-NDO-L1-03 (multiple specs per NDO)
post-mvp/digital-resource-integrity.mdManifests and verifiable digital assets; aligns with Layer 1 DigitalAsset capability slots (prima materia §9.2)
post-mvp/resource-transport-flow-protocol.mdMulti-dimensional transport/flow semantics over economic events
post-mvp/valueflows-dsl.mdDSL for recipes, bulk bootstrap, scripted coordination (operational tooling track)
post-mvp/lobby-dna.mdMulti-network federation: Lobby DNA (public registry), Group DNA (per-group coordination), NDO DNA extensions (NdoHardLink, Contribution, Agreement); dual deployment (standalone + Moss applet) — REQ-LOBBY-, REQ-GROUP-, REQ-NDO-EXT-*
archives/resources.md, archives/governance.mdOntology and gap-analysis context (non-normative for REQ IDs)

2. Implementation Principles

  • Incremental Enhancement: Build on existing working code without breaking changes, extending functionality through new modules and functions
  • ValueFlows Compliance: All data structures and flows adhere to the ValueFlows standard with Economic Process integration
  • Agent-Centric Design: All data and validation flows from the perspective of individual agents with capability progression
  • Progressive Trust: Agents earn capabilities through validation (Simple → Accountable → Primary Accountable Agent) with PPR reputation tracking
  • Embedded Governance: Rules and access control are enforced at the resource and agent level with Economic Process integration
  • Capability-Based Security: All access is managed through Holochain capability tokens with role-based process access
  • Privacy-Preserving Accountability: PPR system enables reputation without compromising privacy through selective disclosure
  • Process-Aware Infrastructure: Economic Processes (Use, Transport, Storage, Repair) integrated throughout the system architecture
  • NDO alignment: When implementing the NDO track, follow pay-as-you-grow layer activation (L0 identity always on; L1 specification and L2 process when complexity demands) and keep LifecycleStage (on identity) orthogonal to OperationalState (on resource instances), with the governance zome as state-transition operator (REQ-NDO-LC-02, REQ-NDO-OS-02)

3. Architecture alignment (NDO prima materia)

The three-layer model (ndo_prima_materia.md §4) structures resources as:

  • Layer 0 — Identity: NondominiumIdentity (stable anchor, tombstone at end of life); only lifecycle_stage evolves after creation (REQ-NDO-L0-*).
  • Layer 1 — Specification: Activated by NDOToSpecificationResourceSpecification (governance rules, discoverable form); may be dormant/archived while L0 remains (REQ-NDO-L1-*).
  • Layer 2 — Process: Activated by NDOToProcess → ValueFlows Process; hosts commitments, claims, events, PPRs (REQ-NDO-L2-*).

Two state dimensions (§5): LifecycleStage lives on the identity (maturity of the artefact); OperationalState lives on EconomicResource (transient process condition). Transitions on one must not imply transitions on the other (REQ-NDO-OS-04).

flowchart TB
  subgraph layers [Layer_stack]
    L2[Layer2_Process]
    L1[Layer1_Specification]
    L0[Layer0_Identity_always_on]
    L0 --> L1
    L1 --> L2
  end

4. Implementation tracks

Work below is grouped into parallel tracks so MVP delivery, NDO migration, agent ontology, integrations, and extended specs are not confused as a single serial timeline.

TrackIntentPrimary references
MVP corePhases 2–4 in Section 5: private data sharing, economic processes, PPR, promotion, security, cross-zome coordinationrequirements.md REQ-USER / REQ-PROC / REQ-GOV
NDO model and migrationNondominiumIdentity, NDOToSpecification / NDOToProcess, holonic links, CapabilitySlot, lifecycle plus operational split, faceted discovery links, one-time migration (REQ-NDO-MIG-*)ndo_prima_materia.md §§8–10, §9
Agent ontologyREQ-AGENT-* / REQ-NDO-AGENT-* items under Phases 2–4requirements.md §4.4; archives/agent.md for OVN background
Unyt / FlowstaPhased integration; governance enforcement in later phasesSection 12.2–12.3; REQ-NDO-CS-07–CS-15
Extended post-MVPMany-to-many flows, versioning, digital integrity, RTP-FP, VF DSL, Lobby DNA federation layer — reference and ordering only in Section 12.5–12.6documentation/requirements/post-mvp/*.md

Phase 2.2 and the NDO track: Checklists for LifecycleStage / OperationalState, split discovery links, and process-aware resource work implement REQ-NDO-LC-, REQ-NDO-OS-, and parts of REQ-NDO-L2-* once NondominiumIdentity and NDO links exist; until then, some items remain preparatory. Full L0-first creation and migration follow Section 12.1 and REQ-NDO-MIG-*.


5. Implementation Phases

Phase 1: Foundation Layer ✅ COMPLETED (Existing Working Code)

3.1 Agent Identity & Role System (zome_person) ✅ COMPLETED

  • Implement Person (public info) and PrivateData (private entry, PII).
  • Implement PersonRole entry with validation metadata and links to validation receipts.
  • Modular Architecture: Refactored into person.rs, private_data.rs, role.rs modules
  • Comprehensive Error Handling: PersonError enum with detailed error types
  • Core Functions: Profile management, role assignment, private data storage
  • Testing: Comprehensive test suite with foundation, integration, and scenario tests

3.2 Resource Management (zome_resource) ✅ COMPLETED

  • Implement ResourceSpecification with embedded governance rules.
  • Implement EconomicResource with custodian tracking and state management.
  • Modular Architecture: Refactored into resource_specification.rs, economic_resource.rs, governance_rule.rs
  • Comprehensive Error Handling: ResourceError enum with governance violation support
  • Signal System: Complete post-commit signal handling for DHT coordination
  • Core Functions: Resource specification and economic resource CRUD operations
  • Testing: Comprehensive test suite with integration and scenario coverage

3.3 Governance Foundation (zome_gouvernance) ✅ CORE COMPLETE

  • Basic VfAction Enum: Type-safe economic action vocabulary
  • Validation Infrastructure: ValidationReceipt creation and management
  • Economic Event Logging: Basic economic event recording
  • Cross-Zome Functions: Core validation functions for resource and agent validation
  • Error Handling: GovernanceError enum with comprehensive error types

Phase 2: Enhanced Governance & Process Integration 🚀 HIGH PRIORITY

2.1 Enhanced Private Data Sharing (zome_person) 📋 NEXT SPRINT

Building on existing private data infrastructure without breaking changes

  • Data Access Request System (NEW):
    • DataAccessRequest entry type with status tracking
    • request_private_data_access() function for requesting specific fields
    • respond_to_data_request() function for approving/denying requests
    • Bidirectional linking system for request tracking
  • Data Access Grant System (NEW):
    • DataAccessGrant entry type with expiration and field control
    • grant_private_data_access() function for direct grants
    • get_granted_private_data() function for accessing granted data
    • revoke_data_access_grant() function for revoking access
  • Governance Integration (NEW):
    • get_private_data_for_governance_validation() function for cross-zome access
    • Agent promotion workflow integration with private data validation
    • Enhanced role validation with identity verification

2.2 Economic Process Infrastructure (zome_resource) 📋 CURRENT SPRINT

Extending existing resource management with process-aware workflows. NDO track overlap: state split and discovery links map to REQ-NDO-LC-, REQ-NDO-OS-, REQ-NDO-OS-06; process and PPR linkage align with REQ-NDO-L2-* once Layer 2 is modeled via NDOToProcess (see ndo_prima_materia.md §4.4).

  • Economic Process Data Structures (NEW):
    • EconomicProcess entry type with status tracking and role requirements
    • ProcessStatus enum (Planned, InProgress, Completed, Suspended, Cancelled, Failed)
    • Split ResourceState into LifecycleStage + OperationalState (see ndo_prima_materia.md Section 5):
      • LifecycleStage enum on NondominiumIdentity (Layer 0) — maturity/evolutionary phase
      • OperationalState enum on EconomicResource (Layer 2) — current process condition (Available, Reserved, InTransit, InStorage, InMaintenance, InUse, PendingValidation)
      • Update governance zome state transition logic to manage both enums independently
      • Split ResourcesByState link type into ResourcesByLifecycleStage and ResourcesByOperationalState
    • OperationalState transitions aligned with process outcomes (begin/end of transport, storage, maintenance processes)
  • Process Management Functions (NEW):
    • initiate_economic_process() with role-based access control
    • complete_economic_process() with state change validation
    • Process query functions by type, status, and agent
    • Process-resource relationship tracking
  • Enhanced Cross-Zome Integration (EXTEND):
    • Role validation calls to person zome for process initiation
    • Governance zome integration for process validation and PPR generation
    • Private data coordination for custody transfers

2.3 Private Participation Receipt (PPR) System (zome_gouvernance) 🌟 MAJOR FEATURE

Adding comprehensive reputation system on top of existing governance infrastructure

  • PPR Data Structures (NEW):
    • PrivateParticipationClaim entry type (private entry)
    • ParticipationClaimType enum with 16 claim categories
    • PerformanceMetrics structure for quantitative assessment
    • CryptographicSignature structure for bilateral authentication
  • PPR Management Functions (NEW):
    • issue_participation_receipts() for bi-directional PPR issuance
    • sign_participation_claim() for cryptographic verification
    • validate_participation_claim_signature() for authenticity validation
    • get_my_participation_claims() for private receipt retrieval
    • derive_reputation_summary() for privacy-preserving reputation calculation
  • Process Integration (NEW):
    • Automatic PPR generation for all Commitment-Claim-Event cycles
    • Economic Process completion triggers specialized PPR categories
    • Agent promotion generates appropriate PPR types

2.4 Complete Agent Capability Progression 🎯 GOVERNANCE CRITICAL

Implementing the full Simple → Accountable → Primary Accountable Agent progression

  • Enhanced Agent Promotion (EXTEND existing promote_agent_to_accountable):
    • Cross-zome coordination with governance validation
    • Private data quality assessment for promotion eligibility
    • Automatic PPR generation for promotion activities
    • Capability token progression (general → restricted → full)
  • Specialized Role Validation (EXTEND existing role assignment):
    • Enhanced role validation for Transport, Repair, Storage roles
    • Primary Accountable Agent validation requirements
    • Role-specific PPR generation for validation activities
  • Cross-Zome Validation Workflows (NEW):
    • Resource validation during first access events
    • Agent identity validation with private data verification
    • Specialized role validation with existing role holder approval

Agent Ontology Items (Post-MVP, Phase 2 — see requirements.md §4.4 and archives/agent.md §5.3; REQ-AGENT-*):

  • [G13] Fix request_role_promotion stub (HIGH PRIORITY — broken workflow):
    • Create a real RolePromotionRequest entry type in zome_person integrity, replacing the current placeholder hash return
    • Add AllPromotionRequests anchor link for approver discovery
    • Add AgentToPromotionRequest and PromotionRequestToAgent bidirectional links
    • Implement get_pending_promotion_requests() query function for authorised approvers
    • See REQ-AGENT-16 and code TODO in role.rs
  • [G6] AffiliationRecord entry type (NEW):
    • Define AffiliationRecord struct: agent, network_id, documents_acknowledged: Vec<DocumentAck>, signed_at, signature, witness: Option<AgentPubKey>
    • Define DocumentAck struct: document_hash, document_title, document_version
    • Implement create_affiliation_record(input) — agent cryptographically signs ToP, Nondominium & Custodian agreement, Benefit Redistribution Algorithm
    • Link: agent_pubkey → affiliation_record_hash (AgentToAffiliation)
    • UI: prompt agent to create AffiliationRecord during Person creation flow
    • See REQ-AGENT-05
  • [G2] Derived affiliation state (NEW — computed, not stored):
    • Implement get_affiliation_state(agent_pubkey) -> AffiliationState as a composed query:
      • UnaffiliatedStranger: no Person entry
      • CloseAffiliate: Person exists but no AffiliationRecord and zero contributions
      • ActiveAffiliate: AffiliationRecord exists + tracked contributions (economic events) within configurable recency window
      • CoreAffiliate: ActiveAffiliate whose PPR-derived contribution rate exceeds configurable threshold
      • InactiveAffiliate: AffiliationRecord exists, previously active, but no contributions within recency window
    • Expose affiliation state as part of get_person_profile() response
    • Use affiliation state in governance access decisions (Active/Core affiliates for governance participation)
    • See REQ-AGENT-04

Phase 3: Advanced Security & Cross-Zome Coordination 🔒 PRODUCTION READINESS

3.1 Enhanced Capability-Based Security

Building on existing capability infrastructure with Economic Process integration

  • Progressive Capability Tokens (EXTEND):
    • general_access tokens for Simple Agents (existing foundation)
    • restricted_access tokens for Accountable Agents (PPR-enabled)
    • full_access tokens for Primary Accountable Agents (custodianship-enabled)
    • Automatic capability progression triggered by PPR milestones
  • Economic Process Access Control (NEW):
    • Role-based process access validation (Transport, Repair, Storage)
    • Dynamic capability checking for specialized Economic Processes
    • PPR-derived reputation influencing process access permissions
  • Function-Level Security (EXTEND):
    • Apply capability requirements to all new Economic Process functions
    • Enhanced private data access control with granular field permissions
    • Cross-zome capability validation for complex workflows

Agent Ontology Items (Post-MVP, Phase 3 — see requirements.md §4.4 and archives/agent.md §5.3; REQ-AGENT-*):

  • [G1] AgentEntityType configuration (NEW):
    • Define AgentEntityType enum in zome_person integrity: Individual, Collective(String), Project(ActionHash), Network(ActionHash), Bot { capabilities: Vec<String>, operator: AgentPubKey }, ExternalOrganisation(String)
    • Define AgentContext entry: agent_type: AgentEntityType, person_hash: Option<ActionHash>, created_at, network_seed
    • Collective, Project, and Network types reference an NDO hash — no separate Person entry required
    • Update governance role-gating logic to account for non-individual agent types
    • See REQ-AGENT-01, REQ-AGENT-02
  • [G15] CapabilitySlot on Person (NEW):
    • Implement CapabilitySlot link type from Person entry hash to external capability targets (DID documents, credential wallets, reputation oracles)
    • Reuse CapabilitySlotTag / SlotType pattern from ndo_prima_materia.md §8.3 — same pattern applied at agent identity level
    • Implement attach_agent_capability_slot(person_hash, slot_type, target_hash) and get_agent_capability_slots(person_hash)
    • See REQ-AGENT-11
  • [G3] Composable AgentProfile view (NEW):
    • Implement get_agent_profile(agent_pubkey) -> AgentProfile as a composed query — NOT a new stored entry:
      • Identity: AgentPubKey, Person, AffiliationState, AgentEntityType
      • Capability: roles: Vec<PersonRole>, capability_level, capability_slots: Vec<CapabilitySlotInfo>
      • Reputation: reputation_summary: Option<ReputationSummary>, economic_reliability_score: Option<f64>
      • Participation: active_commitments_count, economic_events_count, resource_custodianships_count
      • Social: network_affiliations: Vec<NetworkAffiliation>, peer_vouches: Option<u32>
      • Temporal: joined_at, last_active_at
    • Agent controls which sections are exposed by granting access to constituent entries
    • See REQ-AGENT-07
  • [G4] AgentRelationship link type (NEW):
    • Define bidirectional AgentRelationship link type with typed tags: Colleague, Collaborator, Trusted, Voucher
    • Store as private links (agent-to-agent, not publicly discoverable)
    • Implement create_agent_relationship(target, relationship_type) and get_my_relationships()
    • See REQ-AGENT-08
  • [G5] Network affiliation links (NEW):
    • Define NetworkAffiliation link type from Person hash to NDO instance hashes
    • Implement add_network_affiliation(person_hash, ndo_hash, affiliation_type) and get_network_affiliations(person_hash)
    • An agent's multi-network membership is visible as part of the composable AgentProfile
    • See REQ-AGENT-09
  • [G14] Configurable role taxonomy (NEW):
    • Define RoleDefinition entry type: role_name, capability_level, description, validation_requirements, network_id
    • Replace hard-coded RoleType enum with RoleDefinition registry; predefined six roles created as default entries at network genesis
    • Update assign_person_role to accept any role name present in the network's RoleDefinition registry
    • See REQ-AGENT-06
  • [G1+Resource] Collective agent custodianship (NEW — resource-agent integration):
    • Define AgentContext union type usable wherever AgentPubKey currently identifies a custodian or initiator
    • Update EconomicResource.custodian from AgentPubKey to AgentContext
    • Update TransitionContext.target_custodian from Option<AgentPubKey> to Option<AgentContext>
    • Update NondominiumIdentity.initiator from AgentPubKey to AgentContext
    • Update custody transfer validation to handle collective agent auth (no single private key — requires collective signature or designated operator key)
    • See REQ-AGENT-02, resources.md §5.3, governance-operator-architecture.md §2.1
  • [G2+Resource] Affiliation-gated resource access (NEW — resource-agent integration):
    • Extend GovernanceRule.rule_data JSON schema to support min_affiliation condition: "min_affiliation": "ActiveAffiliate" | "CoreAffiliate"
    • Extend governance zome evaluate_transition to cross-zome query zome_person for requesting agent's AffiliationState when min_affiliation is present in an applicable GovernanceRule
    • Surface affiliation state as an enumerated result field in GovernanceDecision.role_permissions entries
    • Add affiliation_gated_access: bool flag to governance defaults engine output so UIs can surface relevant access requirements
    • Write integration tests: agent with UnaffiliatedStranger state rejected for min_affiliation: ActiveAffiliate governed resource; ActiveAffiliate agent accepted
    • See REQ-AGENT-03, REQ-AGENT-05, resources.md §5.3 (Affiliation-gated resource access row), governance-operator-architecture.md §2.1 TODO G2

Governance Agent Ontology Integration (Post-MVP, Phase 3 — see governance.md §3.6, §6.4, §6.6):

  • [G1+Governance] Extend core governance entry types to AgentContext:
    • GovernanceTransitionRequest.requesting_agent: AgentPubKeyAgentContext
    • ResourceStateChange.initiated_by: AgentPubKeyAgentContext
    • ValidationReceipt.validator: AgentPubKeyAgentContext
    • EconomicEvent.provider and .receiver: AgentPubKeyAgentContext
    • Commitment.provider and .receiver: AgentPubKeyAgentContext
    • PrivateParticipationClaim.counterparty: AgentPubKeyAgentContext
    • Implement AgentContextsigning_key resolution: for Individual = the key itself; for Collective = designated PrimaryAccountableAgent key from collective NDO; for Bot = operator AgentPubKey
    • See REQ-GOV-16, governance.md §3.6.1, §6.6
  • [G6+Governance] AffiliationRecord governance ceremony:
    • Implement create_affiliation_record() in governance zome using Commitment/EconomicEvent cycle
    • Create AffiliationRecordSigned PPR (bilateral, private) on ceremony completion
    • Ensure AffiliationState derivation in zome_person reads AffiliationRecord presence from DHT
    • See REQ-GOV-15, governance.md §3.6.3, §4.4
  • [G2+Governance] Affiliation-gated governance access:
    • Extend governance evaluate_transition to check GovernanceRule.rule_data["min_affiliation"] specifically for GOVERNANCE PARTICIPATION (distinct from resource access gating)
    • Implement governance_weight formula from governance.md §6.4: affiliation_state gate → 0 if < ActiveAffiliate; core_multiplier if CoreAffiliate
    • See REQ-GOV-14, governance.md §6.4

3.2 Comprehensive Cross-Zome Coordination

Ensuring atomic operations and consistency across the three-zome architecture

  • Transaction Consistency (NEW):
    • Atomic custody transfer operations spanning resource and governance zomes
    • Economic Process completion consistency across resource and governance validation
    • PPR generation consistency with resource state changes
  • Error Handling Coordination (EXTEND):
    • Standardized error translation between zomes (implemented in docs)
    • Rollback mechanisms for failed cross-zome operations
    • Comprehensive error context preservation across zome boundaries
  • State Synchronization (NEW):
    • Resource state changes coordinated with Economic Process status
    • Agent capability progression synchronized with PPR generation
    • Role assignments coordinated with governance validation workflows

3.3 Advanced Validation & Dispute Resolution

Building on basic validation infrastructure with sophisticated governance

  • Enhanced Validation Schemes (EXTEND):
    • 2-of-3, N-of-M reviewer support with PPR-weighted selection
    • Reputation-based validator selection for Economic Process validation
    • Multi-tiered validation for different resource and process types
  • Dispute Resolution Infrastructure (NEW):
    • Edge-based dispute resolution involving recent interaction partners
    • PPR-based reputation context for dispute resolution
    • Private data access coordination for dispute mediation
  • Governance Rule Enforcement (NEW):
    • Dynamic governance rule evaluation for Economic Processes
    • Conditional logic support for complex resource access rules
    • Community-driven governance parameter adjustment

Phase 4: Network Maturity & Advanced Features 🌐 SCALING & OPTIMIZATION

4.1 Advanced Economic Process Workflows

Building sophisticated process chaining and automation on established foundation

  • Process Chaining & Automation (NEW):
    • Multi-step Economic Process workflows (Transport → Repair → Transport)
    • Conditional process logic based on resource state and agent performance
    • Automated process matching and agent selection based on PPR reputation
  • Advanced Resource Management (EXTEND):
    • Resource booking and reservation system for Economic Processes
    • Time-based resource availability and process scheduling
    • Multi-agent process coordination and collaborative workflows
  • Performance Analytics (NEW):
    • Economic Process performance tracking and optimization recommendations
    • Resource utilization analytics and efficiency metrics
    • Agent performance trends and specialization insights

Agent Ontology Items (Post-MVP, Phase 4 — see requirements.md §4.4 and archives/agent.md §5.3; REQ-AGENT-*):

  • [G8] PortableCredential structure and export (NEW):
    • Define PortableCredential struct: issuing_network (DNA hash), agent, credential_type: PortableCredentialType, claims, issued_at, valid_until, issuer_signature, agent_signature
    • PortableCredentialType variants: RoleCredential(String), ReputationCredential, CompetencyCredential(String), AffiliationCredential
    • Implement issue_portable_credential(agent, credential_type) — requires PrimaryAccountableAgent issuer + agent countersign
    • Implement verify_portable_credential(credential) — validates both signatures against issuing network DNA hash
    • See REQ-AGENT-12 and REQ-PPR-15
  • [G7] ZKP capability proofs (NEW — requires external ZKP library integration):
    • Research and select ZKP library compatible with Holochain WASM compilation target (e.g., bellman, arkworks, or ZKP-compatible VC layer)
    • Define prove_capability(condition: CapabilityCondition) -> ZKProof — e.g., "I have ≥ N claims of type T" without revealing counterparties or timestamps
    • Allow governance functions to accept ZKProof in lieu of raw ReputationSummary for access decisions
    • See REQ-AGENT-13 and REQ-PPR-14
  • [G9] Sybil resistance mechanism (NEW — configurable per network):
    • Option A — Social vouching: N existing ActiveAffiliate agents must co-sign a new agent's AffiliationRecord
    • Option B — Biometric opt-in: integrate with external biometric verification service; store proof hash in AffiliationRecord
    • Option C — Proof-of-Personhood: integrate with existing PoP protocols (e.g., Proof of Humanity, Worldcoin) as membrane proof
    • Network genesis configuration selects which option(s) apply
    • See REQ-AGENT-15
  • [G10] Pseudonymous participation mode (NEW):
    • Allow ephemeral AgentPubKey to contribute without creating a Person entry or AffiliationRecord
    • PPRs are issued to the ephemeral key; reputation accumulates but is unlinkable to physical identity
    • Agent can optionally link an ephemeral key to their main Person entry later (explicit opt-in de-anonymisation)
    • See REQ-AGENT-14
  • [G11] AI/bot delegation (DelegatedAgent) (NEW):
    • Define DelegatedAgent entry: delegating_person: AgentPubKey, delegate_key: AgentPubKey, scope: Vec<String>, valid_until: Timestamp, signature
    • Bot/AI keys act within declared scope; their actions are attributed to the delegating person for PPR purposes
    • See REQ-AGENT-03
  • [G12] AgentNeedsWants profile extension (NEW):
    • Define optional AgentNeedsWants entry: needs: Vec<ResourceNeed>, offers: Vec<ResourceOffer>, updated_at
    • Link from Person hash; update via update_agent_needs_wants(input)
    • Enable network-level matching: find_matching_agents(resource_type, quantity) queries NeedsWants entries
    • See REQ-AGENT-10

4.2 Advanced PPR & Reputation Systems

Enhancing the reputation system with AI and cross-network capabilities

  • Advanced Reputation Algorithms (EXTEND):
    • Machine learning-based trust prediction and recommendation systems
    • Context-aware reputation weighting for different Economic Process types
    • Dynamic reputation thresholds based on network maturity and agent density
  • Cross-Network Reputation (NEW):
    • PPR reputation portability across multiple nondominium networks
    • Federated identity management with reputation synchronization
    • Inter-network agent validation and reputation verification
  • Reputation-Based Governance (NEW):
    • Dynamic capability levels based on PPR-derived reputation scores
    • Reputation-weighted validation schemes for community governance
    • Automated role progression based on performance metrics and community recognition

4.3 Performance & Scalability Optimization

Optimizing the system for large-scale network operation

  • DHT & Query Optimization (EXTEND):
    • Advanced DHT anchor strategies for efficient Economic Process discovery
    • Parallel validation processing for large-scale governance operations
    • Caching strategies for frequently accessed PPR and reputation data
  • Network Health & Monitoring (NEW):
    • Real-time network health dashboards and metrics
    • Automated performance bottleneck detection and resolution
    • Predictive scaling based on Economic Process demand patterns
  • Cross-Zome Performance (OPTIMIZE):
    • Optimized cross-zome call patterns for complex workflows
    • Batched operations for multiple Economic Process coordination
    • Efficient state synchronization across distributed agent networks

6. Quality Assurance

  • Test-Driven Development: Write tests before implementation.
  • Incremental Integration: Continuous integration between zomes.
  • Documentation-First: Update specs before coding changes.
  • Unit, Integration, and Network Testing: Validate all workflows, especially validation and promotion.

5. Risk Mitigation

  • Cross-Zome Dependencies: Mitigated by interface design and testing.
  • Validation Complexity: Addressed through modular validation functions.
  • Performance Bottlenecks: Handled via incremental optimization and monitoring.
  • Validation Gaming: Prevented through multi-reviewer schemes and audit trails.

8. Success Metrics & Implementation Tracking

Phase 1 Achievements ✅ FOUNDATION COMPLETE

  • Person Management: Complete agent identity system with public/private data separation
  • Resource Management: Full resource specification and economic resource lifecycle
  • Governance Foundation: Basic validation infrastructure and cross-zome functions
  • Modular Architecture: Clean separation of concerns across all three zomes
  • Comprehensive Testing: Foundation, integration, and scenario test coverage
  • Error Handling: Robust error types and proper DHT signal handling

Phase 2 Targets 🎯 GOVERNANCE & PROCESSES

  • Enhanced Private Data Sharing: Request/grant workflows with time-limited grants (30-day maximum per capability metadata) and field-specific control
  • Economic Process Infrastructure: Four structured processes (Use, Transport, Storage, Repair) with role-based access
  • PPR Reputation System: Bi-directional Private Participation Receipts with cryptographic signatures
  • Agent Capability Progression: Complete Simple → Accountable → Primary Accountable Agent advancement
  • Cross-Zome Integration: Seamless coordination across person, resource, and governance zomes
  • Validation Workflows: Resource validation, agent promotion, and specialized role validation operational

Phase 3 Targets 🔒 PRODUCTION SECURITY

  • Progressive Capability Security: Automatic capability token progression based on PPR milestones
  • Economic Process Access Control: Role-validated access to specialized processes with reputation influence
  • Transaction Consistency: Atomic operations across all three zomes with comprehensive rollback
  • Advanced Validation Schemes: PPR-weighted validator selection and reputation-based consensus
  • Dispute Resolution: Edge-based conflict resolution with PPR context and private data coordination

Phase 4 Targets 🌐 NETWORK MATURITY

  • Advanced Process Workflows: Multi-step process chaining with automated agent selection
  • AI-Enhanced Reputation: Machine learning-based trust prediction and context-aware weighting
  • Cross-Network Integration: PPR portability and federated identity management
  • Performance Optimization: Large-scale network operation with predictive scaling
  • Community Governance: Reputation-weighted validation and automated role progression

7. UI Development Plan 🎨

Current Frontend Status

  • MVP UI: ✅ Implemented — persistent Lobby sidebar + Group panel + NDO detail page with full NDO lifecycle management, Join NDO placeholder ("Coming soon"), Associate with group modal (localStorage-backed ndo_groups_v1), fork friction modal, and reliable NDO data display via cache + DHT refresh
  • Stack: SvelteKit 2 + Svelte 5 runes + TypeScript + UnoCSS + Melt UI next-gen + Effect-TS
  • Service Layer: ✅ Complete (PR #97 + MVP UI work) — all three zome services + NDO/Lobby services with Effect-TS Context.Tag / Layer / E.gen pattern
  • Architecture reference: documentation/specifications/ui_architecture.md

Phase 1: Foundation UI ✅ COMPLETE

  • SvelteKit + UnoCSS + Melt UI next-gen: Fully scaffolded (see vite.config.ts, uno.config.ts)
  • Effect-TS service layer: All three zome services + NdoService + LobbyService (PR #97 + MVP UI)
  • HolochainClientService: wrapZomeCallWithErrorFactory pattern, Context.Tag injection

Phase 2: MVP UI — Lobby → Group → NDO ✅ COMPLETE

Implements documentation/requirements/ui_design.md MVP section and reconciled requirements from GitHub Issue #102. Includes UI-restructure sprint that made the Lobby the persistent outer shell and fixed NDO data display.

Foundation (initial delivery)

  • Three-level identity model: LobbyUserProfile (localStorage), GroupMemberProfile (localStorage), Person (DHT on first action) — documentation/requirements/agent.md §2
  • Shared types: NdoInput, UpdateLifecycleStageInput, NdoTransitionHistoryEvent, LobbyUserProfile, GroupMemberProfile, extended GroupDescriptor and NdoDescriptor; PropertyRegime reduced to 4 canonical variants (Private, Commons, Nondominium, CommonPool) — packages/shared-types/src/resource.types.ts
  • NDO service methods: createNdo, updateLifecycleStage, getNdoTransitionHistory, getGroupNdoDescriptors, getLobbyNdoDescriptorsndo.service.ts
  • Resource service methods: createNdo, getNdo (return type corrected to NondominiumIdentity | null matching Rust Option<NondominiumIdentity>), updateLifecycleStage, filtered queries, history — resource.service.ts
  • Lobby service (localStorage): getMyGroups, createGroup, joinGroup, generateInviteLinklobby.service.ts
  • app.context: lobbyUserProfile state with localStorage hydration
  • lobby.store: activeFilters, filteredNdos, createGroup, joinGroup; loadLobby() now invoked from root layout
  • group.store: group, groupNdos, loadGroupData, createNdo, associateNdoWithGroup (append spec hash to GroupDescriptor.ndoHashes in localStorage; TODO hook for Group DHT when DNA lands)
  • ndo-cache.ts (new): in-memory descriptor cache keyed by hash; populated on card click to seed NDO page instantly
  • UserProfileForm.svelte: Lobby profile create/edit, modal + page modes, nickname required
  • GroupProfileModal.svelte: Per-group disclosure preferences (first visit only)
  • NdoBrowser.svelte: Multi-select filter chips (LifecycleStage × ResourceNature × PropertyRegime 4 variants)
  • NdoCard.svelte: Populates ndo-cache before navigating to NDO page
  • NdoCreateModal.svelte: 5-field form (4-variant regime), uniqueness check, Effect-TS errors, navigation on success
  • NdoIdentityLayer.svelte: Initiator profile link, lifecycle transition button (initiator-only), TransitionHistoryPanel; 4-variant regime color map
  • LifecycleTransitionModal.svelte: Full state machine, Deprecated/Hibernating special cases
  • TransitionHistoryPanel.svelte: Collapsible history panel with copy-to-clipboard
  • ForkNdoModal.svelte: Informational fork friction modal, copy-pubkey CTA
  • AssociateNdoModal.svelte: multi-select modal of groups not already linked to this NDO; confirms via associateNdoWithGroup (see MVP ToDo in ui_design.md for DHT propagation)

UI-restructure sprint (persistent Lobby shell)

  • +layout.svelte (root): onMount initialises agent key, calls loadLobby(), triggers first-time profile modal if no lobby profile exists — ensures sidebar data available on every route
  • Sidebar.svelte (rewritten as LobbySidebar): Browse NDOs link, live groups list (/group/:id), inline "+ New Group" form, inline "→ Join Group" form, "My Profile / Edit profile" at bottom; global "New NDO" link removed (creation is group-scoped only)
  • LobbyView.svelte (simplified): removed GroupSidebar and onMount data loading; renders page header + NdoBrowser only; $effect no longer assigns appContext.currentView = 'lobby' (that clobbered the NDO route when both Lobby and NDO views were reactive); currentView is set where the routed page applies (e.g. NdoView sets 'ndo')
  • GroupView.svelte: replaced onMount with $effect so group name and NDO list reload correctly when navigating between groups via the sidebar
  • NdoView.svelte (extended): NDO detail card (Description, Property Regime, Resource Nature, Lifecycle Stage, Created); loading skeleton; retry-able error banner; Join NDO placeholder (inline "Coming soon"); Associate with a group (always visible header button → AssociateNdoModal); Fork button (Holochain + agent connected); descriptor seeded from ndo-cache, refreshed from DHT in background; $effect that sets selectedNdoId must decode into a local hash variable — assigning selectedNdoId = specActionHash immediately after mutating $state(specActionHash) created a self-referential dependency and effect_update_depth_exceeded (broken header buttons); fixed by passing the local Uint8Array reference only
  • /group/[id] route: ?createNdo=1 query param still supported
  • /ndo/new route: redirects to active group or shows instruction screen

Phase 3: Service Layer (Post-MVP) 🏗️

  • PersonService extensions: DataAccessRequest / DataAccessGrant workflows
  • ResourceService: Economic Process initiation + state management + custody transfers
  • GovernanceService: PPR management + reputation calculation
  • ProcessService: Economic Process lifecycle (initiate, track, complete, chain)
  • ReputationService: PPR retrieval + selective disclosure

Phase 4: Store Architecture Extensions 📊

  • PersonStore: Private data sharing + capability progression
  • ProcessStore: Economic Process workflows + status tracking
  • ReputationStore: PPR management + reputation calculation + selective sharing
  • ValidationStore: Validation status + approval processes

Phase 5: Advanced UI Components 🖼️

  • Person management components: Profile + private data sharing + role progression + reputation display (issue #8)
  • Economic Process Workflows: Process initiation + tracking + completion + chaining interface (issues #28–#32)
  • Governance & Validation Interface: Validation workflows + PPR generation + reputation context
  • Role-Based Dynamic UI: Progressive capability unlocking + specialized process access
  • Reputation Dashboard: PPR tracking + summaries + selective disclosure controls (issue #22)

Phase 6: Group DNA Backend & Post-MVP UI 🌐

  • Group DNA backend: When zome_group lands, replace LobbyService localStorage with real DNA calls — all component + store logic remains identical (see implementation_plan.md §12.6)
  • NDO cell cloning: Per-NDO DHT, once Holochain cloning stabilises
  • Fork submission flow: Claim, vote, and Unyt stake (after Unyt integration §12.2)
  • Moss WeApplet: ui/src/we-applet.tssearch, getAssetInfo, openAsset (see §12.6)

10. Enhanced Roadmap & Future Enhancements

Immediate Development Priorities (Next 6 Months)

  • Phase 2.1: Enhanced private data sharing system implementation
  • Phase 2.2: Economic Process infrastructure with four process types
  • Phase 2.3: Private Participation Receipt system with reputation tracking
  • UI Phase 1-2: Foundation UI with Economic Process and PPR support

Medium-Term Enhancements (6-18 Months)

  • Phase 3: Production security with progressive capability tokens
  • Phase 4.1: Advanced process workflows and automation
  • NDO migration track (when scheduled): L0-first resource creation, retroactive anchoring, capability slots — Section 12.1 and REQ-NDO-MIG-*
  • Cross-Network Integration: Federated nondominium networks with PPR portability
  • Mobile Interface: Progressive Web App with full Economic Process support

Long-Term Vision (18+ Months)

  • AI-Enhanced Governance: Machine learning-based validation and process optimization
  • Interoperability: Deep integration with other ValueFlows and commons-based systems
  • Network Federation: Multi-network reputation and resource sharing protocols
  • Governance Evolution: Community-driven rule evolution with reputation-weighted decision making

Success Indicators

  • Network Health: >1000 active agents with >90% successful Economic Process completion
  • Reputation System: >80% agent participation in PPR system with meaningful reputation differentiation
  • Process Efficiency: Average Economic Process completion time <24 hours with automated matching
  • Community Governance: >70% community validation participation with dispute resolution <1% of transactions
  • NDO readiness (when the track is active): new resources created via L0; legacy specs migrated without data loss; independent queries for lifecycle versus operational facets (REQ-NDO-MIG-01–MIG-05, REQ-NDO-OS-06)

11. Implementation Strategy Summary

This enhanced implementation plan transforms the nondominium hApp from a foundational resource management system into a comprehensive, production-ready ecosystem for decentralized commons governance. The plan:

MVP core (near-term)

  • Ship user-visible flows in Section 5 Phases 2–4: private data access, four economic process types, PPR issuance and reputation summaries, promotion and specialized roles, capability hardening, and cross-zome consistency — measured against REQ-USER-, REQ-PROC-, and REQ-GOV-* in requirements.md.

Builds Incrementally on Existing Code

  • Preserves all existing working functionality without breaking changes
  • Extends current data structures and functions rather than replacing them
  • Maintains backward compatibility while adding advanced features

Delivers Complete Economic Process Integration

  • Four structured Economic Processes (Use, Transport, Storage, Repair) with role-based access
  • Complete agent capability progression (Simple → Accountable → Primary Accountable Agent)
  • Sophisticated cross-zome coordination ensuring atomic operations and consistency

Implements Privacy-Preserving Reputation

  • Bi-directional Private Participation Receipts with cryptographic signatures
  • Privacy-preserving reputation calculation with selective disclosure
  • Performance metrics enabling quality assurance and trust without central authority

Ensures Production Readiness

  • Progressive capability-based security with automatic token advancement
  • Comprehensive error handling and rollback mechanisms across all zomes
  • Advanced validation schemes with reputation-weighted consensus and dispute resolution

This plan ensures the nondominium hApp will fulfill its vision of decentralized, commons-based resource management with sophisticated governance, Economic Process management, privacy-preserving reputation tracking, and embedded accountability, in alignment with requirements.md and, when scheduled, the NDO model in ndo_prima_materia.md.

NDO track (when prioritized)

  • Introduce L0/L1/L2 structures, migration, and capability surface without breaking existing MVP flows until migration windows are defined (REQ-NDO-MIG-*).
  • Preserve governance-as-operator invariants while splitting lifecycle and operational dimensions (REQ-ARCH-07, REQ-NDO-LC-02, REQ-NDO-OS-02).

12. Post-MVP design tracks (NDO, integrations, extensions)

Status: specified in documentation; not part of the MVP WASM deliverable until explicitly scheduled. Normative NDO requirements: ndo_prima_materia.md (§9 REQ-NDO-*, §10 migration). Integration stubs: unyt-integration.md, flowsta-integration.md. Supplementary ontology context: archives/resources.md, archives/agent.md, archives/governance.md.

12.1 Generic NDO (three-layer model, lifecycle split)

  • Introduce NondominiumIdentity (Layer 0), NDOToSpecification / NDOToProcess / holonic links, capability slot surface — see ndo_prima_materia.md §§4, 8, 10.
  • Split ResourceState into LifecycleStage + OperationalState; split discovery links (REQ-NDO-OS-06) — detailed in Phase 2.2 (Section 5); align with prima materia §5 / §9.4.

12.2 Unyt integration (three phases, parallel to prima materia §6.6)

  • Phase 1 — Capability surface: UnytAgreement SlotType; Tier 1 proposals on NDO identity hashes (REQ-NDO-CS-07, REQ-NDO-CS-08).
  • Phase 2 — Governance rules: typed EconomicAgreement on GovernanceRule / GovernanceRuleType (REQ-NDO-CS-09); zome_resource / integrity changes only.
  • Phase 3 — Governance zome: evaluate_transition_request requires valid rave_hash when rules trigger; cross-cell RAVE validation; PPR settlement_rave_hash (REQ-NDO-CS-10, REQ-NDO-CS-11).

12.3 Flowsta integration (three phases, parallel to prima materia §6.7)

  • Phase 1 — DNA + slots: FlowstaIdentity in SlotType; bundle flowsta-agent-linking integrity + coordinator zomes; Tier 1 linking only (REQ-NDO-CS-12, REQ-NDO-CS-13).
  • Phase 2 — UI / Vault UX: link flows, DID display, Vault backup APIs — see flowsta-integration.md §6.
  • Phase 3 — Governance enforcement: IdentityVerification (or equivalent) + REQ-NDO-CS-15 checks in transition evaluation (REQ-NDO-CS-14); fold into same operator story as Unyt Phase 3.

12.4 Agent capability surface (G15)

  • Person entry hash as stigmergic attachment point for FlowstaIdentity and future slots (REQ-NDO-AGENT-07, REQ-AGENT-11) — see archives/agent.md §3.2, person_zome.md Person TODO.

12.5 Extended post-MVP specifications

High-level ordering and dependencies (detailed requirements live in each file):

  • many-to-many-flows.md: Shared custody and n-ary EconomicEvent / Commitment participants — plan after AgentContext / collective custodianship (Phase 3 agent ontology) stabilizes; PPR rules must be extended for multi-party flows.
  • versioning.md: DAG of versions across material, digital, and app-as-resource — complements REQ-NDO-L1-03 (multiple ResourceSpecification links per NDO); non-breaking addition over existing spec/resource entries.
  • digital-resource-integrity.md: Content-addressed manifests and hierarchical verification — attach via Layer 1 DigitalAsset capability slots (prima materia §9.2); aligns with distributed storage expectations for specs.
  • resource-transport-flow-protocol.md: Multi-dimensional transport and flow semantics — builds on mature EconomicEvent metadata and process modeling; cross-link to operational state and RTP-style location/custody dimensions.
  • valueflows-dsl.md: Scriptable network bootstrap and recipe definition — operational tooling; depends on stable VF entry types and governance evaluation surfaces in the DNA.
  • lobby-dna.md: Multi-network federation — see §12.6 below.

12.6 Lobby DNA — multi-network federation

Requirements: lobby-dna.md (REQ-LOBBY-, REQ-GROUP-, REQ-NDO-EXT-*) Architecture: specifications/post-mvp/lobby-architecture.md

Two implementation sub-scopes with different delivery ordering:

New DNAs (Lobby + Group) — plan after NDO governance-as-operator stabilizes:

  • Lobby DNA: zome_lobby_integrity + zome_lobby_coordinatorLobbyAgentProfile, NdoDescriptor, faceted discovery links
  • Group DNA: zome_group_integrity + zome_group_coordinatorGroupDescriptor, GroupMembership, WorkLog, SoftLink, GroupGovernanceRule
  • happ.yaml roles: lobby (fixed network_seed: "nondominium-lobby-v1"), group (cloning_limit 255), nondominium (cloning_limit 1024)
  • Moss WeApplet contract (ui/src/we-applet.ts) — search, getAssetInfo, openAsset

NDO DNA extensions (zome_gouvernance) — plan after Governance-as-Operator (#41–#44) lands:

  • NdoHardLink entry type + NdoToHardLinks / HardLinkByType link types — immutable, requires AccountableAgent + valid EconomicEvent fulfillment (REQ-NDO-EXT-01–06)
    • Stage 2 (pre-Lobby, single cell): to_ndo_dna_hash equals the shared DNA hash (same cell for source and target). Stage 3 (per-NDO clone): to_ndo_dna_hash is the target cell's unique hash. Same struct, no breaking change. See lobby-architecture.md §6.1.
  • Contribution entry type + NdoToContributions / AgentToContributions / ContributionToEvent link types — requires at least one AccountableAgent validator (REQ-NDO-EXT-07–11)
  • Agreement entry type (VF: vf:Agreement) + NdoToAgreement / AgreementUpdates link types — versioned, AccountableAgent-controlled (REQ-NDO-EXT-12–16)

Dependencies:

  • Lobby + Group DNAs: NDO Layer 0 complete ✅, Sweettest patterns established ✅
  • NDO DNA extensions: Governance-as-Operator (#41–#44) for AccountableAgent cross-zome role check
  • Unyt integration (§12.2) activates Agreement.clauses with BenefitType::Monetary
  • Flowsta Phase 3 (§12.3) replaces GroupMembership.ndo_pubkey_map with IsSamePersonEntry attestations (REQ-LOBBY-INT-01)

13. Open questions / research

  • Coordination economics: How do the NDO model and the nondominium hApp mitigate coordination costs, communication overhead, and free-rider dynamics? See design rationale in ndo_prima_materia.md §2 (complexity economics, pay-as-you-grow layers) and COP/testing notes in §3.

nondominium Implementation Status

Overview

nondominium is a Holochain hApp implementing ValueFlows-compliant resource sharing with embedded governance and a Private Participation Receipt (PPR) reputation system.

This document tracks what is actually implemented and verified in the current codebase. Claims are grounded in code, not design documents.

Architecture Overview

Technology Stack

  • Backend: Rust (Holochain HDK ^0.6.0 / HDI ^0.7.0), compiled to WASM
  • Frontend: Svelte 5.0 + TypeScript + Vite 6.2.5 + UnoCSS + Melt UI next-gen
  • Testing: Sweettest (Rust, primary) — Tryorama (TypeScript) is deprecated
  • Client: @holochain/client 0.19.0 for DHT interaction

Zome Architecture (3-Zome Structure)

  1. zome_person - Agent identity, profiles, roles, and capability-based access control
  2. zome_resource - Resource specifications, lifecycle management, and governance rules
  3. zome_gouvernance - Economic events, commitments, claims, and the PPR reputation system

Each zome follows the integrity/coordinator pattern.


Phase 1: Complete ✅

Person Management

  • Public Profiles: Person entries with name, avatar, and bio
  • Private Data: EncryptedProfile entries with PII (legal name, email, phone, address, emergency contact)
  • Role-Based Access: PersonRole assignments — SimpleAgent, AccountableAgent, PrimaryAccountableAgent, Transport, Repair, Storage
  • Agent-to-Person Mapping: Secure linking between Holochain agents and their profiles

Capability-Based Access Control ✅

  • Capability Grants: Time-limited access tokens with field-level permissions
  • Filtered Data Access: FilteredPrivateData entries with selective field exposure
  • Grant Metadata: PrivateDataCapabilityMetadata for tracking access grants
  • Field-Level Control: Granular permissions for email, phone, location, time_zone, emergency_contact, address
  • Time-Based Expiration: 30-day maximum grant duration with configurable expiration

Not yet implemented (person domain)

  • Private data access request/approval workflow (#40)
  • Audit trail for private data access events (#38)
  • get_expiring_grants() for proactive grant lifecycle management (#37)
  • Full agent promotion workflow logic (#33) — roles exist, promotion workflow incomplete
  • Specialized role validation (#34)

Resource Management

Resource Specifications ✅

  • ResourceSpecification entries with name, description, category
  • Tag-based discovery, governance rule linking, active/inactive status

Economic Resources ✅

  • EconomicResource entries conforming to specifications
  • Quantity tracking with units, custodian assignment, location metadata
  • Five-state lifecycle: PendingValidation, Active, Maintenance, Retired, Reserved

Note: The current ResourceState conflates lifecycle maturity and operational condition. The NDO three-layer model (post-MVP) separates these into LifecycleStage + OperationalState. See documentation/requirements/ndo_prima_materia.md.

Governance Rules ✅

  • Extensible rule system with JSON-encoded parameters
  • Enforcement role requirements, resource attachment, audit trail

NDO Layer 0 — Identity Anchor ✅

NondominiumIdentity provides a permanent identity anchor for any resource from conception through end-of-life. Implemented in PR #80.

  • Entry type: NondominiumIdentity with name, initiator, property_regime, resource_nature, lifecycle_stage, created_at, description, successor_ndo_hash
  • Enums: LifecycleStage (10 stages: Ideation→Specification→Development→Prototype→Stable→Distributed→Active→Hibernating→Deprecated→EndOfLife), PropertyRegime (4 variants: Private, Commons, Nondominium, CommonPool — Collective and Pool removed after design review), ResourceNature (5 variants: Physical, Digital, Service, Hybrid, Information — extends spec's 3-variant definition with Service and Information)
  • Immutability: Only lifecycle_stage may change post-creation; successor_ndo_hash set exactly once on Deprecated transition; deletes are always invalid
  • Authorization: Only the initiator may call update_lifecycle_stage (MVP simplification; full role-based authorization per REQ-NDO-LC-07 deferred to governance zome integration)
  • Discovery links: AllNdos (global "ndo_identities" path anchor), AgentToNdo (per-initiator), NdoByLifecycleStage / NdoByNature / NdoByPropertyRegime (categorization anchors — PR #84)
  • API: create_ndo, get_ndo (resolves update chain), get_all_ndos (global anchor traversal), get_my_ndos (resolved entries), update_lifecycle_stage, get_ndos_by_lifecycle_stage, get_ndos_by_nature, get_ndos_by_property_regime (PR #84)
  • REQ coverage: REQ-NDO-L0-01, -02, -03, -04, -06, -07 implemented; not yet enforced: REQ-NDO-L0-05 (EconomicEvent ref on transitions, optional in coordinator), REQ-NDO-LC-02 (governance-as-operator for transition validation), REQ-NDO-LC-03 (automatic EconomicEvent generation per transition), REQ-NDO-LC-05 (EndOfLife challenge period), REQ-NDO-LC-07 (role-based authorization per §5.3)

Discovery and Query Patterns ✅

  • Anchors: AllResourceSpecifications, AllEconomicResources, AllGovernanceRules
  • Hierarchical links: Specification → Resource, Custodian → Resources
  • Category-based, location-based, and state-based query support

Phase 2: In Progress 🔄

ValueFlows Economic Framework

Action Vocabulary ✅

Standard ValueFlows actions (Transfer, Move, Use, Consume, Produce, Work, Modify, Combine, Separate, Raise, Lower, Cite, Accept) plus nondominium extensions (InitialTransfer, AccessForUse, TransferCustody).

Economic Events ✅

  • EconomicEvent entry capture with provider/receiver, resource linking, quantity, timestamping

Commitments & Claims ✅

  • Future economic commitments with due dates
  • Claim entries for fulfillment tracking
  • Bidirectional links: Commitments ↔ Events ↔ Claims

Economic Processes ❌ Not implemented

Use, Transport, Storage, and Repair process workflows are specified but not implemented. Tracked in #28, #29, #31, #32.

PPR Reputation System

Data Structures ✅

16 ParticipationClaimType variants are defined in zome_gouvernance/src/ppr.rs:

  • Genesis: ResourceCreation, ResourceValidation
  • Custody: CustodyTransfer, CustodyAcceptance
  • Services: MaintenanceCommitmentAccepted, MaintenanceFulfillmentCompleted, StorageCommitmentAccepted, StorageFulfillmentCompleted, TransportCommitmentAccepted, TransportFulfillmentCompleted, GoodFaithTransfer
  • Governance: DisputeResolutionParticipation, ValidationActivity, RuleCompliance
  • End-of-Life: EndOfLifeDeclaration, EndOfLifeValidation

Performance score fields (timeliness, quality, reliability, communication, satisfaction) and ReputationSummary struct with category breakdowns are implemented.

Cryptographic Authentication ✅

Bilateral signature system with dual signatures, hash-based security, and temporal validation is implemented in the integrity zome.

Not yet implemented (PPR domain)

  • Bi-directional receipt generation zome functions (#14)
  • Genesis role and custody receipt issuance workflows (#15, #16)
  • End-of-life management with multi-validator security (#18)
  • Challenge period mechanism for EOL declarations (#19)
  • Historical review system for EOL abuse prevention (#20)
  • PPR reputation aggregation zome function (#21)

Governance-as-Operator Architecture ❌ Not implemented

The governance-as-operator pattern (pure-function GovernanceEngine, cross-zome interface types, Request-Evaluate-Apply resource refactor, automatic event generation on state transitions) is fully specified in documentation/specifications/governance/ but not yet implemented. Tracked in #41–#44.


hREA Dual-DNA Integration

Phase 1: Complete ✅

  • hREA git submodule (vendor/hrea, Sensorica fork)
  • happ.yaml dual-DNA roles configuration
  • hREA DNA compiled and included in .webhapp bundle
  • hrea_agent_hash field added to Person integrity entry
  • create_rea_agent bridge call in zome_person coordinator
  • create_person creates a ReaAgent in hREA first
  • Cross-DNA validation tests in Sweettest

Phases 2–4: Not started ❌

Resource lifecycle, governance/PPR wiring, and production hardening via hREA are tracked under epic #47.


Frontend

Infrastructure ✅

  • SvelteKit + UnoCSS + Melt UI next-gen project scaffolded (vite.config.ts, svelte.config.js, uno.config.ts)
  • HolochainProvider.svelte — Holochain client connection management
  • Effect-TS service layer (PR #97): all three zome services and stores converted to Context.Tag / Layer / E.gen pattern with isLoading + errorMessage state
  • wrapZomeCallWithErrorFactory utility for consistent zome call error handling

MVP UI — Lobby → Group → NDO ✅ Implemented

Full three-level hierarchical UI as specified in documentation/requirements/ui_design.md (MVP section) and documentation/specifications/ui_architecture.md. The UI was substantially restructured in the UI-restructure sprint to make the Lobby the persistent outer shell with a permanent sidebar, and to fix NDO data display.

Shared Types

  • NdoDescriptor, NdoInput, UpdateLifecycleStageInput, NdoTransitionHistoryEventpackages/shared-types/src/resource.types.ts
  • PropertyRegime — 4 variants: Private, Commons, Nondominium, CommonPool (Collective and Pool removed)
  • LobbyUserProfile, GroupMemberProfile — three-level identity model
  • Extended GroupDescriptor with ndoHashes, memberProfile, createdBy, createdAt

Service Layer

  • resource.service.tscreateNdo, getNdo (returns NondominiumIdentity | null, matching Rust's Option<NondominiumIdentity>), updateLifecycleStage, getMyNdos, getNdosByLifecycleStage/Nature/Regime, getNdoTransitionHistory
  • ndo.service.tsgetLobbyNdoDescriptors, createNdo(input, groupId), getGroupNdoDescriptors, getNdoTransitionHistory; getNdoDescriptorForSpecActionHash uses getMyNdos → getAllNdos → ResourceSpec lookup chain with reliable base64 hash comparison
  • lobby.service.ts — localStorage-backed: getMyGroups, createGroup, joinGroup, generateInviteLink

Store Layer

  • app.context.svelte.tslobbyUserProfile state with localStorage hydration + persistence
  • lobby.store.svelte.tsndos, filteredNdos, activeFilters, groups, createGroup, joinGroup; loadLobby() now called from root layout
  • group.store.svelte.tsgroup, groupNdos, loadGroupData, createNdo, associateNdoWithGroup(ndoHashB64, groupId) — appends hash to group’s ndoHashes in localStorage; includes TODO for Group DNA propagation
  • ndo-cache.ts (new) — in-memory Map<hashB64, NdoDescriptor> populated on card click so the NDO detail page renders immediately without a DHT round-trip

Components — Shell / Layout

  • +layout.svelte (root) — onMount calls getMyAgentPubKey() + loadLobby() + shows first-time UserProfileForm if no lobby profile exists; ensures sidebar has data on every route
  • Sidebar.svelterewritten as persistent LobbySidebar: Browse NDOs link, live groups list with /group/:id links, inline "+ New Group" form, inline "→ Join Group" form, "My Profile / Edit profile" at bottom; "New NDO" global link removed (NDO creation lives only inside Group)
  • AppShell.svelte — unchanged layout wrapper

Components — Lobby Level

  • LobbyView.svelte — page header + NdoBrowser; $effect mirrors lobbyStore.myPerson into appContext and triggers loadNdos() — it does not set appContext.currentView so the lobby shell does not override 'ndo' when an NDO page is mounted
  • UserProfileForm.svelte — Lobby profile create/edit (modal + page modes; nickname required)
  • NdoBrowser.svelte — multi-select filter chips: LifecycleStage × ResourceNature × PropertyRegime (4 variants); "No NDOs yet" empty state
  • NdoCard.svelte — NDO summary card with lifecycle/nature/regime badges; populates ndo-cache before navigating

Components — Group Level

  • GroupView.svelte — group header, "Create NDO" button, group-scoped NdoBrowser; fixed: uses $effect instead of onMount so group data reloads correctly when navigating between groups
  • NdoCreateModal.svelte — 5-field form (name, 4-variant regime, nature, stage, description), uniqueness check, Effect-TS errors, navigates to NDO page on success
  • GroupProfileModal.svelte — per-group profile disclosure preferences (first visit only)

Components — NDO Level

  • NdoView.svelte — detail card with labeled Description / Property Regime / Resource Nature / Lifecycle Stage / Created; loading skeleton + retry-able DHT refresh error banner; Join NDO (inline Coming soon); Associate with a group opens AssociateNdoModal (multi-select eligible groups → associateNdoWithGroup); Fork opens ForkNdoModal when Holochain is connected (appContext.myAgentPubKey). Descriptor seeded from ndo-cache then refreshed via NdoService.getNdoDescriptorForSpecActionHash. Reactive fix: first $effect decodes URL hash into a local hash variable before assigning appContext.selectedNdoId; reading $state(specActionHash) in the same effect after writing it caused Svelte effect_update_depth_exceeded and left header buttons non-functional.
  • AssociateNdoModal.svelte — lists groups excluding those whose ndoHashes already contain this spec; loads groups via lobbyStore.loadGroups() on mount
  • NdoIdentityLayer.svelte — initiator profile link, lifecycle transition button (initiator-only), TransitionHistoryPanel; 4-variant PropertyRegime color map
  • LifecycleTransitionModal.svelte — full state machine (mirrors Rust), Deprecated + Hibernating special cases
  • TransitionHistoryPanel.svelte — collapsible history: from/to stage, agent, timestamp, event_hash + copy-to-clipboard
  • ForkNdoModal.svelte — informational fork friction modal with copy-initiator-pubkey CTA

Routing

  • / (LobbyView) — NDO browser across all user groups
  • /group/[id] (GroupView) — group-scoped NDO list + Create NDO; ?createNdo=1 auto-opens modal
  • /ndo/[id] (NdoView) — full NDO detail page with detail card, actions, and tabs

Not Yet Implemented (UI)

  • Multi-member groups: invite-link generation and redemption (issue related to group backend)
  • Group member list display (GroupView stub shows empty MemberList)
  • "Join NDO" backend implementation (button is a placeholder)
  • Person management components (issue #8)
  • Resource management components (issue #9)
  • Capability-based private data sharing UI (issue #39)
  • PPR reputation visualization (issue #22)
  • Economic Process workflow UI (issues #28–#32)
  • Role management / agent progression UI (issues #33–#34)
  • Group DNA backend (post-MVP; currently localStorage shell — implementation_plan.md §12.6)

Testing Infrastructure

Sweettest (Rust) — Primary ✅

All new tests are written in Sweettest in dnas/nondominium/tests/src/.

Shared setup utilities (common::conductors):

  • setup_two_agents() — two conductors, nondominium DNA
  • setup_three_agents() — three conductors, nondominium DNA
  • setup_dual_dna_two_agents() — two conductors, nondominium + hREA DNAs

Test modules:

  • misc/mod.rs — zome connectivity (ping)
  • person/mod.rs — person zome + hREA bridge tests

Tryorama (TypeScript) — Deprecated ⚠

Tests in tests/ are deprecated. See tests/DEPRECATED.md for migration status. Do not write new tests there.


Development Environment & Tooling ✅

git submodule update --init --recursive  # Initialize hREA submodule (REQUIRED)
nix develop              # Reproducible environment (REQUIRED)
bun install              # Dependency installation
bun run start            # 2-agent development network with UIs
bun run build:zomes      # WASM compilation
bun run build:happ       # DNA packaging
bun run package          # Final .webhapp distribution

# Sweettest (primary test runner)
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest

Current Status Summary

AreaStatus
Person management (profiles, roles, capability grants)✅ Complete
Resource specifications and economic resources✅ Complete
ValueFlows action vocabulary + economic events✅ Complete
Commitments and claims✅ Complete
PPR data structures + cryptographic auth✅ Complete
hREA Phase 1 (Person/ReaAgent bridge)✅ Complete
SvelteKit + UnoCSS + Melt UI next-gen setup✅ Complete
Effect-TS service layer✅ Complete (PR #97)
NondominiumIdentity (Layer 0 identity anchor)✅ Complete
MVP UI — Persistent Lobby sidebar (all routes)✅ Complete
MVP UI — Lobby → Group → NDO hierarchy✅ Complete
MVP UI — Three-level identity (Lobby/Group/Agent)✅ Complete
MVP UI — NDO creation within Group context✅ Complete
MVP UI — NDO detail page (detail card + header actions)✅ Complete (Join placeholder, Associate modal, Fork modal — smoke-tested)
MVP UI — NDO filter browser (3-dimension chips)✅ Complete
MVP UI — Lifecycle transition + history panel✅ Complete
MVP UI — Fork friction modal✅ Complete
MVP UI — Associate NDO with group modal✅ Complete
MVP UI — Join NDO (placeholder)✅ Complete (placeholder)
MVP UI — First-time user profile modal (root layout)✅ Complete
PropertyRegime reduced to 4 canonical variants✅ Complete
Sweettest scaffold + person tests✅ Complete
Economic processes (Use/Transport/Storage/Repair)❌ Not started
PPR receipt generation and EOL workflows❌ Not started
Governance-as-Operator architecture❌ Not started
Agent promotion + role validation workflows🔄 Partial
Person management UI components❌ Not started
Economic Process UI❌ Not started
PPR reputation visualization❌ Not started
Group DNA backend (currently localStorage shell)❌ Not started
hREA Phase 2–4❌ Not started

Post-MVP Design Specifications

The following are documented and traceable to REQ-NDO-* in documentation/requirements/ndo_prima_materia.md but are not in scope for the current development milestone:

TrackDesign sourcesImplementation status
NDO Layer 0 (identity anchor)ndo_prima_materia.md §§4, 8; REQ-NDO-L0-01–07Complete (#80) — NondominiumIdentity entry with lifecycle validation; REQ-NDO-L0-05 (EconomicEvent ref) and -07 (facet anchors) not yet enforced
NDO Layers 1 & 2ndo_prima_materia.md §§4, 8, 10; resources.md §3Not started — Layer 1 (Specification links), Layer 2 (Process links), cross-layer link types pending
Lifecycle vs operational state splitndo_prima_materia.md §5, §9.4 (REQ-NDO-OS-0106)Not started — ResourceState still conflated (see zome_resource TODOs)
Unyt (EconomicAgreement, RAVE)ndo_prima_materia.md §6.6, §11.5; unyt-integration.md; REQ-NDO-CS-07–CS-11Not started — no Unyt cell / RAVE validation in governance zome
Flowsta (agent linking, IdentityVerification)ndo_prima_materia.md §6.7, §11.6; flowsta-integration.md; REQ-NDO-CS-12–CS-15Not started — flowsta-agent-linking zomes not bundled
Person capability slot (G15)agent.md §3.2; person_zome.md; REQ-AGENT-11, REQ-NDO-AGENT-07Not started — no FlowstaIdentity links on Person hash
Lobby DNA (multi-network federation entry point)post-mvp/lobby-dna.md REQ-LOBBY-*; specifications/post-mvp/lobby-architecture.mdComplete (#103) — zome_lobby DNA with LobbyAgentProfile + NdoAnnouncement entry types, Sweettest suite (lobby_sweettest), lobby role in happ.yaml, Moss manifest. Group DNA (#101) not yet started.
NDO DNA extensions (NdoHardLink, Contribution, Agreement)post-mvp/lobby-dna.md REQ-NDO-EXT-01–16; specifications/post-mvp/lobby-architecture.md §6Complete (#103) — three new entry types and link types added to zome_gouvernance integrity; coordinator modules hard_link.rs, contribution.rs, agreement.rs with Sweettest coverage.

See documentation/implementation_plan.md Section 12 for a phased checklist aligned with the prima materia.

Nondominium Development Report

Executive Summary

This document provides a comprehensive overview of the Nondominium project's development progress, tracing its historical evolution from early research in peer production systems to its current implementation as a decentralized resource transfer engine. The report outlines the project's origins, current status, and future roadmap.

Historical Context and Project Origins

The Nondominium project builds upon more than a decade of research in peer production systems conducted by the Sensorica laboratory. Since 2011, Sensorica has been at the forefront of developing collaborative resource management systems that embody the principles of Open Value Networks.

Real-World Validation: PEP Master Venture

A critical milestone in shaping the Nondominium requirements is the PEP Master venture, a collaborative project creating open source DIY hardware and software for cystic fibrosis therapy. In collaboration with Sainte Justine Children's Hospital in Montreal and the Breathing Games community, PEP Master is developing a medical device that requires:

  • Trust-based economy model: A system where trust between doctors and patients is established based on the quality (safety and efficiency) of medical instruments
  • Certainty of provenance: Digital infrastructure providing proof of origin for device designs
  • On-demand verification: Methods for validating fabrication quality in distributed manufacturing
  • Contribution accounting: Fair reward distribution for everyone involved in producing the instruments

This real-world medical device context provides crucial validation for Nondominium's design, particularly around:

  • Non-fungible tokens (NFTs) for digital certificates representing device provenance
  • Third-generation DLT for contractual and transactional primitives
  • Open value network governance models for collaborative ventures

The NRP-CAS Foundation

In 2013, Sensorica collaborated with Lynn Foster and Bob Haugen to develop the Network Resource Planning and Contribution Accounting System (NRP-CAS). This system was specifically designed to operationalize Open Value Network principles, providing a framework for managing resources and tracking contributions across collaborative projects. The initial prototype was implemented using Django and Python, serving as an internal tool for the laboratory's operations for several years.

However, the NRP-CAS prototype demonstrated stability and security limitations that precluded production deployment. Despite these technical constraints, the project established a crucial theoretical foundation: Foster and Haugen leveraged the NRP-CAS implementation to develop the Valueflows ontology, an extension of William E. McCarthy's Resource-Event-Agent (REA) framework. This ontology would later become a cornerstone of the Nondominium architecture.

Evolution to Web 3 and Architecture Refinement

The year 2025 marked a significant milestone with the initiation of TrueCommons, a Web 3 implementation designed to modernize the NRP-CAS concept. TrueCommons leverages Holochain as its underlying infrastructure and incorporates hREA, the Holochain-native implementation of the Valueflows ontology. The ambitious vision for TrueCommons encompassed a comprehensive implementation of Valueflows to support complete peer production processes.

During the development process, a critical architectural insight emerged: the need to isolate the resource transfer mechanism as a distinct, reusable component. This recognition led to a strategic separation of concerns between two complementary systems.

Nondominium serves as the resource transfer and flow engine, designed as an organization-agnostic system that embeds governance rules directly within resource definitions. This approach enables resources to carry their own governance parameters, ensuring that transfer protocols remain consistent regardless of organizational context.

TrueCommons builds upon the Nondominium foundation to provide a complete peer production system. It incorporates additional capabilities including contribution accounting, benefit redistribution algorithms, and project management functionalities.

Current Development Scope

The initial release of Nondominium focuses on validating the core concept of non-proprietary resource transfer systems through the implementation of essential primitives. This first version encompasses three foundational components.

Core Resource Transfer System

The primary deliverable is a minimal viable implementation of the resource transfer mechanism, demonstrating the feasibility of governance-embedded, non-proprietary resource flows. This system establishes the technical foundation upon which future enhancements will be built.

Agent Management Foundation

The implementation includes fundamental person agent management capabilities with multi-device support, recognizing that modern collaborative workflows require seamless cross-device functionality.

Governance-as-Operator Architecture

The Resource and Governance zomes (modules) adopt a "governance as operator" paradigm, wherein resources remain static until explicitly modified through governance actions. This architectural approach ensures that all state transitions are governed by well-defined rules embedded within the resource itself.

Target Ecosystem Integration

The initial implementation targets the Moss ecosystem (https://moss.social), a peer-to-peer, privacy-first groupware platform designed for small teams. Moss provides an ideal deployment environment as it is built on Holochain and supports Holochain applications, enabling immediate integration and real-world validation of the Nondominium concepts.

Governance-as-Operator Architecture

Nondominium implements a sophisticated governance-as-operator architecture that establishes a clear separation between data management and business logic enforcement. This design pattern enables independent evolution of resource data structures and governance rules, providing modularity, testability, and swappability.

Core Architectural Principles:

The Resource zome operates as a pure data model responsible for resource specification management, economic resource lifecycle operations, and data persistence. It contains no business logic or validation rules, performing only CRUD operations on data structures. All governance decisions are delegated to the Governance zome through well-defined cross-zome interfaces.

The Governance zome functions as a state transition operator, evaluating governance rules and policies, validating agent permissions and roles, authorizing or rejecting state transitions, and generating economic events for audit trails. Its logic is implemented as pure functions that evaluate state transitions without side effects, enabling comprehensive unit testing and governance scheme swappability.

Cross-Zome Communication Protocol:

Communication between zomes follows a Request-Evaluate-Apply pattern implemented through the GovernanceTransitionRequest and GovernanceTransitionResult structures. When a resource state change is requested:

  1. The Resource zome calls request_resource_transition() with the proposed action, current resource state, requesting agent, and transition context
  2. The Governance zome evaluates the request via evaluate_state_transition(), checking agent permissions, applicable governance rules, and state transition validity
  3. The Resource zome applies approved state changes, records generated economic events, and updates state transition links

This architecture ensures that all resource state transitions are governed by well-defined rules embedded within the resource itself, with complete audit trails through economic event generation. The event-driven design integrates seamlessly with the PPR reputation system, enabling comprehensive tracking of agent participation and resource lifecycle history.

Implementation Status

The Nondominium project has achieved substantial implementation completeness across all core systems. The current development state represents a production-ready Holochain application with comprehensive ValueFlows compliance and advanced privacy features. Overall completion stands at approximately 85-90%, with all fundamental functionality operational and tested.

Architecture Context

Nondominium implements a custom ValueFlows-compliant architecture designed to validate novel governance and reputation mechanisms. This independent implementation was developed to prove the PPR (Private Participation Receipt) system concept and governance-as-operator paradigms before committing to deeper ecosystem integration.

The governance-as-operator architecture enables independent evolution of data structures and governance rules, providing modularity, testability, and swappability as fundamental design principles. This separation of concerns allows different governance schemes to be applied to the same resource types without modifying the core resource data model. The pure function approach to governance logic enables comprehensive unit testing and facilitates the substitution of governance mechanisms as organizational requirements evolve. This architectural flexibility positions Nondominium to support diverse collaborative models while maintaining consistent resource management primitives.

The project maintains a strategic distinction between current implementation and future architecture. While Nondominium currently operates as a standalone system with complete ValueFlows data structures, a separate roadmap exists for integrating hREA (the Holochain Regenerative Economics Architecture) as a backend engine. This future integration, detailed in the hREA/integration-strategy.md document, would position hREA as the foundational ValueFlows implementation layer while preserving Nondominium's specialized innovations in privacy, governance, and reputation tracking.

This architectural approach enables the project to demonstrate unique value propositions through practical implementation before adopting ecosystem standards, ensuring that innovations can be properly validated and potentially contributed back to the broader hREA community.

Phase 1: Foundation System

Person Management System (95% Complete)

The Person zome provides comprehensive agent identity management with full multi-device support and role-based access control. The system distinguishes between public profiles (name, avatar, bio) and private data (legal name, contact information, address), with capability-based access control governing sensitive information. Six role types have been implemented, ranging from SimpleAgent for basic network participation to PrimaryAccountableAgent for advanced governance capabilities. The multi-device support allows agents to register and manage multiple devices while maintaining a unified identity, with proper security validation and activity tracking.

Resource Management System (90% Complete)

The Resource zome implements a complete ValueFlows-compliant data model with resource specifications, economic resource instances, and embedded governance rules. Resource specifications define the template for resource types, including naming, categorization, and governance requirements. Economic resources represent individual instances with precise quantity tracking, custodian assignment, and location metadata. The system supports five resource states (PendingValidation, Active, Maintenance, Retired, Reserved) with comprehensive lifecycle management. The governance architecture allows rules to be directly embedded within resources, ensuring that all state transitions follow defined protocols.

Testing Infrastructure

A robust 4-layer testing strategy encompasses Foundation tests (basic zome functionality and connectivity), Integration tests (cross-zome interactions and multi-agent scenarios), Scenario tests (complete user journeys and end-to-end workflows), and Performance tests (load testing for the PPR system). This comprehensive approach ensures approximately 95% test coverage for the Person zome, 90% for the Resource zome, and 75% for the Governance zome.

Governance Architecture Implementation

The governance-as-operator architecture implementation is substantially complete, with core cross-zome communication protocols operational and state transition logic functional.

Cross-Zome Interface (85% Complete)

The GovernanceTransitionRequest and GovernanceTransitionResult structures are defined and in use, providing the foundation for cross-zome communication. The Resource zome request_resource_transition() function is implemented and functional, while the Governance zome evaluate_state_transition() function is operational with permission checking and rule evaluation. Economic event generation for approved transitions is integrated with the PPR reputation system.

State Transition Logic (80% Complete)

The pure function governance engine is implemented with stateless evaluation logic. Agent permission and role checking is operational, supporting the progressive trust model. The governance rule evaluation framework is functional with support for resource-embedded governance rules. State calculation logic correctly determines new resource states based on requested actions and context.

Known Integration Gaps: Cross-zome integration points include some temporarily disabled validation calls due to integration challenges during development. These need to be re-enabled to complete the governance-as-operator architecture, specifically the bidirectional validation between Resource and Governance zomes for certain state transition scenarios.

Phase 2: Advanced Governance and Reputation

PPR Reputation System (70% Complete)

The Private Participation Receipt system provides the foundational infrastructure for cryptographic reputation tracking across 16 distinct claim categories. These categories encompass the full resource lifecycle: network entry (ResourceCreation, ResourceValidation), custodianship transfers (CustodyTransfer, CustodyAcceptance), specialized services (Maintenance, Storage, Transport with commitment and fulfillment tracking), network governance (DisputeResolutionParticipation, ValidationActivity, RuleCompliance), and resource end-of-life (EndOfLifeDeclaration, EndOfLifeValidation).

Implemented Core Features: All 16 claim categories are defined and functional with comprehensive performance metrics tracking (timeliness, quality, reliability, communication, and overall satisfaction). The reputation aggregation system calculates weighted averages across claims with category-based breakdowns. Private data storage ensures claim confidentiality while enabling privacy-preserving reputation summaries.

Critical Gaps: The bilateral authentication workflow requires completion before the system can achieve its intended cryptographic authenticity guarantees. Currently, PPR signatures use placeholder counterparty signatures rather than true bilateral signing. The automatic PPR generation function exists but requires test coverage validation. Multi-agent signing scenarios beyond 2-agent interactions need implementation for production scalability.

Production Readiness: The PPR system provides functional reputation tracking for single-agent scenarios and comprehensive metrics calculation. However, the missing bilateral authentication workflow represents a critical gap that must be addressed before the system can deliver its core value proposition of cryptographically-authenticated, peer-validated reputation tracking.

Economic Processes

Four structured economic processes with role-based access control have been implemented to govern resource interactions. The Use process enables resource utilization without ownership transfer, requiring Accountable Agent status and implementing time-limited access with usage tracking. The Transport process manages resource movement between locations, requiring Primary Accountable Agent status and implementing custody transfer with location tracking. The Storage process handles resource preservation and maintenance, while the Repair process manages resource restoration and improvement. Each process integrates with the PPR system for reputation tracking and generates appropriate economic events.

Progressive Trust Model

A three-tier progressive trust model enables agent advancement based on validated participation and reputation accumulation. Simple Agents represent basic network membership with general capability tokens, allowing resource creation and initial transactions. Accountable Agents represent stewardship-level participation with restricted capability tokens, enabling resource access and validation of other agents. Primary Accountable Agents represent coordination and governance-level participation with full capability tokens, permitting custody holding and validation of specialized roles. Advancement between tiers occurs through validated transaction participation and PPR milestone achievements.

Frontend Foundation

Svelte 5 + TypeScript frontend infrastructure has been established with Holochain integration components. However, the current UI implementation requires a complete rewrite to be functional and compatible with the Moss ecosystem. The technical foundation is in place, but user-facing components need redevelopment to align with Moss integration requirements and provide functional workflows for end users.

Remaining Technical Work

Frontend Development

The Svelte 5 + TypeScript infrastructure exists but requires a complete rewrite to create a functional, user-friendly interface compatible with the Moss ecosystem. This includes implementing profile management interfaces, resource browsing and discovery tools, role assignment capabilities, capability management controls, and real-time DHT synchronization. This represents a significant development effort rather than polish work.

Backend Technical Debt

Several backend items require attention for full production optimization. Cross-zome integration points require specific attention to complete the governance-as-operator architecture: some temporarily disabled validation calls between Resource and Governance zomes need to be re-enabled, specifically the bidirectional validation for state transition scenarios where request_resource_transition() must validate against evaluate_state_transition() results. Resource link management requires addressing duplicate resource links that occur during custody transfer scenarios, which affects resource counting accuracy. Code quality improvements include removing unused imports and ambiguous glob re-exports for cleaner compilation. These backend items represent polish and optimization work rather than missing core features, with the cross-zome validation re-enabling being the most significant for architectural completeness.

PPR System Completion

The Private Participation Receipt system requires completion of its bilateral authentication workflow to achieve full functionality. Current implementation uses placeholder counterparty signatures rather than true multi-party cryptographic signing. Required work includes: implementing a two-step signature collection mechanism, adding pending signature status tracking, creating counterparty notification systems, and developing automatic PPR finalization when both signatures are received. Additionally, the automatic PPR generation function exists but requires comprehensive testing to validate production behavior.

Future Roadmap: hREA Integration

A separate roadmap exists for integrating hREA as the foundational ValueFlows backend engine. This integration, detailed in hREA/integration-strategy.md, represents a future architectural enhancement rather than current implementation. The strategy employs a git submodule approach with cross-DNA calls, enabling Nondominium to leverage hREA's proven ValueFlows patterns while maintaining its specialized PPR system, private data innovations, and governance mechanisms.

The integration roadmap comprises four phases: Person zome pilot integration, Resource lifecycle expansion, Governance system integration with PPR enhancement, and Production readiness optimization. This future evolution positions Nondominium to contribute validated innovations back to the hREA ecosystem while achieving immediate ValueFlows compliance through its current custom implementation.

Post-MVP Development Roadmap

Following the completion of the initial release, the project team has identified several strategic enhancements designed to extend Nondominium's capabilities and establish it as a foundational technology for peer production systems.

Protocol Standardization

A primary objective is to standardize the Nondominium resource transfer system as a formal protocol, with the long-term vision of establishing it as an ISO standard for peer production systems. Documentation of this protocol is available in the resource-transport-flow-protocol specification.

Digital Resource Integrity

The team plans to implement a Digital Resource Integrity feature designed to ensure the authenticity and integrity of resources throughout their lifecycle. This capability will provide cryptographic proof that downloaded resource data remains identical to the original data uploaded to the Holochain DHT, addressing concerns about data integrity in distributed systems. Further details are available in the digital-resource-integrity specification.

Valueflows Domain-Specific Language

To enable more sophisticated resource management, the team is developing a Valueflows Domain-Specific Language (DSL). This DSL will facilitate the scripted definition and management of resource flows and transactions, enabling automated resource allocation and distribution based on predefined rules. The valueflows-dsl specification provides additional technical details on this initiative.

Testing Infrastructure for nondominium hApp

Overview

The nondominium hApp employs a comprehensive, multi-layered testing strategy covering all three zomes across two parallel test suites that are active simultaneously during migration.

Current status: Sweettest is in place for misc (ping), person (hREA bridge), resource, nondominium (NDO Layer 0 lifecycle tests, 8 scenarios), and governance (federation extensions from #103). The lobby_sweettest crate covers the Lobby DNA. Per-zome tests continue to be co-evolved alongside the NDO refactor (see documentation/requirements/ndo_prima_materia.md §10). Tryorama (TypeScript) remains active for UI-layer tests.

Sweettest (Rust) — Primary

Sweettest runs Holochain in-process, providing faster feedback and direct access to Holochain types without the WebSocket/msgpack round-trip.

Running Sweettest

nix develop  # Required: provides Rust toolchain + Holochain binaries

# Build the .dna bundle first, then run Rust tests
bun run sweettest             # build:happ + cargo test -p nondominium_sweettest
bun run sweettest:verbose     # same + --nocapture for test output
bun run sweettest:only        # skip build:happ (use when .dna is already built)

Test crate locations

dnas/
├── nondominium/tests/        # package: nondominium_sweettest
│   ├── Cargo.toml            # [[test]] targets: misc, person, resource, nondominium, governance
│   └── src/
│       ├── common/
│       │   └── conductors.rs # setup_two_agents(), setup_three_agents(), setup_dual_dna_two_agents()
│       ├── misc/mod.rs       # ping test — validates full build chain end-to-end
│       ├── person/mod.rs     # Person zome + hREA bridge tests
│       ├── resource/mod.rs   # zome_resource tests: get_all_resource_specifications (action_hashes field)
│       ├── nondominium/      # NondominiumIdentity lifecycle tests (8 scenarios, closes #76)
│       └── governance/mod.rs # Agreement, Contribution, NdoHardLink tests (#103)
└── lobby/tests/              # package: lobby_sweettest
    ├── Cargo.toml
    └── src/
        ├── common/
        │   └── conductors.rs # setup_two_lobby_agents()
        └── lobby/mod.rs      # announce_ndo, upsert_lobby_agent_profile, get_my_groups tests

Per-zome test modules are co-evolved alongside implementation PRs. Each PR that adds new #[hdk_extern] functions adds corresponding tests in the relevant module.

Environment requirement for Sweettest

The holonix shell (GCC-based) needs LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS set for the datachannel-sys bindgen step. These are exported automatically when using nix develop after flake.nix adds llvmPackages_19.libclang.

Use CARGO_TARGET_DIR=target/native-tests to isolate from the WASM build artifacts.


Testing Philosophy

Our testing approach follows Holochain community best practices with emphasis on:

  • Progressive Complexity: Start with basic connectivity, build to complex scenarios
  • DHT-Aware Testing: Accounts for distributed timing and synchronization requirements
  • Multi-Agent Focus: Validates true peer-to-peer interactions using Tryorama
  • Real-World Scenarios: Tests actual governance and community workflows
  • Privacy Validation: Ensures proper private entry storage and access control boundaries

Test Architecture

Layered Testing Approach

📊 Test Layers (Bottom-up approach)
├── 🔧 Foundation Tests     - Basic connectivity & function calls
├── 🧩 Unit Tests          - Individual zome functionality
├── 🔗 Integration Tests   - Cross-zome & multi-agent interactions
├── 🎭 Scenario Tests      - Real-world usage patterns
└── ⚡ Performance Tests   - Scalability & timing validation

Technology Stack

Sweettest (Rust — new primary):

  • Framework: holochain = "=0.6.0" with test_utils feature
  • Runtime: tokio multi-thread executor
  • Language: Rust, in-process Holochain
  • CARGO_TARGET_DIR: target/native-tests (isolated from WASM artifacts)

Tryorama (TypeScript — transitioning out):

  • Framework: Vitest v3.2.4
  • Holochain Testing: @holochain/tryorama v0.18.2
  • Language: TypeScript with full type safety
  • Environment: Nix development shell for consistent Holochain binaries

Test Structure

Directory Layout

tests/
├── src/nondominium/
│   ├── person/                    # Person management tests
│   │   ├── person-foundation-tests.test.ts
│   │   ├── person-integration-tests.test.ts
│   │   ├── person-scenario-tests.test.ts
│   │   ├── person-capability-based-sharing.test.ts
│   │   └── common.ts
│   ├── resource/                  # Resource lifecycle tests
│   │   ├── resource-foundation-tests.test.ts
│   │   ├── resource-integration-tests.test.ts
│   │   ├── resource-scenario-tests.test.ts
│   │   ├── resource-update-test.test.ts
│   │   └── common.ts
│   ├── governance/                # Governance system tests
│   │   ├── governance-foundation-tests.test.ts
│   │   ├── ppr-system/           # PPR system tests
│   │   │   ├── ppr-foundation.test.ts
│   │   │   ├── ppr-integration.test.ts
│   │   │   ├── ppr-scenarios.test.ts
│   │   │   ├── ppr-cryptography.test.ts
│   │   │   ├── ppr-debug.test.ts
│   │   │   └── common.ts
│   │   └── common.ts
│   └── misc/                      # Miscellaneous tests
│       └── misc.test.ts
├── package.json                   # Test dependencies & scripts
├── tsconfig.json                  # TypeScript configuration
└── vitest.config.ts              # Test framework configuration

Test Command System

Pattern-Based Test Execution

The testing system uses Vitest's file filtering capabilities with the bun tests command:

# Main test command (builds zomes, packages hApp, runs tests)
bun tests

# Pattern-based selection
bun tests person          # All files starting with "person-"
bun tests resource        # All files starting with "resource-"
bun tests governance      # All files starting with "governance-"
bun tests ppr             # All files starting with "ppr-"

# Layer-based selection
bun tests foundation      # All files containing "foundation"
bun tests integration     # All files containing "integration"
bun tests scenario        # All files containing "scenario"

# Specific test files
bun tests person-foundation
bun tests ppr-integration
bun tests resource-scenario

Test Command Options

# Development workflows
bun tests --watch person                    # Hot reload during development
bun tests --reporter=verbose ppr-debug     # Detailed output for debugging
bun tests --coverage                       # Generate coverage reports
bun tests --typecheck                      # Run with TypeScript checking

# Quality assurance
bun tests foundation && bun tests --typecheck    # Pre-commit validation
bun tests && bun tests --coverage                 # Full validation

Test Categories

🔧 Foundation Tests

Purpose: Validate basic zome connectivity and entry creation Scope: Single agent operations, individual function calls Files: *-foundation-tests.test.ts

Test Coverage:

  • Person Foundation: Basic profile creation, private data storage, community discovery
  • Resource Foundation: Resource specification creation, basic validation
  • Governance Foundation: Basic governance operations, rule validation
  • PPR Foundation: Private Participation Receipt creation and validation

Key Features:

  • Immediate feedback on API compatibility issues
  • Basic entry validation and error boundary testing
  • Foundation for more complex multi-agent tests
  • Single-conductor Tryorama scenarios

🔗 Integration Tests

Purpose: Validate multi-agent interactions and DHT synchronization Scope: Multiple agents, cross-zome functionality, distributed operations Files: *-integration-tests.test.ts

Test Coverage:

  • Person Integration: Multi-agent discovery, cross-agent role assignment
  • Resource Integration: Resource sharing between agents, access validation
  • PPR Integration: Cross-agent PPR validation, cryptographic verification

Key Features:

  • Multi-conductor Tryorama setup with 2+ agents
  • DHT timing validation and synchronization delays
  • Cross-agent visibility and access control testing
  • Distributed state consistency validation

🎭 Scenario Tests

Purpose: Simulate complete real-world usage patterns and workflows Scope: End-to-end user journeys, complex governance scenarios Files: *-scenario-tests.test.ts

Test Scenarios:

1. Complete Resource Sharing Workflow

  • Resource creation and specification
  • Capability-based access grants
  • Multi-agent resource discovery
  • Usage validation and governance

2. PPR System End-to-End

  • PPR creation for resource access
  • Cryptographic validation chain
  • Multi-step approval workflows
  • Governance rule enforcement

3. Community Onboarding Scenarios

  • New member profile creation
  • Role assignment and capability grants
  • Resource access integration
  • Privacy boundary verification

Key Features:

  • Complete user journey testing
  • Real governance workflow simulation
  • Privacy and security validation
  • Complex multi-step transaction flows

Specialized Tests

PPR Cryptography Tests: Validation of cryptographic primitives and security PPR Debug Tests: Development debugging and edge case validation Capability-Based Sharing: Advanced access control scenarios Resource Update Tests: Resource lifecycle and modification workflows

Test Utilities & Infrastructure

Data Factories (common.ts)

Standardized test data creation for each domain:

// Person management
createTestPerson() → Standard person profile
createTestPersonVariation(suffix) → Unique profiles for multi-agent tests

// Resource management
createTestResource() → Sample resource specification
createTestResourceVariant() → Resource variations

// PPR system
createTestPPR() → Basic PPR structure
createTestValidationBlock() -> Cryptographic validation data

Validation Helpers

Comprehensive response validation across domains:

validatePersonCreation() → Complete person entry validation
validateResourceCreation() → Resource specification validation
validatePPRCreation() → PPR structure and cryptographic validation
validateAgentProfile() → Profile retrieval validation

Multi-Agent Management

Tryorama-specific tools for complex distributed scenarios:

createMultipleAgents(count) → Setup multiple test conductors
waitForDHTSync(delay) → DHT synchronization delays
setupTryoramaScenario() → Standard scenario initialization
cleanupTryorama(scenario) → Proper cleanup and shutdown

Test Configuration

Timeout Settings: 4 minutes for complex multi-agent scenarios Concurrency: Single fork execution for DHT consistency Agent Simulation: Supports 2+ distributed agents per test Environment: Requires Nix development shell

Running Tests

Prerequisites

  1. Nix Development Environment: Required for Holochain binaries

    nix develop  # Enter reproducible environment (REQUIRED)
    
  2. Dependencies: Automatically installed by test scripts

    bun install  # Install all dependencies
    

Test Execution Commands

From Project Root:

# Build and run all tests
bun tests

# Pattern-based test selection
bun tests person          # Person-related tests
bun tests resource        # Resource-related tests
bun tests governance      # Governance-related tests
bun tests ppr             # PPR system tests

# Layer-based selection
bun tests foundation      # All foundation tests
bun tests integration     # All integration tests
bun tests scenario        # All scenario tests

# Specific test files
bun tests person-foundation
bun tests ppr-integration
bun tests resource-scenario

Development Workflows:

# Watch mode for development
bun tests --watch person

# Debug mode with verbose output
bun tests --reporter=verbose ppr-debug

# Coverage analysis
bun tests --coverage

# Type checking integration
bun tests --typecheck

Environment Requirements

Critical: Tests must run inside the Nix development environment to access required Holochain binaries:

  • kitsune2-bootstrap-srv - Holochain networking service
  • hc - Holochain CLI tool
  • Other Holochain runtime dependencies

Without Nix Environment: Tests will fail with "Failed to spawn kitsune2-bootstrap-srv" and "spawn hc ENOENT" errors.

Test Development Features

Test Isolation: Use .only() for focused development:

describe.only('specific test suite', () => { ... })
it.only('specific test', async () => { ... })

Rust Debugging: Use warn! macro in zome functions:

#![allow(unused)]
fn main() {
warn!("Debug info: variable = {:?}", some_variable);
warn!("Checkpoint reached in function_name");
}

Current Test Coverage

Phase 1 Foundation Layer ✅

DomainFoundationIntegrationScenariosSpecializedStatus
Person Management✅ Complete✅ Complete✅ Complete✅ CapabilityReady
Resource Management✅ Complete✅ Complete✅ Complete✅ UpdateReady
Governance System✅ Complete🔲 Planned🔲 Planned🔲 PlannedReady
PPR System✅ Complete✅ Complete✅ Complete✅ Crypto/DebugReady

Test File Inventory

Person Tests (4 files):

  • person-foundation-tests.test.ts - Basic connectivity and profile management
  • person-integration-tests.test.ts - Multi-agent discovery and interaction
  • person-scenario-tests.test.ts - Complete user workflows
  • person-capability-based-sharing.test.ts - Advanced access control

Resource Tests (4 files):

  • resource-foundation-tests.test.ts - Resource creation and validation
  • resource-integration-tests.test.ts - Cross-agent resource sharing
  • resource-scenario-tests.test.ts - Complete resource lifecycle workflows
  • resource-update-test.test.ts - Resource modification and versioning

Governance Tests (1 file):

  • governance-foundation-tests.test.ts - Basic governance operations

PPR System Tests (5 files):

  • ppr-foundation.test.ts - Basic PPR creation and validation
  • ppr-integration.test.ts - Cross-agent PPR workflows
  • ppr-scenarios.test.ts - Complete PPR usage scenarios
  • ppr-cryptography.test.ts - Cryptographic validation
  • ppr-debug.test.ts - Development debugging

Miscellaneous Tests (1 file):

  • misc.test.ts - Additional test scenarios

Technology Stack Status

ComponentVersionStatus
Sweettest (Rust)holochain 0.6.0✅ Active — new primary
Vitest3.2.4✅ Active — transitioning out
Tryorama0.18.2✅ Active — transitioning out (last supported pair with HDK 0.6)
Holochain Client0.19.0✅ Active
TypeScript5.6.3✅ Active
HDK^0.6.0✅ Active
HDI^0.7.0✅ Active

Development Workflow Integration

Test-Driven Development

  1. Foundation First: Start with bun tests foundation for basic connectivity
  2. Build Integration: Add multi-agent tests with bun tests integration
  3. Validate Scenarios: Create real-world usage with bun tests scenario
  4. Iterate & Debug: Use pattern matching for focused testing

Debugging Strategy

The layered approach enables systematic debugging:

  1. Foundation Failure → API compatibility or basic functionality issue
  2. Integration Failure → DHT timing or multi-agent logic issue
  3. Scenario Failure → Business logic or user workflow issue

Environment Debugging

Common issues and solutions:

  1. Missing Binaries: Run tests inside nix develop environment
  2. Bundle Not Found: Verify automatic packaging creates workdir/nondominium.happ
  3. API Errors: Check HDK version compatibility (^0.6.0/^0.7.0)
  4. Timeout Issues: Tests have extended 4-minute timeouts for complex operations

Continuous Integration

Tests are designed for CI environments with:

  • Deterministic test data and timing
  • Proper cleanup between test runs via Tryorama
  • Clear pass/fail indicators
  • Detailed logging for failure diagnosis
  • Automatic build and packaging steps

Best Practices

Pattern-Based Test Selection

Use the file naming conventions for efficient testing:

# Efficient development workflow
bun tests person-foundation    # Fast: single test file
bun tests foundation          # Medium: multiple foundation tests
bun tests person              # Slower: all person tests
bun tests                     # Slowest: complete test suite

Multi-Agent Testing with Tryorama

Use consistent Tryorama patterns:

const [alice, bob] = await scenario.addPlayersWithApps([
  { appBundleSource: getAppBundleSource() },
  { appBundleSource: getAppBundleSource() },
]);

// Allow DHT synchronization
await waitForDHTSync(2000);

DHT Synchronization

Always account for distributed timing in Tryorama tests:

await waitForDHTSync(2000); // Basic operations
await waitForDHTSync(5000); // Complex multi-agent operations

Validation Consistency

Use provided validation helpers for consistency across tests:

validatePersonCreation(result, input, agentPubKey);
validatePPRCreation(pprResult, expectedData);
validateResourceCreation(resourceResult, specification);

Error Testing

Include negative test cases with proper Tryorama error handling:

await expect(async () => {
  await cell.callZome({
    zome_name: "person",
    fn_name: "create_person",
    payload: invalidData,
  });
}, "Expected error pattern");

Environment Management

Always run tests in the correct environment:

# Correct way - includes Nix environment
nix develop --command bun tests person

# Incorrect way (will fail) - missing Holochain binaries
bun tests person

Performance and Scalability

Test Execution Performance

  • Parallel Execution: Tests run in parallel by default for maximum speed
  • Smart Filtering: Use specific patterns to reduce test execution time
  • Build Optimization: Automatic incremental builds and WASM compilation
  • Memory Management: Proper Tryorama cleanup prevents memory leaks

Timeout Configuration

  • Standard Tests: 5 minutes (Vitest default)
  • Complex Scenarios: 4 minutes (custom configured)
  • Integration Tests: Extended timeouts for DHT synchronization
  • Foundation Tests: Standard timeouts for quick validation

Future Enhancements

Planned Test Coverage

  • Governance Integration: Cross-zome governance workflows
  • Performance Testing: Load testing with multiple agents
  • Security Testing: Advanced cryptographic validation
  • Cross-DNA Testing: Multi-application interaction scenarios

Infrastructure Improvements

  • Enhanced Debugging: Better Tryorama logging and error reporting
  • Mock Services: External service mocking for complex scenarios
  • Test Data Management: Improved test data factories and management
  • CI/CD Integration: Enhanced continuous integration workflows

Conclusion

This testing infrastructure provides a robust foundation for ensuring the reliability and functionality of the nondominium hApp using Tryorama. The pattern-based test execution system enables efficient development workflows while the comprehensive layered approach ensures thorough validation of distributed functionality.

Current Status: All foundation, integration, and scenario tests are actively maintained and passing with Tryorama 0.18.2 and Holochain HDK ^0.6.0 / HDI ^0.7.0.

Key Strengths:

  • Pattern-based test selection for efficient development
  • Comprehensive Tryorama integration for realistic testing
  • Proper DHT synchronization and multi-agent validation
  • Full TypeScript support and type safety
  • Robust build and packaging automation

Next Steps:

  1. Expand governance test coverage for complex workflows
  2. Add performance and load testing capabilities
  3. Enhance debugging and error reporting features
  4. Integrate additional security and cryptographic validation

This infrastructure supports the complete development lifecycle from foundation testing to complex multi-agent scenario validation using the official Holochain testing framework.

Test Commands Reference

Quick reference for running tests from the project root.

🦀 Sweettest (Rust) — Primary

Runs Holochain in-process. Faster, no WebSocket round-trip, direct Rust types.

Four [[test]] binaries (targets for cargo test --test <name>):

  • misc — ping test, validates full build chain end-to-end
  • person — Person zome + hREA bridge tests
  • resource — Resource zome tests
  • nondominium — NDO Layer 0 (NondominiumIdentity) lifecycle tests (8 scenarios)
# Build .dna bundle then run all Rust tests
bun run sweettest

# Same with --nocapture (see test output in real time)
bun run sweettest:verbose

# Skip build:happ if .dna is already built
bun run sweettest:only

Cargo commands directly (inside nix develop):

# Requires LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS to be set (exported by nix develop)
CARGO_TARGET_DIR=target/native-tests cargo test -p nondominium_sweettest
CARGO_TARGET_DIR=target/native-tests cargo test -p nondominium_sweettest -- --nocapture

# Run a specific test module
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test misc
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test person
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test resource
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test governance

Lobby DNA Sweettest

# Prerequisites: build:happ must have been run first
bun run build:happ

# Run all Lobby Sweettest tests
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby

# With test output visible
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby -- --nocapture

# Run a single test
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby announce_ndo_cross_conductor

NDO Layer 0 tests (--test nondominium)

# Run all NDO Layer 0 tests
CARGO_TARGET_DIR=target/native-tests cargo test --test nondominium

# Run a single scenario
CARGO_TARGET_DIR=target/native-tests cargo test --test nondominium ndo_cross_agent_discovery

📋 Tryorama (TypeScript) — Deprecated

Still the primary test suite until NDO refactor lands and Sweettest tests are co-evolved.

🚀 Basic Test Commands

All commands automatically build zomes and package the hApp before running tests.

# Run all tests
bun tests

# Run tests with verbose output
bun tests --reporter=verbose

# Run tests in watch mode for development
bun tests --watch

# Generate coverage reports
bun tests --coverage

🎯 Pattern-Based Test Selection

The test system uses file name pattern matching to run specific test subsets:

# Run all person-related tests
bun tests person

# Run all resource-related tests
bun tests resource

# Run all governance-related tests
bun tests governance

# Run all PPR system tests
bun tests ppr

📂 Layer-Specific Test Patterns

# Run all foundation tests (basic connectivity)
bun tests foundation

# Run all integration tests (multi-agent interactions)
bun tests integration

# Run all scenario tests (complete user workflows)
bun tests scenario

🔧 Specific Test Files

# Run specific test files using partial name matching
bun tests person-foundation
bun tests person-integration
bun tests person-scenario
bun tests resource-foundation
bun tests resource-integration
bun tests resource-scenario
bun tests ppr-foundation
bun tests ppr-integration
bun tests ppr-scenarios
bun tests ppr-cryptography
bun tests ppr-debug
bun tests person-capability
bun tests governance-foundation

🎯 Development Workflow Commands

# Development with hot reload
bun tests --watch person

# Debug specific test with verbose output
bun tests --reporter=verbose ppr-foundation

# Run tests for a specific feature area
bun tests resource
bun tests governance
bun tests person

🧹 Test Quality & Type Checking

# Run tests with type checking
bun tests --typecheck

# Run type checking only (from tests directory)
cd tests && npm run check

# Run tests with coverage analysis
bun tests --coverage

💡 Test Development Tips

Test Isolation During Development

Use .only() on specific test blocks to run single tests:

describe.only('specific test suite', () => { ... })  // Run only this suite
it.only('specific test', async () => { ... })       // Run only this test
test.only('specific test', async () => { ... })       // Run only this test

Rust Zome Debugging

Use the warn! macro in Rust zome functions to log debugging info:

#![allow(unused)]
fn main() {
warn!("Debug info: variable = {:?}", some_variable);
warn!("Checkpoint reached in function_name");
warn!("Processing entry: {}", entry_hash);
}

📊 Test File Structure

tests/src/nondominium/
├── person/                           # bun tests person
│   ├── person-foundation-tests.test.ts
│   ├── person-integration-tests.test.ts
│   ├── person-scenario-tests.test.ts
│   └── person-capability-based-sharing.test.ts
├── resource/                         # bun tests resource
│   ├── resource-foundation-tests.test.ts
│   ├── resource-integration-tests.test.ts
│   ├── resource-scenario-tests.test.ts
│   └── resource-update-test.test.ts
├── governance/                       # bun tests governance
│   ├── governance-foundation-tests.test.ts
│   └── ppr-system/                   # bun tests ppr
│       ├── ppr-foundation.test.ts
│       ├── ppr-integration.test.ts
│       ├── ppr-scenarios.test.ts
│       ├── ppr-cryptography.test.ts
│       └── ppr-debug.test.ts
└── misc/                             # bun tests misc
    └── misc.test.ts
  1. Feature Development: bun tests --watch <feature-area>
  2. Specific Test Debugging: bun tests --reporter=verbose <specific-test>
  3. Pre-commit Validation: bun tests foundation && bun tests --typecheck
  4. Full Validation: bun tests && bun tests --coverage

🔍 Pattern Matching Rules

The bun tests command uses Vitest's file filtering:

  • Prefix Matching: bun tests person matches all files starting with "person-"
  • Partial Matching: bun tests foundation matches all files containing "foundation"
  • Specific Files: Use unique parts of filenames for precise selection
  • Multiple Patterns: Chain multiple patterns for broader coverage

Performance Tips

  • Use Specific Patterns: bun tests person-foundation is faster than bun tests person
  • Foundation First: Run foundation tests before integration/scenario tests
  • Parallel Execution: Tests run in parallel by default for maximum speed
  • Verbose Output: Use --reporter=verbose for debugging but not for routine runs

All commands run from the project root and automatically handle the complete build → test cycle! 🚀

Environment: Requires Nix development environment (nix develop) for Holochain binaries.

Artcoin

Main doc

https://docs.google.com/document/d/12HMYNECezq2dDXDb4FZ-hY7s6zNp_bJyA_l7Z6i2xLE/edit?tab=t.0

Project page

Nondominium Support for Artcoin

1. Summary of Artcoin in the Context of Nondominium

Artcoin (also referred to as the Internet of Art or IoA) is a proposed platform designed to disintermediate the art market and enable the scalable circulation of artworks. It builds upon the "Soogart" and "L'Artoteque" models, where artworks are displayed in public and private venues (restaurants, offices, cafes) rather than traditional galleries, allowing the public to discover, enjoy, rent, or adopt art in their daily environments.

In the context of Nondominium, Artcoin represents a specific Resource Domain. The core philosophy of Artcoin—making art accessible, creating a sharing economy for creative works, and ensuring fair compensation for creators—aligns perfectly with Nondominium's goals of creating organization-agnostic, uncapturable, and self-governed resources.

By leveraging Nondominium's infrastructure, Artcoin can transition from a centralized or low-tech agency model to a fully distributed, peer-to-peer ecosystem where:

  • Artworks are treated as Nondominium Resources, governed by embedded rules rather than a central authority.
  • Artists retain ownership and control over their work while enabling permissionless access for display and transport.
  • Venues (Custodians) act as Primary Accountable Agents, managing the physical custody of the art.
  • Reputation for all parties (artists, venues, transporters) is tracked via Private Participation Receipts (PPRs), ensuring trust without a middleman.

2. Supporting Artcoin with Nondominium

Nondominium provides the necessary primitives to model the entire lifecycle of an artwork within the Artcoin ecosystem, from creation to display, and finally to adoption or return.

Core Agents and Roles

The Artcoin ecosystem maps directly to Nondominium's Agent types:

  • Artists (Accountable Agents):

    • Create ResourceSpecifications for their art (defining the "Artcoin" resource type).
    • Create Economic Resources (the physical artworks).
    • Define governance rules (e.g., "70% of sale price goes to artist," "Rent is $30/month," "Must be displayed in smoke-free environment").
  • Venue Owners (Primary Accountable Agents / Custodians):

    • Restaurant or cafe owners who act as Custodians.
    • They accept Commitments to store and display the art.
    • They are responsible for the well-being of the resource while in their custody.
  • Transporters (Accountable Agents with Transport Role):

    • Agents validated to move art between the Artist's studio and the Venue, or between Venues.
    • Requires a validated Transport Role (likely requiring proof of insurance or vehicle suitability).
  • Public / Art Lovers (Simple or Accountable Agents):

    • Discover art in Venues.
    • Can "adopt" (buy) or rent art.
    • Initiate Use Processes (viewing/renting) or Transfer Processes (adopting).

Core Processes and Transactions

Nondominium's Economic Processes can model the circulation of art:

1. Onboarding and Creation

  • Artist creates a ResourceSpecification for a collection (e.g., "Oil on Canvas 2025").
  • Artist creates an EconomicResource for a specific painting. The resource starts in the Artist's custody.

2. Distribution (Artist to Venue)

  • Venue Owner signals interest in displaying the art.
  • Transport Process:
    • A Transporter commits to move the painting from Artist to Venue.
    • Custody Transfer: The Artist transfers custody to the Transporter (generating a CustodyTransfer PPR).
    • The Transporter delivers to the Venue.
    • Custody Acceptance: The Venue Owner accepts custody (generating a CustodyAcceptance PPR).
    • The painting is now "In Storage/Display" at the Venue.

3. Display and Renting (The "Soogart" Model)

  • Use Process (Display): The Venue "uses" the art to enhance their space.
    • Governance rules might stipulate a rental fee paid to the Artist.
    • This is modeled as a continuous Use process or periodic AccessForUse events.
  • Discovery: A Patron (Simple Agent) visits the restaurant and scans a QR code (linked to the Nondominium entry) to view the painting's history, artist profile, and price.

4. Adoption (Transaction)

  • Scenario: A Patron decides to buy ("adopt") the painting.
  • Commitment: The Patron makes a Commitment to transfer value (if integrated with a payment system) or simply commits to the "Adoption" rules.
  • Validation: The Venue Owner (Custodian) validates the transaction.
  • Transfer:
    • The Venue Owner initiates a Transfer Process.
    • Custody is transferred from Venue to Patron.
    • Ownership rights (if applicable in the governance rules) are updated.
    • Revenue Sharing: If the system handles value flows (Phase 3), the payment is split according to the embedded GovernanceRule (e.g., 70% Artist, 20% Venue, 10% Protocol/DAO).

Governance and Trust

  • Reputation: If a Venue damages a painting, their Reliability Score drops (via PPRs). Artists can filter Venues based on this score.
  • Validation: High-value art might require Multi-Reviewer Validation (REQ-GOV-06) before a custody transfer is finalized.
  • Hard to Clone: The digital twin (Nondominium entry) proves the authenticity of the physical piece, solving provenance issues.

By using Nondominium, Artcoin becomes a self-governed, capture-resistant ecosystem where the value flows directly between the creators and the custodians/appreciators, fulfilling the vision of a "true sharing economy" for art.

Distributed journalism — citizen investigation

Source: Citizen Investigation (Google Doc, via MCP).

This note summarizes that document: a design-oriented treatment of peer-to-peer (P2P) citizen investigations as organizational and socio-technical systems—framed as analysis of decentralized sense-making under pressure, not as operational guidance.

Framing

The text argues that decentralized investigations should be modeled as distributed sense-making protocols, not as conventional media production. Centralized “citizen” efforts that hinge on one visible coordinator recreate a Napster-style failure mode (single choke point for pressure, law, and economics); a BitTorrent-style pattern spreads initiation, visibility, and monetization so no one node is required for the process to continue.

Conceptual model (defensive P2P)

  • Pattern: Central control and intermediaries become choke points; demand diverges; repression targets visible nodes; protocols can replace platforms. P2P is framed here primarily as defensive (smaller attack surface), not only as emancipation.
  • Design goals: Initiation does not imply ownership; visibility does not imply control; contribution is not tied to public attribution by default; leadership is process-shaped, not personality-shaped; value accrual is indirect, delayed, and distributed.
  • Infrastructure themes: Federated or protocol-level communication; content-addressed publishing and mirroring; append-only, tamper-evident evidence logs; separation of raw data, analysis, and interpretation; pseudonymous identities with reputation from contribution quality.
  • Methodology: Modular tasks (gather, verify, cross-reference, test hypotheses, synthesize); stigmergic coordination (signals on artifacts, not central directives); explicit uncertainty and coexisting interpretations; no forced consensus.
  • Governance: No final “truth” authority; validation, challenge, and revision processes; forkability of datasets and narratives as a safety valve; minimal rules (formats, review, dispute signaling).
  • Economics: Reward verification, sourcing, and methodology—not headline visibility; indirect monetization for initiators (reputation, future collaboration, voluntary patronage); avoid exclusive ownership of evidence, paywalls on raw material, and platform lock-in (commons-style peer production).
  • Culture: Norms favor evidence over authority, process over fixed outcome, forking over faction fights; anti-hero framing—visibility rotated or diffused so the system does not depend on a spokesperson.

Commons-oriented stack (architecture sketch)

The doc specifies layers: ontology (evidence artifacts, claims, analyses, reviews, forkable narratives, contributions); infrastructure (content-addressed redundant storage; separation of storage, indexing, presentation); coordination (federated or relayed messaging; subscriptions to objects/claims); identity (pseudonymous crypto IDs; non-transferable, non-financial-by-default reputation—references to ideas like Flowsta in the original); methodology (artifact fingerprinting/time-stamping; claims that reference artifacts and decay if unmaintained; validation as privileged labor); governance (no editorial sovereign; forking as governance; boundary rules without defining “truth”); economics (monetize labor and infrastructure, not access to evidence/claims; contribution accounting with value signals that can connect to external settlement); culture (anti-celebrity UI, epistemic humility, defensive participant mindset). It explicitly asks whether stacks like Nondominium / ValueFlows could map to this.

Concrete tool landscape (excerpt)

The document surveys social protocols (e.g. Nostr, ActivityPub/Fediverse, AT Protocol, Farcaster, SSB), storage (IPFS, Filecoin, Arweave, blog tooling), and collaboration/leaks (Matrix, SecureDrop, encrypted DMs)—as a composable “off–Web2” stack for independent work.

Failure-mode analysis

Major risks analyzed include: informal re-centralization (power-law attention on a few interpreters); signal flooding (DoS on attention); ideological capture (monoculture, moralized review); economic capture via funders; legal chilling through identification; procedural ossification; fork fatigue without shared evidence pools; reputational laundering; success-induced capture (institutional absorption). The meta-point: dominant failure is often re-institutionalization, not raw shutdown. Design heuristic: mechanisms that maximize efficiency often raise capture risk; resilience favors redundancy, friction, plurality, and procedural humility.

Economics of creators and “independent investigators”

A long tab reviews influencer business models (platform ads, sponsorships, affiliates, products, subscriptions, IP, hybrids) and contrasts them with independent investigator models (direct audience funding, grants, ideological or hybrid outlets, platform monetization, merchandise, consultancy, crowdsourced investigation). It discusses competitive fragmentation in decentralized media (attention markets, tournament dynamics, Nash-style equilibria favoring conflict) and outlines a Decentralized Media Commons (DMC) direction: OVN- and DAO-inspired ideas—shared infrastructure, contribution accounting, reputation, and incentives that make collaboration economically rational (with references to commons-based peer production, Sensorica-style OVNs, and tooling such as ValueFlows / SourceCred-style accounting in the blueprint).

Closing thread

The piece ends by arguing that much infrastructure already exists; the open question is whether participants adopt coordination and value models that treat investigation as a shared epistemic substrate rather than a sequence of branded media products.


Nondominium in this context

Nondominium is a Holochain application that implements ValueFlows-shaped, agent-centric resource sharing with embedded governance and Private Participation Receipts (PPRs) for participation-backed reputation. It is explicitly aimed at a peer sharing economy and uncapturable, collaboratively governed resources (see README.md, requirements.md, and DOCUMENTATION_INDEX.md). Citizen investigation appears among the project’s adjacent application targets in strategic_development.md.

What is implemented today (relevant capabilities)

At a high level, the codebase delivers a three-zome split—person (identity, roles, capabilities, private-data access), resource (resource specifications and EconomicResource state as the data layer), governance (rule evaluation, commitments, economic events, claims, validation, PPR issuance)—documented in the index and zome docs.

For distributed investigation–style workflows, the following are concrete affordances:

  • Agents and membranes: Public profiles and pseudonymous operation, role assignments, capability progression (e.g. Simple → Accountable → Primary Accountable), and time-bounded private data sharing—so participants can separate “public investigator” presence from sensitive fields without a central account database.
  • Resources as first-class objects: ResourceSpecification and EconomicResource with lifecycle and governance rules attached to resources—suitable for modeling investigation bundles (e.g. a dataset, a verified extract, a collaborative case file) as resources whose access, transfer, and process use are rule-governed rather than platform-governed.
  • Auditability and contribution structure: Commitments, economic events, and claims provide a traceable record of who did what to which resource and when—aligned with the Citizen Investigation doc’s emphasis on provenance, modular tasks, and accounting for verification labor rather than only narrative output.
  • Peer validation: Multi-reviewer validation workflows (e.g. N-of-M) and governance-driven transitions support collective checking without a single editorial authority—overlapping the doc’s “validation / challenge / revision” and “review as labor” themes.
  • Reputation from participation, not vanity metrics: PPRs (multi-category participation receipts tied to economic activity) are designed so reputation accrues from signed participation in flows, not from follower counts—closer to “review reputation” and contribution quality than to influencer economics.

The Svelte UI and Tryorama test suites exercise these paths end-to-end for the resource sharing domain; applying the same primitives to journalism-specific resource specs and governance patterns is largely a modeling and UX exercise on top of existing APIs.

What is planned or in flight (how the fit improves)

Roadmap and architecture docs describe directions that strengthen the match to commons-based and OVN-style investigation economics:

  • hREA integration (integration-strategy.md): richer ValueFlows types and cross-DNA economic operations—useful when investigations need full VF graphs (processes, agreements, fuller commitment/event semantics) while keeping governance and PPR generation atomic with events.
  • NDO / generic object model (ndo_prima_materia.md): a more explicit Nondominium Object lifecycle, capability surface, and migration story—relevant if “evidence artifact / claim / narrative fork” become first-class product concepts beyond today’s resource-centric MVP.
  • Optional post-MVP bridges: Unyt (economic settlement / proofs) and Flowsta (portable identity across apps)—sketched in post-mvp/—for teams that want external settlement or cross-app identity without re-centralizing the investigation graph.

Requirements also spell out post-MVP agent and organization modeling (collectives, projects, bots, affiliation rules); today’s MVP emphasizes individual agents, so newsroom- or collective-as-agent patterns are design targets, not fully realized in code yet.

How this maps to the Citizen Investigation stack

The Google Doc asks for a protocolized commons: separation of raw data / analysis / interpretation, stigmergic coordination on artifacts, forkability, contribution accounting, and defensive economics. Nondominium does not replace broadcast (Nostr, Fediverse), large-file permanence (IPFS, Arweave), or anonymous drops (SecureDrop)—those remain complementary layers. Where it does plug in is as a coordination and accounting substrate:

Citizen investigation themeRole of Nondominium
No single owner of the investigation graphPeer-hosted Holochain data; governance on resources instead of a platform operator
Traceable contributions and verification laborEconomic events, commitments, PPRs, validation workflows
Reputation without “hero” centralityPPR categories and role/capability progression tied to validated participation
Forkable interpretationsComposable resources and distinct resource specs / instances can represent parallel lines of inquiry; fuller fork semantics may deepen with NDO/hREA
Commons-compatible value flowsValueFlows alignment and planned hREA depth for OVN-style value accounting

In short: Nondominium can serve citizen investigation and distributed journalism as the Holochain-native layer for governed shared resources, auditable contributions, and participation-based reputation—with public narrative and bulk evidence storage still typically composed from federated or content-addressed tools the stack was designed to interoperate with conceptually, not to duplicate wholesale.

ERP-Holochain Bridge: Connecting ERPLibre to Nondominium

1. Introduction

This document outlines a strategy for bridging traditional Enterprise Resource Planning (ERP) systems with Nondominium's peer-to-peer resource-sharing infrastructure using a Node.js Bridge Service powered by the official @holochain/client library. The goal is to enable organizations using centralized ERP systems to participate in decentralized resource economies without abandoning their existing business infrastructure.

2. Problem Statement

2.1 The Challenge

Organizations currently manage their inventory, equipment, and resources using centralized ERP systems (e.g., Odoo, SAP, ERPNext). While these systems excel at internal management, they create data silos that prevent resource sharing across organizational boundaries.

Current limitations:

  • No cross-organizational visibility: Organization A cannot see if Organization B has idle equipment that could be borrowed.
  • Trust barriers: Ad-hoc resource sharing requires manual coordination, legal contracts, and trust-building overhead.
  • Platform dependency: Centralized marketplaces (e.g., equipment rental platforms) extract rent and control access.
  • Data sovereignty concerns: Organizations are reluctant to upload sensitive inventory data to third-party platforms.

2.2 The Opportunity

Nondominium offers a peer-to-peer, organization-agnostic resource-sharing layer that can complement existing ERP systems:

  • Resources can be selectively published from ERP inventory to Nondominium without migrating away from the ERP.
  • Organizations retain full sovereignty over their data and participation.
  • Reputation tracking (PPR system) replaces heavy legal contracts with cryptographic accountability.
  • Emergent coordination via stigmergy reduces the need for manual negotiation.

3. The ERPLibre Context

3.1 What is ERPLibre?

ERPLibre is an open-source "soft fork" of Odoo Community Edition, released under the AGPLv3 license. It automates deployment, development, and maintenance of Odoo.

Key characteristics:

  • Language: Python (backend), JavaScript (frontend)
  • Architecture: Monolithic web application with PostgreSQL database
  • Modules: Inventory management, sales, purchases, accounting, manufacturing
  • API: XML-RPC and JSON-RPC endpoints
  • Deployment: Docker-based, with docker-compose.yml for easy setup

3.2 ERPLibre Inventory Management

ERPLibre (via Odoo) manages inventory through:

  • Product Templates: Define product specifications (SKU, name, category, unit of measure)
  • Product Variants: Specific instances of products (size, color, etc.)
  • Stock Locations: Warehouses, storage zones, etc.
  • Stock Moves: Transfers between locations, with full traceability
  • Quants: Quantities on hand for each product/location combination

Relevant Odoo Models:

  • product.product: Individual products
  • stock.quant: Available quantities per location
  • stock.move: Movement history and planned transfers
  • stock.warehouse: Physical locations

4. The Nondominium Context

4.1 What Nondominium Offers

Nondominium is a Holochain-based, ValueFlows-compliant application for distributed resource management:

  • Agent-centric: Each organization runs its own node
  • Peer-to-peer: No central server; resources exist in a shared DHT
  • Embedded governance: Rules are encoded in ResourceSpecifications
  • Reputation layer: Private Participation Receipts (PPRs) track reliability

4.2 Key Data Structures

To bridge ERP inventory to Nondominium, we need to map:

ERP ConceptNondominium ConceptNotes
Product TemplateResourceSpecificationDefines what can be shared
Product VariantEconomicResourceSpecific instance available for sharing
Stock LocationResource location fieldWhere the resource is physically located
Available Quantityquantity in EconomicResourceHow much is available
Stock MoveEconomicEvent (Transfer, Use)History of resource movements

5. Implementation Scope

5.1 Minimal Viable Demonstration

Objective: Demonstrate that inventory from two organizations running ERPLibre can be synchronized to Nondominium and made discoverable for sharing.

Scenario:

  1. Organization A has a 3D printer listed in its ERPLibre inventory
  2. Organization B has a laser cutter listed in its ERPLibre inventory
  3. Both organizations publish their available equipment to Nondominium via the Node.js Bridge
  4. Each organization can discover the other's equipment via Nondominium
  5. Organization B initiates a Use process for Organization A's 3D printer
  6. The usage is recorded as an EconomicEvent in Nondominium
  7. Real-time signals notify Organization A of the resource usage
  8. The usage is reflected back to Organization A's ERPLibre as a "Loan" or "External Use" stock move

5.2 Requirements

Functional Requirements:

  • FR-1: Read inventory data from ERPLibre via its API
  • FR-2: Map ERPLibre products to Nondominium ResourceSpecification entries
  • FR-3: Publish selected inventory items as EconomicResource entries in Nondominium
  • FR-4: Query Nondominium for available resources from other organizations
  • FR-5: Initiate a Use process in Nondominium for a discovered resource
  • FR-6: Record the EconomicEvent and generate PPRs for both parties
  • FR-7: Subscribe to Holochain signals for real-time updates
  • FR-8: Handle bidirectional sync (Nondominium → ERPLibre)

Non-Functional Requirements:

  • NFR-1: The bridge should not require modifications to ERPLibre core code
  • NFR-2: The bridge should be deployable as a separate service/container
  • NFR-3: Support real-time synchronization via WebSocket signals
  • NFR-4: Handle proper zome call signing and capability management
  • NFR-5: Provide caching, batching, and retry logic

6. Bridge Architecture: Node.js Bridge Service

6.1 Architecture Overview

The bridge uses a Node.js service that wraps the official @holochain/client library to provide a RESTful API for ERPLibre while maintaining full WebSocket connectivity to Holochain.

Architecture:

ERPLibre (Python) <--HTTP/JSON--> Node.js Bridge (@holochain/client) <--WebSocket--> Holochain Conductor <--> Nondominium DHT

Key Components:

  1. Node.js Bridge Service: Express/Fastify server exposing RESTful endpoints
  2. @holochain/client: Official Holochain WebSocket client
  3. Webhook Handler: Push real-time signals from Holochain to ERPLibre
  4. Cache Layer: Redis for frequently accessed data
  5. Queue System: Bull/BullMQ for async operations

6.2 Why Node.js Bridge?

Advantages:

  • Full feature support: Access to all @holochain/client features (signals, zome call signing, etc.)
  • Real-time signals: Subscribe to Holochain signals and push to ERPLibre via webhooks or SSE
  • Official library: Maintained by Holochain core team with ongoing support
  • Flexible: Can customize bridge logic (caching, batching, request aggregation)
  • Production-ready: Built-in error handling, retry logic, and connection management
  • Proper signing: Full control over zome call signing and capability token management

Trade-offs:

  • ⚠️ Extra runtime: Requires Node.js alongside Python
  • ⚠️ Custom code: Need to write and maintain the bridge service
  • ⚠️ Polyglot stack: Python + Node.js + Holochain

HTTP Gateway (hc-http-gw):

  • ❌ Limited to GET requests with Base64-encoded payloads
  • ❌ No native signal support
  • ❌ Requires workarounds for RESTful patterns
  • ❌ Performance constraints (single call per request)

Direct Python WebSocket Client:

  • ❌ Must implement entire Conductor API protocol
  • ❌ Complex Ed25519 signing in Python
  • ❌ High maintenance burden (no official client)
  • ❌ Must track Holochain protocol changes

7. Node.js Bridge Implementation

7.1 Core Bridge Service

// bridge-service.js
import { AppWebsocket, AdminWebsocket } from '@holochain/client';
import express from 'express';
import { createClient } from 'redis';
import Bull from 'bull';

class NondominiumBridge {
  constructor(config) {
    this.appWs = null;
    this.adminWs = null;
    this.redis = createClient({ url: config.redisUrl });
    this.queue = new Bull('nondominium', config.redisUrl);
    this.config = config;
  }

  async connect() {
    // Connect to Holochain Admin API
    this.adminWs = await AdminWebsocket.connect({
      url: new URL(this.config.adminWsUrl),
      wsClientOptions: { origin: this.config.appId }
    });

    // Connect to App WebSocket
    const token = await this.adminWs.issueAppAuthenticationToken({
      installed_app_id: this.config.appId
    });

    this.appWs = await AppWebsocket.connect({
      url: new URL(this.config.appWsUrl),
      token: token.token,
      wsClientOptions: { origin: this.config.appId }
    });

    // Subscribe to signals
    this.appWs.on('signal', this.handleSignal.bind(this));

    await this.redis.connect();
    console.log('Bridge connected to Holochain and Redis');
  }

  async handleSignal(signal) {
    console.log('Received signal:', signal);
    // Push signal to ERPLibre via webhook
    await this.notifyERPLibre(signal);
  }

  async notifyERPLibre(signal) {
    // POST to ERPLibre webhook endpoint
    const response = await fetch(this.config.erpWebhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        type: signal.data.type,
        payload: signal.data.payload
      })
    });
    console.log('Notified ERPLibre:', response.status);
  }

  async callZome(cellId, zomeName, fnName, payload) {
    const cacheKey = `zome:${zomeName}:${fnName}:${JSON.stringify(payload)}`;
    
    // Check cache for read operations
    if (fnName.startsWith('get_')) {
      const cached = await this.redis.get(cacheKey);
      if (cached) return JSON.parse(cached);
    }

    try {
      const result = await this.appWs.callZome({
        cell_id: cellId,
        zome_name: zomeName,
        fn_name: fnName,
        payload: payload
      }, 30000);

      // Cache read operations
      if (fnName.startsWith('get_')) {
        await this.redis.setEx(cacheKey, 300, JSON.stringify(result));
      }

      return result;
    } catch (error) {
      console.error('Zome call failed:', error);
      throw error;
    }
  }

  async createResource(cellId, specHash, quantity, unit, custodian) {
    return this.callZome(cellId, 'zome_resource', 'create_economic_resource', {
      conforms_to: specHash,
      quantity: quantity,
      unit: unit,
      custodian: custodian
    });
  }

  async searchResources(cellId, query = null) {
    return this.callZome(cellId, 'zome_resource', 'get_all_resources', {
      query: query
    });
  }

  async initiateUseProcess(cellId, resourceHash, receiver, startTime, endTime) {
    return this.callZome(cellId, 'zome_resource', 'initiate_use_process', {
      resource_hash: resourceHash,
      receiver: receiver,
      start_time: startTime,
      end_time: endTime
    });
  }

  async getReputationSummary(cellId, agentId) {
    return this.callZome(cellId, 'zome_gouvernance', 'get_reputation_summary', {
      agent: agentId
    });
  }
}

// Initialize bridge
const bridge = new NondominiumBridge({
  adminWsUrl: process.env.HC_ADMIN_WS_URL || 'ws://localhost:8000',
  appWsUrl: process.env.HC_APP_WS_URL || 'ws://localhost:8888',
  appId: process.env.HC_APP_ID || 'nondominium',
  redisUrl: process.env.REDIS_URL || 'redis://localhost:6379',
  erpWebhookUrl: process.env.ERP_WEBHOOK_URL || 'http://localhost:8069/nondominium/webhook'
});

await bridge.connect();

7.2 REST API Endpoints

// api-routes.js
const app = express();
app.use(express.json());

// Helper to extract cell_id from request
function getCellId(req) {
  return [req.body.dna_hash || req.query.dna_hash, req.body.agent_key || req.query.agent_key];
}

// Resource Management
app.post('/api/resources', async (req, res) => {
  try {
    const cellId = getCellId(req);
    const result = await bridge.createResource(
      cellId,
      req.body.spec_hash,
      req.body.quantity,
      req.body.unit,
      req.body.custodian
    );
    res.json({ success: true, data: result });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});

app.get('/api/resources', async (req, res) => {
  try {
    const cellId = getCellId(req);
    const resources = await bridge.searchResources(cellId, req.query.q);
    res.json({ success: true, data: resources });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});

app.post('/api/resources/:hash/use', async (req, res) => {
  try {
    const cellId = getCellId(req);
    const result = await bridge.initiateUseProcess(
      cellId,
      req.params.hash,
      req.body.receiver,
      req.body.start_time,
      req.body.end_time
    );
    res.json({ success: true, data: result });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});

// Reputation
app.get('/api/reputation/:agent_id', async (req, res) => {
  try {
    const cellId = getCellId(req);
    const summary = await bridge.getReputationSummary(cellId, req.params.agent_id);
    res.json({ success: true, data: summary });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});

// Batch operations
app.post('/api/batch', async (req, res) => {
  try {
    const cellId = getCellId(req);
    const results = await Promise.all(
      req.body.operations.map(op => 
        bridge.callZome(cellId, op.zome, op.function, op.payload)
      )
    );
    res.json({ success: true, data: results });
  } catch (error) {
    res.status(500).json({ success: false, error: error.message });
  }
});

// Health check
app.get('/health', (req, res) => {
  res.json({ 
    status: 'ok', 
    holochain: bridge.appWs ? 'connected' : 'disconnected',
    redis: bridge.redis.isOpen ? 'connected' : 'disconnected'
  });
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Bridge service running on port ${PORT}`);
});

8. ERPLibre Integration

8.1 Reading ERPLibre Inventory (Python)

import xmlrpc.client
import requests
import os

class ERPLibreNondominiumSync:
    def __init__(self, erp_url, erp_db, erp_user, erp_password, bridge_url):
        self.erp_url = erp_url
        self.erp_db = erp_db
        self.erp_user = erp_user
        self.erp_password = erp_password
        self.bridge_url = bridge_url
        
        # Authenticate with ERPLibre
        common = xmlrpc.client.ServerProxy(f'{erp_url}/xmlrpc/2/common')
        self.uid = common.authenticate(erp_db, erp_user, erp_password, {})
        self.models = xmlrpc.client.ServerProxy(f'{erp_url}/xmlrpc/2/object')
    
    def get_available_products(self):
        """Fetch products with available quantity from ERPLibre"""
        products = self.models.execute_kw(
            self.erp_db, self.uid, self.erp_password,
            'product.product', 'search_read',
            [[('qty_available', '>', 0)]],
            {'fields': ['name', 'default_code', 'qty_available', 'uom_id', 'categ_id']}
        )
        return products
    
    def publish_to_nondominium(self, product, dna_hash, agent_key):
        """Publish a single product to Nondominium via Node.js bridge"""
        # Create ResourceSpecification
        spec_payload = {
            'dna_hash': dna_hash,
            'agent_key': agent_key,
            'name': product['name'],
            'description': f"SKU: {product['default_code']}",
            'category': product['categ_id'][1] if product['categ_id'] else 'General',
            'governance_rules': []
        }
        
        spec_response = requests.post(
            f"{self.bridge_url}/api/resource-specifications",
            json=spec_payload
        )
        spec_response.raise_for_status()
        spec_hash = spec_response.json()['data']
        
        # Create EconomicResource
        resource_payload = {
            'dna_hash': dna_hash,
            'agent_key': agent_key,
            'spec_hash': spec_hash,
            'quantity': product['qty_available'],
            'unit': product['uom_id'][1],
            'custodian': agent_key
        }
        
        resource_response = requests.post(
            f"{self.bridge_url}/api/resources",
            json=resource_payload
        )
        resource_response.raise_for_status()
        
        # Store Nondominium hash in ERPLibre product
        resource_hash = resource_response.json()['data']
        self.models.execute_kw(
            self.erp_db, self.uid, self.erp_password,
            'product.product', 'write',
            [[product['id']], {'x_nondominium_hash': resource_hash}]
        )
        
        return resource_hash
    
    def sync_all_products(self, dna_hash, agent_key):
        """Sync all available products to Nondominium"""
        products = self.get_available_products()
        results = []
        
        for product in products:
            try:
                resource_hash = self.publish_to_nondominium(product, dna_hash, agent_key)
                results.append({
                    'product_id': product['id'],
                    'product_name': product['name'],
                    'resource_hash': resource_hash,
                    'status': 'success'
                })
                print(f"✓ Published: {product['name']}")
            except Exception as e:
                results.append({
                    'product_id': product['id'],
                    'product_name': product['name'],
                    'error': str(e),
                    'status': 'failed'
                })
                print(f"✗ Failed: {product['name']} - {e}")
        
        return results

# Usage
sync = ERPLibreNondominiumSync(
    erp_url='http://localhost:8069',
    erp_db='erplibre_db',
    erp_user='admin',
    erp_password='admin',
    bridge_url='http://localhost:3000'
)

results = sync.sync_all_products(
    dna_hash=os.getenv('NONDOMINIUM_DNA_HASH'),
    agent_key=os.getenv('ORGANIZATION_AGENT_KEY')
)

8.2 ERPLibre Webhook Handler (Python)

# odoo_addon/nondominium_bridge/controllers/webhook.py
from odoo import http
from odoo.http import request
import logging

_logger = logging.getLogger(__name__)

class NondominiumWebhook(http.Controller):
    
    @http.route('/nondominium/webhook', type='json', auth='none', methods=['POST'], csrf=False)
    def handle_signal(self, **kwargs):
        """Handle real-time signals from Nondominium via Node.js bridge"""
        data = request.jsonrequest
        signal_type = data.get('type')
        payload = data.get('payload')
        
        _logger.info(f"Received Nondominium signal: {signal_type}")
        
        if signal_type == 'resource.use.initiated':
            self._handle_resource_use(payload)
        elif signal_type == 'resource.transferred':
            self._handle_resource_transfer(payload)
        elif signal_type == 'ppr.issued':
            self._handle_ppr_update(payload)
        
        return {'status': 'ok'}
    
    def _handle_resource_use(self, payload):
        """Update ERPLibre when a resource is used"""
        resource_hash = payload.get('resource_hash')
        receiver = payload.get('receiver')
        
        # Find product by Nondominium hash
        Product = request.env['product.product'].sudo()
        product = Product.search([('x_nondominium_hash', '=', resource_hash)], limit=1)
        
        if product:
            # Create a stock move for "External Use"
            StockMove = request.env['stock.move'].sudo()
            StockMove.create({
                'name': f'Nondominium Use: {receiver}',
                'product_id': product.id,
                'product_uom_qty': 1,
                'product_uom': product.uom_id.id,
                'location_id': product.property_stock_production.id,
                'location_dest_id': request.env.ref('stock.stock_location_customers').id,
                'state': 'done'
            })
            _logger.info(f"Created stock move for product {product.name}")
    
    def _handle_resource_transfer(self, payload):
        """Update custody when resource is transferred"""
        # Update internal tracking
        pass
    
    def _handle_ppr_update(self, payload):
        """Update organization reputation score"""
        # Update reputation field in res.partner or custom model
        pass

9. Deployment Architecture

9.1 Docker Compose Setup

# docker-compose.yml
version: '3.8'

services:
  erplibre:
    image: erplibre/erplibre:latest
    ports:
      - "8069:8069"
    environment:
      - POSTGRES_HOST=postgres
      - POSTGRES_DB=erplibre
    depends_on:
      - postgres

  holochain:
    image: holochain/holochain:latest
    ports:
      - "8000:8000"  # Admin WebSocket
      - "8888:8888"  # App WebSocket
    volumes:
      - ./nondominium.happ:/happ/nondominium.happ
      - holochain_data:/data
    command: holochain -c /data/conductor-config.yml

  bridge:
    build: ./bridge-service
    ports:
      - "3000:3000"
    environment:
      - HC_ADMIN_WS_URL=ws://holochain:8000
      - HC_APP_WS_URL=ws://holochain:8888
      - HC_APP_ID=nondominium
      - REDIS_URL=redis://redis:6379
      - ERP_WEBHOOK_URL=http://erplibre:8069/nondominium/webhook
    depends_on:
      - holochain
      - redis

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"

  postgres:
    image: postgres:14-alpine
    environment:
      - POSTGRES_DB=erplibre
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  holochain_data:
  postgres_data:

9.2 Bridge Service Dockerfile

# bridge-service/Dockerfile
FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY . .

EXPOSE 3000

CMD ["node", "index.js"]

10. Implementation Roadmap

Phase 1: Foundation (Week 1-2)

  • ✅ Set up development environment (Docker Compose)
  • ✅ Deploy ERPLibre, Holochain, and Nondominium hApp
  • ✅ Implement core Node.js Bridge Service with @holochain/client
  • ✅ Create basic REST API endpoints
  • ✅ Test WebSocket connectivity and signal handling

Phase 2: ERP Integration (Week 3-4)

  • ✅ Implement Python sync script for ERPLibre inventory
  • ✅ Create ERPLibre webhook handler for real-time updates
  • ✅ Implement bidirectional data mapping
  • ✅ Add error handling and retry logic
  • ✅ Test with 2 organizations and cross-organizational discovery

Phase 3: Advanced Features (Week 5-6)

  • ✅ Implement batch operations for bulk sync
  • ✅ Add caching layer (Redis) for performance
  • ✅ Implement queue system for async operations
  • ✅ Add proper zome call signing with delegation support
  • ✅ Create PPR reputation dashboard integration

Phase 4: Production Readiness (Week 7-8)

  • ✅ Add comprehensive logging and monitoring
  • ✅ Implement health checks and alerting
  • ✅ Security audit and penetration testing
  • ✅ Load testing and performance optimization
  • ✅ Documentation and deployment guides

11. Next Steps

  1. Organizational Delegation: Implement the delegation pattern where ERPLibre users act as delegates of the organization
  2. UI Integration: Build native ERPLibre module for resource discovery and management
  3. Governance Rules: Allow organizations to configure access rules via ERPLibre UI
  4. Financial Integration: Connect resource usage to invoicing and accounting modules
  5. Multi-warehouse Support: Handle complex inventory scenarios across locations
  6. Mobile App: QR code scanning for custody transfers

12. References

13. Future Architecture: Pure P2P vs. Organizational Variants

As Nondominium evolves, we envision two distinct deployment contexts: a Pure P2P context for individuals and an Organizational context (often bridged from ERPs). While the core ValueFlows logic remains consistent, the governance and identity layers diverge significantly.

The following analysis highlights key differences that may necessitate a fork or a modular architecture to support both use cases.

13.1 Identity & Delegation (The Agency Gap)

  • Pure P2P Context:

    • Structure: 1 Human = 1 Agent Key.
    • Agency: Direct. The individual is the sole signer and decision-maker.
    • Implication: Simplifies the security model. Private keys live on the user's personal device.
  • Organizational Context:

    • Structure: 1 Organization = 1 Identity (or a group of Agents).
    • Agency: Delegated. The "Agent" on the DHT represents a legal entity (e.g., "Acme Corp"), but the actual signing is done by employees (e.g., Alice, Bob).
    • Requirement: We need a Delegation Pattern.
      • Representative Keys: Employees need their own keys that are authorized to sign on behalf of the Organization's root identity.
      • Scope & Expiry: Alice might only be authorized to "Transport" resources, not "Sell" them. Bob might only be authorized to "Use" resources up to a certain value.
      • Revocation: If Alice leaves the company, her delegation must be revoked immediately without changing the Organization's identity.

13.2 Reputation (PPR) Aggregation

  • Pure P2P Context:

    • Accrual: Reputation (PPRs) sticks directly to the individual.
    • Portability: High. The user carries their reputation everywhere.
  • Organizational Context:

    • Accrual: External reputation accrues to the Organization. If Alice (the driver) delivers late, "Acme Corp" gets the negative PPR for timeliness.
    • Internal Attribution: The ERP needs to track which employee caused the outcome. Nondominium might need to include a "performed_by" field in the metadata that links to an internal employee ID (hashed/private) so the organization can audit performance without exposing internal staff structures to the public DHT.
    • Inheritance: A new employee starts with the Organization's reputation (trust by association), whereas a new P2P user starts from zero.

13.3 Governance: Autonomy vs. Policy

  • Pure P2P Context:

    • Decision Making: Ad-hoc and autonomous. "I like your profile, I'll lend you my camera."
    • Rules: Often negotiated socially or via simple template rules.
  • Organizational Context:

    • Decision Making: Policy-driven and automated.
    • Automated Governance: The ERP bridge might automatically approve requests based on strict criteria (e.g., "Borrower Credit Score > 700" AND "Inventory > 5 units").
    • Multi-Sig/Thresholds: High-value transactions (e.g., transferring a vehicle) might require signatures from 2+ delegates (e.g., Warehouse Manager + Logistics Coordinator).

13.4 Custody vs. Ownership

  • Pure P2P Context:

    • Convergence: Custody and Ownership are often the same person.
    • Transfers: Usually implies a temporary transfer of possession (lending) or permanent transfer of ownership (giving/selling).
  • Organizational Context:

    • Divergence: The Organization owns the resource, but an employee holds custody.
    • Internal Transfers: When a drill moves from the "Warehouse" to "Service Truck 4", Nondominium might not need to know (it's internal to the agent). However, if Nondominium tracks Location, these internal shifts might need to be published without triggering a "Change of Ownership" event.
    • Legal Wrapper: Interactions often imply a legal contract. The bridge might need to hash a PDF contract generated by the ERP and attach it to the Commitment or EconomicEvent.

13.5 Device Management & Security

  • Pure P2P Context:

    • Device: Personal, single-user devices.
    • Security: Biometrics or simple passwords.
  • Organizational Context:

    • Device: Shared terminals (e.g., a warehouse tablet used by 10 people) or BYOD (Bring Your Own Device).
    • Session Management: A shared device needs to support rapid "login/logout" of different delegates using the same Holochain Conductor, or manage multiple Agent keys securely.
    • IAM Integration: Corporate users expect Single Sign-On (SSO). The bridge might need to map an OAuth token (from the ERP) to a Holochain Capability Token.

See more on PEP Master https://www.sensorica.co/ventures/scientific-instruments/pep-master

To be continued...

Goal

Build a development steategy that represents the highest leverage, exploiting the sweatspot for all the adjacent possibles, which are possible applications of Nondominium.

  • Reduce friction for flows of resources between organizations that use traditional open source ERP, CMS and groupware systems.
  • Make Open and Collaborative Spaces (OCS) interoperable at the economic level.
  • Help artists spread their art more sustainably.
  • Legitimize open source DIY medical devices.
  • Power citizen journalism

All these applications are low hanging fruits for us, as we can boast 15 years of uninterrupted experience in (material) peer production, and acting as an advocate for p2p and as a catalyst to federate open and collaborative initiatives.

Ordered list of immediate applications

Ordering criteria

ToDo: define the ordering criteria and method for the list of applications.

Table ToDo: build ordered table of applications

Lowest commun denominator

ToDo: Extract the lowest commun denominator (as a list of basic features) for all the immadiate applications, while prioritizing the ones that score high on our list.

User Story: ArtCoin - Art Circulation and Discovery

Scenario: Artist Sharing Artwork Through Venues Using Nondominium

Context: An independent artist wants to circulate their paintings through a network of venues (cafes, restaurants, offices) to gain exposure and generate rental income, using the Artcoin platform built on Nondominium infrastructure. This scenario primarily demonstrates Nondominium's resource sharing capabilities, with optional extension for a more comprehensive cultural network economics.

See also artcoin_main_doc.md and Nondominium_Artcoin.md.


🏗️ System Architecture Context

Resource Sharing Focus (Nondominium Sweet Spot)

graph TB
    subgraph "Nondominium - Perfect Match for Art Circulation"
        Person[Person Zome - Artist/Venue Profiles]
        Resource[Resource Zome - Artwork Registry]
        Governance[Governance Zome - Display Rules]
        PPR[PPR Reputation System]
    end

    subgraph "Art Network Capabilities"
        Discovery[Artwork Discovery]
        Access[Venue Access Control]
        Transactions[Rental/Sales Transactions]
        Reputation[Artist/Venue Reputation]
    end

    Person --> Discovery
    Resource --> Access
    Governance --> Transactions
    PPR --> Reputation

Why Nondominium Excels for Art Networks:

  • Perfect fit for bilateral resource sharing (artwork ↔ venue)
  • PPR system captures artistic and custodial reputation effectively
  • Economic events handle rental and sales transactions cleanly
  • Governance rules protect artwork and ensure proper care

Optional Enhancement (Cultural Economics Analysis)

graph TB
    subgraph "TrueCommon - Cultural Network Analytics"
        REA[Cultural Economics Analysis]
        Impact[Social Impact Measurement]
        Accounting[Cultural Value Accounting]
        Planning[Network Growth Planning]
    end

    subgraph "Enhanced Capabilities Optional"
        ArtistDevelopment[Artist Career Tracking]
        CulturalMetrics[Community Impact Analysis]
        ValueCreation[Creative Value Measurement]
        NetworkOptimization[Venue Network Optimization]
    end

Enhancement:

  • Cultural value beyond simple rental income
  • Social impact measurement of public art access
  • Artist career development analytics
  • Community cultural enrichment metrics

🎨 The Players

Maya Rodriguez - Independent Visual Artist

  • Role: Accountable Agent (Creator & Resource Owner)
  • Goal: Circulate artwork to gain public recognition and generate sustainable income
  • Reputation: Emerging artist with growing local following, strong craftsmanship record

Jean-Pierre Dubois - Café Owner

  • Role: Primary Accountable Agent (Custodian)
  • Goal: Enhance café ambiance with rotating art while supporting local artists
  • Reputation: Established venue owner with excellent art care track record

The Artwork

  • Piece: "Urban Rhythms" - Oil on Canvas, 36" x 48"
  • Current Location: Maya's Studio, Montreal
  • Governance Rules: 70% artist commission on sales, $40/month rental fee, smoke-free display required

🔄 Art Circulation Journey

Phase 1: Artwork Creation & Onboarding (Week 1)

sequenceDiagram
    participant Maya as Maya Rodriguez
    participant Artcoin as Artcoin Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Maya->>Artcoin: Register as artist
    Artcoin->>ND: create_person_with_role(Artist)
    ND->>Res: Create artist profile

    Maya->>Artcoin: Submit artwork details
    Maya->>ND: create_resource_specification(Oil Painting)
    ND->>Res: Store art specification template

    Maya->>ND: create_economic_resource("Urban Rhythms")
    ND->>Res: Register artwork with embedded governance
    ND->>Gov: Link governance rules to artwork

Artwork Onboarding Process:

  1. Artist Registration: Maya creates her artist profile with portfolio and credentials
  2. Resource Specification: Defines artwork type (Oil on Canvas 2025 collection)
  3. Artwork Registration: Registers "Urban Rhythms" with:
  • Physical specifications (size, medium, weight)
  • High-resolution images and provenance
  • Governance rules: 70/30 split, $40/month rental, insurance requirements
  • Care instructions and display preferences

Phase 2: Venue Discovery & Matching (Week 2)

sequenceDiagram
    participant JeanPierre as Jean-Pierre Dubois
    participant Artcoin as Artcoin Platform
    participant ND as Nondominium
    participant PPR as PPR System
    participant Gov as Governance Zome

    JeanPierre->>Artcoin: Browse available artworks
    Artcoin->>ND: get_all_economic_resources()
    ND->>Res: Query available artworks
    Res-->>ND: Return artwork catalog with governance rules
    ND-->>Artcoin: Display curated selection

    JeanPierre->>Artcoin: View "Urban Rhythms" details
    Artcoin->>ND: get_governance_rule_profile(artwork_hash)
    ND->>Gov: Return governance rules and requirements

    JeanPierre->>ND: derive_reputation_summary(Maya)
    ND->>PPR: Calculate Maya's artist reputation
    PPR-->>ND: Return artist profile (3 PPRs, 4.8/5 quality)

    JeanPierre->>Artcoin: Submit display commitment
    Artcoin->>ND: propose_commitment(AccessForUse)
    ND->>Gov: Create venue display agreement

Venue Discovery Process:

  1. Artwork Browsing: Jean-Pierre searches Artcoin platform for café-appropriate artwork
  2. Artist Review: Evaluates Maya's portfolio and reputation:
  • 3 previous successful venue displays
  • 4.8/5 artwork quality rating
  • Positive venue feedback comments
  1. Governance Review: Analyzes display terms:
  • $40/month rental fee ✅
  • 70% artist commission on sales ✅
  • Smoke-free environment requirement ✅
  • Quarterly rotation option
  1. Display Commitment: Jean-Pierre submits AccessForUse commitment for 3-month initial period

Phase 3: Validation & Trust Building (Week 3)

sequenceDiagram
    participant Maya as Maya Rodriguez
    participant JeanPierre as Jean-Pierre Dubois
    participant Artcoin as Artcoin Platform
    participant ND as Nondominium
    participant PPR as PPR System

    ND->>Maya: Notify of venue interest
    Maya->>Artcoin: Review Jean-Pierre's venue profile
    Artcoin->>ND: derive_reputation_summary(JeanPierre)
    ND->>PPR: Calculate venue reputation
    PPR-->>ND: Return venue data (8 PPRs, 4.9/5 art care)

    Maya->>ND: validate_venue_for_display()
    ND->>Gov: Create validation receipt
    Gov-->>Artcoin: Display commitment approved

    JeanPierre->>ND: validate_specialized_role(VenueOperator)
    ND->>Gov: Issue venue operator validation
    Gov->>PPR: record_validation_activity()

Mutual Validation Process:

  1. Venue Vetting: Maya reviews Jean-Pierre's café reputation:
  • 8 previous art displays completed
  • 4.9/5 artwork care rating
  • No damage incidents in 2 years
  • Active art promotion on social media
  1. Insurance Verification: Jean-Pierre provides liability insurance certificate
  2. Display Agreement: Both parties sign smart contract with automated revenue sharing
  3. Trust Confirmation: PPR system records mutual validation for future partnerships

Phase 4: Artwork Preparation & Transport (Week 4)

stateDiagram-v2
    [*] --> InStudio: "Urban Rhythms" created
    InStudio --> ReservedForDisplay: Display commitment approved
    ReservedForDisplay --> PreparedForTransport: Maya prepares artwork
    PreparedForTransport --> InTransit: Transporter initiated
    InTransit --> InstalledAtVenue: Delivery completed

    note right of ReservedForDisplay
        Artwork status: Available → Reserved
        Display agreement activated
        Insurance verification complete
    end note

    note right of PreparedForTransport
        Maya signs artwork certificate
        Transport logistics arranged
        Installation instructions prepared
    end note

Transport & Installation:

  1. Artwork Preparation: Maya prepares "Urban Rhythms" for transport:
  • Professional packaging and framing
  • Certificate of authenticity signed
  • Installation and care instructions
  1. Transport Coordination: Verified transport agent arranges delivery
  2. Custody Transfer: Maya transfers custody to transport agent (CustodyTransfer PPR)
  3. Venue Installation: Transport agent delivers and installs artwork at café
  4. Acceptance Confirmation: Jean-Pierre accepts custody (CustodyAcceptance PPR)

Phase 5: Public Display & Engagement (Months 1-3)

graph LR
    subgraph "Display Process"
        A[Artwork Installed] --> B[Public Discovery]
        B --> C[Engagement Tracking]
        C --> D[Rental Revenue]
        D --> E[Monthly PPRs]
    end

    subgraph "Engagement Metrics"
        F[QR Code Scans]
        G[Social Media Shares]
        H[Viewer Comments]
        I[Sales Inquiries]
    end

    C --> F
    C --> G
    C --> H
    C --> I

Public Display Experience:

  1. Physical Installation: "Urban Rhythms" prominently displayed in café seating area
  2. Digital Integration: QR code links to artwork's Nondominium profile showing:
  • Artist biography and artistic statement
  • Previous display history and public engagement
  • Purchase inquiries and rental information
  • Authenticity verification and provenance
  1. Engagement Tracking: Platform monitors:
  • Daily viewer interactions via QR code scans
  • Social media mentions and shares
  • Sales inquiries and appreciation requests
  • Public comments and ratings
  1. Monthly Revenue: Automated payment processing with 70/30 revenue split

Phase 6: Extended Discovery & Sales Opportunity (Month 2)

sequenceDiagram
    participant Patron as Art Patron
    participant JeanPierre as Jean-Pierre Dubois
    participant Artcoin as Artcoin Platform
    participant ND as Nondominium
    participant Maya as Maya Rodriguez

    Patron->>JeanPierre: Inquire about "Urban Rhythms"
    JeanPierre->>Artcoin: Scan QR code for artwork details
    Artcoin->>ND: get_artwork_profile()
    ND-->>Artcoin: Display artwork with price: $2,800

    Patron->>Artcoin: Submit purchase intent
    Artcoin->>ND: initiate_transfer_process()
    ND->>Maya: Notify of purchase interest
    Maya->>ND: approve_sale_conditions()

    Patron->>ND: Complete purchase transaction
    ND->>Gov: Execute revenue sharing (70% Maya, 20% JeanPierre, 10% platform)
    Gov->>PPR: issue_participation_receipts()

Sales Process Integration:

  1. Patron Discovery: Art enthusiast discovers artwork during café visit
  2. Authenticity Verification: QR code provides blockchain-verified provenance
  3. Direct Purchase: Smart contract facilitates immediate purchase with automatic revenue distribution
  4. Transfer Coordination: Arrangements made for artwork collection or delivery
  5. Success Celebration: All parties receive PPRs for successful transaction

📊 Network Effects & Artist Growth

Artist Reputation Development

graph LR
    subgraph "Before Artcoin Integration"
        Maya_Before["Maya: Emerging Artist<br/>3 PPRs - 4.8/5 rating<br/>Local recognition only"]
    end

    subgraph "Artcoin Network Effects"
        Phase1[Venue Display]
        Phase2[Public Engagement]
        Phase3[Sales Success]
        Phase4[Network Expansion]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After 3 Months"
        Maya_After["Maya: Established Artist<br/>8 PPRs - 4.9/5 rating<br/>Multiple venue offers<br/>+$1,960 revenue"]
    end

    Maya_Before --> Phase1
    Phase4 --> Maya_After

Maya's PPR Growth:

  • +1 UseService (venue display)
  • +1 ServiceValidation (artwork quality)
  • +1 CommitmentFulfillment (display period)
  • +1 SalesTransaction (artwork sale)
  • +2 VenueCollaboration (positive feedback)
  • Reputation Impact: 4.8 → 4.9 overall rating

Venue Benefits Expansion

mindmap
  root((Café Art Integration))
    Business Benefits
      Customer Experience
        Enhanced ambiance
        Increased dwell time
        Social media buzz
      Marketing Advantage
        Cultural destination status
        Art community engagement
        Local media coverage
    Financial Benefits
      Direct Revenue
        Rental fee sharing
        Sales commissions
        Event hosting opportunities
      Indirect Benefits
        Increased foot traffic
        Customer loyalty
        Premium positioning
    Community Impact
      Artist Support
        Emerging artist platform
        Cultural contribution
        Creative ecosystem building
      Cultural Enrichment
        Public art access
        Arts education
        Community beautification

🌐 Platform Integration Architecture

Artcoin Platform Integration

graph TB
    subgraph "Artcoin Web Platform"
        Gallery[Virtual Gallery]
        Discovery[Art Discovery]
        Booking[Venue Booking]
        Analytics[Engagement Analytics]
    end

    subgraph "Nondominium Art Network"
        Person[Person Zome - Artist Profiles]
        Resource[Resource Zome - Artworks]
        Governance[Governance Zome - Smart Contracts]
    end

    subgraph "Art Ecosystem Integration"
        Social[Social Media Integration]
        Payment[Payment Processing]
        Logistics[Transport & Installation]
        CRM[Customer Relationship Mgmt]
    end

    Gallery --> Resource
    Discovery --> Person
    Booking --> Governance
    Analytics --> Resource

    Person -.-> |Artist Authentication| Social
    Governance -.-> |Revenue Sharing| Payment
    Resource -.-> |Artwork Logistics| Logistics
    Analytics -.-> |Patron Data| CRM

Artist-Centric Features

Creative Empowerment Tools:

  • Portfolio Management: Comprehensive artwork catalog with exhibition history
  • Revenue Analytics: Real-time tracking of rental income and sales performance
  • Audience Insights: Data on artwork engagement across different venue types and locations
  • Network Discovery: Connection with complementary venues and art communities

Smart Contract Capabilities:

  • Dynamic Pricing: Automated pricing adjustments based on artist reputation and demand
  • Royalty Enforcement: Droit de suite compliance for secondary sales
  • Multi-Venue Management: Simultaneous display across multiple venues
  • Flexibility Options: Easy modification of governance rules for different artwork collections

💡 Artistic Innovation Benefits

Creative Independence & Sustainability

  • Direct Artist Income: Elimination of gallery commissions and intermediaries
  • Artistic Control: Artists retain ownership and creative direction
  • Sustainable Career: Ongoing passive income through rental rather than one-time sales
  • Audience Building: Direct connection with art enthusiasts and collectors

Cultural Democratization

mindmap
  root((Artcoin Cultural Impact))
    Public Access
      Everyday Art Exposure
        Art in daily environments
        No gallery intimidation
        Spontaneous discovery
      Economic Accessibility
        Rental options for enjoyment
        Fractional ownership possibilities
        Support for emerging collectors
    Artist Empowerment
      Creative Freedom
        Direct patron connection
        Community-based validation
        Experimental art support
      Economic Justice
        Fair revenue sharing
        Transparent pricing
        Royalty protection
    Community Building
      Local Art Ecosystems
        Venue-artist partnerships
        Cultural district development
        Cross-disciplinary collaboration
      Social Cohesion
        Shared cultural experiences
        Community identity
        Intergenerational connection

Technology-Enhanced Art Experience

  • Provenance Tracking: Complete artwork history with blockchain verification
  • Interactive Engagement: QR codes enabling deeper artist and artwork stories
  • Community Curation: Decentralized validation of artistic quality and relevance
  • Global Reach: Local physical display with global digital discovery

🎯 Strategic Outcomes

Immediate Artist Benefits

  • Revenue Generation: $1,960 total ($120 rental + $1,840 sale commission)
  • Exposure Expansion: Artwork viewed by ~2,000 café visitors over 2 months
  • Network Growth: Invitations from 4 other venues for future displays
  • Reputation Building: Enhanced artist profile with verifiable success metrics

Long-Term Career Development

  • Sustainable Practice: Ongoing rental income providing financial stability
  • Direct Patron Relationships: Building collector base without gallery intermediation
  • Artistic Freedom: Ability to experiment with new styles and mediums
  • Community Recognition: Established as contributor to local cultural ecosystem

Platform Evolution

  • Artist Success Stories: Growing database of artist career development case studies
  • Venue Network Expansion: Increasing number of quality venues seeking art partnerships
  • Collector Community: Developing base of art enthusiasts engaged with platform
  • Cultural Impact Metrics: Quantifiable data on art accessibility and community enrichment

🔮 Future Possibilities

Extended Art Forms Integration

  • Digital Art: NFTs with physical display components
  • Performance Art: Bookable performances in venue spaces
  • Interactive Installations: Technology-enhanced artwork experiences
  • Multi-Sensory Art: Integration with venue's ambiance and customer experience

Advanced Economic Models

  • Artist Cooperatives: Collective ownership and management of shared studio spaces
  • Patronage Systems: Community-supported artist funding models
  • Cultural Investment: Artwork as appreciating community assets
  • Cross-Disciplinary Collaboration: Joint projects between artists, musicians, and performers

This user story demonstrates how Nondominium enables artists to transform their relationship with the art market, creating sustainable careers through direct community engagement while maintaining creative independence and building verifiable reputations in a decentralized cultural ecosystem.


Artwork "Urban Rhythms" successfully sold to a private collector after 2 months of café display. Maya now has 3 other artworks displayed across different venues and is earning consistent monthly rental income while building her artistic reputation.

User Story: Artist Distribution - Gallery Network & Exhibition Logistics

Context: An artist organizes a traveling exhibition across multiple galleries and alternative venues, coordinating logistics, artwork transport, and installation through the Artcoin distribution network built on Nondominium.

See also artcoin_main_doc.md, user-story-artcoin.md and Nondominium_Artcoin.md.


🖼️ The Players

David Kim - Contemporary Artist

  • Role: Accountable Agent (Exhibition Artist & Tour Director)
  • Goal: Tour "Fragments of Memory" photography exhibition across 5 cities in 6 months
  • Reputation: Emerging photographer with growing international recognition
  • Role: Primary Accountable Agent (Distribution Manager & Exhibition Logistics)
  • Goal: Coordinate multi-venue exhibition tour while maintaining artwork integrity and artist vision
  • Reputation: Expert in contemporary art logistics with experience in international exhibition management

The Distribution Network

  • Exhibition Venues: 3 galleries, 2 alternative spaces (community center, university gallery)
  • Logistics Assets: Climate-controlled transport, professional art handlers, installation teams
  • **Governance Rules: Conservation standards, insurance verification, installation quality requirements

🔄 Art Distribution Journey

Phase 1: Exhibition Planning & Venue Coordination (Month 1)

sequenceDiagram
    participant David as David Kim
    participant Artcoin as Artcoin Distribution Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    David->>Artcoin: Submit exhibition tour proposal
    David->>ND: create_person_with_role(TouringArtist)
    ND->>Res: Create artist profile with exhibition history

    David->>ND: create_resource_specification(PhotographyExhibition)
    ND->>Res: Store exhibition requirements and artistic vision
    ND->>Gov: Link conservation standards and insurance requirements

    David->>Artcoin: Define tour schedule and venue requirements
    Artcoin->>ND: propose_exhibition_tour_workflow()
    ND->>Gov: Create multi-venue distribution commitment

Exhibition Planning Process:

  1. Tour Specification: David defines "Fragments of Memory" exhibition requirements:
    • Artistic content: 24 large-format photographs, 6 video installations
    • Technical requirements: Specific lighting, climate control (18-22°C, 45-55% humidity)
    • Exhibition timeline: 6 months, 3 weeks per venue
    • Conservation requirements: UV protection, limited exposure time, professional handling
  2. Conservation Protection: Embedded governance rules ensure artwork preservation and insurance compliance
  3. Venue Matching: Platform identifies galleries with appropriate space, climate control, and curatorial alignment
  4. Transport Planning: Climate-controlled logistics requirements and professional art handler coordination
sequenceDiagram
    participant Sophie as Sophie Laurent
    participant David as David Kim
    participant Artcoin as Artcoin Distribution Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Sophie->>Artcoin: Review exhibition tour opportunities
    Artcoin->>ND: get_exhibition_tour_requirements()
    ND->>Res: Query photography exhibition specifications
    Res-->>ND: Return technical and curatorial requirements

    Sophie->>ND: derive_reputation_summary(David)
    ND->>PPR: Calculate artist reputation and exhibition history
    PPR-->>ND: Return profile (4 PPRs, 4.7/5 artistic merit, 1 previous tour)

    Sophie->>ND: validate_venue_capability(ContemporaryGallery)
    ND->>Gov: Verify venue specifications and exhibition standards
    Gov-->>Artcoin: Gallery capability validated

    Sophie->>Artcoin: Submit venue participation proposal
    Artcoin->>ND: propose_commitment(ExhibitionHosting)
    ND->>Gov: Create tour hosting agreement with conservation requirements

Gallery Network Formation:

  1. Venue Selection and Validation: Five venues selected with complementary characteristics:
    • Gallery A (Downtown): Commercial gallery with established collector base
    • Gallery B (University): Academic context with educational programming
    • Gallery C (Alternative): Community-focused space with local engagement
    • Gallery D (Regional): Suburban location with diverse audience
    • Gallery E (International): Final venue with exposure to international collectors
  2. Capability Verification: Each venue's exhibition standards verified:
    • Climate control and environmental monitoring ✅
    • Professional installation capabilities ✅
    • Security and insurance coverage ✅
    • Curatorial alignment and audience engagement ✅
  3. Tour Coordination Agreement: Smart contract outlines:
    • Conservation standards and artwork handling requirements
    • Installation quality and lighting specifications
    • Tour schedule with buffer time for transport and installation
    • Revenue sharing and commission structures

Phase 3: Artwork Preparation & Tour Logistics (Month 2-3)

stateDiagram-v2
    [*] --> StudioReady: Artworks completed
    StudioReady --> ConservationChecked: Professional art conservation review
    ConservationChecked --> TourPackaged: Custom crating and documentation
    TourPackaged --> FirstVenueReady: Transport to first gallery
    FirstVenueReady --> InstallationComplete: Professional installation
    InstallationComplete --> PublicOpening: Curatorial preparation and opening

    note right of ConservationChecked
        Conservation report: All artworks in excellent condition
        UV protection glass installed on all pieces
        Custom archival mounting completed
        Insurance valuation confirmed
    end note

    note right of TourPackaged
        Custom crates for each artwork size
        Climate control monitoring devices
        Installation instructions and lighting specifications
        Complete documentation and condition reports
    end note

Tour Preparation and Logistics:

  1. Artwork Conservation Review: Professional conservator reviews all artworks:
    • Condition assessment and documentation
    • UV protection glass installation for photographs
    • Archival mounting and framing to conservation standards
    • Insurance valuation and risk assessment
  2. Tour Packaging and Documentation:
    • Custom crates designed for each artwork with climate control
    • Digital condition reporting with before/after documentation
    • Installation specifications and lighting requirements for each piece
    • Complete provenance and exhibition history documentation
  3. Transport Planning: Climate-controlled transport with:
    • Professional art handlers trained in photography conservation
    • Temperature and humidity monitoring throughout transport
    • GPS tracking and security protocols
    • Insurance coverage for entire tour duration

Phase 4: Multi-Venue Exhibition Tour (Months 3-8)

graph TB
    subgraph "Tour Schedule & Logistics"
        A[Month 3: Gallery A - Downtown]
        B[Month 4: Gallery B - University]
        C[Month 5: Gallery C - Community]
        D[Month 6: Gallery D - Regional]
        E[Month 7: Gallery E - International]
        F[Month 8: Return to Studio]
    end

    subgraph "Distribution Process"
        G[Professional Installation]
        H[Climate Monitoring]
        I[Curatorial Programming]
        J[Visitor Engagement]
    end

    subgraph "Quality Assurance"
        K[Pre-Installation Inspection]
        L[Ongoing Conservation Checks]
        M[Post-Exhibition Review]
        N[Tour Documentation]
    end

    A --> G
    B --> H
    C --> I
    D --> J
    E --> K
    F --> L

    G --> M
    H --> N
    I --> O[Artist Reputation Growth]

Tour Execution Process:

  1. Venue 1 - Downtown Gallery (Month 3):
    • Professional installation with gallery technician coordination
    • Artist-led curatorial walk-through and collector preview
    • Sales representative training and artwork pricing coordination
    • Visitor engagement tracking and collector relationship development
  2. Venue 2 - University Gallery (Month 4):
    • Integration with academic curriculum and student programs
    • Artist lecture series and educational programming
    • Research collaboration and interdisciplinary engagement
    • Student mentorship and portfolio review sessions
  3. Venue 3 - Community Center (Month 5):
    • Community outreach and local artist engagement
    • Workshop series and public programming
    • School group visits and educational tours
    • Community dialogue and cultural exchange initiatives
  4. Venue 4 - Regional Gallery (Month 6):
    • Regional media coverage and broader audience engagement
    • Local collector development and community building
    • Cultural tourism promotion and regional networking
    • Satellite programming and community partnerships
  5. Venue 5 - International Gallery (Month 7):
    • International collector exposure and market development
    • Cross-cultural dialogue and artistic exchange
    • Museum and institutional relationship building
    • International press coverage and critical recognition

Phase 5: Tour Completion & Impact Assessment (Month 8)

sequenceDiagram
    participant David as David Kim
    participant Sophie as Sophie Laurent
    participant Artcoin as Artcoin Distribution Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Sophie->>ND: initiate_tour_completion_process()
    ND->>Gov: Execute final venue de-installation and artwork return
    Gov-->>ND: Tour completion confirmation and condition reports

    David->>Artcoin: Review tour performance and impact metrics
    Artcoin->>ND: validate_tour_success()
    ND->>Gov: Verify conservation standards and artistic outcomes
    Gov-->>Artcoin: Tour excellence confirmation

    David->>ND: validate_specialized_role(TouringArtist)
    ND->>Gov: Issue touring artist excellence PPR
    Gov->>PPR: record_exhibition_tour_achievement()

    All Venues->>ND: claim_hosting_completion()
    ND->>PPR: issue_exhibition_network_receipts()

Tour Completion and Assessment:

  1. Artwork Condition Verification: Final conservation review confirms all artworks maintained in excellent condition throughout tour
  2. Tour Impact Analysis:
    • Visitor engagement: 15,000+ total visitors across all venues
    • Sales performance: 8 artworks sold to collectors, 3 institutional acquisitions
    • Critical recognition: 12 reviews, 3 feature articles, 2 television interviews
    • Artist reputation: Significant enhancement with international recognition
  3. Network Performance Evaluation: All venues receive quality ratings and collaboration feedback
  4. Documentation Completion: Complete tour documentation for archival and educational purposes

📊 Tour Analytics & Distribution Performance

Exhibition Tour Monitoring Dashboard

graph LR
    subgraph "Artistic Impact Metrics"
        A[Visitor Engagement: 15,234]
        B[Critical Recognition: 4.8/5]
        C[Sales Performance: 45% sold]
        D[Artist Reputation: 4.9/5]
    end

    subgraph "Tour Efficiency"
        E[Conservation Compliance: 100%]
        F[On-Time Performance: 98%]
        G[Cost Efficiency: 12% under budget]
        H[Audience Diversity: High]
    end

    subgraph "Network Performance"
        I[Venue Satisfaction: 4.7/5]
        J[Installation Quality: 4.9/5]
        K[Visitor Engagement: 4.8/5]
        L[Collaboration Excellence: 4.8/5]
    end

    A --> E
    B --> F
    C --> G
    D --> H

    E --> I
    F --> J
    G --> K
    H --> L

Tour Distribution Outcomes:

  • Artistic Success: Significant critical recognition and collector interest
  • Conservation Excellence: Perfect maintenance of artwork condition throughout tour
  • Network Performance: High satisfaction ratings across all participating venues
  • Economic Impact: Strong sales results and artist career advancement

Artist Reputation Development

graph LR
    subgraph "Before Exhibition Tour"
        David_Before["David: Emerging Artist<br/>4 PPRs - 4.7/5 rating<br/>Local recognition only"]
        Sophie_Before["Sophie: Gallery Manager<br/>6 PPRs - 4.6/5 rating<br/>Single venue focus"]
        Network_Before["Gallery Network: Disconnected<br/>Limited touring experience"]
    end

    subgraph "Tour Coordination Process"
        Phase1[Tour Planning]
        Phase2[Network Formation]
        Phase3[Multi-Venue Execution]
        Phase4[Impact Assessment]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Exhibition Tour"
        David_After["David: International Artist<br/>9 PPRs - 4.9/5 rating<br/>plus 1 TouringExcellence<br/>plus 1 InternationalRecognition"]
        Sophie_After["Sophie: Tour Network Director<br/>10 PPRs - 4.8/5 rating<br/>plus 2 TourCoordination<br/>plus 1 NetworkBuilding"]
        Network_After["Gallery Network: Enhanced<br/>Plus 1 ExhibitionTour<br/>Plus collaborative programming"]
    end

    David_Before --> Phase1
    Sophie_Before --> Phase1
    Network_Before --> Phase1
    Phase4 --> David_After
    Phase4 --> Sophie_After
    Phase4 --> Network_After

🏗️ Exhibition Distribution Architecture

Tour Coordination Management System

graph TB
    subgraph "Artcoin Distribution Platform"
        Touring[Tour Management]
        Scheduling[Venue Scheduling]
        Logistics[Transport Coordination]
        Quality[Conservation Management]
    end

    subgraph "Nondominium Exhibition Distribution"
        Person[Person Zome - Artist/Gallery Profiles]
        Resource[Resource Zome - Artwork Assets]
        Governance[Governance Zome - Conservation Standards]
    end

    subgraph "External Systems"
        CRM[Gallery Management]
        Shipping[Transport Logistics]
        Conservation[Art Conservation]
        Press[Media Relations]
    end

    Touring --> Person
    Scheduling --> Resource
    Logistics --> Governance
    Quality --> Governance

    Person -.-> |Artist Relationship| CRM
    Resource -.-> |Artwork Status| Conservation
    Governance -.-> |Compliance| Shipping

Advanced Tour Distribution Features

Exhibition Coordination Tools:

  • Tour Planning: Integrated scheduling and timeline management for multi-venue exhibitions
  • Conservation Monitoring: Real-time environmental monitoring and artwork condition tracking
  • Professional Network: Verified database of art handlers, conservators, and installation technicians
  • Documentation System: Complete digital records of exhibition history and artwork provenance

Gallery Network Capabilities:

  • Venue Matching: Intelligent pairing of artists with appropriate exhibition spaces
  • Quality Assurance: Standardized installation and conservation requirements across all venues
  • Revenue Management: Transparent commission structures and payment processing
  • Audience Development: Coordinated marketing and programming across exhibition network

💡 Exhibition Distribution Innovation Benefits

Touring Exhibition Advantages

  • Career Development: Artists gain exposure across multiple markets and collector communities
  • Cost Efficiency: Shared transport and installation costs reduce financial barriers to touring
  • Conservation Assurance: Professional art handling and conservation standards protect artwork integrity
  • Network Building: Relationships with galleries, collectors, and institutions across geographic regions

Art Market & Cultural Impact

mindmap
  root((Exhibition Tour Network))
    Artist Benefits
      Career Development
        Multi-market exposure
        International recognition
        Collector relationships
      Economic Opportunities
        Artwork sales
        Commission opportunities
        Grant funding eligibility
    Gallery Network Benefits
      Curatorial Excellence
        Diverse programming
        Artist relationships
        Community engagement
      Financial Sustainability
        Shared exhibition costs
        Increased visitor traffic
        Commission revenue
    Cultural Impact
      Public Access
        Broader audience reach
        Educational programming
        Cultural dialogue
      Community Building
        Local engagement
        Cultural tourism
        Community partnerships

Technology-Enhanced Exhibition Distribution

  • Real-Time Monitoring: Environmental conditions and artwork status tracked throughout tour
  • Digital Documentation: Complete exhibition history with installation records and visitor analytics
  • Network Optimization: Data-driven venue selection and tour scheduling for maximum impact
  • Market Intelligence: Collector engagement tracking and sales opportunity identification

🎯 Strategic Distribution Outcomes

Immediate Tour Benefits

  • Career Advancement: Artist achieved international recognition and representation
  • Sales Success: 45% of exhibition sold, with 3 institutional acquisitions
  • Critical Acclaim: Strong reviews and media coverage across all tour markets
  • Network Expansion: Established relationships with galleries and collectors internationally

Long-Term Market Development

  • Touring Model: Established framework for artist touring exhibitions
  • Gallery Network: Ongoing collaboration opportunities for network artists
  • Market Intelligence: Data on collector behavior and market preferences across regions
  • Cultural Exchange: Platform for international artistic dialogue and exchange

Platform Evolution

  • Tour Templates: Standardized workflows for different types of exhibition tours
  • Quality Standards: Industry benchmarks for artwork conservation and touring excellence
  • Network Growth: Expansion to include more galleries and alternative exhibition spaces
  • Educational Resources: Case studies and best practices for exhibition touring

🔮 Future Exhibition Distribution Scenarios

Advanced Touring Models

  • Virtual Reality Integration: Digital twins of exhibitions for remote viewing and collector engagement
  • International Collaborations: Cross-border touring with cultural diplomacy and exchange programs
  • Site-Specific Adaptation: Touring exhibitions adapted to each venue's unique characteristics
  • Collector Education: Programming and events designed to educate and engage new collectors

New Distribution Channels

  • Pop-Up Exhibitions: Temporary exhibitions in non-traditional spaces using the touring framework
  • Corporate Exhibitions: Art programming in corporate environments with employee engagement
  • Hospitality Partnerships: Exhibitions in hotels and resorts with tourist audience development
  • Digital Exhibitions: Hybrid physical-digital exhibitions reaching global audiences

This user story demonstrates how Nondominium enables artists to coordinate complex touring exhibitions through distributed gallery networks, ensuring artwork conservation while maximizing career opportunities and artistic impact through decentralized coordination and reputation-based trust.


"Fragments of Memory" tour completed successfully with critical acclaim in all cities. David Kim secured gallery representation in 3 countries and 2 institutional acquisitions. The touring model has been adopted by 4 other artists for upcoming international exhibitions, and the gallery network has expanded to include 12 venues across North America and Europe.

User Story: Artist Production - Collaborative Art Creation & Fabrication

Scenario: Artists Co-producing Large-Scale Installation Using Shared Studio Resources

Context: A collective of artists collaborates to create a large-scale public art installation, sharing specialized equipment and studio space through the Artcoin production platform. This scenario demonstrates both the current Nondominium resource sharing capabilities and the need for broader TrueCommon implementation with full REA integration for complete peer production network management through Network Resource Planning (NRP).


🏗️ System Architecture Context

Current Nondominium Implementation (Resource Sharing Economics)

graph TB
    subgraph "Nondominium - Resource Sharing Focus"
        Person[Person Zome - Artist Profiles]
        Resource[Resource Zome - Studio Resources]
        Governance[Governance Zome - PPR System]
    end

    subgraph "Current Capabilities"
        ResourceSharing[Resource Access & Sharing]
        Reputation[PPR Reputation Tracking]
        Transactions[Economic Event Logging]
    end

Nondominium excels at: Resource discovery, access governance, reputation tracking through PPRs, and secure economic transactions.

Required TrueCommon Integration (Full REA + Network Resource Planning)

graph TB
    subgraph "TrueCommon - Complete REA Implementation"
        REA[Full REA Integration]
        NRP[Network Resource Planning]
        Accounting[Integrated Accounting]
        Planning[Resource Planning]
    end

    subgraph "Enhanced Capabilities Needed"
        ProductionPlanning[Production Workflow Planning]
        ResourceOptimization[Network-wide Resource Optimization]
        DemandForecasting[Demand & Supply Planning]
        FinancialAccounting[Complete Financial Accounting]
        ImpactMeasurement[Social & Environmental Impact]
    end

TrueCommon provides: Complete REA economics model, Network Resource Planning for production coordination, integrated accounting, and comprehensive impact measurement.

🎨 The Players

Elena Vasquez - Lead Artist & Concept Designer

  • Role: Accountable Agent (Creative Director & Project Lead)
  • Goal: Produce "Urban Canopy" - a 12-meter interactive light sculpture for public plaza
  • Reputation: Established public artist with successful installations in 3 cities

Marcus Chen - Fabrication Specialist

  • Role: Primary Accountable Agent (Production Manager & Technical Lead)
  • Goal: Coordinate multi-studio fabrication while maintaining artistic vision and technical integrity
  • Reputation: Expert in large-scale sculpture fabrication with architectural integration experience

The Production Network

  • Collaborating Studios: 4 artist studios with complementary capabilities
  • Specialized Equipment: Metal fabrication, 3D printing, electronics, lighting systems
  • Governance Rules: Quality validation at each stage, intellectual property protection, safety compliance

🔄 Art Production Journey

Phase 1: Concept Development & Production Planning (Week 1-2)

sequenceDiagram
    participant Elena as Elena Vasquez
    participant Artcoin as Artcoin Production Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Elena->>Artcoin: Submit public art commission
    Elena->>ND: create_person_with_role(PublicArtist)
    ND->>Res: Create lead artist profile with portfolio

    Elena->>ND: create_resource_specification(InteractiveLightSculpture)
    ND->>Res: Store technical requirements and artistic vision
    ND->>Gov: Link IP protection and public safety requirements

    Elena->>Artcoin: Define production workflow and collaboration needs
    Artcoin->>ND: propose_art_production_workflow()
    ND->>Gov: Create multi-studio production commitment

Art Production Planning Process:

  1. Commission Specification: Elena defines "Urban Canopy" requirements:
    • Artistic vision: Interactive light sculpture responding to pedestrian movement
    • Technical specifications: 12m span, 500 LED nodes, weather-resistant
    • Timeline: 12 weeks from concept to installation
    • Budget: $85,000 including materials and studio time
  2. IP Protection: Embedded governance rules protect artistic concept and collaboration agreements
  3. Capability Assessment: Platform identifies studios with required fabrication equipment and expertise
  4. Safety Compliance: Public art safety requirements and structural engineering standards embedded

Phase 2: Studio Network Discovery & Collaboration Formation (Week 3)

sequenceDiagram
    participant Marcus as Marcus Chen
    participant Elena as Elena Vasquez
    participant Artcoin as Artcoin Production Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Marcus->>Artcoin: Browse collaborative art opportunities
    Artcoin->>ND: get_art_production_requirements()
    ND->>Res: Query sculpture production specifications
    Res-->>ND: Return technical and artistic requirements

    Marcus->>ND: derive_reputation_summary(Elena)
    ND->>PPR: Calculate artist reputation and collaboration history
    PPR-->>ND: Return profile (7 PPRs, 4.9/5 artistic vision, 3 public installations)

    Marcus->>ND: validate_studio_capability(MetalFabrication)
    ND->>Gov: Verify equipment and artistic collaboration experience
    Gov-->>Artcoin: Studio capability validated

    Marcus->>Artcoin: Submit fabrication collaboration proposal
    Artcoin->>ND: propose_commitment(ArtProductionService)
    ND->>Gov: Create collaboration agreement with IP protection

Studio Collaboration Formation:

  1. Studio Network Assembly: Four studios with complementary capabilities:
    • Studio A (Marcus): Metal fabrication and structural engineering
    • Studio B: 3D printing and prototyping
    • Studio C: Electronics and interactive systems
    • Studio D: Lighting design and programming
  2. Expertise Validation: Each studio's artistic and technical capabilities verified:
    • Previous public art collaborations ✅
    • Equipment specifications and certifications ✅
    • Artistic alignment and portfolio quality ✅
    • Collaboration reputation and reliability ✅
  3. Creative Agreement: Smart contract outlines:
    • Creative attribution and ownership percentages
    • Quality standards and artistic vision adherence
    • Timeline coordination and milestone payments
    • Exhibition rights and documentation requirements

Phase 3: Multi-Studio Production Coordination (Weeks 4-9)

graph TB
    subgraph "Production Stage 1: Component Fabrication"
        A[Structural Frame - Metal Work<br/>Studio A: Marcus]
        B[Interactive Elements - 3D Printing<br/>Studio B]
        C[Sensor Arrays - Electronics<br/>Studio C]
        D[Light Modules - Custom LEDs<br/>Studio D]
    end

    subgraph "Production Stage 2: Assembly & Integration"
        E[Frame Assembly<br/>Studio A]
        F[Electronics Integration<br/>Studio C]
        G[Light Installation<br/>Studio D]
        H[Software Programming<br/>Studio C + Studio D]
    end

    subgraph "Production Stage 3: Artistic Refinement"
        I[Visual Testing<br/>All Studios]
        J[Interactive Calibration<br/>Studio C + Elena]
        K[Artistic Review<br/>Elena + All Studios]
        L[Final Artistic Approval<br/>Elena]
    end

    A --> E
    B --> F
    C --> G
    D --> H
    E --> I
    F --> J
    G --> K
    H --> L

Distributed Art Production Process:

  1. Stage 1 - Specialized Component Creation (Weeks 4-6):
    • Studio A: Fabricate structural aluminum frame with weather-resistant coating
    • Studio B: 3D print interactive sensor housings and artistic decorative elements
    • Studio C: Develop custom sensor arrays and microcontroller systems
    • Studio D: Program custom LED lighting sequences and create light diffusers
  2. Stage 2 - Technical Integration (Weeks 6-7):
    • Assembly of structural frame with mounting points for electronics
    • Integration of sensor systems and interactive response programming
    • Installation of lighting systems with power distribution and control
    • Software development for pedestrian interaction and light response patterns
  3. Stage 3 - Artistic Refinement (Weeks 8-9):
    • Visual testing and artistic adjustments based on Elena's creative vision
    • Calibration of interactive responses for optimal public engagement
    • Quality assurance for weather resistance and public safety
    • Final artistic approval and documentation of creative process

Phase 4: Creative Validation & Documentation (Week 10-11)

sequenceDiagram
    participant Elena as Elena Vasquez
    participant Marcus as Marcus Chen
    participant Artcoin as Artcoin Production Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Marcus->>ND: initiate_artistic_validation()
    ND->>Gov: Execute multi-studio quality and artistic validation
    Gov-->>ND: Artistic vision compliance results

    Elena->>Artcoin: Review artistic implementation and creative vision
    Artcoin->>ND: validate_artistic_integrity()
    ND->>Gov: Verify artistic standards and innovation achievement
    Gov-->>Artcoin: Creative excellence confirmation

    Elena->>ND: validate_specialized_role(PublicArtist)
    ND->>Gov: Issue artistic innovation PPR
    Gov->>PPR: record_creative_collaboration_achievement()

    All Studios->>ND: claim_production_completion()
    ND->>PPR: issue_collaborative_creation_receipts()

Artistic Validation Process:

  1. Creative Vision Verification: Elena validates that the installation meets her artistic concept:
    • Visual impact and aesthetic quality ✅
    • Interactive engagement effectiveness ✅
    • Technical innovation and artistic merit ✅
    • Public safety and durability standards ✅
  2. Collaboration Documentation: Creative contributions from each studio documented and attributed
  3. Innovation Recognition: New techniques and approaches recorded for artistic community knowledge sharing
  4. Production Completion: All studios receive PPRs for their creative and technical contributions

📊 Art Production Analytics & Creative Collaboration

Creative Production Monitoring Dashboard

graph LR
    subgraph "Artistic Metrics"
        A[Creative Vision Fidelity: 98%]
        B[Innovation Score: 4.9/5]
        C[Technical Complexity: Advanced]
        D[Artistic Impact: High]
    end

    subgraph "Collaboration Efficiency"
        E[Inter-Studio Coordination: 95%]
        F[Resource Sharing: 3x Efficiency]
        G[Timeline Adherence: On Schedule]
        H[Budget Utilization: 97%]
    end

    subgraph "Quality & Innovation"
        I[Technical Quality: 4.8/5]
        J[Artistic Merit: 4.9/5]
        K[Public Safety: 100% Compliant]
        L[Documentation: Complete]
    end

    A --> E
    B --> F
    C --> G
    D --> H

    E --> I
    F --> J
    G --> K
    H --> L

Creative Collaboration Outcomes:

  • Artistic Achievement: Successful realization of complex interactive public art vision
  • Innovation Recognition: New approaches to interactive sculpture and pedestrian engagement
  • Collaboration Excellence: Seamless coordination across 4 studios with complementary expertise
  • Technical Quality: Museum-level fabrication and weather resistance for public installation

Artistic Reputation Development

graph LR
    subgraph "Before Collaborative Production"
        Elena_Before["Elena: Public Artist<br/>7 PPRs - 4.9/5 rating<br/>3 successful installations"]
        Marcus_Before["Marcus: Fabrication Expert<br/>5 PPRs - 4.7/5 rating<br/>Technical specialist"]
        Studios_Before["Production Network: 4 studios<br/>Limited large-scale collaboration"]
    end

    subgraph "Artistic Collaboration Process"
        Phase1[Concept & Planning]
        Phase2[Multi-Studio Production]
        Phase3[Artistic Integration]
        Phase4[Creative Validation]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Collaborative Production"
        Elena_After["Elena: Innovation Leader<br/>10 PPRs - 5.0/5 rating<br/>plus 1 LargeScaleInstallation<br/>plus 1 CreativeCollaboration"]
        Marcus_After["Marcus: Art-Tech Integration Expert<br/>8 PPRs - 4.9/5 rating<br/>plus 1 ArtisticFabrication<br/>plus 1 TechnicalInnovation"]
        Studios_After["Production Network: Enhanced<br/>Plus 1 CollaborativeCreation<br/>Plus resource sharing models"]
    end

    Elena_Before --> Phase1
    Marcus_Before --> Phase1
    Studios_Before --> Phase1
    Phase4 --> Elena_After
    Phase4 --> Marcus_After
    Phase4 --> Studios_After

🏗️ Integrated Platform Architecture: Nondominium + TrueCommon

Complete Peer Production Management System

graph TB
    subgraph "Current Nondominium Implementation"
        ND_Person[Person Zome - Artist Profiles]
        ND_Resource[Resource Zome - Studio Resources]
        ND_Governance[Governance Zome - Creative Standards]
        PPR[PPR Reputation System]
    end

    subgraph "Required TrueCommon Implementation"
        TC_REA[Full REA Economics Model]
        TC_NRP[Network Resource Planning]
        TC_Accounting[Integrated Accounting]
        TC_Planning[Production Planning]
        TC_Impact[Impact Measurement]
    end

    subgraph "Enhanced Production Platform"
        Creative[Concept Management]
        Scheduling[Production Timeline]
        Quality[Artistic Validation]
        Documentation[Process Documentation]
        Financial[Cost Accounting]
        Impact[Social Impact Tracking]
        Workflow[Production Workflow]
    end

    %% Current Nondominium Connections
    Creative --> ND_Person
    Scheduling --> ND_Resource
    Quality --> ND_Governance
    Documentation --> PPR

    %% TrueCommon Integration
    Financial --> TC_Accounting
    Workflow --> TC_NRP
    Impact --> TC_Impact
    Scheduling --> TC_Planning
    Creative --> TC_REA

    %% Cross-system integration
    TC_NRP -.-> |Resource Optimization| ND_Resource
    TC_Accounting -.-> |Transaction Data| PPR
    TC_REA -.-> |Agent Identities| ND_Person

Where Nondominium Ends and TrueCommon Must Begin

Nondominium Provides (Current):

  • ✅ Resource discovery and access governance
  • ✅ Agent reputation through PPR system
  • ✅ Secure economic event logging
  • ✅ Bilateral transaction coordination

TrueCommon Must Provide (Missing):

  • Network Resource Planning: Coordinated multi-studio production scheduling
  • Full REA Integration: Complete economic relationships beyond simple transactions
  • Production Workflow Management: Multi-stage production process coordination
  • Integrated Accounting: Complete financial tracking across production network
  • Demand-Supply Planning: Resource allocation optimization across network
  • Social/Environmental Impact: Comprehensive impact measurement and reporting

Advanced Art Production Features

Creative Collaboration Tools:

  • Concept Sharing: Secure development environment for sharing early-stage artistic concepts
  • Progressive Reveal: Staged sharing of technical details while protecting artistic IP
  • Creative Feedback: Structured artistic critique and validation processes
  • Documentation: Automatic creation of process documentation for archival and educational purposes

Resource Sharing Capabilities:

  • Equipment Marketplace: Shared access to expensive specialized fabrication equipment
  • Studio Time Trading: Token-based system for trading studio access and expertise
  • Material Sourcing: Collective purchasing power for bulk art material acquisition
  • Skill Exchange: Knowledge sharing and skill development between collaborating artists

💡 Artistic Innovation Benefits

Creative Collaboration Advantages

  • Scale Enablement: Artists can undertake larger, more ambitious projects than possible individually
  • Specialization Access: Access to specialized technical skills without becoming expert in all areas
  • Risk Distribution: Shared financial and creative risks across collaborative network
  • Innovation Cross-Pollination: New ideas emerging from intersection of different artistic approaches

Economic & Artistic Impact

mindmap
  root((Collaborative Art Production))
    Creative Benefits
      Artistic Vision Expansion
        Larger scale projects
        Technical complexity
        Multi-disciplinary integration
      Innovation Acceleration
        New techniques development
        Cross-studio learning
        Creative problem solving
    Economic Advantages
      Resource Efficiency
        Shared equipment costs
        Studio time optimization
        Material bulk purchasing
      Market Access
        Larger project opportunities
        Public art commissions
        Gallery representation
    Community Building
      Artist Network
        Collaboration opportunities
        Skill development
        Knowledge sharing
      Cultural Impact
        Public art enhancement
        Cultural dialogue
        Community engagement

Technology-Enhanced Art Creation

  • Digital Fabrication: Integration of traditional art techniques with advanced manufacturing
  • Interactive Art: New possibilities for art that responds to audience and environment
  • Process Documentation: Complete digital record of creative process for educational purposes
  • Innovation Sharing: Platform for sharing new techniques and approaches with artistic community

🎯 Strategic Art Production Outcomes

Immediate Creative Benefits

  • Artistic Achievement: Successfully completed complex interactive sculpture
  • Innovation Recognition: Developed new approaches to pedestrian-responsive art
  • Collaboration Excellence: Established model for multi-studio artistic production
  • Public Impact: Installation received critical acclaim and community engagement

Long-Term Artistic Development

  • Production Network: Established ongoing collaborative relationships for ambitious projects
  • Technical Innovation: Developed new fabrication and integration techniques now being adopted by other artists
  • Artistic Growth: All collaborating artists expanded their creative capabilities and portfolios
  • Community Building: Created framework for supporting large-scale public art in the community

Platform Evolution

  • Production Templates: Standardized workflows for different types of collaborative art production
  • Innovation Library: Growing database of new techniques and approaches developed through collaboration
  • Artist Marketplace: Enhanced platform connecting artists with complementary skills and resources
  • Educational Resources: Documentation and case studies for artistic community learning

🔮 Future Art Production Scenarios

Advanced Creative Collaboration

  • Virtual Reality Collaboration: Immersive collaborative design environments for distributed artistic teams
  • AI-Assisted Creation: Integration of AI tools for concept development and technical problem-solving
  • Blockchain Art History: Complete provenance tracking for collaborative artworks with attribution recorded on blockchain
  • Global Production Networks: International collaboration between artists across different cultural contexts

New Art Forms Enabled

  • Generative Art: Collaborative creation of art that evolves and responds to environmental inputs
  • Participatory Installation: Large-scale works involving community members in creation process
  • Responsive Architecture: Art that becomes integrated with building systems and responsive to occupancy
  • Digital-Physical Hybrid: Works that exist simultaneously in physical and digital realms

This user story demonstrates how Nondominium enables artists to scale their creative vision through collaborative production networks, combining artistic creativity with technical expertise while maintaining creative control and fair attribution through decentralized governance and reputation systems.


"Urban Canopy" installation successfully completed and installed in downtown plaza, receiving widespread public acclaim. The collaborative production model has since been adopted by 3 other artist collectives for projects ranging from interactive museum installations to responsive environmental artworks.

User Story: Resource Sharing / Mutualization

Scenario: Two Organizations Sharing Equipment via an open soruce ERP

Context: Sensorica (a maker space) and FabLab (a fabrication lab) want to share a CNC machine through their traditional open source ERP platform integration with Nondominium. This scenario represents Nondominium's core strength - bilateral resource sharing between organizations - with potential enhancement for broader equipment network optimization.

See also erp_holochain_bridge.md


🏗️ System Architecture Context

Perfect Nondominium Use Case (Equipment Sharing)

graph TB
    subgraph "Nondominium - Equipment Sharing Excellence"
        Person[Person Zome - Organization Reps]
        Resource[Resource Zome - Equipment Registry]
        Governance[Governance Zome - Access Rules]
        PPR[PPR Reputation System]
    end

    subgraph "Equipment Sharing Capabilities"
        Discovery[Equipment Discovery]
        Access[Secure Access Control]
        Validation[Operator Certification]
        Reputation[Custodial Reputation]
    end

    Person --> Discovery
    Resource --> Access
    Governance --> Validation
    PPR --> Reputation

Nondominium Perfectly Supports:

  • Equipment discovery and availability management
  • Access governance with certification requirements
  • Reputation tracking for equipment care and responsible usage
  • Secure transaction logging and audit trails

Enhancement Option (Equipment Network Optimization)

graph TB
    subgraph "Network Resource Planning (NRP)"
        NRP[Equipment Network Planning]
        Utilization[Utilization Optimization]
        Maintenance[Shared Maintenance Planning]
        Costing[Usage-Based Costing]
    end

    subgraph "Enhanced Equipment Management"
        Scheduling[Network-wide Scheduling]
        Capacity[Capacity Planning]
        Maintenance[Preventive Maintenance]
        CostAllocation[Fair Cost Allocation]
    end

Post MVP Would Add:

  • Multi-equipment network optimization
  • Predictive maintenance scheduling
  • Utilization analytics and bottleneck identification
  • Fair cost allocation across network participants

🎯 The Players

Sarah - Sensorica Resource Coordinator

  • Role: Primary Accountable Agent (Custodian)
  • Goal: Make expensive equipment available to partner organizations
  • Reputation: High PPR scores in ResourceValidation and CustodyTransfer

Marco - FabLab Technical Manager

  • Role: Accountable Agent with Transport & Repair specializations
  • Goal: Access CNC machine for prototype production
  • Reputation: Strong performance in TransportService and RepairService

The Resource

  • CNC Machine Model: Proxxon MF70 (modified)
  • Current Location: Sensorica Workshop, Montreal
  • Governance Rules: Requires certified operators, insurance validation

🔄 Transaction Journey

Phase 1: Discovery & Intent (Day 1)

sequenceDiagram
    participant Marco as Marco (FabLab)
    participant ERP as ERP
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Marco->>ERP: Search for CNC equipment
    ERP->>ND: get_all_economic_resources()
    ND->>Res: Query available resources
    Res-->>ND: Return CNC machine specs
    ND-->>ERP: Resource with governance rules
    ERP-->>Marco: Display CNC machine details

    Marco->>ERP: Review governance rules
    ERP->>ND: get_governance_rule_profile()
    ND->>Gov: Return rules (certification, insurance)
    Marco->>ERP: Submit AccessForUse commitment
    ERP->>ND: propose_commitment()
    ND->>Gov: Create commitment

Sarah's Actions:

  1. Resource Discovery: Marco searches the ERP for available fabrication equipment
  2. Governance Review: Marco reviews CNC machine's embedded governance rules:
    • Requires Transport certification ✅
    • Proof of facility insurance required
    • Minimum 48-hour notice for transport
  3. Intent Signaling: Marco submits AccessForUse commitment through ERP interface

Phase 2: Validation & Trust Building (Day 2)

sequenceDiagram
    participant Sarah as Sarah (Sensorica)
    participant ERP as ERP
    participant ND as Nondominium
    participant PPR as PPR System

    ND->>Sarah: Notify of new commitment
    Sarah->>ERP: Review Marco's credentials
    ERP->>ND: derive_reputation_summary(Marco)
    ND->>PPR: Calculate reputation scores
    PPR-->>ND: Return reputation data (98% on-time, 4.8/5 quality)
    ND-->>ERP: Display Marco's reputation
    Sarah->>ND: validate_agent_for_custodianship()
    ND->>Gov: Create validation receipt
    Gov-->>ERP: Commitment approved

Multi-Party Validation:

  1. Identity Verification: Sarah validates Marco's credentials and insurance
  2. Capability Check: System validates Marco's Transport certification
  3. Reputation Assessment: Sarah reviews Marco's PPR summary:
    • 98% on-time delivery rate
    • 4.8/5 quality score
    • 12 successful transport completions

Phase 3: Resource Preparation (Day 3)

stateDiagram-v2
    [*] --> Active: CNC Machine Available
    Active --> Reserved: Sarah prepares for transport
    Reserved --> ReadyForTransport: Documentation complete

    note right of Reserved
        Resource state update: Active → Reserved
        Transport protocols linked
        Insurance certificate uploaded
    end note

Sarah's Preparation:

  1. Resource State Update: Changes CNC from Active to Reserved
  2. Transport Documentation: Creates transport checklist and safety protocols
  3. Insurance Coordination: Uploads facility insurance certificate

Phase 4: Transport Process (Day 4)

sequenceDiagram
    participant Marco as Marco (FabLab)
    participant Sarah as Sarah (Sensorica)
    participant ERP as ERP 
    participant ND as Nondominium
    participant Res as Resource Zome
    participant PPR as PPR System

    Marco->>ERP: Arrive for transport
    ERP->>ND: initiate_transport_process()
    ND->>Gov: Validate Marco's Transport role
    Sarah->>ERP: Scan QR code on CNC machine
    Marco->>ERP: Scan QR code confirmation
    ERP->>ND: transfer_custody()
    ND->>Res: Update custodian: Sarah → Marco
    ND->>Gov: log_economic_event(TransferCustody)
    Gov->>PPR: issue_participation_receipts()
    PPR-->>ND: Generate PPRs for both agents
    ND-->>ERP: Update transport status

The Physical Transfer:

  1. Transport Initiation: Marco arrives with certified transport equipment
  2. Custody Transfer Ceremony: Both agents scan QR codes on CNC machine
  3. Multi-Signature Process: Bilateral cryptographic signatures executed
  4. Real-time Updates: ERP shows live transport status

Phase 5: Usage & Monitoring (Week 1-2)

graph LR
    subgraph "Usage Process"
        A[Start Use] --> B[Log Daily Usage]
        B --> C[Performance Metrics]
        C --> D[PPR Generation]
        D --> E[Quality Monitoring]
    end

    subgraph "PPR Categories"
        F[UseService]
        G[ServiceValidation]
        H[CommitmentFulfillment]
    end

    D --> F
    D --> G
    D --> H

Resource Utilization:

  1. Use Process Activation: Marco initiates CNC machine for prototype production
  2. Quality Monitoring: System tracks usage hours and maintenance needs
  3. Progress Reporting: Daily usage logs through ERP interface
  4. Performance Metrics: Automatic PPR generation for each use session

Phase 6: Return & Completion (Day 15)

sequenceDiagram
    participant Marco as Marco (FabLab)
    participant Sarah as Sarah (Sensorica)
    participant ERP as ERP
    participant ND as Nondominium
    participant PPR as PPR System

    Marco->>ERP: Complete maintenance checklist
    ERP->>ND: claim_commitment()
    Marco->>ERP: Initiate return transport
    ERP->>ND: initiate_transport_process()
    Sarah->>ERP: Scan return QR code
    ERP->>ND: transfer_custody()
    ND->>Res: Update custodian: Marco → Sarah
    Sarah->>ERP: Inspect and approve return
    ERP->>ND: validate_specialized_role()
    ND->>Gov: Create validation receipts
    Gov->>PPR: issue_participation_receipts()
    PPR-->>ND: Update reputation scores
    ND-->>ERP: Transaction complete

Return Process:

  1. Maintenance Check: Marco performs routine maintenance and documents condition
  2. Return Transport: Reverse transport with same validation process
  3. Final Assessment: Sarah inspects returned equipment
  4. Bilateral PPR Issuance: Both agents receive participation receipts

🏆 Transaction Outcomes

Immediate Benefits

  • Cost Savings: FabLab saves $15,000 on equipment purchase
  • Revenue: Sensorica earns $800 usage fee
  • Capacity Building: Both organizations expand fabrication capabilities
  • Trust Enhancement: PPR scores improved for both agents

Reputation Impact

graph LR
    subgraph "Before Transaction"
        Sarah_Before[Sarah: 4.7/5<br/>12 PPRs]
        Marco_Before[Marco: 4.6/5<br/>8 PPRs]
    end

    subgraph "Transaction Process"
        Phase1[Discovery & Validation]
        Phase2[Transport Process]
        Phase3[Usage Period]
        Phase4[Return Process]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Transaction"
        Sarah_After[Sarah: 4.9/5<br/>15 PPRs<br/>+1 CustodyTransfer<br/>+1 GoodFaithTransfer]
        Marco_After[Marco: 4.8/5<br/>11 PPRs<br/>+1 CustodyAcceptance<br/>+1 TransportService]
    end

    Sarah_Before --> Phase1
    Marco_Before --> Phase1
    Phase4 --> Sarah_After
    Phase4 --> Marco_After

Sarah's PPR Updates:

  • +1 CustodyTransfer (outgoing)
  • +1 GoodFaithTransfer
  • Performance: 5.0/5 reliability score

Marco's PPR Updates:

  • +1 CustodyAcceptance (incoming)
  • +1 TransportService completion
  • Performance: 4.9/5 overall satisfaction

Network Effects

  • New Resource Discovery: Two other organizations express interest in similar sharing
  • Process Optimization: Transport protocol refined for future transactions
  • Community Building: Sensorica and FabLab plan collaborative training workshop

🔗 Web2 Integration Features

System Architecture Integration

graph TB
    subgraph "Web2 Platform Layer"
        ERP[ERP Platform]
        Mobile[Mobile App]
        API[REST API]
    end

    subgraph "Nondominium Core"
        Person[Person Zome]
        Resource[Resource Zome]
        Governance[Governance Zome]
    end

    subgraph "PPR System"
        Claims[Private Participation Claims]
        Reputation[Reputation Summary]
        Crypto[Cryptographic Signatures]
    end

    subgraph "External Systems"
        Inventory[Inventory Management]
        Insurance[Insurance Systems]
        Finance[Financial Reporting]
    end

    ERP --> API
    Mobile --> API
    API --> Person
    API --> Resource
    API --> Governance

    Governance --> Claims
    Claims --> Reputation
    Reputation --> Crypto

    Resource --> Inventory
    Governance --> Insurance
    API --> Finance

    Person -.-> |Identity Management| Resource
    Resource -.-> |Resource Lifecycle| Governance
    Governance -.-> |Validation & PPR| Person

ERP Interface

  • Resource Gallery: Visual catalog with availability calendars
  • Agent Profiles: Public reputation summaries with privacy controls
  • Workflow Dashboard: Step-by-step transaction tracking
  • Notification System: Real-time updates via email and ERP messages

Enterprise Integration

  • Synchronization: Resource status synced with inventory management systems
  • Reporting: Usage analytics and financial reconciliation
  • Compliance: Automatic audit trail for insurance and regulatory requirements
  • API Access: RESTful endpoints for custom workflow integrations

User Experience

  • Mobile App: Field operations with QR code scanning
  • Document Management: Secure storage of certificates and agreements
  • Communication Hub: Integrated messaging for coordination
  • Analytics Dashboard: Usage patterns and cost optimization insights

💡 Key Innovation Highlights

Trust Without Platforms

  • No central authority controlling the resource
  • Direct peer-to-peer governance through embedded rules
  • Cryptographic reputation that travels with agents

Privacy-Preserving Transparency

  • Economic events publicly visible for accountability
  • Private operational details protected through capability access
  • Selective disclosure of sensitive information

Progressive Trust Building

  • Start with basic resource sharing
  • Build reputation through successful transactions
  • Unlock more complex collaborative opportunities

Composable Workflows

  • Transport → Use → Maintenance → Return processes
  • Multi-agent coordination for complex projects
  • Automated governance enforcement at each step

🎯 Business Value Proposition

Web2 Integration Benefits

mindmap
  root((Nondominium + Web2))
    Platform Enhancement
      New Revenue Streams
        Transaction fees
        Premium features
      User Engagement
        Reputation system
        Gamified participation
      Network Effects
        Growing ecosystem
        Resource discovery
    Business Value
      Cost Reduction
        Shared access to equipment
        Reduced capital investment
      Risk Management
        Insured transactions
        Clear accountability
      Innovation Enablement
        Democratized access
        Collaborative opportunities
    Technical Features
      Familiar Interface
        ERP integration
        Mobile accessibility
      Enterprise Ready
        API integration
        Reporting dashboard
      Trust Layer
        Cryptographic reputation
        Privacy-preserving transparency

For Web2 Platforms

  • New Revenue Streams: Transaction fees and premium features
  • User Engagement: Increased platform stickiness through reputation
  • Network Effects: Growing ecosystem of shared resources
  • Competitive Advantage: Differentiation through decentralized trust

For Organizations

  • Resource Optimization: Better utilization of expensive equipment
  • Cost Reduction: Shared access to specialized tools and facilities
  • Risk Management: Insured transactions with clear accountability
  • Innovation Enablement: Access to resources without capital investment

For the Community

  • Sustainability: Reduced waste through resource sharing
  • Accessibility: Democratized access to expensive equipment
  • Skill Development: Knowledge sharing through collaboration
  • Economic Resilience: Distributed resource ownership

This user story demonstrates how Nondominium enables Web2 platforms to transform from simple content management systems into powerful engines for decentralized resource sharing, combining the familiarity of existing platforms with the trust and transparency of blockchain-based governance.


Transaction completed successfully in 15 days with both organizations reporting high satisfaction and expressing interest in expanding their sharing partnership.

User Story: Food Basket - Last-Mile Logistics Coordination

Scenario: Cooperative Distribution Network for Local Food Systems

Context: A network of local farms and food producers coordinates last-mile delivery to urban customers through a distributed logistics system powered by Nondominium, optimizing routes and sharing delivery resources.


🚚 The Players

Maria Garcia - Organic Farm Owner

  • Role: Accountable Agent (Producer & Shipper)
  • Goal: Efficiently distribute fresh produce to urban customers while maintaining quality
  • Reputation: Certified organic producer with excellent delivery track record

James Chen - Logistics Coordinator

  • Role: Primary Accountable Agent (Distribution Manager)
  • Goal: Optimize delivery routes and coordinate multi-producer distribution
  • Reputation: Expert in cold chain logistics and route optimization

The Distribution Network

  • Network Members: 8 local farms, 3 community kitchens, 2 urban distribution hubs
  • Assets: Refrigerated vehicles, bike couriers, temperature monitoring devices
  • **Governance Rules: Food safety compliance, temperature tracking, delivery time windows

🔄 Distribution Journey

Phase 1: Production Planning & Distribution Needs (Monday)

sequenceDiagram
    participant Maria as Maria Garcia
    participant Platform as Distribution Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Maria->>Platform: Submit weekly harvest and delivery needs
    Maria->>ND: create_person_with_role(FoodProducer)
    ND->>Res: Create producer profile with certifications

    Maria->>ND: create_resource_specification(OrganicProduce)
    ND->>Res: Store produce specifications and quality standards
    ND->>Gov: Link food safety requirements and temperature controls

    Maria->>ND: create_economic_resources(WeeklyHarvest)
    ND->>Res: Register produce batches with lot tracking
    ND->>Gov: Embed governance rules for food safety

Production & Distribution Planning:

  1. Harvest Registration: Maria registers weekly production:
    • Mixed vegetables: 250 kg total
    • Temperature requirements: 2-4°C throughout delivery
    • Delivery windows: Tuesday and Thursday, 6-9 PM
    • Quality standards: Organic certification, freshness guarantees
  2. Food Safety Setup: HACCP compliance and temperature monitoring requirements
  3. Batch Tracking: Lot numbers and timestamps for complete traceability
  4. Distribution Scheduling: Integration with weekly delivery planning system

Phase 2: Route Optimization & Network Coordination (Tuesday Morning)

sequenceDiagram
    participant James as James Chen
    participant Platform as Distribution Platform
    participant ND as Nondominium
    participant PPR as PPR System
    participant Gov as Governance Zome

    James->>Platform: Review weekly distribution requirements
    Platform->>ND: get_all_distribution_needs()
    ND->>Res: Query all registered deliveries for week
    Res-->>ND: Return consolidated delivery list

    James->>ND: optimize_delivery_routes()
    ND->>Gov: Calculate optimal routes with time windows
    Gov-->>ND: Return route efficiency plan

    James->>ND: derive_reputation_summary(Producers)
    ND->>PPR: Calculate producer reliability scores
    PPR-->>ND: Return producer quality ratings (avg 4.8/5)

    James->>ND: create_distribution_commitments()
    ND->>Gov: Generate delivery agreements with all producers

Network Optimization Process:

  1. Delivery Consolidation: James reviews all producer delivery needs:
    • 8 producers with 250-400 kg each
    • 150 urban delivery addresses
    • Geographic clustering optimization
  2. Route Planning: Algorithm optimizes for:
    • Minimum total distance: 127 km reduced to 89 km
    • Temperature maintenance requirements
    • Customer delivery time windows
    • Vehicle capacity constraints
  3. Producer Validation: All producers verified for food safety compliance and on-time performance
  4. Resource Sharing: Refrigerated vehicles and bike couriers coordinated across network

Phase 3: Multi-Producer Consolidation & Hub Operations (Tuesday Afternoon)

stateDiagram-v2
    [*] --> HarvestComplete: All producers ready
    HarvestComplete --> PickupScheduled: Route optimization complete
    PickupScheduled --> InTransitToHub: First pickup initiated
    InTransitToHub --> HubProcessing: Arrive at distribution hub
    HubProcessing --> ConsolidationReady: Quality verification complete
    ConsolidationReady --> LastMileDelivery: Final route loading

    note right of HubProcessing
        Temperature verification: 3.2°C ✅
        Quality inspection: All produce fresh
        Lot scanning: Complete traceability
        Mixed-produce consolidation
    end note

Consolidation & Hub Operations:

  1. Producer Pickup: James coordinates pickup sequence to minimize total travel distance
  2. Temperature Verification: Each pickup scanned for temperature compliance and quality
  3. Hub Processing: At urban distribution hub:
    • Quality verification for all produce
    • Mixed-produce consolidation for final delivery efficiency
    • Customer order assembly and packaging
    • Final route planning optimization
  4. Blockchain Tracking: Each produce batch logged with complete temperature and handling history

Phase 4: Last-Mile Delivery & Customer Interaction (Tuesday Evening)

graph TB
    subgraph "Delivery Fleet Coordination"
        A[Refrigerated Van - High Volume Routes]
        B[Bike Couriers - Urban Core]
        C[Electric Cargo Bikes - Eco Zones]
    end

    subgraph "Delivery Process"
        D[Route 1: Downtown - 45 deliveries]
        E[Route 2: Residential West - 38 deliveries]
        F[Route 3: University District - 32 deliveries]
    end

    subgraph "Customer Experience"
        G[Real-time Tracking]
        H[QR Code Verification]
        I[Quality Confirmation]
        J[Feedback Collection]
    end

    A --> D
    B --> E
    C --> F

    D --> G
    E --> H
    F --> I
    I --> J

Last-Mile Delivery Execution:

  1. Fleet Deployment: Mixed transportation approach:
    • 1 refrigerated van for high-volume suburban routes
    • 2 bike couriers for dense urban core delivery
    • 1 electric cargo bike for environmentally sensitive zones
  2. Real-Time Tracking: Customers receive live delivery updates and ETAs
  3. Quality Verification: QR codes on each package enable:
    • Producer verification and origin confirmation
    • Temperature history verification
    • Freshness guarantee validation
  4. Customer Interaction: Delivery confirmation and immediate feedback collection

Phase 5: Quality Assurance & Network Payment Processing (Wednesday)

sequenceDiagram
    participant Maria as Maria Garcia
    participant James as James Chen
    participant Platform as Distribution Platform
    participant ND as Nondominium
    participant PPR as PPR System

    James->>ND: initiate_delivery_completion()
    ND->>Gov: Validate all deliveries completed
    Gov-->>ND: Delivery completion confirmation

    Maria->>Platform: Review delivery performance report
    Platform->>ND: validate_delivery_quality()
    ND->>Gov: Verify temperature compliance and on-time delivery
    Gov-->>Platform: Quality metrics confirmed

    Maria->>ND: validate_specialized_role(OrganicProducer)
    ND->>Gov: Issue quality assurance PPR
    Gov->>PPR: record_delivery_excellence()

    James->>ND: process_distribution_payments()
    ND->>Gov: Execute automatic payment distribution
    Gov->>PPR: issue_financial_receipts()

Quality Assurance & Settlement:

  1. Delivery Metrics Analysis:
    • 98% on-time delivery rate
    • 100% temperature compliance maintained
    • 4.9/5 average customer satisfaction rating
  2. Quality Verification: All produce maintained freshness standards with zero quality complaints
  3. Payment Processing: Smart contract automatically distributes payments:
    • 85% to producers based on volume delivered
    • 10% to logistics network for distribution services
    • 5% to platform maintenance and development
  4. Reputation Enhancement: All network participants receive PPRs for successful collaboration

📊 Distribution Analytics & Network Performance

Real-Time Delivery Monitoring Dashboard

graph LR
    subgraph "Operational Metrics"
        A[Delivery Success Rate: 98%]
        B[Temperature Compliance: 100%]
        C[Route Efficiency: 30% improvement]
        D[Customer Satisfaction: 4.9/5]
    end

    subgraph "Environmental Impact"
        E[CO2 Reduction: 40% vs individual delivery]
        F[Food Waste Reduction: 95% vs traditional]
        G[Local Food Access: +250 households]
        H[Economic Circulation: $12,500 local]
    end

    subgraph "Network Efficiency"
        I[Vehicle Utilization: 87%]
        J[Resource Sharing: 3x efficiency]
        K[Scalability: Ready for 2x expansion]
        L[Adaptability: Weather-optimized routing]
    end

    A --> E
    B --> F
    C --> G
    D --> H

    E --> I
    F --> J
    G --> K
    H --> L

Network Performance Impact Analysis

graph LR
    subgraph "Before Network Distribution"
        Maria_Before["Maria: Individual Delivery<br/>4.2/5 efficiency<br/>High overhead costs"]
        James_Before["James: Single Route Planning<br/>Limited network effect"]
        System_Before["Food System: Fragmented<br/>High environmental impact"]
    end

    subgraph "Network Coordination Process"
        Phase1[Production Planning]
        Phase2[Route Optimization]
        Phase3[Hub Consolidation]
        Phase4[Last-Mile Delivery]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Network Distribution"
        Maria_After["Maria: Network Producer<br/>4.9/5 delivery reliability<br/>40% cost reduction<br/>+2 FoodDistribution PPRs"]
        James_After["James: Logistics Network Manager<br/>+3 RouteOptimization PPRs<br/>+1 NetworkCoordination"]
        System_After["Food System: Integrated<br/>Sustainable & Efficient<br/>Local economic multiplier"]
    end

    Maria_Before --> Phase1
    James_Before --> Phase1
    System_Before --> Phase1
    Phase4 --> Maria_After
    Phase4 --> James_After
    Phase4 --> System_After

🏗️ Distribution Platform Architecture

Logistics Coordination System

graph TB
    subgraph "Distribution Management Platform"
        Planning[Route Planning]
        Tracking[Real-Time Tracking]
        Quality[Quality Monitoring]
        Payments[Automated Settlement]
    end

    subgraph "Nondominium Distribution Integration"
        Person[Person Zome - Producer/Courier Profiles]
        Resource[Resource Zome - Food Assets & Vehicles]
        Governance[Governance Zome - Food Safety Rules]
    end

    subgraph "External Systems"
        GPS[GPS Navigation]
        IoT[Temperature Sensors]
        Payment[Payment Processing]
        Compliance[Food Safety Compliance]
    end

    Planning --> Resource
    Tracking --> Person
    Quality --> Governance
    Payments --> Governance

    Resource -.-> |Asset Status| IoT
    Person -.-> |Location Tracking| GPS
    Governance -.-> |Compliance Verification| Compliance

Advanced Distribution Features

Smart Logistics Capabilities:

  • Dynamic Route Optimization: Real-time adjustment based on traffic, weather, and delivery constraints
  • Predictive Quality Monitoring: AI-powered temperature prediction and spoilage prevention
  • Automated Resource Matching: Intelligent assignment of vehicles and couriers based on delivery requirements
  • Customer Preference Integration: Personalized delivery time windows and communication methods

Network Coordination Tools:

  • Capacity Sharing: Shared utilization of refrigerated vehicles and cold storage facilities
  • Cross-Training Programs: Multi-skilled couriers capable of handling diverse food products
  • Emergency Response: Rapid response system for delivery failures or quality issues
  • Seasonal Adaptation: Flexible network scaling for harvest season variations

💡 Distribution Innovation Benefits

Food System Resilience

  • Local Food Security: Increased reliability of fresh food access in urban areas
  • Producer Sustainability: Improved economic viability for small-scale farmers
  • Environmental Benefits: Reduced food miles and transportation emissions
  • Quality Preservation: Maintained food safety and nutritional value through optimized logistics

Economic & Social Impact

mindmap
  root((Local Food Distribution))
    Economic Benefits
      Producer Revenue
        Direct market access
        Reduced middlemen costs
        Predictable cash flow
      Consumer Value
        Fresher produce
        Competitive pricing
        Traceability assurance
    Environmental Sustainability
      Reduced Food Miles
        Consolidated delivery
        Optimized routing
        Alternative transport modes
      Waste Reduction
        Better inventory management
        Extended shelf life
        Composting partnerships
    Community Building
      Food Access
        Underserved neighborhoods
        Elderly and mobility limited
        Food desert remediation
      Local Economy
        Job creation
        Skill development
        Community wealth building

Technology-Enhanced Food Systems

  • Complete Traceability: Blockchain-based farm-to-table tracking with temperature and quality data
  • Predictive Analytics: Machine learning for demand forecasting and resource optimization
  • Quality Automation: Computer vision and sensors for automated quality assessment
  • Customer Education: Rich data about food origins, nutrition, and preparation

🎯 Strategic Distribution Outcomes

Immediate Network Benefits

  • Cost Reduction: 35% lower distribution costs through consolidation and sharing
  • Quality Improvement: 15% reduction in food waste and spoilage
  • Customer Satisfaction: 4.9/5 rating with 92% customer retention
  • Environmental Impact: 40% reduction in CO2 emissions from optimized logistics

Long-Term Food System Evolution

  • Food Security: Established reliable local food distribution network serving 5,000+ households
  • Producer Viability: 25 small farms achieved economic sustainability through direct market access
  • Community Resilience: Local food system capable of adapting to supply chain disruptions
  • Scalable Model: Framework replicable in other cities and regions

Platform Development

  • Distribution Templates: Standardized workflows for different food types and delivery models
  • Quality Standards: Developing industry benchmarks for local food distribution excellence
  • Network Marketplace: Growing platform for connecting additional producers and customers
  • Innovation Pipeline: Continuous improvement through feedback and data analytics

🔮 Future Distribution Scenarios

Advanced Food Logistics Integration

  • Autonomous Delivery: Integration with autonomous vehicles and delivery drones for最后一公里
  • Smart Packaging: IoT-enabled packaging that monitors and reports on food quality in real-time
  • Blockchain Integration: Enhanced traceability with smart contracts for automatic quality enforcement
  • AI-Powered Demand: Predictive analytics for production planning and inventory optimization

Network Expansion Models

  • Regional Hubs: Scaling to multiple cities with inter-connected regional distribution centers
  • Multi-Modal Integration: Combining different transportation modes (water, rail, road) for maximum efficiency
  • Community Integration: Partnering with schools, hospitals, and community organizations for institutional delivery
  • International Networks: Cross-border local food distribution with appropriate compliance and certification

This user story demonstrates how Nondominium enables distributed logistics networks to coordinate complex last-mile delivery operations, optimizing resource utilization while maintaining quality standards and creating resilient local food systems through decentralized governance and reputation-based trust.


Distribution network now serves 5,000+ households weekly with 98% customer satisfaction. The network has expanded to include 12 additional producers and is planning expansion to neighboring cities. The collaborative model has become a blueprint for sustainable local food systems nationwide.

User Story: peer production (makerspace) - Collaborative Manufacturing

Scenario: Makerspace Network Producing Custom Equipment Using Nondominium

Context: A distributed network of makerspaces collaborates to produce custom scientific equipment for research institutions. This scenario clearly demonstrates the limitations of Nondominium's resource sharing economics and the critical need for extension (ex. full REA integration with Network Resource Planning (NRP) for complete peer production network management).


🏗️ System Architecture Context

Production Network Requirements Analysis

graph TB
    subgraph "Nondominium Capabilities (Resource Sharing)"
        ResourceSharing[Resource Access & Sharing]
        Transactions[Transaction Logging]
        Reputation[PPR Reputation System]
        Governance[Basic Governance Rules]
    end

    subgraph "TrueCommon Requirements (Production Network)"
        NRP[Network Resource Planning]
        REA[Full REA Economics]
        Workflow[Production Workflow Mgt]
        Accounting[Integrated Accounting]
        Planning[Demand-Supply Planning]
        Impact[Social/Environmental Impact]
    end

    subgraph "Production Network Gap Analysis"
        Gap1["Multi-site Coordination"]
        Gap2["Production Workflow Mgt"]
        Gap3["Resource Optimization"]
        Gap4["Cost Accounting"]
        Gap5["Impact Measurement"]
    end

    ResourceSharing -.-> |Insufficient for| Gap1
    Transactions -.-> |Limited| Gap2
    Reputation -.-> |No workflow support| Gap3
    Governance -.-> |No planning tools| Gap4
    Governance -.-> |No impact tracking| Gap5

    NRP --> Gap1
    Workflow --> Gap2
    Planning --> Gap3
    Accounting --> Gap4
    Impact --> Gap5

Critical Missing Capabilities for Production Networks

What Nondominium Cannot Provide:

  • Multi-site Production Planning: Coordinated scheduling across distributed facilities
  • Production Workflow Management: Multi-stage production process coordination
  • Resource Optimization: Network-wide equipment and material allocation
  • Cost Accounting: Complete production cost tracking and allocation
  • Supply Chain Integration: Material procurement and inventory management
  • Quality Management: Cross-facility quality assurance processes

New capabilities required:

  • Network Resource Planning (NRP): Distributed production coordination
  • Full REA Integration: Complete economic relationships and value flows
  • Production Accounting: Comprehensive cost and contribution tracking
  • Supply Chain Management: Material flow optimization across network
  • Impact Assessment: Environmental and social impact measurement

🏭 The Players

Dr. Sarah Mitchell - Research Project Lead

  • Role: Accountable Agent (Product Designer & Commissioning Agent)
  • Goal: Produce custom environmental monitoring sensors for climate research
  • Reputation: Successful track record in research equipment design and project management

Alex Thompson - Advanced Fabrication Specialist

  • Role: Primary Accountable Agent (Production Facilitator)
  • Goal: Coordinate multi-site manufacturing while maintaining quality standards
  • Reputation: Expert in precision manufacturing with ISO certification

The Production Network

  • Specialized Facilities: 3 makerspaces with complementary capabilities
  • Equipment: CNC mills, 3D printers, electronics assembly, calibration labs
  • Governance Rules: Quality validation required at each stage, intellectual property protection

🔄 Production Journey

Phase 1: Project Design & Production Planning (Week 1)

sequenceDiagram
    participant Sarah as Dr. Sarah Mitchell
    participant Platform as Production Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Sarah->>Platform: Submit production project
    Sarah->>ND: create_person_with_role(ResearchLead)
    ND->>Res: Create project lead profile

    Sarah->>ND: create_resource_specification(EnvironmentalSensor)
    ND->>Res: Store technical specifications
    ND->>Gov: Link quality standards and IP protection

    Sarah->>Platform: Define production workflow
    Platform->>ND: propose_production_workflow()
    ND->>Gov: Create multi-stage production commitment

Production Planning Process:

  1. Project Specification: Sarah defines environmental sensor requirements:
    • Technical specifications (accuracy, durability, connectivity)
    • Quality standards (ISO 9001 compliance)
    • Timeline (8 weeks total production)
    • Budget allocation ($45,000 total)
  2. IP Protection: Embedded governance rules protect research aainst IP enclosure (commons)
  3. Workflow Design: Multi-stage production process with validation gates
  4. Capability Matching: Platform identifies makerspaces with required equipment and expertise

Phase 2: Network Discovery & Capability Matching (Week 2)

sequenceDiagram
    participant Alex as Alex Thompson
    participant Sarah as Dr. Sarah Mitchell
    participant Platform as Production Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Alex->>Platform: Browse production opportunities
    Platform->>ND: get_production_requirements()
    ND->>Res: Query sensor production specs
    Res-->>ND: Return technical requirements

    Alex->>ND: derive_reputation_summary(Sarah)
    ND->>PPR: Calculate research lead reputation
    PPR-->>ND: Return profile (5 PPRs, 4.9/5 project success)

    Alex->>ND: validate_production_capability(CNCFabrication)
    ND->>Gov: Verify equipment and certification
    Gov-->>Platform: Capability validated

    Alex->>Platform: Submit production bid
    Platform->>ND: propose_commitment(ProductionService)
    ND->>Gov: Create production agreement

Capability Validation Process:

  1. Production Facility Review: Alex's makerspace capabilities verified:
    • CNC precision manufacturing ✅
    • Clean room assembly area ✅
    • ISO 9001 quality certification ✅
    • Electronics testing equipment ✅
  2. Team Expertise Assessment: Technical team qualifications validated
  3. Capacity Planning: Production schedule alignment across network facilities
  4. Quality Assurance: Multi-site quality control procedures established

Phase 3: Multi-Site Production Coordination (Weeks 3-6)

graph TB
    subgraph "Production Stage 1: Component Fabrication"
        A[Sensor Casings - CNC Machining<br/>Makerspace A]
        B[PCB Boards - Precision Milling<br/>Makerspace B]
        C[Mounting Hardware - 3D Printing<br/>Makerspace C]
    end

    subgraph "Production Stage 2: Assembly & Testing"
        D[Electronics Assembly<br/>Makerspace B]
        E[Sensor Calibration<br/>Makerspace A]
        F[Quality Assurance Testing<br/>All Sites]
    end

    subgraph "Production Stage 3: Integration & Validation"
        G[Final Assembly<br/>Makerspace A]
        H[Environmental Testing<br/>Makerspace B]
        I[Research Validation<br/>Sarah's Lab]
    end

    A --> D
    B --> D
    C --> G
    D --> E
    E --> G
    G --> H
    H --> I

Distributed Manufacturing Process:

  1. Stage 1 - Component Production (Weeks 3-4):
    • Makerspace A: CNC machining of precision sensor casings
    • Makerspace B: PCB fabrication with micro-controller integration
    • Makerspace C: 3D printing of mounting brackets and protective components
  2. Stage 2 - Assembly & Testing (Weeks 4-5):
    • Electronics assembly with quality control checkpoints
    • Sensor calibration against certified reference standards
    • Multi-site cross-validation of test results
  3. Stage 3 - Integration (Weeks 5-6):
    • Final assembly with complete system integration
    • Environmental chamber testing for durability validation
    • Research team acceptance testing

Phase 4: Quality Assurance & Certification (Week 7)

sequenceDiagram
    participant Sarah as Dr. Sarah Mitchell
    participant Alex as Alex Thompson
    participant Platform as Production Platform
    participant ND as Nondominium
    participant PPR as PPR System

    Alex->>ND: initiate_quality_validation()
    ND->>Gov: Execute multi-site quality checks
    Gov-->>ND: Quality validation results

    Sarah->>Platform: Review production quality report
    Platform->>ND: validate_production_standards()
    ND->>Gov: Verify ISO compliance
    Gov-->>Platform: Certification confirmed

    Sarah->>ND: validate_specialized_role(ResearchValidation)
    ND->>Gov: Issue research validation PPR
    Gov->>PPR: record_quality_achievement()

    Alex->>ND: claim_production_completion()
    ND->>PPR: issue_production_receipts()

Quality Assurance Process:

  1. Multi-Site Validation: Independent quality verification at each production facility
  2. Cross-Certification: Each site validates work of other sites for redundancy
  3. Research Acceptance: Sarah's team validates equipment meets research specifications
  4. Certification Issuance: ISO compliance documented on blockchain
  5. Performance Tracking: All production stages recorded with PPRs for future reference

📊 Production Analytics & Network Performance

Real-Time Production Monitoring

graph LR
    subgraph "Production Metrics"
        A[Component Production Rate] --> B[Quality Pass Rate]
        B --> C[Timeline Adherence]
        C --> D[Cost Efficiency]
    end

    subgraph "Quality Metrics"
        E[Defect Rate: 0.02%]
        F[Calibration Accuracy: 99.8%]
        G[Environmental Test Pass: 100%]
        H[Research Acceptance: 100%]
    end

    subgraph "Network Performance"
        I[Inter-Site Coordination]
        J[Resource Utilization]
        K[Knowledge Sharing]
        L[Continuous Improvement]
    end

    D --> E
    D --> F
    D --> G
    D --> H

    I --> J
    J --> K
    K --> L

Production Outcomes:

  • Quality Achievement: 99.8% calibration accuracy, 100% research acceptance
  • Timeline Performance: On-time delivery with 2-day buffer for contingencies
  • Cost Optimization: 12% under budget through resource sharing
  • Network Efficiency: 85% equipment utilization across all sites

Reputation Development Analysis

graph LR
    subgraph "Before Production"
        Sarah_Before["Sarah: Research Lead<br/>5 PPRs - 4.9/5 rating"]
        Alex_Before["Alex: Production Manager<br/>8 PPRs - 4.8/5 rating"]
        Network_Before["Production Network: 3 sites<br/>Avg 4.7/5 rating"]
    end

    subgraph "Production Collaboration Process"
        Phase1[Design & Planning]
        Phase2[Multi-Site Fabrication]
        Phase3[Quality Assurance]
        Phase4[Research Validation]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Production"
        Sarah_After["Sarah: Research Innovation Leader<br/>8 PPRs - 5.0/5 rating<br/>plus 1 ProductDesign<br/>plus 1 ResearchCoordination"]
        Alex_After["Alex: Advanced Manufacturing Expert<br/>12 PPRs - 4.9/5 rating<br/>plus 2 MultiSiteProduction<br/>plus 1 QualityExcellence"]
        Network_After["Production Network: Enhanced<br/>Avg 4.9/5 rating<br/>plus 1 NetworkCollaboration"]
    end

    Sarah_Before --> Phase1
    Alex_Before --> Phase1
    Network_Before --> Phase1
    Phase4 --> Sarah_After
    Phase4 --> Alex_After
    Phase4 --> Network_After

🏗️ Integrated Production Architecture: Nondominium + TrueCommon

Complete Production Network Management System

graph TB
    subgraph "Current Nondominium (Resource Sharing Layer)"
        ND_Person[Person Zome - Agent Profiles]
        ND_Resource[Resource Zome - Equipment Registry]
        ND_Governance[Governance Zome - Basic Rules]
        ND_PPR[PPR Reputation System]
    end

    subgraph "Required TrueCommon (Production Management Layer)"
        TC_REA[Full REA Economics]
        TC_NRP[Network Resource Planning]
        TC_Workflow[Production Workflows]
        TC_Accounting[Integrated Accounting]
        TC_SupplyChain[Supply Chain Management]
        TC_Quality[Quality Management]
        TC_Planning[Demand-Supply Planning]
    end

    subgraph "Enhanced Production Platform"
        Design[Design Management]
        Scheduling[Production Scheduling]
        Quality[Quality Assurance]
        Inventory[Resource Inventory]
        Costing[Cost Accounting]
        Planning[Capacity Planning]
        Impact[Impact Assessment]
    end

    %% Nondominium provides foundation
    Design --> ND_Person
    Scheduling -.-> |Basic access control| ND_Resource
    Quality -.-> |Reputation data| ND_PPR

    %% TrueCommon provides production management
    Costing --> TC_Accounting
    Planning --> TC_NRP
    Inventory --> TC_SupplyChain
    Quality --> TC_Quality
    Scheduling --> TC_Workflow
    Design --> TC_REA
    Impact --> TC_NRP

    %% Integration points
    TC_NRP -.-> |Resource data| ND_Resource
    TC_Accounting -.-> |Transaction base| ND_PPR
    TC_REA -.-> |Agent identities| ND_Person

Production Network Capability Gap Analysis

CapabilityNondominiumTrueCommon RequiredImpact on Production Networks
Resource Discovery✅ Excellent-Foundation layer works well
Access Governance✅ Strong-Basic access control sufficient
Reputation Tracking✅ PPR System-Individual reputation works
Multi-site Planning❌ Not Available✅ NRP ModuleCritical Gap - Production coordination
Production Workflows❌ Not Available✅ Workflow ModuleCritical Gap - Process management
Cost Accounting❌ Transaction only✅ Accounting ModuleCritical Gap - Financial tracking
Supply Chain❌ Not Available✅ Supply Chain ModuleCritical Gap - Material flow
Quality Management❌ Not Available✅ Quality ModuleCritical Gap - Cross-site QA
Impact Measurement❌ Not Available✅ Impact ModuleCritical Gap - Sustainability

Why Nondominium Alone Cannot Support Production Networks

Limitation 1: Bilateral Transaction Focus

  • Nondominium is designed for 1-to-1 resource sharing
  • Production networks require N-to-M coordination (multiple facilities, multiple workflows)
  • No support for complex multi-party production relationships

Limitation 2: No Production Planning

  • Resource sharing ≠ production planning
  • No capability for capacity planning, bottleneck analysis, or production optimization
  • Missing workflow sequencing and dependency management

Limitation 3: Limited Economic Model

  • Economic events track resource movements, not value creation
  • No support for work-in-progress, value-added processes, or production costs
  • Missing comprehensive accounting for production networks

TrueCommon's Network Resource Planning (NRP) bridges these gaps by providing complete REA integration with production-specific capabilities.

Advanced Production Features

Smart Manufacturing Capabilities:

  • Predictive Maintenance: IoT sensors predict equipment maintenance needs
  • Automated Quality Control: Computer vision and sensor-based quality verification
  • Dynamic Resource Allocation: Real-time equipment scheduling across network
  • Supply Chain Integration: Automated material procurement and inventory management

Collaborative Tools:

  • Design Sharing: Secure multi-site design collaboration with version control
  • Knowledge Transfer: Expertise sharing between production facilities
  • Best Practice Library: Growing database of production techniques and innovations
  • Performance Benchmarking: Cross-facility comparison and improvement identification

💡 Production Innovation Benefits

Distributed Manufacturing Advantages

  • Resource Optimization: Shared access to expensive specialized equipment
  • Risk Mitigation: Production redundancy across multiple sites
  • Local Expertise: Leveraging regional manufacturing capabilities
  • Scalability: Flexible production capacity based on demand

Quality & Compliance Enhancement

mindmap
  root((Distributed Production))
    Quality Assurance
      Multi-Site Validation
        Independent verification
        Cross-site quality checks
        Redundant testing procedures
      Continuous Improvement
        Real-time feedback loops
        Process optimization
        Knowledge sharing
    Operational Efficiency
      Resource Sharing
        Specialized equipment access
        Expertise pooling
        Cost distribution
      Flexible Manufacturing
        Distributed capacity
        Parallel production streams
        Rapid reconfiguration
    Innovation Enablement
      Collaborative Design
        Multi-disciplinary input
        Rapid prototyping
        Iterative improvement
      Technology Transfer
        Skill development
        Best practice sharing
        Advanced technique adoption

Economic & Environmental Impact

  • Cost Reduction: 40% lower capital investment through equipment sharing
  • Reduced Waste: Optimized material usage and precision manufacturing
  • Local Production: Reduced transportation costs and carbon footprint
  • Job Creation: Distributed employment opportunities in local communities

🎯 Strategic Production Outcomes

Immediate Project Benefits

  • Research Acceleration: Custom sensors delivered 2 weeks ahead of schedule
  • Cost Savings: $5,400 under budget through collaborative production
  • Quality Excellence: 100% research acceptance with enhanced accuracy
  • Network Growth: All three makerspaces secured additional production contracts

Long-Term Manufacturing Evolution

  • Production Network: Established ongoing collaborative manufacturing relationships
  • Technology Enhancement: Upgraded equipment capabilities through shared investment
  • Skill Development: Cross-trained workforce with multi-facility expertise
  • Market Expansion: Access to larger projects requiring diverse capabilities

Platform Development

  • Production Templates: Standardized workflows for common equipment types
  • Expert Marketplace: Growing database of specialized manufacturing capabilities
  • Quality Standards: Developing industry-wide benchmarks for distributed production
  • Innovation Pipeline: Continuous improvement through collaborative R&D

🔮 Future Production Scenarios

Advanced Manufacturing Integration

  • AI-Optimized Production: Machine learning for process optimization and quality prediction
  • Digital Twins: Virtual production planning and simulation before physical manufacturing
  • Blockchain Supply Chain: Complete material traceability from source to final product
  • Autonomous Quality Control: Self-correcting production processes with minimal human intervention

Industry Expansion Models

  • Medical Device Manufacturing: Distributed production of customized medical equipment
  • Aerospace Components: Specialized parts production across certified facilities
  • Renewable Energy: Collaborative manufacturing of solar and wind energy components
  • Consumer Electronics: Localized production with global quality standards

This user story demonstrates how Nondominium enables distributed manufacturing networks to collaborate on complex production projects, combining the capabilities of multiple facilities while maintaining quality standards and protecting intellectual property through decentralized governance and reputation systems.


Production completed successfully with 50 environmental sensors delivered to research institution. The production network has since secured 3 additional collaborative projects and expanded to include 2 more makerspaces with complementary capabilities.

User Story: Open Science - Resource Usage Process

Scenario: University Research Team Using Shared Laboratory Equipment

Context: A university research team needs specialized laboratory equipment for a critical experiment, accessing it through their institutional platform integrated with Nondominium. This scenario demonstrates Nondominium's capabilities for specialized equipment access, with post MVP capabilities providing enhanced research network coordination and impact measurement.


🏗️ System Architecture Context

Research Equipment Access (Nondominium Core Strength)

graph TB
    subgraph "Nondominium - Specialized Equipment Sharing"
        Person[Person Zome - Researcher Profiles]
        Resource[Resource Zome - Lab Equipment Registry]
        Governance[Governance Zome - Access Protocols]
        PPR[PPR Reputation System]
    end

    subgraph "Research Access Capabilities"
        Certification[Research Certification Management]
        Access[Secure Equipment Access]
        Protocol[Experimental Protocol Validation]
        Reputation[Research Responsibility Tracking]
    end

    Person --> Certification
    Resource --> Access
    Governance --> Protocol
    PPR --> Reputation

Nondominium Excellently Handles:

  • Researcher certification and qualification verification
  • Specialized equipment access with safety protocols
  • Research reputation and responsible usage tracking
  • Secure audit trails for research compliance

Post MVP Research Network Enhancement

graph TB
    subgraph "Research Network Coordination"
        NRP[Research Network Planning]
        Impact[Research Impact Measurement]
        Accounting[Research Cost Accounting]
        Planning[Resource Capacity Planning]
    end

    subgraph "Enhanced Research Management"
        Collaboration[Cross-Institution Collaboration]
        Scheduling[Research Project Scheduling]
        ImpactTracking[Research Impact Analytics]
        ResourceOptimization[Equipment Network Optimization]
    end

Post MVP enhancement:

  • Multi-institution research coordination
  • Research impact measurement beyond equipment usage
  • Collaborative project planning and resource allocation
  • Research network efficiency optimization

🎯 The Players

Dr. Elena Rodriguez - University Research Director

  • Role: Accountable Agent with Research specialization
  • Goal: Access high-end laboratory equipment for climate research project
  • Reputation: Strong background in scientific collaboration and responsible equipment use

Professor Chen Wei - Laboratory Manager

  • Role: Primary Accountable Agent (Custodian)
  • Goal: Monetize laboratory equipment while ensuring proper scientific usage
  • Reputation: Excellent track record in equipment maintenance and research support

The Resource

  • Equipment: Cryogenic Electron Microscope (CEM-3000)
  • Current Location: Advanced Materials Research Lab, MIT
  • Governance Rules: Requires research certification, experimental protocol approval, real-time monitoring

🔄 Resource Usage Journey

Phase 1: Research Planning & Equipment Discovery (Week 1)

sequenceDiagram
    participant Elena as Dr Elena Rodriguez
    participant Platform as University Platform
    participant ND as Nondominium
    participant Res as Resource Zome
    participant Gov as Governance Zome

    Elena->>Platform: Search for electron microscopes
    Platform->>ND: get_resources_by_specification()
    ND->>Res: Query CEM-3000 availability
    Res-->>ND: Return microscope specs and calendar
    ND-->>Platform: Display equipment with governance rules
    Platform-->>Elena: Show available slots and requirements

    Elena->>Platform: Review research certification requirements
    Platform->>ND: get_governance_rule_profile()
    ND->>Gov: Return research protocol requirements
    Elena->>Platform: Submit research proposal and credentials
    Platform->>ND: propose_commitment(AccessForUse)
    ND->>Gov: Create research usage commitment

Research Planning Process:

  1. Equipment Discovery: Elena searches institutional platform for cryogenic electron microscopes
  2. Requirement Analysis: Reviews governance rules including:
    • PhD-level research certification ✅
    • Experimental protocol approval required
    • Real-time usage monitoring and logging
    • Minimum 2-week advance booking
  3. Research Proposal Submission: Elena submits detailed experimental protocol through institutional review

Phase 2: Research Validation & Protocol Approval (Week 2)

sequenceDiagram
    participant Chen as Prof Chen Wei
    participant Elena as Dr Elena Rodriguez
    participant ND as Nondominium
    participant PPR as PPR System
    participant Gov as Governance Zome

    ND->>Chen: Notify of new research request
    Chen->>ND: Access Elena's research credentials
    ND->>PPR: derive_reputation_summary(Elena)
    PPR-->>ND: Return research collaboration history
    ND-->>Chen: Display Elena's research reputation

    Chen->>ND: validate_research_protocol()
    ND->>Gov: Review experimental methodology
    Gov-->>ND: Protocol validation result
    Chen->>ND: approve_commitment_with_conditions()
    ND->>Gov: Create usage agreement with monitoring

Research Validation Process:

  1. Credentials Verification: Chen validates Elena's research background and institutional affiliation
  2. Protocol Review: Experimental methodology reviewed for equipment compatibility and safety
  3. Reputation Assessment: Elena's research collaboration history analyzed:
    • 15 successful research collaborations
    • 4.9/5 equipment care rating
    • 0 protocol violations in 5 years
  4. Usage Agreement: Custom agreement created with real-time monitoring requirements

Phase 3: Usage Preparation & Training (Week 3)

stateDiagram-v2
    [*] --> Available: CEM-3000 Ready
    Available --> Reserved: Research protocol approved
    Reserved --> PreparedForUse: Elena completes training
    PreparedForUse --> UsageReady: System calibration complete

    note right of Reserved
        Equipment state: Active → Reserved
        Research protocol linked
        Monitoring systems activated
    end note

    note right of PreparedForUse
        Elena completes safety training
        Calibration procedures verified
        Real-time logging configured
    end note

Usage Preparation:

  1. Equipment Reservation: CEM-3000 status changed from Available to Reserved
  2. Research Training: Elena completes specialized equipment safety and usage training
  3. System Configuration: Real-time monitoring and data logging systems configured for research requirements
  4. Calibration Verification: Equipment calibrated to meet experimental specifications

Phase 4: Research Usage & Real-Time Monitoring (Week 4-5)

sequenceDiagram
    participant Elena as Dr Elena Rodriguez
    participant System as Monitoring System
    participant ND as Nondominium
    participant Res as Resource Zome
    participant PPR as PPR System

    Elena->>ND: initiate_use_process(research_experiment)
    ND->>Res: validate_usage_permissions()
    Elena->>System: Start experimental procedure
    System->>ND: log_economic_event(Use, real_time)
    ND->>PPR: generate_usage_metrics()

    loop Research Duration (2 weeks)
        Elena->>System: Log experimental data
        System->>ND: continuous_usage_tracking()
        ND->>PPR: update_performance_metrics()
        System->>Chen: send_usage_reports()
    end

    Elena->>ND: complete_research_session()
    ND->>PPR: issue_participation_receipts()

Research Usage Process:

  1. Experiment Initiation: Elena begins cryogenic microscopy experiments with real-time monitoring
  2. Continuous Tracking: System logs usage hours, experimental parameters, and equipment performance
  3. Performance Monitoring: Real-time alerts for any deviations from approved protocols
  4. Data Integration: Research data automatically linked to usage logs for compliance verification

Phase 5: Research Completion & Data Verification (Week 5)

graph TB
    subgraph "Research Completion Workflow"
        A[Experiment Complete] --> B[Data Validation]
        B --> C[Equipment Condition Check]
        C --> D[Usage Report Generation]
        D --> E[PPR Issuance]
        E --> F[Research Publication Support]
    end

    subgraph "PPR Categories Generated"
        G[UseService - Research Application]
        H[ServiceValidation - Protocol Compliance]
        I[CommitmentFulfillment - Research Completion]
        J[ValidationActivity - Equipment Care]
    end

    E --> G
    E --> H
    E --> I
    E --> J

    subgraph "Quality Metrics"
        K["Equipment Care: 5.0 out of 5"]
        L["Protocol Adherence: 4.9 out of 5"]
        M["Data Quality: 4.8 out of 5"]
        N["Overall Satisfaction: 4.9 out of 5"]
    end

    E --> K
    E --> L
    E --> M
    E --> N

Research Completion Process:

  1. Experimental Validation: Research data verified against expected outcomes and equipment usage parameters
  2. Equipment Assessment: CEM-3000 inspected for wear and calibration maintenance
  3. Usage Documentation: Comprehensive usage report generated with experimental parameters and performance metrics
  4. Research Support: System generates usage documentation for research publication and reproducibility

📊 Usage Analytics & Performance Metrics

Real-Time Monitoring Dashboard

graph LR
    subgraph "Live Monitoring"
        A[Equipment Status] --> B[Usage Hours]
        B --> C[Performance Metrics]
        C --> D[Alert System]
    end

    subgraph "Research Metrics"
        E[Experimental Progress] --> F[Data Quality]
        F --> G[Protocol Compliance]
        G --> H[Research Milestones]
    end

    subgraph "Equipment Health"
        I[Temperature Monitoring] --> J[Vibration Analysis]
        J --> K[Calibration Status]
        K --> L[Maintenance Alerts]
    end

    D --> E
    H --> I

Usage Analytics Delivered:

  • Equipment Utilization: 87% efficiency rate during research period
  • Research Productivity: 3 experimental phases completed ahead of schedule
  • Equipment Health: No performance degradation, routine maintenance only
  • Research Quality: High-quality data suitable for peer-reviewed publication

Performance Impact Analysis

graph LR
    subgraph "Before Research Usage"
        Elena_Before["Elena: Research Reputation<br/>4.7 out of 5 - 8 PPRs"]
        Chen_Before["Chen: Equipment Management<br/>4.8 out of 5 - 12 PPRs"]
    end

    subgraph "Research Collaboration Process"
        Phase1[Planning & Discovery]
        Phase2[Validation & Approval]
        Phase3[Usage & Monitoring]
        Phase4[Completion & Documentation]

        Phase1 --> Phase2
        Phase2 --> Phase3
        Phase3 --> Phase4
    end

    subgraph "After Research Usage"
        Elena_After["Elena: Research Specialist<br/>4.9 out of 5 - 12 PPRs<br/>plus 1 UseService<br/>plus 1 ResearchCollaboration"]
        Chen_After["Chen: Research Support Leader<br/>4.9 out of 5 - 15 PPRs<br/>plus 1 ServiceProvision<br/>plus 1 ResearchValidation"]
    end

    Elena_Before --> Phase1
    Chen_Before --> Phase1
    Phase4 --> Elena_After
    Phase4 --> Chen_After

🏗️ Platform Integration Architecture

Research Platform Integration

graph TB
    subgraph "University Research Platform"
        LMS[Learning Management System]
        Research[Research Portal]
        Scheduling[Equipment Scheduling]
        Compliance[Compliance Dashboard]
    end

    subgraph "Nondominium Research Integration"
        Person[Person Zome - Research Profiles]
        Resource[Resource Zome - Lab Equipment]
        Governance[Governance Zome - Research Protocols]
    end

    subgraph "Research Support Systems"
        LIMS[Laboratory Information System]
        Publishing[Publication Support]
        Grants[Grant Management]
        Ethics[Ethics Review System]
    end

    LMS --> Person
    Research --> Resource
    Scheduling --> Governance
    Compliance --> Governance

    Person -.-> |Research Credentials| LIMS
    Resource -.-> |Equipment Status| LIMS
    Governance -.-> |Protocol Compliance| Ethics
    Publishing -.-> |Usage Data| Research

Research-Specific Features

Platform Capabilities:

  • Research Protocol Management: Integration with institutional review boards
  • Grant Funding Integration: Automatic usage tracking for research grants
  • Publication Support: Usage documentation for research reproducibility
  • Compliance Reporting: Automated generation of regulatory compliance reports

Advanced Monitoring:

  • Equipment Performance: Real-time sensor data and predictive maintenance
  • Research Progress: Integration with project management systems
  • Quality Assurance: Automated data quality validation and alerts
  • Collaboration Tools: Multi-institutional research coordination

💡 Research Innovation Benefits

Scientific Advancement

  • Equipment Access: Democratized access to expensive research equipment
  • Collaborative Research: Cross-institutional collaboration without equipment duplication
  • Research Reproducibility: Detailed usage logs and parameter tracking
  • Grant Efficiency: Optimized equipment utilization for research funding

Academic Partnership Models

mindmap
  root((Research Resource Sharing))
    Institutional Benefits
      Cost Optimization
        Shared equipment costs
        Reduced maintenance overhead
        Efficient space utilization
      Research Enhancement
        Access to specialized equipment
        Interdisciplinary collaboration
        Advanced research capabilities
    Academic Collaboration
      Cross-Institutional Projects
        Joint research initiatives
        Shared facility management
        Collaborative grant applications
      Student Development
        Advanced training opportunities
        Research skill development
        Network building
    Technical Innovation
      Smart Laboratory Integration
        IoT sensor networks
        Real-time monitoring systems
        Predictive maintenance
        Automated compliance reporting
      Research Support Systems
        Publication assistance
        Data management tools
        Protocol optimization

Sustainability Impact

  • Equipment Longevity: Optimized usage schedules extending equipment lifespan
  • Energy Efficiency: Reduced idle time and improved scheduling algorithms
  • Waste Reduction: Shared usage reduces redundant equipment purchases
  • Knowledge Sharing: Collaborative research reduces duplicated experimental efforts

🎯 Strategic Outcomes

Immediate Research Benefits

  • Research Acceleration: 6-month research project completed in 5 weeks
  • Cost Savings: University saved $250,000 in equipment purchase costs
  • Publication Quality: High-quality data leading to Nature publication
  • Reputation Building: Both researchers gained specialized equipment PPRs

Long-Term Academic Impact

  • Research Network: Established ongoing equipment sharing agreement between institutions
  • Grant Success: Improved grant applications through documented equipment access
  • Student Training: Enhanced research training opportunities for graduate students
  • Innovation Ecosystem: Contributed to regional research infrastructure optimization

Platform Evolution

  • Research Module: University platform now includes specialized research equipment sharing
  • Protocol Library: Growing database of validated research protocols and procedures
  • Collaboration Network: Expanding network of research institutions sharing equipment
  • Funding Model: New revenue streams through research equipment monetization

This user story demonstrates how Nondominium enables research institutions to transform expensive laboratory equipment from isolated assets into shared research infrastructure, combining the power of Web2 platforms with the trust and accountability of decentralized governance while accelerating scientific discovery and optimizing research funding.


Research collaboration completed successfully with breakthrough results published in high-impact journal. Both institutions have expanded their equipment sharing network to include 5 additional research facilities.

P2PModels vs Nondominium vs TrueCommons: Comprehensive Analysis Report

Executive Summary

This report provides a comprehensive analysis of three decentralized platform projects:

  1. P2PModels - An Aragon-based organization developing decentralized governance and resource sharing tools
  2. Nondominium - Core Engine: A sophisticated Holochain-based ValueFlows-compliant resource sharing application with embedded governance and private participation receipt system
  3. TrueCommons - Pilot Implementation: A Network Resource Planning (NRP) system that will serve as the first practical implementation of the Nondominium engine for digital commons

Critical Relationship: TrueCommons is not just another project in the ecosystem - it's specifically designed as the pilot implementation of Nondominium's core engine, demonstrating how the sophisticated PPR system and embedded governance can be applied to create Network Resource Planning systems for digital commons. This represents a strategic engine-to-application relationship where Nondominium provides the foundational infrastructure and TrueCommons provides the domain-specific implementation.

While all three projects aim to enable decentralized collaboration and resource sharing, they take fundamentally different architectural approaches, serve different use cases, and represent different maturity levels in the decentralized ecosystem.


Project Analysis Matrix

AspectP2PModelsNondominiumTrueCommons
Primary PlatformEthereum/AragonHolochainHolochain + hREA
Core FocusDAO governance toolsCore Engine - Resource sharing infrastructurePilot NRP - Digital commons implementation
RelationshipIndependent organizationFoundational engine for NRP systemsFirst implementation using Nondominium engine
MaturityPrototype/Proof of ConceptAdvanced development stageEarly prototype (UI-focused)
Economic ModelToken-based votingValueFlows + PPR reputation systemValueFlows + commons economics
GovernanceCommittee-based delegationEmbedded governance + PPR validationCommons governance (engine-provided)
Target UsersDAO operators and membersNRP system developersDigital commons contributors
Key InnovationCommittee delegation systemPPR system - cryptographic reputation trackingNRP application - capture-resistant commons

P2PModels Organization Analysis

Overview

P2PModels is a research-focused organization developing decentralized governance tools primarily on the Ethereum/Aragon platform. Their work focuses on DAO operations, committee delegation, and decentralized task management.

Key Projects

1. P2PModels Wiki (⭐ 30 stars)

  • Technology Stack: Aragon framework, IPFS, Solidity 0.4.24
  • Purpose: Unstoppable wiki for censorship-resistant knowledge sharing
  • Features:
    • Markdown-based page editing
    • Permission-based page protection
    • IPFS integration for content storage
    • Aragon DAO integration for governance

2. Committees App (⭐ 5 stars)

  • Technology Stack: Aragon, Solidity, MiniMe tokens
  • Purpose: Delegate DAO operations to subgroups for faster decision-making
  • Features:
    • Committee creation with custom voting parameters
    • Token-based committee membership
    • Delegated authority mechanisms
    • Aragon native app integration

3. Task Allocation Prototype

  • Technology Stack: Ethereum, Hardhat, The Graph, Aragon Connect
  • Purpose: Decentralized allocation of subtitle tasks for Amara platform
  • Approach: Round-robin and first-come-first-served allocation algorithms
  • Status: Research prototype with multiple allocation strategies

Architectural Patterns

P2PModels follows these consistent patterns:

  • Aragon Native Apps: All major projects are built as Aragon applications
  • IPFS Integration: Content storage and censorship resistance via IPFS
  • Token-Based Governance: MiniMe tokens for voting and access control
  • Solidity Smart Contracts: Ethereum-based business logic
  • The Graph Integration: Off-chain data indexing and querying

Strengths

  • Consistent Platform Focus: Deep expertise in Aragon ecosystem
  • Research-Driven: Academic approach to DAO governance problems
  • Modular Design: Reusable components across projects
  • Real-World Applications: Focus on practical governance problems

Limitations

  • Platform Dependency: Heavy reliance on Aragon framework
  • Legacy Solidity: Using older Solidity versions (0.4.x)
  • Ethereum Limitations: Gas costs and scalability constraints
  • Limited Scope: Focus on governance rather than broader resource sharing

Nondominium Project Analysis (Core Engine)

Overview

Nondominium is a sophisticated Holochain-based core engine implementing ValueFlows-compliant resource sharing with embedded governance rules and the groundbreaking Private Participation Receipts (PPR) system. It represents a mature implementation of agent-centric decentralized resource management designed to power Network Resource Planning (NRP) systems.

Engine Architecture for NRP Systems

Designed as Foundational Infrastructure:

  • Modular Zome Architecture: 3-zome structure provides clean separation for NRP applications
  • PPR Reputation Engine: Cryptographic receipt system for trust and reputation in any domain
  • ValueFlows Compliance: Standardized economic modeling applicable across industries
  • Capability-Based Security: Flexible access control for different NRP use cases
  • Embedded Governance: Rules engine that can be customized for specific domains

Engine Capabilities for NRP Applications:

  • Resource Lifecycle Management: Complete tracking from creation to end-of-life
  • Agent Reputation System: Multi-role reputation with privacy preservation
  • Economic Event Tracking: Full audit trail of all economic activities
  • Process Validation: Structured workflows with role-based access control
  • Cross-Zome Coordination: Complex business logic across multiple domains

Architecture

3-Zome Structure

  1. zome_person: Agent identity, profiles, roles, capability-based access control
  2. zome_resource: Resource specifications and lifecycle management
  3. zome_gouvernance: Commitments, economic events, governance rules, PPR system

Technology Stack

  • Backend: Rust (Holochain HDK ^0.6.0 / HDI ^0.7.0) compiled to WASM
  • Frontend: Svelte 5.0 + TypeScript + Vite 6.2.5
  • Testing: Vitest 3.1.3 + @holochain/tryorama 0.18.2
  • Client: @holochain/client 0.19.0

Key Innovations

Participation Receipts (PPR) System

The most sophisticated innovation in Nondominium is the Private Participation Receipts (PPR) system - a cryptographically signed, cumulative reputation mechanism that forms the foundation for trust and governance:

#![allow(unused)]
fn main() {
// From zome_gouvernance/src/lib.rs
fn generate_promotion_validation_pprs(
  promoted_agent: AgentPubKey,
  validator_agent: AgentPubKey,
  resource_hash: ActionHash,
  validation_hash: ActionHash,
) -> ExternResult<IssueParticipationReceiptsOutput>
}

PPR Core Features:

  • Bi-directional Issuance: Every economic interaction generates exactly 2 receipts between participating agents
  • Cryptographic Integrity: All receipts are cryptographically signed for authenticity and non-repudiation
  • Private Storage: Receipts stored as Holochain private entries, preserving privacy while enabling reputation derivation
  • Multi-role Support: Agents accumulate receipts across multiple roles simultaneously (User, Transport, Repair, Storage)
  • ValueFlows Integration: Modeled as specialized Claims within the ValueFlows ontology

PPR Categories:

  1. Genesis Role: Resource creation & validation receipts
  2. Core Usage Role: Custody transfer receipts
  3. Intermediate Roles: Service fulfillment (Transport, Repair, Storage) receipts
  4. Network Governance: Dispute resolution and validation receipts
  5. Quality Assurance: Performance-based receipts

Security Features:

  • End-of-Life Protection: Multiple validators required for resource decommissioning with 7-14 day challenge period
  • Role Chaining: Agents can chain multiple actions (transport → repair → transport) within single commitment
  • Performance Metrics: Quantitative measures (timeliness, quality, reliability, communication) tracked for reputation

Capability-Based Security Architecture

  • Holochain native capability tokens for granular access control
  • Role-based permissions with validation metadata in link tags
  • Public/private data separation by design
  • Progressive access: Simple Agents → Accountable Agents → Primary Accountable Agents

Complete ValueFlows Implementation

  • EconomicResource: Concrete instances with embedded governance rules
  • EconomicEvent: All consummated actions with full audit trails
  • Commitment: Intentions to perform future economic events
  • Process Validation: Structured activities (Use, Transport, Storage, Repair) with role requirements
  • Agent Promotion: Validation-based advancement through trust levels

Development Status

  • Phase 1 Complete: Person management with role-based access control
  • 🔄 Phase 2 In Progress: Resource lifecycle and governance implementation

Testing Architecture

4-Layer Strategy:

  1. Foundation: Basic zome function calls and connectivity
  2. Integration: Cross-zome interactions and multi-agent scenarios
  3. Scenarios: Complete user journeys and workflows
  4. Performance: Load and stress testing (planned)

Strengths

  • Holochain Native: Full leverage of Holochain's agent-centric architecture
  • ValueFlows Integration: Comprehensive economic modeling
  • Privacy by Design: Public profiles with encrypted private data
  • Comprehensive Testing: Multi-layer testing strategy with good coverage
  • Production Ready: Advanced development stage with real deployment capability

Limitations

  • Complexity: Sophisticated architecture requiring significant expertise
  • Holochain Learning Curve: Platform complexity for new developers
  • Niche Focus: Specialized for resource sharing use cases
  • Documentation: Technical documentation could be more accessible

TrueCommons Project Analysis (Pilot NRP Implementation)

Overview

TrueCommons is a proof-of-concept Network Resource Planning (NRP) implementation that demonstrates how the Nondominium core engine can be applied to create organization-agnostic, capture-resistant digital commons. It serves as the first practical application of Nondominium's sophisticated PPR system and embedded governance for digital resource management.

NRP Implementation Strategy

Domain-Specific Application of Nondominium Engine:

  • Digital Commons Focus: Applies Nondominium's engine to commons-based peer production
  • NRP for Knowledge Resources: Specializes in managing digital artifacts, designs, and knowledge
  • Pilot for Engine Validation: Demonstrates real-world application of core engine capabilities
  • Template for Future NRPs: Provides blueprint for other domain-specific NRP implementations

Vision and Principles (Engine-Powered)

TrueCommons leverages Nondominium's engine to create digital resources that are:

  • 🔒 Capture-Resistant: Built on Holochain's decentralized architecture + engine governance
  • 🏛️ Organization-Agnostic: Engine provides rules without centralized control
  • 📊 Value-Tracking: Uses Nondominium's ValueFlows + PPR reputation system
  • 🔓 Permissionless: Engine's capability system enables open access under rules
  • 🌱 Shareable by Default: Engine's economic incentives promote collaboration
  • 📈 Unenclosable: Engine's reputation and governance resist capture

Engine Integration Benefits

Leveraging Nondominium's Core Capabilities:

  • PPR Reputation System: Automatically tracks contributions and builds trust in commons
  • ValueFlows Integration: Complete economic activity tracking for resource lifecycle
  • Embedded Governance: Rules engine enforces commons principles automatically
  • Multi-Role Support: Different participants (creators, validators, users) with appropriate capabilities
  • Privacy Preservation: Private receipts enable reputation while protecting sensitive data

Architecture

Multi-DNA Vision (Planned):

1. Commons Registry DNA: Global registry for discovering commons
2. Resource DNA: Core resource management with ValueFlows integration
3. Collaboration DNA: Real-time collaborative editing and messaging
4. Governance DNA: Voting and rule management

Current Implementation:

┌─────────────────────────────────────────────────────────────────┐
│                     True Commons UI (SvelteKit)                 │
│  ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────┐│
│  │   Dashboard     │ │   Resources     │ │   Economic Events   ││
│  │   - Network     │ │   - Discovery   │ │   - ValueFlows      ││
│  │   - Stats       │ │   - Metadata    │ │   - Tracking        ││
│  └─────────────────┘ └─────────────────┘ └─────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
                                  │
                ┌─────────────────┼─────────────────┐
                │                 │                 │
         ┌─────────────┐  ┌──────────────┐  ┌─────────────┐
         │   GraphQL   │  │ True Commons │  │  Holochain  │
         │   Service   │  │   Service    │  │   Client    │
         │   (hREA)    │  │ (Orchestor)  │  │  Service    │
         └─────────────┘  └──────────────┘  └─────────────┘
                │                                   │
         ┌─────────────┐                    ┌─────────────┐
         │    hREA     │                    │  Holochain  │
         │  Backend    │                    │  Conductor  │
         │ (GraphQL)   │                    │    (P2P)    │
         └─────────────┘                    └─────────────┘

Core Innovations

TrueCommonsResource Entry

A custom Holochain entry type that serves as the core artifact:

  • Content Storage: Metadata + hash links to actual content (IPFS or other entries)
  • Economic Linking: Automatically generates hREA EconomicEvents for all resource interactions
  • Embedded Governance: Links to access control rules and coordination frameworks
  • Stigmergic Coordination: Implements indirect coordination through resource modification signals

Organization-Agnostic Design

TrueCommons solves the platform capture problem through:

  • No Admin Privileges: Resources exist independently of any controlling organization
  • Permissionless Access: Open participation under defined rules
  • Capture Resistance: Multiple technical and social mechanisms prevent monopolization
  • Self-Governance: Rules embedded in resources themselves, not external platforms

Stigmergic Collaboration Architecture

Inspired by biological systems like ant colonies:

  • Indirect Coordination: Agents guided by signals and artifacts left by others
  • Resource-Centric Organization: Economic organization determined by Resources used and Processes applied
  • Permissionless Participation: Identity-blind and frictionless access like Wikipedia/Bitcoin
  • Proliferation Reduction: Incentives to collaborate on canonical resources rather than fork

Technology Stack

  • Frontend: SvelteKit, TypeScript, TailwindCSS 4.0
  • Backend: Holochain, hREA (Holochain Resource-Event-Agent)
  • Data Layer: GraphQL for hREA integration
  • Services: Microservices architecture with clean separation

Current Implementation Status

What Works (Frontend Complete)

  • Modern Dashboard: Beautiful, responsive interface
  • Network Statistics: Real-time display of agents, resources, economic events
  • Resource Discovery: Browse and search digital resources with metadata
  • Agent Profiles: View contributors and reputation
  • Economic Events: Track ValueFlows activities
  • Demo Data: Rich examples (solar irrigation, water purification, etc.)

🚧 What's In Progress

  • hREA Backend: GraphQL endpoint not yet configured
  • Holochain Conductor: Backend services not deployed
  • Real Resource Operations: Currently using mock data
  • Agent Authentication: Identity management needed

Development Phases

Phase 1 (Immediate): Backend Integration

  • Deploy hREA backend and configure Holochain conductor
  • Connect real data and implement agent authentication

Phase 2 (Short-term): Core Functionality

  • Resource creation, forking, and economic event tracking
  • Search, discovery, and reputation system

Phase 3 (Medium-term): Advanced Features

  • Real-time collaboration, governance mechanisms, value distribution

Phase 4 (Long-term): Ecosystem Growth

  • Domain-specific commons, enterprise integration, global network

Strengths

  • Clear Vision: Compelling concept of capture-resistant digital commons
  • Modern UI: Beautiful, responsive frontend with excellent UX
  • Type Safety: Full TypeScript implementation with zero linting errors
  • Service Architecture: Clean microservices design
  • Economic Integration: ValueFlows ontology for value tracking

Limitations

  • Prototype Status: Currently UI-focused with mock data
  • Backend Dependency: Relies on hREA backend integration
  • Early Stage: Limited real-world functionality
  • Complex Integration: Multiple service dependencies

Comparative Analysis

Platform Philosophy

AspectP2PModelsNondominiumTrueCommons
Core PhilosophyDAO governance optimizationAgent-centric resource sharingCapture-resistant digital commons
Approach to DecentralizationToken-based votingCapability-based securityEmbedded governance rules
Economic ModelToken governanceValueFlows trackingValueFlows + commons economics
Governance StyleRepresentative delegationEmbedded rulesCommons governance

Technical Architecture Comparison

Data Storage & Consensus Models

  • P2PModels: Ethereum blockchain (global consensus) + IPFS (content storage)
    • Immutable public ledger with gas costs
    • Centralized validation through miners
    • IPFS for decentralized content addressing
  • Nondominium: Holochain DHT (agent-centric validation)
    • Each agent validates their own source chain
    • Distributed hash table for shared data
    • No global consensus required
  • TrueCommons: Holochain + hREA (resource-event-agent modeling)
    • Agent-centric with economic activity tracking
    • Custom entry types integrated with hREA standards
    • Multi-DNA architecture planned for scalability

Smart Contract & Business Logic

  • P2PModels: Solidity smart contracts on Ethereum
    • Gas-intensive operations
    • Global state consistency
    • Legacy Solidity 0.4.x patterns
  • Nondominium: Rust zomes compiled to WASM
    • Complex validation logic in Rust
    • Private entries for sensitive data
    • Cross-zome calls for coordination
  • TrueCommons: Holochain DNA + hREA GraphQL schema
    • Service-oriented architecture
    • GraphQL abstraction layer
    • Custom TrueCommonsResource entries

Frontend Architecture & User Experience

  • P2PModels: Traditional web apps with Aragon client integration
    • Aragon client for DAO interactions
    • IPFS node requirement for content
    • Focus on governance interfaces
  • Nondominium: Svelte 5.0 with direct Holochain client
    • Real-time capability-based UI updates
    • Complex multi-agent workflows
    • Role-based interface adaptation
  • TrueCommons: SvelteKit with GraphQL/Apollo integration
    • Modern reactive UI with TypeScript
    • Service abstraction layer
    • Mock data for PoC demonstrations

Use Case Analysis

P2PModels Best For:

  • DAO operations requiring committee delegation
  • Organizations needing governance optimization
  • Projects requiring token-based voting systems
  • Use cases needing Ethereum ecosystem integration

Nondominium Best For:

  • Resource sharing networks with complex governance
  • Multi-agent economic coordination
  • Privacy-sensitive applications requiring capability security
  • Production systems needing comprehensive testing

TrueCommons Best For:

  • Digital commons and knowledge sharing
  • Open source project collaboration
  • Community resource management
  • Research into capture-resistant systems

Development Maturity

ProjectCode QualityTestingDocumentationProduction Ready
P2PModelsGood (legacy)BasicModerateResearch prototypes
NondominiumExcellentComprehensiveGoodAdvanced stage
TrueCommonsExcellentFrontend onlyGoodEarly prototype

Strategic Insights and Recommendations

Market Positioning Analysis

1. P2PModels occupies the DAO governance optimization niche

  • Strength: Deep expertise in Aragon ecosystem and committee delegation
  • Market: DAO operators seeking better governance tools
  • Limitation: Platform dependency and Ethereum scalability constraints

2. Nondominium targets production-grade resource sharing networks

  • Strength: Sophisticated PPR system and complete ValueFlows implementation
  • Market: Resource sharing networks requiring trust and reputation systems
  • Limitation: Complexity and Holochain learning curve

3. TrueCommons aims to create capture-resistant digital commons

  • Strength: Compelling vision and modern UI/UX approach
  • Market: Digital commons projects seeking platform independence
  • Limitation: Early-stage prototype with backend dependencies

Technical Innovation Assessment

Most Innovative Features:

1. Nondominium's PPR System ⭐⭐⭐⭐⭐

  • Bi-directional cryptographic receipts for every economic interaction
  • Private storage with public reputation derivation
  • Multi-role support with performance metrics tracking
  • End-of-life security with multi-validator requirements
  • Role chaining for complex service workflows

2. TrueCommons' NRP Application Architecture ⭐⭐⭐⭐

  • Domain-specific implementation of Nondominium engine for digital commons
  • Stigmergic coordination powered by engine's reputation and governance systems
  • TrueCommonsResource entry leveraging engine's embedded governance capabilities
  • Permissionless participation enabled by engine's capability-based security
  • Multi-DNA vision extending engine architecture for scalable commons networks
  • NRP Template: Demonstrates how engine can be applied to specific domains

3. P2PModels' Committee Delegation ⭐⭐⭐

  • Subgroup delegation for faster DAO decision-making
  • Token-based committee membership with voting parameters
  • Aragon native integration for ecosystem compatibility
  • Research-driven approach to governance problems

Deep Philosophical Differences

Approach to Trust & Reputation

  • P2PModels: Token-based voting and delegation patterns
  • Nondominium: Cryptographic receipt accumulation with privacy preservation
  • TrueCommons: Permissionless reputation through contribution validation

Economic Modeling Sophistication

  • P2PModels: Simple token governance with basic voting
  • Nondominium: Complete ValueFlows implementation with 15+ receipt types
  • TrueCommons: ValueFlows + commons economics + stigmergic coordination

Platform Philosophy

  • P2PModels: Ethereum/Aragon ecosystem optimization
  • Nondominium: Holochain-native agent-centric design
  • TrueCommons: Platform-agnostic capture resistance

Synergies and Integration Opportunities

Engine-Application Relationship (Nondominium ↔ TrueCommons)

Critical Strategic Partnership:

  • Nondominium EngineTrueCommons NRP: Provides core infrastructure for digital commons management
  • TrueCommons PilotNondominium Engine: Validates engine capabilities in real-world domain
  • Feedback Loop: TrueCommons usage informs engine improvements and feature development
  • NRP Template: Success creates blueprint for other domain-specific NRP implementations

Complementary Strengths Integration

  1. P2PModels → TrueCommons: Committee delegation for commons governance decisions
  2. Nondominium → TrueCommons: PPR system + engine governance for complete NRP solution
  3. TrueCommons → Nondominium: Domain validation and UI patterns for engine applications
  4. TrueCommons → P2PModels: Modern UI/UX demonstrating decentralized NRP interfaces

Technical Integration Scenarios

  1. Engine-to-Application: Nondominium engine powering TrueCommons NRP functionality
  2. Cross-platform Governance: P2PModels committees managing TrueCommons commons governance
  3. Hybrid Architectures: Ethereum governance (P2PModels) + Holochain NRP (Nondominium + TrueCommons)
  4. NRP Ecosystem: Multiple domain-specific implementations using Nondominium engine

Development Collaboration Potential

  1. Engine Validation: TrueCommons as living testbed for Nondominium engine capabilities
  2. NRP Framework: Standardized approach for building domain-specific NRP applications
  3. Shared Frontend Components: Reusable UI components for NRP interactions
  4. Research Collaboration: Apply governance research (P2PModels) to NRP systems (TrueCommons)

Development Recommendations

For P2PModels

  1. Modernize Stack: Upgrade from Solidity 0.4.x to modern versions
  2. Expand Platform: Consider Holochain integration for better scalability
  3. Enhance Testing: Implement comprehensive testing like Nondominium
  4. UI/UX Improvement: Learn from TrueCommons frontend approach

For Nondominium (Core Engine)

  1. Engine Documentation: Create accessible documentation for NRP application developers
  2. NRP SDK: Develop simplified SDK for building domain-specific NRP applications
  3. GraphQL API: Implement GraphQL layer like TrueCommons for better developer experience
  4. Engine Community: Build ecosystem of NRP application developers using the engine

For TrueCommons (Pilot NRP)

  1. Engine Integration: Complete integration with Nondominium engine capabilities
  2. NRP Validation: Demonstrate practical application of all engine features (PPR, governance, etc.)
  3. NRP Template Creation: Document patterns for other domain-specific NRP implementations
  4. Engine Feedback: Provide detailed feedback to improve Nondominium engine based on real-world usage

Strategic NRP Ecosystem Development

  1. Engine-Application Partnership: Formalize development relationship between Nondominium and TrueCommons
  2. NRP Framework: Create standardized approach for future domain-specific NRP applications
  3. Cross-Domain NRPs: Plan additional NRP implementations (supply chain, healthcare, education) using engine
  4. NRP Marketplace: Platform for discovering and deploying domain-specific NRP applications

Conclusion

Key Findings

  1. Engine-Application Paradigm: The analysis reveals a strategic relationship where Nondominium serves as a core engine for Network Resource Planning systems, with TrueCommons as the pilot implementation demonstrating real-world application of this engine.

  2. Sophisticated Innovation Hierarchy: Nondominium's PPR system represents the most advanced technical innovation (⭐⭐⭐⭐⭐), providing capabilities that could revolutionize how decentralized systems handle reputation and trust.

  3. Strategic Platform Divergence: The choice between Ethereum/Aragon (P2PModels) and Holochain (Nondominium/TrueCommons) creates fundamentally different architectural approaches with significant implications for scalability, privacy, and governance models.

  4. NRP Ecosystem Potential: The engine-application relationship suggests a broader opportunity for creating a whole ecosystem of domain-specific NRP applications built on Nondominium's foundation.

  5. Complementary Rather Than Competitive: The projects serve different roles - governance optimization (P2PModels), core infrastructure (Nondominium), and domain application (TrueCommons) - creating natural synergies rather than competition.

  6. Maturity and Relationship Spectrum: From independent governance research (P2PModels) to mature core engine (Nondominium) to pilot application (TrueCommons), representing a complete stack for decentralized resource management.

Future Outlook

The decentralized ecosystem needs diversity in approaches, and these three projects represent valuable experimentation in different architectural and governance paradigms. Their success will depend on:

  1. Real-world adoption and user feedback
  2. Technical execution and delivery of promised features
  3. Community building and ecosystem development
  4. Interoperability with other decentralized systems

Final Assessment

Each project brings unique value to the decentralized landscape, but with a newly understood strategic relationship:

  • P2PModels advances DAO governance with practical committee delegation - Independent governance research
  • Nondominium Core Engine - Provides sophisticated PPR reputation system and ValueFlows infrastructure for NRP applications
  • TrueCommons Pilot Implementation - First practical NRP application demonstrating engine capabilities for digital commons

Strategic Implications: The engine-application relationship between Nondominium and TrueCommons represents a powerful paradigm for decentralized system development. Rather than building standalone applications, this approach creates:

  1. Reusable Infrastructure: Core capabilities that can power multiple domain-specific applications
  2. Validated Architecture: Real-world testing through pilot implementations
  3. Ecosystem Foundation: Blueprint for future NRP applications across different domains
  4. Reduced Development Complexity: Domain applications can focus on specific use cases rather than core infrastructure

The diversity of approaches across all three projects contributes valuable insights to the broader decentralized ecosystem, with Nondominium and TrueCommons together demonstrating a complete engine-to-application stack that could revolutionize how we build Network Resource Planning systems for the digital economy.

Nondominium: A Solution for Frictionless Mutualization

1. Introduction

Mutualization—the sharing of resources, expertise, and services among organizations—is a powerful strategy for increasing resilience, impact, and efficiency. However, as highlighted in the Petit Guide orange du partage des ressources et de la mutualisation (RCAAQ), the path to successful mutualization is fraught with hidden costs and structural risks.

Nondominium is designed specifically to address these challenges by providing a decentralized, agent-centric infrastructure that embeds trust, transparency, and governance directly into the resource-sharing process.

2. Costs and Risks of Mutualization

Based on the RCAAQ methodology and industry experience, mutualization involves several categories of friction:

2.1 Hidden Costs

  • Concertation Overhead: Significant time and energy are often consumed in meetings, negotiations, and consensus-building. This "hidden tax" on collaboration can often offset the marginal economic gains of sharing.
  • Legal & Administrative Complexity: Establishing partnerships often requires complex contracts, changes to bylaws, or the creation of new legal entities to manage shared assets.
  • Sustained Communication: Maintaining alignment requires constant, intensive communication to ensure all partners remain on the "same wavelength."

2.2 Structural Risks

  • Loss of Sovereignty: Organizations fear losing control over their own resources, decision-making processes, or institutional identity.
  • Trust and Reliability (The "Free Rider" Problem): Collaborative efforts can fail if some participants contribute less than they consume, or if promised services (maintenance, transport) are not reliably fulfilled.
  • Informational Asymmetry: Without a shared, real-time view of resource status and history, misunderstandings and conflicts are inevitable.
  • Dependency Risks: Relying on a partner's specific expertise or equipment creates vulnerability if that partner withdraws or fails to deliver.

3. How Nondominium Reduces Mutualization Friction

Nondominium leverages Holochain and the ValueFlows standard to transform mutualization from a high-maintenance social contract into a low-friction, automated economic process.

3.1 Reducing Concertation with Machine-Readable Governance

Instead of relying solely on verbal agreements and manual oversight, Nondominium embeds governance rules directly into the Resource Specifications.

  • Automated Rules: Rules for access, usage, and transfer are enforced programmatically. This reduces the need for constant "concertation" over routine interactions.
  • Standardized Language: By using the ValueFlows ontology (Resources, Events, Commitments), Nondominium provides a common "economic grammar" that eliminates the ambiguity often found in collaborative projects.

3.2 Automated Accountability through PPRs

The Private Participation Receipt (PPR) system directly addresses the risks of trust and reliability.

  • Proof of Participation: Every interaction (creating a resource, fulfilling a commitment, performing a repair) generates a cryptographically signed receipt.
  • Privacy-Preserving Reputation: Agents build a reputation based on their actual performance (timeliness, quality, reliability) without needing to reveal sensitive private data. This replaces the need for complex, manual performance reviews with a data-driven trust layer.

3.3 Preserving Sovereignty in an Agent-Centric Framework

Nondominium is built on Holochain's agent-centric architecture, which is fundamentally different from centralized platforms.

  • Organization-Agnostic Resources: Resources in Nondominium are not "owned" by a single organization or platform. They exist in a shared DHT (Distributed Hash Table) and are governed by peer-validated rules.
  • Local Control: Each agent manages their own identity and private data. They "own" their participation history, which they can selectively share to prove their reliability to new partners.

3.4 Managing Complexity with Specialized Roles

Nondominium supports a sophisticated role-based system that allows for unequal but fair participation:

  • Flexible Roles: Participants can act as Simple Agents, Accountable Agents, or Custodians. Specialized roles like Transport, Repair, and Storage allow organizations to contribute according to their specific strengths.
  • Full Provenance: Every Economic Resource has a complete, immutable history of its lifecycle and the Economic Events that affected it. This transparency prevents disputes and simplifies the "who, what, when, and how" of resource management.

4. The P2P Dimension: Engineering vs. Emergence

Instead of the "manual engineering" of collaboration, Nondominium enables stigmergic coordination and emergence, which are more appropriate for complex, real-world situations.

4.1 From Planning to Stigmergy

  • Traditional Engineering (RCAAQ): Relies on top-down planning and pre-negotiated rigid structures. This approach assumes a closed set of organizations that must harmonize their internal rules before any action can be taken.
  • Stigmergic Coordination (Nondominium): Agents coordinate by leaving "traces" in the shared environment (ValueFlows events and commitments). When a resource is updated to "In Storage," it signals availability for "Transport" or "Use" to any qualified agent. This is edge sensing in action—decisions are made at the periphery where the needs are identified, rather than at a central committee.

4.2 Self-Organization in Complex Environments

  • Emergent Allocation: Resource acquisition and allocation aren't engineered; they emerge from the aggregate actions of autonomous agents responding to real-time signals. This allows the network to adapt to complex situations where static plans quickly become obsolete.
  • Open Value Networks (OVN): Nondominium follows OVN principles where anyone can contribute and be recognized through the PPR system. This removes the administrative bottlenecks of traditional "membership" models and allows for a truly open, self-organizing economy.

4.3 Economic Benefits of Emergence

  • Zero-Concertation Scaling: As the network grows, the coordination cost does not increase exponentially (as it does with committees and planning), but remains low due to automated signaling.
  • Agility and Resilience: The system can rapidly reorganize itself around local failures or opportunities without waiting for a central directive or a new round of "mutualization engineering."

5. Conclusion: Moving Beyond the Guide

The RCAAQ guide proposes a methodology to manage the risks of mutualization through better planning and communication. Nondominium goes a step further by encoding the solution into the infrastructure itself.

By automating trust, standardizing resource language, and enabling emergent coordination, Nondominium significantly lowers the barrier to collaboration. It offers a path away from heavy-handed planning towards a more agile, resilient, and economically efficient sharing economy.


Traduction française

Nondominium : Une solution pour une mutualisation sans friction

1. Introduction

La mutualisation — le partage de ressources, d'expertises et de services entre organisations — est une stratégie puissante pour accroître la résilience, l'impact et l'efficacité. Cependant, comme le souligne le Petit Guide orange du partage des ressources et de la mutualisation (RCAAQ), le chemin vers une mutualisation réussie est parsemé de coûts cachés et de risques structurels.

Nondominium est conçu spécifiquement pour relever ces défis en fournissant une infrastructure décentralisée et centrée sur l'agent qui intègre la confiance, la transparence et la gouvernance directement dans le processus de partage des ressources.

2. Coûts et risques de la mutualisation

Basée sur la méthodologie du RCAAQ et l'expérience du secteur, la mutualisation implique plusieurs catégories de friction :

2.1 Coûts cachés

  • Surcharge de concertation : Un temps et une énergie considérables sont souvent consommés dans les réunions, les négociations et la recherche de consensus. Cette « taxe cachée » sur la collaboration peut souvent annuler les gains économiques marginaux du partage.
  • Complexité juridique et administrative : L'établissement de partenariats nécessite souvent des contrats complexes, des modifications aux règlements généraux ou la création de nouvelles entités juridiques pour gérer les actifs partagés.
  • Communication soutenue : Maintenir l'alignement exige une communication constante et intensive pour s'assurer que tous les partenaires restent sur la « même longueur d'onde ».

2.2 Risques structurels

  • Perte de souveraineté : Les organisations craignent de perdre le contrôle de leurs propres ressources, de leurs processus de décision ou de leur identité institutionnelle.
  • Confiance et fiabilité (Le problème du « passager clandestin ») : Les efforts collaboratifs peuvent échouer si certains participants contribuent moins qu'ils ne consomment, ou si les services promis (entretien, transport) ne sont pas fournis de manière fiable.
  • Asymétrie informationnelle : Sans une vue partagée et en temps réel de l'état et de l'historique des ressources, les malentendus et les conflits sont inévitables.
  • Risques de dépendance : Compter sur l'expertise ou l'équipement spécifique d'un partenaire crée une vulnérabilité si ce partenaire se retire ou ne livre pas ses prestations.

3. Comment Nondominium réduit les frictions de la mutualisation

Nondominium s'appuie sur Holochain et le standard ValueFlows pour transformer la mutualisation, d'un contrat social lourd en maintenance vers un processus économique automatisé et fluide.

3.1 Réduire la concertation grâce à une gouvernance lisible par machine

Au lieu de s'appuyer uniquement sur des accords verbaux et une surveillance manuelle, Nondominium intègre les règles de gouvernance directement dans les Spécifications de Ressources.

  • Règles automatisées : Les règles d'accès, d'utilisation et de transfert sont appliquées par programme. Cela réduit le besoin de « concertation » constante pour les interactions de routine.
  • Langage standardisé : En utilisant l'ontologie ValueFlows (Ressources, Événements, Engagements), Nondominium fournit une « grammaire économique » commune qui élimine l'ambiguïté souvent rencontrée dans les projets collaboratifs.

3.2 Responsabilité automatisée via les PPR

Le système de Reçus de Participation Privés (PPR) répond directement aux risques de confiance et de fiabilité.

  • Preuve de participation : Chaque interaction (création d'une ressource, respect d'un engagement, réalisation d'une réparation) génère un reçu signé cryptographiquement.
  • Réputation préservant la vie privée : Les agents se forgent une réputation basée sur leur performance réelle (ponctualité, qualité, fiabilité) sans avoir besoin de révéler des données privées sensibles. Cela remplace les évaluations de performance manuelles complexes par une couche de confiance basée sur les données.

3.3 Préserver la souveraineté dans un cadre centré sur l'agent

Nondominium est construit sur l'architecture centrée sur l'agent de Holochain, ce qui est fondamentalement différent des plateformes centralisées.

  • Ressources agnostiques à l'organisation : Dans Nondominium, les ressources ne sont pas « possédées » par une seule organisation ou plateforme. Elles existent dans une DHT (Table de Hachage Distribuée) partagée et sont régies par des règles validées par les pairs.
  • Contrôle local : Chaque agent gère sa propre identité et ses données privées. Il « possède » son historique de participation, qu'il peut partager sélectivement pour prouver sa fiabilité à de nouveaux partenaires.

3.4 Gérer la complexité avec des rôles spécialisés

Nondominium prend en charge un système sophistiqué basé sur les rôles qui permet une participation inégale mais équitable :

  • Rôles flexibles : Les participants peuvent agir en tant qu'Agents Simples, Agents Responsables ou Gardiens (Custodians). Des rôles spécialisés comme le Transport, la Réparation et le Stockage permettent aux organisations de contribuer selon leurs forces spécifiques.
  • Traçabilité complète : Chaque Ressource Économique possède un historique complet et immuable de son cycle de vie et des Événements Économiques qui l'ont affectée. Cette transparence prévient les litiges et simplifie le « qui, quoi, quand et comment » de la gestion des ressources.

4. La dimension P2P : Ingénierie vs Émergence

Au lieu d'une « ingénierie manuelle » de la collaboration, Nondominium permet la coordination stigmergique et l'émergence, qui sont plus appropriées pour les situations réelles et complexes.

4.1 De la planification à la stigmergie

  • Ingénierie traditionnelle (RCAAQ) : Repose sur une planification descendante et des structures rigides pré-négociées. Cette approche suppose un ensemble fermé d'organisations qui doivent harmoniser leurs règles internes avant toute action.
  • Coordination stigmergique (Nondominium) : Les agents se coordonnent en laissant des « traces » dans l'environnement partagé (événements et engagements ValueFlows). Lorsqu'une ressource est mise à jour avec le statut « En Stockage », cela signale sa disponibilité pour un « Transport » ou une « Utilisation » à tout agent qualifié. C'est la détection aux bords (edge sensing) en action : les décisions sont prises à la périphérie, là où les besoins sont identifiés, plutôt qu'au sein d'un comité central.

4.2 Auto-organisation dans les environnements complexes

  • Allocation émergente : L'acquisition et l'allocation des ressources ne sont pas « ingénierées » ; elles émergent des actions globales d'agents autonomes répondant à des signaux en temps réel. Cela permet au réseau de s'adapter à des situations complexes où les plans statiques deviennent rapidement obsolètes.
  • Réseaux de Valeur Ouverts (OVN) : Nondominium suit les principes des OVN où n'importe qui peut contribuer et être reconnu par le système PPR. Cela élimine les goulots d'étranglement administratifs des modèles traditionnels d'« adhésion » et permet une économie véritablement ouverte et auto-organisée.

4.3 Avantages économiques de l'émergence

  • Passage à l'échelle sans concertation : À mesure que le réseau grandit, le coût de coordination n'augmente pas de manière exponentielle (comme c'est le cas avec les comités et la planification), mais reste bas grâce à la signalisation automatisée.
  • Agilité et résilience : Le système peut se réorganiser rapidement autour des défaillances locales ou des opportunités sans attendre une directive centrale ou un nouveau cycle d'« ingénierie de mutualisation ».

5. Conclusion : Aller au-delà du guide

Le guide du RCAAQ propose une méthodologie pour gérer les risques de la mutualisation par une meilleure planification et communication. Nondominium va plus loin en encodant la solution directement dans l'infrastructure.

En automatisant la confiance, en standardisant le langage des ressources et en permettant une coordination émergente, Nondominium abaisse considérablement la barrière à la collaboration. Il offre une voie alternative à la planification lourde vers une économie de partage plus agile, résiliente et économiquement efficace.

Fractal Composable Resource Architecture

Created: 2025-12-11 Status: ARCHIVAL - Conceptual Design Complete Context: Digital Resource Integrity System for nondominium Holochain Application

Architecture Overview

The Fractal Composable Resource Architecture enables unlimited nesting depth in resource compositions, supporting complex manufacturing and digital fabrication scenarios where resources are built from other resources in recursive patterns.

Core Concepts

1. Resource Classification

Atomic Resources

  • Definition: Base resources with no sub-components
  • Examples: Individual files, data chunks, basic manufacturing components
  • Characteristics:
    • No component references
    • Direct integrity verification
    • Single-level manifest structure
    • Content-addressed storage

Component Resources

  • Definition: Resources designed to be used as parts of larger assemblies
  • Examples: Standardized parts, reusable modules, manufacturing sub-components
  • Characteristics:
    • Can be referenced by parent resources
    • Independent verification status
    • Version compatibility requirements
    • Substitution rules defined

Composite Resources

  • Definition: Assemblies built from multiple component resources
  • Examples: Complex products, manufacturing assemblies, multi-file datasets
  • Characteristics:
    • References to component resources
    • Assembly rules and constraints
    • Hierarchical dependency management
    • Multi-level verification requirements

2. Component Relationship Types

Required Components

  • Definition: Essential components that must be present for assembly to function
  • Verification: Assembly fails verification if required components missing
  • Impact: Critical for assembly integrity and functionality
  • Examples: Critical structural components, essential data files

Optional Components

  • Definition: Non-essential components that enhance functionality
  • Verification: Assembly can be partially verified without optional components
  • Impact: Missing optional components result in "PARTIALLY VERIFIED" status
  • Examples: Optional features, supplementary data, enhancement modules

Alternative Components

  • Definition: Multiple options available for fulfilling a component role
  • Verification: Any valid alternative satisfies assembly requirements
  • Impact: Substitution rules define verification implications
  • Examples: Compatible parts from different manufacturers, alternative data formats

3. Hierarchical Composition Patterns

Linear Assembly Pattern

Final Assembly
├── Component A (Required)
│   └── Sub-component A1 (Required)
├── Component B (Required)
└── Component C (Optional)
    └── Sub-component C1 (Alternative to C2)
    └── Sub-component C2 (Alternative to C1)

Modular Pattern

Product Assembly
├── Core Module (Required)
│   ├── Controller Component (Required)
│   └── Power Component (Required)
├── Feature Module A (Optional)
│   └── Sensor Component (Required for Module A)
└── Feature Module B (Optional)
    └── Actuator Component (Required for Module B)

Fractal Pattern

Complex System
├── Subsystem Alpha (Required)
│   ├── Assembly Alpha-1 (Required)
│   │   ├── Component Alpha-1a (Required)
│   │   └── Component Alpha-1b (Alternative to Alpha-1c)
│   │   └── Component Alpha-1c (Alternative to Alpha-1b)
│   └── Assembly Alpha-2 (Optional)
└── Subsystem Beta (Required)
    └── Component Beta-1 (Required)

4. Version Compatibility System

Version Matrices

  • Purpose: Define which component versions can work together
  • Structure: Compatibility rules between component versions
  • Validation: Assembly verification includes version compatibility checks
  • Evolution: Support for component upgrades with compatibility preservation

Compatibility Types

  • Exact Match: Specific version required
  • Minor Version Compatible: Same major version, compatible minor versions
  • Major Version Compatible: Cross-major version compatibility defined
  • Custom Rules: Complex compatibility relationships defined by manufacturers

Version Conflict Resolution

  • Prevention: Compatibility checks prevent invalid assemblies
  • Resolution: Automatic or manual resolution of version conflicts
  • Migration: Defined upgrade paths between incompatible versions
  • Notification: Alert users to compatibility issues during assembly

5. Substitution System Architecture

Substitution Rules

  • Definition: Allowable component replacements with verification implications
  • Categories:
    • Direct Replacement: Fully compatible with no verification impact
    • Conditional Replacement: Compatible under specific conditions
    • Qualified Replacement: Requires additional verification steps
    • Incompatible Replacement: Not allowed in current assembly

Verification Impact Assessment

  • No Impact: Replacement doesn't affect assembly verification status
  • Re-verify Required: Assembly needs re-verification after replacement
  • Partial Verification: Only affected components need re-verification
  • Full Verification: Complete assembly re-verification required

Substitution Tracking

  • History: Complete record of all component substitutions
  • Audit Trail: Who authorized substitution and when
  • Impact Analysis: Which assemblies affected by substitution
  • Rollback: Ability to reverse substitutions if needed

6. Assembly Rules and Constraints

Structural Constraints

  • Quantity Requirements: Specific numbers of each component type
  • Spatial Relationships: Physical positioning requirements (for manufacturing)
  • Connection Rules: How components can be connected together
  • Order Dependencies: Required assembly sequences

Behavioral Constraints

  • Performance Requirements: Minimum performance characteristics
  • Safety Requirements: Safety-critical component requirements
  • Regulatory Compliance: Industry-specific compliance requirements
  • Quality Standards: Minimum quality criteria for components

Validation Rules

  • Pre-assembly Validation: Checks before assembly creation
  • Runtime Validation: Ongoing checks during operation
  • Post-assembly Validation: Final verification after assembly completion
  • Maintenance Validation: Periodic verification during assembly lifecycle

Verification Architecture

1. Hierarchical Verification Process

Verification Levels

  • Level 1 - Chunk Verification: Individual data chunk integrity
  • Level 2 - File Verification: Individual file integrity within components
  • Level 3 - Component Verification: Complete component resource integrity
  • Level 4 - Assembly Verification: Component relationships and assembly rules
  • Level 5 - System Verification: Complete hierarchical system integrity

Verification Strategies

  • Bottom-Up: Start with leaf components and work up to root assembly
  • Top-Down: Start with root assembly and work down to components
  • Selective: Verify only specific components or subsystems
  • Incremental: Verify only changed components and affected assemblies

Verification Results Propagation

Component Status → Assembly Impact → System-Level Consequence
─────────────────────────────────────────────────────────────
VERIFIED         → NO IMPACT        → SYSTEM REMAINS VERIFIED
CORRUPTED        → RE-VERIFY        → SYSTEM RE-VERIFICATION NEEDED
MISSING          → PARTIAL VERIFIED → SYSTEM PARTIALLY VERIFIED
INCOMPATIBLE     → ASSEMBLY FAILED  → SYSTEM VERIFICATION FAILED

2. Trust Propagation System

Trust Levels

  • FULL TRUST: Component completely verified and trusted
  • CONDITIONAL TRUST: Component trusted under specific conditions
  • PARTIAL TRUST: Component partially verified with limitations
  • NO TRUST: Component not verified or trusted

Trust Propagation Rules

  • Upward Propagation: Component trust affects parent assembly trust
  • Downward Influence: Assembly requirements affect component trust needs
  • Lateral Impact: Component changes affect sibling components
  • System-wide Effects: Critical component failures affect entire system

Trust Optimization

  • Caching: Store verification results to avoid redundant verification
  • Incremental Updates: Update only affected trust relationships
  • Selective Verification: Skip verification of fully trusted components
  • Trust Inheritance: Parent assembly trust inherits from component trust

3. Performance Optimization Strategies

Verification Parallelization

  • Component-level Parallelism: Verify multiple components simultaneously
  • Chunk-level Parallelism: Verify multiple chunks within components simultaneously
  • Assembly-level Parallelism: Verify multiple assemblies simultaneously
  • Hierarchical Parallelism: Parallel verification at multiple hierarchy levels

Selective Verification Optimization

  • Critical Path: Verify only components in critical assembly paths
  • Risk-based Verification: Prioritize high-risk components
  • User-defined Priorities: Allow users to specify verification priorities
  • Adaptive Verification: Adjust verification based on usage patterns

Caching Strategies

  • Component Verification Cache: Store component verification results
  • Chunk Hash Cache: Cache frequently accessed chunk hashes
  • Assembly Rule Cache: Cache assembly validation rule results
  • Trust Relationship Cache: Store trust propagation results

Manufacturing Integration Patterns

1. Supply Chain Transparency

Component Provenance

  • Origin Tracking: Complete history of component origin and movement
  • Manufacturer Verification: Cryptographic proof of manufacturer identity
  • Quality Certifications: Integration with external quality certification systems
  • Regulatory Compliance: Tracking of regulatory compliance status

Supply Chain Events

  • Manufacturing Events: Record of component manufacturing processes
  • Transport Events: Tracking of component movement through supply chain
  • Quality Events: Recording of quality checks and certifications
  • Modification Events: Tracking of any modifications or repairs

Transparency Interfaces

  • Supplier Portals: Interfaces for suppliers to provide provenance data
  • Verification APIs: APIs for external verification system integration
  • Compliance Reporting: Automated generation of compliance reports
  • Audit Support: Tools for regulatory and quality audits

2. Quality Assurance Integration

Quality Metrics Integration

  • Component Quality Metrics: Integration with component quality measurement systems
  • Assembly Quality Metrics: Aggregated quality metrics for assemblies
  • Process Quality Metrics: Integration with manufacturing process quality systems
  • Continuous Improvement: Quality metrics feedback for process improvement

Quality Validation

  • Specification Compliance: Verification against component specifications
  • Standards Compliance: Verification against industry standards
  • Regulatory Compliance: Verification against regulatory requirements
  • Customer Requirements: Verification against customer-specific requirements

3. Maintenance and Lifecycle Management

Maintenance Tracking

  • Maintenance History: Complete record of maintenance activities
  • Component Lifecycle: Tracking of component aging and replacement needs
  • Predictive Maintenance: Integration with predictive maintenance systems
  • Warranty Management: Tracking of warranty status and claims

Lifecycle Events

  • Installation Events: Recording of component installations
  • Replacement Events: Tracking of component replacements
  • Decommissioning Events: Recording of component end-of-life
  • Recycling Events: Tracking of component recycling and disposal

Implementation Considerations

1. Data Structure Design

Component References

ComponentReference {
  component_id: ResourceHash
  quantity: Number
  required: Boolean
  alternatives: [ResourceHash]
  version_constraints: VersionMatrix
  substitution_rules: SubstitutionRules
  verification_level: VerificationLevel
}

Assembly Definitions

AssemblyDefinition {
  assembly_id: ResourceHash
  components: [ComponentReference]
  assembly_rules: AssemblyRules
  constraints: Constraints
  verification_requirements: VerificationRequirements
  trust_requirements: TrustRequirements
}

Verification Status

VerificationStatus {
  resource_id: ResourceHash
  verification_level: VerificationLevel
  status: VerificationResult
  timestamp: Timestamp
  verified_by: AgentPubKey
  trust_level: TrustLevel
  dependencies: [ResourceHash]
  dependents: [ResourceHash]
}

2. Algorithm Complexity

Verification Algorithm Complexity

  • Time Complexity: O(n) where n is number of components in hierarchy
  • Space Complexity: O(h) where h is height of assembly hierarchy
  • Network Complexity: O(m) where m is number of chunks across all components
  • Optimization: Parallel verification reduces effective complexity

Trust Propagation Complexity

  • Propagation Time: O(d) where d is dependency depth
  • Update Complexity: O(k) where k is number of affected relationships
  • Consistency Maintenance: O(1) for incremental updates
  • Scalability: Designed for large-scale assembly hierarchies

3. Error Handling and Recovery

Error Classification

  • Component Errors: Individual component verification failures
  • Assembly Errors: Assembly rule violations
  • System Errors: System-wide verification failures
  • Network Errors: Network-related verification issues

Recovery Strategies

  • Component Recovery: Retry failed component verification from alternative sources
  • Assembly Recovery: Graceful degradation with partial assembly functionality
  • System Recovery: System-wide recovery with backup and restore mechanisms
  • Network Recovery: Adaptive network strategies for chunk retrieval

Future Evolution Paths

1. Advanced Manufacturing Integration

  • IoT Device Integration: Direct verification from manufacturing IoT devices
  • Real-time Monitoring: Continuous integrity monitoring during operation
  • Digital Twin Integration: Integration with digital twin systems
  • AI-powered Optimization: Machine learning for verification optimization

2. Cross-Platform Standardization

  • Industry Standards: Contribution to industry standards for resource integrity
  • Interoperability: Integration with other manufacturing platforms
  • Protocol Standardization: Standard protocols for cross-system verification
  • Certification Programs: Certification programs for compliance verification

3. Advanced Verification Techniques

  • Zero-Knowledge Proofs: Privacy-preserving verification techniques
  • Quantum-resistant Cryptography: Future-proof cryptographic approaches
  • Homomorphic Verification: Verification of encrypted data without decryption
  • Blockchain Integration: Cross-blockchain verification and provenance tracking

Status: CONCEPTUAL DESIGN COMPLETE - READY FOR TECHNICAL SPECIFICATION Next Phase: Implementation Planning and Holochain Zome Architecture Design Confidence Level: HIGH - Comprehensive architecture coverage achieved

Digital Fabrics: A Conceptual Framework

Executive Summary

Digital Fabrics represent a new paradigm of decentralized, coordination-focused infrastructure that enables autonomous interactions without centralized control. Unlike platforms that mediate and control user interactions, Digital Fabrics provide the underlying substrate for self-organizing, stigmergic coordination between autonomous digital entities.

Core Definition

Digital Fabric:

A decentralized, interconnected infrastructure that enables autonomous digital entities to coordinate, interact, and self-organize through embedded coordination mechanisms, without requiring centralized mediation or platform control.

Fabric Metaphor in Digital Context

Physical Fabric Properties → Digital Analogues

Physical Fabric PropertyDigital Fabric Equivalent
Interwoven ThreadsInterconnected autonomous agents/resources
Flexible & ResilientAdaptive, fault-tolerant network topology
Pattern & StructureEmergent coordination patterns and governance
Stretchable & MalleableScalable, recomposable system architecture
Tear-ResistantAnti-fragile, capture-resistant design
Breathable & PermeablePermissionless access and interoperability
Self-RepairingAutonomous healing and adaptation mechanisms

Distinguishing Characteristics

From Platforms to Fabrics

Platform Architecture

┌─────────────────────┐
│   Applications      │  ← Built ON platform
├─────────────────────┤
│   Platform Layer     │  ← Controls & mediates
│   - Rules            │  - Access control
│   - APIs             │  - Rate limiting
│   - Algorithms       │  - Content moderation
│   - Monetization     │  - Data extraction
├─────────────────────┤
│   Infrastructure     │  ← Owned by platform
└─────────────────────┘

Digital Fabric Architecture

┌─────────────────────┐
│   Autonomous         │  ← Self-governing entities
│   Digital Entities   │
├─────────────────────┤
│   Coordination       │  ← Embedded coordination
│   Fabric             │  - Stigmergic signaling
│   - Rules            │  - Resource-based triggers
│   - Patterns         │  - Self-enforcing protocols
│   - Signals          │  - Indirect communication
├─────────────────────┤
│   Peer-to-Peer       │  ← Decentralized substrate
│   Infrastructure     │
└─────────────────────┘

Core Principles of Digital Fabrics

1. Subsidiarity-Based Coordination

  • Local autonomy: Decisions made at the most local level possible
  • Emergent coordination: Global patterns emerge from local interactions
  • Embedded governance: Rules embedded within resources themselves

2. Stigmergic Communication

  • Indirect coordination: Entities modify environment, others respond
  • Signal-based: Traces and patterns guide future interactions
  • Asynchronous interaction: No need for direct messaging or synchronization

3. Anti-Fragile Architecture

  • Improves with stress: System becomes stronger through use and disruption
  • Capture-resistant: No single point of control or failure
  • Self-healing: Automatic recovery from damage or partitioning

4. Resource-Centric Design

  • First-class resources: Resources are primary actors, not data
  • Embedded rules: Governance travels with resources
  • Autonomous existence: Resources exist independently of any host

5. Permissionless Participation

  • Open access: Anyone can participate under established rules
  • Identity-agnostic: Coordination doesn't require identity verification
  • Meritocratic contribution: Value determined by contribution quality

Types of Digital Fabrics

1. Coordination Fabrics

  • Purpose: Enable stigmergic resource coordination
  • Examples: True Commons, supply chain coordination systems
  • Key Features: Resource tracking, event flows, governance embedding

2. Identity Fabrics

  • Purpose: Decentralized identity and reputation management
  • Examples: Self-sovereign identity systems, reputation networks
  • Key Features: Verifiable credentials, portable reputation

3. Compute Fabrics

  • Purpose: Distributed computational coordination
  • Examples: Decentralized AI agent systems, distributed computing
  • Key Features: Autonomous computation, resource allocation

4. Data Fabrics

  • Purpose: Decentralized data coordination and governance
  • Examples: Data commons, shared scientific datasets
  • Key Features: Data sovereignty, usage tracking, fair compensation

5. Social Fabrics

  • Purpose: Human coordination and social organization
  • Examples: Decentralized social networks, community governance
  • Key Features: Community moderation, reputation systems, collective decision-making

Architectural Patterns

Weaving Patterns

  1. Plain Weave: Simple peer-to-peer coordination
  2. Twill Weave: Complex multi-layered coordination
  3. Satin Weave: High-performance optimized coordination
  4. Jacquard Weave: Complex programmable coordination patterns

Fiber Types

  • Resource Fibers: Autonomous digital resources
  • Agent Fibers: Human and AI participants
  • Protocol Fibers: Coordination rules and standards
  • Signal Fibers: Communication and coordination channels

Fabric Structures

  • Monolithic: Single unified coordination system
  • Composite: Multiple fabric types woven together
  • Layered: Hierarchical coordination fabrics
  • Hybrid: Mixed centralized/decentralized elements

Implementation Characteristics

Technical Properties

  • Distributed Hash Tables (DHTs): Resource location and discovery
  • Cryptographic Verification: Trust without central authorities
  • Event Sourcing: Complete coordination history
  • Gossip Protocols: Information propagation
  • Crdt (Conflict-free Replicated Data Types): Convergent data structures

Economic Properties

  • ValueFlows Integration: Economic activity tracking
  • Contribution Accounting: Fair value distribution
  • Tokenless Coordination: Coordination without financial tokens
  • Resource Economics: Resource-based value systems

Governance Properties

  • Embedded Rules: Governance in resource definitions
  • Evolutionary Governance: Rules adapt through usage
  • Multi-level Governance: Local, regional, global coordination layers
  • Dispute Resolution: Automated and community-based resolution

Comparison with Existing Concepts

Digital Fabrics vs. Platforms

AspectPlatformsDigital Fabrics
ControlCentralizedDecentralized
AccessPermission-basedPermissionless
Value CaptureExtractiveDistributive
GovernanceTop-downBottom-up
Data OwnershipPlatform-ownedUser/Resource-owned
InteroperabilityWalled gardensOpen protocols

Digital Fabrics vs. Networks

AspectNetworksDigital Fabrics
PurposeConnectivityCoordination
IntelligenceLayer 3/4Layer 7 (Application)
State ManagementStatelessStateful coordination
GovernanceTechnical protocolsSocial/economic rules
Value CreationConnectivity utilityCoordination value

Digital Fabrics vs. dApps

AspectdAppsDigital Fabrics
InfrastructureBlockchain-dependentInfrastructure-agnostic
CoordinationTransaction-basedStigmergic signaling
GovernanceToken votingEmbedded rules
ScalabilityBlockchain-limitedP2P scalable
Economic ModelToken speculationReal value flows

Use Cases and Applications

True Commons as Coordination Fabric

  • Digital Resource Management: Autonomous lifecycle management
  • Collaborative Production: Stigmergic coordination of creative work
  • Supply Chain Coordination: Multi-party resource tracking
  • Knowledge Commons: Scientific and educational resource sharing

Future Fabric Applications

  • Autonomous Supply Chains: Self-organizing logistics networks
  • Decentralized Science: Research coordination without institutions
  • Community Energy: Local energy production and distribution
  • Digital Manufacturing: Distributed production coordination

Development Roadmap

Phase 1: Foundation

  • Core fabric protocols and standards
  • Basic resource coordination mechanisms
  • Initial governance frameworks

Phase 2: Weaving

  • Multi-fabric integration
  • Advanced coordination patterns
  • Cross-fabric interoperability

Phase 3: Ecosystem

  • Fabric development tools and frameworks
  • Application layers and user interfaces
  • Ecosystem governance and evolution

Conclusion

Digital Fabrics represent a fundamental shift from platform-mediated to fabric-enabled coordination. By embedding governance and coordination directly into digital resources and their interactions, fabrics enable autonomous, self-organizing systems that are more resilient, equitable, and adaptable than traditional platform architectures.

True Commons stands as a pioneering implementation of a Coordination Fabric, demonstrating how digital resources can exist, coordinate, and evolve independently of any centralized control structure. This paradigm shift from platforms to fabrics may be as significant as the shift from mainframes to networks, opening new possibilities for decentralized collaboration and value creation.


This framework provides a foundation for understanding and developing Digital Fabrics as a new category of decentralized infrastructure that enables post-platform coordination and collaboration.

Holochain File Storage and Verification Patterns

Created: 2025-12-11 Status: ARCHIVAL - Research Complete Context: Digital Resource Integrity Implementation Research for nondominium

Research Overview

This document archives the research findings on implementing robust file storage and cryptographic verification within the Holochain DHT environment, specifically for the nondominium resource sharing application with fractal composable resource architecture.

Holochain Storage Architecture Research

1. Content-Addressed Storage Patterns

Holochain DHT Characteristics

  • Content Addressing: Data stored and retrieved by cryptographic hash
  • Distributed Storage: Data distributed across network nodes automatically
  • Redundancy: Multiple copies maintained for availability
  • Validation: All entries validated before network acceptance
  • Gossip Protocol: Data propagation through peer-to-peer gossip

Implementation Strategy for File Storage

#![allow(unused)]
fn main() {
// File chunking strategy
const CHUNK_SIZE: usize = 64 * 1024; // 64KB chunks

// Chunk storage entry structure
#[hdk_entry(id = "file_chunk")]
struct FileChunk {
    chunk_hash: Vec<u8>,     // SHA-256 hash of chunk data
    chunk_data: Vec<u8>,     // Actual chunk data (max 64KB)
    chunk_index: u32,        // Index within file
    file_hash: Vec<u8>,      // Parent file hash for grouping
    created_at: u64,         // Timestamp
    agent_pub_key: AgentPubKey, // Storage agent
}
}

Chunk Management Strategy

  • Size Optimization: 64KB chunks balance DHT performance and retrieval efficiency
  • Hash-based Addressing: Each chunk addressable by its SHA-256 content hash
  • Metadata Separation: File metadata stored separately from chunk data
  • Redundancy Handling: Automatic redundancy through Holochain DHT replication

2. Manifest System Architecture

File Manifest Structure

#![allow(unused)]
fn main() {
#[hdk_entry(id = "file_manifest")]
struct FileManifest {
    file_hash: Vec<u8>,           // Root hash of entire file
    file_name: String,            // Original filename
    file_size: u64,               // Total file size in bytes
    chunk_count: u32,             // Number of chunks
    chunk_hashes: Vec<Vec<u8>>,   // Hash of each chunk in order
    merkle_root: Vec<u8>,         // Merkle tree root hash
    created_at: u64,              // Creation timestamp
    agent_pub_key: AgentPubKey,   // Original uploader
    mime_type: String,            // File MIME type
    integrity_metadata: IntegrityMetadata, // Additional integrity info
}

#[derive(Serialize, Deserialize)]
struct IntegrityMetadata {
    verification_algorithm: String,  // "SHA-256", "SHA-3", etc.
    chunk_size: u32,                 // Chunk size used
    compression: Option<String>,     // Compression algorithm if used
    encryption: Option<EncryptionInfo>, // Encryption information
}
}

Merkle Tree Implementation

#![allow(unused)]
fn main() {
// Merkle tree node structure
#[derive(Clone, Debug)]
struct MerkleNode {
    hash: Vec<u8>,
    left: Option<Box<MerkleNode>>,
    right: Option<Box<MerkleNode>>,
    is_leaf: bool,
}

// Merkle tree verification function
fn verify_merkle_proof(
    merkle_root: &[u8],
    chunk_hash: &[u8],
    proof: &[Vec<u8>],
    index: usize
) -> bool {
    let mut current_hash = chunk_hash.to_vec();
    let mut current_index = index;

    for sibling_hash in proof {
        if current_index % 2 == 0 {
            // Current node is left child
            current_hash = hash_children(&current_hash, sibling_hash);
        } else {
            // Current node is right child
            current_hash = hash_children(sibling_hash, &current_hash);
        }
        current_index /= 2;
    }

    current_hash == merkle_root
}
}

3. Fractal Resource Storage Patterns

Component Reference Structure

#![allow(unused)]
fn main() {
#[hdk_entry(id = "resource_component")]
struct ResourceComponent {
    component_id: ResourceHash,     // Hash of component resource
    parent_resource: ResourceHash,  // Hash of parent resource
    quantity: f64,                  // Quantity required
    unit: String,                   // Unit of measurement
    required: bool,                 // Whether component is required
    alternatives: Vec<ResourceHash>, // Alternative components
    version_constraints: VersionConstraints, // Version compatibility
    created_at: u64,
    agent_pub_key: AgentPubKey,
}

#[derive(Serialize, Deserialize)]
struct VersionConstraints {
    min_version: Option<String>,
    max_version: Option<String>,
    exact_version: Option<String>,
    compatible_versions: Vec<String>,
}
}

Composite Resource Manifest

#![allow(unused)]
fn main() {
#[hdk_entry(id = "composite_resource")]
struct CompositeResource {
    resource_hash: ResourceHash,           // Hash of this resource
    resource_name: String,                 // Human-readable name
    resource_type: ResourceType,           // ATOMIC, COMPONENT, COMPOSITE
    components: Vec<ResourceComponent>,    // List of components
    assembly_rules: AssemblyRules,         // Assembly constraints
    integrity_hash: Vec<u8>,              // Hash of component structure
    merkle_root: Vec<u8,                  // Merkle root of all components
    created_at: u64,
    agent_pub_key: AgentPubKey,
}

#[derive(Serialize, Deserialize)]
struct AssemblyRules {
    min_components: u32,
    max_components: u32,
    required_components: Vec<ResourceHash>,
    optional_components: Vec<ResourceHash>,
    exclusions: Vec<(ResourceHash, ResourceHash)>, // Mutually exclusive
}
}

4. Verification System Architecture

Multi-Level Verification Strategy

#![allow(unused)]
fn main() {
// Verification result enumeration
#[derive(Serialize, Deserialize, Debug)]
enum VerificationResult {
    Verified,
    PartiallyVerified,
    Failed(String),
    NotFound,
    InProgress,
}

// Verification status tracking
#[hdk_entry(id = "verification_status")]
struct VerificationStatus {
    resource_hash: ResourceHash,
    verification_level: VerificationLevel,
    result: VerificationResult,
    timestamp: u64,
    verified_by: AgentPubKey,
    component_status: HashMap<ResourceHash, VerificationResult>,
    trust_level: TrustLevel,
}

#[derive(Serialize, Deserialize)]
enum VerificationLevel {
    Chunk,      // Individual chunk verification
    File,       // Complete file verification
    Component,  // Component resource verification
    Assembly,   // Assembly verification
    System,     // Complete system verification
}
}

Hierarchical Verification Algorithm

#![allow(unused)]
fn main() {
// Recursive verification function
fn verify_resource_hierarchically(
    resource_hash: &ResourceHash,
    level: VerificationLevel,
) -> Result<VerificationResult, HolochainError> {
    match level {
        VerificationLevel::Chunk => {
            // Verify individual chunk
            verify_chunk(resource_hash)
        }
        VerificationLevel::File => {
            // Verify file by checking all chunks
            let manifest = get_file_manifest(resource_hash)?;
            let mut all_verified = true;

            for chunk_hash in &manifest.chunk_hashes {
                if verify_chunk(chunk_hash)? != VerificationResult::Verified {
                    all_verified = false;
                }
            }

            if all_verified {
                Ok(VerificationResult::Verified)
            } else {
                Ok(VerificationResult::PartiallyVerified)
            }
        }
        VerificationLevel::Component => {
            // Verify component resource
            verify_component_resource(resource_hash)
        }
        VerificationLevel::Assembly => {
            // Verify assembly by checking all components
            let composite = get_composite_resource(resource_hash)?;
            let mut component_results = HashMap::new();
            let mut all_required_verified = true;

            for component in &composite.components {
                let result = verify_resource_hierarchically(
                    &component.component_id,
                    VerificationLevel::Component
                )?;
                component_results.insert(component.component_id.clone(), result.clone());

                if component.required && result != VerificationResult::Verified {
                    all_required_verified = false;
                }
            }

            if all_required_verified {
                Ok(VerificationResult::Verified)
            } else {
                Ok(VerificationResult::PartiallyVerified)
            }
        }
        VerificationLevel::System => {
            // Verify complete system recursively
            verify_system_recursively(resource_hash)
        }
    }
}
}

5. Trust Propagation System

Trust Level Management

#![allow(unused)]
fn main() {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
enum TrustLevel {
    NoTrust,
    PartialTrust,
    ConditionalTrust,
    FullTrust,
}

// Trust propagation rules
impl TrustLevel {
    fn propagate_to_parent(&self, parent_level: &TrustLevel) -> TrustLevel {
        match (self, parent_level) {
            (TrustLevel::FullTrust, _) => parent_level.clone(),
            (TrustLevel::ConditionalTrust, TrustLevel::FullTrust) => TrustLevel::ConditionalTrust,
            (TrustLevel::PartialTrust, TrustLevel::FullTrust) => TrustLevel::PartialTrust,
            (TrustLevel::NoTrust, _) => TrustLevel::NoTrust,
            (_, _) => parent_level.clone().min(self.clone()),
        }
    }

    fn can_skip_verification(&self) -> bool {
        matches!(self, TrustLevel::FullTrust)
    }
}
}

Trust Relationship Storage

#![allow(unused)]
fn main() {
#[hdk_entry(id = "trust_relationship")]
struct TrustRelationship {
    resource_hash: ResourceHash,
    trusted_by: AgentPubKey,
    trust_level: TrustLevel,
    trust_reason: String,
    expires_at: Option<u64>,
    created_at: u64,
    verification_history: Vec<VerificationEvent>,
}

#[derive(Serialize, Deserialize)]
struct VerificationEvent {
    timestamp: u64,
    result: VerificationResult,
    verification_type: VerificationLevel,
    agent: AgentPubKey,
}
}

6. Performance Optimization Patterns

Parallel Verification Implementation

#![allow(unused)]
fn main() {
use futures::future::join_all;

// Parallel chunk verification
async fn verify_chunks_parallel(
    chunk_hashes: &[Vec<u8>],
) -> Vec<VerificationResult> {
    let verification_futures: Vec<_> = chunk_hashes
        .iter()
        .map(|chunk_hash| async move {
            verify_chunk_async(chunk_hash).await.unwrap_or(VerificationResult::Failed("Async error".to_string()))
        })
        .collect();

    join_all(verification_futures).await
}

// Parallel component verification
async fn verify_components_parallel(
    components: &[ResourceComponent],
) -> HashMap<ResourceHash, VerificationResult> {
    let verification_futures: Vec<_> = components
        .iter()
        .map(|component| {
            let component_id = component.component_id.clone();
            async move {
                let result = verify_resource_hierarchically_async(
                    &component_id,
                    VerificationLevel::Component
                ).await.unwrap_or(VerificationResult::Failed("Async error".to_string()));
                (component_id, result)
            }
        })
        .collect();

    let results = join_all(verification_futures).await;
    results.into_iter().collect()
}
}

Caching Strategy

#![allow(unused)]
fn main() {
// Verification cache entry
#[hdk_entry(id = "verification_cache")]
struct VerificationCache {
    resource_hash: ResourceHash,
    verification_result: VerificationResult,
    cache_timestamp: u64,
    expires_at: u64,
    verification_level: VerificationLevel,
    trust_level: TrustLevel,
}

// Cache management functions
impl VerificationCache {
    fn is_valid(&self, current_time: u64) -> bool {
        current_time < self.expires_at
    }

    fn can_reuse(&self, requested_level: VerificationLevel) -> bool {
        matches!((self.verification_level, requested_level),
            (VerificationLevel::System, _) |
            (VerificationLevel::Assembly, VerificationLevel::Component) |
            (VerificationLevel::File, VerificationLevel::Chunk) |
            (_, _) // Same level
        )
    }
}
}

7. Error Handling and Recovery

Error Classification and Handling

#![allow(unused)]
fn main() {
#[derive(Debug, thiserror::Error)]
enum VerificationError {
    #[error("Chunk not found: {hash:?}")]
    ChunkNotFound { hash: Vec<u8> },

    #[error("Hash mismatch for chunk {hash:?}")]
    HashMismatch { hash: Vec<u8> },

    #[error("Component missing: {component_id:?}")]
    ComponentMissing { component_id: ResourceHash },

    #[error("Assembly rule violation: {rule}")]
    AssemblyRuleViolation { rule: String },

    #[error("Network timeout during verification")]
    NetworkTimeout,

    #[error("Insufficient storage agents")]
    InsufficientStorage,
}

// Error recovery strategies
impl VerificationError {
    fn can_retry(&self) -> bool {
        match self {
            VerificationError::NetworkTimeout => true,
            VerificationError::InsufficientStorage => true,
            VerificationError::ChunkNotFound { .. } => true,
            VerificationError::HashMismatch { .. } => false,
            VerificationError::ComponentMissing { .. } => false,
            VerificationError::AssemblyRuleViolation { .. } => false,
        }
    }

    fn should_fallback(&self) -> bool {
        match self {
            VerificationError::NetworkTimeout => true,
            VerificationError::InsufficientStorage => true,
            VerificationError::ChunkNotFound { .. } => true,
            _ => false,
        }
    }
}
}

Recovery Mechanisms

#![allow(unused)]
fn main() {
// Recovery strategy implementation
async fn verify_with_recovery(
    resource_hash: &ResourceHash,
    max_retries: u32,
) -> Result<VerificationResult, VerificationError> {
    let mut retry_count = 0;

    loop {
        match verify_resource(resource_hash).await {
            Ok(result) => return Ok(result),
            Err(error) if error.can_retry() && retry_count < max_retries => {
                retry_count += 1;
                // Exponential backoff
                let delay = 2_u64.pow(retry_count) * 1000; // milliseconds
                tokio::time::sleep(Duration::from_millis(delay)).await;

                if error.should_fallback() {
                    // Try alternative verification strategies
                    if let Ok(fallback_result) = try_fallback_verification(resource_hash).await {
                        return Ok(fallback_result);
                    }
                }
            }
            Err(error) => return Err(error),
        }
    }
}
}

8. Integration with ValueFlows

ValueFlows Resource Enhancement

#![allow(unused)]
fn main() {
// Enhanced ResourceSpecification with integrity
#[derive(Serialize, Deserialize)]
struct EnhancedResourceSpecification {
    // Base ValueFlows fields
    name: String,
    note: Option<String>,
    resource_classification: ResourceClassification,

    // Integrity extensions
    integrity_metadata: Option<ResourceIntegrity>,
    component_structure: Option<ComponentStructure>,
    verification_requirements: Option<VerificationRequirements>,
}

#[derive(Serialize, Deserialize)]
struct ResourceIntegrity {
    resource_hash: ResourceHash,
    merkle_root: Vec<u8>,
    verification_algorithm: String,
    last_verified: Option<u64>,
    trust_level: TrustLevel,
}

#[derive(Serialize, Deserialize)]
struct ComponentStructure {
    is_composite: bool,
    components: Vec<ComponentReference>,
    assembly_rules: Option<AssemblyRules>,
    version_matrix: Option<VersionMatrix>,
}
}

Economic Event Integration

#![allow(unused)]
fn main() {
// Enhanced EconomicEvent with verification
#[derive(Serialize, Deserialize)]
struct VerifiedEconomicEvent {
    // Base EconomicEvent fields
    action: VfAction,
    resource_inventoried: Option<ResourceAddress>,
    resource_quantity: Option<Quantity>,
    provider: AgentAddress,
    receiver: AgentAddress,

    // Verification requirements and results
    verification_required: bool,
    verification_result: Option<VerificationResult>,
    verification_timestamp: Option<u64>,

    // Component-specific verification
    component_verifications: HashMap<ResourceHash, VerificationResult>,
}
}

9. Security Considerations

Cryptographic Security

#![allow(unused)]
fn main() {
// Cryptographic operations
use sha2::{Sha256, Digest};

fn compute_chunk_hash(chunk_data: &[u8]) -> Vec<u8> {
    let mut hasher = Sha256::new();
    hasher.update(chunk_data);
    hasher.finalize().to_vec()
}

fn compute_merkle_root(chunks: &[Vec<u8>]) -> Vec<u8> {
    let mut level = chunks.iter().map(|chunk| compute_chunk_hash(chunk)).collect::<Vec<_>>();

    while level.len() > 1 {
        let mut next_level = Vec::new();

        for pair in level.chunks(2) {
            if pair.len() == 2 {
                let combined = [&pair[0], &pair[1]].concat();
                next_level.push(compute_chunk_hash(&combined));
            } else {
                // Odd number of elements, duplicate the last one
                next_level.push(pair[0].clone());
            }
        }

        level = next_level;
    }

    level.into_iter().next().unwrap_or_default()
}
}

Access Control Integration

#![allow(unused)]
fn main() {
// Capability-based access control for verification
#[hdk_entry(id = "verification_capability")]
struct VerificationCapability {
    granted_to: AgentPubKey,
    granted_by: AgentPubKey,
    resource_hash: Option<ResourceHash>, // None for global capability
    verification_level: VerificationLevel,
    granted_at: u64,
    expires_at: Option<u64>,
    conditions: Vec<String>, // Additional conditions
}

// Access control check
fn check_verification_capability(
    agent: &AgentPubKey,
    resource_hash: &ResourceHash,
    level: VerificationLevel,
) -> Result<bool, HolochainError> {
    // Check for global capabilities first
    let global_caps = get_global_capabilities(agent)?;

    for cap in global_caps {
        if can_verify_level(&cap.verification_level, level) && !cap.is_expired() {
            return Ok(true);
        }
    }

    // Check for resource-specific capabilities
    let resource_caps = get_resource_capabilities(agent, resource_hash)?;

    for cap in resource_caps {
        if can_verify_level(&cap.verification_level, level) && !cap.is_expired() {
            return Ok(true);
        }
    }

    Ok(false)
}
}

10. Testing and Validation Strategy

Verification Testing Patterns

#![allow(unused)]
fn main() {
// Test data generation
fn generate_test_chunks(count: usize) -> Vec<Vec<u8>> {
    (0..count)
        .map(|i| format!("Test chunk data {}", i).into_bytes())
        .collect()
}

// Verification testing framework
#[cfg(test)]
mod verification_tests {
    use super::*;

    #[tokio::test]
    async fn test_chunk_verification() {
        let chunk_data = b"test chunk data".to_vec();
        let chunk_hash = compute_chunk_hash(&chunk_data);

        // Store chunk
        let chunk_entry = FileChunk {
            chunk_hash: chunk_hash.clone(),
            chunk_data: chunk_data.clone(),
            chunk_index: 0,
            file_hash: vec![1, 2, 3], // dummy hash
            created_at: 0,
            agent_pub_key: AgentPubKey::from_raw_bytes(vec![0; 32]).unwrap(),
        };

        // Verify chunk
        let result = verify_chunk(&chunk_hash).await.unwrap();
        assert_eq!(result, VerificationResult::Verified);
    }

    #[tokio::test]
    async fn test_merkle_tree_verification() {
        let chunks = generate_test_chunks(5);
        let merkle_root = compute_merkle_root(&chunks);

        // Test merkle proof for second chunk
        let chunk_hash = compute_chunk_hash(&chunks[1]);
        let proof = generate_merkle_proof(&chunks, 1);

        let is_valid = verify_merkle_proof(&merkle_root, &chunk_hash, &proof, 1);
        assert!(is_valid);
    }

    #[tokio::test]
    async fn test_hierarchical_verification() {
        // Create test composite resource
        let composite = create_test_composite_resource();

        // Verify at assembly level
        let result = verify_resource_hierarchically(
            &composite.resource_hash,
            VerificationLevel::Assembly,
        ).await.unwrap();

        assert_eq!(result, VerificationResult::Verified);
    }
}
}

Implementation Recommendations

1. Performance Priorities

  1. Chunk Size Optimization: 64KB chunks provide good balance between DHT performance and retrieval efficiency
  2. Parallel Verification: Implement parallel verification at all levels to maximize performance
  3. Caching Strategy: Comprehensive caching reduces redundant verification operations
  4. Selective Verification: Allow users to verify only necessary components for time-sensitive operations

2. Security Priorities

  1. Cryptographic Standards: Use SHA-256 for hash computations with potential migration to SHA-3
  2. Access Control: Integrate with existing capability-based access control system
  3. Audit Trails: Maintain comprehensive audit trails for all verification operations
  4. Key Management: Secure storage and management of cryptographic keys

3. Usability Priorities

  1. Clear Feedback: Provide users with clear, hierarchical verification status information
  2. Error Recovery: Graceful handling of verification failures with recovery options
  3. Progress Indicators: Real-time progress reporting for long-running verification operations
  4. Trust Management: Intuitive trust level management and propagation

4. Integration Priorities

  1. ValueFlows Compatibility: Seamless integration with existing ValueFlows resource management
  2. Governance Integration: Respect existing governance rules and access controls
  3. Standards Compliance: Follow relevant industry standards for digital integrity
  4. Extensibility: Design for future standards updates and new requirements

Future Research Directions

1. Advanced Cryptographic Techniques

  • Zero-Knowledge Proofs: Privacy-preserving verification of encrypted data
  • Homomorphic Verification: Verification of encrypted data without decryption
  • Quantum-Resistant Algorithms: Future-proof cryptographic approaches

2. Performance Optimization

  • Machine Learning: AI-powered verification optimization and anomaly detection
  • Edge Computing: Distributed verification at network edge
  • GPU Acceleration: Hardware-accelerated cryptographic operations

3. Cross-Platform Integration

  • Interoperability Standards: Cross-platform verification protocols
  • Blockchain Bridges: Integration with other blockchain systems
  • IoT Integration: Direct verification from IoT devices in manufacturing

Research Status: COMPLETE - Implementation patterns identified and documented Next Phase: Technical specification development and prototype implementation Confidence Level: HIGH - Comprehensive research coverage achieved

"Complexity Oriented Programming" doesn't exist as a formal paradigm yet, which makes it worth thinking through carefully. Here's how I'd frame it:

The core intuition

Most paradigms are reduction strategies. OOP encapsulates. FP eliminates side effects. Procedural linearizes. They all try to make complexity disappear through abstraction. Complexity Oriented Programming (COP) would invert this: instead of hiding complexity, it would model it faithfully and work with it as the primary material.

What it would draw from

Complexity science offers a clear vocabulary: emergence, feedback loops, attractors, phase transitions, edge of chaos, adaptive agents. COP would translate these into first-class programming concepts. You wouldn't fight emergence, you'd design for it. You wouldn't isolate components from their environment, you'd model the coupling.

Key principles that could define it

Rather than single sources of truth, you'd have distributed state with coherence protocols. Rather than deterministic pipelines, you'd have adaptive feedback architectures. Side effects wouldn't be contained, they'd be typed as relational events flowing through a graph. Time and context would be primary, not afterthoughts.

Where it already exists implicitly

Some things already approximate COP without naming it:

  • Holochain's agent-centric model, where global coherence emerges from local validation rules
  • Reactive/dataflow systems (signals, FRP)
  • Actor model concurrency
  • Cellular automata as computational substrate
  • ValueFlows/REA, which models economic reality as flowing events rather than static entities

The epistemological shift

In classical paradigms, the programmer is a god who designs a closed system. In COP, the programmer is more like an ecologist who designs conditions for emergence. You write rules, thresholds, feedback sensitivity, and then you observe what arises. The system is never fully knowable from the source code alone.

The honest tension

The hard challenge is tooling. Debuggers, type systems, tests, all assume reducibility. COP would need new verification paradigms, probably closer to simulation and formal methods than unit tests.

Given your work on Nondominium and the recognition architecture framework, there's a strong argument that what you're building is COP in practice: protocol-level rules that produce economic coordination as emergent behavior, without a central orchestrator. The ValueFlows ontology isn't modeling a machine, it's modeling a living economic ecosystem.