free-agent
Safe HaskellNone
LanguageGHC2024

Free.Agent.Bus.Claim

Description

Mechanical claim gate for a free-agent bus root.

.claim-N files are the authority; the bus post is only the record. Uses check-then-create — the race window is microseconds vs 30s LLM latency.

Synopsis

Claim operations

claimTask :: FilePath -> Int -> Text -> IO Bool Source #

Claim task n for name. Returns True on success, False if already claimed (file exists when we check).

checkTask :: FilePath -> Int -> IO (Maybe Text) Source #

Who holds task n? Returns Nothing if unclaimed.

releaseTask :: FilePath -> Int -> IO () Source #

Release (delete) the claim on task n.

listClaims :: FilePath -> IO [(Int, Text)] Source #

List all current claims. Returns [(task number, holder)].

wipeClaims :: FilePath -> IO () Source #

Remove all claim files in the bus root.

Paths

claimPath :: FilePath -> Int -> FilePath Source #

Path to the claim lock file for a task.