Skip to main content

Module projects

Module projects 

Source
Expand description

Single source of truth for record envelopes, double-entry finance, and cooperative projects. Cooperative projects (audit COP-01..19) — Restricted records for shared work, membership, contributions, and the obligations derived from them.

Money/effort safety mirrors finance.rs: contributions merge add-wins by stable entry id and never by raw sum, and obligations are a pure derivation over the unique-id set keyed by (project_id, contributor_did). This makes duplicate, reordered, or replayed sync frames safe — you can never double-count effort.

Contribution records form an author chain via predecessor_id, so a project’s effort history is a verifiable append-only sequence per contributor.

Structs§

Contribution
A single immutable unit of contributed effort. Never mutated; a correction is a new entry linked via predecessor_id, so id is a stable content anchor for dedup and the entries form an append-only author chain.
Obligation
Project
A cooperative project — a named unit of shared work.
ProjectMembership
Membership of a DID in a project, with an agreed role.

Enums§

ContributionPrivacy
ProjectRole
Role a member holds within a cooperative project.

Functions§

build_contribution_envelope
Builds contribution-envelope.
build_membership_envelope
Builds membership-envelope.
build_project_envelope
Builds project-envelope.
contribution_record_id
contribution-record ID.
contribution_summary
Lossless contribution summary including capital_cents, roi_multiplier, privacy_level, occurred_at_instant, and predecessor_id.
derive_obligations
Derive per-(project, contributor) effort obligations purely from the unique-id set.
membership_summary
Membership summary.
merge_contributions
Merge two contribution sets add-wins by stable id (never sum-merge), returning a deterministically ordered union. Idempotent and order-independent.
parse_contribution_summary
Reconstruct a Contribution losslessly from a stored/transmitted summary JSON.
project_membership_record_id
project-membership-record ID.
project_record_id
project-record ID.
project_summary
Project summary.