# if.api demo — Google Drive resolver (receipt-backed)

**Audience:** external reviewers + operators  
**Reality gate:** demo of a transformation contract, not a deployed Google Drive integration.

---

## Links (HTML-first)

if.trace receipt:
https://infrafabric.io/static/trace/UL9-wyRgKRgtGphVV-KURw

Pack (HTML view):
https://infrafabric.io/static/pack/UL9-wyRgKRgtGphVV-KURw

Pack (raw Markdown):
https://infrafabric.io/static/pack/UL9-wyRgKRgtGphVV-KURw.md

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

---

## What this proves (black/white)

This demo proves:
- a known Google Drive 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 Google Drive API calls, OAuth scopes, or sharing rules
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    b4d113f2c1bdca4a3e34737453f670d1529d5a51fd28cdd9e3f319e386f25953

Input JSON sha256:

    d8587e8cee6cc6f310fd2a9a30c627031980d7dea4b0b53317a6497005191b61

Normalized output JSON sha256:

    3ff64d8fe3c46c8146dcf5f369b6f2697ed2283d5503a77ac424629d16d585d8

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-gdrive-demo-source.tgz "https://infrafabric.io/static/source/b4d113f2c1bdca4a3e34737453f670d1529d5a51fd28cdd9e3f319e386f25953.tgz"
sha256sum if-api-gdrive-demo-source.tgz

tar -xzf if-api-gdrive-demo-source.tgz
python3 resolve_gdrive_demo.py gdrive_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    b4d113f2c1bdca4a3e34737453f670d1529d5a51fd28cdd9e3f319e386f25953  if-api-gdrive-demo-source.tgz

Expected `sha256sum` (normalized output):

    3ff64d8fe3c46c8146dcf5f369b6f2697ed2283d5503a77ac424629d16d585d8  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "d8587e8cee6cc6f310fd2a9a30c627031980d7dea4b0b53317a6497005191b61",
  "integration": "google.drive",
  "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": [
    {
      "file_id": "1A2B3C4D5E6F7G8H9I0J",
      "metadata": {
        "mime_type": "application/pdf",
        "name": "demo-report.pdf",
        "owner": "demo.owner@example.com",
        "size_bytes": 254321
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://drive.google.com/file/d/1A2B3C4D5E6F7G8H9I0J/view"
    },
    {
      "file_id": "0J9I8H7G6F5E4D3C2B1A",
      "metadata": {
        "mime_type": "application/vnd.google-apps.folder",
        "name": "demo-evidence",
        "owner": "demo.owner@example.com",
        "size_bytes": 0
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://drive.google.com/drive/folders/0J9I8H7G6F5E4D3C2B1A"
    }
  ],
  "schema_version": "demo.v1"
}
```
