tarlatan
    Preparing search index...

    Interface ProjectLog

    A project's append-only event log as a capability.

    The busy-wait contract, which every implementation must meet: each log is opened with a busy timeout, in milliseconds. A write that meets another writer's lock on the same log (in this process or another) waits for it up to that timeout; if the lock is released in time the write goes ahead, and if not it fails with ProjectLogError whose reason is "project log busy", and writes nothing. An implementation states how it meets this and what its evidence is (dogfood-6f, owner ruling of 2026-11-28).

    interface ProjectLog {
        append: (
            expected: number & Brand<"LogPosition">,
            events: readonly (
                | Approved
                | PreApproved
                | Waived
                | WaiverExpired
                | Released
                | Adopted
                | Reconciled
                | ProtectedReleased
                | SessionOpened
                | ReportRecorded
                | FindingsRecorded
                | RulingAdded
                | FindingOverruled
                | RoundsGranted
                | BriefRecorded
                | SnapshotTaken
                | SnapshotKept
                | HandoffApproved
                | HandoffRejected
                | ReviewChecked
                | StepEndedByOwner
                | SessionClosed
                | Intended
                | Launched
                | Finished
                | CommitRecorded
                | ReviewQueued
                | Unwound
                | TrancheEnded
                | LedgerBound
                | WorktreeIntended
                | WorktreeCreated
                | Rebased
                | BaseRequested
                | UnwindRequested
                | RestoreRequested
                | RequestCompleted
                | HoldCreated
            )[],
        ) => Effect<number & Brand<"LogPosition">, PositionMoved | ProjectLogError>;
        readFrom: (
            position: number & Brand<"LogPosition">,
        ) => Effect<readonly LoggedEvent[], ProjectLogError>;
    }
    Index
    append: (
        expected: number & Brand<"LogPosition">,
        events: readonly (
            | Approved
            | PreApproved
            | Waived
            | WaiverExpired
            | Released
            | Adopted
            | Reconciled
            | ProtectedReleased
            | SessionOpened
            | ReportRecorded
            | FindingsRecorded
            | RulingAdded
            | FindingOverruled
            | RoundsGranted
            | BriefRecorded
            | SnapshotTaken
            | SnapshotKept
            | HandoffApproved
            | HandoffRejected
            | ReviewChecked
            | StepEndedByOwner
            | SessionClosed
            | Intended
            | Launched
            | Finished
            | CommitRecorded
            | ReviewQueued
            | Unwound
            | TrancheEnded
            | LedgerBound
            | WorktreeIntended
            | WorktreeCreated
            | Rebased
            | BaseRequested
            | UnwindRequested
            | RestoreRequested
            | RequestCompleted
            | HoldCreated
        )[],
    ) => Effect<number & Brand<"LogPosition">, PositionMoved | ProjectLogError>

    Appends events only if the log is still at expected, and returns the new position; otherwise fails with PositionMoved and writes nothing. Under another writer's lock it waits as the log's busy-wait contract says, and fails with ProjectLogError ("project log busy"), writing nothing, once the busy timeout has passed.

    readFrom: (
        position: number & Brand<"LogPosition">,
    ) => Effect<readonly LoggedEvent[], ProjectLogError>

    Every event written after position, in order.