Skip to content

Commit e319f1b

Browse files
Add dsfb-debug crate
1 parent 8824f37 commit e319f1b

121 files changed

Lines changed: 37544 additions & 0 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.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# DSFB-Debug — cargo-mutants configuration.
2+
#
3+
# Mutation testing focuses on the modules whose correctness the paper
4+
# makes load-bearing claims about: grammar evaluation (§5.5),
5+
# policy mapping (§5), and episode aggregation (§7 — Trace Event
6+
# Collapse). A mutation in any of these that is NOT killed by the test
7+
# suite is a signal that the test suite under-specifies the module.
8+
#
9+
# Run:
10+
# cargo mutants --manifest-path crates/dsfb-debug/Cargo.toml --in-place
11+
#
12+
# Tier-1 modules (must have ≥ 80% mutation kill-rate before paper goes
13+
# out): grammar.rs, policy.rs, episode.rs.
14+
# Tier-2 (target ≥ 60%): sign.rs, dsa.rs, baseline.rs.
15+
# Tier-3 (best-effort): heuristics_bank.rs, residual.rs, envelope.rs.
16+
17+
# Examine only the load-bearing modules first; the const constructors in
18+
# adapters/ and lib.rs internal scaffolding produce noisy mutants.
19+
examine_globs = [
20+
"src/grammar.rs",
21+
"src/policy.rs",
22+
"src/episode.rs",
23+
"src/sign.rs",
24+
"src/dsa.rs",
25+
"src/baseline.rs",
26+
"src/heuristics_bank.rs",
27+
"src/residual.rs",
28+
"src/envelope.rs",
29+
]
30+
31+
# The test command must fire both the no_std unit tests and the std-side
32+
# fixture-aware tests so paper-lock invariants are exercised.
33+
test_tool = "cargo"
34+
additional_cargo_test_args = ["--features", "std paper-lock"]
35+
36+
# Timeout safety: the no_std core is tiny, but mutation runs are slow.
37+
timeout_multiplier = 2.0
38+
39+
# Skip mutants that target trivial scaffolding the paper does not
40+
# claim correctness for.
41+
skip_calls = ["dbg!"]

crates/dsfb-debug/.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
target/
2+
target-local/
3+
artifacts/
4+
data/upstream/
5+
*.zip
6+
*.tar.gz
7+
*.log
8+
*.aux
9+
*.out
10+
*.toc
11+
build/
12+
.cargo/

