Skip to content

Commit b9e788e

Browse files
committed
feat(workspace): add xtask + fuzz + ClusterFuzzLite from WP-edition fork
Brings the WordPress-edition fork's workspace shape into the canonical repo. The WP-edition was developed in-tree under repos-monorepo/document-management-toolset/wordpress-tools/project-wharf/ and is now graduating back to the standalone. - Cargo.toml: add xtask workspace member; exclude fuzz/ from default build - Cargo.lock: synced (includes new deps for xtask + fuzz dependencies) - .cargo/config.toml: pinned cargo settings - xtask/: build-automation crate (`cargo xtask build-ebpf`, etc.) - fuzz/: cargo fuzz targets (sql_policy, integrity) - .clusterfuzzlite/: OSS-Fuzz / ClusterFuzzLite CI integration Per the 2026-04-26 graduation plan (AI-WORK-todo.md item -4).
1 parent 60184c3 commit b9e788e

10 files changed

Lines changed: 388 additions & 7 deletions

File tree

.cargo/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
4+
# Cargo configuration for Project Wharf
5+
6+
[alias]
7+
# Run xtask commands (e.g., cargo xtask build-ebpf)
8+
xtask = "run --package xtask --"
9+
10+
# Build everything including eBPF
11+
build-all = "xtask build-all"
12+
13+
# eBPF-specific target configuration
14+
[target.bpfel-unknown-none]
15+
rustflags = ["-C", "link-arg=--btf"]

.clusterfuzzlite/Containerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: PMPL-1.0
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
#
4+
# ClusterFuzzLite Dockerfile for Rust fuzzing
5+
6+
FROM gcr.io/oss-fuzz-base/base-builder-rust
7+
8+
COPY . $SRC/project-wharf
9+
WORKDIR $SRC/project-wharf
10+
11+
COPY .clusterfuzzlite/build.sh $SRC/

.clusterfuzzlite/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -eu
2+
# SPDX-License-Identifier: PMPL-1.0
3+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
4+
#
5+
# ClusterFuzzLite build script for Rust fuzzing
6+
7+
cd "$SRC"/project-wharf
8+
9+
# Install nightly for fuzzing
10+
rustup install nightly
11+
rustup default nightly
12+
13+
# Build fuzz targets
14+
cargo +nightly fuzz build
15+
16+
# Copy fuzz targets to output
17+
for target in fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_*; do
18+
if [ -f "$target" ] && [ -x "$target" ]; then
19+
cp "$target" $OUT/
20+
fi
21+
done

.clusterfuzzlite/project.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
#
4+
# ClusterFuzzLite project configuration
5+
6+
language: rust

Cargo.toml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ members = [
33
"crates/wharf-core",
44
"bin/wharf-cli",
55
"bin/yacht-agent",
6+
"xtask",
67
]
78
# eBPF crate excluded from default build - requires special toolchain (bpf-linker)
8-
# Build separately with: cd crates/wharf-ebpf && cargo +nightly build --target bpfel-unknown-none
9-
exclude = ["crates/wharf-ebpf"]
9+
# Build with: cargo xtask build-ebpf
10+
# Or manually: cd crates/wharf-ebpf && cargo +nightly build --target bpfel-unknown-none -Z build-std=core
11+
exclude = ["crates/wharf-ebpf", "fuzz"]
1012
resolver = "2"
1113

1214
[workspace.package]
1315
version = "0.1.0"
1416
edition = "2021"
15-
authors = ["Jonathan D. A. Jewell <hyperpolymath>"]
16-
license = "MIT"
17+
authors = ["Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"]
18+
license = "PMPL-1.0"
1719
repository = "https://gitlab.com/hyperpolymath/wharf"
1820
description = "The Sovereign Web Hypervisor - Immutable CMS Infrastructure"
1921

2022
[workspace.dependencies]
2123
# CLI & Async
22-
clap = { version = "4.4", features = ["derive"] }
24+
clap = { version = "4.4", features = ["derive", "env"] }
2325
tokio = { version = "1", features = ["full"] }
2426

2527
# Configuration
@@ -35,17 +37,43 @@ sqlparser = "0.39"
3537
webauthn-rs = "0.4"
3638

3739
# Cryptography
38-
ed25519-dalek = "2.0"
3940
blake3 = "1.5"
4041
argon2 = "0.5"
4142

