Doklo

leaf-web

Dok Hub

IA9Roles4Lexicon0Code mapping

Doks

Doks 7·Domains 7

All 7Needs review 2Active 5Stale 3
7 Doks shown

Admin

ADMIN-MODERATIONAdmin review moderation

Sign in

AUTH-SIGNINEmail and password sign-in

Sign up

AUTH-SIGNUPNew account registrationdrift

Reading circles

CIRCLESReading circle membership managementdrift

Reading journal

JOURNALBook reflection journal

Bookshelf

LIBRARYPersonal reading shelf tracker

Notifications

NOTICESClub update notificationsdrift
Read-only demo

Product preview

Dok Hub

You’re browsing a read-only sample workspace — a fictional reading-circle app, read by Doklo and reviewed by a person. Nothing here can be changed. Free to start: 40 credits on your first GitHub connection, and every repository’s first generation free (up to 30 Doks). Get started free · Back to doklo.io

CIRCLESactivestale — code movedcritical

Reading circle membership management

Members browse reading circles (book clubs), join or cancel their membership, and are automatically placed in JOINED or WAITING status based on circle capacity. Hosts and admins can close a circle, which notifies every member and promotes the next waiting member when a joined member cancels.

Document details · v1
5 steps · 4 rules · 6 criteriaweb#circles #book-club #membership #waitlist #join-cancel-close
approved 2026-10-12

Drift detectedlib/features/circles.mjs — This dok may no longer match the code beneath it.

User flow 5Business rules 4Acceptance criteria 6

User flow

5
  1. 01

    member

    View the list of reading circles with their book, schedule, and seat availability

    Result

    The circles grid shows each circle's title, description, book, start date, joined/capacity count, waiting count, and the member's own membership status if any

    Interaction details
    • all · auto
  2. 02

    member

    Join an open reading circle

    Result

    A membership is created with status JOINED if the circle has open seats, or WAITING if the circle is at capacity

    Starts when · Member is signed in · Circle is not closed · Member is not the circle's host

    Interaction details
    • desktop · click
  3. 03

    member

    Cancel an existing circle membership

    Result

    The membership is removed; if the removed membership was JOINED, the earliest-waiting member is automatically promoted to JOINED

    Starts when · Member is signed in · Member currently holds a membership in the circle

    Interaction details
    • desktop · click
  4. 04

    host

    Close a hosted reading circle after confirming the action

    Result

    The circle is marked closed, further joins are blocked, and every current member receives a closed-circle notification

    Starts when · Host is signed in · Host owns the circle · Circle is not already closed

    Interaction details
    • desktop · click
  5. 05

    admin

    Close any reading circle on behalf of the platform

    Result

    The circle is marked closed and every current member receives a closed-circle notification, regardless of who hosts it

    Starts when · Admin is signed in · Circle is not already closed

    Interaction details
    • desktop · click

Business rules

4

Policies and constraints the product must keep.

  • 01RestrictionBR-CIRCLES-01

    The host of a circle cannot join their own circle; attempting to do so is rejected with error code HOST_CANNOT_JOIN and HTTP status 409.

    Rule scope and code anchor

    Roles · ROLE-HOST

    Linked criteria 1Criterion 02
    Read linked criteria here
    • AC-CIRCLES-02When the host of a circle attempts to join that same circle, the request is rejected with error code HOST_CANNOT_JOIN and HTTP status 409.
  • 02ValidationBR-CIRCLES-02

    Joining a circle that has already been closed is rejected with error code CLUB_CLOSED and HTTP status 409.

    Rule scope and code anchor

    Roles · ROLE-MEMBER

    Linked criteria 1Criterion 03
    Read linked criteria here
    • AC-CIRCLES-03When a member attempts to join a circle that is already closed, the request is rejected with error code CLUB_CLOSED and HTTP status 409.
  • 03CalculationBR-CIRCLES-03

    When a member joins, their membership status is JOINED if the number of currently JOINED members is below the circle's capacity, otherwise WAITING. When a JOINED member cancels, the WAITING member with the lowest join sequence is promoted to JOINED.

    Rule scope and code anchor

    Roles · ROLE-MEMBER

    Linked criteria 2Criterion 01Criterion 04
    Read linked criteria here
    • AC-CIRCLES-01When a circle's joined-member count equals its capacity, a new join request results in membership status WAITING rather than JOINED.
    • AC-CIRCLES-04When a JOINED member cancels their membership and at least one WAITING member exists, the waiting member with the lowest join sequence is automatically changed to JOINED status.
  • 04PermissionBR-CIRCLES-04

    Join, cancel, and close actions require an authenticated session, otherwise error code UNAUTHENTICATED with HTTP status 401 is returned. Closing a circle additionally requires the acting user to be the circle's host or an admin, otherwise error code FORBIDDEN with HTTP status 403 is returned; referencing a non-existent circle in any action returns error code NOT_FOUND with HTTP status 404.

    Rule scope and code anchor

    Roles · ROLE-MEMBER, ROLE-HOST, ROLE-ADMIN

    Linked criteria 2Criterion 05Criterion 06
    Read linked criteria here
    • AC-CIRCLES-05When a signed-in member who is neither the circle's host nor an admin attempts to close the circle, the request is rejected with error code FORBIDDEN and HTTP status 403.
    • AC-CIRCLES-06When a join, cancel, or close request is made without a valid session, it is rejected with error code UNAUTHENTICATED and HTTP status 401.

