# oil-gas-impact-core

Primary TypeScript npm package for deterministic oil and gas source-fit, production normalization, decline-curve, asset-economics, portfolio-screening, lease-operating-statement review, AFE spend review, revenue reconciliation review, cash netback review, well watchlist, monthly operating review, executive monthly ops packets, geology/readiness/spacing/LOE-aware well-intervention workflows, and exact-knapsack intervention budget optimization.

## Install

```bash
npm install oil-gas-impact-core
```

## API surface

- `validateSourcePack`
- `validateSourcePackFromFile`
- `loadProductionDatasetFromFile`
- `loadProductionDatasetFromSource`
- `ProductionRecordConnector` for API/database integrations
- `createHttpProductionConnector`
- `createDatabaseProductionConnector`
- `mapProductionRecord`
- `normalizeProductionDataset`
- `auditProductionQuality`
- `compareProductionSourceFit`
- `compareProductionSourcePacks`
- `compareGeologySourceFit`
- `fitDeclineCurve`
- `forecastProduction`
- `runAssetEconomics`
- `runAssetEconomicsScenarios`
- `runAssetScreenWorkflow`
- `runSourceGovernedAssetScreenWorkflow`
- `runPortfolioScreenWorkflow`
- `runLeaseOperatingStatementReview`
- `runAfeSpendReview`
- `loadLeaseOperatingStatementFromFile`
- `mapLeaseOperatingStatementLine`
- `runRevenueReconciliationReview`
- `loadRevenueStatementFromFile`
- `mapRevenueStatementLine`
- `runMonthlyOperatingReview`
- `runNetbackReview`
- `runWellWatchlist`
- `runExecutiveMonthlyOpsPacket`
- `parseGeologyDataset`
- `parseTypeCurveLibrary`
- `parseInterventionScenarioDefinitions`
- `analyzeWellEfficiency`
- `rankInterventionOpportunities`
- `runWellInterventionScreenWorkflow`
- `runInterventionBudgetOptimizer`
- `runExecutiveInterventionQuicklookWorkflow`
- Markdown/HTML report renderers

## CLI

```bash
oil-gas-impact validate-source-pack --source-pack source-pack.json --out validation.json --report validation.md
oil-gas-impact normalize-production --input production.csv --out normalized.json --report normalized.md
oil-gas-impact audit-production-quality --input normalized.json --out quality.json --report quality.md
oil-gas-impact compare-production-source-fit --left internal.json --right enverus.json --left-label internal --right-label enverus --out source-fit.json --report source-fit.md
oil-gas-impact compare-geology-source-fit --left internal-geology.json --right vendor-geology.json --left-label internal --right-label vendor --out geology-source-fit.json --report geology-source-fit.md
oil-gas-impact fit-decline --input normalized.json --well-id well-a --product oil --out decline.json --report decline.md
oil-gas-impact run-economics --forecast decline.json --assumptions assumptions.json --out economics.json --report economics.md
oil-gas-impact run-economics-scenarios --forecast forecast.json --assumptions assumptions.json --scenarios scenarios.json --out scenarios.json --report scenarios.md
oil-gas-impact run-lease-operating-statement-review --production production.json --statement lease-operating-statement.json --budget budget.json --category-map examples/accounting/category-map.json --run-dir /tmp/accounting
oil-gas-impact run-afe-spend-review --statement lease-operating-statement.json --budget afe-budget.json --run-dir /tmp/afe-spend
oil-gas-impact run-revenue-reconciliation-review --production production.json --revenue-statement revenue-statement.json --ownership ownership.json --run-dir /tmp/revenue
oil-gas-impact run-monthly-operating-review --production production.json --statement lease-operating-statement.json --revenue-statement revenue-statement.json --ownership ownership.json --run-dir /tmp/monthly
oil-gas-impact run-netback-review --production production.json --statement lease-operating-statement.json --revenue revenue-statement.json --ownership ownership.json --run-dir /tmp/netback
oil-gas-impact run-well-watchlist --production production.json --statement lease-operating-statement.json --revenue revenue-statement.json --ownership ownership.json --run-dir /tmp/watchlist
oil-gas-impact run-executive-monthly-ops-packet --production production.json --statement lease-operating-statement.json --revenue-statement revenue-statement.json --ownership ownership.json --run-dir /tmp/executive-monthly
oil-gas-impact run-asset-screen --source-pack source-pack.json --assumptions assumptions.json --well-id well-a --run-dir /tmp/asset-screen
oil-gas-impact run-source-governed-asset-screen --primary-production internal.json --comparison-production enverus.json --primary-label internal --comparison-label enverus --assumptions assumptions.json --well-id well-a --run-dir /tmp/source-governed
oil-gas-impact run-portfolio-screen --primary-production internal.json --comparison-production enverus.json --primary-label internal --comparison-label enverus --assumptions assumptions.json --scenarios scenarios.json --run-dir /tmp/portfolio
oil-gas-impact run-well-intervention-screen --production production.json --geology geology.json --type-curves type-curves.json --candidates candidates.json --assumptions assumptions.json --scenarios intervention-scenarios.json --base-scenario-id base --run-dir /tmp/well-interventions
oil-gas-impact optimize-intervention-budget --intervention-screen /tmp/well-interventions/well-intervention-screen.json --budget-usd 750000 --out intervention-budget.json --report intervention-budget.md
oil-gas-impact run-executive-intervention-quicklook --primary-production internal-production.json --comparison-production vendor-production.json --primary-label internal --comparison-label vendor --geology internal-geology.json --comparison-geology vendor-geology.json --type-curves type-curves.json --candidates candidates.json --assumptions assumptions.json --scenarios intervention-scenarios.json --budget-usd 750000 --run-dir /tmp/executive-quicklook
```

## API/database ingestion

Most enterprise usage should feed records from an API or database connector rather than CSV. Implement `ProductionRecordConnector` and pass it to `runAssetScreenWorkflow` through `productionSource`; file adapters are included for demos, audit fixtures, and data-room exports.

## Boundary

This is professional decision-support software. It does not replace qualified engineering, reserves, finance, legal, tax, regulatory, environmental, safety, or field-operations review.
