FrankenMining

Workspace, crate map and budgets

2,947 words6 subsections4 tables1 listingPlan version 0.1

On this page6
28.1 Naming28.2 Layers28.3 The crate map: 59 crates, 7 layers28.4 Budget-overrun protocol (FTX lesson)28.5 Layering and dependency rules (xtask check-*; GATE-LAYERS-00 from commit 1)28.6 Repository layout

28.1 Naming

  • Crate prefix fmine-. Binaries: fmine (CLI), fmined (node daemon), fmine-mcp, fmine-tui. Environment variables: FMINE_*. Format magic: FMNE.
  • Why not fm. Every shorter name collides, verified in code (B4 S7):
    • fm-* is frankenmermaid's published crate prefix (fm-core, fm-parser, … fm-cli). The report path links frankenmermaid, so an fm-core here would put two fm-core packages in one graph.
    • fmd is franken_markdown's binary.
    • fm is /usr/bin/fm on macOS (Apple's Foundation Models CLI).
    • fmn is franken_manim.
  • fmine is free (checked 2026-10-29). crates.io returns 404 for fmine, fmined, fmine-core, fmine-cli, franken_mining, franken-mining and frankenmining, and a crates.io search for "fmine" finds no crate (FACT, E651). OPEN-B4-09 is closed with the default; BD-014's naming ADR records the check and reserves the names at commit 1.
  • Plan prose may say "FM". The owner may overrule the prefix, but must then register the collisions as RISK rows.

28.2 Layers

Dependencies point downward only: T → U → V → E → K → S1 → S0.

Code Layer May May not
S0 Substrate std plus lifted code. Durable formats live here, so formats never depend on a runtime version. Depend on asupersync or any foundation
S1 Runtime and authority asupersync regions, capabilities, obligations; IO for the ledger, CAS, telemetry segment log and sync transport (QUIC/ATP), the only IO outside V Contain domain logic
K Domain kernels Pure functions over Cx<cap::None>, Budget and checkpoint; inner numeric kernels take a FnMut() -> bool cancellation closure (§13.9 R-2) SPAWN, TIME, RANDOM, IO, REMOTE
E Engines SPAWN tiles; seeded RANDOM from fmine-core::rand IO, REMOTE, TIME (times and seeds arrive as inputs)
V Services and adapters All other IO and REMOTE: importers, projections, the FA subprocess, services Domain logic beyond parsing and projection
U Surfaces Present verbs; no authority path of their own Write anything except through the verb registry
T Verification Reach anything (dev-only) Be depended on by production crates

Dependency inversion where §15 names solvers inside fmine-plan. The K-layer modules (sched, blend, mpc) hold formulations, models and certificate checks. Solves are invoked through a Solve trait that K defines and E implements (fmine-lp, fmine-optimize), so K never depends on E.

28.3 The crate map: 59 crates, 7 layers

Phase of first real slice: A = M0–M2 (the 12-month demonstrator), B = M3–M4, C = M5–M6. ★ marks the 35 crates that receive a slice in phase A. A crate joins the workspace only with its first real slice. Budgets are Rust LOC in thousands, including tests. They are TARGETs, and each ceiling is 1.15× the plan.

Layer Crate Subsystem Responsibility (one line) Plan k Ceil k Phase
S0 ★fmine-core Bedrock IDs and prefixes, anchors, codec kit (magic, LE, bounds, CRC, canonical order), lifted det, rand (Philox), hash (BLAKE3) 12 14 A
S0 ★fmine-units Bedrock §25 quantities, bases, exact constants, money boundary type 10 12 A
S0 ★fmine-time Bedrock Quad-temporal types (QuadTemporalStamp), TimeEvidence, site and fiscal calendars, rosters 8 9 A
S0 ★fmine-crs Portal EPSG subset, mine grids as Claims, vertical datums, UNREGISTERED 15 17 A
S0 ★fmine-evidence Plumb Lifted fs-evidence subset; evidence classes; colours; typed refusals; EvidenceRow/DecisionRow schema types (no franken-evidence dependency) 14 16 A
S0 ★fmine-claim Plumb The universal Claim (§8), its algebra and the no-laundering rules 16 18 A
S0 ★fmine-registry Bedrock Registries-as-data loader and the registry-check library 8 9 A
S0 ★fmine-array Bedrock Typed contiguous grids and views (§27.3) 6 7 A
S1 ★fmine-runtime Bedrock Region tree, CapSet profiles, AppSpec per role, budgets, obligation registry 12 14 A
S1 ★fmine-authz Bedrock First-party macaroon caveats, MNPI and venture walls, residency, human authority tokens (§31) 14 16 A
S1 ★fmine-ledger Bedrock Delta batches, cells, leases and fencing, witnesses, narrow combiner, MMR, segment files 24 28 A
S1 ★fmine-object Bedrock CAS chunks, manifests, fanout-16 Merkle, root-last publication, GC by reachability 15 17 A
S1 fmine-telemetry Headframe Site segment log, columnar codecs, ingest backpressure, rollups (§26.8) 16 18 B
S1 ★fmine-sync Bedrock Version vectors, SyncCert, chunk anti-entropy, QUIC/ATP adapter, residency planner 16 18 A
S1 ★fmine-lab Testpit LabRuntime harness, chaos profiles, FM oracles (dev-only) 10 12 A
K ★fmine-geom Strata Lifted VdbGrid, winding, exact predicates; meshes, block grids, sub-blocks, volcert, bricks 30 35 A
K ★fmine-numerics Bedrock Lifted sparse/eproc/voi/risk/tropical/enkf; gmrf; the array bridge 30 35 A
K fmine-materials Strata Sealed geomaterial corpora, correlation cards, matdb-format export (§13.10) 12 14 B
K ★fmine-drill Corebox Collars, surveys, desurvey, intervals, compositing, sample support 15 17 A
K ★fmine-qaqc Corebox CRMs, blanks, duplicates, detection limits, censored fitting, e-process drift, lab certificates 15 17 A
K fmine-geostat Strata Variography, kriging, change of support, conditional simulation 40 46 B
K fmine-belief Strata Subsurface belief objects, realization sets, implicit structure, block-model projections 25 29 B
K ★fmine-calib Plumb Forecast registration, proper scoring, calibration records, surprise monitors, reference classes (§10) 27 31 A
K fmine-explore Lodestar Deposits, exploration effort, absence classes, detection-thinning data model (§11) 15 17 B
K fmine-geotech Highwall Rock mass, slope and support laws, instrumentation semantics, TARP automata 22 25 C
K ★fmine-flow Touchstone Material-flow graph, conservation laws, F-factors (§20) 20 23 A
K ★fmine-recon Touchstone Reconciliation as joint state estimation; gross-error tests; identifiability 18 21 A
K fmine-plan Pushback Plan and schedule models, precedence, scenario labels, cut-off, blend, compliance math 30 35 B
K fmine-blast Headframe Drill and blast design records, fragmentation and blast-movement models 15 17 C
K fmine-ops Headframe As-built, load and haul, reliability, ventilation, dewatering, energy, wear 35 40 C
K ★fmine-plant Crucible Flowsheet graph, process cards, geomet chain, P754 balances, refining custody 37 43 A
K fmine-tailings Freeboard TSF evidence state, GISTM traceability, water balance, ARD/PAG, closure 18 21 C
K fmine-workforce Muster Rosters, competencies, fatigue, CCV, productivity, budgets by driver (privacy by design) 16 18 C
K ★fmine-reserves Hallmark Register model, CP/QP acts, renderers, data-verification index, statement reconciliation 20 23 A
K fmine-econ Helm Price decks, cost models, fiscal terms (NSR, royalties, tax), NPV with exact money 20 23 B
E fmine-estimate Strata Estimation-run orchestration and certificates 15 17 B
E fmine-optimize Pushback Pit limits (pseudoflow), Bienstock–Zuckerberg, Lagrangian, TopoSort, stochastic 36 41 B
E fmine-lp Pushback PDLP, MILP, QP, MPS I/O, decomposition 25 29 B
E fmine-infer Lodestar NUTS, SMC and the thinned point-process posteriors 24 28 B
E fmine-prospect Lodestar Prospectivity engine, Bayesian search, drill-target VOI 22 25 B
E ★fmine-decide Helm DecisionCards, VOI, sensitivities, robustness views; the only franken-evidence/franken-decision adapter and renderer 20 23 A
E fmine-capital Helm CapitalProgram optimization, scenario index, real options, deal cards 25 29 B
E fmine-metalacct Bullion Metal-accounting subledger, costing, FA summary preparation, Merkle folding 30 35 B
E fmine-acctpack Bullion The 17-part mining domain pack over FA (NRV, stockpile costing, streams, ARO …) 22 25 B
E ★fmine-metrics Bullion AISC/AIC/C1/GEO/reserve replacement/ROCE variants, LMDI waterfalls, public lane 29 33 A
V ★fmine-io Portal Quarantine-on-import parsers and writers (§32) 40 46 A
V ★fmine-public Portal Public-filings lane: issuer filings parsed into Public-basis Claims (§31.1) 24 28 A
V ★fmine-projection Bedrock Projectors to fsqlite, fgdb and frankensearch; high-water marks 20 23 A
V fmine-fa-bridge Bullion Posting-slot automaton over fa --json; outbox; FA-ACC client side 15 17 B
V ★fmine-service Adit Node composition (roles, supervisors, leases) → binary fmined 15 17 A
U ★fmine-cli Adit Binary fmine; robot NDJSON; verb registry; doctor and repair 44 51 A
U fmine-mcp Adit Thin adapter over verbs (the only fastmcp dependent); parity gate 10 12 B
U fmine-tui Adit frankentui ops console (inline mode, asupersync lane) 15 17 B
U ★fmine-report Adit franken_markdown + frankenmermaid reports with anchors and no_claim lines 12 14 A
U fmine-view Adit Read-only 3-D scene export (glTF subset) and a static viewer; no authority path 15 17 C
T ★fmine-oracles Testpit Oracle fixtures, known answers, metamorphic relations, conformance 28 32 A
T ★fmine-gen Testpit Synthetic mines and districts with seeded truth (§33.3) 20 23 A
T ★fmine-verify Testpit std-only offline verifier of certificates, bundles and MMR proofs 12 14 A
T ★fmine-derive Testpit Build-time fsym derivations, golden formulas, LaTeX (§27.3) 8 9 A
(gated) fmine-simbridge Strata fs_geom::Chart adapter for frankensim solvers 0 0 after GATE-FSIM-RECONV

Totals (TARGETs).

Layer Crates Plan k Ceiling k
S0 Substrate 8 89 102
S1 Runtime and authority 7 107 123
K Domain kernels 20 460 530
E Engines 10 248 285
V Services and adapters 5 114 131
U Surfaces 5 96 111
T Verification 4 68 78
Total 59 1,182 1,360
Phase Crates first sliced Full budgets of those crates (k) Slice actually built in the phase (k, TARGET)
A (M0–M2, demonstrator) 35 ★ 664 ≈ 390 planned, 450 ceiling (subsets of the ★ crates)
B (M3–M4) 18 397 the remainder of phase-A crates as their slices widen, plus these
C (M5–M6) 6 121 —
  • Calibration of these sizes. FA is ≈ 796k LOC for accounting alone (R4 §4.2; HEAD 41363acb). FTX reached 324k for a narrower product and overran its plan 2.7× (R5 §2.3). B4's 39-crate map was 738k. This map adds 20 crates for the subsystems Part III specified (Lodestar, Headframe, Crucible, Freeboard, Muster, Helm, the public lane and the viewer).
  • Reading the numbers. 1.18M LOC is a ceiling-governed envelope, not a promise. The phase-A demonstrator is the only commitment, and §37's program gate at month 12 decides whether phases B and C are funded. LOC figures are scope caps, never effort or schedule estimates.
  • Velocity reference class (R7-C112, R7-C113, R7-C115). Across 25 FrankenSuite siblings, lifetime non-blank Rust LOC per calendar day (tests included, as xtask loc counts) is min 1,106, Q1 ≈ 1,900, median ≈ 3,540, Q3 ≈ 9,000–11,200 and max 38,541. The plan implies ≈ 1,030–1,070 per day (390k in 12 months). Code volume is therefore unlikely to bind M0–M2 dates; data gates, reviewers and site access are (FORECAST, unscored; scored over the first 60 days as LOC per day against days blocked on a human or external gate). If code runs near sibling rates, the §28.4 80/100/115% triggers fire within months, which is their purpose.

28.4 Budget-overrun protocol (FTX lesson)

  1. registries/loc_budget.toml has one row per crate: {planned, ceiling = 1.15 × planned, charter}.
    • xtask loc is std-only and runs on every commit.
    • Generated fixtures are excluded from LOC and counted separately against a fixture-bytes budget.
  2. At 80% of planned, fmine doctor warns.
  3. At 100%, the next merge touching the crate needs a BUDGET-AMEND-nnn record: the new scope, the gate it serves, the new number and owner approval.
  4. At the ceiling, CI blocks merges to that crate except deletions, test fixes and refactors with net LOC ≤ 0.
  5. A program total above the ceiling freezes new crates and frontier work. Frontier work never borrows from the parity budget.
  6. No smuggling.
    • xtask check-scope maps module families to each crate's CONTRACT.md charter, so a new domain cannot hide inside an existing crate (the FTX ftx-pattern anti-pattern).
    • The delivery log lives in docs/delivery/, never in this plan (§0.7).

28.5 Layering and dependency rules (xtask check-*; GATE-LAYERS-00 from commit 1)

  • L-1 (direction). Dependencies point downward. T may reach anything, and nothing depends on T through normal dependencies. registries/workspace_topology.toml declares the same-layer edges in K and E, and CI checks that they are acyclic. The intended K order is:

    • K0: geom, numerics, materials, calib;
    • K1: drill, qaqc, flow, econ, explore;
    • K2: geostat, geotech, plant, tailings, recon, blast, workforce;
    • K3: belief, plan, ops;
    • K4: reserves.
  • L-2 (formats). S0 is std-only plus lifted code, and durable formats live in S0.

  • L-3 (capabilities). K may use only asupersync::{Cx<cap::None>, Budget, checkpoint}. check-caps bans open_child_region, spawn, IO and time APIs in K and E (defect S3(a), §31.4).

  • L-4 (foundation confinement).

    • fgdb, fsqlite and frankensearch only in fmine-projection, plus the fsqlite catalog in fmine-telemetry.
    • fastmcp only in fmine-mcp; ftui only in fmine-tui.
    • franken_markdown and frankenmermaid only in fmine-report.
    • franken-evidence and franken-decision only in fmine-decide (the converter to and from the S0 schema types; fmine-report renders claims through it). serde enters the build only through FMT-ENV-1 and this adapter's closure.
    • fsym only in fmine-derive.
    • No FA crate anywhere (subprocess only).
  • L-5 (banned dependencies). check-deps (deny.toml plus cargo tree inversion) bans:

    • tokio, hyper, reqwest, axum (the suite runtime is asupersync);
    • rusqlite, sqlx (fsqlite is the SQL store);
    • arrow, parquet, polars (fp-io pulls arrow and parquet unconditionally, so it is not consumed: KILL-6 path, §27.7);
    • petgraph (fnx is the graph library);
    • chrono, time as direct dependencies of any fmine-* crate or in any public API (fmine-time is std-only). They arrive transitively and unconditionally through fsqlite (fsqlite-func), fastmcp (fastmcp-server), frankenpandas (fp-types) and asupersync's tls feature (x509-parser → time), so deny.toml carries a per-foundation allow-list for exactly those paths and check-deps fails on any new path;
    • ort, fastembed (no ONNX runtime in the closure);
    • tantivy (oracle lane only);
    • C solver features such as HiGHS.

    It also requires one package id each for asupersync, fgdb-types and fnx-classes per posture closure.

  • L-6 (claims). xtask check-claims rejects a public K/E signature that takes or returns a bare f64 for a physical or monetary quantity (INV-001, PO-UNIT-2).

  • L-7 (lifts). xtask check-lifts checks provenance headers against registries/lifts.toml (§27.1).

28.6 Repository layout

franken_mining/
├── Cargo.toml                 workspace; [patch.crates-io] keeps one asupersync
├── rust-toolchain.toml        nightly-2026-08-31 (suite pin)
├── franken-stack.lock         exact revisions of every sibling (FA pattern)
├── crates/fmine-*/            each with CONTRACT.md (the ten sections of §0.2) plus public API, POs and budget
├── registries/                loc_budget, lifts, workspace_topology, residency, calendars, crs, units,
│                              io_dialects, mix_rules, refusals, verbs, automata/*, refclass/*, kpi_prices
├── xtask/                     check-layers, check-caps, check-deps, check-lifts, check-scope, check-claims,
│                              loc, registry-check
├── fixtures/                  oracle fixtures, CAS-addressed, under a fixture-bytes budget
├── docs/                      adr/, delivery/, robot-docs/
├── planning/                  this plan, research R1–R8 & W1–W5, Brenner B1–B6, MOR case & audits
└── .beads/                    the work graph (JSONL is truth)

Registries are data, not code. Every behaviour that an owner, QP or regulator may need to change (residency rules, KPI prices, mix rules, refusal texts, calendars) is a registry row with a schema, a registry-check and a golden test. Code changes are needed only for new kinds of rule.