Skip to content

refactor: split keep into the shared saas-service skeleton - #7

Merged
chrischeng-c4 merged 1 commit into
mainfrom
refactor/saas-service-skeleton
Oct 23, 2026
Merged

chrischeng-c4 merged 1 commit into
mainfrom
refactor/saas-service-skeleton

Conversation

@chrischeng-c4

Copy link
Copy Markdown
Contributor

What

Move keep to the shared saas-service skeleton (aw standard S5, faberline/aw#64). One package per context:

Package Was Holds
keep keep assembly: the keep binary, the facade library, integration tests, benches
keep-shared-kernel keep-core value types, errors, cluster topology, metrics, TLS helpers
keep-storage part of keep-engine on-disk format, WAL, blob store, persistence settings
keep-keyspace keep-engine the KV engine, with its snapshot, recovery and persistence handle
keep-replication part of keep-engine raft per-shard hosts (feature raft), backup and restore
keep-access part of keep-http bearer-token auth over service-auth
keep-commands keep-http the HTTP/h2c + OpenAPI surface, spec emitters
keep-operator, keep-client same unchanged, now use keep-shared-kernel

The storage split has no cycle: keep-storage holds only the on-disk primitives. The engine-aware snapshot and recovery stay in keep-keyspace.

The keep facade re-exports the old paths (keep::engine, keep::persistence, keep::http, keep::raft, ...). Callers do not change.

Also

  • ddd.toml with the canonical policy, report only (enforce = false).
  • aw.toml: kind = "saas-service", and an SV7 exception for k8s/overlays/gke-test (it lands in feat(gke-test): test keep on the shared faberline GKE cluster #6).
  • Workspace clippy lint mod_module_files = "deny".
  • build.rs uses core/build-stamp (core-reuse CR6).
  • keep-storage: fixed 4 clippy findings that the old crate-wide allow(clippy::all) hid.
  • README crate table.

Checks (local)

Check Result
cargo fmt --all -- --check pass
cargo clippy --workspace --all-targets [--all-features] -- -D warnings pass (both)
cargo test --workspace and --all-features pass
aw.scripts.saas_service check (S5) PASS, 1 exception (SV7)
aw.scripts.standards check (core-reuse) PASS
aw standards rust-arch check report only: 49 errors, 9 warnings (below)
verify-release-contract.py --app keep, --self-test; receipt --self-test pass

Follow-up (not in this PR)

rust-arch findings that keep had before this PR. The S5 move does not add them:

  • C2: keep-keyspace/src/engine.rs (3493 lines), keep/src/bin/keep.rs (1674), keep-commands/src/http/handlers.rs (1135).
  • B6: bin/keep.rs holds the CLI, not only fn main.
  • A1: integration tests not under tests/it/.
  • A5: docs/README.md, architecture.md, glossary.md, domain/, adr/, operations/ are missing.
  • B2: the shared kernel uses crc32fast, rust_decimal, rustls, utoipa.

When these are fixed, set enforce = true.

Do not merge yet: the five S5 PRs merge together.

🤖 Generated with Claude Code

Move keep to the aw S5 saas-service skeleton (one package per context):

- keep-core -> keep-shared-kernel (value types, errors, cluster topology,
  metrics, TLS helpers).
- keep-engine -> keep-keyspace (the KV engine with its engine-aware
  snapshot, recovery and persistence handle).
- New keep-storage: the on-disk record format, WAL, blob store and
  persistence settings, moved out of keep-engine/src/persistence. It has
  no engine types, so keyspace -> storage has no cycle.
- New keep-replication: raft.rs (feature "raft") and backup.rs.
- New keep-access: http/auth.rs.
- keep-http -> keep-commands (the HTTP/h2c + OpenAPI surface).

The `keep` facade re-exports the old module paths (keep::engine,
keep::persistence, keep::http, keep::raft, ...), so callers do not change.

Also:
- ddd.toml with the canonical policy, report only (enforce = false):
  engine.rs, bin/keep.rs and http/handlers.rs are over size_error.
- aw.toml: kind = "saas-service"; an SV7 exception for the gke-test
  overlay, which lands in keep#6.
- Workspace clippy lint mod_module_files = "deny".
- build.rs uses core/build-stamp (core-reuse CR6).
- keep-storage: fix the clippy findings the old crate-wide
  allow(clippy::all) hid (outer //! docs, WalHeader Default, a borrow).
- README crate table.
@chrischeng-c4
chrischeng-c4 merged commit 90e551c into main Oct 23, 2026
chrischeng-c4 added a commit to faberline/aw that referenced this pull request Oct 23, 2026
…itory (#65)

The status table in docs/standards/saas-service.md names the S5 pull
request for each saas-service repository: faberline/tape#29,
faberline/defer#29, faberline/relay#57, faberline/lumen#159, #160 and #161,
and faberline/keep#7. All of them merged on 2026-10-23. The one exception
left is keep's SV7, until faberline/keep#6.
chrischeng-c4 added a commit that referenced this pull request Oct 23, 2026
…a035

* commit '90e551c939bbbfdfe78a8f19ba4bf9947a63aaea':
  refactor: split keep into the shared saas-service skeleton (#7)

# Conflicts:
#	Cargo.lock
#	crates/keep-commands/src/http.rs
#	crates/keep-http/src/lib.rs
#	crates/keep-keyspace/Cargo.toml
#	crates/keep-keyspace/src/lib.rs
#	crates/keep-replication/src/raft.rs
#	crates/keep/src/lib.rs
chrischeng-c4 added a commit that referenced this pull request Oct 23, 2026
…etry

* commit '90e551c939bbbfdfe78a8f19ba4bf9947a63aaea':
  refactor: split keep into the shared saas-service skeleton (#7)

# Conflicts:
#	Cargo.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant