Skip to content

Commit f42dbaf

Browse files
committed
feat: consolidate saorsa-core and saorsa-transport into workspace
Move saorsa-core and saorsa-transport into crates/ as workspace members. All dependencies now use path references instead of fragile git URLs, branch names, or commit hashes. Cleaned up ~100 non-source files: AI planning artifacts, saved test outputs, Go legacy files, orphaned scripts. 492 ant-node tests pass.
1 parent be00f7c commit f42dbaf

485 files changed

Lines changed: 239191 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 590 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
[workspace]
2+
members = [
3+
".",
4+
"crates/saorsa-core",
5+
"crates/saorsa-transport",
6+
"crates/saorsa-transport/saorsa-transport-workspace-hack",
7+
]
8+
resolver = "2"
9+
110
[package]
211
name = "ant-node"
312
version = "0.10.0-rc.1"
@@ -24,7 +33,7 @@ path = "src/bin/ant-devnet/main.rs"
2433

2534
[dependencies]
2635
# Core (provides EVERYTHING: networking, DHT, security, trust, storage)
27-
saorsa-core = "0.22.0"
36+
saorsa-core = { path = "crates/saorsa-core" }
2837
saorsa-pqc = "0.5"
2938

3039
# Payment verification - autonomi network lookup + EVM payment

crates/saorsa-core/.clippy.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Clippy configuration aligned with repo policy
2+
3+
# Tests may use unwrap/expect/panic for clarity and speed
4+
allow-unwrap-in-tests = true
5+
allow-expect-in-tests = true
6+
allow-panic-in-tests = true
7+
8+
# Pedantic is not required to be zero; CI enforces only critical lints via flags
9+
10+
# Reasonable thresholds for noise control
11+
cognitive-complexity-threshold = 30
12+
too-many-arguments-threshold = 10
13+
type-complexity-threshold = 250

crates/saorsa-core/.cursorrules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

crates/saorsa-core/.cursorules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

crates/saorsa-core/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Rust
2+
/target/
3+
**/*.rs.bk
4+
*.pdb
5+
.cargo/config.toml
6+
7+
# IDE
8+
.vscode/
9+
.idea/
10+
*.swp
11+
*.swo
12+
*~
13+
14+
# OS
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Logs
19+
*.log
20+
21+
# Coverage
22+
lcov.info
23+
coverage/
24+
25+
# Benchmark results
26+
criterion/
27+
28+
# Local config
29+
.env
30+
.env.local
31+
patches/
32+
33+
# Tool state
34+
.serena/
35+
.claude/tasks/
36+
.claude/plans/
37+
.cache/

crates/saorsa-core/ARCHITECTURE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Architecture Overview
2+
3+
This repository is a Rust library crate that provides a modular, post‑quantum secure P2P foundation. It favors clear boundaries, strict linting (no panics in lib code), and testable components.
4+
5+
## Goals & Scope
6+
- Reliable QUIC transport, DHT routing, and dual‑stack endpoints (IPv6 + IPv4).
7+
- Strong security defaults using saorsa‑pqc, safe memory, and validation.
8+
- Extensible higher‑level applications live above this crate (saorsa-node).
9+
10+
## Layered Architecture
11+
- Transport & Networking: `transport/`, `network/` (QUIC, NAT traversal, events, dual‑stack listeners, Happy Eyeballs dialing).
12+
- Routing & Discovery: `dht/`, `dht_network_manager/`, `peer_record/`.
13+
- Security: `quantum_crypto/`, `security.rs`.
14+
- Trust: `adaptive/` (response-rate scoring with time decay, binary peer blocking).
15+
- Application Modules: provided by upper layers (not in this crate).
16+
- Cross‑cutting: `validation.rs`, `config.rs`, `error.rs`.
17+
18+
## Module Map (selected)
19+
- Core exports live in `src/lib.rs`; add new modules there and keep names `snake_case`.
20+
- PQC: `quantum_crypto/` exports saorsa‑pqc types and compatibility shims.
21+
22+
## Data Flow
23+
```
24+
[Upper-layer apps (saorsa-node)]
25+
| commands/events
26+
v
27+
[network] <-> [dht_network_manager] <-> [dht]
28+
| ^
29+
[transport (QUIC)] [adaptive]
30+
^ (trust scoring,
31+
[validation|security] peer blocking)
32+
```
33+
34+
saorsa-core is a peer phonebook with trust enforcement: it handles peer discovery,
35+
response-rate trust scoring with time decay, and binary peer blocking. Application
36+
data storage and replication are handled by saorsa-node via `send_message`-style APIs.
37+
38+
## Concurrency & Errors
39+
- Async with `tokio`; prefer `Send + Sync` types and bounded channels where applicable.
40+
- Errors use `thiserror`/`anyhow` in tests; return precise errors in library code.
41+
- Logging with `tracing`; avoid `unwrap/expect/panic` in lib paths (CI enforces).
42+
43+
## Observability & Testing
44+
- Tests: unit tests in modules (`#[cfg(test)]` blocks).
45+
46+
## Build Targets
47+
- Library only.
48+
- Use `./scripts/local_ci.sh` to run a safe, end‑to‑end local CI.

0 commit comments

Comments
 (0)