P12 — Retire the mechanical port; leveva is the product#
The literal end of the strangler fig. The C tree was strangled by the faithful
mechanical port (P8); the faithful port was strangled by the greenfield leveva
(P10–P11); P12 deletes the faithful port now that leveva is at parity.
Plan: docs/superpowers/plans/2026-06-13-p12-retire-mechanical-port.md.
-
2026‑06‑13 — P12 (retire the mechanical port) merged. The user chose "begin the P12 deletion" over adding more IRCv3 caps — parity is sufficient (the full client surface, S2S, the IRCv3 account-extensions trio, and the parity-matrix fuzzing pass through slice 143 are all done).
-
The gate (final differential run).
cargo test -p leveva-integration— the last run of the oracle differential suite — passed green (exit 0, every*_differential.rs+*_proptest.rsbinary ok, including the slowtopology/stats/s2sproptests). leveva and the mechanical-port oracle (ircd-common/iauth-rs) agree across the entire shared skeleton one final time. This is the PLAN.md P12 entry condition ("run the differential suite a final time, then delete"). -
Pre-condition verified before deleting.
levevaandleveva-iauthhave no dependency on the mechanical port — neither a Cargopathdep nor ause ircd_common/use iauth_rsimport; every textual match across both crates is a comment. So the deletion is clean (no dangling references). The behavioral guarantees were already carried outside the oracle by leveva's own self-contained 212-file suite (boot-golden + per-sliceproptest); theleveva-integrationtests were purely the oracle differential pin layer (assert leveva ⇔ircd-commonon a shared skeleton), a guarantee that is meaningless once the oracle is gone, and every leveva-only invariant inside them (parse panic-freedom, CRLF framing) is duplicated by leveva's own proptests (feed_framing_proptest, the per-slice*_proptest.rs). Nothing to salvage — they retire with their oracle. -
Deleted.
git rm -r ircd-common ircd-rs iauth-rs leveva-integration.iauth-rswas the C-iauth differential oracle, long since subsumed by the native in-processleveva-iauth(see the iauth-subsumed-into-leveva note). WorkspaceCargo.tomlmembers reduced to["leveva", "leveva-iauth"]; the explanatory comment rewritten to record the completed strangler. -
Deployment rigging (user ask). Removed the mechanical port's deployment artifacts:
docker/Dockerfile.ircd; theircdtarget + its slot in thedefaultgroup ofdocker-bake.hcl(leaving thelevevatarget); and the entiredocs/k8s/example-network/(its whole purpose was demonstrating the now-impossible leveva↔ircd S2S link — README topology,ircd.yaml,cfg/ircd.conf, the mixedkustomization.yaml). -
Docs (user ask). Rewrote
README.mdfrom "experimental mechanical port" to what the project actually is now: a finished strangler fig whose product isleveva, an idiomatic async-Rust IRC daemon — with build/run instructions, the workspace table, and the history preserved as a pointer to PLAN.md + git. Also fixed the stale present-tense references to the deletedircd-*crates inleveva/src/lib.rs(module doc),leveva/Cargo.toml, andleveva-iauth/Cargo.tomlcomments. -
Gate (exit).
cargo build --workspace0 warnings;cargo clippy --workspace --testsclean;cargo test -p leveva -p leveva-iauthgreen. The workspace is nowleveva+leveva-iauth. Everything deleted — the C source tree (gone at P8v), the mechanical port, the oracles — remains recoverable from git history; the P8 final byte-identical reference-C run is the provenance anchor. -
The strangler is complete. There is no more mechanical port and no oracle;
levevastands alone as the product, its own test suite carrying the behavioral guarantees forward.
-
-
2026-06-21 — post-P12 refactor:
leveva-casemapleaf crate extracted (+ proptest fuzz). Continuing the leaf-crate carve-out begun by theleveva-message/leveva-patriciaextraction, the RFC 1459 case-folding module moved out of the monolith into its own workspace crate. This is not a migration slice — the strangler is finished; it is standalone refactoring of the finished product.-
Why casemap. It is the lowest leaf in the string cluster: it imports only
core::cmp::Ordering+core::hash::Hasherand has zero intra-crate coupling, whilestring/ident/matching/channel/registry/whowasall depend on it. That made it the cleanest next extraction (thestring/ident/matching/cidrsiblings still touch each other / typed ids, so they stay put for now). -
Mechanism (identical to message/patricia). New
leveva-casemapcrate (publish = false, std-only lib,proptestdev-dep);leveva/src/casemap.rsdeleted;leveva/src/lib.rsnow doespub use leveva_casemap as casemap;(a doc'd re-export beside the message/patricia ones). Everycrate::casemap::*(~40 source + test files) andleveva::casemap::*path is unchanged — zero consumer churn. -
Fuzzing (user ask). Stable toolchain only (rustc 1.96, no nightly, no
cargo-fuzz), so proptest is the runnable fuzz tier — same choiceleveva-messagemade. Added 7proptest!invariants fed arbitrary bytes / arbitrary (incl. non-ASCII) strings, all consistency/inverse properties rather than happy-path echoes: fold ⇔ eq_ignore_case (both directions), cmp==Equal ⇔ eq, cmp antisymmetry, hash agrees with eq (prefix-free0xffmarker exercised), fold idempotent + UTF-8-safe + byte-length-preserving, high bytes (≥0x80) identity, and to_upper∘to_lower identity on the uppercase domain over the full byte range. -
Gate.
cargo build --workspace0 warnings;cargo clippy --workspace --testsclean;cargo test -p leveva-casemap13 green (6 unit + 7 fuzz); fulllevevasuite green. Plan:docs/superpowers/plans/2026-06-21-extract-leveva-casemap.md. Workspace members are nowleveva+leveva-iauth+leveva-casemap+leveva-message+leveva-patricia.
-
-
2026-06-21 — post-P12 refactor:
leveva-stringleaf crate extracted (+ proptest fuzz). The next leaf-crate carve-out afterleveva-casemap(which followedleveva-message/leveva-patricia). The casemapping-aware string types moved out of the monolith into their own workspace crate. Still not a migration slice — the strangler is finished; this is standalone refactoring of the finished product.-
Why string (the architectural #2). With
casemapnow its own crate,stringdepends on exactly one intra-crate module —crate::casemap, already the extractedleveva-casemap— and otherwise onlycore/std. That makes it the cleanest next leaf:leveva-stringdepends onleveva-casemapand nothing else in the workspace, whileident/channel/registry/whowasdepend on it (via the re-exportedIrcStr/IrcString/IrcStringBuilder/IrcErrornames). No cycle —leveva-messageuses neither, andleveva-casemapdepends only oncore. -
Mechanism (identical to message/patricia/casemap). New
leveva-stringcrate (publish = false, std lib, one lib depleveva-casemap,proptestdev-dep);leveva/src/string.rsdeleted;leveva/src/lib.rsnow doespub use leveva_string as string;(a doc'd re-export beside the others) and the existingpub use string::{IrcError, IrcStr, IrcString, IrcStringBuilder};then re-exports straight out of the new crate. The body moved verbatim exceptuse crate::casemap;→use leveva_casemap as casemap;and the two doctests'use leveva::…;→use leveva_string::…;. Everycrate::string::*/leveva::string::*path and the four flat re-exports are unchanged — zero consumer churn (the full build of every dependent crate confirms it). -
Fuzzing (user ask). Stable toolchain → proptest, matching casemap/message. Added 6
proptest!invariants fed arbitrary (incl. non-ASCII) strings, all consistency/inverse properties: eq lifts casemap (the wrapper adds no equality of its own), Ord consistent-with-Eq + antisymmetric, Hash agrees with Eq (the HashMap-key contract for nick/channel tables),Borrow<IrcStr>round-trip (insert under one casing, find by a case-different borrowed key), validation soundness (accept iff no NUL/CR/LF, FromStr agrees, storage byte-identical on success), and builder ≡ try_from (build is a deferred validate, rejects iff a piece carried a framing byte). -
Other crates that can still move out (the user's question). Surveyed by intra-crate dep surface:
cloak(zero intra-crate deps — a perfect standalone leaf, the strongest next candidate);uid(onlycrate::ident, extractable onceidentis a crate);matching+cidrare a coupled pair (mutually referential) so not a clean single leaf yet;msgidpullscap/clock/ident, not a leaf. -
Gate.
cargo build --workspace0 warnings;cargo clippy --workspace --testsclean;cargo test -p leveva-string13 green (7 unit + 6 fuzz) + 2 doctests; fulllevevasuite green. Plan:docs/superpowers/plans/2026-06-21-extract-leveva-string.md. Workspace members are nowleveva+leveva-iauth+leveva-casemap+leveva-message+leveva-patricia+leveva-string.
-
-
2026-06-21 — refactor: extract
leveva-cidrleaf crate (+ proptest fuzzing). Continues the post-P12 leaf-crate carve-out aftercasemap/string/message/patricia. Standalone feature work — no oracle, no differential.-
Why / a correction.
cidris a pure leaf — every function depends only onstd::net::IpAddr. The earlierleveva-stringsurvey filedmatching+cidras "a coupled pair (mutually referential), not a clean single leaf yet"; that was wrong.cidr.rs's only references tocrate::matching/crate::connlimitare in doc comments, not code. The real edge is one-way:matching→cidr(matching.rs:176callscrate::cidr::cidr_match), withconnlimit/websocketalso calling in, whilecidrcalls nothing intra-crate. Socidrextracts cleanly on its own — and unblocksmatching, whose only remaining intra-crate deps are now the two already-extracted cratescasemap+cidr. -
Mechanism (identical to casemap/string/message/patricia).
git mv leveva/src/cidr.rs → leveva-cidr/src/lib.rs; newleveva-cidrcrate (publish = false, std lib, no lib deps,proptestdev-dep);leveva/src/lib.rsnow doespub use leveva_cidr as cidr;(a doc'd re-export beside the others). Body moved verbatim except the doctest'suse leveva::cidr::cidr_match;→use leveva_cidr::cidr_match;and two cross-crate intra-doc links repointed to plain text. All four call sites use fully-qualifiedcrate::cidr::*(parse_cidr/contains/network_base/cidr_match), so zero consumer churn — the fulllevevabuild + the matching/connlimit/websocket tests confirm it. -
Fuzzing (user ask). Stable toolchain → proptest, matching casemap/string. Added 10
proptest!invariants over the full v4/v6 address space (u32::ANY/u128::ANY) and arbitrary in-range prefixes, all consistency/inverse properties: parse_cidr round-trips (+ out-of-range prefix always rejected), contains reflexive through network_base, network_base idempotent, contains prefix-monotone (membership atp⇒ membership at every widerq ≤ p),/0universal + full-length exact, family mismatch never contains, andcidr_match ≡ parse + contains. -
Other crates that can still move out (the user's question).
cidrcleared andmatchingnow unblocked:matching(498 LoC) is now a clean leaf (depscasemap+cidr, both crates; pullsnom) — the natural next extraction, the Cmatch.ccluster;cloak(zero intra-crate deps — a perfect standalone leaf, independent of the matching cluster);uid(onlycrate::ident, extractable onceidentis a crate);msgidpullscap/clock/ident, not a leaf. -
Gate.
cargo build -p leveva0 warnings;cargo test -p leveva-cidr18 green (8 unit + 10 fuzz) + 1 doctest;levevacidr-consumer tests (matching/connlimit/websocket, 54) green. Plan:docs/superpowers/plans/2026-06-21-extract-leveva-cidr.md. Workspace members are nowleveva+leveva-iauth+leveva-casemap+leveva-cidr+leveva-messageleveva-patricia+leveva-string.
-
-
2026-06-22 —
leveva-cloakleaf crate extracted (+ proptest fuzzing). Continues the leaf-crate carve-out (after casemap / string / message / patricia / cidr). Plan:docs/superpowers/plans/2026-06-22-extract-leveva-cloak.md.- Why / leaf-ness —
cloakis the cleanest remaining leaf: zero intra-workspace deps (onlystd::net::IpAddr), exactly as the cidr survey predicted ("strongest next pick"). Its onlycrate::-references are doc comments; the code edges all run into it (command::mode::apply_cloak_changemode.rs:916+session.rs:1786callcrate::cloak::cloak). No cycle —leveva-cloakdepends on nothing in the workspace. - Mechanism —
git mv leveva/src/cloak.rs → leveva-cloak/src/lib.rsverbatim (no doctest, all intra-doc links resolve in-module, so zero body edits beyond the appended fuzz module);leveva/src/lib.rsswapspub mod cloak;forpub use leveva_cloak as cloak;; both call sites use fully-qualifiedcrate::cloak::cloak→ zero consumer churn. - Fuzzing (the user ask) — 10 proptest invariants; the transform has no
differential oracle (C 2.11 has no
+x), so these are the gate. Determinism; the leading-colon wire-safety biconditional (+:-prefixed-unchanged); length preservation for bothcloak_ip/cloak_host; separator/dot byte-index invariance; IP-literal dispatch tocloak_ip; the g–z IP alphabet + first-two-octets-kept (v4) and hex/:/g–z (v6); andfnv_hash_32== charybdis's shift-decomposition over arbitrary bytes. Fed arbitrary (incl. non-ASCII) strings + the full v4/v6 space. - Next extraction candidates —
matching(now a clean casemap+cidr leaf, pullsnom, the Cmatch.ccluster);uid(blocked onident);msgid(not a leaf). - Gate —
cargo build --workspace0 warnings;cargo clippy --workspace --testsclean;cargo test -p leveva-cloak18 (8 unit + 10 fuzz) green; the+xconsumer tests inleveva(command::modeplus_x suite +sessionregisters-cloaked, 8 incl. the s2s+s+xspy) green.
- Why / leaf-ness —
-
2026-06-22 —
leveva-matchingleaf crate extracted (+ proptest fuzzing). Continues the post-P12 leaf carve-out afterleveva-casemap/leveva-string/leveva-message/leveva-patricia/leveva-cidr/leveva-cloak. Thematch.ccluster (IRC glob matcher +nick!user@hosthostmasks, 498 LoC) was the survey-flagged "natural next pick": its only intra-crate edges wereuse crate::casemap;(casemap::to_lower) andcrate::cidr::cidr_match— both already their own leaf crates — plusnom.- Mechanism (identical to the prior six):
git mv leveva/src/matching.rs leveva-matching/src/lib.rs; new crate depsleveva-casemap+leveva-cidr+nom, dev-depproptest. Five verbatim repoints only:use crate::casemap;→use leveva_casemap as casemap;;crate::cidr::cidr_match→leveva_cidr::cidr_match; the module-header intra-doc link(crate::casemap)→(leveva_casemap); two doctestsuse leveva::matching::…→use leveva_matching::….leveva/src/lib.rsswapspub mod matching;forpub use leveva_matching as matching;, so the flatpub use matching::{collapse, matches, HostMask, Pattern};re-export and all ~13 consumer modules (xline/kline/resv/webirc/metadata/registration+command/{oper,map,mask,hunt,dline,tkline}) keep theircrate::matching::*paths. - No dependency cycle:
leveva-matching→{leveva-casemap, leveva-cidr, nom}(leaves that depend on nothing in-workspace);leveva→leveva-matching. The code edges all run into matching. - Fuzzing (the user ask): stable-toolchain proptest, no differential oracle (leveva's
matcher deliberately diverges from
match.c's ASCII-only fold — RFC 1459 case-fold,#=any-digit), so the 13 proptest invariants ARE the gate. Fed arbitrary (incl. non-ASCII) strings + glob masks: totality/no-panic across every entry point,*is universal,?^k ⇔ exact byte-length, case-insensitivity underleveva_casemap::foldof the name,compile==matches,collapseis matching-preserving + idempotent + non-growing,HostMaskre-parses its ownDisplay,matches_target==matches_parts,allow_host_matchesdecomposes into user-glob && host-component, and a glob host component falls back tomatches. - Gate:
cargo build --workspace(0 warnings) ·cargo clippy --workspace --tests(clean) ·cargo test -p leveva-matching(28 = 8 unit + collapse/escaping etc. unit + 13 fuzz, + 2 doctests) green ·levevamatching-consumer tests (xline/kline/resv/webirc, 181) green. - What else can still move out:
uid(≈230 LoC, onlycrate::ident) becomes a leaf onceidentsplits —identis blocked by a singlecrate::commandreference worth auditing, the next unlock.msgidpullscap/clock/ident;clockis a small candidate leaf (audit pending).
- Mechanism (identical to the prior six):