Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@ artifacts/
BenchmarkDotNet.Artifacts/
bin/
obj/
build/
out/
TestResults/
coverage/
node_modules/
__pycache__/
*.py[cod]
.venv/
venv/
dist/
*.egg-info/
*.o
*.so
*.a
*.dll
*.exe
*.log
*.log.*
*.trx
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protocol/fixtures/v1.2/*.snapshot.json text eol=lf
83 changes: 79 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

steps:
- name: Check out source
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up .NET 10
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: 10.0.x

Expand Down Expand Up @@ -62,13 +62,88 @@ jobs:

steps:
- name: Check out source
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up .NET 10
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: 10.0.x

- name: Validate Docker sharing
shell: pwsh
run: ./scripts/validate-docker-shared-memory.ps1 -Configuration Release

native:
name: Native (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Check out source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Validate CMake build, tests, install, and clean consumer
shell: pwsh
run: ./scripts/validate-native.ps1 -Configuration Release

python:
name: Python (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Check out source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Python 3.12
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'

- name: Install Python build frontend
run: python -m pip install --upgrade build

- name: Validate source tests, wheel contents, and clean installation
shell: pwsh
run: ./scripts/validate-python.ps1 -Configuration Release

interoperability:
name: Interoperability (${{ matrix.os }})
needs: [native, python]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Check out source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up .NET 10
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: 10.0.x

- name: Set up Python 3.12
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'

- name: Validate all ordered runtime pairs and stress lifecycles
shell: pwsh
run: >-
./scripts/validate-interoperability.ps1
-Configuration Release
-Stress
-StressValueCount 1000
-StressLifecycleCycleCount 10000
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
bin/
obj/
build/
out/
artifacts/
TestResults/
BenchmarkDotNet.Artifacts/
__pycache__/
*.py[cod]
.venv/
venv/
dist/
*.egg-info/
*.o
*.so
*.a
*.dll
*.exe
*.log
*.trx
*.tmp
Expand Down
2 changes: 1 addition & 1 deletion .specify/feature.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"feature_directory": "specs/007-linux-windows-support"
"feature_directory": "specs/008-cpp-python-implementations"
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- SPECKIT START -->
For additional context about technologies to be used, project structure,
shell commands, and other important information, read the current plan
at specs/007-linux-windows-support/plan.md
at specs/008-cpp-python-implementations/plan.md
<!-- SPECKIT END -->
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,47 @@
All notable package and documentation changes are recorded in reverse
chronological order.

## Unreleased

### Added

- Added an independently versioned CMake `SharedMemoryStore` `0.1.0`
distribution with a C++20 protocol core, Windows and Linux adapters,
fixed-width C ABI `1.0`, move-only C++ RAII wrappers, dependency-free native
tests, install/export rules, clean-consumer project, and basic sample.
- Added the Python `shared-memory-store` `0.1.0` source and wheel configuration
for Python 3.10 or newer. Its standard-library `ctypes` API packages and
validates the native library beside the Python modules and exposes
context-managed stores, leases, reservations, recovery, waits, and
diagnostics.
- Added the canonical language-neutral protocol boundary for layout `1.2`,
resource naming `1`, exact conformance fixtures, compatibility metadata, and
test-only .NET, C++, and Python JSON-lines participants.
- Added an ordered 3x3 core exchange harness plus native and Python contract,
lifecycle, ABI, diagnostics, and package tests.

### Security

- Preserved the trusted same-host participant boundary across all three
distributions. Native and Python callers receive lifecycle and layout
validation, but no implementation claims protection from a malicious writer
that already has legitimate access to the shared resources.
- Restricted Python native loading to the library packaged beside its modules;
it does not search the current directory, `PATH`, or system library paths.

### Compatibility

- NuGet `SharedMemoryStore` remains `1.0.1`; its public managed API, status
numbers, BCL-only runtime dependency surface, and layout `1.2` behavior are
unchanged. The native and Python artifacts are sibling distributions and are
not included in the NuGet package.
- NuGet, CMake, and Python versions advance independently. Cross-runtime
compatibility is declared through layout `1.2`, resource naming `1`, and C
ABI `1.0` where applicable.
- The native and Python `0.1.0` lines are alpha. Registry publication and full
Windows/Linux ordered-pair release evidence remain explicit publication
gates rather than claims made by this entry.

## 1.0.1 - 2026-07-10

### Packaging
Expand Down
82 changes: 82 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cmake_minimum_required(VERSION 3.20)

project(
SharedMemoryStore
VERSION 0.1.0
DESCRIPTION "Cross-process shared memory value store"
LANGUAGES CXX)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
find_package(Threads REQUIRED)

option(SMS_BUILD_TESTS "Build the dependency-free native test suite" OFF)
option(SMS_BUILD_SAMPLES "Build native usage samples" OFF)
option(SMS_BUILD_STATIC "Build the optional static native library" OFF)

set(_sms_install_default ON)
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(_sms_install_default OFF)
endif()
option(SMS_INSTALL "Generate native install and CMake package rules"
"${_sms_install_default}")
unset(_sms_install_default)
set(
SMS_PYTHON_INSTALL_DIR
""
CACHE STRING
"Optional wheel-relative directory for the Python native library")

add_subdirectory(src/cpp)

if(SMS_INSTALL AND NOT SMS_PYTHON_INSTALL_DIR STREQUAL "")
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/src/python/shared_memory_store/__init__.py"
"${CMAKE_CURRENT_SOURCE_DIR}/src/python/shared_memory_store/_native.py"
"${CMAKE_CURRENT_SOURCE_DIR}/src/python/shared_memory_store/enums.py"
"${CMAKE_CURRENT_SOURCE_DIR}/src/python/shared_memory_store/store.py"
DESTINATION "${SMS_PYTHON_INSTALL_DIR}"
COMPONENT Python)
endif()

if(SMS_BUILD_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests/cpp)
endif()

if(SMS_BUILD_SAMPLES)
add_subdirectory(samples/CppBasicUsage)
endif()

if(SMS_INSTALL)
set(
SMS_INSTALL_CMAKEDIR
"${CMAKE_INSTALL_LIBDIR}/cmake/SharedMemoryStore"
CACHE STRING "Directory used to install the CMake package files")

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/SharedMemoryStoreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/SharedMemoryStoreConfig.cmake"
INSTALL_DESTINATION "${SMS_INSTALL_CMAKEDIR}")

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/SharedMemoryStoreConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY SameMajorVersion)

install(
EXPORT SharedMemoryStoreTargets
FILE SharedMemoryStoreTargets.cmake
NAMESPACE SharedMemoryStore::
DESTINATION "${SMS_INSTALL_CMAKEDIR}"
COMPONENT Development)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/SharedMemoryStoreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/SharedMemoryStoreConfigVersion.cmake"
DESTINATION "${SMS_INSTALL_CMAKEDIR}"
COMPONENT Development)
endif()
Loading