cadrumo.adapters.persistence.storage.custody._capsule_filesystem module

Capsule-publication filesystem primitives owned by the capsule boundary.

remove_posix_staging_if_same(parent_fd, name, identity)[source]
Return type:

None

Parameters:
remove_posix_tree(parent_fd, name)[source]
Return type:

None

Parameters:
fsync_directory(path)[source]
Return type:

None

Parameters:

path (Path)

rename_directory_noreplace(staging, destination, *, root_handle, staging_handle=None)[source]

Publish exactly once; fail closed where the platform has no no-replace rename.

Return type:

None

Parameters:
  • staging (Path)

  • destination (Path)

  • root_handle (int | None)

  • staging_handle (int | None)

renameat2_noreplace(*, source_fd, source_name, destination_fd, destination_name)[source]
Return type:

None

Parameters:
  • source_fd (int)

  • source_name (str)

  • destination_fd (int)

  • destination_name (str)

rename_windows_directory_by_handle(staging_handle, destination, *, root_handle)[source]

Rename the exact open stage while the complete destination ancestry is locked.

The sys.platform == "win32" block, rather than a guard at the call site or an early return, is what establishes the platform for the Windows API below: it is the only guard shape every checker this project runs narrows on, so those references resolve when the tree is analysed for a platform that does not ship them.

Return type:

None

Parameters:
  • staging_handle (int)

  • destination (Path)

  • root_handle (int)

write_through_windows_publication_fence(destination, *, root_handle)[source]

Commit the prior handle-relative rename through Windows’ supported fence.

The sys.platform == "win32" block, rather than a guard at the call site or an early return, is what establishes the platform for the Windows API below: it is the only guard shape every checker this project runs narrows on, so those references resolve when the tree is analysed for a platform that does not ship them.

Return type:

None

Parameters:
  • destination (Path)

  • root_handle (int | None)

fsync_windows_published_commit(destination)[source]

Use the server-backed commit record as the remote-volume durability fence.

The sys.platform == "win32" block, rather than a guard at the call site or an early return, is what establishes the platform for the Windows API below: it is the only guard shape every checker this project runs narrows on, so those references resolve when the tree is analysed for a platform that does not ship them.

Return type:

None

Parameters:

destination (Path)

windows_stage_snapshot(staging)[source]

Capture the exact transaction-owned tree before any cleanup can occur.

Return type:

dict[str, tuple[int, int, bool]]

Parameters:

staging (Path)

remove_windows_unpublished_staging(staging, *, staging_handle, snapshot)[source]

Delete only entries proven unchanged while the exact stage is pinned.

Return type:

None

Parameters:
windows_delete_exact_entry(target, expected)[source]
Return type:

None

Parameters:
windows_mark_handle_for_deletion(handle)[source]

Mark the exact open handle for deletion on close.

The sys.platform == "win32" block, rather than a guard at the call site or an early return, is what establishes the platform for the Windows API below: it is the only guard shape every checker this project runs narrows on, so those references resolve when the tree is analysed for a platform that does not ship them.

Return type:

None

Parameters:

handle (int)