index.md

HTML wrapper for HTML-only fetchers; content is shown verbatim.

Raw file

Links (extracted)

Clickable list for reviewers; avoids copy/paste line-wrap issues.
# if.api demo — GitHub webhook normalization (receipt-backed)

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

---

## Links (HTML-first)

IF.TRACE/T3 receipt:
https://infrafabric.io/static/trace/Z_kiBtTQHztidcgYYaSRy4UK

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

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

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

---

## What this proves (black/white)

This demo proves:
- a known input payload can be transformed deterministically into a normalized event envelope
- the transformation output is bound to IF.TRACE/T3 receipts (hash checks; signatures only where present and verifiable)

This demo does not prove:
- GitHub auth, rate-limit behavior, or live webhook delivery
- any shipped `if.bus` runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    8b6107c1da94774c99f35286cfdf6967891cd7b4c6101d3a4776236ddcefdb83

Input JSON sha256:

    29ed81a254ba70108386a09688d159f131734fbc915fcfaf2ad0ae0cc8e82765

Normalized output JSON sha256:

    cd34502dd28a8d031893c9b1b52bd6dfaf374080e07249977b61e0d73a3651ac

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-github-webhook-demo-source.tgz "https://infrafabric.io/static/source/8b6107c1da94774c99f35286cfdf6967891cd7b4c6101d3a4776236ddcefdb83.tgz"
sha256sum if-api-github-webhook-demo-source.tgz

tar -xzf if-api-github-webhook-demo-source.tgz
python3 normalize_github_push.py github_push_sample.json > normalized_event.json
sha256sum normalized_event.json
```

Expected `sha256sum` (source bundle):

    8b6107c1da94774c99f35286cfdf6967891cd7b4c6101d3a4776236ddcefdb83  if-api-github-webhook-demo-source.tgz

Expected `sha256sum` (normalized output):

    cd34502dd28a8d031893c9b1b52bd6dfaf374080e07249977b61e0d73a3651ac  normalized_event.json

---

## Output (normalized event envelope)

```json
{
  "commits": [
    {
      "id": "c0ffee25404a1f0d0a1b2c3d4e5f60718293a4b5",
      "message": "Fix README",
      "timestamp": "2026-01-05T00:00:00Z",
      "url": "https://github.com/octo-org/octo-repo/commit/c0ffee25404a1f0d0a1b2c3d4e5f60718293a4b5"
    },
    {
      "id": "deadbeefcafebabef00d0123456789abcdef0000",
      "message": "Add docs",
      "timestamp": "2026-01-05T00:01:00Z",
      "url": "https://github.com/octo-org/octo-repo/commit/deadbeefcafebabef00d0123456789abcdef0000"
    }
  ],
  "event": "push",
  "input_sha256": "29ed81a254ba70108386a09688d159f131734fbc915fcfaf2ad0ae0cc8e82765",
  "integration": "github",
  "schema_version": "demo.v1",
  "source": {
    "after": "1111111111111111111111111111111111111111",
    "before": "0000000000000000000000000000000000000000",
    "pusher": {
      "email": "octocat@users.noreply.github.com",
      "name": "octocat"
    },
    "ref": "refs/heads/main",
    "repository": {
      "full_name": "octo-org/octo-repo",
      "html_url": "https://github.com/octo-org/octo-repo"
    }
  },
  "summary": {
    "commit_count": 2,
    "head_commit_id": "c0ffee25404a1f0d0a1b2c3d4e5f60718293a4b5"
  }
}
```