Skip to the content.

Region admission (internal/regionadmit)

The fleet runs many execution surfaces at once: dispatch workers, fak loop drive loops, super-loop walks that tell an operator what to enter next, RSI candidates, and plain manual sessions. Before this seam, only the dispatch tick checked anybody else before acting — and only with raw tree geometry. A loop and a dispatch worker could edit the same tree with no mutual visibility at all. Region admission is the one shared answer to “may THIS actor act on THIS (lane, tree) right now?”

The seam — one decision, one fabric, one vocabulary

Three pieces, deliberately separated:

Who consults it (the coordination table)

Surface Before Now
Dispatch tick (fak dispatch tick) inline geometric overlap scan, no lane semantics same acquire path, but the decision is regionadmit.Decide — gains lane serialization + exclusive-lane refusal; refusals carry the rung
fak loop drive nothing — two loops, or a loop and a dispatch worker, could edit one tree blind a GOAL.md lane: / region: (or --lane / --tree) makes the drive refuse over a live overlapping lease, then hold a fenced lease on its region for the whole drive (renewed each turn, released on exit, honest-stop on a mid-drive STALE_LEASE takeover)
Manual session / script nothing to consult fak loop region --lane <l> [--tree <g>] --actor session:<id> — the same decision as a standalone verb (exit 0 admit / 3 refuse); hold with fak leaseref acquire if admitted
Super loop (fak superloop walk) worklist only; two operators could enter the same member the walk stays read-only and gains nothing automatically yet: today an operator entering a member can run fak loop region first by hand, and a member that happens to be a lane/region-declaring GOAL loop inherits the hold; the drive rung that enters members through this gate is the named follow-on (#2224)
RSI loop physical isolation (private worktree) unchanged — isolation by construction needs no lease

Because every surface writes into the same refs/fak/locks/* namespace, visibility is symmetric: a loop’s held region refuses a dispatch spawn, and a dispatch worker’s lane lease refuses a loop drive — witnessed end-to-end in cmd/fak/loop_drive_region_test.go.

Using it from a GOAL.md loop

---
loop: gateway-nightly
witness: commit-audit
lane: gateway                 # the dos.toml lane; its canonical tree is the region
# or explicit globs:
# region: internal/gateway/**, docs/gateway.md
budget: { max_iters: 8 }
---

The drive then emits the region lease as ledger evidence (region_lease: loop-gateway-nightly on every turn event), records a COLLISION_RISK refused-admit event when it must yield, and exits 3 so a scheduler treats it like any other structured refusal. No lane, no region — no change: the historical uncoordinated drive is preserved byte-for-byte.

Using it from a manual session

# before editing internal/gateway/** in a shared checkout:
git fetch origin 'refs/fak/locks/*:refs/fak/locks/*'   # see peers' leases
fak loop region --lane gateway --actor session:$ME     # may I?
fak leaseref acquire --id session-$ME-gateway --tree 'internal/gateway/**' --ttl 3600
# ... work ... (renew with `fak leaseref renew` if it runs long)
fak leaseref release --id session-$ME-gateway --holder $ME   # done: hand the region back NOW

Once held, the manual lease is not advisory decoration: the dispatch tick and every lane/region-declaring loop drive will refuse to enter that region until it clears. When the work is done, fak leaseref release — the release twin of acquire — hands the region back immediately (holder-checked and CAS-deleted: a live lease held by a different holder refuses STALE_LEASE, an already-absent one is an idempotent OK, and an expired record is releasable by anyone as a single-id reap; --force is the operator override). A holder that never releases is still bounded: the TTL lapses the record and fak leaseref reap (or the garden tick) removes it.

Operational consequences worth knowing

Honest boundary

The same one internal/leaseref declares, unchanged by this seam: cross-machine this is distribution / visibility, not atomic acquisition — after a fak leaseref sync a peer’s lease is seen, but a same-fetch-window race between two clones is not arbitrated. Same-host, the fence (AcquireFenced’s CAS + generation) is real atomicity. The decision itself is only as complete as the lease set it is shown: a surface that acquires nothing (RSI by design; any legacy uncoordinated launch) is still invisible. Named next rungs, tracked in the backlog: the super-loop drive rung entering members through this gate (#2224), preflight live-count reading these leases (#2226), and the relay baton’s held_region re-acquire on resume (#1860 track H).