Skip to content

docs: add group_treasury API reference, presence/heartbeat, E2EE key lifecycle, and database schema docs - #615

Merged
codebestia merged 4 commits into
codebestia:devfrom
Dannyorji:clicked-tasks
Oct 2, 2026
Merged

codebestia merged 4 commits into
codebestia:devfrom
Dannyorji:clicked-tasks

Conversation

@Dannyorji

Copy link
Copy Markdown
Contributor

Summary

Adds four verified reference documents covering previously undocumented
surfaces of the contracts and backend codebases:

  • contracts/docs/api-group-treasury.md — full function-by-function API
    reference for the group_treasury Soroban contract (initialize,
    membership, deposit/withdraw, and the propose/approve/reject multisig
    voting flow), including a worked end-to-end multisig example and an
    explicit callout of the known off-by-one in list_proposals/
    get_pending_proposals.

  • apps/backend/docs/concepts-presence-heartbeat.md — the Redis presence
    key structure, the 30s/90s heartbeat timing contract, multi-device
    aggregation, and the debounced offline-broadcast behavior in
    services/presence.ts and services/heartbeat.ts, including a verified
    caveat that the per-user presence hash has no TTL of its own.

  • apps/backend/docs/concepts-e2ee-key-management.md — the backend's role
    in the E2EE key lifecycle end-to-end: the two distinct device-registration
    paths (auth/verify vs. devices/link), prekey upload/consumption,
    key-bundle fetch, revocation, and GC, with an explicit "what the server
    can and cannot see" statement and a verified finding that
    device_key_history is read but never written anywhere in the codebase.

  • apps/backend/docs/contracts-database-schema.md — every table, column,
    index, check constraint, and FK relation in db/schema.ts, with a mermaid
    ER diagram and a dedicated section distinguishing Drizzle's relations()
    query helpers from actual DB constraints, plus several verified schema
    gaps (unindexed conversation_members, unused content_type enum,
    non-unique files.sha256, FK-less audit_logs actor/subject columns).

All four docs are cross-linked to each other and to the existing docs they
build on, and are indexed in docs/README.md per the repo's documentation
maintenance convention.

Closes #441
Closes #445
Closes #447
Closes #465

Dannyorji and others added 4 commits October 2, 2026 00:47
Document every public function in group_treasury/src/lib.rs with full
signatures, auth requirements, and panic conditions, plus a worked
propose_withdraw -> approve_withdraw x N multisig example end-to-end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Document the Redis presence key structure, the 30s/90s heartbeat timing
contract, multi-device aggregation, and the debounced offline-broadcast
behavior in services/presence.ts and services/heartbeat.ts, including
verified caveats around the presence hash's lack of its own TTL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Document the backend's role in device identity, prekey upload/consumption,
key-bundle fetch, and revocation as one coherent lifecycle, including the
two distinct device-registration paths (auth/verify vs. devices/link) and
the verified gap that deviceKeyHistory is never written despite having a
read route. States explicitly what the server can and cannot see.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Document every table, column, index, check constraint, and FK relation in
db/schema.ts, with a mermaid ER diagram and a dedicated section on where
Drizzle's relations() blocks diverge from actual DB constraints, plus
verified schema gaps (unindexed conversation_members, unused content_type
enum, non-unique files.sha256, FK-less audit_logs actor/subject columns).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Dannyorji Dannyorji changed the title Clicked tasks docs: add group_treasury API reference, presence/heartbeat, E2EE key lifecycle, and database schema docs Oct 2, 2026
@codebestia
codebestia merged commit 88d2a1c into codebestia:dev Oct 2, 2026
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants