Skip to content

Commit a8bd85a

Browse files
committed
Merge branch 'crucible-audit-plan' into main
2 parents d7bf2d7 + 312ff5f commit a8bd85a

File tree

30 files changed

+2376
-686
lines changed

30 files changed

+2376
-686
lines changed

.cargo/config.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
# =============================================================================
1212

1313
[build]
14-
# Target directory - use ~/Library/Caches for macOS (stable, avoids iCloud sync)
15-
# /tmp can be cleaned by macOS or cause race conditions with concurrent builds
16-
# Windows users: set CARGO_TARGET_DIR=C:\rust-target\uffs environment variable
17-
target-dir = "~/Library/Caches/uffs/target"
14+
# Keep the checked-in target directory deterministic for artifact discovery.
15+
# Cargo config paths are config-relative, so `~/...` becomes `<workspace>/~/...`
16+
# instead of expanding to $HOME. Use an explicit CARGO_TARGET_DIR environment
17+
# variable locally if you want to place artifacts in an external cache.
18+
# Windows users can set: CARGO_TARGET_DIR=C:\rust-target\uffs
19+
target-dir = "target"
1820

1921
# sccache for compilation caching (significant speedup on rebuilds)
2022
rustc-wrapper = "sccache"

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
uses: Swatinem/rust-cache@v2
7373

7474
- name: Run nightly clippy gate
75-
run: cargo clippy --workspace --exclude uffs-legacy --all-targets --all-features --no-deps -- -D warnings
75+
run: cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
7676

7777
tests:
7878
name: Tier 1 / Tests
@@ -92,10 +92,10 @@ jobs:
9292
uses: taiki-e/install-action@nextest
9393

9494
- name: Run tests
95-
run: cargo nextest run --workspace --exclude uffs-legacy --all-features --lib --bins --tests
95+
run: cargo nextest run --workspace --all-features --lib --bins --tests
9696

9797
- name: Run doc tests
98-
run: RUSTDOCFLAGS="-Dwarnings" cargo test --doc --workspace --exclude uffs-legacy --all-features
98+
run: RUSTDOCFLAGS="-Dwarnings" cargo test --doc --workspace --all-features
9999

100100
security:
101101
name: Tier 1 / Security

INTENT_PROMPT.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Elevate this Rust workspace from a functional but organically-grown codebase to
2323
**Forbidden** (must be removed/rewritten):
2424
- References to the C++ implementation, porting, parity, or comparison (comments, docs, identifiers, scripts)
2525
- `cpp_*` modules, identifiers, and file prefixes in code (`cpp_types.rs`, `cpp_tree.rs`, `cpp_io_pipeline.rs`)
26-
- `crates/uffs-legacy/` (dead C++ port reference crate)
26+
- The obsolete legacy reference crate formerly kept under `crates/`
2727
- `CPP_*.md` docs and any docs whose primary purpose is C++ porting/comparison
2828
- C++ comparison/analysis scripts (`analyze_cpp_stats.rs`, etc.)
2929
- C++ parity/comparison tests (keep the underlying logic tests but reframe as Rust correctness tests)
@@ -36,7 +36,7 @@ Elevate this Rust workspace from a functional but organically-grown codebase to
3636
**Specific files requiring rewrite (not just deletion):**
3737
- **`README.md`** — Remove "Rust rewrite of UFFS, replacing the original C++ version" and "inspired by the original C++ UFFS" phrasing; describe UFFS on its own merits
3838
- **`crates/uffs-mft/README.md`** — Remove "Rust vs C++" performance tables and "faster than the C++ implementation" language; replace with benchmarks against golden baseline or prior UFFS versions (e.g., "v0.1.30 baseline")
39-
- **`CLAUDE.md`** — Remove `uffs-legacy` reference and `cpp_comparison` test references
39+
- **`CLAUDE.md`** — Remove obsolete legacy-crate references and `cpp_comparison` test references
4040
- **`.gitignore`** — Remove any "legacy C++" comments
4141
- **`scripts/verify_parity.rs`** — Rename `cpp_file``baseline_file`, rewrite header/messages to use "golden baseline" terminology (this script is the Validation Agent and must be modernized in Phase 1, before DoD checks can pass)
4242
- **CI workflow comments** and **script help text** — Remove C++ implementation references
@@ -102,7 +102,7 @@ These constraints help the Coordinator avoid merge conflicts when assigning para
102102
Augment supports repo-stored rules in `.augment/rules/` and hierarchical `AGENTS.md` / `CLAUDE.md`. These have **length limits** — they're designed for short, high-leverage constraints, not full specs. Split the material:
103103

