Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.45 KB

File metadata and controls

54 lines (40 loc) · 2.45 KB

AGENTS.md - guide for AI agents working in this repo

Project in one sentence

A community pre-vote layer for the Gonka network: drafts / pledges / ratings / votes live in CosmWasm contracts, comments live in a Postgres-backed NestJS indexer, frontend is Nuxt 3 + Keplr / GG Wallet.

Hard architectural rules - do not break

  1. No comments on-chain. Comments are an off-chain convenience. The chain stores drafts, pledges, ratings, votes, voting power.
  2. No IPFS. Anything verifiable lives in CosmWasm storage with hard byte caps (proposal summary <= 8 KB, otherwise external URL link).
  3. Manual cosmos.gov.v1 handoff is supported. After pre-vote completes, the proposer can submit the real chain governance proposal with inferenced tx gov submit-proposal. Do not add automatic submission without an explicit product/security decision.
  4. Backend is never authoritative. Anything the UI shows that affects consensus must be re-derivable by reading contract state. Indexer = thin projection.
  5. Voting power = locked GNK with duration multiplier. Pure Proof-of-Skin for MVP. Miner-reputation bonus deferred to Phase 2.
  6. Audits required for dao-pre-propose-gonka (it holds funds).

Conventions

  • Rust: cargo fmt + cargo clippy --all-targets -- -D warnings must be clean.
  • TypeScript: strict mode on, pnpm lint must pass.
  • Schemas: never hand-edit anything in schemas/ - regenerate via cargo run --example schema -p <crate>.
  • Indexer: never write a route that mutates chain state. The indexer reads, projects, caches, fans out notifications. That's it.
  • Frontend: every page that shows chain-derived data must surface a "Verify against chain" affordance.
  • Auth: SIWE-style nonce signed by wallet -> short-lived JWT. Never accept an unsigned mutation API call.

Dev workflow

# Activate Node (nvm)
source ~/.nvm/nvm.sh && nvm use --lts

# Workspace install
pnpm install

# Run everything for local dev
docker compose up -d postgres
pnpm --filter @gonka/indexer dev    # :4000
pnpm --filter @gonka/portal  dev    # :3000

For contracts:

cd contracts
cargo build
cargo test
cargo run --example schema -p dao-pre-propose-gonka
cargo run --example schema -p dao-voting-gonka

When in doubt

  • Default to fewer features, smaller scope. The funding budget is finite.
  • Default to simpler types in contracts - every byte costs gas.
  • Default to on-chain truth, off-chain UX - never invert.