Files
Volve-DIA/configs/protocol_v1.yaml
lamlvh 17916650a5 Add M1: OCR hub import, WITSML, labels T1-T3, T4 questions, trial raters, draft protocol
- OCR: match the colleague's full-set Dataset Hub export to the DDRs by content
  (3,059/3,066 pages) and QC it against the HTML (CER 2.40%, exact 0.9181).
- WITSML parser and formation tops: 21 DDR wellbores with time logs, 1,384
  reports; WITSML 15/9-F-15 S is DDR 15/9-F-15.
- Deterministic labels T1-T3 (configs/labels.yaml), 1,662 T4 questions with SQL,
  pandas and raw-XML answers in full agreement.
- Trial label validation by three blind LLM raters (not an author or expert audit)
  and rater agreement script; draft protocol_v1 (not locked): split by well.
- Literature notes and BibTeX; docs, report and run_m1.sh synchronised.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 08:34:35 +00:00

251 lines
18 KiB
YAML

# Volve-DIA evaluation protocol v1 -- DRAFT, NOT LOCKED.
#
# This file is locked at gate G1 (M2, before the first model run) by writing its SHA-256 to protocol_v1.yaml.sha256.
# After the lock it is never edited and no threshold is relaxed: a change becomes protocol_v2 with a recorded
# deviation. Until the lock every item is a proposal that the label validation (M2) may still change; items under `open:`
# are undecided. docs/plan.md sections 4.2-4.7 and 6 give the reasoning; the label numbers quoted here are from
# outputs/labels/summary.json (configs/labels.yaml sha256 0b1f877f2f9c...) and outputs/t4/summary.json.
protocol: volve-dia
version: 1
status: draft # draft -> locked (G1)
drafted: 2026-11-17
# ----------------------------------------------------------------------------------------------------------------
# What the protocol is about: frozen inputs (hashes are filled in at the lock)
# ----------------------------------------------------------------------------------------------------------------
inputs:
data_manifest: {file: data_manifest/volve_dia.json, sha256: null}
labels_config: {file: configs/labels.yaml, sha256: null}
t4_templates: {file: configs/t4_templates.yaml, sha256: null}
label_tables: {dir: outputs/labels, summary_sha256: null}
t4_questions: {dir: outputs/t4, summary_sha256: null}
ground_truth: "DDR XML (scripts/02_parse_ddr.py) and WITSML (scripts/06_parse_witsml.py) only; HTML, PDF and OCR
text are model inputs at most, never labels or answers"
# ----------------------------------------------------------------------------------------------------------------
# Splits
# ----------------------------------------------------------------------------------------------------------------
splits:
# Evidence (17/11/2026, outputs/labels/analysis.md):
# * the 26 DDR wellbores belong to 11 wells; sidetracks of one well follow each other in time, 16 report days are
# shared by two wellbores of a well;
# * verbatim comments of >= 40 characters recur in a sibling wellbore in 0.30% of cases and in another well in
# 0.96%, so text duplication alone does not force a split by well;
# * but siblings share the slot, the upper hole and the formations at the same depths: 191 of the 844 positive
# T3 cells (definition a) lie above the wellbore's own hole top, i.e. in hole shared with the parent;
# * the two public Volve repositories with grouped splits (Anatoly5ms: 11 wells; DrillScribe: 23 nameWell) both
# keep sidetracks with their parent well.
# Decision: group by WELL; the split by wellbore is a sensitivity analysis for the main baselines only.
group: well # volve_dia.names.well_of
sensitivity_group: wellbore
# Decision (was open): leave-one-well-out. It needs no fold-assignment table (one less researcher choice), every
# well is predicted exactly once, and scores are computed on the pooled out-of-fold predictions, so the unequal
# fold sizes (15/9-19: 375 reports, 15/9-F-7: 39) do not weight the folds. GroupKFold(5) was the alternative; it
# does not help the rare classes either, because their concentration is a property of the wells (see below).
outer: leave_one_group_out # 11 folds on DDR-only tasks; on T3/T5 the wells with WITSML time logs
inner: {method: group_k_fold, n_splits: 5, group: well} # all tuning inside the training wells of a fold
scoring: pooled_out_of_fold # one prediction per item, from the fold that held its well out
rule: "nothing (hyperparameter, prompt, threshold, class merge, few-shot example) is chosen on a test well"
# Systems that are not trained per fold (prompted LLMs, retrieval pipelines) cannot tune inside a fold. Their
# prompts, few-shot examples and thresholds are developed only on two development wells, fixed here by a rule:
# the two wells with the fewest DDR reports. Every system, trained or not, is also scored on the other nine wells,
# which is the table where prompted and trained systems are compared.
development_wells: ["15/9-F-7", "15/9-F-9"] # 39 and 60 reports; T2 NPT (a) 54 + 161 rows; T4 54 + 102 questions
# ----------------------------------------------------------------------------------------------------------------
# Inputs a model may see (leakage control)
# ----------------------------------------------------------------------------------------------------------------
masking:
masked_fields: [proprietaryCode, code_main, code_sub, state, stateDetailActivity]
# Other report content that states the label outright is withheld from T2/T3 inputs as well.
withheld_for_t2_t3:
- equip_failures # names the failure; 67.6% of the 325 reports with rows have equipment NPT (b)
- daysAhead # schedule variance accumulates with NPT
- daysBehind
# rig_phase (fixed / wire line) is not an activity code; NPT (a) rate 15.6% vs 12.9%. Kept as an input.
input_view: "table t2_inputs (volve_dia.labels.t2_inputs raises if a masked column appears) plus the comments of
the previous and next activity of the same report"
modes:
masked: primary # results in the main tables
unmasked: leakage_ablation # same models with the codes in the input; reported side by side
t3_causality: "features only from activities, reports and WITSML samples that end before the start of the
predicted interval (t3_intervals.first_start_utc); checked by hand on a sample of windows"
t1_hole_size: "diaHole, diaPilot, mdDiaHoleStart, bit size and casing size are withheld whenever the section is
the target; sizes named in the text stay (they are the evidence a reader uses)"
# ----------------------------------------------------------------------------------------------------------------
# Class evaluability under the split by well (decided on label distributions only, never on model results)
# ----------------------------------------------------------------------------------------------------------------
class_evaluability:
# A class can be learned and tested across wells only if several wells hold it. Rule: a class is scored on its
# own only if at least `min_wells` wells hold at least `min_items_per_well` items of it in the scored label set.
# Otherwise it is merged as listed in `merges`, or dropped from scoring and its items reported separately.
min_items_per_well: 5
min_wells: 3
# Result of the rule on the current labels (recomputed on the frozen labels at G1; the lock records the final
# table). Concentration: sidetrack 100% in well 15/9-19; lost_circulation 87% in 15/9-19; well_control 79% in
# 15/9-F-15; section 6" and 9.875" only in 15/9-19.
preview:
t2_cause:
fail: [sidetrack, lost_circulation, well_control, hse]
# lost_circulation + well_control together still fail (>= 5 items in 2 wells: 15/9-19 73, 15/9-F-15 24), so
# both join stuck_fishing in the usual "hole problem" group; stuck_fishing (passes on its own) keeps a
# per-class F1 inside the merged class as a secondary number.
merges:
downhole: [stuck_fishing, lost_circulation, well_control]
sidetrack: "dropped from the cause target (202 rows, one well; most comments read as ordinary drilling); kept
as NPT in the binary target; the binary T2 score is also reported without these rows"
hse: "1 row (definition b only); dropped from the cause target"
t1_section:
fail: ["6", "9.875"]
merges: {"8.5_and_smaller": ["8.5", "6"]} # both map to phase `reservoir` in labels.yaml
drop: ["9.875"] # 4 drilling days, one well; reported, not scored
t1_op_class: {fail: [], note: "every non-interruption class holds >= 5 rows in >= 6 wells"}
class_merging:
# G1 rule (plan section 6): a class with kappa < 0.6 against the blind LLM raters (median over raters), or with
# fewer than 20 rated items,
# is not reported as its own class: it is merged into its parent group or dropped, and the merge is recorded here.
# Applied after class_evaluability.
min_kappa: 0.6
min_audit_items: 20
merges: [] # filled at G1
# ----------------------------------------------------------------------------------------------------------------
# Tasks, labels and metrics
# ----------------------------------------------------------------------------------------------------------------
tasks:
t1:
section:
unit: report_day
scope: drilling_day # 932 days; other_day (818: completion, P&A, workover) is not scored, because
# its section is the last one drilled, often years earlier
primary_subset: published # 672 drilling days with diaHole in the XML
secondary_subset: filled # 260 drilling days filled by labels.yaml t1.fill (ffill 255, bfill_leading 5);
# scored and reported separately, never pooled into the headline number
metrics: [macro_f1, per_class_f1]
op_class:
unit: activity
classes: "labels.yaml op_class without `interruption` (that class repeats T2 definition a)"
scope: "all activities that are not interruption rows (19,870)"
metrics: [macro_f1, per_class_f1]
secondary: op_group # 7 coarse groups, reported alongside
t2:
unit: activity
targets: [npt, cause_group]
npt_definition:
candidates: {a: interruption_only, b: union} # 3,577 vs 4,286 rows
# Pre-registered rule, decided on label validation, never on model results: the primary definition is the
# candidate with the higher Cohen's kappa against the blind LLM raters (median over raters); on a tie (|delta kappa| < 0.02) `a`.
choose_by: llm_rater_median_kappa
primary: null # filled at G1
# The 79 `wait` rows outside the interruption group are not NPT under a or b (1 of them is b through
# state=fail); they are not a third candidate, and their rate in the audit is reported.
cause_precedence: "code before stateDetailActivity (labels.yaml t2.precedence); the 192 conflicts are reported
and the cause score is also given with the order reversed"
metrics: [f1_npt, pr_auc_npt, macro_f1_cause, per_class_f1]
reference_baselines: [majority, comment_length_only, text_lexicon] # DrillScribe: length alone F1 0.772;
# lexicon: recall 0.33, precision 0.51
t3:
unit: md_bin # 10 m grid, labels.yaml t3
wellbores: with_witsml # wellbores with DDR and WITSML time logs (outputs/witsml)
# Only half of the NPT rows can be placed in depth (md == 0 in 9,116 of 23,447 rows): (a) 50.3% of NPT rows,
# 44.6% of NPT hours. T3 therefore scores where trouble was recorded in depth, not all trouble.
cell_universe: "own hole: from the wellbore's own hole top (smallest mdDiaHoleStart) to its deepest in-hole
depth; cells above it (shared with the parent) are reported separately, not scored"
metrics: [interval_iou, pr_auc_bin]
t4:
unit: question
answers: sql # outputs/t4; pandas and raw-XML re-implementations agree on 1,662 / 1,662
questions: {total: 1662, answerable: 1638, unanswerable: 24}
metrics: [answer_accuracy_within_tolerance, citation_precision, citation_recall, fabricated_number_rate,
wrong_wellbore_rate, abstention_on_unanswerable]
averaging: "macro over the five families (lookup, aggregation, temporal_event, comparison, multi_hop) as the
headline; micro and per-template numbers alongside"
citation_level: "report level (cited report_id) for every question; row level only for the 1,493 questions
with at most 50 evidence rows (169 have more)"
tolerance: "per template in configs/t4_templates.yaml"
input_modalities: "XML/SQL, HTML text, OCR text. The modality comparison (RQ5) uses only the 1,447 questions
whose answer is printed in the render (printed_in_render); the 215 XML-only questions are
scored for XML/SQL systems and reported apart"
scopes: "pair questions (92) compare wellbores of one well and go with that well; the 10 field questions are
scored on their own line and enter no per-well number"
llm_judge: "only for free-text parts and only if gate G3 passes"
# ----------------------------------------------------------------------------------------------------------------
# Statistics
# ----------------------------------------------------------------------------------------------------------------
statistics:
seeds: [0, 1, 2] # at least 3 for every stochastic model; deterministic models run once
ci: {method: cluster_bootstrap, cluster: well, resamples: 2000, level: 0.95, seed: 20261117}
comparisons: "paired on the same folds; paired cluster bootstrap of the score difference"
report_all: "every run is reported, failures included"
# ----------------------------------------------------------------------------------------------------------------
# Label validation (plan section 4.4)
# ----------------------------------------------------------------------------------------------------------------
validation:
trial_audit:
rows: 100
when: M1
purpose: "pipeline check and a first agreement estimate; not used for G1"
tool: "scripts/09_audit.py (sample: seed 20261117, zones a 35 / b_only 15 / none 50, stratified by class within
the zone, spread over wells; score: kappa unweighted and weighted to the population)"
# Decision of 17/11/2026 (plan section 12 item 20): no human rater is available, so label validation uses blind
# LLM raters, not an author audit. The claim is "validated by blind LLM raters and cross-checks", never "audited
# by the author" or "expert-labelled". Each rater is a different model family (Sonnet, Opus, Haiku in the trial;
# M2 adds at least one open-weight model), sees only the masked view (no code, no label, no key), rates every
# row alone with no keyword rules, and is never shown another rater's output. Reported: kappa of each rater
# against the code labels, kappa between raters (Fleiss and pairwise), and the disagreements. A human rater, if
# one becomes available, is added as a further rater and reported on its own line.
llm_raters:
trial: {rows: 100, when: M1, models: [sonnet, opus, haiku], files: "outputs/audit/trial_100/RATINGS_llm_*.csv"}
audit_1: {rows: 300, when: M2, strata: [zone, cause_group, well], masked: true, min_raters: 3,
second_pass_after_days: 14, note: "second pass = same model rerun, for rater self-consistency"}
decision_statistic: median_over_raters
caveat: "LLM raters share training data and conventions with the LLM baselines of M3-M4; agreement with the
code labels is evidence of consistency with a text reading, not of expert correctness"
# Third-party label sets (docs/literature_notes.md, 17/11/2026): none is an independent drilling-NPT label set.
# DrillScribe episodes are runs of stateDetailActivity (rebuilt 1,758/1,758 from our activities), Bassey 2026
# labels daily production data, the OMAE 2024 stuck-pipe set has no label column. They are used as follows and
# never reported as independent agreement. The blind LLM raters and the cross-checks together carry the
# label-validity claim; the absence of a human rater is stated as a limitation.
cross_checks:
drillscribe: "parser cross-check (episodes rebuilt from the XML) and a T2 reference number; not a label source"
anatoly5ms_text_rules: "comment regex rules re-implemented with attribution; agreement with T3 reported as a
partly code-independent check"
omae_2024_stuck_pipe: "three case-level checks (F-4, F-9 A, F-1) of what the DDR records at the incident"
bassey_2026: "not used for T2/T3 (production events); cited as a precedent for rule-built labels"
kappa: cohen
# ----------------------------------------------------------------------------------------------------------------
# To do before the lock (M2)
# ----------------------------------------------------------------------------------------------------------------
before_lock:
- "run the blind LLM-rater validation (300 rows, >= 3 raters) and its second pass; fill npt_definition.primary and class_merging.merges"
- "recompute class_evaluability on the frozen labels and copy the final table here"
- "fill the sha256 fields of `inputs`"
- "fix the T3/T5 well list from outputs/witsml (wells with time logs) and check that every LOGO fold has
positives in its training wells"
# ----------------------------------------------------------------------------------------------------------------
# Gates (plan section 6); thresholds fixed at the lock, only dates may move
# ----------------------------------------------------------------------------------------------------------------
gates:
g1: "protocol locked (sha256) before any model run; class_evaluability and class_merging applied"
g2: "all baselines and the masked/unmasked ablation on every task, >= 3 seeds, CI by well; results reported
whatever their direction"
g3: {llm_judge_min_kappa: 0.6, else: "T4 reports automatic metrics only"}
g4: "the release package reruns from scratch; third-party label licences checked"
# ----------------------------------------------------------------------------------------------------------------
# WITSML feature rules (decision of 17/11/2026, plan section 12 item 21)
# ----------------------------------------------------------------------------------------------------------------
witsml_features:
# Tables keep the published values (provenance); the feature stage treats these as missing. Evidence:
# outputs/witsml/log_suspects.parquet (-999 on MWD_* channels 224,841 values; 99999 on ANNVEL_MMIN 279,676 of
# 279,866; 9999 on time-counter channels; huge values on RETI, SPPA, TQA).
treat_as_missing: {values: [-999, -99999, 99999, 9999], abs_greater_than: 1.0e15}
depth_source: drill_depth # view over GenTime Depth/BITDEP and Schlumberger DMEA/DBTM; never time_log_dedup Depth
formation_labels: Well_picks_Volve_v1.dat # DDR stratInfo only as a cross-check