crates/dsfb-debug/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build artefacts (also covered by parent .gitignore but listed for
2+
# standalone-workspace clarity).
3+
target/
4+
Cargo.lock.bak
5+
6+
# Upstream archives — these are large and DOI-pinned externally; we
7+
# store SHA-256 manifests in `data/MANIFEST.toml` and the projected
8+
# slices in `data/fixtures/`. The raw upstream archives stay local.
9+
data/upstream/
10+
11+
# Paper source and build artefacts stay local unless explicitly requested.
12+
paper/
13+
14+
# Generated demo/report bundles.
15+
output-dsfb-debug/
16+
17+
# Misc local-only.
18+
*.swp
19+
.DS_Store
20+
*.zip
21+
*.tar.gz

crates/dsfb-debug/Cargo.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[package]
2+
name = "dsfb-debug"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["Riaan de Beer <riaan@invariantforge.net>"]
6+
license = "Apache-2.0"
7+
description = """
8+
DSFB-Debug — Structural Semiotics Engine for Software Debugging.
9+
A deterministic, read-only, observer-only augmentation layer for
10+
execution-trace residual interpretation. Does NOT replace existing
11+
observability tools — augments them with typed structural interpretation.
12+
"""
13+
repository = "https://github.com/infinityabundance/dsfb"
14+
keywords = ["debugging", "observability", "deterministic", "semiotics", "tracing"]
15+
categories = ["no-std", "science", "algorithms"]
16+
rust-version = "1.75.0"
17+
18+
[features]
19+
default = []
20+
# paper-lock: gates the real-dataset evaluation API (`evaluate_real_dataset`).
21+
# Without this feature the std-only real-data path is physically absent from
22+
# the compiled artefact, preserving the no_std/no_alloc default build.
23+
paper-lock = ["std"]
24+
# std: enables the std-only adapter, hash-verification, and real-dataset entry
25+
# points. The no_std core (residual/sign/grammar/policy/episode pipeline)
26+
# remains identical regardless of this feature.
27+
std = []
28+
# demo: opt-in feature for the `dsfb-debug-demo` binary. Pulls in plotters /
29+
# printpdf / zip / chrono crates ONLY when this feature is requested. The
30+
# zero-dep no_std core is unaffected; default `cargo install` pulls nothing.
31+
# Reviewers reproducing the published figures use:
32+
# cargo install --path . --features demo
33+
# dsfb-debug-demo
34+
demo = ["std", "paper-lock", "dep:plotters", "dep:zip"]
35+
36+
[dependencies]
37+
# Core crate has zero runtime dependencies — pure no_std, no_alloc.
38+
# SHA-256 and TSV parsing are hand-rolled in `src/adapters/`.
39+
# The optional dependencies below are gated behind the `demo` feature
40+
# and never enter the no_std/no_alloc core build.
41+
plotters = { version = "0.3", optional = true, default-features = false, features = ["bitmap_backend", "bitmap_encoder", "ttf", "all_series", "all_elements", "full_palette"] }
42+
zip = { version = "0.6", optional = true, default-features = false, features = ["deflate"] }
43+
44+
[[bin]]
45+
name = "dsfb-debug-demo"
46+
path = "src/bin/dsfb_debug_demo.rs"
47+
required-features = ["demo"]
48+
49+
[dev-dependencies]
50+
51+
# Detached from the parent workspace at /home/one/dsfb/Cargo.toml so the
52+
# crate can be built / tested standalone after the folder rename. Remove
53+
# this block once the parent manifest's `workspace.members` is updated
54+
# to point at `crates/dsfb-debug`.
55+
[workspace]

crates/dsfb-debug/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# DSFB-Debug — reviewer reproducibility container (Phase η.8, Session 18).
2+
#
3+
# One-command boot of the entire DSFB-Debug verification chain on a
4+
# clean machine. From a fresh checkout:
5+
#
6+
# docker build -t dsfb-debug:reviewer .
7+
# docker run --rm dsfb-debug:reviewer
8+
#
9+
# Default CMD runs `cargo test --features "std paper-lock" -- --nocapture`
10+
# which fires every per-fixture eval test, the LO-CV harness, the
11+
# sensitivity sweep, the axis ablation, the detector subset opt, the
12+
# timing benchmark, and the property-test suite end-to-end.
13+
#
14+
# Pinned to rust:1.75-bookworm to match the rust-toolchain.toml MSRV.
15+
# No Cargo runtime dependencies in the no_std core; the demo feature
16+
# adds plotters + zip; both vendored via cargo's own resolution.
17+
#
18+
# Theorem 9 deterministic replay verified inside every test invoked
19+
# by the default CMD; reproducibility is byte-identical across
20+
# reviewer machines that match the rust:1.75-bookworm digest.
21+
22+
FROM rust:1.75-bookworm
23+
24+
WORKDIR /work/dsfb-debug
25+
26+
# Bring source tree in. .dockerignore should exclude target/ +
27+
# build artefacts; reviewers running `docker build` get a clean
28+
# build from source.
29+
COPY . .
30+
31+
# Pre-fetch dependencies + build the crate so first `docker run`
32+
# is snappy. Build with full features so the LO-CV harness +
33+
# audit modules are wired.
34+
RUN cargo build --features "std paper-lock"
35+
36+
# Default verification chain. Re-runs every fixture eval + LO-CV
37+
# + sensitivity + ablation + subset opt + timing + property tests.
38+
# Output is the verbatim test stdout reviewers should match against
39+
# the published audit ledgers in docs/audit/.
40+
CMD ["cargo", "test", "--features", "std paper-lock", "--", "--nocapture"]

0 commit comments

Comments
 (0)