{
  "protocolVersion": "0.1.0",
  "packageHash": "1bc68112c6670d59f5135fd8302a59ffe2ff40fdcf4b2d06ea3d6a5e9e92b4df",
  "visibility": "public",
  "captureMethod": "script-run",
  "contentProfile": "default",
  "producerProfile": "scripted-recomputation/publish-example",
  "type": "content/analysis/v1",
  "signer": {
    "bindingTier": "pseudonymous",
    "displayName": "typedstandards-publish-example",
    "identifier": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj"
  },
  "contentHash": {
    "sha256": "eb5d7bfecaca0c297ed56513bb7703a2dd7deda08c16b929452f918d059446f3"
  },
  "contentCanonicalization": "https://typedstandards.org/canonicalization/raw-bytes/v1",
  "signature": {
    "signature": "Z3WQCo+e8CoCnPPbN4wi/UfgIoTWrixeJTtBNqurf0jt1Pv9+se+2XXvv4zKHl28/F5rIxYPDnD8bAwAmn36CA==",
    "publicKey": "MCowBQYDK2VwAyEARj4OGjTHMNQRCSRhuc8aQ0yveFtBf2RXaDW8ZOnlaz4=",
    "algorithm": "Ed25519ph",
    "kid": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj"
  },
  "trustRegistryUrl": "https://publish-example.typedstandards.org/.well-known/typed-publisher.json",
  "subjectTitle": "A hosted notebook's record of itself, rerun",
  "subjectSummary": null,
  "trustRegistry": {
    "$comment": "This host's own statement about the signing key of its records, served at https://publish-example.typedstandards.org/.well-known/typed-publisher.json. The key is a pseudonymous did:key whose seed is kept, so that its records can be withdrawn and revised. This registry is not a Typed Standards record, and not an endorsement by the Typed Standards specification or by typedstandards.org, although this host is a subdomain of it. activatedAt is the earliest createdAt among the records this host serves, as the signer states it.",
    "keys": [
      {
        "kid": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj",
        "publicKey": "MCowBQYDK2VwAyEARj4OGjTHMNQRCSRhuc8aQ0yveFtBf2RXaDW8ZOnlaz4=",
        "status": "active",
        "activatedAt": "2026-10-09T22:42:24.489Z",
        "deprecatedAt": null,
        "revokedAt": null,
        "signerIdentity": {
          "bindingTier": "pseudonymous",
          "identifier": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj",
          "displayName": "typedstandards-publish-example"
        }
      }
    ]
  },
  "package": {
    "metadata": {
      "schemaVersion": "0.1.0",
      "packageId": "73d0c4da-0281-447c-9211-a5b713d07c05",
      "createdAt": "2026-10-09T22:51:02.415Z",
      "signingKeyId": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj",
      "captureMethod": "script-run"
    },
    "producerProfile": "scripted-recomputation/publish-example",
    "type": "content/analysis/v1",
    "signer": {
      "bindingTier": "pseudonymous",
      "displayName": "typedstandards-publish-example",
      "identifier": "did:key:z6MkjBTTzQQdfWE3oMuEMW9UgE6FUqb2h3rLcLn1bY1gytmj"
    },
    "contentCanonicalization": "https://typedstandards.org/canonicalization/raw-bytes/v1",
    "prompt": {
      "hash": "441db1b4e4139b5eb33bd4b7ebd4083e5ed52e421f8a5c00eab0e8c347828a40",
      "visibility": "full_text",
      "text": "Summary statistics of twelve values made by a fixed formula, computed in a hosted notebook."
    },
    "queries": [],
    "dataSources": [],
    "cost": {
      "model": "none"
    },
    "skillMetadata": {},
    "output": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"[![Verify this record with Typed Standards](https://typedstandards.org/badge/typed-standards-verify.svg)](<https://typedstandards.org/verify?url=https%3A%2F%2Fpublish-example.typedstandards.org%2Fbundles%2Fcolab-example-rerun.bundle.json>)\\n\",\n    \"\\n\",\n    \"| Typed Standards record | |\\n\",\n    \"|---|---|\\n\",\n    \"| Host | `publish-example.typedstandards.org` |\\n\",\n    \"| Capture method | `script-run` |\\n\",\n    \"\\n\",\n    \"This cell is a reader affordance and is not authoritative: verification reads the signed record, not this cell, and the verifier shows the record's signer, hash and time.\\n\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# A notebook that publishes a record of itself\\n\",\n    \"\\n\",\n    \"This notebook runs a small analysis, signs its own `.ipynb` with this example's key, and\\n\",\n    \"publishes the record to `https://publish-example.typedstandards.org` with one call to the\\n\",\n    \"[`typedstandards`](https://pypi.org/project/typedstandards/) package. The repository's\\n\",\n    \"README says what each record proves, and how to run each step.\\n\",\n    \"\\n\",\n    \"- Run it in Google Colab, with this notebook's access to the two secrets,\\n\",\n    \"  `TYPEDSTANDARDS_SIGNING_SEED_B64` and `TYPEDSTANDARDS_GITHUB_TOKEN`, turned on in the\\n\",\n    \"  Secrets panel. Use Runtime, Run all.\\n\",\n    \"- `RUN = \\\"first\\\"` publishes `colab-example`. `RUN = \\\"rerun\\\"` publishes\\n\",\n    \"  `colab-example-rerun`, links it to `colab-example` with `revises=`, and then withdraws\\n\",\n    \"  `colab-example`.\\n\",\n    \"- No cell prints either secret. The secrets are read only after the analysis has run, in\\n\",\n    \"  the cell just before signing.\\n\",\n    \"- The record is the notebook as the analysis left it. The cell above is the verifier\\n\",\n    \"  badge for `colab-example`. In the copy it signs, the signing cell replaces it with the\\n\",\n    \"  badge for this run's name.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 9,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# The parameters. RUN is \\\"first\\\" for the first run and \\\"rerun\\\" for the rerun.\\n\",\n    \"RUN = \\\"rerun\\\"\\n\",\n    \"\\n\",\n    \"REPOSITORY = \\\"npstorey/typedstandards-publish-example\\\"\\n\",\n    \"ORIGIN = \\\"https://publish-example.typedstandards.org\\\"\\n\",\n    \"FIRST_NAME = \\\"colab-example\\\"\\n\",\n    \"RERUN_NAME = \\\"colab-example-rerun\\\"\\n\",\n    \"NAME = {\\\"first\\\": FIRST_NAME, \\\"rerun\\\": RERUN_NAME}[RUN]\\n\",\n    \"\\n\",\n    \"# The fallback, when Colab cannot return this notebook (the README says when): the path of\\n\",\n    \"# this notebook's .ipynb, downloaded after the analysis ran and uploaded to the Files pane.\\n\",\n    \"NOTEBOOK_FILE = None\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 10,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"This notebook's content is available: 12 cells.\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# This notebook's own bytes, which the signing cell signs. The kernel holds no file of the\\n\",\n    \"# notebook: Colab's frontend returns it through get_ipynb, an internal request that Google\\n\",\n    \"# does not document. This cell asks for it now, before any secret is read, and stops the run\\n\",\n    \"# if it cannot have it.\\n\",\n    \"import json\\n\",\n    \"from pathlib import Path\\n\",\n    \"\\n\",\n    \"BADGE_START = \\\"[![Verify this record with Typed Standards]\\\"\\n\",\n    \"PARAMETERS_CELL = \\\"# The parameters.\\\"\\n\",\n    \"ANALYSIS_CELL = \\\"# The analysis.\\\"\\n\",\n    \"SIGNING_CELL = \\\"# The signing cell.\\\"\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def read_own_notebook():\\n\",\n    \"    \\\"\\\"\\\"The notebook as Colab's frontend holds it, or as NOTEBOOK_FILE holds it.\\\"\\\"\\\"\\n\",\n    \"    if NOTEBOOK_FILE:\\n\",\n    \"        where = f\\\"NOTEBOOK_FILE ({NOTEBOOK_FILE})\\\"\\n\",\n    \"        notebook = json.loads(Path(NOTEBOOK_FILE).read_bytes().decode(\\\"utf-8\\\"))\\n\",\n    \"    else:\\n\",\n    \"        where = \\\"Colab's get_ipynb\\\"\\n\",\n    \"        try:\\n\",\n    \"            from google.colab import _message\\n\",\n    \"        except ImportError:\\n\",\n    \"            raise RuntimeError(\\\"not running in Colab: set NOTEBOOK_FILE to this notebook's .ipynb\\\") from None\\n\",\n    \"        reply = _message.blocking_request(\\\"get_ipynb\\\", request=\\\"\\\", timeout_sec=60)\\n\",\n    \"        notebook = reply.get(\\\"ipynb\\\") if isinstance(reply, dict) else None\\n\",\n    \"        if isinstance(notebook, str):\\n\",\n    \"            notebook = json.loads(notebook)\\n\",\n    \"        if not isinstance(notebook, dict):\\n\",\n    \"            shape = type(reply).__name__ + (f\\\" with keys {sorted(reply)}\\\" if isinstance(reply, dict) else \\\"\\\")\\n\",\n    \"            raise RuntimeError(\\n\",\n    \"                f\\\"{where} answered {shape}, not a notebook: use the fallback in the README (NOTEBOOK_FILE)\\\"\\n\",\n    \"            )\\n\",\n    \"    if notebook.get(\\\"nbformat\\\") != 4 or not isinstance(notebook.get(\\\"cells\\\"), list):\\n\",\n    \"        raise RuntimeError(f\\\"{where} did not return an nbformat 4 notebook: use the fallback in the README\\\")\\n\",\n    \"    return notebook\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def cell_text(cell):\\n\",\n    \"    source = cell.get(\\\"source\\\", \\\"\\\")\\n\",\n    \"    return \\\"\\\".join(source) if isinstance(source, list) else source\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def joined(value):\\n\",\n    \"    return \\\"\\\".join(value) if isinstance(value, list) else value\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def clean_output(output):\\n\",\n    \"    \\\"\\\"\\\"An output as nbformat defines it, with its metadata dropped.\\\"\\\"\\\"\\n\",\n    \"    kind = output.get(\\\"output_type\\\")\\n\",\n    \"    if kind == \\\"stream\\\":\\n\",\n    \"        return {\\\"name\\\": output[\\\"name\\\"], \\\"output_type\\\": kind, \\\"text\\\": joined(output[\\\"text\\\"]).splitlines(True)}\\n\",\n    \"    if kind in (\\\"display_data\\\", \\\"execute_result\\\"):\\n\",\n    \"        cleaned = {\\\"data\\\": dict(output.get(\\\"data\\\", {})), \\\"metadata\\\": {}, \\\"output_type\\\": kind}\\n\",\n    \"        if kind == \\\"execute_result\\\":\\n\",\n    \"            cleaned[\\\"execution_count\\\"] = output.get(\\\"execution_count\\\")\\n\",\n    \"        return cleaned\\n\",\n    \"    if kind == \\\"error\\\":\\n\",\n    \"        return {\\\"ename\\\": output[\\\"ename\\\"], \\\"evalue\\\": output[\\\"evalue\\\"], \\\"output_type\\\": kind,\\n\",\n    \"                \\\"traceback\\\": list(output.get(\\\"traceback\\\", []))}\\n\",\n    \"    raise RuntimeError(f\\\"an output of type {kind!r}, which this notebook does not sign\\\")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def code_cell(notebook, start):\\n\",\n    \"    \\\"\\\"\\\"The code cell whose source starts with ``start``.\\\"\\\"\\\"\\n\",\n    \"    for cell in notebook[\\\"cells\\\"]:\\n\",\n    \"        if cell[\\\"cell_type\\\"] == \\\"code\\\" and cell_text(cell).startswith(start):\\n\",\n    \"            return cell\\n\",\n    \"    raise RuntimeError(f\\\"the notebook returned has no cell starting {start!r}\\\")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def signable(notebook):\\n\",\n    \"    \\\"\\\"\\\"The notebook as it is signed. Every cell keeps its type and source. Code cells above the\\n\",\n    \"    signing cell keep their outputs and execution counts; the signing cell and every later cell\\n\",\n    \"    keep neither. Every cell's metadata is dropped, and of the notebook's only kernelspec and\\n\",\n    \"    language_info are kept: Colab's metadata names the account that ran each cell. The old\\n\",\n    \"    badge cell is dropped; the signing cell inserts this run's.\\\"\\\"\\\"\\n\",\n    \"    cells, signing = [], False\\n\",\n    \"    for cell in notebook[\\\"cells\\\"]:\\n\",\n    \"        kind, text = cell.get(\\\"cell_type\\\"), cell_text(cell)\\n\",\n    \"        if kind == \\\"code\\\" and text.startswith(SIGNING_CELL):\\n\",\n    \"            signing = True\\n\",\n    \"        kept = {\\\"cell_type\\\": kind, \\\"metadata\\\": {}, \\\"source\\\": text.splitlines(True)}\\n\",\n    \"        if kind == \\\"code\\\":\\n\",\n    \"            kept[\\\"execution_count\\\"] = None if signing else cell.get(\\\"execution_count\\\")\\n\",\n    \"            kept[\\\"outputs\\\"] = [] if signing else [clean_output(o) for o in cell.get(\\\"outputs\\\", [])]\\n\",\n    \"        cells.append(kept)\\n\",\n    \"    if not signing:\\n\",\n    \"        raise RuntimeError(\\\"the notebook returned has no signing cell\\\")\\n\",\n    \"    if cells[0][\\\"cell_type\\\"] == \\\"markdown\\\" and cell_text(cells[0]).startswith(BADGE_START):\\n\",\n    \"        cells = cells[1:]\\n\",\n    \"    metadata = notebook.get(\\\"metadata\\\", {})\\n\",\n    \"    kept_metadata = {key: metadata[key] for key in (\\\"kernelspec\\\", \\\"language_info\\\") if key in metadata}\\n\",\n    \"    return {\\\"cells\\\": cells, \\\"metadata\\\": kept_metadata, \\\"nbformat\\\": 4, \\\"nbformat_minor\\\": 4}\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"probe = signable(read_own_notebook())\\n\",\n    \"for start in (PARAMETERS_CELL, ANALYSIS_CELL, SIGNING_CELL):\\n\",\n    \"    code_cell(probe, start)\\n\",\n    \"print(f\\\"This notebook's content is available: {len(probe['cells'])} cells.\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 11,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"%pip install --quiet typedstandards==0.2.0\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## The analysis\\n\",\n    \"\\n\",\n    \"Summary statistics of twelve values made by a fixed formula, so every run prints the same\\n\",\n    \"numbers. It reads no file, no network and no credential.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 12,\n   \"metadata\": {},\n   \"outputs\": [\n    {\n     \"name\": \"stdout\",\n     \"output_type\": \"stream\",\n     \"text\": [\n      \"values: [57, 51, 45, 62, 56, 50, 44, 61, 55, 49, 43, 60]\\n\",\n      \"count: 12\\n\",\n      \"mean: 52.75\\n\",\n      \"median: 53.0\\n\",\n      \"min, max: 43 62\\n\",\n      \"largest rise between neighbours: 17\\n\"\n     ]\n    }\n   ],\n   \"source\": [\n    \"# The analysis.\\n\",\n    \"import statistics\\n\",\n    \"\\n\",\n    \"values = [40 + (17 * k) % 23 for k in range(1, 13)]\\n\",\n    \"rises = [b - a for a, b in zip(values, values[1:])]\\n\",\n    \"print(\\\"values:\\\", values)\\n\",\n    \"print(\\\"count:\\\", len(values))\\n\",\n    \"print(\\\"mean:\\\", round(statistics.mean(values), 4))\\n\",\n    \"print(\\\"median:\\\", statistics.median(values))\\n\",\n    \"print(\\\"min, max:\\\", min(values), max(values))\\n\",\n    \"print(\\\"largest rise between neighbours:\\\", max(rises))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## Sign and publish\\n\",\n    \"\\n\",\n    \"The next cell reads the two secrets from Colab's Secrets panel into this process's\\n\",\n    \"environment, where the `typedstandards` CLI reads the seed and `publish` reads the token. It\\n\",\n    \"prints nothing.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 13,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"import os\\n\",\n    \"\\n\",\n    \"from google.colab import userdata\\n\",\n    \"\\n\",\n    \"os.environ[\\\"TYPEDSTANDARDS_SIGNING_SEED_B64\\\"] = userdata.get(\\\"TYPEDSTANDARDS_SIGNING_SEED_B64\\\")\\n\",\n    \"os.environ[\\\"TYPEDSTANDARDS_GITHUB_TOKEN\\\"] = userdata.get(\\\"TYPEDSTANDARDS_GITHUB_TOKEN\\\")\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# The signing cell. It signs this notebook as the cells above it left it, with the verifier\\n\",\n    \"# badge for this run's bundle as cell 0, written before signing.\\n\",\n    \"import typedstandards as ts\\n\",\n    \"\\n\",\n    \"notebook = signable(read_own_notebook())\\n\",\n    \"if f'RUN = \\\"{RUN}\\\"' not in cell_text(code_cell(notebook, PARAMETERS_CELL)):\\n\",\n    \"    raise RuntimeError(f\\\"the notebook returned does not set RUN = {RUN!r}: it is not this run's notebook\\\")\\n\",\n    \"if not code_cell(notebook, ANALYSIS_CELL)[\\\"outputs\\\"]:\\n\",\n    \"    raise RuntimeError(\\\"the notebook returned has no outputs for the analysis: it is not this run's notebook\\\")\\n\",\n    \"\\n\",\n    \"BUNDLE_URL = f\\\"{ORIGIN}/bundles/{NAME}.bundle.json\\\"\\n\",\n    \"NOTEBOOK_PATH = Path(f\\\"{NAME}.ipynb\\\")\\n\",\n    \"NOTEBOOK_PATH.write_text(json.dumps(notebook, indent=1, sort_keys=True, ensure_ascii=False) + \\\"\\\\n\\\", encoding=\\\"utf-8\\\")\\n\",\n    \"ts.badge_cell(BUNDLE_URL, capture_method=\\\"script-run\\\", notebook=NOTEBOOK_PATH)\\n\",\n    \"\\n\",\n    \"signed = ts.sign(\\n\",\n    \"    {\\n\",\n    \"        \\\"type\\\": \\\"content/analysis/v1\\\",\\n\",\n    \"        \\\"producerProfile\\\": \\\"scripted-recomputation/publish-example\\\",\\n\",\n    \"        \\\"captureMethod\\\": \\\"script-run\\\",\\n\",\n    \"        \\\"prompt\\\": \\\"Summary statistics of twelve values made by a fixed formula, computed in a hosted notebook.\\\",\\n\",\n    \"        \\\"promptVisibility\\\": \\\"full_text\\\",\\n\",\n    \"        \\\"queries\\\": [],\\n\",\n    \"        \\\"dataSources\\\": [],\\n\",\n    \"        \\\"cost\\\": {\\\"model\\\": \\\"none\\\"},\\n\",\n    \"        \\\"skillMetadata\\\": {},\\n\",\n    \"        \\\"trace\\\": {},\\n\",\n    \"        \\\"signer\\\": {\\\"bindingTier\\\": \\\"pseudonymous\\\", \\\"displayName\\\": \\\"typedstandards-publish-example\\\"},\\n\",\n    \"    },\\n\",\n    \"    output_file=NOTEBOOK_PATH,\\n\",\n    \")\\n\",\n    \"print(\\\"signed:\\\", NAME, signed[\\\"envelopeHash\\\"])\\n\",\n    \"print(\\\"signer:\\\", signed[\\\"package\\\"][\\\"signer\\\"][\\\"identifier\\\"])\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# Publish. The rerun first signs a revises node from the first run's record to this one.\\n\",\n    \"import httpx\\n\",\n    \"\\n\",\n    \"TITLES = {\\n\",\n    \"    \\\"first\\\": \\\"A hosted notebook's record of itself\\\",\\n\",\n    \"    \\\"rerun\\\": \\\"A hosted notebook's record of itself, rerun\\\",\\n\",\n    \"}\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"def listed_hash(name):\\n\",\n    \"    \\\"\\\"\\\"The envelopeHash of the record this host serves as name: its packageHash in the served\\n\",\n    \"    records.json, which a verifier reads too. publish compares it with the repository's main.\\\"\\\"\\\"\\n\",\n    \"    with httpx.Client(trust_env=False, follow_redirects=False, timeout=30) as client:\\n\",\n    \"        response = client.get(f\\\"{ORIGIN}/records.json\\\")\\n\",\n    \"    response.raise_for_status()\\n\",\n    \"    for record in response.json()[\\\"records\\\"]:\\n\",\n    \"        if record[\\\"name\\\"] == name:\\n\",\n    \"            return record[\\\"packageHash\\\"]\\n\",\n    \"    raise RuntimeError(f\\\"{ORIGIN}/records.json lists no {name}: has its publish run deployed?\\\")\\n\",\n    \"\\n\",\n    \"\\n\",\n    \"host = ts.GitHubPagesHost(REPOSITORY)\\n\",\n    \"revises = None\\n\",\n    \"if RUN == \\\"rerun\\\":\\n\",\n    \"    revises = ts.attest(\\n\",\n    \"        {\\n\",\n    \"            \\\"type\\\": \\\"attestation/revises/v1\\\",\\n\",\n    \"            \\\"targetNodeId\\\": listed_hash(FIRST_NAME),\\n\",\n    \"            \\\"successorNodeId\\\": signed[\\\"envelopeHash\\\"],\\n\",\n    \"            \\\"signer\\\": signed[\\\"package\\\"][\\\"signer\\\"],\\n\",\n    \"        }\\n\",\n    \"    )\\n\",\n    \"receipt = ts.publish(signed, host=host, name=NAME, title=TITLES[RUN], revises=revises)\\n\",\n    \"for key in (\\\"name\\\", \\\"commit\\\", \\\"bundle_url\\\", \\\"verify_url\\\", \\\"registry_url\\\", \\\"written\\\"):\\n\",\n    \"    print(f\\\"{key}: {receipt[key]}\\\")\\n\",\n    \"\\n\",\n    \"badge = json.loads(signed[\\\"package\\\"][\\\"output\\\"])[\\\"cells\\\"][0]\\n\",\n    \"print(\\\"the badge in cell 0 links to verify_url:\\\", f\\\"](<{receipt['verify_url']}>)\\\" in cell_text(badge))\"\n   ]\n  },\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## The withdrawal (the rerun only)\\n\",\n    \"\\n\",\n    \"On the rerun, the next cell withdraws the first run's record, `colab-example`, with a\\n\",\n    \"signed reason. The record stays listed and still verifies; `records.json` marks it\\n\",\n    \"withdrawn with the reason. Run it once: a second run adds a second withdrawal.\"\n   ]\n  },\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\n    \"# The withdrawal: on the rerun only, after the rerun is published.\\n\",\n    \"if RUN == \\\"rerun\\\":\\n\",\n    \"    withdrawal = ts.withdraw(\\n\",\n    \"        {\\n\",\n    \"            \\\"targetNodeId\\\": listed_hash(FIRST_NAME),\\n\",\n    \"            \\\"reason\\\": \\\"Replaced by a rerun of the same notebook, published as colab-example-rerun.\\\",\\n\",\n    \"            \\\"signer\\\": signed[\\\"package\\\"][\\\"signer\\\"],\\n\",\n    \"        }\\n\",\n    \"    )\\n\",\n    \"    withdrawn = ts.publish_attestation(withdrawal, host=host, name=FIRST_NAME)\\n\",\n    \"    for key in (\\\"name\\\", \\\"commit\\\", \\\"verify_url\\\", \\\"written\\\"):\\n\",\n    \"        print(f\\\"{key}: {withdrawn[key]}\\\")\\n\",\n    \"else:\\n\",\n    \"    print(\\\"RUN is first: nothing is withdrawn.\\\")\"\n   ]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"name\": \"python\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}\n",
    "trace": {},
    "contentHash": {
      "sha256": "eb5d7bfecaca0c297ed56513bb7703a2dd7deda08c16b929452f918d059446f3"
    }
  }
}
