Canonical URLs: Full §05 · Raw Markdown · Plain-Text Brief · ← §04 Brief · §06 Brief → · All §01–§09 Master Brief · All Articles · Raw Markdown Executive Synthesis: Problem: An expired lease does not physically stop a stale worker or an uncooperative local writer from changing a resource. — Proves: Monotonic generations, current tenancy, typed scopes, and overlapping Win32 handle exclusion fence the write itself. — Evaluation Scope: Use the Shared-Resource Lease & Kernel Fencing Challenge on one shared file or SQLite row. Lossless Parts (4 total, 100% unabridged): Part 1/4 (.txt) · Part 2/4 (.txt) · Part 3/4 (.txt) · Part 4/4 (.txt)
- Introduction & Thesis [Part 1/4]: # Expiry Is Not Fencing: Typed Leases and Kernel Write Exclusion A lease clock can expire without removing a stale worker's ability to write. Authority must be revalidated at the effect boundary and held through the rename. **By Blayne Aina · Principal Systems Architect and…
- The Two Hazards the Architecture Must Defeat [Part 1/4]: Subtopics: Hazard 1: The resurrected worker; Hazard 2: The uncooperative local writer — The refusal must happen at the resource. A wake-time check is not enough because authority can change after the wake. A heartbeat alone is not enough because a delayed heartbeat can arrive after succession.
- 1. Six Typed Namespaces and Real Target Identity [Part 1/4]: Subtopics: Lexical paths are not kernel object identity — Leases are partitioned by resource class, not by an undifferentiated path string. Bare paths default to
file://for compatibility. ATypedScopecontains the namespace and fullresource_id; different namespaces never conflict with one another at the lease-algebra level. — Spec/Table:file://; Example resource: Exact files or directory hierarchies; Conflict rule: Canonical path-prefix conflicts; parent and child scopes overlap |session://; Example resource: Managed sessions and virtual resources such assqlite.records/<target>; Conflict rule: Canonical session-resource prefix conflicts |window://; Example resource: GUI application windows; Conflict rule: Hierarchical prefix… - 2. Workspace-Wide Monotonic Generations [Part 1/4]: Subtopics: Two-phase persistence; Exhibit 1 — A sealed generation marker; Exhibit 2 — The stale-worker refusal — A per-file counter can restart when the file is replaced or a lease is released. That makes old authority look current again. AINA therefore uses a workspace-wide high-water sequence in
room.generation.v2. - 3. A 30-Second Cross-Process Transition Mutex [Part 1/4]: Generation, lease mutation, vault capture, guarded replacement, and readback must form one authoritative transition.
with_transitionserializes them through.lease-transition.mutex, an OS file lock opened with read/write sharing but no delete sharing. — Key Rules/Claims: The transition mutex serializes one commit and is held across decision, capture, replacement, and verification. | The lease TTL bounds tenancy and requires heartbeat renewal. | The generation determines whether a tenancy is current at execution. - 4. Acquisition, Re-Grant, and Conditional Lifecycle [Part 1/4]: Subtopics: Dead-holder re-granting requires proof of death; Conditional lifecycle compares all six tenancy keys — Acquisition checks break-glass admission, package/source exclusion, namespace conflicts, and existing tenancy. A lease cannot silently change tasks;
lease_task_mismatchpreserves the original binding. — Key Rules/Claims: an enforced server-held tenancy, or an eligible identity-bound managed SQLite session; |holder_aliveto be false; | the recordedholder_pidto be absent according toprocess_alive. - 5. The Five-Role Overlapping Handle Exchange [Part 2/4]: Subtopics: Role G: the long-term exclusion; Role W: pin and hash the preimage; Role P: pin the parent directory; Role T: stage and rename the new object; Role H: bridge publication to the next guard; Role G': verify before success — Windows refuses to rename over an existing destination when any open handle withholds
FILE_SHARE_DELETE. The long-term guard therefore cannot simply remain open across replacement. Closing it naively would create a write-open race. — Key Rules/Claims:FILE_RENAME_INFORMATION_EXclass 65; |FILE_RENAME_FLAG_POSIX_SEMANTICS(0x2); |FILE_RENAME_FLAG_REPLACE_IF_EXISTS(0x1) when replacement is allowed; |RootDirectory = parent_pin.as_raw_handle(); | one verified relative UTF-16 leaf name. - 6. Two Residual Intervals—and the Evidence They Produce [Part 2/4]: Subtopics: Preimage displacement forensics; Exhibit 3 — Successful guarded replacement verification; Six typed reconciliation faults; Exhibit 4 —
destination_preimage_displaced— The handle exchange closes write-open gaps. It does not make every delete or rename impossible. During Interval 1, onlyWandPremain; during Interval 2, onlyHremains. — Spec/Table:GuardLost; What broke: The destination guard could not be acquired or reacquired;reconcile_byaction: If the rename completed, hash the path to distinguish published bytes from preimage; if it failed, re-establish the lease before any further write |NameRedirected; What broke:G'resolves somewhere other than the leased path;reconcile_byaction: Resolve the name, locate the published bytes at… — Key Rules/Claims: Interval 2's object substitution is detected byG'identity verification. | A reparse redirect is detected by comparingG''s resolved path with the leased scope. | A moved preimage is detected throughW. | A third-party delete-and-recreate can remain indistinguishable from ordinary replacement. - 7. Server Liveness and Zero-Downtime Image Handoff [Part 2/4]: Subtopics: Adopting leases without an exclusion gap — A fencing system cannot depend on a PID alone. PID reuse would let a dead holder appear alive.
enter_server_modepublishes.squad/servers/<pid>.jsonwith build, session, and protocol identity, then holds the record itself withFILE_SHARE_READ. — Key Rules/Claims: Generate a one-time handoff secret and pass it only to the child. | The child authenticates withsquad/lease_adoptbefore serving ordinary requests. | For every held scope, the child takes its own deny-write handle while the parent still holds its handle. Concurrent read-sharing opens coexist. - 8. Fencing Continues Into Every Execution Surface [Part 3/4]: Subtopics: File write funnel; Fenced SQLite mutation;
RequestedActand result grants — Generation checks would be decorative if they stopped at the lease manager. They are wired into file replacement, SQLite, worker acts, and successor result delivery. — Key Rules/Claims: rereads the current row and requiresnow_version == expected; | captures recovery state; | revalidates target identity,RequestedAct, and approval; | executes a conditional `UPDATE ... - 9. Release Verification and Quarantine [Part 3/4]: Subtopics: The out-of-band owner lock kill-switch; Exhibit 5 — Release quarantine instead of baseline laundering — Release is another evidence boundary, not a lockfile deletion with good intentions.
release_content_checkcompares on-disk bytes with: If content matches, release archives the post-edit state to Amber. — Key Rules/Claims:post_sha256from the last gated write under the lease, when one exists; or | the lease's captured pre-write FNV-1a and byte count when no gated write occurred. That FNV-plus-length comparison is a non-cryptographic drift check, useful for noticing ordinary change, not for proving integrity against a malicious… - Platform and Route Matrix [Part 3/4]: The architecture is therefore strong without becoming unfalsifiable. It names the route it governs, the kernel primitives that enforce it, the interval it cannot close, and the evidence that remains when verification fails. — Spec/Table: Windows long-lived MCP server: Kernel handle exclusion is enforced across tenancy and all five replacement roles | Windows short-lived CLI: Lease is advisory because process exit drops handles; protected execution requires a server-held handle | Non-Windows: No equivalent Win32 share-mode, parent-pin, native-rename, or liveness claims; no false equivalence is asserted | **Handles or memory mappings…
- 10. The 2026 Fencing Evidence Landscape [Part 3/4]: The research supports monotonic execution fencing and exposes the same limitation that matters here: a mechanism proves only the effect classes its boundary actually covers. The functional-equivalence concession still applies. — Spec/Table: Shu, Boundary-State Control for Tool-Using Language-Model Agents, September 2026 preprint; What it establishes: BSC-R binds a single-use authorization to the exact action and semantic authorization state.
- The Adversarial Stale-Writer Challenge [Part 3/4]: The Shared-Resource Lease & Kernel Fencing Challenge uses a deliberately hostile sequence, not just a happy-path replacement: The challenge excludes retroactive revocation of pre-existing handles and mappings, universal OS/filesystem coverage, total effect coverage, and… — Key Rules/Claims: Worker A acquires generation 14 and stalls. | Worker B acquires generation 15 and completes a guarded replacement. | Worker A resumes and attempts both a stale-generation write and a direct incompatible file open. | The executor returns
stale_lease_generation; the kernel returnsERROR_SHARING_VIOLATION. - The Twelve Execution Claims [Part 4/4]: Spec/Table:
05-C01; Bounded claim: Six typed lease namespaces and hierarchical conflict rules govern ownership; FNV-1a is only a routing key; Evidence and ceiling: Implemented and author-verified for all lease requests; full canonical identity decides authority |05-C02; Bounded claim: Filesystem scopes reject ambiguous paths and resolve opened object identity through handles; Evidence and ceiling: Implemented and… - The Article 05 Claim Card [Part 4/4]: Key Rules/Claims: Mechanism: | AINA Typed Leases, Monotonic Generation Fencing, and Guarded Replacement | (typed scopes, room.generation.v2, transition mutex, lifecycle guards, | G/W/T/H/G' handles, parent pin, liveness, SQLite fences, and release quarantine) | Failure it governs: | Stale workers resurrecting after lease expiry; | uncooperative local write/delete/rename opens; | rolled-back generation stores and successor-tenancy confusion; | parent junction swaps and destination reparse redirection; | displaced preimages and divergent post-release content.
- The Clock Is Not the Fence [Part 4/4]: A lease expires because coordination needs a way forward. That does not mean the old worker has become harmless. Authority must change form at the resource: a new generation, a new holder, a new epoch, and a kernel-enforced exclusion that survives the replacement.
- Frequently Asked Questions [Part 4/4]: Subtopics: Why is lease expiry not fencing?; Is FNV-1a part of the security proof?; Why are five handle roles necessary?; Does the kernel gate revoke handles or mappings opened earlier?; What does preimage displacement detection prove?; Does this guarantee exactly-once external effects? — Expiry allows ownership to move after a holder stops responding, but it does not erase a stale worker's process, cached authority, delayed request, or physical ability to write. The resource must reject the stale generation at execution. No.
- Continue the Series [Part 4/4]: Key Rules/Claims: Series index: From Proposal to Consequence: The AINA Transition-Governance Series | Previous: Article 04 — The Room: Why Git and Chat Are Not Coordination Planes | Next: [Article 06 — Rollback Is…
- Primary 2026 Sources [Part 4/4]: Key Rules/Claims: Shu — Boundary-State Control for Tool-Using Language-Model Agents: Commit-Time Consistency under State Drift,
arXiv:2609.37475| [Lyu et al. - Publication Metadata [Part 4/4]: Title tag: Expiry Is Not Fencing: Typed Leases and Kernel Write Exclusion Meta description: Why wall-clock lease expiry cannot stop stale AI writes: typed scopes, monotonic generations, five-role Win32 handle exchange, preimage forensics, and release quarantine.