Skip to content

feat(storage): add mango-storage skeleton with redb + raft-engine fork (ROADMAP:815)#49

Merged
humancto merged 3 commits into
mainfrom
feat/mango-storage-skeleton
Apr 24, 2026
Merged

feat(storage): add mango-storage skeleton with redb + raft-engine fork (ROADMAP:815)#49
humancto merged 3 commits into
mainfrom
feat/mango-storage-skeleton

Conversation

@humancto
Copy link
Copy Markdown
Owner

Summary

Closes ROADMAP:815 — the Phase 1 crates/mango-storage skeleton. Scaffolding only: no trait definitions yet (that's ROADMAP:816's own PR), no impls. The purpose of this PR is to prove the two load-bearing Phase 1 deps (redb and the humancto/raft-engine fork) integrate cleanly end-to-end through the resolver, cargo-deny, cargo-vet, and cargo-geiger before the trait/impl PRs land on top.

Builds on PR #48 (ADR 0002 §W5 amendment + fork-tracking file, merged).

Key decisions

Dropped the scripting feature from the original ADR 0002 §W5 plan. The ADR had features = ["internals", "scripting"] preserving two of upstream's three defaults. Scripting pulls rhaismartstring (MPL-2.0), which would require a license-allowlist widening for a raft-engine surface mango does not use (TiKV admin CLI). internals is the only feature mango-raft actually needs. Noted in the ADR's comment header so future impl PRs don't silently re-enable scripting.

[policy.raft-engine] audit-as-crates-io = true so a single [[exemptions.raft-engine]] version = "0.4.2" entry covers both the active fork and the post-retirement upstream, matching the posture already recorded in .planning/fork-raft-engine-lz4-verification.md §"Supply-chain audit posture."

Four [bans] skip entries for raft-engine-transitive major-version gaps (bitflags 1.x, getrandom 0.2, hashbrown 0.14, syn 1.x). Each names its retirement trigger.

One new [advisories] ignore entry for RUSTSEC-2024-0437 (protobuf 2.28 uncontrolled recursion via raft-engine → prometheus). Skeleton exercises zero protobuf parsing; mango-raft impl PRs will carry fuzz corpora for this input class per ROADMAP's Reviewer's contract.

Verification

cargo check --workspace                               OK
cargo clippy --workspace --all-targets -- -D warnings OK
cargo fmt --check                                     OK
cargo nextest run -p mango-storage                    1 passed
cargo deny check (advisories/bans/licenses/sources)   all OK
cargo-deny --all-features check                       all OK
cargo vet check                                       Succeeded (141 exempted)
cargo run -q -p xtask-vet-ttl                         PASS (148 with review-by, 1 without)
cargo tree -p mango-storage -i lz4-sys                not in graph (exit 101 — pure-Rust north-star intact)
cargo tree -p mango-storage -i redb                   redb v4.1.0 ✓
cargo tree -p mango-storage -i raft-engine            raft-engine v0.4.2 from humancto fork at e1d738d ✓
cargo doc --no-deps -p mango-storage                  OK

File list

  • Cargo.toml — workspace member add + redb + fork-pinned raft-engine
  • crates/mango-storage/Cargo.toml (new) — publish = false, deps via .workspace = true
  • crates/mango-storage/src/lib.rs (new) — placeholder + VERSION smoke test
  • deny.tomlallow-git, 4 skip entries, 1 ignore entry
  • supply-chain/config.toml[policy.mango-storage], [policy.raft-engine], ~90 new exemptions
  • supply-chain/imports.lock — auto-regenerated
  • unsafe-baseline.jsonmango-storage entry (all zeros)
  • .planning/mango-storage-skeleton.plan.md (new, force-added per precedent) — revised plan

Non-goals