104104
- **`.augment/rules/forge.md`** (Always-included, short): Non-negotiables only — no C++ port references, spec-first workflow, perf non-regression, no blanket `#[allow]`, `forge:` commit prefix, nightly-only
105-
- **`CLAUDE.md`** (root): Update to remove `uffs-legacy` and `cpp_comparison` references; add a pointer to `.augment/rules/forge.md` for FORGE-specific rules
105+
- **`CLAUDE.md`** (root): Update to remove obsolete legacy-crate references and `cpp_comparison` references; add a pointer to `.augment/rules/forge.md` for FORGE-specific rules
106106
- **This document** (`INTENT_PROMPT.md` → later `docs/architecture/FORGE_SPEC.md`): The full living spec with decomposition plans, DoD commands, idiom tables, etc. — referenced by agents but not always-included in context
107107

108108
---
@@ -117,7 +117,7 @@ Cargo workspace (resolver = "2", edition = "2024", rust-version = "1.85")
117117
├── crates/uffs-cli/ — CLI binary on clap (~3.6K lines)
118118
├── crates/uffs-tui/ — Terminal UI on ratatui (~700 lines)
119119
├── crates/uffs-gui/ — Placeholder (~200 lines)
120-
├── crates/uffs-legacy/ — Dead legacy C++ port reference (TO BE REMOVED)
120+
├── [obsolete legacy crate] — Dead C++ port reference (TO BE REMOVED)
121121
├── crates/uffs-diag/ — Diagnostic binaries ("temporarily enabled" since Jan 2026)
122122
├── vendor/ — Disabled patches kept "for reference"
123123
├── scripts/ — 11 rust-script utilities
@@ -169,7 +169,7 @@ This should be split into focused crates or at minimum well-separated internal m
169169

170170
### 3. DEAD WEIGHT IN THE WORKSPACE
171171

172-
- **`crates/uffs-legacy/`** — "Reference only, do not modify" but still compiled as workspace member
172+
- **Obsolete legacy reference crate** — "Reference only, do not modify" but still compiled as workspace member
173173
- **`crates/uffs-diag/`** — "Temporarily enabled" since January 2026 (2+ months)
174174
- **`vendor/`** — Disabled patches with a comment saying "kept for reference"
175175
- **`dist/`** — 29GB of build artifacts (keep latest 2 in git for CI/scripts; keep all locally for rollback — offline scripts rely on these to locate current relevant artifacts)
@@ -195,7 +195,7 @@ This should be split into focused crates or at minimum well-separated internal m
195195
- `dirs-next` — ✅ correct choice (per RUSTSEC-2020-0053, `dirs` is unmaintained; `dirs-next` is the maintained fork)
196196
- `hostname` crate at 0.4.2 — check if still maintained
197197
- `log` + `simplelog`**remove both**, standardize entirely on `tracing` + `tracing-subscriber` (the modern choice)
198-
- `colored` 3.x — **remove**: only used in `uffs-legacy` (being deleted), zero usage in active crates
198+
- `colored` 3.x — **remove**: only used in the obsolete legacy reference crate, zero usage in active crates
199199

200200
### 6. POLARS FEATURE AUDIT (Selective, Not Aggressive)
201201

