Skip to content

PR4: Storage-protocol hygiene & guard - #89

Closed
Diego Colombo (colombod) wants to merge 1 commit into
feat/schema-version-observabilityfrom
feat/lease-store-and-storage-guard
Closed

PR4: Storage-protocol hygiene & guard#89
Diego Colombo (colombod) wants to merge 1 commit into
feat/schema-version-observabilityfrom
feat/lease-store-and-storage-guard

Conversation

@colombod

@colombod Diego Colombo (colombod) commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Fourth of the progressive split of #79. Stacks on PR3 (#88) → PR2 (#87) → PR1 (#85) → #81#78.

Delivers

  • Writer-lease lease_store/ package + writer_lease.py refactored to move LeaseRecord + file I/O behind the store (public surface unchanged — main.py still reads only writer_lease.acquired).
  • AST storage-boundary guard (tests/test_storage_boundary_guard.py): asserts no non-storage module does raw glob/os.unlink/Path over a storage directory; _STORAGE_PACKAGES covers blob_store/identity_store/queue_manager/lease_store.
  • Queue enumeration via protocol: session_keys() on the QueueManager Protocol + impl; _boot_reclaim uses it (with a new unit test).
  • Protocol hygiene: removed queues_dir (a filesystem Path) from the QueueManager Protocol and routed the main.py consumers through backend-neutral methods; the one sanctioned registry.queues_dir_path WriterLease exception now resolves from settings.queues_path. Batch docstring corrected to match Record's opaque-position contract.

Scope

  • Storage hygiene only.

Surface

  • Adds session_keys(), removes queues_dir from the Protocol → version 7.2.0 → 7.3.0 + CHANGELOG.

Verification

  • 2164 non-Neo4j tests pass (0 fail), incl. 41 storage-boundary-guard + lease_store + writer_lease (planted-leak self-test confirmed armed) and 3 session_keys() tests; 4 Neo4j reclaim/queue tests pass on a live container; boot smoke green (/version → 7.3.0, session_keys() returns the live session, queues_dir_path resolves from settings).

…on_keys

Storage-protocol hygiene, stacked on the schema-version work. Carries only the
two storage-agnosticism concerns from the maintenance re-seat -- no maintenance
mode, auto-repair, or blob-reclaim (those land later).

Writer-lease persistence moves behind a new backend-neutral lease_store package
(protocol + filesystem + factory), the fourth storage backend alongside
blob_store, queue_manager, and identity_store. The writer-lease detector keeps
all policy -- staleness, conflict, the bounded single-thread I/O executor --
and reaches the lease only through the store, so the same detector runs
unchanged against any backend.

A standing AST tripwire (test_storage_boundary_guard) asserts no module outside
the four storage backend packages performs a storage-artifact file operation or
reads a storage root path; it is proven red on a planted leak. It also catches
a raw queues_dir glob or path-join.

QueueManager gains session_keys() -- a backend-neutral way to enumerate every
persisted session key. Boot reclaim sweeps through it instead of globbing the
queue directory. queues_dir is removed from the QueueManager Protocol: the two
main.py consumers now go through session_keys()/the session key, and the single
sanctioned exception (registry.queues_dir_path, for the WriterLease boot
detector) resolves the directory straight from settings. The Batch docstring
now states its offsets are opaque queue-produced cursors, matching Record.

Version 7.3.0.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@colombod
Diego Colombo (colombod) force-pushed the feat/lease-store-and-storage-guard branch from d39b00c to 5e7c2ca Compare August 26, 2026 17:06
@colombod
Diego Colombo (colombod) marked this pull request as draft August 27, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant