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

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

---

## Links (HTML-first)

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

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

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

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

---

## What this proves (black/white)

This demo proves:
- a known Salesforce record 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 Salesforce API calls, OAuth scopes, or field-level access rules
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    d702113f272b2ce5aadfb1dc65a91454bc1fde48a956d8d9310352889fe34024

Input JSON sha256:

    3287e2a9790cc05b3800cf10e6011836d6200cff55ff26c402d57646f47c5481

Normalized output JSON sha256:

    e02400245e435b2d24b5992aacc99c33113f48f519805297fc5f9b3e7c3ea623

---

## How to reproduce (no internal access)

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

tar -xzf if-api-salesforce-demo-source.tgz
python3 resolve_salesforce_demo.py salesforce_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    d702113f272b2ce5aadfb1dc65a91454bc1fde48a956d8d9310352889fe34024  if-api-salesforce-demo-source.tgz

Expected `sha256sum` (normalized output):

    e02400245e435b2d24b5992aacc99c33113f48f519805297fc5f9b3e7c3ea623  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "3287e2a9790cc05b3800cf10e6011836d6200cff55ff26c402d57646f47c5481",
  "integration": "salesforce",
  "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": [
    {
      "metadata": {
        "name": "InfraFabric Demo Account",
        "object_type": "Account",
        "owner": "demo.owner@example.com",
        "status": "Active"
      },
      "record_id": "0015g00000DemoA",
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://example.salesforce.com/0015g00000DemoA"
    },
    {
      "metadata": {
        "name": "Receipt validation request",
        "object_type": "Case",
        "owner": "demo.owner@example.com",
        "status": "In Progress"
      },
      "record_id": "5005g00000DemoB",
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://example.salesforce.com/5005g00000DemoB"
    }
  ],
  "schema_version": "demo.v1"
}
```
