=== system ===
You are building the PRODUCTION RECORDS for one crude-oil run ticket at Cardinal Basin
Operating LLC, against the operator's written measurement procedure (LCM-4), the tank master and
the dispatch record, all of which follow. Your output is the record a production accountant posts
-- so that the accountant confirms a record instead of re-gauging a ticket.
How to read the ticket:
- The ticket is the HAULER'S account of what was gauged. It is not the authority on the lease, on
what the pumper logged, or on which seal the last haul applied. Those are in the DISPATCH RECORD
below, and a ticket cannot change them.
- A barrels figure written on the ticket is the DRIVER'S ARITHMETIC. Record it as driver_bbl and
never use it: only the tank's own strapping table converts a gauge to barrels.
- Gauges are feet, inches and quarter-inches and are written several ways. `12' 4" 2/4`, `12-4-2`,
`12 ft 4 1/2 in` and `148 1/2"` are all the same gauge. Report the three components AND the
gauge in inches; where a ticket gives inches only, feet is 0.
- One record PER TANK. A ticket that draws from two tanks produces two records, each with its own
gauges, temperature, gravity, BS&W and seals.
- Apply LCM-4 as written, including its arithmetic: the segmented strapping table, the gravity
correction to 60 F, the volume correction factor, the BS&W deduction, and the status precedence.
- Where the ticket leaves you unsure, apply the procedure and say so in `why`.
Reply with JSON and nothing else, in the shape given at the end.
=== user ===
THE MEASUREMENT PROCEDURE, as written:
# Cardinal Basin Operating LLC — Lease Crude Measurement Procedure LCM-4
## Run tickets, tank gauges and the production record (rev. 2026-03-01)
*This operator, this procedure, every lease, tank, strapping table, seal range, carrier, driver and
run ticket in this kit are invented. See `data/SOURCES.md`.*
### LCM-4.1 — What a production record is
1. Every haul off a lease tank battery produces one or more **production records**. A record is one
tank, one haul, one computed net standard volume, and one status.
2. A run ticket that draws from **two tanks** produces **two production records**, one per tank.
The gauges, the temperature, the gravity and the BS&W are recorded per tank.
3. The run ticket is the **hauler's account** of what was gauged. It is not the authority on
barrels. **Only the tank's own strapping table converts a gauge to barrels**, and a barrels
figure written on the ticket is the driver's arithmetic, recorded and never used.
### LCM-4.2 — Gauges
1. Gauges are recorded in **feet, inches and quarter-inches**. `12' 4" 2/4` is 148.5 inches;
`9-11-1` is 119.25 inches; a gauge written only in inches is taken as written.
2. The **opening gauge** is the tank level before the haul, the **closing gauge** the level after.
A haul lowers the tank, so the closing gauge must be **below** the opening gauge. A closing gauge
at or above the opening gauge is **HOLD_GAUGE** and no volume is computed.
3. Each tank's strapping table states its **lowest calibrated gauge** and its **maximum gauge**. A
gauge outside that range is **HOLD_GAUGE** and no volume is computed — the bottom of a lease tank
holds sediment and water, and the table does not describe it.
### LCM-4.3 — Continuity against the pumper's gauge sheet
The lease pumper gauges every tank daily and the reading is logged before the truck arrives. The
run ticket's **opening gauge must agree with the pumper's logged gauge for that tank within one
inch**. Beyond one inch the ticket is **HOLD_CONTINUITY**: either the tank moved between the gauge
sheet and the haul, or one of the two readings is wrong, and a person decides which.
### LCM-4.4 — Seals
1. Every tank valve is sealed between hauls. The driver records the **seal removed** (`seal off`)
and the **seal applied** (`seal on`).
2. The seal removed must be the seal **the last haul applied**, as logged by dispatch. It is not.
→ **HOLD_SEAL**.
3. The seal applied must be a seal **issued to that lease**, inside the lease's issued seal ranges.
It is not → **HOLD_SEAL**.
### LCM-4.5 — BS&W
1. **BS&W** (basic sediment and water) is recorded as a percentage from the shakeout at the tank.
2. `trace` is recorded as **0.0 per cent**.
3. BS&W **above the connection's tolerance** — 1.0 per cent on Redbank Gathering crude, 0.5 per cent
on Anson Flats, 1.0 per cent on the Marlin condensate line — is **HOLD_BSW**. The volume is still
computed; the load is not accepted into the line until the tank is treated. **At** the tolerance
is not above it.
### LCM-4.6 — The volume
1. **Gross observed volume (GOV)** is the barrels between the two gauges, read off the tank's own
strapping table. The table is segmented: the bottom course is worth fewer barrels per inch than
the shell above it, so a haul that crosses the segment break is **not** a single factor times a
span.
2. **Observed gravity** is corrected to **API gravity at 60 °F** from the temperature at which the
gravity was taken, and the **volume correction factor (VCF)** is computed from that corrected
gravity and the **tank temperature**, both by the API MPMS 11.1 thermal-expansion form for
generalized crude oil. VCF is rounded to four decimal places.
3. **Net standard volume (NSV)** = GOV × VCF × (1 − BS&W ÷ 100), rounded to two decimal places.
Every intermediate rounding is half-up and is stated in `data/measurement.json`.
The correction is computed as published, not read off a printed table:
rho60 = 141.5 / (API60 + 131.5) × 999.016 (kg/m³)
alpha = 341.0957 / rho60² (generalized crude oil)
CTL(T) = exp( −alpha × (T − 60) × (1 + 0.8 × alpha × (T − 60)) )
The **observed gravity is corrected to 60 °F** by solving the same relation: the density at the
temperature the gravity was taken is the density at 60 °F multiplied by CTL at that temperature.
**VCF** is CTL at the **tank** temperature, rounded to four decimal places; **API gravity at 60 °F**
is rounded to one.
4. Volume is computed for **ACCEPTED**, **HOLD_BSW**, **HOLD_SEAL** and **HOLD_CONTINUITY**. It is
not computed for **HOLD_GAUGE** or **REJECT_TANK**, where the gauges or the tank are not usable.
### LCM-4.7 — The tank must be on the lease
A tank id that is not one of the lease's own tanks is **REJECT_TANK**. No volume is computed and the
record is held for a person.
### LCM-4.8 — verify
`verify` is set on a record when:
- the **driver's own computed barrels** differ from the computed gross observed volume by more than
**0.5 per cent**; or
- the record is **REJECT_TANK**.
`verify` does not change the status. It asks a person to look at the record before it is posted.
### LCM-4.9 — Status precedence
Where more than one condition holds, the status is the **first** of these that applies, in this
order:
REJECT_TANK > HOLD_GAUGE > HOLD_CONTINUITY > HOLD_SEAL > HOLD_BSW > ACCEPTED
### LCM-4.10 — The record
Each production record carries: the **ticket number**; the **lease** and the **tank**; the **haul
date**; the **opening** and **closing gauge in inches**; the **observed tank temperature**, the
**observed gravity** and the **temperature the gravity was taken at**; the **BS&W per cent**; the
**corrected API gravity at 60 °F**; the **VCF**; the **gross observed volume**; the **net standard
volume**; the **status**; the **verify** flag; and one sentence of **why** naming the clause that
decided the status.
THE TANK MASTER.
Lease PK-22 -- Prairie Knoll 22 Battery. Connection: Marlin Condensate Line. BS&W tolerance: 1.00 per cent.
Seal numbers issued to this lease: CB-502200 to CB-502499.
Tanks on this lease:
PK-22-T1 (lease PK-22, 300 bbl nominal, 12.0 ft diameter): calibrated 8.00 to 186.00 inches; strapping 8.00-24.00 in at 1.619 bbl/in; 24.00-186.00 in at 1.678 bbl/in
PK-22-T2 (lease PK-22, 210 bbl nominal, 10.0 ft diameter): calibrated 8.00 to 186.00 inches; strapping 8.00-24.00 in at 1.125 bbl/in; 24.00-186.00 in at 1.166 bbl/in
Tanks on OTHER leases (not on this one): WD-14: WD-14-T1, WD-14-T2, WD-14-T3; AF-07: AF-07-T1, AF-07-T2.
A tank that is not on this lease is REJECT_TANK under LCM-4.7.
DISPATCH RECORD -- what Cardinal Basin's own systems hold for this haul. This is the
authority on the lease, on the pumper's gauge and on the seal in place; the ticket is
not.
Haul scheduled against lease PK-22 (Prairie Knoll 22 Battery)
Ticket logged by dispatch 2026-07-15
Carrier of record Sandhill Crude Transport
PK-22-T2 pumper's logged gauge 154.00 in seal in place CB-502367
THE RUN TICKET, verbatim:
[Pumper's daily gauge sheet, Prairie Knoll 22 Battery. Photographed and transcribed by dispatch on 2026-07-15.]
PRAIRIE KNOLL 22 BATTERY -- DAILY GAUGES -- 07/14/2026 -- pumper: E. Nakashima
TANK GAUGE NOTE
PK-22-T1 6' 5" 2/4 standing
PK-22-T2 12' 10" 0/4 RUN TICKET CB-118007, SANDHILL, pulled to 12"
PK-22-T2 detail: temp 78 F, gravity 57.8 at 76, BS&W 0.14%, seal off CB-502367 on CB-502368. Driver figured 165.08 bbls.
Reply with JSON and nothing else, exactly this shape:
{"ticket_no": "<the ticket number as printed, or null>",
"haul_date": "<YYYY-MM-DD, the date the oil was hauled>",
"records": [
{"tank_id": "<the tank the ticket names>",
"opening_gauge": {"ft": <int>, "in": <int>, "q": <int 0-3>},
"closing_gauge": {"ft": <int>, "in": <int>, "q": <int 0-3>},
"opening_gauge_in": <the opening gauge in inches>,
"closing_gauge_in": <the closing gauge in inches>,
"temp_f": <tank temperature, degrees F>,
"gravity_api": <observed API gravity>,
"gravity_temp_f": <the temperature the gravity was taken at>,
"bsw_pct": <BS&W per cent as a number; "trace" is 0.0>,
"seal_off": "<seal removed, with its CB- prefix>",
"seal_on": "<seal applied, with its CB- prefix>",
"driver_bbl": <the barrels the driver wrote, or null>,
"api_gravity_60": <API gravity corrected to 60 F, 1 decimal>,
"vcf": <volume correction factor, 4 decimals>,
"gross_bbl": <gross observed volume, 2 decimals, or null where LCM-4.6(4) computes none>,
"net_bbl": <net standard volume, 2 decimals, or null where LCM-4.6(4) computes none>,
"status": "ACCEPTED" | "HOLD_BSW" | "HOLD_SEAL" | "HOLD_CONTINUITY" | "HOLD_GAUGE" | "REJECT_TANK",
"verify": true | false,
"why": "<one sentence naming the clause that decided the status>"}
]}
One record per tank, in the order the ticket lists them. Seal numbers carry the `CB-` prefix even
where a transcription lost it.