Skip to content
C.W.K.
Stream
Lesson 01 of 05 · published

A Claim Binds a Session

~12 min · claim, session, concurrency, ownership

Level 0Cold Vessel
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

A Claim Binds a Session

A queued delegation is available work, not shared authoring space. Take creates a claim that binds the work order to one live session identity. From that point, stage logs, review requests, and landing attempts must carry the same identity or be rejected.

The binding prevents two kinds of confusion. Concurrent authors cannot both believe they own the same task, and a later session cannot casually continue under an earlier session's authority. Handoff is possible, but it needs an explicit record rather than reuse of a copied environment value.

Session identity is operational provenance, not human identity. It names the concrete execution context strongly enough to correlate actions. The record may also name a brain family for attribution, but the claim token is what enforces exclusivity.

Claims need liveness policy. A crashed session can otherwise hold work forever. Recovery may require an explicit abandon, expiry, or administrative release, each recorded with a reason. Silent claim stealing makes the trail convenient and untrustworthy.

One Owner, Visible Recovery

Attempt two takes against one queued item under a single writer transaction. Exactly one returns a claim; the other receives the current owner and status. Then simulate recovery through the supported transition, never by editing the row underneath the engine.

Every subsequent mutation should include the session identity. The engine compares it to the claim before writing, so possessing a task key alone never grants authority.

Exclusive ownership needs visible recovery. The claim token makes one session accountable for every mutation, while abandon or release records explain how control moved after failure. Convenience must never turn a crashed owner into permission for silent claim theft.

Code

Bind mutations to the claimed session·python
delegation = {"status": "queued", "claimed_by": None}

def take(session: str) -> None:
    if delegation["status"] != "queued":
        raise RuntimeError(f"already claimed by {delegation['claimed_by']}")
    delegation.update(status="taken", claimed_by=session)

def stage(session: str) -> None:
    if session != delegation["claimed_by"]:
        raise PermissionError("session does not own claim")

take("session-a")
stage("session-a")
try:
    stage("session-b")
except PermissionError as exc:
    print(exc)

External links

Exercise

Design claim, handoff, and crash-recovery transitions for a workshop. Name who may trigger each and what receipt remains.
Hint
Avoid a generic force-unlock with no reason.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.