43+
# Post-Quantum Hybrid Signatures (FIPS 204 ML-DSA-87)
44+
pqcrypto-mldsa = "0.1"
45+
pqcrypto-traits = "0.3"
46+
47+
# Ed448 Goldilocks Curve (classical component of hybrid)
48+
ed448-goldilocks = { version = "0.14.0-pre.10", features = ["signing"] }
49+
50+
# SHAKE3/SHA3 (FIPS 202)
51+
sha3 = "0.10"
52+
53+
# XChaCha20-Poly1305 symmetric encryption
54+
chacha20poly1305 = "0.10"
55+
56+
# HKDF key derivation
57+
hkdf = "0.12"
58+
59+
# ChaCha20-based CSPRNG
60+
rand_chacha = "0.3"
61+
rand_core = { version = "0.6", features = ["std"] }
62+
63+
# HTTP client
64+
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
65+
66+
# Crypto utilities
67+
hex = "0.4"
68+
zeroize = { version = "1.7", features = ["derive"] }
69+
4270
# Networking
4371
trust-dns-client = "0.23"
4472
trust-dns-server = "0.23"
4573

4674
# Logging & Error Handling
4775
tracing = "0.1"
48-
tracing-subscriber = "0.3"
76+
tracing-subscriber = { version = "0.3", features = ["json"] }
4977
anyhow = "1.0"
5078
thiserror = "1.0"
5179

fuzz/Cargo.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
4+
[package]
5+
name = "project-wharf-fuzz"
6+
version = "0.0.0"
7+
publish = false
8+
edition = "2021"
9+
10+
[package.metadata]
11+
cargo-fuzz = true
12+
13+
[dependencies]
14+
libfuzzer-sys = "0.4"
15+
16+
[dependencies.wharf-core]
17+
path = "../crates/wharf-core"
18+
19+
[[bin]]
20+
name = "fuzz_sql_policy"
21+
path = "fuzz_targets/fuzz_sql_policy.rs"
22+
test = false
23+
doc = false
24+
bench = false
25+
26+
[[bin]]
27+
name = "fuzz_integrity"
28+
path = "fuzz_targets/fuzz_integrity.rs"
29+
test = false
30+
doc = false
31+
bench = false
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: PMPL-1.0
2+
// SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
//
4+
//! Fuzz target for integrity manifest parsing
5+
//! Tests handling of arbitrary manifest JSON input
6+
7+
#![no_main]
8+
9+
use libfuzzer_sys::fuzz_target;
10+
use wharf_core::integrity::Manifest;
11+
12+
fuzz_target!(|data: &[u8]| {
13+
// Try to interpret fuzzer input as JSON manifest
14+
if let Ok(json_str) = std::str::from_utf8(data) {
15+
// Attempt to deserialize - should handle any input gracefully
16+
let _: Result<Manifest, _> = serde_json::from_str(json_str);
17+
}
18+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// SPDX-License-Identifier: PMPL-1.0
2+
// SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
//
4+
//! Fuzz target for SQL policy engine
5+
//! Tests the PolicyEngine's ability to handle arbitrary SQL input
6+
7+
#![no_main]
8+
9+
use libfuzzer_sys::fuzz_target;
10+
use wharf_core::db_policy::{PolicyConfig, PolicyEngine, TableZone};
11+
12+
fuzz_target!(|data: &[u8]| {
13+
// Try to interpret fuzzer input as UTF-8 SQL
14+
if let Ok(sql) = std::str::from_utf8(data) {
15+
// Create a basic policy config for testing
16+
let config = PolicyConfig {
17+
mutable_tables: vec!["wp_comments".to_string(), "wp_posts".to_string()],
18+
immutable_tables: vec!["wp_users".to_string(), "wp_options".to_string()],
19+
hybrid_tables: vec![],
20+
default_zone: TableZone::Mutable,
21+
};
22+
23+
let engine = PolicyEngine::new(config);
24+
25+
// Fuzz the evaluate function - it should handle any input gracefully
26+
let _ = engine.evaluate(sql);
27+
}
28+
});

xtask/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2025 Jonathan D. A. Jewell <hyperpolymath>
3+
4+
[package]
5+
name = "xtask"
6+
version = "0.1.0"
7+
edition = "2021"
8+
publish = false
9+
10+
[dependencies]
11+
anyhow = "1.0"
12+
clap = { version = "4", features = ["derive"] }

0 commit comments

Comments
 (0)