feat(dna): Group DNA per-group coordination DHT with Sweettest suite#107
Conversation
Review pass — issues found and fixed (commit
|
- Coordinator API: 13 → 15 externs (add update_group, get_my_work_logs) - Sweettest coverage: 7 → 13 test scenarios (reflects commit 1892ce5 additions) - Milestone bullet: mark Group DNA backend complete (was 'post-MVP/not started') - Milestone table row: ❌ Not started → ✅ Complete (PR #107) - Post-MVP table: remove stale 'Group DNA (#101) not yet started' note
- Fix compile error in zome_gouvernance/validation.rs: status field now uses ResourceValidationStatus::Pending (enum) instead of "pending".to_string() (pre-existing type mismatch introduced by commit 32975a5 on dev) - Rewrite lobby_zome.md to reflect current GroupAnnouncement API; removes stale NdoAnnouncement, announce_ndo, get_my_ndo_announcements references - Fix architecture_overview.md: update Lobby DNA entry types from NdoAnnouncement to GroupAnnouncement; update description - Fix group_zome.md test command comment: 12 tests x 2 conductors (not 13)
- Coordinator API: 13 → 15 externs (add update_group, get_my_work_logs) - Sweettest coverage: 7 → 13 test scenarios (reflects commit 1892ce5 additions) - Milestone bullet: mark Group DNA backend complete (was 'post-MVP/not started') - Milestone table row: ❌ Not started → ✅ Complete (PR #107) - Post-MVP table: remove stale 'Group DNA (#101) not yet started' note
b977ce2 to
5262c42
Compare
- Fix compile error in zome_gouvernance/validation.rs: status field now uses ResourceValidationStatus::Pending (enum) instead of "pending".to_string() (pre-existing type mismatch introduced by commit 32975a5 on dev) - Rewrite lobby_zome.md to reflect current GroupAnnouncement API; removes stale NdoAnnouncement, announce_ndo, get_my_ndo_announcements references - Fix architecture_overview.md: update Lobby DNA entry types from NdoAnnouncement to GroupAnnouncement; update description - Fix group_zome.md test command comment: 12 tests x 2 conductors (not 13)
Correct architecture per PR #107 (Group DNA): - Lobby discovers Groups via GroupAnnouncement (not NDOs directly) - Groups discover NDOs via SoftLink entries in each group's cloned-cell DHT - Lobby NdoBrowser aggregates only the agent's own group NDOs — no global public registry - No direct Lobby→NDO relationship Placed in ui_architecture.md (Section 1 Overview) and ui_design.md (MVP intro).
Introduces the Group DNA as the per-group coordination layer of the Lobby → Group → NDO hierarchy. Each group runs in its own cloned cell (separate DHT, same DNA template) provisioned via clone_cell. Entry types (integrity zome): - GroupProfile — name, description; identity from action header - GroupMembership — group_hash, optional role; member from action header - WorkLog — group_hash, description, hours (> 0); author from action header - SoftLink — group_hash, target_ndo_hash, description; planning-only (ADR-GROUP-04) Coordinator externs (16): - create_group, get_group, get_my_group, update_group (NotAuthor guard) - join_group (AlreadyMember guard), leave_group, get_group_members, is_member - log_work, get_work_logs, get_my_work_logs, delete_work_log (NotAuthor guard) - create_soft_link, get_soft_links, delete_soft_link (NotAuthor guard), init happ.yaml: group role added with deferred: true and clone_limit: 64 Shared crate: GroupError domain error enum added
The Lobby DHT is now the registry for group cells, not NDOs directly. NDOs are discovered through group cells (Lobby → Groups → NDOs). - NdoAnnouncement entry type and announce_ndo, get_all_ndo_announcements, get_ndo_announcement, update_ndo_announcement replaced by GroupAnnouncement and announce_group, get_all_group_announcements, get_group_announcement_by_dna_hash - get_my_groups now returns real GroupDescriptorStub from DHT instead of stub solo workspace - AnnounceGroupInput replaces AnnounceNdoInput and UpdateNdoAnnouncementInput in shared crate
Group DNA Sweettest (dnas/group/tests/): - create_group_returns_profile, get_group_by_hash - join_group_creates_membership, leave_group_removes_membership - is_member_reflects_membership_state, duplicate_join_returns_already_member_error - log_work_and_get_work_logs, get_my_work_logs_returns_own_logs - create_soft_link_and_get_soft_links, get_my_group_returns_created_group - update_group_changes_name - empty_group_name_rejected, work_log_zero_hours_rejected Thread limit: 13 tests × 2 conductors; --test-threads 6 required. Lobby Sweettest updated for GroupAnnouncement API (announce_group, get_my_group_announcements, get_group_announcement_by_dna_hash).
GroupService stub replaced with real callZome implementation. Interface takes groupCellId: CellId (DnaHash + AgentPubKey) — CellId is the correct addressing for cloned group cells (ADR-GROUP-03). - group.types.ts: GroupProfile, GroupMembership, WorkLog, SoftLink types and input types; GroupGovernanceRule removed - group.service.ts: getMembers, getWorkLogs, getSoftLinks implemented via callGroupZome helper; GroupServiceLive built as Effect-TS Layer - cell.manager.ts: getGroupCellHandle added to resolve DnaHash to group CellId - lobby.service.ts: GroupAnnouncement API wired; get_my_groups updated - lobby.types.ts: NdoAnnouncement → GroupAnnouncement; shared-types updated
- group_zome.md: full API reference for Group DNA (entry types, link types, 16 coordinator functions including delete_work_log and delete_soft_link, validation rules, error types, ADRs, test commands) - architecture_overview.md: updated to multi-DNA hApp structure with Nondominium DNA / Lobby DNA / Group DNA sections - lobby_zome.md: updated for GroupAnnouncement API - API_REFERENCE.md, IMPLEMENTATION_STATUS.md, TEST_COMMANDS.md, DOCUMENTATION_INDEX.md updated for Group DNA
5262c42 to
9e71f18
Compare
Intent
Implement the Group DNA as the per-group coordination layer of the Lobby → Group → NDO hierarchy. Each group gets its own DHT via a cloned cell from a Group DNA template. The
GroupViewandGroupSidebarUI components are currently full stubs — this DNA replaces those stubs with real data without changing any component interfaces.Unblocked by PR #103 (Lobby DNA).
Changes
Integrity zome (
zome_group_integrity)GroupProfile— group name, description, created_at, initiatorGroupMembership— agent membership record (join date, role in group)WorkLog— contribution record within the group contextSoftLink— planning-level link to a resource or NDO (dashed border in UI)Coordinator zome (
zome_group) — 16 externscreate_group,get_group,get_my_group,update_groupjoin_group,leave_group,get_group_members,is_memberlog_work,get_work_logs,get_my_work_logs,delete_work_logcreate_soft_link,get_soft_links,delete_soft_linkinitLobby DNA refactor —
NdoAnnouncementreplaced byGroupAnnouncementannounce_groupreplacesannounce_ndoget_my_group_announcements,get_group_announcement_by_dna_hashreplace the NDO announcement functionsget_my_groupsnow returns real group data instead of a stub solo workspaceShared crate
GroupErroradded tocrates/shared/src/errors.rshapp.yaml
grouprole added withdeferred: trueandclone_limit: 64— infrastructure for cloned cells (cell creation flow is deferred to a follow-up PR)Service layer
group.service.tsstub replaced with realcallZomeimplementation —GroupServiceTaginterface unchanged (ADR-GROUP-03)cell.manager.tsextended withgetGroupCellHandleto resolve aDnaHashto a groupCellIdTests
dnas/group/tests/: group creation,get_group(fetch by hash),get_my_group, membership (join/leave/is_member/duplicate-join guard), work logs (group + per-agent query + delete), soft links (create + get + delete),update_group, and validation rejection cases (empty name, zero hours)GroupAnnouncementAPIDecisions
How to test
bun run build:happ CARGO_TARGET_DIR=target/native-tests cargo test --package group_sweettest --test group -- --test-threads 6All 13 Sweettest assertions pass. Thread limit required: 13 tests × 2 conductors = 26 conductors; without
--test-threads 6the suite hits port exhaustion.Documentation
documentation/zomes/group_zome.md(new file) — Group DNA API referencedocumentation/zomes/lobby_zome.md— updated for GroupAnnouncement APIdocumentation/zomes/architecture_overview.md— updated for multi-DNA structuredocumentation/API_REFERENCE.md,IMPLEMENTATION_STATUS.md,TEST_COMMANDS.mdupdatedRelated
Related issues:
Closes feat(dna): Group DNA per-group coordination DHT with Sweettest suite #101
Depends on: feat(dna): Lobby DNA multi-network federation entry point with Sweettest suite #100 (Lobby DNA — merged via PR feat(dna): Lobby DNA multi-network federation entry point with Sweettest suite #103 ✅)
Follow-up: feat(ui): wire Lobby DNA into UI — profile bar, NdoBrowser states, DHT profile sync #106 (wire Lobby DNA into UI — Group DNA feeds
GroupViewdata)