# if.api demo — URN:NBN resolver (receipt-backed)

**Audience:** external reviewers + operators  
**Reality gate:** demo of a transformation contract, not a deployed URN:NBN resolver.

---

## Links (HTML-first)

if.trace receipt:
https://infrafabric.io/static/trace/vxq6JBhV7qa7GcczlqxtEA

Pack (HTML view):
https://infrafabric.io/static/pack/vxq6JBhV7qa7GcczlqxtEA

Pack (raw Markdown):
https://infrafabric.io/static/pack/vxq6JBhV7qa7GcczlqxtEA.md

Source bundle (tgz):
https://infrafabric.io/static/source/c442e1f70c6e9b487cc158713b16c69db5a04b960c0aa54c2b279ee5b58b4af3.tgz

---

## What this proves (black/white)

This demo proves:
- a known URN:NBN request can be transformed deterministically into a normalized resolution envelope
- the output is bound to if.trace receipts (hash checks; signatures only where present and verifiable)

This demo does not prove:
- live URN:NBN resolution, national library policy, or metadata governance
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    c442e1f70c6e9b487cc158713b16c69db5a04b960c0aa54c2b279ee5b58b4af3

Input JSON sha256:

    dcda79f830876779d5b447ab86e0fd610b9458b4c08881ac6128deb8311b7663

Normalized output JSON sha256:

    2e42c778fd9ebeea7f5fbc2d87bd79cb5da5517f48b006488162a88fbc4c0ac9

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-urn-nbn-resolver-demo-source.tgz "https://infrafabric.io/static/source/c442e1f70c6e9b487cc158713b16c69db5a04b960c0aa54c2b279ee5b58b4af3.tgz"
sha256sum if-api-urn-nbn-resolver-demo-source.tgz

tar -xzf if-api-urn-nbn-resolver-demo-source.tgz
python3 resolve_urn_nbn_demo.py urn_nbn_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    c442e1f70c6e9b487cc158713b16c69db5a04b960c0aa54c2b279ee5b58b4af3  if-api-urn-nbn-resolver-demo-source.tgz

Expected `sha256sum` (normalized output):

    2e42c778fd9ebeea7f5fbc2d87bd79cb5da5517f48b006488162a88fbc4c0ac9  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "dcda79f830876779d5b447ab86e0fd610b9458b4c08881ac6128deb8311b7663",
  "integration": "urn.nbn.resolver",
  "notes": {
    "integrity": "see if.trace receipt for output bytes",
    "live_lookup": false
  },
  "requested_at": "2026-01-07T00:00:00Z",
  "resolved_at": "2026-01-07T00:00:00Z",
  "results": [
    {
      "identifier": "urn:nbn:de:demo-2026-001",
      "metadata": {
        "country_code": "DE",
        "issued": "2025-12-31",
        "publisher": "Example National Library",
        "title": "Synthetic demo artifact (URN:NBN)"
      },
      "resolution_method": "synthetic-map",
      "scheme": "urn:nbn",
      "status": "resolved",
      "target_url": "https://example.org/urn-nbn-demo-1"
    },
    {
      "identifier": "urn:nbn:fr:demo-2026-002",
      "metadata": {
        "country_code": "FR",
        "issued": "2025-12-31",
        "publisher": "Example National Library",
        "title": "Synthetic decision pack (URN:NBN)"
      },
      "resolution_method": "synthetic-map",
      "scheme": "urn:nbn",
      "status": "resolved",
      "target_url": "https://example.org/urn-nbn-demo-2"
    }
  ],
  "schema_version": "demo.v1"
}
```