Explicitly NOT in this PR:

  • Trait definitions (ROADMAP:816)
  • Trait impls (ROADMAP:817, :818)
  • Differential bbolt-oracle harness (ROADMAP:819)
  • Chaos / crash-recovery / disk-full / engine-swap tests (ROADMAP:820–827)
  • Benches (ROADMAP:828, :829)
  • cargo-geiger CI gate against the +10-over-baseline rule (ROADMAP:823)

Test plan

  • Skeleton compiles via cargo check --workspace
  • Single smoke test passes under nextest
  • cargo-deny all four gates green (advisories, bans, licenses, sources)
  • cargo-vet check succeeds
  • xtask-vet-ttl PASS
  • Full-workspace clippy clean at -D warnings
  • rustfmt clean
  • cargo doc builds with #![deny(missing_docs)]
  • lz4-sys absent from the mango-storage dep graph (pure-Rust north-star verified end-to-end)

🤖 Generated with Claude Code

…k deps

Adds the Phase 1 storage crate skeleton per ROADMAP:815. Scaffolding
only — no trait definitions yet (those land in ROADMAP:816's own PR),
no implementations. The goal of this PR is to prove the two load-bearing
storage dependencies integrate cleanly end to end (resolver, cargo-deny,
cargo-vet, cargo-geiger) before the trait and impl PRs land on top.

What ships:

- crates/mango-storage skeleton: publish = false, deny(missing_docs),
  matches the shape of the existing mango crate. Single
  VERSION-matches-manifest smoke test.

- Cargo.toml workspace deps:
    redb = "4.1.0"
    raft-engine = humancto/raft-engine at e1d738d, default-features = false,
                  features = ["internals"]
  Consumers inherit the feature set verbatim via `.workspace = true`.

  Dropped the `scripting` feature from the original ADR 0002 §W5 plan:
  scripting pulls rhai → smartstring (MPL-2.0), which would require a
  license-allowlist widening for a raft-engine surface mango does not
  use (the TiKV-admin CLI path). `internals` is the only feature mango-
  raft actually needs.

- deny.toml:
  - allow-git allowlist entry for humancto/raft-engine with a retirement
    trigger (tikv/raft-engine#397 merging → drop the entry).
  - skip entries for four raft-engine-transitive major-version gaps
    (bitflags 1.x, getrandom 0.2, hashbrown 0.14, syn 1.x). Each names
    the retirement trigger (raft-engine upstream refresh).
  - ignore entry for RUSTSEC-2024-0437 (protobuf 2.28 uncontrolled
    recursion via raft-engine → prometheus). Skeleton exercises zero
    protobuf parsing; mango-raft impl PRs will carry fuzz corpora for
    the crafted-input class per ROADMAP's Reviewer's contract.

- supply-chain/config.toml:
  - [policy.mango-storage] first-party stanza.
  - [policy.raft-engine] audit-as-crates-io = true so one
    [[exemptions.raft-engine]] version = "0.4.2" entry covers both the
    active fork and post-retirement upstream, matching the posture
    recorded in .planning/fork-raft-engine-lz4-verification.md.
  - ~90 new [[exemptions.*]] entries for the transitive graph of both
    deps, each with review-by: 2026-10-23 in notes per house convention.

- unsafe-baseline.json: add mango-storage (all zeros — skeleton has no
  unsafe, no #![allow(unsafe_code)], no miri enrollment).

- supply-chain/imports.lock: auto-bumped by `cargo vet regenerate
  exemptions`.

- .planning/mango-storage-skeleton.plan.md: the revised plan after
  rust-expert's REVISE review (addressed two showstoppers, three bugs,
  and eight missing items from the first-round findings).

Verification (local):
  cargo check --workspace                              OK
  cargo clippy --workspace --all-targets -- -D warnings OK
  cargo fmt --check                                     OK
  cargo nextest run -p mango-storage                    1 passed
  cargo deny check (advisories/bans/licenses/sources)   all OK
  cargo vet check                                       Succeeded
  cargo run -q -p xtask-vet-ttl                         PASS
  cargo tree -p mango-storage -i lz4-sys                lz4-sys absent

Closes ROADMAP:815. Next item: ROADMAP:816 (Backend + RaftLogStore
trait definition).
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 500384be72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread supply-chain/config.toml
Comment on lines +509 to +512
[[exemptions.rhai]]
version = "1.24.0"
criteria = "safe-to-deploy"
notes = "review-by: 2026-10-23 — raft-engine 0.4.2 transitive (scripting engine), audit pending"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove exemptions for currently-disabled scripting deps

This commit adds rhai/rhai_codegen/smartstring (and related wasm helper) exemptions even though raft-engine is configured with only features = ["internals"], so those scripting-path crates are not in the resolved lockfile for this change. Pre-approving unused crates weakens the cargo vet guardrail: if someone later re-enables scripting (or pulls these crates another way), vet will stay green without a fresh review. The exemptions should be limited to the active dependency graph and added when those crates are intentionally introduced.

Useful? React with 👍 / 👎.

Archith and others added 2 commits April 24, 2026 16:25
Addresses the five must-fix items from rust-expert's final diff
review before the mango-storage skeleton can merge:

1. audit.yml: add `ignore: RUSTSEC-2024-0437` — rustsec/audit-check
   does not read deny.toml, so the protobuf recursion advisory must
   be suppressed separately here. Cross-reference comment points at
   deny.toml as the single source of truth for the justification.

2. fork-raft-engine-lz4-verification.md: rewrite the manifest snippet
   and retirement snippet to show `features = ["internals"]`, add a
   "scripting dropped" rationale section (MPL-2.0 via rhai /
   smartstring, avoided by not taking a feature mango does not use),
   and bump "Last updated" to reflect that PR #49 wires the dep.

3. supply-chain/config.toml raft-engine exemption: keep the
   SHA-qualified `version = "0.4.2@git:<SHA>"` form — verified by
   running `cargo vet check` that plain `version = "0.4.2"` does NOT
   match a git source, even with `audit-as-crates-io = true`. Rewrite
   the exemption notes AND the `[policy.raft-engine]` notes to
   honestly describe the actual cargo-vet behavior (exemptions key on
   fully-resolved source, not `package.version` alone) and the
   rebase/retirement implications. Fork-tracking doc §"Supply-chain
   audit posture" rewritten to match.

4. supply-chain/config.toml crc32fast exemption: add the missing
   `notes = "review-by: 2026-10-23 — raft-engine 0.4.2 transitive,
   audit pending"`. xtask-vet-ttl would have caught this on any next
   run.

5. mango-storage-skeleton.plan.md: update the Goal section and the
   raft-engine pin snippet to show `features = ["internals"]`, add
   a "Deviations from plan" section at the bottom enumerating the
   four real implementation departures from the revised plan
   (scripting drop, explicit version on the git dep, four dedup-skip
   entries, RUSTSEC-2024-0437 ignore).

Verified locally:
- cargo vet check — PASS
- cargo deny check — advisories/bans/licenses/sources all ok
- cargo run -q -p xtask-vet-ttl — PASS (149/149 exemptions have
  review-by)
- cargo clippy --workspace --all-targets -- -D warnings — clean
- cargo fmt --check — clean

imports.lock drift is cargo-vet's auto-regeneration; included in the
commit to keep the working tree clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI surfaced: cargo-vet 0.10.2 store-consistency check rejects a
single-quoted multi-line string that contains an inner escape-quote.
cargo vet fmt (which CI runs with --locked --frozen, and which
rejects any reformatting delta) wanted the notes rewritten as a TOML
triple-quoted literal.

This is a formatting-only change: the text content is unchanged.
Local cargo vet check PASSES.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@humancto humancto merged commit a9f8e42 into main Apr 24, 2026
22 checks passed
@humancto humancto deleted the feat/mango-storage-skeleton branch April 24, 2026 14:36
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