@@ -267,7 +267,7 @@ The repo root is cluttered with files and directories that don't belong there:
267267
| `missing_paths.txt` | Test output data from a Windows drive — not source code |
268268
| `LOG/` (48 files) | Changelog-healing session logs — valuable history but not tracked source |
269269
| `vendor/` | Disabled patches "kept for reference" — no longer active |
270-
| `crates/uffs-legacy/` | Dead C++ port reference |
270+
| Obsolete legacy reference crate | Dead C++ port reference |
271271
| `benchmarks/` | Empty (just `.gitkeep`) — remove placeholder or populate |
272272
| C++ scripts in `scripts/` | `analyze_cpp_stats.rs`, `analyze_trial_parity.rs`, `analyze_parity_differences.*`, `compare_outputs.py` (NOTE: **keep** `verify_parity.rs` — it's the Validation Agent, just modernize its C++ terminology) |
273273

@@ -379,7 +379,7 @@ uffs-cli/src/commands/
379379

380380
### Crate Restructuring
381381

382-
1. **Move `uffs-legacy` and `uffs-diag` out of workspace members** — use `exclude` or move to a separate `tools/` directory
382+
1. **Remove the obsolete legacy reference crate and move `uffs-diag` out of workspace members** — use `exclude` or move tools to a separate directory
383383
2. **Consider extracting `uffs-mft-index`** as a separate crate if the index grows further
384384
3. **Remove `vendor/`** entirely or move to `.gitignore`-d location
385385
4. **Clean `dist/`** — keep latest 2 artifacts in git for CI/scripts; gitignore the rest
@@ -393,13 +393,14 @@ uffs-cli/src/commands/
393393
**Tier 1 — Always on PR (must pass to merge):**
394394
1. **Format check**`cargo +nightly fmt --check`
395395
2. **Clippy**`cargo +nightly clippy --workspace --all-targets -- -D warnings` (use `cargo check` for Polars-heavy crates if clippy OOMs)
396-
3. **Tests**`cargo +nightly nextest run --workspace` (exclude integration tests that require Windows/MFT)
396+
3. **Tests**`cargo +nightly nextest run --workspace --all-features --lib --bins --tests` (exclude only tests that truly require Windows/MFT)
397397
4. **Security**`cargo audit` + `cargo deny check`
398398

399399
**Tier 2 — Scheduled / manual trigger (weekly + on-demand):**
400-
5. **Full build**Use a larger runner, `sccache` with S3 backend, or pre-build Polars in a Docker image cached in GHCR
400+
5. **Full build**`cargo build --release -p uffs-cli --bin uffs` (use a larger runner, `sccache` with S3 backend, or pre-build Polars in a Docker image cached in GHCR)
401401
6. **Coverage**`cargo +nightly llvm-cov` with Codecov upload
402-
7. **Cross-compile check**`cargo +nightly check --target x86_64-pc-windows-msvc`
402+
7. **Cross-compile check**`cargo xwin check -p uffs-mft --lib --bin uffs_mft`
403+
8. **Windows regression**`cargo test -p uffs-mft --bin uffs_mft required_output_path`
403404

404405
**Acceptance criteria:** Tier 1 must be green on every PR. Tier 2 must be green before FORGE merge to main. Both tiers are non-negotiable for the final merge.
405406

@@ -411,7 +412,7 @@ uffs-cli/src/commands/
411412
| `async-trait` | Remove **if** all async traits are used generically (no `dyn Trait`). If any async traits require trait objects, keep `async-trait` and document why — native `async fn in trait` (Rust 1.75+) doesn't support `dyn` dispatch |
412413
| `async-recursion` | Evaluate if still needed with `Box::pin` |
413414
| `log` + `simplelog` | **Remove both** — standardize on `tracing` ecosystem |
414-
| `colored` | **Remove** — only used in `uffs-legacy` (being deleted) |
415+
| `colored` | **Remove** — only used in the obsolete legacy reference crate |
415416
| `dirs-next` | ✅ Keep (correct maintained fork per RUSTSEC-2020-0053) |
416417
| `hostname` 0.4.2 | Check maintenance status, consider `gethostname` |
417418
| Polars features | Selective audit only — keep SQL, analytics, I/O features for MCP/query vision; remove only clearly irrelevant financial features |
@@ -485,7 +486,7 @@ Any refactoring must include before/after benchmarks proving no regression.
485486
## Execution Strategy
486487

487488
### Phase 1: Cleanup & Hygiene (Week 1)
488-
- **Delete all C++ traces**: Remove `cpp_types.rs`, `cpp_tree.rs`, `cpp_io_pipeline.rs` (extract any still-needed logic into idiomatic Rust first). Remove `crates/uffs-legacy/` from workspace. Delete C++ comparison scripts and C++ porting docs (`docs/architecture/CPP_*.md`)
489+
- **Delete all C++ traces**: Remove `cpp_types.rs`, `cpp_tree.rs`, `cpp_io_pipeline.rs` (extract any still-needed logic into idiomatic Rust first). Remove the obsolete legacy reference crate from the workspace. Delete C++ comparison scripts and C++ porting docs (`docs/architecture/CPP_*.md`)
489490
- **Modernize `verify_parity.rs` terminology** — rename `cpp_file``baseline_file`, rewrite header/messages to use "golden baseline" language. This must happen in Phase 1 because the DoD grep checks cannot pass until this script is cleaned
490491
- **Rewrite READMEs** — remove C++ implementation references from `README.md`, `crates/uffs-mft/README.md`, `CLAUDE.md`, `.gitignore`
491492
- Remove/archive dead weight (`vendor/`, trim `docs/`, manage `dist/` retention policy) — use `cp``_trash/` then `git rm`, never `git mv`
@@ -555,12 +556,15 @@ Every criterion below must pass before FORGE can be declared complete. These are
555556
```bash
556557
cargo +nightly fmt --check # Clean formatting
557558
cargo +nightly clippy --workspace --all-targets -- -D warnings # Zero warnings
558-
cargo +nightly test --workspace # All tests pass (or: cargo nextest run --workspace)
559+
cargo +nightly nextest run --workspace --all-features --lib --bins --tests # Canon test sweep
559560
RUSTDOCFLAGS="-D warnings" cargo +nightly doc --workspace --no-deps # Docs build — warnings are fatal
560561
```
561562

562563
**Validation gate:**
563564
```bash
565+
cargo build --release -p uffs-cli --bin uffs # Release CLI build succeeds
566+
cargo xwin check -p uffs-mft --lib --bin uffs_mft # Windows-targeted MFT target checks
567+
cargo test -p uffs-mft --bin uffs_mft required_output_path # Required output path regression passes
564568
rust-script scripts/verify_parity.rs /Users/rnio/uffs_data D --regenerate # SHA256 MATCH
565569
```
566570

@@ -590,7 +594,6 @@ rg -n -S -g'*.rs' '\bcpp_[A-Za-z0-9_]*\b' crates/ scripts/ \
590594

591595
# Confirm deleted files/crates are gone
592596
ls crates/uffs-mft/src/cpp_*.rs 2>/dev/null && exit 1 || true # Should not exist
593-
ls crates/uffs-legacy/ 2>/dev/null && exit 1 || true # Should not exist
594597
```
595598

596599
**Dependency purge (direct deps only — transitive deps from other crates are acceptable):**

LOG/CHANGELOG_HEALING_CRUCIBLE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# CHANGELOG_HEALING_CRUCIBLE
2+
3+
## Scope
4+
5+
Created the Wave 1D CRUCIBLE audit artifacts and recorded the validated documentation baseline.
6+
7+
## Added
8+
9+
- `docs/ARCHITECTURE.md`
10+
- `docs/PERFORMANCE.md`
11+
- `docs/RISKS.md`
12+
- `LOG/CHANGELOG_HEALING_CRUCIBLE.md`
13+
- Minimal discoverability links from `docs/README.md`
14+
15+
## Baseline captured
16+
17+
- Repository-wide cleanup of retired legacy naming is verified complete.
18+
- Validation canon alignment is verified.
19+
- Wave 1C parity artifact resolution is verified.
20+
- The `required_output_path` regression test remains in the canon but is currently blocked by host disk pressure rather than a confirmed code regression.
21+
22+
## External blocker carried forward
23+
24+
- Command: `cargo test -p uffs-mft --bin uffs_mft required_output_path`
25+
- Current blocker: `No space left on device` (`os error 28`)
26+
- Disposition: carry forward as an environment blocker and rerun once disk capacity is restored.
27+
28+
## Notes
29+
30+
- No source code or dependency changes were made in this task.
31+
- No commit or push was performed.

0 commit comments

Comments
 (0)