From e1d54ff75e048e190b7f953322f83e36886a51f3 Mon Sep 17 00:00:00 2001 From: Krzysztof Rudnicki Date: Fri, 10 Jul 2026 13:02:20 +0200 Subject: [PATCH] Root scaffold: README, LICENSE, per-subdirectory CI for utils monorepo --- .github/workflows/crdt-sync-precommit.yml | 24 +++++++++++ .github/workflows/crdt-sync-tests.yml | 33 ++++++++++++++ .github/workflows/gatelock-precommit.yml | 24 +++++++++++ .github/workflows/gatelock-tests.yml | 33 ++++++++++++++ LICENSE | 21 +++++++++ README.md | 52 +++++++++++++++++++++++ 6 files changed, 187 insertions(+) create mode 100644 .github/workflows/crdt-sync-precommit.yml create mode 100644 .github/workflows/crdt-sync-tests.yml create mode 100644 .github/workflows/gatelock-precommit.yml create mode 100644 .github/workflows/gatelock-tests.yml create mode 100644 LICENSE create mode 100644 README.md diff --git a/.github/workflows/crdt-sync-precommit.yml b/.github/workflows/crdt-sync-precommit.yml new file mode 100644 index 0000000..c698fc1 --- /dev/null +++ b/.github/workflows/crdt-sync-precommit.yml @@ -0,0 +1,24 @@ +name: crdt-sync pre-commit + +on: + push: + branches: [main] + paths: ['crdt-sync/**'] + pull_request: + branches: [main] + paths: ['crdt-sync/**'] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + working-directory: crdt-sync + run: pip install -r requirements.txt + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --config crdt-sync/.pre-commit-config.yaml --all-files diff --git a/.github/workflows/crdt-sync-tests.yml b/.github/workflows/crdt-sync-tests.yml new file mode 100644 index 0000000..0a27b13 --- /dev/null +++ b/.github/workflows/crdt-sync-tests.yml @@ -0,0 +1,33 @@ +name: crdt-sync tests + +on: + push: + branches: [main] + paths: ['crdt-sync/**'] + pull_request: + branches: [main] + paths: ['crdt-sync/**'] + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: crdt-sync + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run tests with coverage + run: python -m pytest -v diff --git a/.github/workflows/gatelock-precommit.yml b/.github/workflows/gatelock-precommit.yml new file mode 100644 index 0000000..3f89561 --- /dev/null +++ b/.github/workflows/gatelock-precommit.yml @@ -0,0 +1,24 @@ +name: gatelock pre-commit + +on: + push: + branches: [main] + paths: ['gatelock/**'] + pull_request: + branches: [main] + paths: ['gatelock/**'] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + working-directory: gatelock + run: pip install -r requirements.txt + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --config gatelock/.pre-commit-config.yaml --all-files diff --git a/.github/workflows/gatelock-tests.yml b/.github/workflows/gatelock-tests.yml new file mode 100644 index 0000000..f82779b --- /dev/null +++ b/.github/workflows/gatelock-tests.yml @@ -0,0 +1,33 @@ +name: gatelock tests + +on: + push: + branches: [main] + paths: ['gatelock/**'] + pull_request: + branches: [main] + paths: ['gatelock/**'] + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: gatelock + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run tests with coverage + run: python -m pytest -v diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d1aa637 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Krzysztof Rudnicki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3326f3 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# utils + +Shared libraries used across kuhyx's other projects. Each subdirectory is a +formerly-standalone repo, folded in here with full commit history preserved +(see each subdirectory's own `git log` for its pre-merge history). + +## crdt_sync_dart/ + +Dart/Flutter CRDT sync library (pub package name: `crdt_sync`, not published +to pub.dev — consumed via a git dependency). Mirrors `crdt-sync` (below) +module-for-module and test-for-test. Not yet consumed by any app; planned +for screen-locker's workout sync. + +Consume via: +```yaml +dependencies: + crdt_sync: + git: + url: https://github.com/kuhyx/utils + ref: crdt_sync_dart-v0.1.0 + path: crdt_sync_dart +``` + +## crdt-sync/ + +Python CRDT sync library (package: `crdt_sync`, not published to PyPI). Same +design as `crdt_sync_dart` (HLC clocks, per-field LWW, sticky-delete +tombstones). Not yet consumed by any app. + +Consume via: +``` +crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.1.0#subdirectory=crdt-sync +``` + +## guard-lib/ + +Bash tamper-resistance primitives (`guardctl`: chattr + bind-mount + systemd +watcher + pacman hooks). Not a package — installed by running +`guard-lib/install.sh` as root, which copies files onto the system +(`/usr/local/bin`, `/usr/local/lib/guard-lib`, systemd units, pacman hooks). +Consumed by `steam-backlog-enforcer` (expects a `guard-lib/install.sh` +sibling clone) and referenced by `screen-locker`. + +## gatelock/ + +Python lock-window + HMAC log-integrity backend (package: `gatelock`, not +published to PyPI). Consumed via pip by `screen-locker`, `diet-guard`, and +`wake-alarm`: + +``` +gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock +```