Skip to content

Fix stale doc_sourced reference and enforce provenance consistency - #27

Merged
leggetter merged 1 commit into
mainfrom
fix/provenance-docs-consistency
Aug 11, 2026
Merged

Fix stale doc_sourced reference and enforce provenance consistency#27
leggetter merged 1 commit into
mainfrom
fix/provenance-docs-consistency

Conversation

@leggetter

Copy link
Copy Markdown
Collaborator

Two small follow-ups after #26 and #25 merged.

The README still referenced doc_sourced

It told contributors that a provider whose samples are all doc-sourced carries doc_sourced: true in its index.json. Nothing has done that since provenance replaced the flag — no index.json sets it, and no code reads it. Replaced with what actually marks those versions:

"provenance": {
  "latest": { "sourced_via": "docs", "sourced_on": "2026-07-29" }
}

The two provenance records could drift

After both PRs, the same fact is recorded twice: the per-file source key that doc-sourced samples carry (1,260 files), and the version-level provenance block (95 providers). They're complementary rather than redundant — per-file travels with the payload and records exactly where each example was read, version-level is what a consumer can filter on without downloading every version file — but nothing kept them in step.

compile.ts now fails the build when a version marked capture contains a file with a source key:

Error: scrapfly/latest is marked sourced_via "capture" but crawler_started.json
carries a "source" key, which only doc-sourced samples have

That's the drift worth catching: doc-sourced samples published under a claim they were captured live. The reverse isn't checked — a docs version legitimately needn't mark every file.

Testing

yarn compile passes on the full tree: 112 providers, 1,260 doc-sourced files, publishing docs: 93, unknown: 21, capture: 2. Planting a source key into a captured version fails as intended, and removing it passes again.

One thing worth a second opinion

This is stricter than the tree it validates, so it's a new way for a build to break. If someone captures fresh samples over a version that was previously docs and flips sourced_via to capture without clearing the old source keys, compile stops rather than warns. That's deliberate — publishing a doc example as captured is the failure mode the whole provenance idea exists to prevent — but @garethx it's your samples-doc/ workflow it would interrupt most, so say if you'd rather it warned.

🤖 Generated with Claude Code

https://claude.ai/code/session_019pce9oHWGjdwHsJNya1ovP

…stency

The README still told contributors that an all-doc-sourced provider
carries `doc_sourced: true` in its index.json. Nothing has done that
since provenance replaced the flag — no index.json sets it and no code
reads it. Replaced with what actually marks those versions,
`"sourced_via": "docs"`.

That leaves two records of the same fact: the per-file `source` key
doc-sourced samples carry, and the version-level provenance block.
They're complementary — per-file travels with the payload, version-level
is what a consumer filters on without downloading every version file —
but nothing stopped them drifting.

`compile.ts` now fails the build when a version marked `capture`
contains a file with a `source` key. That's the drift that matters:
doc-sourced samples published under a claim they were captured live.
The reverse isn't checked, since a `docs` version legitimately need not
mark every file.

Verified against the full tree: 112 providers and 1,260 doc-sourced
files compile clean, and planting a `source` key in a captured version
fails as intended.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019pce9oHWGjdwHsJNya1ovP
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webhook-samples Ready Ready Preview Aug 7, 2026 10:57am

Request Review

@garethx

garethx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fail rather warn works for me

@leggetter
leggetter merged commit c1389e2 into main Aug 11, 2026
3 checks passed
@leggetter
leggetter deleted the fix/provenance-docs-consistency branch August 11, 2026 09:17
garethx added a commit to garethx/webhook-samples that referenced this pull request Aug 12, 2026
Real deliveries from a Vapi sandbox assistant through a Hookdeck source on
2026-08-12, captured byte-exact from the wire. `status-update` and
`end-of-call-report` — both among the 11 message types the docs could NOT supply,
because their examples elide the Call Object behind a placeholder comment. These
carry it in full: 21 keys on end-of-call-report, with artifact, costBreakdown,
performanceMetrics and the real call object.

Redacted by generator/redact_capture.py in the registry repo, not by hand. Every
UUID is swapped for a well-formed fake through one stable mapping shared across
both files, so identifiers that correlate in a real delivery still correlate here;
the two call ids differ because these are two different calls, which the mapping
preserved rather than flattened. 56 values redacted, and the script then audits its
own OUTPUT for surviving identifiers rather than trusting its intent.

One redaction was not on the list supplied with the captures, and it was the one
that mattered most: `assistant.server.url` is the LIVE INGEST ENDPOINT the webhook
was delivered to. It is not personal data, so reading the payload for personal data
misses it — but publishing it lets anyone POST arbitrary bodies into that source.
Transcripts were emptied too; on these calls they held only "AI: Hello," because
the calls errored before any customer audio, but the rule should not depend on that.

Headers are the observed set with placeholder values. `x-signature` is an HMAC over
the RAW body and the body here is redacted, so the real digest no longer verifies —
shipping it would teach a verification that fails, which is worse than shipping
none. The header NAMES are what carry the information, and they are exact:
x-signature, x-timestamp, x-vapi-secret (present but empty when an HMAC credential
is used), x-call-id, user-agent: axios/1.8.3.

`provenance` for `latest` is now removed rather than set. The version holds 10
doc-sourced files and 2 captures, and sourced_via has no value for that: `docs`
would misdescribe the captures, `capture` would misdescribe the other ten and fail
the hookdeck#27 build check, and Vapi has no version scheme to split them into without
inventing one. Undeclared is what this repo already does for its 8 other mixed
versions, and the per-file `source` key still distinguishes them exactly. A
`provenance_note` says so in place of a wrong declaration.

`yarn compile` passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants