feat(dao): scaffold aldabra-dao crate (Phase 1 reads)

Adds a 4th workspace crate `aldabra-dao` for native Agora-on-Cardano
DAO interaction. Multi-DAO from day one — DaoConfig per DAO at
\$ALDABRA_DATA/daos/<name>.json + .active selector. Sulkta DAO and any
community Agora deployment (Bob's DAO, Alice's DAO) are first-class.

Phase 0 type port complete:
- StakeDatum, StakeRedeemer, ProposalAction, ProposalLock, Credential
- ProposalDatum, ProposalRedeemer, ProposalStatus, ProposalThresholds,
  ProposalTimingConfig, ProposalVotes
- GovernorDatum, GovernorRedeemer
- All Constr indices verified against Agora source makeIsDataIndexed
  + EnumIsData declarations (Stake/Proposal/Governor/Action/Status all
  cross-referenced)
- Round-trip tests for every type

Phase 1 read surface (this commit):
- DaoStore: DaoConfig load/save/list/remove + active-DAO selector with
  first-register-becomes-active UX. 8 unit tests.
- DaoReader trait + KoiosDaoReader impl for get_governor + list_stakes.
  list_proposals stubbed pending Phase 4 proposal-script-address discovery.
- Stake address sharing handled: list_stakes filters on gov_token_policy
  (the shared MLabs stakes addr serves many DAOs).

Stubs for upcoming phases:
- agora/treasury.rs (Phase 4 — treasury spend helpers)
- agora/authority_token.rs (Phase 4 — GAT mint/burn)
- agora/reference_scripts.rs (Phase 2/3 — independent script-hash discovery
  per Sulkta's choice 2026-05-05; computed locally, never trust MLabs registry)
- builder/mod.rs (per-operation Plutus tx builders, populated phase-by-phase)

Spec doc + decisions: internal notes in workspace.

Effects map (`ProposalDatum.effects`) kept as raw PlutusData for round-trip
integrity until Phase 4 (proposal create) needs typed access.

ExUnits strategy locked: Koios tx_evaluate from day one (no hardcoded values).
Wired up in Phase 2 alongside reference-script discovery.
This commit is contained in:
Sulkta 2026-05-05 13:40:12 -07:00
parent 0a658cc4de
commit 50658ea51b
15 changed files with 2018 additions and 3 deletions

View file

@ -0,0 +1,35 @@
//! aldabra-dao — Agora-on-Cardano DAO interaction.
//!
//! Native client for any [Agora](https://github.com/Liqwid-Labs/agora)
//! deployment on Cardano. Multi-DAO from day one — Sulkta DAO, Bob's
//! DAO, and Alice's DAO are all first-class, configured per-instance
//! at `$ALDABRA_DATA/daos/<name>.json`.
//!
//! ## Surface
//!
//! - [`config`] — per-DAO config files + active-DAO selector.
//! - [`agora`] — Plutarch datum/redeemer type ports with PlutusData
//! encode/decode.
//! - [`reader`] — Koios-backed state queries (governor, stakes,
//! proposals).
//! - [`builder`] — Plutus tx assembly per operation (stake_create,
//! proposal_vote, etc).
//! - [`error::DaoError`] — crate-internal error type.
//!
//! ## What this crate is NOT
//!
//! - Not a key store. Signing is delegated to `aldabra-core`.
//! - Not an MCP server. The `dao_*` tools that wrap these primitives
//! live in `aldabra-mcp`.
//! - Not Sulkta-specific. Every Sulkta value (TRP policy, governor
//! address, etc) comes from a [`config::DaoConfig`] loaded at
//! runtime, never compile-time.
pub mod agora;
pub mod builder;
pub mod config;
pub mod error;
pub mod reader;
pub use config::{ActiveDao, DaoConfig, DaoStore};
pub use error::DaoError;