kibisis-native 0.1.0a12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kibisis_native-0.1.0a12/.github/dependabot.yml +30 -0
- kibisis_native-0.1.0a12/.github/workflows/ci.yml +119 -0
- kibisis_native-0.1.0a12/.github/workflows/release.yml +311 -0
- kibisis_native-0.1.0a12/.github/workflows/scorecard.yml +36 -0
- kibisis_native-0.1.0a12/.gitignore +12 -0
- kibisis_native-0.1.0a12/CHANGELOG.md +413 -0
- kibisis_native-0.1.0a12/CONTRIBUTING.md +10 -0
- kibisis_native-0.1.0a12/Cargo.lock +105 -0
- kibisis_native-0.1.0a12/Cargo.toml +19 -0
- kibisis_native-0.1.0a12/LICENSE +21 -0
- kibisis_native-0.1.0a12/PKG-INFO +21 -0
- kibisis_native-0.1.0a12/README.md +145 -0
- kibisis_native-0.1.0a12/SECURITY.md +183 -0
- kibisis_native-0.1.0a12/bindings/python/Cargo.lock +137 -0
- kibisis_native-0.1.0a12/bindings/python/Cargo.toml +19 -0
- kibisis_native-0.1.0a12/bindings/python/README.md +8 -0
- kibisis_native-0.1.0a12/bindings/python/src/lib.rs +233 -0
- kibisis_native-0.1.0a12/deny.toml +19 -0
- kibisis_native-0.1.0a12/pyproject.toml +21 -0
- kibisis_native-0.1.0a12/rust-toolchain.toml +5 -0
- kibisis_native-0.1.0a12/src/file_lease.rs +749 -0
- kibisis_native-0.1.0a12/src/journal.rs +313 -0
- kibisis_native-0.1.0a12/src/kibisis/__init__.py +60 -0
- kibisis_native-0.1.0a12/src/kibisis/__main__.py +76 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_audit.py +247 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_crypto.py +509 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_review.py +656 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_search.py +869 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_snapshot.py +303 -0
- kibisis_native-0.1.0a12/src/kibisis/_vault_tombstone.py +229 -0
- kibisis_native-0.1.0a12/src/kibisis/admission.py +149 -0
- kibisis_native-0.1.0a12/src/kibisis/config.py +139 -0
- kibisis_native-0.1.0a12/src/kibisis/crypto.py +196 -0
- kibisis_native-0.1.0a12/src/kibisis/keys.py +61 -0
- kibisis_native-0.1.0a12/src/kibisis/lease.py +107 -0
- kibisis_native-0.1.0a12/src/kibisis/mcp_server.py +611 -0
- kibisis_native-0.1.0a12/src/kibisis/models.py +220 -0
- kibisis_native-0.1.0a12/src/kibisis/protocols.py +289 -0
- kibisis_native-0.1.0a12/src/kibisis/review.py +97 -0
- kibisis_native-0.1.0a12/src/kibisis/vault.py +1676 -0
- kibisis_native-0.1.0a12/src/lib.rs +1853 -0
- kibisis_native-0.1.0a12/tests/conftest.py +4 -0
- kibisis_native-0.1.0a12/tests/fixtures/journal_format3_vectors.json +409 -0
- kibisis_native-0.1.0a12/tests/fixtures/make_journal_vectors.py +275 -0
- kibisis_native-0.1.0a12/tests/fixtures/make_legacy_vault.py +57 -0
- kibisis_native-0.1.0a12/tests/fixtures/vault-0.1.0a5-fallback.sqlite +0 -0
- kibisis_native-0.1.0a12/tests/journal_vectors.rs +305 -0
- kibisis_native-0.1.0a12/tests/test_abstention_eval.py +315 -0
- kibisis_native-0.1.0a12/tests/test_admission_governance.py +94 -0
- kibisis_native-0.1.0a12/tests/test_adversarial_resilience.py +94 -0
- kibisis_native-0.1.0a12/tests/test_atlas_acceptance.py +494 -0
- kibisis_native-0.1.0a12/tests/test_atlas_rubric_hardening.py +182 -0
- kibisis_native-0.1.0a12/tests/test_benchmark_ergonomics.py +71 -0
- kibisis_native-0.1.0a12/tests/test_cold_start_reload_integrity.py +124 -0
- kibisis_native-0.1.0a12/tests/test_contracts.py +343 -0
- kibisis_native-0.1.0a12/tests/test_encryption_default.py +197 -0
- kibisis_native-0.1.0a12/tests/test_enforce_fencing.py +221 -0
- kibisis_native-0.1.0a12/tests/test_fallback_integrity.py +301 -0
- kibisis_native-0.1.0a12/tests/test_journal_vectors.py +151 -0
- kibisis_native-0.1.0a12/tests/test_kc_native_lease.py +149 -0
- kibisis_native-0.1.0a12/tests/test_mcp_server.py +304 -0
- kibisis_native-0.1.0a12/tests/test_negative_probe_abstention.py +130 -0
- kibisis_native-0.1.0a12/tests/test_origin_bound_admission.py +251 -0
- kibisis_native-0.1.0a12/tests/test_persona_slot.py +94 -0
- kibisis_native-0.1.0a12/tests/test_plugin_integration.py +153 -0
- kibisis_native-0.1.0a12/tests/test_provenance.py +201 -0
- kibisis_native-0.1.0a12/tests/test_ranked_search.py +491 -0
- kibisis_native-0.1.0a12/tests/test_recall_layer_kr345.py +298 -0
- kibisis_native-0.1.0a12/tests/test_review_2026_10_28.py +383 -0
- kibisis_native-0.1.0a12/tests/test_scope_resolution_kj.py +75 -0
- kibisis_native-0.1.0a12/tests/test_shared_vault_file.py +53 -0
- kibisis_native-0.1.0a12/tests/test_supersession_kr2.py +250 -0
- kibisis_native-0.1.0a12/tests/test_temporal_supersession.py +223 -0
- kibisis_native-0.1.0a12/tests/test_term_index_kd.py +422 -0
- kibisis_native-0.1.0a12/tests/test_threat_model_claims.py +98 -0
- kibisis_native-0.1.0a12/uv.lock +444 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Weekly, grouped version updates; a release is considered only once it is 7 days old.
|
|
2
|
+
version: 2
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: github-actions
|
|
5
|
+
directory: /
|
|
6
|
+
schedule:
|
|
7
|
+
interval: weekly
|
|
8
|
+
cooldown:
|
|
9
|
+
default-days: 7
|
|
10
|
+
groups:
|
|
11
|
+
github-actions:
|
|
12
|
+
patterns: ["*"]
|
|
13
|
+
- package-ecosystem: cargo
|
|
14
|
+
directory: /
|
|
15
|
+
schedule:
|
|
16
|
+
interval: weekly
|
|
17
|
+
cooldown:
|
|
18
|
+
default-days: 7
|
|
19
|
+
groups:
|
|
20
|
+
cargo:
|
|
21
|
+
patterns: ["*"]
|
|
22
|
+
- package-ecosystem: uv
|
|
23
|
+
directory: /
|
|
24
|
+
schedule:
|
|
25
|
+
interval: weekly
|
|
26
|
+
cooldown:
|
|
27
|
+
default-days: 7
|
|
28
|
+
groups:
|
|
29
|
+
uv:
|
|
30
|
+
patterns: ["*"]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test-rust-stable:
|
|
14
|
+
name: Rust Stable (fmt, clippy, test)
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
19
|
+
|
|
20
|
+
- name: Set up Rust toolchain
|
|
21
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, pinned 2026-10-25
|
|
22
|
+
with:
|
|
23
|
+
toolchain: 1.97.1
|
|
24
|
+
components: rustfmt, clippy
|
|
25
|
+
|
|
26
|
+
- name: Check formatting
|
|
27
|
+
run: |
|
|
28
|
+
cargo fmt --all -- --check
|
|
29
|
+
cargo fmt --manifest-path bindings/python/Cargo.toml -- --check
|
|
30
|
+
|
|
31
|
+
- name: Clippy linter
|
|
32
|
+
run: |
|
|
33
|
+
cargo clippy --all-targets -- -D warnings
|
|
34
|
+
cargo clippy --manifest-path bindings/python/Cargo.toml --all-targets -- -D warnings
|
|
35
|
+
|
|
36
|
+
- name: Run unit & doc tests
|
|
37
|
+
run: cargo test --verbose
|
|
38
|
+
|
|
39
|
+
test-rust-msrv:
|
|
40
|
+
name: Rust MSRV (1.89)
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout repository
|
|
44
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
45
|
+
|
|
46
|
+
- name: Set up MSRV toolchain
|
|
47
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, pinned 2026-10-25
|
|
48
|
+
with:
|
|
49
|
+
toolchain: "1.89.0"
|
|
50
|
+
|
|
51
|
+
- name: Cargo check on MSRV
|
|
52
|
+
run: cargo check --verbose
|
|
53
|
+
|
|
54
|
+
test-rust-miri:
|
|
55
|
+
name: Rust Miri (Undefined Behavior Check)
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
steps:
|
|
58
|
+
- name: Checkout repository
|
|
59
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
60
|
+
|
|
61
|
+
- name: Set up Nightly for Miri
|
|
62
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, pinned 2026-10-25
|
|
63
|
+
with:
|
|
64
|
+
toolchain: nightly
|
|
65
|
+
components: miri
|
|
66
|
+
|
|
67
|
+
- name: Run Miri test on lease coordination
|
|
68
|
+
run: cargo miri test --lib -- tests::test_lease_coordination
|
|
69
|
+
continue-on-error: true
|
|
70
|
+
|
|
71
|
+
test-python:
|
|
72
|
+
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
|
|
73
|
+
runs-on: ${{ matrix.os }}
|
|
74
|
+
strategy:
|
|
75
|
+
fail-fast: false
|
|
76
|
+
matrix:
|
|
77
|
+
os: [ubuntu-latest, macos-15]
|
|
78
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- name: Checkout repository
|
|
82
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
83
|
+
|
|
84
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
85
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
86
|
+
with:
|
|
87
|
+
python-version: ${{ matrix.python-version }}
|
|
88
|
+
|
|
89
|
+
- name: Set up Rust
|
|
90
|
+
uses: dtolnay/rust-toolchain@stable
|
|
91
|
+
|
|
92
|
+
- name: Install dependencies
|
|
93
|
+
run: |
|
|
94
|
+
python -m pip install --upgrade pip
|
|
95
|
+
pip install pydantic cryptography sqlcipher3 pytest hatchling build maturin
|
|
96
|
+
|
|
97
|
+
# K-C: the lease coordinator and the format-3 journal hashes are the crate's; the Python package
|
|
98
|
+
# requires the kibisis_native extension (no fallback), so it is built and installed first.
|
|
99
|
+
- name: Build and install the kibisis_native extension
|
|
100
|
+
run: |
|
|
101
|
+
(cd bindings/python && maturin build --release --locked --out "$RUNNER_TEMP/native-wheel")
|
|
102
|
+
pip install "$RUNNER_TEMP"/native-wheel/*.whl
|
|
103
|
+
python -c "import kibisis_native as n; print('kibisis_native', n.crate_version())"
|
|
104
|
+
|
|
105
|
+
# Installs the built wheel the way a user would: dependencies resolved from PyPI, no --no-deps.
|
|
106
|
+
# The native wheel is not on PyPI yet, so it is offered from the local directory with --find-links.
|
|
107
|
+
- name: Install the wheel with its dependencies in a clean venv
|
|
108
|
+
shell: bash
|
|
109
|
+
run: |
|
|
110
|
+
python -m build --wheel
|
|
111
|
+
python -m venv "$RUNNER_TEMP/smoke"
|
|
112
|
+
PY="$RUNNER_TEMP/smoke/bin/python"
|
|
113
|
+
"$PY" -m pip install --upgrade pip
|
|
114
|
+
"$PY" -m pip install --find-links "$RUNNER_TEMP/native-wheel" dist/*.whl
|
|
115
|
+
"$PY" -c "import platform, sqlcipher3, kibisis; print(platform.system(), platform.machine(), 'kibisis', kibisis.__version__, 'with', sqlcipher3.__name__)"
|
|
116
|
+
|
|
117
|
+
- name: Run pytest
|
|
118
|
+
run: |
|
|
119
|
+
pytest tests -v
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# A tag builds the kibisis_native extension wheels (manylinux x86_64, macOS universal2, plus an sdist),
|
|
4
|
+
# builds and tests the crate and the Python package, attests them, checks that the wheel installs with
|
|
5
|
+
# its dependencies (kibisis_native resolved from the same release files) on Ubuntu and macOS arm64, and
|
|
6
|
+
# creates a GitHub release that names the commit. Publishing to PyPI and crates.io runs in the protected `pypi` and `crates-io`
|
|
7
|
+
# environments, so nothing is published until a required reviewer approves the deployment.
|
|
8
|
+
# Pull requests run the same build and install jobs; attestation, release and publishing are tag-only.
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
tags:
|
|
13
|
+
- "v*"
|
|
14
|
+
pull_request:
|
|
15
|
+
branches: [main]
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
native:
|
|
22
|
+
name: kibisis_native wheel (${{ matrix.name }})
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
strategy:
|
|
25
|
+
fail-fast: false
|
|
26
|
+
matrix:
|
|
27
|
+
include:
|
|
28
|
+
- { name: manylinux-x86_64, os: ubuntu-latest, target: x86_64, manylinux: auto, sdist: true }
|
|
29
|
+
- { name: macos-universal2, os: macos-15, target: universal2-apple-darwin, manylinux: "", sdist: false }
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout repository
|
|
32
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
33
|
+
|
|
34
|
+
- name: Set up Python
|
|
35
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.12"
|
|
38
|
+
|
|
39
|
+
# The sdist goes first: the manylinux wheel builds inside a container that leaves native-dist root-owned.
|
|
40
|
+
- name: Build the extension sdist
|
|
41
|
+
if: matrix.sdist
|
|
42
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
43
|
+
with:
|
|
44
|
+
working-directory: bindings/python
|
|
45
|
+
command: sdist
|
|
46
|
+
args: --out ../../native-dist
|
|
47
|
+
|
|
48
|
+
# abi3-py311: one wheel per platform covers every CPython >= 3.11.
|
|
49
|
+
- name: Build the extension wheel
|
|
50
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
51
|
+
with:
|
|
52
|
+
working-directory: bindings/python
|
|
53
|
+
target: ${{ matrix.target }}
|
|
54
|
+
manylinux: ${{ matrix.manylinux }}
|
|
55
|
+
args: --release --locked --out ../../native-dist
|
|
56
|
+
sccache: "false"
|
|
57
|
+
|
|
58
|
+
- name: Upload the extension distributions
|
|
59
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
60
|
+
with:
|
|
61
|
+
name: native-${{ matrix.name }}
|
|
62
|
+
path: native-dist/
|
|
63
|
+
if-no-files-found: error
|
|
64
|
+
|
|
65
|
+
build:
|
|
66
|
+
name: Build, test and attest
|
|
67
|
+
needs: native
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
permissions:
|
|
70
|
+
contents: read
|
|
71
|
+
id-token: write
|
|
72
|
+
attestations: write
|
|
73
|
+
steps:
|
|
74
|
+
- name: Checkout repository
|
|
75
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
76
|
+
|
|
77
|
+
- name: Set up Rust toolchain
|
|
78
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, pinned 2026-10-25
|
|
79
|
+
with:
|
|
80
|
+
toolchain: 1.97.1
|
|
81
|
+
|
|
82
|
+
- name: Set up Python
|
|
83
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
84
|
+
with:
|
|
85
|
+
python-version: "3.12"
|
|
86
|
+
|
|
87
|
+
- name: Check the tag matches every version string
|
|
88
|
+
shell: python
|
|
89
|
+
run: |
|
|
90
|
+
import os, pathlib, re, tomllib
|
|
91
|
+
ref = os.environ["GITHUB_REF"]
|
|
92
|
+
tag = os.environ["GITHUB_REF_NAME"] if ref.startswith("refs/tags/") else None
|
|
93
|
+
cargo = tomllib.loads(pathlib.Path("Cargo.toml").read_text())["package"]["version"]
|
|
94
|
+
python = tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"]
|
|
95
|
+
native_cargo = tomllib.loads(pathlib.Path("bindings/python/Cargo.toml").read_text())["package"]["version"]
|
|
96
|
+
native_python = tomllib.loads(pathlib.Path("bindings/python/pyproject.toml").read_text())["project"]["version"]
|
|
97
|
+
pep440 = re.sub(r"-(alpha|beta|rc)\.", lambda m: {"alpha": "a", "beta": "b", "rc": "rc"}[m.group(1)], cargo)
|
|
98
|
+
problems = []
|
|
99
|
+
if tag is not None and tag != f"v{cargo}":
|
|
100
|
+
problems.append(f"tag {tag} != Cargo.toml v{cargo}")
|
|
101
|
+
if python != pep440:
|
|
102
|
+
problems.append(f"pyproject.toml {python} != {pep440}")
|
|
103
|
+
if native_cargo != cargo:
|
|
104
|
+
problems.append(f"bindings/python/Cargo.toml {native_cargo} != {cargo}")
|
|
105
|
+
if native_python != pep440:
|
|
106
|
+
problems.append(f"bindings/python/pyproject.toml {native_python} != {pep440}")
|
|
107
|
+
deps = tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["dependencies"]
|
|
108
|
+
if f"kibisis-native=={pep440}" not in deps:
|
|
109
|
+
problems.append(f"pyproject.toml dependencies lack kibisis-native=={pep440}: {deps}")
|
|
110
|
+
for init in pathlib.Path("src").glob("*/__init__.py"):
|
|
111
|
+
found = re.search(r'^__version__ = "([^"]+)"', init.read_text(), re.M)
|
|
112
|
+
if found and found.group(1) != python:
|
|
113
|
+
problems.append(f"{init} __version__ {found.group(1)} != {python}")
|
|
114
|
+
if problems:
|
|
115
|
+
raise SystemExit("; ".join(problems))
|
|
116
|
+
print(f"{tag or ref}: crate {cargo}, Python {python}, commit {os.environ['GITHUB_SHA']}")
|
|
117
|
+
|
|
118
|
+
- name: Run Rust tests
|
|
119
|
+
run: cargo test --release
|
|
120
|
+
|
|
121
|
+
- name: Package crate
|
|
122
|
+
run: cargo package
|
|
123
|
+
|
|
124
|
+
# The tests run against a wheel built here with --locked (same source as the published ones); the
|
|
125
|
+
# published extension wheels come from the `native` job above.
|
|
126
|
+
- name: Build and install the kibisis_native extension for the tests
|
|
127
|
+
run: |
|
|
128
|
+
python -m pip install --upgrade pip maturin
|
|
129
|
+
(cd bindings/python && maturin build --release --locked --out "$RUNNER_TEMP/native-wheel")
|
|
130
|
+
python -m pip install "$RUNNER_TEMP"/native-wheel/*.whl
|
|
131
|
+
python -c "import kibisis_native as n; print('kibisis_native', n.crate_version())"
|
|
132
|
+
|
|
133
|
+
- name: Run Python tests
|
|
134
|
+
run: |
|
|
135
|
+
python -m pip install build pytest .
|
|
136
|
+
python -m pytest tests -q
|
|
137
|
+
|
|
138
|
+
- name: Build sdist and wheel
|
|
139
|
+
run: python -m build
|
|
140
|
+
|
|
141
|
+
- name: Download the extension distributions
|
|
142
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
143
|
+
with:
|
|
144
|
+
pattern: native-*
|
|
145
|
+
path: native-dist
|
|
146
|
+
merge-multiple: true
|
|
147
|
+
|
|
148
|
+
- name: Collect release files and checksums
|
|
149
|
+
run: |
|
|
150
|
+
mkdir release
|
|
151
|
+
cp dist/*.whl dist/*.tar.gz native-dist/*.whl native-dist/*.tar.gz target/package/*.crate release/
|
|
152
|
+
ls release
|
|
153
|
+
cd release && sha256sum * > SHA256SUMS && cat SHA256SUMS
|
|
154
|
+
|
|
155
|
+
- name: Attest build provenance
|
|
156
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
157
|
+
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
|
158
|
+
with:
|
|
159
|
+
subject-path: |
|
|
160
|
+
release/*.whl
|
|
161
|
+
release/*.tar.gz
|
|
162
|
+
release/*.crate
|
|
163
|
+
|
|
164
|
+
- name: Upload release files
|
|
165
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
166
|
+
with:
|
|
167
|
+
name: release-files
|
|
168
|
+
path: release/
|
|
169
|
+
if-no-files-found: error
|
|
170
|
+
|
|
171
|
+
install-check:
|
|
172
|
+
name: Install the wheel (${{ matrix.os }})
|
|
173
|
+
needs: build
|
|
174
|
+
runs-on: ${{ matrix.os }}
|
|
175
|
+
strategy:
|
|
176
|
+
fail-fast: false
|
|
177
|
+
matrix:
|
|
178
|
+
os: [ubuntu-latest, macos-15]
|
|
179
|
+
steps:
|
|
180
|
+
- name: Set up Python
|
|
181
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
182
|
+
with:
|
|
183
|
+
python-version: "3.12"
|
|
184
|
+
|
|
185
|
+
- name: Download release files
|
|
186
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
187
|
+
with:
|
|
188
|
+
name: release-files
|
|
189
|
+
path: release
|
|
190
|
+
|
|
191
|
+
# No --no-deps: dependencies resolve from PyPI exactly as `pip install kibisis` would; kibisis_native,
|
|
192
|
+
# not yet on PyPI at this point of the run, resolves from the release files for this platform.
|
|
193
|
+
- name: Install the wheel and open an encrypted vault
|
|
194
|
+
shell: bash
|
|
195
|
+
run: |
|
|
196
|
+
python -m venv "$RUNNER_TEMP/venv"
|
|
197
|
+
PY="$RUNNER_TEMP/venv/bin/python"
|
|
198
|
+
"$PY" -m pip install --upgrade pip
|
|
199
|
+
"$PY" -m pip install --find-links release release/kibisis-*.whl
|
|
200
|
+
"$PY" - <<'EOF'
|
|
201
|
+
import pathlib, platform, tempfile
|
|
202
|
+
import sqlcipher3
|
|
203
|
+
import kibisis, kibisis_native
|
|
204
|
+
from kibisis import FileLeaseCoordinator, SQLiteMemoryVault
|
|
205
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
206
|
+
vault = SQLiteMemoryVault(pathlib.Path(tmp) / "smoke.db", passphrase="release install smoke test")
|
|
207
|
+
vault.put("smoke", "check", "installed from the release wheel")
|
|
208
|
+
assert vault.get("smoke", "check").content == "installed from the release wheel"
|
|
209
|
+
vault.close()
|
|
210
|
+
lease = FileLeaseCoordinator(pathlib.Path(tmp) / "leases").acquire("smoke", "holder-a", ttl_seconds=5)
|
|
211
|
+
assert lease.fencing_token == 1, lease
|
|
212
|
+
print(platform.system(), platform.machine(), "kibisis", kibisis.__version__, "kibisis_native",
|
|
213
|
+
kibisis_native.crate_version(), "with", sqlcipher3.__name__)
|
|
214
|
+
EOF
|
|
215
|
+
|
|
216
|
+
github-release:
|
|
217
|
+
name: GitHub release
|
|
218
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
219
|
+
needs: [build, install-check]
|
|
220
|
+
runs-on: ubuntu-latest
|
|
221
|
+
permissions:
|
|
222
|
+
contents: write
|
|
223
|
+
steps:
|
|
224
|
+
- name: Download release files
|
|
225
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
226
|
+
with:
|
|
227
|
+
name: release-files
|
|
228
|
+
path: release
|
|
229
|
+
|
|
230
|
+
- name: Create the release, naming its commit
|
|
231
|
+
env:
|
|
232
|
+
GH_TOKEN: ${{ github.token }}
|
|
233
|
+
run: |
|
|
234
|
+
{
|
|
235
|
+
echo "Built and tested by CI from commit ${GITHUB_SHA}."
|
|
236
|
+
echo
|
|
237
|
+
echo "Build provenance: https://github.com/${GITHUB_REPOSITORY}/attestations"
|
|
238
|
+
echo
|
|
239
|
+
echo '```'
|
|
240
|
+
cat release/SHA256SUMS
|
|
241
|
+
echo '```'
|
|
242
|
+
} > notes.md
|
|
243
|
+
gh release create "$GITHUB_REF_NAME" release/* --repo "$GITHUB_REPOSITORY" \
|
|
244
|
+
--title "$GITHUB_REF_NAME" --notes-file notes.md --verify-tag --prerelease
|
|
245
|
+
|
|
246
|
+
publish-pypi:
|
|
247
|
+
name: Publish to PyPI
|
|
248
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
249
|
+
needs: github-release
|
|
250
|
+
runs-on: ubuntu-latest
|
|
251
|
+
environment:
|
|
252
|
+
name: pypi
|
|
253
|
+
url: https://pypi.org/project/kibisis/
|
|
254
|
+
permissions:
|
|
255
|
+
id-token: write
|
|
256
|
+
steps:
|
|
257
|
+
- name: Download release files
|
|
258
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
259
|
+
with:
|
|
260
|
+
name: release-files
|
|
261
|
+
path: release
|
|
262
|
+
|
|
263
|
+
- name: Keep only the Python distributions, one project per directory
|
|
264
|
+
run: |
|
|
265
|
+
mkdir dist-native dist
|
|
266
|
+
cp release/kibisis_native-*.whl release/kibisis_native-*.tar.gz dist-native/
|
|
267
|
+
cp release/kibisis-*.whl release/kibisis-*.tar.gz dist/
|
|
268
|
+
ls dist-native dist
|
|
269
|
+
|
|
270
|
+
# Trusted publishing: no stored token. PyPI records the repository, workflow and commit. Both projects
|
|
271
|
+
# (kibisis-native, kibisis) carry this workflow + environment as their trusted publisher; the extension
|
|
272
|
+
# publishes first so `pip install kibisis==<version>` resolves the moment the second upload lands.
|
|
273
|
+
- name: Publish kibisis-native
|
|
274
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
275
|
+
with:
|
|
276
|
+
packages-dir: dist-native
|
|
277
|
+
|
|
278
|
+
- name: Publish kibisis
|
|
279
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
280
|
+
with:
|
|
281
|
+
packages-dir: dist
|
|
282
|
+
|
|
283
|
+
publish-crates:
|
|
284
|
+
name: Publish to crates.io
|
|
285
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
286
|
+
needs: github-release
|
|
287
|
+
runs-on: ubuntu-latest
|
|
288
|
+
environment:
|
|
289
|
+
name: crates-io
|
|
290
|
+
url: https://crates.io/crates/kibisis
|
|
291
|
+
permissions:
|
|
292
|
+
contents: read
|
|
293
|
+
id-token: write
|
|
294
|
+
steps:
|
|
295
|
+
- name: Checkout repository
|
|
296
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
297
|
+
|
|
298
|
+
- name: Set up Rust toolchain
|
|
299
|
+
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, pinned 2026-10-25
|
|
300
|
+
with:
|
|
301
|
+
toolchain: 1.97.1
|
|
302
|
+
|
|
303
|
+
# Trusted publishing: exchanges this job's OIDC token for a short-lived crates.io token.
|
|
304
|
+
- name: Authenticate to crates.io
|
|
305
|
+
id: auth
|
|
306
|
+
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
|
|
307
|
+
|
|
308
|
+
- name: Publish
|
|
309
|
+
run: cargo publish
|
|
310
|
+
env:
|
|
311
|
+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# OpenSSF Scorecard. Results go to code scanning only: publish_results stays false until main is protected by a ruleset.
|
|
2
|
+
name: Scorecard
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
branch_protection_rule:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: "27 4 * * 1"
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
permissions: read-all
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
analysis:
|
|
15
|
+
name: Scorecard analysis
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
security-events: write # upload the SARIF to code scanning
|
|
19
|
+
id-token: write # needed once publish_results is true
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
22
|
+
with:
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
- uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
|
|
25
|
+
with:
|
|
26
|
+
results_file: results.sarif
|
|
27
|
+
results_format: sarif
|
|
28
|
+
publish_results: false
|
|
29
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
30
|
+
with:
|
|
31
|
+
name: scorecard-sarif
|
|
32
|
+
path: results.sarif
|
|
33
|
+
retention-days: 5
|
|
34
|
+
- uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
|
|
35
|
+
with:
|
|
36
|
+
sarif_file: results.sarif
|