Acceptance criteria

6

Expected outcomes. These entries do not claim a test was run or passed.

  1. 01CriterionAC-CIRCLES-01

    When a circle's joined-member count equals its capacity, a new join request results in membership status WAITING rather than JOINED.

    Linked rules 1Rule 03
  2. 02CriterionAC-CIRCLES-02

    When the host of a circle attempts to join that same circle, the request is rejected with error code HOST_CANNOT_JOIN and HTTP status 409.

    Linked rules 1Rule 01
  3. 03CriterionAC-CIRCLES-03

    When a member attempts to join a circle that is already closed, the request is rejected with error code CLUB_CLOSED and HTTP status 409.

    Linked rules 1Rule 02
  4. 04CriterionAC-CIRCLES-04

    When a JOINED member cancels their membership and at least one WAITING member exists, the waiting member with the lowest join sequence is automatically changed to JOINED status.

    Linked rules 1Rule 03
  5. 05CriterionAC-CIRCLES-05

    When a signed-in member who is neither the circle's host nor an admin attempts to close the circle, the request is rejected with error code FORBIDDEN and HTTP status 403.

    Linked rules 1Rule 04
  6. 06CriterionAC-CIRCLES-06

    When a join, cancel, or close request is made without a valid session, it is rejected with error code UNAUTHENTICATED and HTTP status 401.

    Linked rules 1Rule 04
Source files 21
  • page.tsx
  • LeafProvider.tsx
  • useLeafState.ts
  • useLeafLocale.ts
  • locale.ts
  • layout.tsx
  • headings.tsx
  • store.mjs
  • initial-state.mjs
  • password.mjs
  • action-support.ts
  • domain-error.mjs
  • session.mjs
  • validation.mjs
  • types.ts
  • FeatureFrame.tsx
  • circles.tsx
  • actions.ts
  • circles.mjschanged
  • notification-events.mjs
  • actionView.ts

Source anchors are injected deterministically. No GitHub repository is connected. File links are unavailable.

Hub context & agents

Hub trust

Doks
7
Source anchors
133
Model-generated anchors
0
Average confidence
—

Source anchors are injected deterministically. This is not a check of every statement in a Dok.

Agents query this hub

doklo.get_dok("CIRCLES")

Reading circle membership management
5 steps · 4 rules · 6 criteria
is_stale: true
anchors: 21 files

search_doks · get_dok · list_doks

Cursor and Claude Code can use Doklo’s MCP tools to read Doks and their code references.

Storage

Your Hub lives in Doklo Cloud, reviewed here and used by agents and published docs. Sync back to your own git is on the roadmap.

On this Dok

User flowBusiness rulesAcceptance criteria

Evidence

21 source files recorded for this Dok.

View source files →

Document

Version 1

web · critical

About this status

Approved 2026-10-12. Approval and source freshness are separate facts.

Source changes were detected.

Hub context & agents →