Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

Document Provenance

How a page declares who made it, how it was made and what review it had, and how a signature lets a reader's browser check that the page has not changed since it was published.

What provenance covers

Provenance is the record of where a page came from. In Vanilla Breeze it has two parts, and they are different in kind.

  • Declarations. The publisher states who wrote the page, whether AI was used, what review it had and whether it is a draft. These are claims. Nothing checks them.
  • Integrity. The publisher signs the page at build time. The reader's browser checks the signature. This is a test with a result, and it proves one narrow thing: the page is what was signed.

Both are built. Declarations need only markup. Signing needs a key and a step in your build, and the signing script lives in the repository, not in the published package (see Signing a page).

Declaring how content was made

Three attributes describe a page or any part of it. Each answers one question.

AttributeQuestionValuesDefault look
data-provenance How was this made? human, ai-assisted, ai-generated; add translated, synthesized or migrated after a space human shows nothing. ai-assisted adds a coloured edge at the start of the line. ai-generated adds the edge and a faint tint.
data-review What review did it get? unreviewed, fact-checked, editor-reviewed fact-checked and editor-reviewed recolour the edge that data-provenance draws, each with its own colour. On content with no edge they show only with labeled. unreviewed shows nothing.
data-status Is it published? draft, published, archived draft has a dashed border. archived is dimmed.

Add the labeled class to print the value as a small badge above the content. Without it the signal is the edge and tint only.

For a whole page, say the same thing in the <head> with vb:provenance, vb:review, vb:status and vb:ai-tools. Page Metadata lists every tag. <page-info> shows them to the reader, and <trust-filter> lets a reader filter a list of pages by them.

Who made an edit

On <ins> and <del>, data-author names who made the change and data-reason says why. The reason shows as a small label before the change. The author appears after it when the reader points at the change or moves focus into it, and always on touch screens. Showing Changes covers tracked edits.

The trust badge

The provenance badge in a <page-info> summary carries a second fact: how far the claim has been checked. The component sets it as data-trust on the badge and adds the tier as visible text, so the tier is not shown by colour alone.

TierText shownMeaning
undeclaredNoneThe page has neither an author nor a vb:provenance tag
declaredSelf-declaredThe page makes a claim and carries no signature
verifiedVerifiedThe signature matches the page as it is now
failedSignature failedA signature is present and does not match, names an algorithm other than ECDSA-P256-SHA256, or has no key link. The badge reads Key not from this site when the key link points at another origin, and Key expired when the key's expiry date has passed.
key-unavailableKey unavailableThe key could not be fetched or read

You never write data-trust yourself. It is a result. The component also fires page-info:verified each time the tier is set, with { status, tier, reason } in the event detail, so a page can react to a failed check.

Signing a page

A signed page carries four extra tags. <page-info> looks for them every time it connects and runs the check with the browser's Web Crypto API.

What is signed

The signature covers a fixed summary of the page, not its raw HTML, so reformatting the markup does not break it. The summary holds:

  • the canonical URL, title, author, author URL, published and modified dates, version, keywords, concepts, provenance, review, status and license, all read from the <head>
  • the text of every element marked data-signable

Put data-signable on the <article> or <main> that holds the content. Inside it, navigation, headers, footers, asides, forms, buttons, dialogs, figure captions, hidden elements, scripts and the library's own page furniture (<page-info>, <page-toc>, <page-stats>, <page-tools>, <content-lens>) are left out. Deleted text in <del> is left out. Inserted text in <ins> is included. Text inside a <change-set> follows the same rule: the unchanged text and the insertions are signed, and the caption and buttons the component adds are not. Mark a part with data-signable="false" to leave it out.

The browser builds the summary from the page as it stands when the check runs. A script that rewrites text inside the signed region will make the check fail, which is the point, so keep client-side text changes out of that region.

The signing step

The repository has two reference scripts. They are not in the published npm package: copy them, or write your own to the same format.

ScriptWhat it does
scripts/generate-key.js Makes an ECDSA P-256 key pair. Writes the public half as a JWK file to publish and the private half to a folder kept out of version control.
scripts/sign-pages.js Walks a folder of built HTML, signs each page that has data-signable content, and adds the four tags. Pages that already have a signature are skipped. The private key path comes from the VB_PRIVATE_KEY_JWK environment variable.

Run the signer last, after every step that changes page text. Without --strict it logs a page it cannot sign and carries on.

This site signs its pages on every build with a demonstration key whose private half is in the public repository. A Verified badge here shows the mechanism working. It says nothing about who published the page.

What a passed check proves

It provesIt does not prove
The signed text and metadata have not changed since signing That the content is accurate
The signature was made with the private half of the key the page links to That the key belongs to the named author
The key is published on the same origin as the page and has not passed its expiry date That the key has not been stolen or copied
That AI was not used. Only the declaration speaks to that, and it is self-reported.

The check guards against a page being altered after publication by a cache, a proxy or an edit to the stored file. It does not guard against whoever controls the page replacing the content, the signature and the key link together. A reader who wants more than that has to trust the key through some other route.

The key link must point at the page's own origin. A key on any other host is not fetched and the check fails. There is no way to allow another host.

A key file can carry an expiry date in metadata.expires, which generate-key.js sets a year ahead. A date such as 2027-01-01 means the key stops being accepted at the start of that day, UTC. The date is compared with the reader's clock, not with the time of signing, so make a new key and sign the site again before the old one expires. A key file with no expiry date is accepted indefinitely.

The check also reads the vb:hash tag. When the tag is present its value must equal the SHA-256 of the summary, or the check fails. The signature covers the same bytes, so the hash adds no protection of its own. It is there so that other tools can compare a page against a known value without the key.

What is not built

  • An editor interface for setting provenance or signing. The library displays and checks; authoring belongs to your CMS or build.
  • Interoperation with C2PA or Verifiable Credentials.
  • Any check on the declarations themselves. Human written is the publisher's word.
↑