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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,64 @@ jobs:
- uses: docker://rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667
with:
args: -color
rust:
name: Rust quality gates (fmt, clippy, test)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f # v1
with:
toolchain: 1.98.1
components: rustfmt, clippy
- run: cargo fmt --all -- --check
- run: RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets
- run: cargo test --workspace --locked

component-package:
name: Component package (linux x86_64)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f # v1
with:
toolchain: 1.98.1
- name: Build release component
run: cargo build --release --locked --target x86_64-unknown-linux-gnu --bin bitty-storage
- name: Pack target archive and checksums
run: |
scripts/package-component.sh \
--version "$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)" \
--target x86_64-unknown-linux-gnu \
--binary target/x86_64-unknown-linux-gnu/release/bitty-storage \
--output dist/x86_64-unknown-linux-gnu.tar.gz
- name: Verify package shape
run: scripts/test-package-component.sh
- name: Smoke-test the packed executable
run: |
set -euo pipefail
version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)"
mkdir -p dist/smoke
tar -xzf dist/x86_64-unknown-linux-gnu.tar.gz -C dist/smoke
dist/smoke/bitty-storage --version | grep -Fx "bitty-storage $version"
dist/smoke/bitty-storage --check-manifest dist/smoke/bitty-component.toml
test -s dist/SHA256SUMS
(cd dist && sha256sum -c SHA256SUMS)
- name: Run the live protocol suite against the packed executable
env:
BITTY_STORAGE_COMPONENT_BIN: ${{ github.workspace }}/dist/smoke/bitty-storage
run: cargo test --test component_server --locked
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: storage-component-linux-x86_64
path: |
dist/*.tar.gz
dist/*.sha256
dist/SHA256SUMS
if-no-files-found: error
retention-days: 7
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
Metadata-only candidate; no product migration authorized. Read repo.toml, TODO, CarryCtx and shared security corpus. W-131 must separate transcript, command history, session snapshots and sandboxed plugin KV. No generic database, arbitrary filesystem authority or default raw stdout persistence. Terminal Truth remains volatile and Core-owned. Require opt-in capture, isolation, retention/deletion, secret minimization, recovery and bounded schemas.

English only; no hardcoded host values. Rust starts 0.0.1, edition 2024, Core MSRV. Run just gates; metadata checks are not product evidence. CTX-0001 -> 0002 -> 0003 -> 0004 orders bootstrap, contracts, implementation, independent verification. Named sessions, narrowed scopes, task worktrees after first commit; managed hooks required. Direct bootstrap is authorized, not independent acceptance. No commit/push/release without authority; publish redacted snapshots only. Preserve unrelated work; no silent installs, destructive cleanup or unowned process kills. Record negative tests and canonical docs synchronization.

Executable component boundary (CTX-0008, bitty#2495): the `storage` component is a stdio coprocess around journaled namespaces, not a second database. Preserve protocol v1 framing and bounds, atomic journal-before-snapshot commits, previous-revision rollback semantics, and the rule that the wire carries namespaces/keys/values but never a filesystem path. The host chooses the root at spawn time and owns installation, digest verification, capability grants, consent, safe-mode denial, XDG migration, and restore re-derivation; the component commits exactly the batch it is handed. On Linux/Android state operations must stay directory-fd anchored (`openat`/`renameat`/`unlinkat`) with `O_NOFOLLOW` final components and `O_CREAT|O_EXCL` temps; never reintroduce path-based state access, symlink following, or a non-Linux fallback. Do not add an installer, download source, catalog row, or Core dependency here. `just component-package` builds and packs locally; no tag or R2 upload belongs to this task.
59 changes: 59 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ publish = false
name = "bitty_storage"
path = "src/lib.rs"

[[bin]]
name = "bitty-storage"
path = "src/bin/bitty-storage.rs"

[lints.rust]
unsafe_code = "forbid"

[lints.clippy]
all = { level = "warn", priority = -1 }

# Namespace locks are OS advisory `flock`s, safe API only (no `unsafe`).
# Same platform split as the Core/execution claim lock; the Linux x86_64
# component is the packaged target for this task.
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
rustix = { version = "1.1.4", default-features = false, features = ["fs", "std"] }
Loading
Loading