Files
Volve-DIA/AGENTS.md
lamlvh 5ffc8b3008 Set the paper title and record the naming decision
Title: "Volve-DIA: A leakage-controlled benchmark for daily drilling
reports and real-time drilling data". The naming survey and rationale
are in plan.md section 12 item 22, report.html decision D-14 and the log.
AGENTS.md gains a next step to check the Equinor Open Data Licence text
before choosing the release licence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:20:57 +00:00

56 lines
10 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AGENTS.md
Volve-DIA: a public benchmark and baselines for drilling-context recognition, NPT/trouble-interval identification and evidence-grounded question answering over the Volve daily drilling reports (DDR) and WITSML real-time data. Paper title (decided 17/11/2026, plan §12 item 22): *Volve-DIA: A leakage-controlled benchmark for daily drilling reports and real-time drilling data*; never put "first", "expert" or "human-annotated" in the title. One author; target a Q2 journal (Geoenergy Science and Engineering first). Direction chosen on 29/10/2026 (`docs/danh-gia-huong-NCKH-2026-10-29.md`, local only).
Read first: `docs/plan.md` (plan, gates, decisions; §1 data facts, §6 roadmap, §10 forbidden claims, §12 decision log), `README.md` (setup, scripts, logging), `docs/danh-gia-huong-NCKH-2026-10-29.md` (why this direction, competitors, references; local only, not in git), `docs/technical_overview.md` (a lecture for newcomers: drilling, DDR, leakage, tasks, labels, OCR, evaluation, code map). Progress page: `report.html`. These docs are in Vietnamese.
## Status (17/11/2026)
- **P0 (infrastructure) done and committed** (first commit on `main`, 29/10/2026). The project folder is `/home/jovyan/lamlvh/Volve-DIA`; remote `origin` `https://gitea.vts-ai.space/lamlvh/Volve-DIA` is **public**. `scripts/run_p0.sh` runs scripts 00–05 and the tests.
- **M1 machine work done on 17/11/2026, not committed** (git shows many untracked and modified files; commit only when the user asks). `scripts/run_m1.sh` chains the M1 steps but has not been run end to end. Last pytest run by the WITSML agent: 141 passed.
- **Data:** `data/Volve` is now a real directory (no longer a symlink); `/home` has about 75 GB free (98%). The manifest holds 25,571 files (formation tops added), `--check` ok. Third-party material is in `data/third_party/` (untracked).
- **DDR XML:** 1,759 reports, 26 wellbores (11 wells), 23,447 activities; counts locked in `EXPECTED`. Render bugs: *Tight well* and *HPHT* ("Y" in every HTML), and the Bit Record "End mMD" column (prints `bitRun_mdHoleStart`). `03` covers only the header, 31 fields, summaries and Operations.
- **OCR:** a colleague ran the full OCR and exported it through Dataset Hub (credentials only in `.env`, never in committed files or runlog commands). `scripts/04_ocr_hub.py` matches pages to DDRs by content (3,059 of 3,066 pages, 1,752 of 1,759 reports complete; 7 pages unmatched, 16 pages with a date disagreement not yet inspected). QC on the hub pages (`scripts/05_ocr_qc.py --source hub`, 1,752 reports): content CER 2.40%, WER 5.56%, exact 0.9181; depth fields and rig name are the weakest. The shared vLLM service is not used any more; `04_ocr.py` and its page cache stay for the pilot.
- **WITSML** (`06_parse_witsml.py`, written by a subagent; its figures are locked in `EXPECTED` and 30 tests): 21 DDR wellbores have time logs (not 14), 1,384 reports (not 964); WITSML `15/9-F-15 S` is DDR `15/9-F-15` and two more names are shifted by one. Formation tops: 409 picks, 24 DDR wellbores with own picks, 2 with shared picks. Tables in `outputs/witsml/` (2.2 GB, gitignored).
- **Labels T1–T3** (`07_labels.py`, `configs/labels.yaml`): T1 section with forward fill (672 published + 260 filled drilling days), T2 NPT (a) 3,577 rows / (b) 4,286 rows, T3 844 / 979 positive cells (only 50% of NPT rows can be located in depth).
- **T4** (`08_t4_questions.py`, `configs/t4_templates.yaml`): 1,662 questions from 39 templates; SQL, independent pandas and raw-XML answers agree 100%.
- **Protocol:** `configs/protocol_v1.yaml` is a **draft, not locked** (split by well with leave-one-well-out; development wells F-7 and F-9; class evaluability rule: at least 3 wells with at least 5 items; NPT definition a unless audit 1 says otherwise). Locked by SHA-256 at G1, before any model run.
- **Trial audit:** 100 masked items drawn (`09_audit.py sample`, `outputs/audit/trial_100/`) and rated blind by three LLM raters (Sonnet, Opus, Haiku; `RATINGS_llm_*.csv`, `scripts/09_rater_agreement.py` -> `raters.json`). They are **LLM raters, not an author audit**: never describe them as the author's, a human or an expert audit. Median weighted kappa against the code labels: NPT a 0.553, NPT b 0.574, cause a 0.456, operation class 0.434; Fleiss between raters about 0.66. No human rated; there is no human time per row.
- **Literature:** `docs/literature_notes.md`, `docs/references.bib`. No public NPT label set on Volve is independent of the DDR codes; the plan's "three independent label sets" was dropped. PetroAgents full text read (`docs/lit_petroagents.pdf`): well-day unit, 60-example samples, leakage ablation on 30 examples, split by wellbore.
- Nothing is running.
- **Agents:** delegate to Sonnet; to Opus only for very complex work; do not use Fable (user decision 17/11/2026).
## Next
Roadmap and gates: `docs/plan.md` §6, §12 item 1.
1. M2 label validation is by blind LLM raters (at least 3 model families, 300 rows, second pass), not an author audit: no human rater is available (decision 17/11/2026, plan §12 item 20). Never call it an author, expert or manual audit.
2. C4 reports results with and without the 16 date-disagreement pages; the 7 unmatched reports are dropped.
3. Decided 17/11 (plan §12 item 21): WITSML suspect values (-999, -99999, 99999, 9999, |v| > 1e15) are missing at feature stage; formation picks file is the label source; 7 unmatched OCR reports are dropped from C4; NPT definition a vs b decided at M2 (trial favours b by 0.021, not conclusive).
4. M2: blind LLM-rater validation (about 300 rows, strata zone, cause group, well), cross-checks against DrillScribe and a re-implementation of the Anatoly5ms text rules, then lock `protocol_v1` at G1.
5. Check the text of the Equinor Open Data Licence named on the Volve page before choosing the release licence (the Conventions say CC BY-NC-SA 4.0).
6. Read in full: EAGE 2026101276, SPE-236554-MS, SPE-235330-MS, IPTC-25191-MS.
## Conventions
- **Ground truth:** every label and every T4 answer comes from the XML (and WITSML), by code, with provenance. HTML and PDF are renders: never take a label from them. Labels are only *validated* (blind LLM raters, cross-checks with third-party sets, calibrated judge), never created by raters. No human rater is available, so no result may be called a human, author or expert audit.
- **No leakage:** activity codes (`proprietaryCode`, `stateDetailActivity`, `state`) are masked in model inputs for T2 and T3. T3 uses only features from before the event. Splits are by wellbore (GroupKFold); nothing is chosen on test wellbores. Report results with and without the masked codes.
- **Locked protocols:** the evaluation protocol is locked by SHA-256 before the first model run. Never edit a locked protocol or relax a threshold. New decisions go into a new protocol with a recorded deviation. Report results as they come out, including failures.
- **OCR service and Dataset Hub:** the Hub URL, dataset id and API key live only in the untracked `.env` (`DATASET_HUB_URL`, `DATASET_HUB_API_KEY`, `VOLVE_DIA_OCR_HUB_DATASET`); never put them on a command line, in a committed file or in output shown to the user. The OCR service URL lives only in the untracked `.env` (`VOLVE_DIA_OCR_URL`; template `.env.example`). Read it only through `volve_dia.ocr.service_url()`. Never put it on a command line (`runlog` records the command in `logs/index.csv`), in a committed file, or in output shown to the user. The service is shared with vopec-chatbot: keep `workers: 4`. The model, prompt hash, dpi, max_tokens and temperature form the page-cache key, so changing one re-reads every page.
- **Git:** work on `main`. Do not create branches unless the user explicitly asks. Commit only when the user asks. End commit messages with a co-author line for the agent.
- **Language:** code, figures, paper text and commit messages in academic English. `README.md`, `docs/plan.md`, `docs/technical_overview.md`, `report.html` and explanations to the user in Vietnamese.
- **Decisions:** decide from evidence and proceed.
- **Keep docs in sync (every task):** whenever a run starts, finishes, fails or is stopped, or a result, decision, script or file changes, update in the same turn every file that states it: `report.html` (task status, results, decisions, log), `docs/plan.md` (§0, §1, §6, §12), `AGENTS.md` (Status, Next) and where relevant `README.md` (scripts, run commands) and `docs/technical_overview.md` (results story, code map). Before ending the turn, grep these files for older statements about the same item (for example "not started", old counts or dates) and correct them, so no two files disagree.
- **Shared server:** never touch other users' jobs. Set `OMP_NUM_THREADS`, `MKL_NUM_THREADS` and `OPENBLAS_NUM_THREADS` explicitly when running by hand (the machine default is 40); `run_p0.sh` sets them to 4.
- **Long runs:** detach multi-hour runs with `setsid nohup ... > /dev/null 2>&1 &` so they survive the agent session, and wrap them with `scripts/runlog.sh` (the log is in `logs/runs/`). `04_ocr.py` resumes from the page cache.
- **Licence and confidentiality:** Volve is CC BY-NC-SA 4.0 (Equinor and the Volve licence partners): release derived labels and code under the same licence, non-commercial, with attribution. `docs/NCKH_Ban TD.DOCX` is an internal PVEP document: never commit or publish it. `docs/danh-gia-huong-NCKH-2026-10-29.md` quotes it, so it is gitignored and stays local. The remote is public: before every push, check that no committed file quotes the internal proposal.
- **Code style:** lines of at most 120 characters; scripts are numbered `scripts/NN_name.py`; tests that need the data carry the `data` marker.
## Not in git (other machines)
`data/` (the Volve copy, OCR hub export, third-party repos), `outputs/`, `logs/runs/`, `.env`, `docs/*.DOCX`, `docs/*.pdf`, `docs/danh-gia-huong-NCKH-2026-10-29.md` and the `.venv` are gitignored. Check the data with `scripts/00_data_manifest.py --check` and regenerate `outputs/` with `scripts/run_p0.sh`, except the OCR page cache `outputs/ocr/pages/`: it holds hours of GPU time, so copy it rather than reading the pages again.
## Skills
Agent skills live in `.agents/skills/` (sources in `skills-lock.json`): scikit-learn, pymc, statistical-analysis, scientific-visualization, scientific-writing, scientific-critical-thinking, literature-review, citation-management, academic-humanizer, mlflow.