Skip to content

Latest commit

 

History

History
143 lines (109 loc) · 4.73 KB

File metadata and controls

143 lines (109 loc) · 4.73 KB

Provenance round-trip transcript — captured 2026-04-25T17:08:57Z

Generated by tests/benchmark/demo_roundtrip.py. Live UniProt REST output — values observed at capture time may differ on subsequent runs as UniProt advances releases. The structural claims (Provenance shape, verify-tool verdicts) are stable.

Step 1 — real query to UniProt for P04637

primaryAccession: P04637
gene:             TP53
organism:         Homo sapiens
length:           393

Step 2 — captured Provenance record (live values)

{
  "source": "UniProt",
  "release": "2026_01",
  "release_date": "28-January-2026",
  "retrieved_at": "2026-04-25T17:09:00Z",
  "url": "https://rest.uniprot.org/uniprotkb/P04637",
  "response_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e"
}

Step 3 — verify with captured fields (expected: verified)

Provenance Verification

Status: verified

URL: https://rest.uniprot.org/uniprotkb/P04637

  • ✓ URL resolves (HTTP 200)
  • ✓ Release: recorded '2026_01', current '2026_01'
  • ✓ Response SHA-256: recorded 0040d79bb39e2f73…, current 0040d79bb39e2f73…

Advice: Both checks passed. The recorded provenance is reproducible against the live UniProt API.

{
  "url": "https://rest.uniprot.org/uniprotkb/P04637",
  "recorded_release": "2026_01",
  "recorded_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e",
  "url_resolves": true,
  "http_status": 200,
  "current_release": "2026_01",
  "current_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e",
  "release_match": true,
  "hash_match": true,
  "status": "verified"
}

Step 4 — hash-drift demonstration (wrong recorded hash)

Pass response_sha256 = '0' * 64 to force a mismatch. Release tag still matches, so the verifier must report hash_drift.

Provenance Verification

Status: hash_drift

URL: https://rest.uniprot.org/uniprotkb/P04637

  • ✓ URL resolves (HTTP 200)
  • ✓ Release: recorded '2026_01', current '2026_01'
  • ✗ Response SHA-256: recorded 0000000000000000…, current 0040d79bb39e2f73…

Advice: The release tag still matches but the canonical response body has changed. Investigate: UniProt may have edited the entry within the release, or our canonicalisation differs.

{
  "url": "https://rest.uniprot.org/uniprotkb/P04637",
  "recorded_release": "2026_01",
  "recorded_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
  "url_resolves": true,
  "http_status": 200,
  "current_release": "2026_01",
  "current_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e",
  "release_match": true,
  "hash_match": false,
  "status": "hash_drift"
}

Step 5 — release-drift demonstration (impossibly old release)

Pass release = '1999_01' to force a mismatch. Body hash still matches, so the verifier must report release_drift.

Provenance Verification

Status: release_drift

URL: https://rest.uniprot.org/uniprotkb/P04637

  • ✓ URL resolves (HTTP 200)
  • ✗ Release: recorded '1999_01', current '2026_01'
  • ✓ Response SHA-256: recorded 0040d79bb39e2f73…, current 0040d79bb39e2f73…

Advice: UniProt has moved past the release recorded in this provenance. The underlying entry may also have changed; if you need byte-level reproducibility, fetch the recorded release from the UniProt FTP snapshot archive.

{
  "url": "https://rest.uniprot.org/uniprotkb/P04637",
  "recorded_release": "1999_01",
  "recorded_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e",
  "url_resolves": true,
  "http_status": 200,
  "current_release": "2026_01",
  "current_sha256": "0040d79bb39e2f7386d55f81071e87858ec2e5c2cd9552e93c3633897f78345e",
  "release_match": false,
  "hash_match": true,
  "status": "release_drift"
}

Step 6 — url-unreachable demonstration (synthetic accession)

Pass an accession-shaped URL that UniProt does not recognise. The verifier must classify the failure cleanly rather than raising.

Provenance Verification

Status: url_unreachable

URL: https://rest.uniprot.org/uniprotkb/Q99999_NOT_A_REAL_ACC_42

  • ✗ URL resolves (HTTP 400)

Advice: The recorded URL did not return a successful response. The endpoint may have been retired, rate-limited, or temporarily unavailable.

{
  "url": "https://rest.uniprot.org/uniprotkb/Q99999_NOT_A_REAL_ACC_42",
  "recorded_release": null,
  "recorded_sha256": null,
  "url_resolves": false,
  "http_status": 400,
  "status": "url_unreachable"
}

Summary. Every step produced the predicted verdict. The architectural chain — upstream → Provenance → markdown / JSON surface → verify tool re-fetches → matches — works end-to-end against live UniProt at capture time.