hREA Integration Specification
Overview
This document details the integration of hREA (Holochain Resource-Event-Agent) within the Requests & Offers application. hREA provides the foundation for managing economic flows, resource tracking, and agent relationships in our Holochain-based system.
Economic Flow Model
The application implements the following hREA economic flow with integrated feedback mechanisms:
Agent -> Proposal (Requests/Offers) -> Intent -> Agreement -> Commitment -> Economic Event -> Resource
↓
Feedback Process ← Agent
Note:
Resourcein the flow above refers toEconomicResource— a concrete instance produced or transferred as the result of an Economic Event. This is distinct fromResourceSpecification, which describes the type of resource. Service Types and Mediums of Exchange areResourceSpecifications referenced by Intents — they are never EconomicResources.
Each step serves a specific purpose in the collaborative ecosystem:
Agent: Participants in the ecosystem (individuals or organizations)Proposal: Encompasses both Requests (Intents for receiving) and Offers (Intents for providing)Intent: The underlying purpose or goal of the proposal (service or medium of exchange)Agreement: Mutual acceptance and alignment between partiesCommitment: Confirmed obligation to fulfill the agreed termsEconomic Event: Actual record of fulfillment or action taken (conditional on positive feedback)Resource: The tangible or intangible outcome affected by the eventFeedback Process: Critical validation mechanism that conditionally enables fulfillment
For MVP simplicity, we merge Requests/Offers with Proposals and Intents in the user experience while maintaining the underlying hREA structural complexity.
Feedback-Driven Economic Flow
Feedback Process Rules
Based on the exchange process clarifications and hREA mapping diagram, the feedback mechanism operates as follows:
-
Feedback Initiation Rights:
- The agent that initiates a request has the right to provide feedback
- The agent that accepts an offer has the right to provide feedback
- The agent performing work (on request) or providing service (from offer) can request feedback
-
Feedback-Conditional Fulfillment:
- Economic events fulfill commitments conditionally based on positive feedback
- Fulfillment implementation can be delayed to optimize the feedback process
- This creates a quality assurance layer in the economic flow
-
Feedback Process States:
Pending Feedback: Work completed, awaiting feedbackFeedback Requested: Worker/provider has requested feedback from recipientPositive Feedback: Enables commitment fulfillment and economic event creationNegative Feedback: Triggers resolution process before fulfillment
hREA Mapping Implementation
Based on the provided hREA mapping diagram, the flow operates as:
Alice (Agent) --make--> Proposal (Request/Offer) --represent--> Resource Specifications
↓ bundle
Bob (Agent) --make--> Agreement --bundle--> Commitments --fulfills--> Economic Event
↑ ↓
Feedback ←--ask for--← Bob Commitment Completion
↓
if feedback is positive → fulfills commitments
This ensures that:
- Alice creates requests that represent resource specifications (Service Types)
- Bob can make offers and later request feedback from Alice
- Agreements bundle commitments from both parties
- Economic Events are created only when feedback is positive
- Feedback validation acts as a quality gate for commitment fulfillment
Economic Flow Visualization
graph TD
%% Agents and Initial Actions
A[Agent Alice] -- make --> R[Request Proposal]
B[Agent Bob] -- make --> O[Offer Proposal]
%% Resource Specifications
R -- represent --> RS[Resource Specification<br/>Service Types]
O -- represent --> RS
%% Agreement Formation
R -- bundle --> AG[Agreement]
O -- bundle --> AG
AG -- bundle --> C1[Commitment from Bob]
AG -- bundle --> C2[Commitment to Alice]
%% Work Completion and Feedback Request
C1 -- Work Performed --> WC[Work Completion]
B -- ask for --> FP[Feedback Process]
%% Feedback Validation
A -- provides --> FB[Feedback]
FB -- if positive --> EE[Economic Event]
FB -- if negative --> RP[Resolution Process]
%% Fulfillment
EE -- fulfills --> C1
EE -- fulfills --> C2
EE -- affects --> RES[Resource]
%% Alternative Resolution
RP -- may lead to --> EE
class A,B agent
class R,O proposal
class AG,C1,C2 agreement
class FP,FB feedback
class EE event
Core Components Integration
1. Agent Ecosystem
Agent Types
- Individual Agents: Users with specific skills and capabilities
- Organizational Agents: Collectives with collective resources and needs
- Project Agents: Specialized organizations with specific goals
Agent Feedback Responsibilities
- Request Initiators: Provide feedback on received services
- Offer Acceptors: Provide feedback on delivered outcomes
- Service Providers: Can request feedback to enable fulfillment
- Quality Assurance: Participate in resolution processes for negative feedback
2. Enhanced Proposal System
Dual Nature of Proposals
Proposals in our system serve a dual purpose:
- Requests: Map to hREA proposals bundling intents expressing the need to receive resources or services
- Offers: Map to hREA proposals bundling intents expressing the willingness to provide resources or services
Resource Specification Integration
Both Requests and Offers reference hREA ResourceSpecifications:
- Service Types: Standardized categories of services and skills (our Service Types system)
- Medium of Exchange: Methods of value transfer (time, money, barter, etc.)
- Quality Metrics: Standards for evaluating service delivery
Important: Service Types and Mediums of Exchange are hREA ResourceSpecifications only — they define categories and types, not concrete resource instances.
EconomicResourceentries are not created for Service Types or Mediums of Exchange; those arise only from Economic Events in a completed exchange.
3. Agreement and Commitment Workflow
Agreement Formation
- Mutual acceptance between requesting and offering agents
- Bundling of complementary commitments
- Definition of feedback criteria and success metrics
- Establishment of quality assurance framework
Commitment Management with Feedback Integration
- Commitment Creation: Formalized obligations with feedback requirements
- Progress Tracking: Monitor commitment fulfillment stages
- Feedback Triggers: Automatic prompts for feedback at completion milestones
- Conditional Fulfillment: Economic events created only after positive feedback
4. Feedback-Enhanced Economic Events
Economic Event Creation Process
- Work Completion: Service provider completes committed work
- Feedback Request: Provider can request feedback from recipient
- Feedback Evaluation: Recipient provides positive/negative feedback
- Conditional Event: Economic event created only with positive feedback
- Resource Impact: Resources affected based on successful completion
Quality Assurance Integration
- Feedback Validation: Ensure feedback quality and authenticity
- Dispute Resolution: Handle negative feedback through mediation processes
- Reputation Tracking: Build agent reputation based on feedback history
- Continuous Improvement: Use feedback data for system optimization
5. Resource and Value Flow Management
Resource Specifications as Service Types
- Map traditional "skills" to hREA ResourceSpecifications
- Enable standardized service categorization
- Support skill matching and discovery
- Facilitate quality benchmarking
Value Exchange Mechanisms
- Direct Service Exchange: Skills for skills
- Mediated Exchange: Services for tokens/credits
- Hybrid Models: Combination of direct and mediated exchange
- Reputation-Based: Quality feedback influences exchange rates
Technical Implementation Strategies
Feedback System Architecture
Feedback Data Structures
interface FeedbackProcess {
id: string;
commitmentId: string;
requesterId: AgentId; // Who can request feedback
providerId: AgentId; // Who provides feedback
status: "pending" | "requested" | "completed";
feedback?: FeedbackEntry;
}
interface FeedbackEntry {
rating: "positive" | "negative";
comments: string;
timestamp: Date;
providedBy: AgentId;
}
Conditional Economic Events
- Economic events include feedback validation
- Delayed fulfillment patterns for quality assurance
- Automated triggers based on feedback outcomes
- Integration with existing hREA event structures
Matching and Discovery
Enhanced Matching Algorithms
- Quality-Weighted Matching: Consider agent feedback history
- Service Type Alignment: Match based on ResourceSpecification compatibility
- Feedback-Informed Recommendations: Prioritize high-rated providers
- Risk Assessment: Factor feedback patterns into matching decisions
Search and Filtering
- Feedback-Enhanced Search: Include quality metrics in search results
- Reputation Filtering: Filter by agent feedback scores
- Service Quality Indicators: Display historical performance data
- Trust Network Navigation: Leverage feedback networks for discovery
Performance and Scalability
Feedback Data Optimization
- Efficient Feedback Storage: Optimized data structures for feedback queries
- Aggregated Reputation Scores: Pre-computed quality metrics
- Feedback Indexing: Fast retrieval of feedback history
- Privacy-Preserving Analytics: Aggregate insights while protecting individual privacy
Privacy Architecture
Exchange-related hREA entities are accessible only to the agents named as participants in those entities. This is a core architectural constraint, not a UI-layer concern.
Scope of Private Exchange Data
The following entities are private to exchange participants only:
Agreement— accessible only to the two agents named in the agreementCommitment— accessible only to the commitment partiesEconomicEvent— accessible only to the agents who created and received itFulfillmentlinks — traversable only by exchange participants- Conversations and counter-proposals (see
conversationszome inrequests_and_offersDNA)
Agent-Centric Enforcement
Holochain's agent-centric model provides the underlying enforcement:
- Entries are stored in participants' source chains, not in a shared public DHT
get_*zome calls are validated against the calling agent's identity- Capability tokens on exchange zome functions restrict access to named participants
- No admin-level capability token grants access to exchange, commitment, or economic event data
Administrator Exclusion
Administrator agents are explicitly excluded from exchange data access:
- The
adminzome inrequests_and_offersDNA handles platform-level operations only: user approval/suspension, service type and organization management - Admin capability tokens do NOT grant access to
Agreement,Commitment,EconomicEvent, orFulfillmentqueries - This separation is intentional — peer-to-peer exchange contracts are private to their parties
For the full privacy model including conversation privacy and the ConversationToAgreement link architecture, see Exchange Process — Privacy Model.
Future Evolution
Planned Enhancements
- Machine Learning Integration: AI-powered feedback analysis and quality prediction
- Advanced Reputation Systems: Multi-dimensional trust scoring
- Automated Quality Assurance: Smart contracts for feedback validation
- Cross-Platform Feedback: Integration with external reputation systems
Integration Roadmap
- Enhanced Feedback Analytics: Detailed insights into service quality trends
- Predictive Quality Scoring: AI-driven quality predictions
- Automated Dispute Resolution: Smart mediation for negative feedback
- Ecosystem Health Monitoring: System-wide quality and satisfaction metrics
MVP Implementation Priorities
For the initial release, focus on:
- Basic Feedback Workflows: Simple positive/negative feedback with comments
- Conditional Fulfillment: Economic events triggered by positive feedback
- Quality Indicators: Basic reputation scoring and display
- Feedback Request System: Allow service providers to request feedback
- Dispute Handling: Manual process for negative feedback resolution
This feedback-driven approach ensures quality while maintaining the decentralized nature of the hREA economic model, creating a self-regulating ecosystem where quality service delivery is incentivized and validated through peer feedback.
