Skip to content

feat: read-only lock mode (shared locks) #16

@pszymkowiak

Description

@pszymkowiak

Problem

Current locks are exclusive (write-only). If agent-1 claims validateToken, agent-2 can't even read it to understand the codebase. In practice, multiple agents may need to read a function for context while only one writes.

Proposal

Add read/write lock modes:

grit claim -a agent-1 -i "refactor" --mode write "src/auth.ts::login"
grit claim -a agent-2 -i "reading for context" --mode read "src/auth.ts::login"
  • Multiple readers allowed simultaneously
  • Writer blocks all other writers AND readers
  • Reader doesn't block other readers
  • Standard read-write lock semantics

Schema change

locks.mode column already exists (default 'write') but is unused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions