Summary
Governance domain — the most complex implementation in the 7-layer plan. Includes the Workflow Services (Layer 1 extension unique to Nondominium's governance-as-operator architecture), the governance store, composables for dispatch and validation queue, and tests.
Layer 2 store base implemented by #97: governance.store.svelte.ts converted to R&O factory pattern (E.gen + yield* GovernanceServiceTag + withLoadingState, boolean isLoading + string|null errorMessage). Remaining Layer 2 work: full store state (pendingCommitments, myEconomicEvents, validationQueue, pendingRoleRequests). Workflow services, composables, and tests are fully remaining.
Scope
Layer 1 extension — Workflow Services
Multi-step governance sequences implemented as Context.Tag + Layer.effect using E.gen:
services/workflows/custody-transfer.workflow.ts
Sequence: Commitment → GovernanceEvaluation → EconomicEvent → Claim → PPR×2
services/workflows/agent-promotion.workflow.ts
Sequence: request_role_promotion → validate identity → validate first resource → approve_role_promotion → assign role
services/workflows/resource-validation.workflow.ts
Sequence: create_resource_validation → collect ValidationReceipts → check_validation_status → emit result
services/workflows/economic-process.workflow.ts
Sequence: validate role → initiate_economic_process → complete_economic_process → issue PPRs
Layer 2 — Store
Layer 5 — Composable
composables/domain/governance/useGovernanceWorkflow.svelte.ts — single entry point for all workflow dispatch; surfaces isExecuting, lastResult, workflow-specific error messages
composables/domain/governance/useValidationQueue.svelte.ts — reactive validation queue for AccountableAgents; submits ValidationReceipts
Layer 7 — Tests
- Workflow service unit tests verifying each step sequence with mocked zome services
- Store tests for
validationQueue reactivity and role-gating
- Composable tests for workflow dispatch and error surface
Acceptance Criteria
Depends on
#92 (Person domain), #93 (Resource domain)
Part of
Epic #7
Summary
Governance domain — the most complex implementation in the 7-layer plan. Includes the Workflow Services (Layer 1 extension unique to Nondominium's governance-as-operator architecture), the governance store, composables for dispatch and validation queue, and tests.
Scope
Layer 1 extension — Workflow Services
Multi-step governance sequences implemented as
Context.Tag+Layer.effectusingE.gen:services/workflows/custody-transfer.workflow.tsSequence: Commitment → GovernanceEvaluation → EconomicEvent → Claim → PPR×2
services/workflows/agent-promotion.workflow.tsSequence: request_role_promotion → validate identity → validate first resource → approve_role_promotion → assign role
services/workflows/resource-validation.workflow.tsSequence: create_resource_validation → collect ValidationReceipts → check_validation_status → emit result
services/workflows/economic-process.workflow.tsSequence: validate role → initiate_economic_process → complete_economic_process → issue PPRs
Layer 2 — Store
✅ done by refactor(services,stores): effectify zome services and stores with R&O DI pattern #97stores/governance.store.svelte.ts— base R&O factory pattern,withLoadingStatestores/governance.store.svelte.ts— remaining:pendingCommitments,myEconomicEvents,validationQueue(AccountableAgent-gated),pendingRoleRequests(PrimaryAccountableAgent-gated)executeWorkflow(type, params)dispatch to workflow servicesLayer 5 — Composable
composables/domain/governance/useGovernanceWorkflow.svelte.ts— single entry point for all workflow dispatch; surfacesisExecuting,lastResult, workflow-specific error messagescomposables/domain/governance/useValidationQueue.svelte.ts— reactive validation queue for AccountableAgents; submits ValidationReceiptsLayer 7 — Tests
validationQueuereactivity and role-gatingAcceptance Criteria
CustodyTransferWorkflowcorrectly sequences all 5 steps;WorkflowError.rejectedsurfaces governance rejection reasons to UIvalidationQueueonly populated for agents withcoordinationorgovernancecapability levelvalidationQueuerefreshbun run check,bun run test,bun run buildpassDepends on
#92 (Person domain), #93 (Resource domain)
Part of
Epic #7