Skip to content

Commit bce14cf

Browse files
authored
docs(ndo): add NDO Prima Materia specification and integrate across docs (#66)
* NDO prima materia requirements, Flowsta/Unyt stubs, and doc/zome updates - Expand ndo_prima_materia and requirements; add flowsta-integration stub - Refresh governance, resource, person zome docs and architecture index - Align integrity zomes (gouvernance, person) with documented model - Update CLAUDE.md, README, archives, and cross-zome governance specs Made-with: Cursor * docs(governance): update PPR_Security_Implementation to include inspiration source - Added a note referencing Mark Lizar's work on Digital Notice Consent at the OPN lab as an inspiration for the PPR system.
1 parent 3ce6c55 commit bce14cf

23 files changed

Lines changed: 545 additions & 61 deletions

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ nondominium is a **3-zome Holochain hApp** implementing ValueFlows-compliant res
8787
- **ValueFlows Compliance**: EconomicResource, EconomicEvent, Commitment data structures
8888
- **Embedded Governance**: Resources contain governance rules for access/transfer
8989

90+
### Documentation (NDO & post-MVP integrations)
91+
92+
- **Normative NDO / capability requirements:** `documentation/requirements/ndo_prima_materia.md` (REQ-NDO-*, §6.6 Unyt, §6.7 Flowsta)
93+
- **Master index:** `documentation/DOCUMENTATION_INDEX.md`
94+
- **Integration stubs:** `documentation/requirements/post-mvp/unyt-integration.md`, `documentation/requirements/post-mvp/flowsta-integration.md`
95+
- **Ontology archives:** `documentation/archives/resources.md`, `agent.md`, `governance.md`
96+
9097
## Key Development Patterns
9198

9299
### Entry Creation Pattern

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ nondominium implements a modular governance-as-operator architecture that separa
4949
- Testing: Vitest 3.1.3 + @holochain/tryorama 0.18.2
5050
- Client: @holochain/client 0.19.0
5151

52+
**Documentation map:** See [documentation/DOCUMENTATION_INDEX.md](documentation/DOCUMENTATION_INDEX.md). Post-MVP **NDO** model and optional **Unyt** / **Flowsta** integrations are specified in [documentation/requirements/ndo_prima_materia.md](documentation/requirements/ndo_prima_materia.md) and the stubs under [documentation/requirements/post-mvp/](documentation/requirements/post-mvp/).
53+
5254
## Environment Setup
5355

5456
> **PREREQUISITE**: Set up the [Holochain development environment](https://developer.holochain.org/docs/install/).

dnas/nondominium/zomes/integrity/zome_gouvernance/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ pub enum VfAction {
1414
// Standard ValueFlows production/consumption actions
1515
Use, // Use a resource without consuming it
1616

17-
// TODO: No consumable in the PoC, but we have to think about hte end of life of a resource.
17+
// TODO: No consumable in the PoC, but end-of-life / Consume flows need design alignment with
18+
// lifecycle stages — see `documentation/requirements/ndo_prima_materia.md` §5.3, REQ-GOV-11–13.
1819
Consume, // Consume/destroy a resource
1920
Produce, // Create/produce a new resource
2021
Work, // Apply work/labor to a resource

dnas/nondominium/zomes/integrity/zome_person/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ use std::{fmt::Display, str::FromStr};
2727
//
2828
// TODO (G15 — CapabilitySlot on Agent): The `Person` entry hash should serve as a stigmergic
2929
// attachment surface for external capabilities — analogous to the NondominiumIdentity
30-
// CapabilitySlot in ndo_prima_materia.md §6. Add a `PersonCapabilitySlot` link type:
30+
// CapabilitySlot surface in `documentation/requirements/ndo_prima_materia.md` §6. Add a
31+
// `PersonCapabilitySlot` link type:
3132
// PersonCapabilitySlot: Person hash → capability target (DID document, credential wallet,
3233
// reputation oracle, external registry)
3334
// Implement `attach_agent_capability_slot` and `get_agent_capability_slots` coordinator
34-
// functions. See `REQ-AGENT-11` and `ndo_prima_materia.md` §6.5.
35+
// functions. See `REQ-AGENT-11`, `ndo_prima_materia.md` §6.5 (Person attachment surface),
36+
// §6.7 + REQ-NDO-CS-12–CS-15 (Flowsta `FlowstaIdentity` / `IsSamePersonEntry`), and
37+
// `documentation/requirements/post-mvp/flowsta-integration.md`.
3538

3639
/// Represents a person's public profile with basic information
3740
#[hdk_entry_helper]

documentation/ARCHITECTURE_COMPONENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ graph TB
121121
end
122122
123123
subgraph "Private Data Sharing"
124-
DataReq["DataAccessRequest<br/>7-day Expiration"]
124+
DataReq["DataAccessRequest<br/>time-limited (max 30d)"]
125125
DataGrant["DataAccessGrant<br/>Field-specific Control"]
126126
PrivateData["PrivateDataEntry<br/>Encrypted Info"]
127127
end
@@ -157,7 +157,7 @@ graph TB
157157
│ └── Access Control Lists (resource permissions) │
158158
│ │
159159
│ 1.3 PRIVATE DATA SHARING │
160-
│ ├── DataAccessRequest Entry (7-day expiration)
160+
│ ├── DataAccessRequest Entry (time-limited; max 30-day grants)
161161
│ ├── DataAccessGrant Entry (field-specific control) │
162162
│ └── PrivateDataEntry (encrypted personal information) │
163163
│ │
@@ -582,12 +582,12 @@ fn authorize_process_data_access(
582582
.find(|r| r.matches_process_requirements(&process))
583583
.ok_or(DataAccessError::InsufficientRole)?;
584584

585-
// Create time-limited grant (7-day expiration)
585+
// Illustrative pseudocode — align grant duration with zome_person capability rules (30-day max).
586586
let grant = DataAccessGrant {
587587
requesting_agent,
588588
granting_agent: process.resource_owner,
589589
accessible_fields: required_fields,
590-
expires_at: sys_time()? + Duration::from_secs(7 * 24 * 60 * 60), // 7 days
590+
expires_at: sys_time()? + Duration::from_secs(7 * 24 * 60 * 60), // example: 7 days; cap 30 days in MVP metadata
591591
purpose: format!("Data access for {} process", process.process_type),
592592
process_context: process.hash,
593593
};
@@ -694,7 +694,7 @@ Reputation Derivation:
694694
```
695695
Data Access Control:
696696
├── Field-Level Granularity (specific data elements)
697-
├── Time-Limited Grants (7-day maximum)
697+
├── Time-Limited Grants (30-day maximum per capability metadata)
698698
├── Purpose Binding (process-specific usage)
699699
├── Automatic Expiration (system-enforced)
700700
├── Audit Trail (access logging)

documentation/DOCUMENTATION_INDEX.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ nondominium implements a **Governance-as-Operator** architecture that separates
9595
- **🔐 Capability-Based Security**: Progressive trust model (Simple → Accountable → Primary Accountable Agent)
9696
- **📋 Private Participation Receipts (PPRs)**: Cryptographic reputation tracking across 16 categories
9797
- **🔄 Economic Processes**: Structured workflows (Use, Transport, Storage, Repair) with role-based access
98-
- **🛡️ Private Data Sharing**: Request/grant workflows with field-level control and 7-day expiration
98+
- **🛡️ Private Data Sharing**: Request/grant workflows with field-level control and time-limited grants (30-day maximum per `PrivateDataCapabilityMetadata`; shorter defaults may apply in UI flows — see [person_zome.md](documentation/zomes/person_zome.md))
9999

100100
---
101101

@@ -152,7 +152,7 @@ nondominium implements a **Governance-as-Operator** architecture that separates
152152
**Private Data Sharing**
153153

154154
- `request_private_data_access()` - Request access to specific fields
155-
- `grant_private_data_access()` - Grant time-limited access (7-day expiration)
155+
- `grant_private_data_access()` - Grant time-limited access (subject to 30-day maximum enforced in capability metadata)
156156
- `get_private_data()` - Retrieve authorized private data
157157
- `revoke_private_data_access()` - Revoke granted permissions
158158

@@ -276,7 +276,7 @@ bun run test:debug # Verbose test output for debugging
276276

277277
### ✅ Phase 2 Complete: Advanced Governance & Reputation
278278

279-
- **Capability-Based Sharing**: Complete request/grant workflows with 7-day expiration
279+
- **Capability-Based Sharing**: Complete request/grant workflows with time-limited grants (30-day cap; see person zome docs)
280280
- **PPR System**: 16-category reputation tracking with cryptographic signatures
281281
- **Economic Processes**: Four structured processes (Use, Transport, Storage, Repair)
282282
- **Multi-Reviewer Validation**: 2-of-3, N-of-M, and simple majority validation

documentation/archives/IMPLEMENTATION_STATUS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,22 @@ bun run package # Final .webhapp distribution
425425

426426
---
427427

428+
## Post-MVP design specifications (not in shipped DNA yet)
429+
430+
The following are **documented and traceable** to REQ-NDO-* in `documentation/requirements/ndo_prima_materia.md` but **not implemented** in the current MVP codebase unless noted otherwise:
431+
432+
| Track | Design sources | Implementation status |
433+
| ----- | -------------- | ---------------------- |
434+
| **NDO three-layer model** | `ndo_prima_materia.md` §§4, 8, 10; `resources.md` §3 | Not started — MVP uses flat `ResourceSpecification` + `EconomicResource` |
435+
| **Lifecycle vs operational state split** | `ndo_prima_materia.md` §5, §9.4 (`REQ-NDO-OS-01``06`) | Not started — `ResourceState` still conflated (see zome_resource TODOs) |
436+
| **Unyt (EconomicAgreement, RAVE)** | `ndo_prima_materia.md` §6.6, §11.5; `unyt-integration.md`; REQ-NDO-CS-07–CS-11 | Not started — no Unyt cell / RAVE validation in governance zome |
437+
| **Flowsta (agent linking, IdentityVerification)** | `ndo_prima_materia.md` §6.7, §11.6; `flowsta-integration.md`; REQ-NDO-CS-12–CS-15 | Not started — `flowsta-agent-linking` zomes not bundled; `GovernanceRule` remains untyped strings |
438+
| **Person capability slot (G15)** | `agent.md` §3.2; `person_zome.md`; REQ-AGENT-11, REQ-NDO-AGENT-07 | Not started — no `FlowstaIdentity` links on `Person` hash |
439+
440+
See `documentation/archives/implementation_plan.md` §10 for a phased checklist aligned with prima materia.
441+
442+
---
443+
428444
## Conclusion
429445

430446
The nondominium hApp represents a **complete, production-ready implementation** of a sophisticated ValueFlows-compliant resource sharing ecosystem with advanced privacy controls and revolutionary reputation mechanics. All major components are fully implemented, thoroughly tested, and ready for deployment.

0 commit comments

Comments
 (0)