{
  "schemaVersion": 2,
  "title": "C4 Mining data lineage and journey coverage",
  "authorityClasses": [
    "ses-source",
    "ses-derived",
    "program-runtime",
    "external-service",
    "missing"
  ],
  "pipeline": {
    "summary": "The Uber SAGE Exporter aggregates mining-relevant slices for humans and downstream consumers, but the current c4-converter executable reads the leaf SoT files directly. Its parsed --uber path is diagnostic only and is not passed to runPipeline().",
    "uberAggregate": "SAGE Editor Suite/UberJSON/uber-export-latest.json",
    "converterEntry": "tools/c4-converter/src/cli.ts",
    "converterPipeline": "tools/c4-converter/src/pipeline.ts",
    "output": "programs/cli/c4-cli/conf/universe.json"
  },
  "decisions": [
    {
      "id": "heat-shockwave-mining-effects",
      "status": "intentional",
      "decision": "Heat and Shockwave weapon groups intentionally modify mining yield and/or mining Ammo consumption through the shared component composition path.",
      "preserveInComposition": true
    },
    {
      "id": "phase-two-scenario-authority",
      "status": "bounded-estimate",
      "decision": "The Mining scenario combines converter-parity configuration stats with explicit operator inputs. It is not live fleet state or a transaction prediction.",
      "liveInputsRequiredForExactResult": [
        "fleet quantity and selected configuration",
        "body and selected resources",
        "current cargo occupancy and per-resource storage cost",
        "Food and Ammo balances",
        "Character, crew, and rare-find modifiers",
        "settlement timing"
      ]
    }
  ],
  "lineage": [
    {
      "id": "ship-base-mining-stats",
      "label": "Ship base mining and consumption stats",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/Ship Configurator/ships/*.json",
      "fields": [
        "ship.asteroid_mining_rate",
        "ship.asteroid_mining_food_rate",
        "ship.asteroid_mining_ammo_rate",
        "ship.cargo_capacity",
        "ship.ammo_capacity",
        "ship.fuel_capacity",
        "ship.loading_rate",
        "ship.required_crew"
      ],
      "display": [
        "SAGE Editor Suite/Ship Stats/",
        "Ship Config Lite/"
      ],
      "uber": "Uber Export/app.js DATA_SOURCES.shipStats loads ship-manifest.json and all listed ship files into shipStats.",
      "converter": "tools/c4-converter/src/sot.ts::loadShipBaseStats reads the leaf files directly; pipeline.ts passes them to phase3 emitShips.",
      "destination": "ships.map[*].configs[*].stats.asteroid_mining_rate / asteroid_mining_food_rate / asteroid_mining_ammo_rate"
    },
    {
      "id": "ship-components-configs",
      "label": "Component and ship-configuration mining effects",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/Ship Configurator/ship_configurations-combatv5.json",
      "fields": [
        "shipConfigurations",
        "components.componentsById",
        "componentAttributes",
        "classScalingFormulas",
        "tierScalingFormulas"
      ],
      "display": [
        "Ship Config Lite/"
      ],
      "uber": "Uber Export/app.js DATA_SOURCES.shipConfigurator loads the complete file into shipConfigurations after removing only locked keys.",
      "converter": "tools/c4-converter/src/stages/phase3-shipstats.ts::composeShipStats applies selected top-level component-group effects with linear multiplier stacking.",
      "destination": "ships.map[*].configs[*].stats and costs"
    },
    {
      "id": "mining-configuration-scenario",
      "label": "Configuration composition and bounded mining scenario",
      "authority": "ses-derived",
      "source": "SAGE Editor Suite/Mining/scripts/mining-compose.mjs and Mining/scenario.js",
      "fields": [
        "mining-configurations.json ships[slug][*].stats",
        "body richness",
        "selected resource count",
        "runtime multiplier",
        "occupied cargo and selected-resource storage cost",
        "authored Food cargo-type storage cost",
        "available Food and Ammo"
      ],
      "converter": "tools/c4-converter/tests/mining-configuration-parity.ts exhaustively compares every generated active configuration with composeShipStats.",
      "destination": "Read-only Mining configuration deltas, runways, limiting factor, and settled-unit estimate",
      "boundary": "The scenario does not query live fleet, cargo, Character, crew, rare-find, eligibility, transaction, or settlement state. Blank Food/Ammo balances are reported as unmodeled runway constraints; Food cargo-volume outflow remains source-derivable from composed burn and authored storage cost."
    },
    {
      "id": "resource-catalog",
      "label": "Resource tier, faction, and authored planet-type metadata",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/C4 Tools/data/resources.json",
      "fields": [
        "resources[*].tier",
        "resources[*].planet_types",
        "resources[*].faction",
        "resources[*].c4_status"
      ],
      "display": [
        "SAGE Editor Suite/C4 Tools/"
      ],
      "uber": "Uber Export/app.js DATA_SOURCES.resources loads resources.json.",
      "converter": "tools/c4-converter/src/sot.ts::loadResourceCatalog is used only when --resource-placement on is selected.",
      "destination": "Map resource placement compiler input; not a standalone universe mining section."
    },
    {
      "id": "resource-locations-richness",
      "label": "Mineable body locations and richness",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/Map Editor/69regions-v10.json",
      "fields": [
        "mapData[*].planets[*].resources[*].name",
        "mapData[*].planets[*].resources[*].richness",
        "mapData[*].regionId",
        "regionDefinitions[*].resource_tiers",
        "regionDefinitions[*].risk_zone",
        "regionDefinitions[*].mining_research_requirements"
      ],
      "display": [
        "SAGE Map Editor/",
        "3D Galaxy Viewer/"
      ],
      "uber": "Uber Export/app.js DATA_SOURCES.mapEditor collects the map file into mapData.",
      "converter": "tools/c4-converter/src/sot.ts::loadMapData reads v10 directly; phase5 emits map data. Resource tier placement and region research gates are optional flags and are default-off.",
      "destination": "map systems/body resource richness and region metadata"
    },
    {
      "id": "mining-research",
      "label": "Mining progression nodes and requirements",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/Research Nodes/research_nodes-careercombatspread.json",
      "fields": [
        "nodes[*].tag",
        "nodes[*].character_value_changes",
        "nodes[*].required_tags",
        "nodes[*].c4_numerical_id"
      ],
      "display": [
        "Research Nodes/",
        "Research Nodes/progression-simulator.html"
      ],
      "uber": "Uber Export/app.js DATA_SOURCES.researchNodes includes the editor nodes.",
      "converter": "tools/c4-converter/src/pipeline.ts loads research nodes directly and phase4 emits them.",
      "destination": "research_nodes; downstream content gates must independently consume granted tags."
    },
    {
      "id": "mining-xp-curve",
      "label": "Mining XP threshold curve",
      "authority": "ses-source",
      "source": "SAGE Editor Suite/C4 Tools/data/level_thresholds_v1.json",
      "fields": [
        "thresholds.mining.levels"
      ],
      "display": [
        "SAGE Editor Suite/Council Rank XP/"
      ],
      "uber": "Uber Export includes the level-threshold slice.",
      "converter": "tools/c4-converter/src/stages/phase2.ts emits the Mining track directly from the leaf SoT.",
      "destination": "level_thresholds.mining",
      "boundary": "Per-action Mining XP accrual is Programs runtime authority, not this curve."
    },
    {
      "id": "runtime-mining-rate",
      "label": "Fleet mining execution, settlement, and XP",
      "authority": "program-runtime",
      "source": "programs/sage/src/state/hangar/fleet/state.rs and instructions/mining/*.rs",
      "fields": [
        "Fleet::mining_rate",
        "Fleet::calculate_mining_tick",
        "StartMiningAsteroid",
        "StopMiningAsteroid",
        "XpCategory::Mining"
      ],
      "destination": "On-chain fleet, asteroid, cargo, Character XP, and crew XP state",
      "boundary": "Current Fleet::mining_rate multiplies aggregate fleet mining_rate by authored body richness. The tick then splits effort evenly across selected resources, applies runtime crew/rare-find modifiers, and clips by Food, Ammo, cargo capacity, and storage cost. No resource-hardness divisor is present in that path."
    },
    {
      "id": "npc-escalation",
      "label": "Mining-triggered NPC escalation",
      "authority": "external-service",
      "source": "Not present in sage-editor or Programs mining configuration at this head.",
      "fields": [],
      "destination": "Nemesis/service policy if such a feature is active",
      "boundary": "Do not invent or migrate thresholds into SES without the service owner and an explicit authority decision."
    }
  ],
  "journeys": [
    {
      "id": "discover-resource-location",
      "label": "Discover a mineable resource and location",
      "status": "fully-derivable",
      "evidence": [
        "resources.json catalog metadata",
        "69regions-v10.json body resources and richness"
      ],
      "gap": "Client/runtime eligibility still needs current on-chain state; region mining requirements are authored but converter emission is optional and Programs enforcement is not established."
    },
    {
      "id": "configure-mining-ship",
      "label": "Select and configure a mining-capable ship",
      "status": "fully-derivable",
      "evidence": [
        "Per-ship asteroid_mining_* base stats",
        "All active v1/v2 selected config components",
        "componentAttributes composition",
        "Exhaustive parity with converter composeShipStats"
      ],
      "gap": "A positive base rate does not by itself prove live ownership, formation eligibility, or current research access."
    },
    {
      "id": "supply-consumables",
      "label": "Supply Food and Ammo for mining",
      "status": "partially-derivable",
      "evidence": [
        "asteroid_mining_food_rate",
        "asteroid_mining_ammo_rate",
        "cargo/ammo capacities"
      ],
      "gap": "Required starting quantities depend on selected resource, available cargo space, cargo storage cost, and intended duration."
    },
    {
      "id": "start-mining",
      "label": "Start mining",
      "status": "runtime-only",
      "evidence": [
        "Programs StartMiningAsteroid instruction"
      ],
      "gap": "SES documents inputs but does not own live account/state validation."
    },
    {
      "id": "monitor-mining",
      "label": "Monitor rate, consumables, progress, and cargo",
      "status": "partially-derivable",
      "evidence": [
        "SES rate/consumption inputs",
        "Programs time-based mining projection"
      ],
      "gap": "Requires authoritative live start time, fleet state, balances, and current cargo occupancy."
    },
    {
      "id": "stop-settle-mining",
      "label": "Stop mining and settle cargo",
      "status": "runtime-only",
      "evidence": [
        "Programs StopMiningAsteroid instruction and mining tick settlement"
      ],
      "gap": "No editable SES balance surface is required for the transaction lifecycle itself."
    },
    {
      "id": "return-dock-unload",
      "label": "Return, dock, and unload mined cargo",
      "status": "runtime-only",
      "evidence": [
        "Programs movement, docking, and cargo instructions"
      ],
      "gap": "This is a connected user journey, not a missing mining balance field."
    },
    {
      "id": "earn-mining-xp",
      "label": "Earn Mining XP",
      "status": "partially-derivable",
      "evidence": [
        "SES Mining level-threshold curve",
        "Programs mining tick XP collection"
      ],
      "gap": "Per-action accrual and budget behavior are runtime authority and must not be copied into a second editable SES number."
    },
    {
      "id": "unlock-mining-progression",
      "label": "Unlock Mining research and equipment tiers",
      "status": "partially-derivable",
      "evidence": [
        "Mining research nodes",
        "component recipe/research gate map",
        "region mining_research_requirements"
      ],
      "gap": "Reverse-link every granted tag to a current runtime consumer; region enforcement remains unproven."
    },
    {
      "id": "time-to-full-cargo",
      "label": "Estimate time to full cargo",
      "status": "partially-derivable",
      "evidence": [
        "Fleet mining rate × richness",
        "cargo capacity",
        "Food/Ammo burn rates"
      ],
      "gap": "SES now exposes a transparent scenario over explicit configuration, richness, selected-resource count, runtime multiplier, cargo occupancy/storage cost, and optional Food/Ammo balances. An exact answer still requires live fleet quantity/config, balances, Character/crew/rare-find modifiers, eligibility, and settlement timing."
    },
    {
      "id": "faucet-comparison",
      "label": "Compare mining with claim-stake and scanning faucets",
      "status": "missing",
      "evidence": [],
      "gap": "No unified expected-yield/time/risk model currently normalizes all three loops."
    },
    {
      "id": "risk-npc-escalation",
      "label": "Understand security and NPC escalation",
      "status": "missing",
      "evidence": [
        "Map region risk zones exist"
      ],
      "gap": "No source-grounded mining-rate threshold → NPC escalation policy is present in SES or Programs at this head."
    }
  ]
}
