Welllog Traceability and Known-Result Audit
Why this exists
Well-log outcomes can drift when formulas, defaults, or dependencies change. This workflow prevents silent drift by:
- Storing stage-level trace signatures in processing outputs and DB records.
- Running a deterministic known-result audit against a fixed LAS fixture.
- Producing machine-readable and human-readable audit reports.
How traceability works
Each stage now emits traceability:
stage:normalize,interpret, orclassify.processing_version: version tag for formula/runtime policy.algorithm_references: plain-language method list used in that stage.config: exact knobs used by stage (cutoffs/formulas/etc.).config_hash: stable hash of stage config.output_signature: stable hash of deterministic stage output summary.- Upstream linkage:
- interpret includes
upstream_normalize_signature - classify includes
upstream_interpret_signature
This allows rapid drift localization:
- config hash changed -> configuration drift.
- config hash same, output signature changed -> code/dependency drift.
- upstream signature changed -> drift originated in previous stage.
Database trace columns
Trace JSON is persisted in:
ops.well_logs.traceabilityops.well_interpretations.traceabilityops.well_bypassed_candidates.traceability
The status-pack API returns these records so UI and operators can inspect provenance directly.
Known-result audit mechanism
Deterministic fixture:
- Input LAS:
tests/fixtures/welllog/legacy17.las - Expected snapshot:
tests/fixtures/welllog/legacy17_expected.json
Audit runner:
make run-welllog-known-result-audit
Outputs:
- JSON report:
docs/operations/WELLLOG_KNOWN_RESULT_AUDIT_REPORT.json - Markdown report:
docs/operations/WELLLOG_KNOWN_RESULT_AUDIT_REPORT.md
Pass criteria:
- mismatch count =
0 - all numeric checks within tolerance (
1e-6)
If the model intentionally changes:
python3 scripts/dev/run_welllog_known_result_audit.py --refresh-expected
Then review and commit:
- expected fixture update
- rationale in
docs/CHANGELOG.md - formula/policy update in architecture docs
Test gates
- Unit golden snapshot test:
tests/unit/test_welllog_known_results.py
- Existing functional welllog tests:
tests/unit/test_welllog_core.py
- Migration chain integrity:
tests/integration/test_migration_chain.py
Formula trace references (implemented)
- Minimum curvature TVD conversion for deviation stations.
- Vsh from normalized GR baseline.
- PHIE from RHOB/NPHI with shale correction.
- Deterministic cutoff mask and interval segmentation.
- Optional Archie Sw only when parameters are supplied.
These formulas are implemented in:
libs/py/welllog_core/__init__.py.