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

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

---

## Links (HTML-first)

if.trace receipt:
https://infrafabric.io/static/trace/LAOtzUpSBPBUHoW0l--wkA

Pack (HTML view):
https://infrafabric.io/static/pack/LAOtzUpSBPBUHoW0l--wkA

Pack (raw Markdown):
https://infrafabric.io/static/pack/LAOtzUpSBPBUHoW0l--wkA.md

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

---

## What this proves (black/white)

This demo proves:
- a known ServiceNow 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 ServiceNow API calls, instance access, or approval policies
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    0ae47fbb6e41011aebef3d514d1ed2e2b583350babe6632279979dc47493cb9d

Input JSON sha256:

    203210219c54e7d1c74f4dabaa041aa56e0c34a57b477aad646dec0f6064b73e

Normalized output JSON sha256:

    4680f089b8927c6a57cd3d0aad4af21d5f616b1b2b1efbf42bda93ce9f4ba159

---

## How to reproduce (no internal access)

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

tar -xzf if-api-servicenow-demo-source.tgz
python3 resolve_servicenow_demo.py servicenow_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    0ae47fbb6e41011aebef3d514d1ed2e2b583350babe6632279979dc47493cb9d  if-api-servicenow-demo-source.tgz

Expected `sha256sum` (normalized output):

    4680f089b8927c6a57cd3d0aad4af21d5f616b1b2b1efbf42bda93ce9f4ba159  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "203210219c54e7d1c74f4dabaa041aa56e0c34a57b477aad646dec0f6064b73e",
  "integration": "servicenow",
  "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": {
        "owner": "demo.owner@example.com",
        "priority": "2 - High",
        "short_description": "Receipt validation failed",
        "state": "In Progress",
        "table": "incident"
      },
      "record_id": "INC0012345",
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://example.service-now.com/incident.do?sys_id=INC0012345"
    },
    {
      "metadata": {
        "owner": "demo.owner@example.com",
        "priority": "3 - Moderate",
        "short_description": "Publish receipt-backed pack",
        "state": "Scheduled",
        "table": "change_request"
      },
      "record_id": "CHG0012345",
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://example.service-now.com/change_request.do?sys_id=CHG0012345"
    }
  ],
  "schema_version": "demo.v1"
}
```
