---
name: market-map-report
description: Build a chart-led, cited research report (PDF) from one Synorb market map. Maps are State Legislatures & Executives, AI Companies and Public Company Blogs. The skill asks questions written for that map, shows a free scope copy for you to edit and approve, then pulls the approved Manifests into a file with code, analyses them and builds the report. Needs an agent that can run code and reach the network, and a Synorb Professional plan or higher for the full run.
license: MIT
metadata:
  author: synorb
  version: "1.8.0"
  homepage: https://synorb.com/skills/market-map-report
---

# Market Map Research

Build a research report that a professional would pay to read. Use one market map as the evidence base.
The user chooses the period, the length, the topics, the segments and the organizations. You do the counting and the charts.

Requires a Synorb Professional plan or higher for the full run. The scope copy in Step 3 is free on every plan.
Needs an agent that can run code, write files and reach `https://api.synorb.com`. A small context window is enough, because the Manifests go to a file and never into your context. A large window helps you read more evidence at the end.

Read [references/synorb-api.md](#bundled-references-synorb-api-md) for every call and rule.
Read [references/report-method.md](#bundled-references-report-method-md) before you choose any claim.
Read [references/pull-with-code.md](#bundled-references-pull-with-code-md) before you pull.
Read [references/row-fields.md](#bundled-references-row-fields-md) before you analyse the file.
Read [references/output-quality.md](#bundled-references-output-quality-md) before you write.
Read [references/visuals.md](#bundled-references-visuals-md) and [references/chart-kit.md](#bundled-references-chart-kit-md) before you draw. Draw with the ready-made charts in [references/chart-recipes.md](#bundled-references-chart-recipes-md).
The templates are in [assets/brief-form.md](#bundled-assets-brief-form-md), [assets/scope-copy-template.md](#bundled-assets-scope-copy-template-md), [assets/report-outline.md](#bundled-assets-report-outline-md) and [assets/report-theme.md](#bundled-assets-report-theme-md).

If a tool result truncates this skill or a reference, fetch the missing part before you go on. Read the complete refinement procedure before you draft.

Before delivering, the calling agent must complete the same-invocation draft → critique → revise → verify procedure in [references/output-quality.md](#bundled-references-output-quality-md). Check each claim against its evidence, its control group and its denominator. Deliver only the final result.

## Step 1: Connect first

Do this before anything else. Do not ask any report question until you are connected.

Use the REST API with the user's key for every Synorb call in this skill. Where [references/synorb-api.md](#bundled-references-synorb-api-md) shows an MCP tool beside a REST call, use the REST call.

1. **Ask first.** Say this to the user in your own words: "This report needs a Synorb Professional plan or higher. Do you have a Synorb key?" Wait for the answer.
2. **This report connects through the REST API only.** Do not use Synorb MCP tools for any step of it. An MCP connection does not count as connected, even if it works.
   - The key is the environment variable `SYNORB_KEY`. Test that it is set without printing it. The pull code in Step 4 reads this variable.
   - If `SYNORB_KEY` is not set, do item 3 now, before any report question. Do not say "I will set it up before the pull". Do not go to Step 2 yet.
   - If it is set, go to item 5.
   - **If Synorb is already connected to this agent through MCP, say so and explain.** Tell the user: "This research skill needs the Synorb REST API, not the MCP connection. The MCP key and the API key are the same key. Do you want to use the key your Synorb MCP already uses for the research setup?" Wait for the answer.
     - If yes: do it for them. Do not make them open a terminal.
       - Read the Synorb key from their own MCP settings on this computer: the Synorb entry's `Authorization: Bearer` value, or the environment variable that entry names. Claude Code keeps MCP settings in `~/.claude.json` or the project's `.mcp.json`. Codex keeps them in `~/.codex/config.toml`. Read only the Synorb entry. Do not read or show any other entry.
       - Keep the key in memory only. Pass it as `SYNORB_KEY` to the Python processes you start yourself. Never print it, never put it in chat, never write it to a file, and never put it on a command line. Show only its last four characters, for example "key ending 7f3a".
       - Test it with the check in item 5. If it works, say "You are using the key your Synorb MCP already uses" and go on. You do not need the terminal steps in item 3.
       - If you cannot find the key (for example the host stores it in a keychain or signs in with OAuth), or the test fails, say so plainly and use the three terminal steps in item 3.
     - If no: continue with item 3 or item 4 for a different key.
3. **If the user has a key, give them the exact steps to connect it the safe way.**
   - The pull code in Step 4 reads the environment variable `SYNORB_KEY`. Your code can only see it if it was set before this agent started.
   - **Show the three steps below exactly as written. Do not write your own version.** Number them 1, 2, 3. Put each command in its own fenced code block, in your normal chat message, so the user can copy it with one click. Never put the steps in a question box or a form field, because those cannot show code blocks. Do not add a key prompt of your own.
   - Ask which system they use if you cannot tell. Windows uses PowerShell. macOS and Linux use a shell such as zsh or bash. Show only the steps for their system.
   - Never ask the user to paste the key into this chat. Never print it or write it to a file you share. Show only its last four characters.
   - End with one short line: "Start me again from that terminal, paste the first message again, and I will carry on." Do not ask them to reply "ready" in this chat. The key must be set before this agent starts.

   **Windows (PowerShell). Show these three steps:**

   1. **Open PowerShell on your own computer.** Press the Windows key, type `PowerShell`, and press Enter. A blue or black window opens. Open a new window for this. If this agent is already running in another window, leave it there.
   2. **Paste this block and press Enter.** To paste, press Ctrl+V or right-click.

      ```powershell
      mkdir $HOME\synorb-report -Force; cd $HOME\synorb-report
      $env:SYNORB_KEY = [System.Net.NetworkCredential]::new('', (Read-Host 'Paste your Synorb key, then press Enter' -AsSecureString)).Password
      ```

   3. **When the key field appears, paste your Synorb key and press Enter.** Nothing shows on screen as you paste. That is normal, and the key stays out of your command history. Then start the agent from this same window: type `claude` for Claude Code, or `codex` for Codex. To keep the key for every future window instead, run `setx SYNORB_KEY "<your Synorb key>"` once and open a new window.

   **macOS or Linux. Show these three steps:**

   1. **Open a terminal on your own computer.** On macOS press Command and Space, type `Terminal`, and press Enter. On Linux press Ctrl, Alt and T, or search your app menu for Terminal.
   2. **Paste this block and press Enter.** To paste, press Command+V on macOS, or Ctrl+Shift+V on Linux.

      ```bash
      mkdir -p ~/synorb-report && cd ~/synorb-report
      read -s -p "Paste your Synorb key, then press Enter: " SYNORB_KEY && export SYNORB_KEY && echo
      ```

   3. **When the key field appears, paste your Synorb key and press Enter.** Nothing shows as you paste. That is normal. Then start the agent from this same window: type `claude` or `codex`.

   To check that it worked without showing the key, they can run `echo ${#SYNORB_KEY}` on macOS and Linux, or `$env:SYNORB_KEY.Length` in PowerShell. A number above zero means the key is set. To keep the chat in Claude Code, use `claude --continue`. In another agent, start it and paste the first message again.
4. **If the user has no key**, offer two choices:
   - Get a free key at https://synorb.com/connect/start, or follow `synorb-setup` to get a free demo key. A free key is enough for Steps 2 and 3.
   - Look at the plans at https://synorb.com/pricing. The full report needs Professional or higher. Offer Professional or Startup. Enterprise is arranged offline, so do not offer it as a plan to buy.
   Then go back to item 3 with the key they get.
5. **Check the connection.** Run `GET https://api.synorb.com/account` from code, with `Authorization: Bearer <key>` read from `SYNORB_KEY`. A 200 response means the key works. Do not call `synorb-profile`.
   Read the plan name from `subscription.plan_display_name` and the allowance left from `usage.manifests_remaining`. Never state a plan number from memory.
6. **Check the plan.**
   - Professional, Startup or Enterprise can run the full report.
   - Starter, Individual and the 72 Hour Agent Demo can run Steps 2 and 3. They cannot run Step 4 for a large scope. Say so plainly now, before they spend time. Tell them how many Manifests the scope would use after Step 3.
7. **Confirm it out loud.** Say: "You are connected to Synorb. Plan: <plan name>. Allowance left: <number>." Then go to Step 2 and take the user through the questions. If you could not say this sentence with a real plan name, you are not connected. Stay in Step 1.

## Step 2: Pick the map and ask the user

1. Match the request to one pack:

   | The user wants | Pack |
   | --- | --- |
   | State bills, governors, executive orders, state action on a topic | [pack-state-legislatures-executives.md](#bundled-references-pack-state-legislatures-executives-md) |
   | AI companies, models, vendors, funding, launches, peers | [pack-ai-companies.md](#bundled-references-pack-ai-companies-md) |
   | What listed companies say in their blogs, by sector | [pack-public-company-blogs.md](#bundled-references-pack-public-company-blogs-md) |

2. If no pack fits, say so. Do not build a report from one company or one source.
3. **Know the topic first.** If the user has not said what the report should answer, ask that one question in chat. Offer a few examples as choices. Build the rest of the questions around the answer, so the options fit it.
4. **Use the brief form.** You can write a file and open it on the user's machine, so give them a short form and not a list of chat questions. Follow [assets/brief-form.md](#bundled-assets-brief-form-md).
   - Build the questions from the pack. Do not ask again what the user already told you, in their first message or earlier in the chat. Show it in the form's "What you told me" box (`known`), where they can fix it. Count only the questions you still ask.
   - Put the number of questions in the form's intro, for example "6 quick questions". Count only the questions you still need.
   - Use multiple choice whenever the answers come from a set, such as the offices, the kinds of action, the segments, the sectors, the period and the length. Preselect the default. Add "Other" so the user can write their own.
   - Offer only options that fit what the user said so far. Read segments and sectors from Synorb with `synorb-catalog` or `GET /v3/public/beacons`. Never type a list from memory.
   - For the period, the data reaches back about three full months plus the current month. Offer the last full month (default) and the last three full months. Do not offer a quarter or a year you cannot confirm. Say that you will check the real dates in Step 3.
   - A choice that needs detail gets a small box beside it, for example "A region" with "Which region?". Do not make the user pick "Other" for it.
   - Put a question in a second form when its options depend on another answer. For example, ask which offices first. Then ask which kinds of action fit those offices.
   - Say the output in the form's intro: it is a PDF. Add an output question only if the user may want something else.
   - Open the form for the user and tell them: "I made a short form for your answers. It takes about a minute. Fill it in, click Copy my answers, then paste here."
   - Read the pasted brief. Treat "(no answer: use the default)" as the default, and say which defaults you used.
   - If the answers need a follow-up that depends on them, send one more short form with only the new questions. Do not send more than two forms.
5. **Chat fallback.** If you cannot write or open a file, or the user would rather answer in chat, ask one question at a time. Do not show a list.
   - Say how many questions there are before the first: "I have 6 quick questions before I can build the scope copy." Count only the ones you still need.
   - Label every question with its place: "Question 2 of 6: who will read the report?" If an answer settles a later question, lower the count and say so.
   - Give multiple-choice options whenever the answers come from a set. If your agent has a question tool that shows choices (Claude Code has `AskUserQuestion`), use it, with one question in each call. If not, write a numbered list and say: "Reply with a number, or write your own answer." Put the recommended option first and mark it "(default)". Add "Other".
   - Choose each next question from everything the user has said so far. Offer only options that fit.
   - After each answer, show the brief so far in one line, with the number left: "So far: <topic>, <audience>, <focus>. 4 questions left."
   - If the user says "defaults" or "you choose", apply the defaults for the rest, show the full brief, and tell them which questions they skipped.
6. In chat, ask for the output last, in one line, and only if the user did not say. PDF is the default.
7. Stop when you have the topic, the audience, the focus (states, segments, sectors or companies), the period and the length. Five to seven questions is usual. Go to Step 3.

## Step 3: Show the scope copy

Fill [assets/scope-copy-template.md](#bundled-assets-scope-copy-template-md). Show it in chat. This step uses no allowance.

Every market map is a Beacon. Run the whole report on the map's Beacon. Do not build the scope from Surface ids or a list of Streams.

1. **Read the map's size first, with no key.** `GET /v3/public/beacons` lists the catalog Beacons. Each has `counts`: Streams, channels and Manifests last month. Show these as the first draft of the scope. The catalog slugs are `state-legislatures-executives`, `ai-companies` and `public-company-blogs`.
2. Find the map's Beacon in the account (`synorb-beacons`, or `GET /v3/beacons`). A starter Beacon can already be the right one, for example AI Companies.
3. If the account does not have it, preview the copy: `POST /v3/beacons/fork` with `{"pack_id": "<catalog slug>", "status": "active", "dry_run": true}`. The preview writes nothing and charges nothing.
4. Check the Beacon limit in the account response. Copy only after the user says yes. If the limit is full, name the Beacons and ask which one to archive. Archive nothing without a yes.
5. Count what a Beacon count can count with `mode="count"` or `mode="orient"`. Both are free. These counts cover the whole map, a date range, and the supported narrow-only filters of the Beacon. Never invent a field and never set `broaden_sources=true`.
   A topic that you define yourself, such as "data centers", has no free count. For that claim, write "counted after the pull" and size it from the Beacon total. You count it in Step 5, with a term list you test.
6. List the proposed claims. Give each its evidence count when it has one, and the chart you plan.
7. List what you leave out and why.
8. Estimate the run: Manifests to read, pages in the report, and the share of the allowance.
9. Ask the user to edit it: swap a claim, change the period, drop a chart, add a topic.
10. Wait for "approve". Do not pull Manifests before it.

If the user has not said yes to the copy yet, show the first draft from step 1 and ask for the yes. Claim-level counts come after the copy.

## Step 4: Pull the approved scope with code

Follow [references/pull-with-code.md](#bundled-references-pull-with-code-md).

1. Pull only the approved scope, from the same Beacon and dates you counted. Do not read outside it.
2. Write every page to a file. Do not print Manifests.
3. Stop at the allowance. Never go past it. Tell the user what you could not read.
4. Record how many Manifests matched, how many you read and how many you kept.

## Step 5: Analyse

Follow [references/report-method.md](#bundled-references-report-method-md).

1. Define each topic with a term list and test it. The method reference has the steps.
2. Count with code. Count companies or bills, not Records.
3. Give each claim a control group.
4. Read every hit for a small topic, and a sample for a large one. Report how often your term list was right. You are one reader, so say so.
5. If you read a sample of the matched Manifests, say what that means for each count. Counts are floors.
6. Drop every claim you cannot trace to specific Records. Drop a claim the data contradicts.
7. Read the Claims and quotes of the items you feature. Never write from titles.

## Step 6: Build the report

1. Use the outline in [assets/report-outline.md](#bundled-assets-report-outline-md).
2. Put one finding on each chart page. Give it a headline, a chart, "What this tells us", "The question to pursue" and a scope note with the denominator and the period.
3. Add a methods and limits page, and an appendix that lists every cited Record with its link.
4. Build the PDF with the theme in [assets/report-theme.md](#bundled-assets-report-theme-md) and the charts from the recipes. Print the HTML to PDF with a headless browser. If no tool can write a PDF, give the user the HTML file and say how to print it.
5. Check every page for overflow and every number against the data file before you deliver.
6. Deliver the PDF, the data file and the cited Records file. Do not publish or send anything for the user.

## Rules for this skill

- Say what organizations publish in their own channels. Do not say what the press did or did not write. Synorb cannot show that.
- A mention is not use, a customer tie or an integration. Say so wherever you chart mentions.
- Keep each organization's words apart from your analysis.
- Do not give investment advice. The report is information.
- If a window is quiet or the evidence is thin, shrink the report and say why. Do not pad.
- If `quota.account_notice.user_message` is in a response, give that sentence once, after the result.

<!-- Generated from https://synorb.com/skills/market-map-report (repo: Synorb/skills). The bundled files below are part of this skill. -->

---

<a id="bundled-assets-brief-form-md"></a>
## Bundled file: `assets/brief-form.md`

### Brief form

A short form the user fills in, instead of a list of chat questions. You fill in the data. The page does the rest.
It is one HTML file with no network calls. It shows what the user already told you, then the questions with multiple-choice options, a progress line, a live summary and a "Copy my answers" button.

#### How to use it

1. Copy the HTML below into a file named `synorb-report-brief.html` in the user's working folder.
2. Replace the JSON between `BRIEF_START` and `BRIEF_END` with your own, in the shape shown after the page.
3. In your JSON text, replace every `</` with `<\/`, so that the page does not end early.
4. Open the file for the user. On Windows run `start "" synorb-report-brief.html`. On macOS run `open synorb-report-brief.html`. On Linux run `xdg-open synorb-report-brief.html`. If you cannot open it, tell the user the full path and ask them to open it.
5. Tell the user: "I made a short form for your answers. It takes about a minute. Fill it in, click Copy my answers, then paste here."
6. Read the pasted text. Go to Step 3. If the user would rather answer in chat, use the chat questions in Step 2 instead.

#### The page

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Your report brief</title>
<style>
:root{--bg:#fafafa;--fg:#111;--mute:#5a5a5a;--line:#d6d6d6;--card:#fff;--accent:#0a7a4b;--accent-fg:#fff}
@media (prefers-color-scheme:dark){:root{--bg:#0e0e0e;--fg:#ededed;--mute:#a3a3a3;--line:#333;--card:#171717;--accent:#3ecf8e;--accent-fg:#06281a}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
main{max-width:720px;margin:0 auto;padding:24px 16px 120px}
h1{font-size:1.5rem;margin:0 0 4px}
.map{color:var(--mute);margin:0 0 12px}
.progress{position:sticky;top:0;background:var(--bg);padding:10px 0;border-bottom:1px solid var(--line);z-index:2}
.progress b{font-weight:600}
.bar{height:6px;background:var(--line);border-radius:3px;margin-top:6px;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .2s}
fieldset{border:1px solid var(--line);background:var(--card);border-radius:12px;margin:16px 0;padding:14px 16px}
fieldset.known{border-style:dashed}
legend{padding:0 6px;color:var(--mute);font-size:.85rem}
.q{font-weight:600;margin:0 0 8px}
.hint{color:var(--mute);font-size:.9rem;margin:-4px 0 8px}
label.opt{display:flex;gap:10px;align-items:flex-start;padding:8px 6px;border-radius:8px;cursor:pointer;flex-wrap:wrap}
label.opt:hover{background:rgba(127,127,127,.12)}
label.opt input[type=radio],label.opt input[type=checkbox]{margin-top:5px}
.tag{font-size:.75rem;color:var(--accent);margin-left:6px}
input[type=text],textarea{width:100%;font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.inline{margin:2px 0 4px 30px;width:calc(100% - 30px)}
.summary{border:1px dashed var(--line);border-radius:12px;padding:12px 16px;margin:16px 0;color:var(--mute)}
.summary b{color:var(--fg)}
.actions{position:fixed;left:0;right:0;bottom:0;background:var(--bg);border-top:1px solid var(--line);padding:12px 16px}
.actions div{max-width:720px;margin:0 auto;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
button{font:inherit;border-radius:8px;padding:10px 16px;border:1px solid var(--accent);background:var(--accent);color:var(--accent-fg);cursor:pointer;font-weight:600}
button.ghost{background:transparent;color:var(--fg);border-color:var(--line);font-weight:500}
button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#msg{color:var(--mute);font-size:.9rem}
</style>
</head>
<body>
<main>
<h1 id="title"></h1>
<p class="map" id="map"></p>
<p id="intro"></p>
<div class="progress" role="status" aria-live="polite"><span id="count"></span><div class="bar"><i id="fill"></i></div></div>
<form id="form" onsubmit="return false"></form>
<div class="summary" id="summary"></div>
</main>
<div class="actions"><div>
<button id="copy" type="button">Copy my answers</button>
<button id="save" type="button" class="ghost">Save as a file</button>
<span id="msg" role="status" aria-live="polite"></span>
</div></div>
<script>
/*BRIEF_START*/
const BRIEF = {
  "title": "Your report brief",
  "map": "State Legislatures & Executives",
  "intro": "Pick an option, or write your own. The default is already selected.",
  "questions": [
    {"id": "topic", "label": "What the report should answer", "type": "text", "known": true, "value": "data centers"},
    {"id": "states", "label": "Which states?", "type": "single", "options": [{"label": "All states", "default": true}, {"label": "A region", "text": "Which region?"}, {"label": "A list", "text": "Which states?"}], "other": true}
  ]
};
/*BRIEF_END*/
(function () {
  var all = BRIEF.questions, known = all.filter(function (q) { return q.known; }), asked = all.filter(function (q) { return !q.known; });
  var form = document.getElementById("form");
  document.getElementById("title").textContent = BRIEF.title || "Your report brief";
  document.getElementById("map").textContent = BRIEF.map ? "Market map: " + BRIEF.map : "";
  document.getElementById("intro").textContent = BRIEF.intro || "";
  document.title = BRIEF.title || "Your report brief";

  function el(tag, attrs, text) {
    var n = document.createElement(tag);
    Object.keys(attrs || {}).forEach(function (k) { n.setAttribute(k, attrs[k]); });
    if (text !== undefined) n.textContent = text;
    return n;
  }
  function textField(q) {
    var t = el(q.long ? "textarea" : "input", { name: q.id, placeholder: q.placeholder || "" });
    if (q.long) t.setAttribute("rows", "3"); else t.setAttribute("type", "text");
    t.value = q.value || "";
    return t;
  }

  if (known.length) {
    var kf = el("fieldset", { "class": "known" });
    kf.appendChild(el("legend", {}, "What you told me. Change anything that is wrong."));
    known.forEach(function (q) {
      kf.appendChild(el("p", { "class": "q", "data-known": q.id }, q.label));
      kf.appendChild(textField(q));
    });
    form.appendChild(kf);
  }

  asked.forEach(function (q, i) {
    var fs = el("fieldset", { "data-id": q.id });
    fs.appendChild(el("legend", {}, "Question " + (i + 1) + " of " + asked.length));
    fs.appendChild(el("p", { "class": "q" }, q.label));
    if (q.hint) fs.appendChild(el("p", { "class": "hint" }, q.hint));
    if (q.type === "text") {
      fs.appendChild(textField(q));
    } else {
      var kind = q.type === "multi" ? "checkbox" : "radio";
      var wanted = [].concat(q.value || []);
      var matched = false;
      (q.options || []).forEach(function (o) {
        var lab = el("label", { "class": "opt" });
        var inp = el("input", { type: kind, name: q.id, value: o.label });
        if (o.default && !wanted.length) inp.checked = true;
        if (wanted.indexOf(o.label) > -1) { inp.checked = true; matched = true; }
        lab.appendChild(inp);
        var span = el("span", {}, o.label);
        if (o.default) span.appendChild(el("span", { "class": "tag" }, "default"));
        lab.appendChild(span);
        if (o.text) {
          lab.appendChild(el("input", { type: "text", "class": "inline", "data-for": o.label, placeholder: o.text, "aria-label": o.label + ": " + o.text }));
        }
        fs.appendChild(lab);
      });
      if (q.other) {
        var lab2 = el("label", { "class": "opt" });
        var oth = el("input", { type: kind, name: q.id, value: "__other__" });
        lab2.appendChild(oth);
        lab2.appendChild(el("span", {}, "Other"));
        var ot = el("input", { type: "text", "class": "inline", "data-for": "__other__", placeholder: "Write your own", "aria-label": "Other answer for: " + q.label });
        lab2.appendChild(ot);
        fs.appendChild(lab2);
        if (wanted.length && !matched) { oth.checked = true; ot.value = wanted.join("; "); }
      }
    }
    form.appendChild(fs);
  });

  function inlineText(fs, key) {
    var t = fs.querySelector('input.inline[data-for="' + key.replace(/"/g, '\\"') + '"]');
    return t ? t.value.trim() : "";
  }
  function answerOf(q) {
    if (q.known) return form.querySelector('[name="' + q.id + '"]').value.trim();
    var fs = form.querySelector('[data-id="' + q.id + '"]');
    if (q.type === "text") return fs.querySelector("input,textarea").value.trim();
    var picked = [].slice.call(fs.querySelectorAll("input[type=radio]:checked,input[type=checkbox]:checked")).map(function (x) {
      var extra = inlineText(fs, x.value);
      if (x.value === "__other__") return extra;
      return extra ? x.value + ": " + extra : x.value;
    }).filter(Boolean);
    return picked.join("; ");
  }

  function refresh() {
    var done = 0, box = document.getElementById("summary");
    while (box.firstChild) box.removeChild(box.firstChild);
    var any = false;
    all.forEach(function (q) {
      var a = answerOf(q);
      if (!q.known && a) done++;
      if (a) {
        any = true;
        var line = el("div", {});
        line.appendChild(el("b", {}, q.label + " "));
        line.appendChild(document.createTextNode(a));
        box.appendChild(line);
      }
    });
    if (!any) box.textContent = "Your answers will show here.";
    var left = asked.length - done, c = document.getElementById("count");
    while (c.firstChild) c.removeChild(c.firstChild);
    c.appendChild(el("b", {}, left === 0 ? "All " + asked.length + " answered. " : done + " of " + asked.length + " answered. "));
    c.appendChild(document.createTextNode(left === 0 ? "Click Copy my answers." : left + " left."));
    document.getElementById("fill").style.width = Math.round(100 * done / Math.max(asked.length, 1)) + "%";
  }

  function brief() {
    var out = ["SYNORB REPORT BRIEF"];
    if (BRIEF.map) out.push("Map: " + BRIEF.map);
    known.forEach(function (q) { out.push("- " + q.label + ": " + (answerOf(q) || "(not given)")); });
    asked.forEach(function (q, i) { out.push((i + 1) + ". " + q.label + " " + (answerOf(q) || "(no answer: use the default)")); });
    return out.join("\n");
  }

  function say(m) { var s = document.getElementById("msg"); s.textContent = m; setTimeout(function () { s.textContent = ""; }, 4000); }

  document.getElementById("copy").addEventListener("click", function () {
    var text = brief();
    function fallback() {
      var a = document.createElement("textarea"); a.value = text; a.setAttribute("readonly", "");
      a.style.position = "fixed"; a.style.opacity = "0"; document.body.appendChild(a); a.select();
      var ok = false; try { ok = document.execCommand("copy"); } catch (e) {}
      document.body.removeChild(a); return ok;
    }
    if (navigator.clipboard && navigator.clipboard.writeText) {
      navigator.clipboard.writeText(text).then(function () { say("Copied. Paste it into your agent."); }, function () { say(fallback() ? "Copied. Paste it into your agent." : "Copy failed. Use Save as a file."); });
    } else { say(fallback() ? "Copied. Paste it into your agent." : "Copy failed. Use Save as a file."); }
  });

  document.getElementById("save").addEventListener("click", function () {
    var blob = new Blob([brief() + "\n"], { type: "text/plain" });
    var a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "synorb-report-brief.txt";
    document.body.appendChild(a); a.click(); document.body.removeChild(a);
    say("Saved. Tell your agent the file is in your Downloads folder.");
  });

  // Typing in a box that belongs to an option picks that option.
  form.addEventListener("input", function (e) {
    var t = e.target;
    if (t.classList && t.classList.contains("inline")) {
      var box = t.closest("label").querySelector("input[type=radio],input[type=checkbox]");
      if (box && t.value.trim() && !box.checked) box.checked = true;
    }
    refresh();
  });
  form.addEventListener("change", refresh);
  refresh();
})();
</script>
</body>
</html>
```

#### The data

Put this shape between `BRIEF_START` and `BRIEF_END`.

```json
{
  "title": "Your report brief",
  "map": "State Legislatures & Executives",
  "intro": "3 quick questions before I can build the scope copy. The report will be a PDF. Pick an option, or write your own. The default is already selected.",
  "questions": [
    {"id": "topic", "label": "What the report should answer", "type": "text", "known": true, "long": true, "value": "What states are doing about data centers and power prices"},
    {"id": "audience", "label": "Who will read it", "type": "text", "known": true, "value": "Infrastructure investors"},
    {"id": "states", "label": "Which states?", "type": "single",
     "options": [{"label": "All states the map covers", "default": true}, {"label": "A region", "text": "Which region?"}, {"label": "A list", "text": "Which states?"}], "other": true},
    {"id": "offices", "label": "Which offices?", "type": "single",
     "options": [{"label": "Legislatures and governors, kept apart", "default": true}, {"label": "Legislatures only"}, {"label": "Governors only"}]},
    {"id": "period", "label": "Which period?", "type": "single", "hint": "The data reaches back about three full months plus this month. I check the real dates in the next step.",
     "options": [{"label": "The last full month", "default": true}, {"label": "The last three full months"}], "other": true}
  ]
}
```

Fields:

- `type` is `single` (one choice), `multi` (more than one) or `text` (free text). Add `"long": true` for a larger text box.
- **`"known": true`** marks something the user already told you. It must be `text`. It shows in a box at the top, called "What you told me", where the user can fix it. It is not counted as a question. The pasted brief lists it first.
- Count only the questions that are not `known`. Put that number in `intro`, for example "3 quick questions". The page numbers them the same way.
- Mark the default option with `"default": true`. A `multi` question can have more than one default.
- Add `"other": true` to let the user write their own answer. Typing in the box picks it.
- Add `"text": "Which region?"` to an option to show a small box beside it. Use it for "A region" or "A list". Typing in the box picks the option. The pasted answer reads `A region: Texas`.
- Set `"value"` on a choice question to pre-select an answer the user gave. If it matches no option, the page selects "Other" and fills the box.
- `hint` is plain text under the question. It may carry live numbers that you read from Synorb.
- Offer only options that fit what the user said so far. Read segments, sectors and dates from Synorb. Do not type them from memory.
- Do not put questions in one form when the options depend on another answer in the same form. Send a second form for those. For example, ask the offices first, then the kinds of action that fit them.
- Say in `intro` what the output is. It is a PDF. Add an output question only if the user may want something else.

#### What you get back

The user pastes text like this:

```
SYNORB REPORT BRIEF
Map: State Legislatures & Executives
- What the report should answer: What states are doing about data centers and power prices
- Who will read it: Infrastructure investors
1. Which states? A region: Texas and Ohio
2. Which offices? Legislatures and governors, kept apart
3. Which period? The last full month
```

A line that says "(no answer: use the default)" means the user left it blank. Use the default and say so.

---

<a id="bundled-assets-report-outline-md"></a>
## Bundled file: `assets/report-outline.md`

### Report outline

Scale the number of chart pages to the length the user chose. Each chart page holds one claim.

#### Cover

- Title, the map, the period and the date of the data.
- One line that names the population: "N companies" or "N states".
- The line "Built with Synorb data".

#### Summary (one page)

- The three to five findings that matter most, each in one sentence with its number.
- One line on what the data is and what it is not.

#### Page count

The length the user chose counts the chart pages. The cover, the summary, the methods page and the appendix come on top. A short test brief can drop the summary. Say so on the cover.

#### Chart pages

Each page has these parts in this order:

1. **Headline.** The claim in one sentence, with the number in it.
2. **Chart.** One chart that fits the claim.
3. **Caption.** What the chart shows, the denominator and the period.
4. **What this tells us.** Two or three sentences on the meaning for this reader.
5. **The question to pursue.** One question the reader can take to their own work.
6. **Scope note.** The population, the control group, the minimum-count rule and any gap.
7. **Quote (optional).** One short quote from a Claim, with its source link. Skip it when no quote carries the point.

The footer on every page names the map, the period, the matched total, the number read and the page number.

Group the pages in chapters. Put the population page first. Put the strongest claim early.

#### Methods and limits (one or two pages)

- What the data is and where it comes from.
- Matched, read and kept counts.
- The instruments and how you checked them, with your labelling agreement.
- What the data cannot show.
- A line that says the report is information and not advice.

#### Appendices

- A list of every organization or state in the population, with its counts.
- The cited Records: company, title, date and link.
- Your reviewed labels.
- The scope copy the user approved.

---

<a id="bundled-assets-report-theme-md"></a>
## Bundled file: `assets/report-theme.md`

### Report theme

One style sheet and one page layout for the whole report. Use them so every page looks designed and the pages do not spill over.
The theme is brand-neutral. The user can change the three colour values at the top to match their own brand.
It prints to Letter size. For A4, change `size: Letter` to `size: A4`.

#### How to use it

1. Write one HTML file for the whole report. Put the style sheet below in its `<style>` block.
2. Add one `<section class="page">` for each page, from the layouts below. Each section is one printed page.
3. Draw each chart with [chart-recipes.md](#bundled-references-chart-recipes-md). Save it as a PNG and put it in the page with an `<img>` tag.
4. Print the file to PDF with a headless browser. In Playwright, use `page.pdf(prefer_css_page_size=True, print_background=True)`.
5. Check the page count and look at every page. See [chart-kit.md](#bundled-references-chart-kit-md).

#### The style sheet

```css
:root{--ink:#111;--mute:#5f5f5f;--line:#dcdcdc;--soft:#f4f6f5;--accent:#0a7a4b;--accent-soft:#e6f2ec}
@page{size:Letter;margin:0}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font:10.5pt/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;color:var(--ink);-webkit-print-color-adjust:exact;print-color-adjust:exact}
.page{width:8.5in;height:11in;padding:0.7in 0.75in 0.9in;position:relative;page-break-after:always;overflow:hidden;background:#fff}
.page:last-child{page-break-after:auto}
.kicker{font-size:8.5pt;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);font-weight:700;margin:0 0 8pt}
h1{font-size:23pt;line-height:1.15;margin:0 0 10pt;font-weight:700;letter-spacing:-.01em}
h2{font-size:13pt;margin:16pt 0 6pt;font-weight:700}
p{margin:0 0 8pt}
.lead{font-size:12pt;color:var(--mute);margin-bottom:12pt}
figure{margin:10pt 0 6pt;padding:0}
figure img{width:100%;height:auto;max-height:4.3in;object-fit:contain;display:block}
figcaption{font-size:8.5pt;color:var(--mute);margin-top:4pt}
.box{border:1px solid var(--line);border-left:4px solid var(--accent);background:var(--soft);border-radius:4pt;padding:9pt 12pt;margin:10pt 0}
.box b{display:block;font-size:8.5pt;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);margin-bottom:3pt}
.box p{margin:0}
.scope{font-size:8.5pt;color:var(--mute);border-top:1px solid var(--line);padding-top:7pt;margin-top:10pt}
.quote{font-size:10pt;font-style:italic;color:var(--mute);border-left:2px solid var(--line);padding-left:10pt;margin:8pt 0}
footer{position:absolute;left:0.75in;right:0.75in;bottom:0.4in;font-size:8pt;color:var(--mute);display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:6pt}
.cover{background:linear-gradient(180deg,var(--accent-soft) 0,#fff 55%);display:flex;flex-direction:column;justify-content:center}
.cover h1{font-size:34pt;max-width:6in}
.cover .meta{margin-top:18pt;color:var(--mute);font-size:10.5pt}
.cover .rule{width:64pt;height:4pt;background:var(--accent);margin:0 0 18pt}
.stats{display:flex;gap:10pt;margin:12pt 0}
.stat{flex:1;border:1px solid var(--line);border-radius:6pt;padding:10pt 12pt;background:#fff}
.stat .n{font-size:22pt;font-weight:700;color:var(--accent);line-height:1.1}
.stat .t{font-size:8.5pt;color:var(--mute)}
table{border-collapse:collapse;width:100%;font-size:8.5pt}
th{text-align:left;border-bottom:2px solid var(--ink);padding:4pt 6pt}
td{border-bottom:1px solid var(--line);padding:4pt 6pt;vertical-align:top}
a{color:var(--accent);text-decoration:none;word-break:break-all}
```

#### Cover

```html
<section class="page cover">
  <div class="rule"></div>
  <p class="kicker">{map name} | {period}</p>
  <h1>{report title with the main finding}</h1>
  <p class="lead">{one sentence: what the report covers and for whom}</p>
  <p class="meta">{denominator, for example 100 offices in 50 states}<br>Data to {date}. Built with Synorb data.</p>
</section>
```

#### Summary page

```html
<section class="page">
  <p class="kicker">Summary</p>
  <h1>{the three to five findings, as one headline}</h1>
  <div class="stats">
    <div class="stat"><div class="n">{number}</div><div class="t">{what it counts}</div></div>
    <div class="stat"><div class="n">{number}</div><div class="t">{what it counts}</div></div>
    <div class="stat"><div class="n">{number}</div><div class="t">{what it counts}</div></div>
  </div>
  <h2>What we found</h2>
  <p>{finding 1, with its number and page}</p>
  <p>{finding 2}</p>
  <p>{finding 3}</p>
  <p class="scope">What the data is, and what it is not.</p>
  <footer><span>Built with Synorb data | {map} | {period} | {matched} matched, {read} read</span><span>Page {n}</span></footer>
</section>
```

#### Chart page

```html
<section class="page">
  <p class="kicker">{chapter name}</p>
  <h1>{the claim, with the number in it}</h1>
  <figure>
    <img src="{chart}.png" alt="{what the chart shows}">
    <figcaption>{caption: what it shows, the population and the period}</figcaption>
  </figure>
  <div class="box"><b>What this tells us</b><p>{two or three sentences}</p></div>
  <div class="box"><b>The question to pursue</b><p>{one question}</p></div>
  <p class="scope"><b>Scope note.</b> {population, control group, minimum-count rule, gaps}</p>
  <footer><span>Built with Synorb data | {map} | {period} | {matched} matched, {read} read</span><span>Page {n}</span></footer>
</section>
```

#### Methods and limits page

```html
<section class="page">
  <p class="kicker">Methods and limits</p>
  <h1>How this report was built</h1>
  <h2>The data</h2><p>{what it is, the Beacon, the period, matched, read and kept}</p>
  <h2>How we counted</h2><p>{the term lists, the checks, the precision of the list, who read the labels}</p>
  <h2>What the data cannot show</h2><p>{the limits, in plain sentences}</p>
  <p class="scope">This report is information. It is not investment advice.</p>
  <footer><span>Built with Synorb data | {map} | {period}</span><span>Page {n}</span></footer>
</section>
```

#### Appendix page

```html
<section class="page">
  <p class="kicker">Appendix</p>
  <h1>Cited records</h1>
  <table>
    <tr><th>Organization</th><th>Title</th><th>Date</th><th>Link</th></tr>
    <tr><td>{name}</td><td>{title}</td><td>{date}</td><td><a href="{url}">{short link}</a></td></tr>
  </table>
  <footer><span>Built with Synorb data | {map} | {period}</span><span>Page {n}</span></footer>
</section>
```

A table that runs past one page needs a second appendix section. Split the rows, and repeat the header row on the new page.

#### Rules

1. One claim for each chart page. The headline holds the number.
2. Keep a page inside its box. If text spills, shorten the text. Do not shrink the font below 9 points.
3. Keep the footer on every page after the cover.
4. A page that spills onto a new page means your page count is wrong. Fix it before you deliver.

---

<a id="bundled-assets-scope-copy-template-md"></a>
## Bundled file: `assets/scope-copy-template.md`

### Scope copy: <report title>

Show this in chat. Fill every line. Use real counts from free count calls. The user edits it and replies "approve".

#### Brief

- **Map:** <State Legislatures & Executives, AI Companies or Public Company Blogs>
- **Audience:** <who reads it>
- **Period:** <from> to <to>. Dates available from the count: <effective from> to <effective to>.
- **Length:** about <6, 12 or 25> pages.
- **Focus:** <segments, states, sectors, companies or topics the user chose>
- **Output:** PDF, with the data file and the cited-Records file.

#### Proposed claims

| # | Claim to test | Evidence count | Control group | Chart |
| --- | --- | --- | --- | --- |
| 1 | <one sentence> | <number of items or companies> | <fixed panel, rest of the map, or other> | <chart type> |
| 2 | | | | |

#### Left out, and why

- <a topic or claim, and the reason: thin evidence, a gap in coverage, or outside the focus>

#### Cost of the full run

- **Manifests matched in the scope:** <total_count>.
- **Manifests to read:** <number>. Rows are used for the bulk read.
- **Share of the allowance left:** <percent>. Allowance left: <number from the account>.
- **Plan:** <plan name from the account>. The full run needs Professional or higher.
- **This scope copy used:** 0 Manifests.

#### Limits you should know

- <coverage gaps, such as a state or a source that is not readable>
- <anything the data cannot show, for example outside press coverage>

#### What to do now

Reply with edits, or "approve". Nothing is pulled until you approve.

---

<a id="bundled-references-chart-kit-md"></a>
## Bundled file: `references/chart-kit.md`

### Chart kit and PDF build

Use the tools your agent already has. Do not install anything the user did not allow.

#### Choose a chart for the claim

Choose the message first. Then choose the form. Do not use six bar charts. Ready-made code for the charts in this table is in [chart-recipes.md](#bundled-references-chart-recipes-md). Copy it and pass your numbers.

| The claim is about | Chart |
| --- | --- |
| A share of a whole | Waffle, or a stacked bar |
| Two groups that differ | Dumbbell, or paired bars |
| A ranking | Lollipop, or a bar with a minimum-count rule |
| Change over time | Line or slope chart, on a fixed panel |
| Many items over time | Heatmap, or small multiples |
| Concentration | Lorenz curve, or a ranked bar with the top share marked |
| Links between organizations | Network or a matrix |
| Parts of a hierarchy | Treemap |
| A sequence of events | Timeline |
| A comparison of three or more measures | Table with data bars |

#### Draw every chart so it reads on a phone

1. Use large type. A headline, a chart and at most three labels.
2. Show the number on the chart. Do not make the reader guess from the axis.
3. Name the denominator and the period under the chart.
4. Use one accent colour and grey. Use colour for meaning, not decoration.
5. Make colour-blind safe choices. Do not use red against green.
6. Save each chart as an image and as a small CSV of the numbers behind it.

#### Page template

Use the theme in [../assets/report-theme.md](#bundled-assets-report-theme-md). It has the style sheet and every page layout. The block below shows the shape of a chart page.

Use one template for every chart page. Letter or A4, portrait, with these blocks from top to bottom:

```html
<section class="page">
  <h1>{headline with the number}</h1>
  <figure><img src="{chart.png}" alt="{what the chart shows}"><figcaption>{caption: population, period}</figcaption></figure>
  <div class="box"><b>What this tells us</b><p>{two or three sentences}</p></div>
  <div class="box"><b>The question to pursue</b><p>{one question}</p></div>
  <p class="scope"><b>Scope note.</b> {population, control group, minimum count, gaps}</p>
  <footer>Built with Synorb data | {map} | {period} | {matched} matched, {read} read | Page {n}</footer>
</section>
```

Set a fixed page size, 0.75 inch margins and a body size of 10 to 11 points. A chart is at most half the page height. The text boxes get a light fill and a thin border.

#### Build the PDF

1. Write each page as HTML with the same template: headline, chart, a "What this tells us" box, a "The question to pursue" box and a scope note.
2. Render the pages to PDF with the tool you have, for example a headless browser, WeasyPrint or a notebook export.
3. Check every page for text that runs off the page, a chart label that is cut off, and a page that spilled onto an extra page. Render each page to an image with a library such as PyMuPDF, then look at the image. Compare the page count with the plan.
4. If no tool can make a PDF, give the user the HTML file and say how to print it.
5. Give the PDF a cover with the title, the period, the denominator and the date of the data.
6. Add the footer line "Built with Synorb data" on every page. It is the user's report. Do not say Synorb Research wrote it.

#### Windows

Set `PYTHONIOENCODING=utf8` before you print text with non-ASCII letters. Write files in UTF-8. Do not print long names to the console.

#### Files to deliver

- The PDF.
- `numbers.csv`, with every number in the report and its page.
- `cited_records.csv`, with the company, title, date and link of every Record you cite.
- `scope_copy.md`, the version the user approved.

---

<a id="bundled-references-chart-recipes-md"></a>
## Bundled file: `references/chart-recipes.md`

### Chart recipes

Ready-made charts for the report. They use only `matplotlib` and `numpy`. Copy the code, pass your numbers, save the figure as a PNG and as a small CSV of the numbers behind it.
Choose the chart that fits the claim. See the table in [chart-kit.md](#bundled-references-chart-kit-md).

Every function returns a `matplotlib` figure of 8 by 4.5 inches. Call `save(fig, "name")` to write `name.png` (200 dpi) and nothing else.
Pass real numbers only. Never invent a value to fill a chart.

#### Style and helpers

```python
import math

import matplotlib

matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np

INK, MUTE, LINE = "#111111", "#6b6b6b", "#d9d9d9"
ACCENT, ACCENT2, GREY = "#0a7a4b", "#e07a1f", "#b8b8b8"
PALETTE = ["#0a7a4b", "#e07a1f", "#2f6fbb", "#8a4fb3", "#c0392b", "#7f8c8d"]


def apply_style() -> None:
    plt.rcParams.update({
        "font.family": "DejaVu Sans", "font.size": 11, "text.color": INK, "axes.labelcolor": MUTE,
        "axes.edgecolor": LINE, "xtick.color": MUTE, "ytick.color": MUTE, "axes.spines.top": False,
        "axes.spines.right": False, "axes.grid": False, "figure.facecolor": "white", "axes.facecolor": "white",
    })


def new_fig():
    apply_style()
    fig, ax = plt.subplots(figsize=(8, 4.5))
    return fig, ax


def save(fig, name: str) -> str:
    fig.savefig(f"{name}.png", dpi=200, bbox_inches="tight")
    plt.close(fig)
    return f"{name}.png"


def note(ax, text: str) -> None:
    """A short source line under the chart: denominator and period."""
    ax.figure.text(0.01, -0.02, text, fontsize=8.5, color=MUTE, ha="left", va="top")
```

#### Bar with value labels (a ranking)

```python
def ranked_bars(labels, values, highlight=None, unit=""):
    fig, ax = new_fig()
    order = np.argsort(values)
    labels, values = [labels[i] for i in order], [values[i] for i in order]
    colors = [ACCENT if (highlight is None or l in highlight) else GREY for l in labels]
    bars = ax.barh(labels, values, color=colors, height=0.62)
    for b, v in zip(bars, values):
        ax.text(b.get_width() + max(values) * 0.01, b.get_y() + b.get_height() / 2, f"{v:g}{unit}", va="center", fontsize=10)
    ax.set_xlim(0, max(values) * 1.12)
    ax.xaxis.set_visible(False)
    ax.spines["bottom"].set_visible(False)
    return fig
```

#### Lollipop (a ranking with less ink)

```python
def lollipop(labels, values, unit=""):
    fig, ax = new_fig()
    order = np.argsort(values)
    labels, values = [labels[i] for i in order], [values[i] for i in order]
    y = np.arange(len(labels))
    ax.hlines(y, 0, values, color=LINE, linewidth=2)
    ax.scatter(values, y, s=90, color=ACCENT, zorder=3)
    for yi, v in zip(y, values):
        ax.text(v + max(values) * 0.03, yi, f"{v:g}{unit}", va="center", fontsize=10)
    ax.set_yticks(y, labels)
    ax.set_xlim(0, max(values) * 1.15)
    ax.xaxis.set_visible(False)
    ax.spines["bottom"].set_visible(False)
    return fig
```

#### Dumbbell (two groups that differ)

```python
def dumbbell(labels, a, b, a_label="A", b_label="B"):
    fig, ax = new_fig()
    order = np.argsort(np.abs(np.array(b) - np.array(a)))
    labels, a, b = [labels[i] for i in order], [a[i] for i in order], [b[i] for i in order]
    y = np.arange(len(labels))
    ax.hlines(y, a, b, color=LINE, linewidth=3, zorder=1)
    ax.scatter(a, y, s=95, color=ACCENT, zorder=3, label=a_label)
    ax.scatter(b, y, s=95, color=ACCENT2, zorder=3, label=b_label)
    ax.set_yticks(y, labels)
    ax.legend(frameon=False, loc="upper center", bbox_to_anchor=(0.5, 1.1), ncol=2)
    return fig
```

#### Slope chart (change between two points)

```python
def slope(labels, left, right, left_name="Before", right_name="After"):
    fig, ax = new_fig()
    for l, a, b in zip(labels, left, right):
        color = ACCENT if b >= a else ACCENT2
        ax.plot([0, 1], [a, b], color=color, linewidth=2, marker="o", markersize=6)
        ax.text(-0.03, a, f"{l}  {a:g}", ha="right", va="center", fontsize=9.5)
        ax.text(1.03, b, f"{b:g}", ha="left", va="center", fontsize=9.5)
    ax.set_xlim(-0.6, 1.25)
    ax.set_xticks([0, 1], [left_name, right_name])
    ax.yaxis.set_visible(False)
    ax.spines["left"].set_visible(False)
    return fig
```

#### Waffle (a share of a whole)

```python
def waffle(part, whole, label="share", rows=10, cols=20):
    fig, ax = new_fig()
    n = rows * cols
    filled = round(n * part / whole)
    for i in range(n):
        r, c = divmod(i, cols)
        ax.add_patch(plt.Rectangle((c, rows - 1 - r), 0.86, 0.86, color=ACCENT if i < filled else LINE))
    ax.set_xlim(0, cols)
    ax.set_ylim(0, rows)
    ax.set_aspect("equal")
    ax.axis("off")
    ax.text(0, -0.9, f"{part:,} of {whole:,} ({100 * part / whole:.0f}%) {label}", fontsize=12, color=INK)
    return fig
```

#### Heatmap (many items over a second dimension)

```python
def heatmap(matrix, rows, cols, fmt="{:g}"):
    fig, ax = new_fig()
    m = np.array(matrix, dtype=float)
    im = ax.imshow(m, cmap="Greens", aspect="auto")
    ax.set_xticks(range(len(cols)), cols, rotation=40, ha="right")
    ax.set_yticks(range(len(rows)), rows)
    for i in range(m.shape[0]):
        for j in range(m.shape[1]):
            if m[i, j]:
                ax.text(j, i, fmt.format(m[i, j]), ha="center", va="center", fontsize=8.5,
                        color="white" if m[i, j] > m.max() * 0.6 else INK)
    for s in ax.spines.values():
        s.set_visible(False)
    ax.tick_params(length=0)
    return fig
```

#### Small multiples (the same line for several groups)

```python
def small_multiples(series: dict, x, cols=3):
    apply_style()
    n = len(series)
    rows = math.ceil(n / cols)
    fig, axes = plt.subplots(rows, cols, figsize=(8, 1.9 * rows + 0.4), sharex=True, squeeze=False)
    for ax, (name, y) in zip(axes.flat, series.items()):
        ax.plot(x, y, color=ACCENT, linewidth=2)
        ax.fill_between(x, y, color=ACCENT, alpha=0.12)
        ax.set_title(name, fontsize=10, loc="left", color=INK)
        ax.set_yticks([])
        ax.spines["left"].set_visible(False)
    for ax in list(axes.flat)[n:]:
        ax.axis("off")
    return fig
```

#### Lorenz curve (concentration)

```python
def lorenz(values, label="items"):
    fig, ax = new_fig()
    v = np.sort(np.array(values, dtype=float))
    share = np.insert(np.cumsum(v) / v.sum(), 0, 0)
    x = np.linspace(0, 1, len(share))
    ax.plot([0, 1], [0, 1], color=LINE, linestyle="--", label="Equal share")
    ax.plot(x, share, color=ACCENT, linewidth=2.5, label="Actual")
    ax.fill_between(x, x, share, color=ACCENT, alpha=0.12)
    top = max(1, round(len(v) * 0.1))
    ax.text(0.04, 0.88, f"The top 10% hold {100 * v[-top:].sum() / v.sum():.0f}% of {label}", fontsize=11, color=INK)
    ax.set_xlabel("Share of organizations, smallest first")
    ax.set_ylabel(f"Share of {label}")
    ax.legend(frameon=False, loc="lower right")
    return fig
```

#### Timeline (a sequence of dated events)

```python
def timeline(events):
    """events: list of (date_string, short_label). Dates are YYYY-MM-DD."""
    from datetime import date

    fig, ax = new_fig()
    days = [date.fromisoformat(d) for d, _ in events]
    x = [(d - min(days)).days for d in days]
    ax.hlines(0, min(x) - 2, max(x) + 2, color=LINE, linewidth=2)
    for i, (xi, (d, text)) in enumerate(zip(x, events)):
        up = 1 if i % 2 == 0 else -1
        ax.vlines(xi, 0, up * (0.5 + 0.35 * (i % 3)), color=GREY)
        ax.scatter([xi], [0], s=70, color=ACCENT, zorder=3)
        ax.text(xi, up * (0.55 + 0.35 * (i % 3)), f"{d}\n{text}", ha="center", va="bottom" if up > 0 else "top", fontsize=8.5)
    ax.set_ylim(-2, 2)
    ax.axis("off")
    return fig
```

#### Stacked bar (parts of a whole, by group)

```python
def stacked_bars(groups, parts: dict):
    fig, ax = new_fig()
    bottom = np.zeros(len(groups))
    for i, (name, vals) in enumerate(parts.items()):
        ax.bar(groups, vals, bottom=bottom, color=PALETTE[i % len(PALETTE)], label=name, width=0.6)
        bottom += np.array(vals, dtype=float)
    ax.legend(frameon=False, ncol=min(len(parts), 4), loc="upper center", bbox_to_anchor=(0.5, 1.12))
    return fig
```

#### Rules for every chart

1. One message for each chart. Put the number in the page headline. The chart shows the evidence.
2. Write the denominator and the period under the chart with `note(ax, "...")`.
3. Use the accent colour for the thing the claim is about, and grey for the rest.
4. Keep labels short enough to read on a phone. At most three labels on the chart.
5. Sort bars. Do not leave them in alphabetical order unless the order is the point.
6. Write the numbers behind the chart to a CSV with the same name.

---

<a id="bundled-references-output-quality-md"></a>
## Bundled file: `references/output-quality.md`

### Deliver the result this user needs

Synorb supplies cited outside evidence; the calling runtime supplies authorized user
context, reasoning and delivery. Produce one result for the current job and audience,
with alternatives or audience variants only when requested.

#### Understand the job and choose evidence

Identify the present user-facing job independently of any surrounding implementation,
release or test work. Use relevant accessible context to establish the user's goal,
audience, priorities, constraints and preferred form. Treat delivery feedback as a
quality criterion. Use a prior assessment to update belief only when it addresses the
same domain question or thesis. The current request takes precedence; ask only when a
consequential missing fact prevents useful work, otherwise state a necessary assumption.
Do not infer private facts, commitments or entitlements from a role.

Keep a compact private job brief and use it to select evidence, depth and tone. Choose
candidates and form for this user, without prescribed picks or forced variety. Use
established identity and branding; otherwise use neutral roles and descriptive titles.
A writing sample guides voice, not the conclusion. Private context guides relevance and
belongs in public work only when intended for that audience.

#### Check the reader payoff

After gathering, return to this check before drafting. Identify the specific
understanding, choice or useful experience this reader should gain, the evidence
that earns it, and its concrete consequence. Match the reader's expertise: a clear
basic explanation can serve a newcomer, while an experienced reader may need the
tradeoff or implication beyond a familiar truth.

Make the retained facts do work in that argument. For a synthesis, explain the
mechanism or meaningful contrast connecting items; a broad theme that could join
almost any relevant news is weak editorial support. A strong single item can carry
the result. A decision to maintain course can be useful when the evidence explains
why and what would change it. Do not manufacture novelty or a connection when the
evidence is genuinely thin; narrow the claim and deliver the useful part.

#### Finish the skill's job

Lead with the finding, decision or editorial angle. Develop what changed, why it matters
for this reader and the usable implication. For a decision, identify the actual commitment
being chosen and compare the strongest feasible rival. Apply the user's responsibilities,
existing capabilities and decision horizon before constructing the options. Compare
commitments at a similar decision level: a small package is not a fair win over a whole
new product. If the available options differ in scale, make that tradeoff explicit; when
the relevant gap or eligibility is unknown, keep the comparison conditional or bounded.
Explain what outside evidence adds and establish any assumed gap. A justified decision to
maintain or defer is valid, with the condition that would change it. A communication, demo
or test can be the right next step when the job or evidence supports it; specify what
decision a test resolves. Complete a useful small comparison or artifact when it fits.

Keep these route facts distinct: an offering's compatibility, a connection in this runtime,
an application submitted for review, and verified public availability through a specific
distribution route. A working connection does not establish public discoverability through
a directory. Match availability and eligibility claims to the exact offering and route, and
check available current user context before treating that route as feasible. Submission or
missing approval evidence leaves public status unknown.

Choose evidence for the question, check named priorities, deduplicate original sources,
and connect them only where supported. Separate source facts from interpretation; do not
infer consensus or adoption from a sampled count. Attribute claims naturally, preserve
hedges, measurement conditions and Claim confidence, and retain exact confidence labels
in an evidence table or ledger when used. Keep a result attached to its exact offering,
variant, billing route and population. Check relevant alternatives within a family before
extending one variant's result to the family or platform. Link sources near their claims.

Write the main narrative as attributed facts, interpretation and a usable implication.
Explain distinct uncertainty and counterevidence where they change action or interpretation;
consolidate repeated conditions. Natural attribution such as a source reporting a result
already conveys provenance. A following generic denial of independent proof adds value
only when it changes how the reader should use that result; explain that consequence once.
Put verification diagnostics, sample counts, missing prior state and routine negative-proof
commentary in a receipt, unless requested or needed to understand a material limitation. Match length
and vocabulary to the medium; thin evidence warrants a shorter, bounded result.

Use a visual when it makes a meaningful relationship easier to understand. Read visuals.md
and verify any visual created; qualitative comparisons or timelines can be useful without
a numeric series. For audio, make the argument work aloud and put a useful visual in notes.

#### Preserve privacy and delivery state

Keep job state in the user's runtime, not Synorb. Protect credentials, secret-store contents,
full Synorb Keys and the private job brief. When persistent state exists, retain the brief
with source/date, same-question assessment, open questions, recommendations and feedback;
update stale preferences. Filter delivered items, revisiting them when new evidence changes
their meaning. Record skill version, effective window and successfully delivered items;
commit state only after successful delivery. Recover missed windows within access and
disclose a material gap.

Use existing authorization for saved jobs; schedule, save a Beacon or send to others only
within that authorization. If a capability is absent, deliver the useful part and state the limit.

#### Refine before delivery

The calling agent performs this in the same invocation, without a separate editor, model,
service or manual cleanup. Do not expose intermediate work unless requested or request/save
hidden chain-of-thought.

1. **Draft** the complete deliverable from evidence and available user context.
2. **Critique** the actual passages against two separate conditions. First check the
   reader payoff: what specific understanding or choice does the evidence add for
   this reader, and where does the draft develop its consequence? If the answer is
   only a familiar principle, a restatement of a source or a broad theme, identify
   that substantive weakness before polishing. Check that the selected facts
   advance the chosen argument. Then check source and delivery fidelity. For a
   decision, could a reasonable user choose the strongest rival
   at the stated horizon, after applying the profile and existing capabilities? If the
   rival is only a distant pivot or an implausible foil, repair the comparison. Does each
   judgment match the exact offering and evidence scope, including relevant variants?
   Check source fidelity, privacy, identity, tone and visual accuracy; check spoken pace
   and duration. A generic statement that the draft was checked is not this verification.
3. **Revise** the interpretation, connection or reader consequence when that check
   found it weak; remove facts that do not serve the result, or retrieve better
   evidence within the permitted scope and allowance when needed. Check the
   reader payoff again after revision as well as the factual corrections.
   Reread the revised final as the recipient: identify
   the distinct conditions that affect its use, keep them, and combine duplicates. Remove
   audit narration and routine disclaimers that add no new decision information. Check
   the final comparison and wording, not only the first draft.
4. **Verify** against the request, evidence, privacy and delivery constraints. If a material
   defect remains, repeat at most once (two revision cycles total). Deliver a bounded result
   and its specific limit if a critical evidence gap prevents completion.

Deliver only the final result. When an audit artifact is requested, capture the complete
first draft before critique, then retain the concise critique, revision summary, final and
supporting references, never hidden reasoning or unauthorized private context. Record
missing artifacts honestly rather than reconstructing a draft from the final.
When a critique artifact is requested, briefly identify a concrete evidence-linked
reader payoff or the actual passage where it is missing, separately from factual
and wording checks. This is an observable assessment of the deliverable, not a
request for hidden reasoning.

---

<a id="bundled-references-pack-ai-companies-md"></a>
## Bundled file: `references/pack-ai-companies.md`

### Pack: AI Companies

The map holds hundreds of AI companies. Each company's Stream carries its own blog, newsroom, changelog or filings.
The Beacon is `ai-companies` in the catalog (`GET /v3/public/beacons`). New accounts also have it as a starter Beacon.
Read the current segments and sub-segments from Synorb. Do not type a list or a count from memory.

#### What the data is

- **First-party words.** Every item is what a company says in its own channel.
- **Not outside coverage.** The report reads what companies say about themselves and each other.
- **A mention is not use.** A company that names a model, vendor or customer has not shown that it uses or sells to them.

#### The questions

Build the brief form from these. In chat, ask them one at a time. Either way, use this order. Skip any the user already answered. Use each answer to shape the next question.

1. **The question.** What should the report answer? Offer the ones that fit what they said so far:
   - Which model families and vendors do companies name.
   - Who do companies treat as the referee: analyst firms or benchmark groups.
   - Which listed companies do private companies name most.
   - Who names whom: the peer graph.
   - Which terms rise and fall.
   - Who backs claims with numbers, money or power figures.
   - Tone and release cadence.
2. **The audience.** Who reads it? Offer investors, founders, reporters or analysts. This sets the tone.
3. **Which segments or sub-segments?** Read them live and offer the ones that fit the question. Default: the whole map.
4. **Private, listed or both?** Listed companies are flagged in the Tags. Default: both, kept apart. Skip this if the question is about listed companies only.
5. **Named companies to follow?** A short list is fine. Say that the report still covers the map. Skip it if the user has none.
6. **Which period?** Default: the last full month. Also offer the last three full months. Say that you will check the real dates in Step 3.
7. **How long?** About 6, 12 or 25 pages. Default: 12.

Examples of shaping. If the question is about model vendors, offer the segments where companies name vendors most. If the audience is public-market investors, put listed companies first. If the user names one company, ask which peers to compare it with.

#### Claim patterns to test

Treat each one as a hypothesis. Test it before you chart it. The data can show the opposite.

- **Model supply.** The share of companies that name each vendor or model family. Compare segments.
- **A hidden supplier.** Segments where few companies name any lab.
- **Referees.** Analyst firms against benchmark groups, by segment.
- **Listed exposure.** The listed companies that private companies name most, with a person-read role for each top name.
- **Peer graph.** Name links between companies on the map. Names received against names given.
- **Language over time.** Terms that rise or fall on a fixed panel.
- **Numbers.** The share of Claims with a figure, a percentage or an amount, by segment.
- **Tone.** The share of negative Signals by segment.
- **Cadence.** Releases and changelog entries by company and sub-segment.

#### Control groups that work

- A fixed panel of companies that published in every month, against all companies.
- One segment against the other segments.
- Listed companies against private companies.
- One vendor or model family against the others in the same segment.

#### Rules for this pack

1. Count companies, not Records. One loud blog must not move a number.
2. Use a fixed panel for every trend. Companies are added in waves.
3. Set a minimum count for company-level charts. The typical company has few items in a quarter.
4. Read what the largest source by volume is before you chart volume. Cap it or leave it out, and state the rule.
5. Build an alias list and a stop list from the data. One company can have several names. Some Tags are noise.
6. Leave out a company's own name from its own list of mentions.
7. Find model names in the text. Tags are thin for them.
8. A named organization is a customer, a supplier or a rival only after a person labels it. "Names" is the verb the data supports.
9. Say the denominator on every page: all companies, the active ones, or the panel.
10. Do not use sparse fields such as employee counts for a chart.

---

<a id="bundled-references-pack-public-company-blogs-md"></a>
## Bundled file: `references/pack-public-company-blogs.md`

### Pack: Public Company Blogs

The map holds the blogs of listed companies. Each company's Stream carries its own posts.
The Beacon is `public-company-blogs` in the catalog (`GET /v3/public/beacons`).
Read the current sectors and companies from Synorb. Do not type a list or a count from memory.

#### What the data is

- **Company posts.** Every item is a post that a listed company published on its own blog.
- **Communication, not results.** A post shows what a company chose to say. It does not show results, adoption or audited figures.
- **Blogs only.** This map has no filings and no earnings data. For those, use the Public Company Filings Beacon in a separate report.
- **Many companies have no active blog.** Silence is part of the finding. Count it.

#### The questions

Build the brief form from these. In chat, ask them one at a time. Either way, use this order. Skip any the user already answered. Use each answer to shape the next question.

1. **The question.** What should the report answer? Offer the ones that fit what they said so far:
   - Who blogs and who does not, by size and sector.
   - What companies say about AI, and how that changes.
   - What kind of post: product, results, people, expertise.
   - Who speaks for the company: the company, an executive or an expert.
   - Which outside organizations listed companies name.
   - Which claims carry a number.
2. **The audience.** Who reads it? Offer investors, reporters or advisers. This sets the tone.
3. **Which sectors?** Read them live and offer the ones that fit the question. Default: all.
4. **Which companies?** A ticker list or a watchlist, or all. Say that the report still gives the sector context. Skip it if the user has none.
5. **Which period?** Default: the last full month. Also offer the last three full months. Say that you will check the real dates in Step 3.
6. **How long?** About 6, 12 or 25 pages. Default: 12.

Examples of shaping. If the question is about AI language, offer the sectors that publish most about AI. If the user gives a watchlist, ask which peers to compare it with. If the audience is reporters, ask whether to cover quiet blogs too.

#### Claim patterns to test

Treat each one as a hypothesis. Test it before you chart it. The data can show the opposite.

- **Reach.** The share of the roster with an active blog. A census is a different denominator from a research set. Keep them apart.
- **Concentration.** A few publishers carry most posts.
- **Intensity.** Posts per company, with a minimum-count rule.
- **Sector breadth.** Which sectors publish, which are quiet.
- **AI language.** The share of companies and posts with AI headlines, by sector, on a fixed panel.
- **Kinds of post.** The mix of product, results, people and expertise posts, with your labelling rate reported.
- **Voices.** Company, executive or expert.
- **Organization references.** Who is named, with a company's own name removed.
- **Quantified claims.** The share of posts that carry a figure.

#### Control groups that work

- A fixed panel of channels that posted in every month, against all channels.
- One sector against the other sectors.
- Companies with an active blog against the whole roster.
- AI headlines against all headlines in the same sector.

#### Rules for this pack

1. Use a fixed panel for trends. Channels start and stop.
2. Count companies, then posts. State the denominator on every page.
3. Remove category pages and false headline matches. One example: a term that appears inside a security standard.
4. Label post kinds by reading. Label at least 150 posts with two passes and report the agreement. Ask the user to check 20 or more.
5. A post that names a vendor does not show that the company uses it.
6. A claim in a post is the company's own claim. Do not turn it into a fact or a financial result.
7. A quiet blog can mean a company moved its news elsewhere. Say that the data cannot tell.
8. The report is information. It is not investment advice.

---

<a id="bundled-references-pack-state-legislatures-executives-md"></a>
## Bundled file: `references/pack-state-legislatures-executives.md`

### Pack: State Legislatures & Executives

The map holds one legislature and one governor's office for each of the 50 U.S. states.
The Beacon is `state-legislatures-executives` in the catalog (`GET /v3/public/beacons`).
Read the current Streams and segments from Synorb. Do not type a list from memory.

#### What the data is

- **Legislatures:** bill status, bill text, committee action and floor votes from official feeds.
- **Governors:** press releases, executive orders, signings and announcements from official sites.
- **Everything is an official record.** The data shows what the offices published. It does not show lobbying, votes in committee that no feed carries, or party. Party comes from public record outside Synorb. Say so if you use it.

#### The questions

Build the brief form from these. In chat, ask them one at a time. Either way, use this order. Skip any the user already answered. Use each answer to shape the next question.

1. **The question or topic.** What should the report answer? Examples: where is action concentrated, what do governors do that bills do not, which provisions are new, what is due next session. The user names the topics, for example AI, data centers, power prices, health, housing, taxes or company investment. No default for the topic. Do not guess one.
2. **The audience.** Who reads it? Offer investors, reporters or advisers, or let them say. This sets the tone and the length.
3. **Which states?** Default: all 50. If the topic is tied to a few states, offer those first.
4. **Which offices?** Legislatures, governors or both. Default: both, kept apart.
5. **Which kinds of action?** Ask this after the offices, because the choices depend on them. In a form, put it in the second form. Offer only the kinds that fit the topic and the offices. Default: bills, signed laws, executive orders and governor announcements, kept apart.
6. **Which period?** Default: the last full month. Also offer the last three full months. Say that you will check the real dates in Step 3.
7. **How long?** About 6, 12 or 25 pages. Default: 12.

Examples of shaping. If the topic is data centers, ask about power prices as a second topic. If the audience is reporters, offer to include the governor releases as quotes. If the user names three states, skip question 3.

#### Claim patterns to test

Treat each one as a hypothesis. A real run found the data did not support one of them, so test each before you chart it.

- **Reach.** How many states have at least one item on a topic, and in which office.
- **Concentration.** A few states supply most of the bill text. Say how many.
- **Timing.** Who acts first, governors or legislatures, and when bills pile up. Compare by month. Do not assume governors come first.
- **Toolbox.** Which tools governors use: orders, pauses, signed laws, announcements.
- **Levers.** What bills ask for: disclosure, limits, tax changes, local say. Label each bill with one primary lever.
- **First of a kind.** A provision that appears in one state only.
- **Calendar.** What pre-filed bills say about the next session.
- **Company deals.** Investments announced by governors, by company, sector and state.

#### Default kinds of governor action

Use this list when you label governor items. Add a kind only if an item fits none.

- **Binding:** a signed law or an executive order.
- **Pressing a regulator or utility:** a letter, a request or a public demand.
- **Funding:** a grant, a program or an investment.
- **Plan or statement:** an announced intention, not yet an action.
- **Other.**

A stated plan is not an action. Label it as a plan.

#### Control groups that work for a thin topic

- The same measure for a second topic, for example data centers against power prices.
- The levers that appear in two or more states against the levers that appear in one.
- Legislatures against governors on the same topic.

#### Rules for this pack

1. Count distinct bills, one per state and bill number. A feed can record a bill twice.
2. Read every governor item yourself. Give it one kind. Do not trust a count of releases.
3. Remove menu links and teaser links to other releases before you count. One governor's menu can look like 60 items.
4. Some bill Manifests have no subject line. One example is a California record that only says "chaptered". A keyword count cannot see them. Do two things. First, count how many bill Manifests have no subject line, and say that you could not test them for the topic. Second, link a governor item that names a bill number to the bill Manifests of that state with the same number, and read those bills.
5. Some legislatures do not publish in the period, because they are not in session. Say which. Do not read silence as no action.
6. Coverage is not complete for every state. Read the coverage note in the response. Name any state you could not read. Do not say "all 50 states" unless the count shows it.
7. A bill that is introduced is not a law. Keep stages apart.
8. The data starts when each source started. Read the dates in the count before you promise a period.

---

<a id="bundled-references-pull-with-code-md"></a>
## Bundled file: `references/pull-with-code.md`

### Pull the approved scope with code

Use this only after the user approved the scope copy. The Manifests go to a file. Never print them and never read them into your context.

#### Before you pull

1. Read the key from the environment variable `SYNORB_KEY`. Do not print it. Do not write it into a file you share. If it is not set, go back to Step 1 of the skill. Do not pull without a key.
2. Read the allowance left from the account response.
3. Count the scope again with `"mode": "count"`. It is free. If the total is above the approved estimate or above the allowance left, stop and tell the user. The `count` function below does this.
4. Choose the response shape. The code below does this for you:
   - Send `"response_profile": "rows"` for a bulk pull. A row holds the identifiers, dates, Streams, source, Tags and the Signal with its Claims. It has no Brief and no Record.
   - If the API rejects `rows` with HTTP 422, the code uses `"response_profile": "slim"` for the whole run. Keep only the fields you need.
   - To quote an item, read it again with the default profile. A Manifest you already received bills 0 in the same usage period.

#### Never take "the first N"

The API returns the newest Manifests first. If the approved limit is below the matched total, the first N Manifests all come from the last day or two. A report built on them is wrong.
Use `pull_even`. It reads everything when the limit covers the matched total. Otherwise it splits the period into weeks and gives each week a share of the limit in proportion to its volume.

#### The pull code

Pages are numbered. The API starts page N at item `N * page_size`. So `page_size` must stay the same on every page. If you change it, the next page starts in the wrong place and you read some items twice and skip others.
The code never asks for more than the limit when the limit is below the total. It picks one `page_size` that divides the limit exactly.

```python
import json, math, os, sys, time
from datetime import date, timedelta

import requests

BASE = "https://api.synorb.com"
KEY = os.environ.get("SYNORB_KEY") or sys.exit(
    "SYNORB_KEY is not set. Ask the user to set it in their own terminal, then run this again."
)
HEAD = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}
STATE = {"profile": "rows"}  # becomes "slim" for the rest of the run if the API rejects "rows"


def post(body: dict) -> requests.Response:
    while True:
        r = requests.post(f"{BASE}/manifests/query", headers=HEAD, json=body, timeout=180)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "20")))
            continue
        return r


def count(scope: dict) -> int:
    """How many Manifests match. Free: it uses no allowance."""
    r = post({**scope, "mode": "count"})
    r.raise_for_status()
    return int(((r.json().get("data") or {}).get("pagination") or {}).get("total_count") or 0)


def plan_pages(limit: int, total: int) -> tuple[int, int]:
    """Return (page_size, rows_to_read). The page size is at most 200 and never changes."""
    if total <= 0 or limit <= 0:
        return 1, 0
    if limit >= total:  # read everything: a short last page is fine
        return min(200, total), total
    if limit <= 200:
        return limit, limit
    size = math.gcd(limit, 200)
    if size < 25:  # a small size means many calls: round the limit down to a multiple of 50
        limit -= limit % 50
        size = math.gcd(limit, 200)
    return size, limit


def pull(scope: dict, out_path: str, limit: int, total: int | None = None, start_page: int = 0) -> dict:
    """Append rows to a file, one JSON line per Manifest. Reads the newest first.

    To resume, call again with the same arguments and start_page set to the returned next_page.
    """
    total = count(scope) if total is None else total
    page_size, rows_to_read = plan_pages(limit, total)
    pages = math.ceil(rows_to_read / page_size) if rows_to_read else 0
    saved, page = 0, start_page
    with open(out_path, "a", encoding="utf-8") as out:
        while page < pages:
            body = {**scope, "page": page, "page_size": page_size, "response_profile": STATE["profile"]}
            r = post(body)
            if r.status_code == 422 and STATE["profile"] == "rows":
                STATE["profile"] = "slim"  # the API does not know "rows" yet
                continue
            r.raise_for_status()
            data = r.json().get("data", {})
            rows = data.get("manifests") or []
            for row in rows:
                out.write(json.dumps(row, ensure_ascii=False) + "\n")
            saved += len(rows)
            page += 1
            if len(rows) < page_size or not (data.get("pagination") or {}).get("has_more"):
                break
    return {"saved": saved, "next_page": page, "page_size": page_size, "profile": STATE["profile"]}


def pull_even(scope: dict, out_path: str, limit: int) -> dict:
    """Read at most `limit` Manifests, spread across the whole period in proportion to weekly volume."""
    total = count(scope)
    if limit >= total:
        result = pull(scope, out_path, limit, total=total)
        return {**result, "matched": total, "weeks": 1}
    start = date.fromisoformat(scope["published_date_from"])
    end = date.fromisoformat(scope["published_date_to"])
    weeks, day = [], start
    while day <= end:
        stop = min(day + timedelta(days=6), end)
        weeks.append((day, stop))
        day = stop + timedelta(days=1)
    counts = []
    for a, b in weeks:
        counts.append(count({**scope, "published_date_from": a.isoformat(), "published_date_to": b.isoformat()}))
    saved = 0
    for (a, b), n in zip(weeks, counts):
        share = min(n, (limit * n) // max(sum(counts), 1))
        if share <= 0:
            continue
        week_scope = {**scope, "published_date_from": a.isoformat(), "published_date_to": b.isoformat()}
        saved += pull(week_scope, out_path, share, total=n)["saved"]
    return {"saved": saved, "matched": total, "weeks": len(weeks), "profile": STATE["profile"]}
```

Rules for the code:

1. Pass the scope as the saved Beacon id plus dates, for example `{"beacon_id": "synorb_bcn_...", "published_date_from": "2026-09-01", "published_date_to": "2026-11-30"}`. Do not change it between pages.
2. Call `pull_even` with `limit` set to the approved number or the allowance left, whichever is smaller. It reads at most that many. In a limited run it can read up to 49 fewer rows in each week, to keep the pages exact. Say the final number to the user.
3. Say on the methods page that a limited run is a proportional sample by week. Report matched, read and kept.
4. Do not mix continuation methods. If a response gives a `next` link, use it unchanged and do not use `page`.
5. Save progress. If a run stops inside `pull`, call it again with the same arguments and `start_page` set to the `next_page` you saved. Do not start again from page 0.
6. Check the allowance between weeks when a run is long.
7. A 429 means slow down. The code waits and retries the same page.
8. If the profile is `slim`, each row is larger. Keep only the fields you need.

#### After the pull

1. Load the file with a data library. Check the row count against the count you made at the start.
2. Check for duplicates by `manifest_id`.
3. Write down matched, read and kept. They go on the methods page.
4. Read only the Claims you will quote, in full, with the default profile.

#### If the network is blocked

Some agents block outside domains. Ask the user to allow `api.synorb.com`, then try again.
If they cannot, tell the user plainly. Do not pull through a different route, and do not paste Manifests into the chat.

---

<a id="bundled-references-report-method-md"></a>
## Bundled file: `references/report-method.md`

### Report method

This is how Synorb builds its own market-map reports. Follow it for every claim.

#### Find claims worth a page

1. Start from the user's topics and audience. A claim must change what that reader does or asks.
2. Look for claims in these shapes:
   - **A share.** For example, the share of companies that name a given model family.
   - **A gap.** One segment does something another does not.
   - **A change.** A count that moves over the period.
   - **A concentration.** A few organizations carry most of the volume.
   - **A first.** A provision, product or term that appears in only one place so far.
3. Treat each shape as a hypothesis. The data may show the opposite. Drop a claim the data contradicts, and say so on the methods page.
4. Count first, then decide. A surprising number means you read 20 rows before you write the page.

#### Define what is "on the topic"

A Beacon count cannot count a topic such as "data centers". You define the topic yourself, with a term list, and you test it.

1. **Write a term list.** Use plain terms first. Add the common alternatives, for example "data center", "data centre", "large load", "hyperscale".
2. **Choose where to search.** Search the headline and the summary of each Manifest. Search the Claims when the headline is empty or generic.
3. **Write must-catch and must-not-catch cases.** Pick at least 5 items the list must catch and 5 it must not catch. Use the must-not-catch cases for words with other meanings. For example, "rates" also matches housing rates and unemployment rates. "Affordability" also matches tax and housing items.
4. **Run the list on the whole file.** Read every hit when there are fewer than 60. Read a random 30 when there are more.
5. **Tighten the list and run it again.** Keep a count of hits before and after each change.
6. **Find what the list misses.** Some Manifests have no subject line. Read the items that carry the topic in another way, for example a bill known only by its number. See the pack for map-specific misses.
7. **Write the final list on the methods page.** Give the hits read, the false hits removed, and the items you could not test.

#### Prove each claim

1. **Name the population.** State the denominator on the page: all organizations on the map, the active ones, or a fixed panel.
2. **Count the right thing.** Count companies, bills or distinct items. Never count Records alone. One loud source must not move a headline.
3. **Add a control group.** Compare with a fixed panel, the rest of the map, the other topic, or listed against private. Say which one. For a thin topic, a control can be the same measure on a second topic, or the items that appear in two or more places against one place only.
4. **Use a fixed panel for trends.** Streams are added in waves, so volume rises for reasons that are not news. Keep only organizations that published in every month of the period.
5. **Set a minimum count.** Do not rank organizations with a handful of items. State the rule.
6. **Check the instrument on both sides.** Test your term list on items it must catch and on items it must not catch. Remove menus, repeated page text and teaser links before you count.
7. **Use the right fields.** Identify a company by `source.source_name`. Use the Claims and the Brief for meaning. Do not use titles alone. See [row-fields.md](#bundled-references-row-fields-md) for the fields.
8. **Remove duplicates.** The same article can appear under two Records. Dedupe on the canonical link first. Then dedupe on the same headline, the same date and the same source family. One letter can sit under two links.
9. **Handle conflicting names.** If a title and the Claims name different people for one office, report the conflict and use the name in the Claims. Do not merge them silently.
10. **Read a sample.** For each label you made, read every item when the label has fewer than 30. Read at least 30 when it has more.
11. **Be honest about who checked.** You wrote the labels and you read them. That is one reader. Say so. Measure how often your term list was right (hits that were true, out of hits read) and call it the precision of the list. Do not call it an agreement rate. Ask the user to check 20 of the labels that carry a headline claim.
12. **Drop what you cannot trace.** Every number must come from specific Records. Keep them in a cited-Records file with the company, title, date and link. A count over the whole file, such as the matched total, comes from the count call. Record the response and its date in `numbers.csv`.

#### Say what a sample can and cannot show

If you read fewer Manifests than matched, you read a sample.

1. State the matched total, the number read, and the fraction. Put them on every page footer.
2. Counts in a sample are floors. Do not scale them up. Write "at least" or "in the sample".
3. A limited pull takes the newest items of each week, not a random draw. Say so.
4. Check which sources dominate the sample. If two sources give more than a third of the Manifests, say so. Cap them or report them apart.
5. A sample is weak for a rare topic. If a topic has fewer than 10 items, say that the sample is too small to rank states or companies.

#### Say only what the data shows

- The data is what organizations publish in their own channels. Write "named", "published" or "stated". Do not write "uses", "supplies" or "customer" unless a person labelled it.
- Keep the confidence label of each Claim. Stated and measured come from the source. Implied and inferred are readings.
- Do not turn an organization's forecast or plan into an action. Label a stated plan as a plan.
- Do not claim the press missed something. You cannot measure that. If you can search the web, check the claims on the cover. Record what you found. Move down any claim the press already carries.
- Show counter-evidence. If two sources disagree, show both.
- Quote with care. Quote only text that is in a Claim `quote` or a supporting quote. Put at most one quote on a page, with its source link.

#### Length and depth

| Pages | Use for | Claims |
| --- | --- | --- |
| About 6 | A quick brief | 3 |
| About 12 | A board or client note | 6 to 8 |
| About 25 | A full report | 14 to 18 |

The count is chart pages only. Add a cover, a one-page summary, a methods page and an appendix. Each chart page carries one claim. A page with two claims splits into two pages.
For a test or a very short brief, the user may drop the summary. Say so on the cover.

---

<a id="bundled-references-row-fields-md"></a>
## Bundled file: `references/row-fields.md`

### Fields of a Manifest row

You pull Manifests as `rows` or as `slim`. This page lists the fields you use. Read other fields only when you need them.

| Field | What it holds |
| --- | --- |
| `manifest_id` | The id of the Manifest. Treat it as a string. |
| `record_id` | The id of the source Record. |
| `published_date` | The date of the source item. Use this for time. |
| `matched_at` | When Synorb matched the item to a Stream. Do not use it for time. |
| `stream_ids`, `stream_names` | The Streams that carry the item. |
| `source.source_name` | The organization's channel. Use it as the identity of a company or an office. |
| `source.source_url` | The link to the original item. Use it in the cited-Records file. |
| `source.record_title` | The title of the source item (in `rows`). |
| `signal.headline`, `signal.summary` | Synorb's headline and short summary. They are Synorb's reading. |
| `signal.significance`, `signal.sentiment` | Labels for the item. |
| `signal.body.claims[]` | The Claims. Each has `claim_text`, `claim_type`, `confidence`, `evidence` and often `quote`. This is the evidence. |
| `signal.body.entity_details[]` | Named organizations, people and places in the item. |
| `signal.body.topics[]` | Topic labels. They are coarse. Do not rely on them for your own topic. |
| `tag_names`, `tag_types`, `subtypes` | The Tags on the item and their kinds. |
| `brief` | In `slim` only. The Brief: headline, summary and a structured body. It is Synorb's reading. |
| `citations[]` | In `slim` only. Links for the item. |

#### Rules

1. Cite the source link in `source.source_url`, not a Synorb link.
2. Read the Claims before you write about an item. Titles are not evidence.
3. The Brief and the summary are Synorb's reading. Say "Synorb's summary says" if you use them. Check them against the Claims.
4. A Manifest can hold more than one name for the same office. Use the name in the Claims.
5. Some Manifests have a headline with no subject, for example a bill record that only says "chaptered". Count these items apart and say how many you could not test.
6. Write files in UTF-8. Names contain non-ASCII letters. On Windows, set `PYTHONIOENCODING=utf8` before you print, or write to a file.

---

<a id="bundled-references-synorb-api-md"></a>
## Bundled file: `references/synorb-api.md`

### Synorb connection and call reference

This file is shared by every Synorb skill. It tells you how to connect and which calls to make.
Synorb serves source-cited Manifests. Synorb makes no model call when it serves a request. Your own model writes the result.

#### 1. Check the connection

Use the first path that works:

1. **MCP tools are present.** Look for a tool named `synorb-profile`. Call it. If it returns an `account` object, you are connected.
2. **A Synorb Key is stored.** Look in your secret store or memory for a key saved for Synorb. Call `GET https://api.synorb.com/account` with `Authorization: Bearer <key>`. A 200 response means the key works.
3. **Neither.** Follow the `synorb-setup` skill. If that skill is not installed, read https://synorb.com/skills/synorb-setup.md and follow it.

#### 2. Get a key without a browser

A demo key needs no email, no card and no form.

- MCP: call `synorb-get-demo-key` with `agent_name` set to `synorb-skill/<this skill name>`. Example: `synorb-skill/newsletter-writer`.
- REST: `POST https://api.synorb.com/api/connect/demo-key` with the JSON body `{"client": "synorb-skill/<this skill name>"}`.

The response also holds `getting_started` and `resource_reading`. They are optional guides. You do not need them for this skill.
Save `api_key` and `visitor_token` in your secret store. Send `visitor_token` back on a later call to get the same key. A call without it makes a new key.
Do not show the full key in chat. Show only the last four characters.
A person can also get a key at https://synorb.com/connect/start.

To add Synorb as an MCP server, use the URL `https://mcp.synorb.com/mcp` (Streamable HTTP). Send the key as `Authorization: Bearer <key>`.

#### 3. Pick the Beacon

Every Synorb skill runs on a Beacon. A Beacon is a saved watch over many Streams. A broad Beacon can still have no items relevant to this user's question.
Do not run a skill on one company or one person. Most single sources publish a few times a month, so the result is thin.

Use the first Beacon that fits:

1. **A Beacon the user saved.** List them with `synorb-beacons` or `GET /v3/beacons`.
2. **A starter Beacon** (`tag="starter"`). New accounts have five: AI Companies, Business & Technology Podcasts, Venture Capital, Private Companies, and Public Company Filings & Executive Transitions. Accounts made before 2026-10-25 have AI Companies, Business & Technology Podcasts and Central Banks.
3. **A Synorb catalog Beacon.** `GET /v3/public/beacons` lists them, for example Venture Capital (`venture-capital`) and Private Companies (`private-companies`) for older accounts, Public Markets, Research and Central Banks. Copy one into the account only after the user says yes:
   - With HTTP access: `POST /v3/beacons/fork` with `{"pack_id": "<slug>", "status": "active"}`. Send `"dry_run": true` first to preview.
   - With MCP tools only: ask the user to copy it at https://synorb.com/beacons (the Beacon Library). Core MCP has no copy tool.
   Check the Beacon limit first ("Beacon limits" in section 4).

To focus a broad Beacon, first use the user's job brief from `output-quality.md`.
Inspect the available tool schema and supported filters before you narrow the pull.
Keep the selected Beacon and its saved scope. Use a supported narrow-only filter when it fits; never invent a field or set `broaden_sources=true` to bypass a scope error.
If narrowing is unavailable or rejected, keep the Beacon and select from bounded pages or date slices.
Check named priorities and relevant dates within the allowance before claiming nothing matched.
The first page is not a ranking of importance to this user. Do not call a sampled pull complete coverage.
Track how many items matched, how many you inspected, and how many you kept; distinguish headline screening from full Claim review. Put these counts in a receipt when requested, or report them when needed to understand coverage. Always disclose a material sampling limitation in the result, without making routine retrieval totals part of every deliverable.
If no Beacon fits the request, say so. Do not build a result from one source.

##### Set it up once, then run on a schedule

A skill is a job the user sets up once. After that, the agent runs it on a schedule and reports back. The user does not need to ask again.

1. **The first run is the setup.** Pick the Beacon. Agree the cadence and the delivery place (chat, email, a file) with the user. Run the job once, so the user sees a real result.
2. **Save the job state** in your memory or a file: the skill and version, `beacon_id`, cadence, time zone, delivery place, and `lookback_hours`. Keep the compact user brief, prior assessment, open questions, last successful effective window, and delivered `manifest_id` values too.
3. **Schedule it** in your own runtime within the user's authorization. An existing request for this scheduled job is sufficient; do not ask again each run. Synorb does not run schedules and does not push.
4. **Every later run** starts from the last successful coverage window. Use an overlapping window and enough supported continuation to recover a missed run within the allowance and entitlement. Disclose any gap you cannot cover.
5. **Before drafting**, drop items already delivered for this job. Also remove repeated original articles when identifiable. Keep a substantive update that changes a previous item, and explain what changed.
6. **After successful delivery**, commit the delivered IDs, effective window, and current assessment. Do not advance state after a failed draft or send. If nothing relevant is new, send one short line, or stay quiet if the user requested that.

| Cadence | `lookback_hours` |
| --- | --- |
| Daily | 48 |
| Weekly | 192 |
| Monthly | 768 |

If your runtime cannot schedule, say so plainly. Then offer the workflow recipe at https://synorb.com/skills/packs/workflow-recipe.md, which runs the skill from any tool with a schedule step.

#### 4. The calls

| Job | MCP tool | REST (base `https://api.synorb.com`) | Uses allowance |
| --- | --- | --- | --- |
| Account, plan, allowance | `synorb-profile` | `GET /account` | No |
| List Beacons | `synorb-beacons` (`tag="starter"` for the starters) | `GET /v3/beacons?tag=starter` | No |
| Find Streams for a name or topic | `synorb-stream-search` (`query`) | `POST /streams/search` `{"query": "..."}` | No |
| Draft a Beacon from an intent | `synorb-configure-beacon` (`intent`) | `POST /streams/search`, then read `data.beacon_results` | No |
| Save a Beacon (only after the user says yes) | `synorb-save-beacon` (`proposal` or `stream_ids`, `name`) | `POST /v3/beacons` `{"name": "...", "stream_ids": ["..."], "status": "active"}` | No |
| Copy a Synorb catalog Beacon (only after a yes) | Not in Core MCP. The user copies it at https://synorb.com/beacons | `POST /v3/beacons/fork` `{"pack_id": "venture-capital", "status": "active"}`; add `"dry_run": true` to preview. Without `status` the copy is a `draft`. Recipes: `GET /v3/public/beacons` | No |
| Count Manifests | `synorb-manifests` with `mode="count"` | `POST /manifests/query` with `"mode": "count"` | No |
| Pull Manifests | `synorb-manifests` | `POST /manifests/query` | Yes, new Manifests only |

Pass every Synorb id (stream, source channel, Tag, Manifest) as a JSON string. The ids are larger than the safe integer range of JavaScript.

##### Pull a Beacon

```json
{"beacon_id": "synorb_bcn_...", "lookback_hours": 168}
```

A copied catalog Beacon gets its own `synorb_bcn_...` id. Pull it the same way.

To cover a long window evenly, split it into date slices with `published_date_from` and `published_date_to` (`YYYY-MM-DD`). Other date field names fail with HTTP 422.

Use a returned opaque continuation or REST `next` URL unchanged when present. Otherwise use the supported `page` field with the same scope and dates; it starts at 0. Do not mix continuation methods or silently change the query between pages.

Always count first. A count is free. Read the total at `pagination.total_count` (REST also has `data.total_count`). Ignore a top-level `count` field: it is the page size. Read the dates at `temporal.effective_from` and `temporal.effective_to`. A count returns an empty `manifests` list. That is normal. Then pull one page.

If the count request fails but authentication and allowance are clearly valid, try at most one small pull using the same documented selectors and window, within the remaining allowance. Use it only if the server confirms success for the requested scope and returns actual pagination and temporal coverage. A count error does not mean zero matches. Stop on authentication or quota errors, or if the pull's success or coverage is unverified. Do not broaden the scope, use `force` or `allow_partial`, invent or alter proof tokens, or override authorization or quota.

Windows round to whole days and end at the latest available day. On a demo key that is the previous calendar day. For "the last two days", use `lookback_hours=72`.

##### Size of a pull

A pull is large: about 40 to 60 KB for each Manifest. Most of it is the `manifests` array. Over MCP a count can also be large (about 120 KB), although it holds no Manifests. Read only `pagination.total_count` and `temporal` from it.
If tool results go straight into your context and you have no file or code tool, use `page_size` 5. Read `briefing.markdown` and `briefing.scaffold` first. Open `manifests` only when you need a full Claim or a quote.
If you have a code tool, save the result to a file and read the fields you need.

If a Beacon's 7-day count is low, count 30 days (`lookback_hours=720`) and tell the user the Beacon is quiet this week.

##### Read a stream search

| Field | Meaning |
| --- | --- |
| `results[]` | Streams: `stream_id`, `name`, `display_name`, `description`, `media_formats`. |
| `match_strength` | `strong` means a Stream is named for the query. `weak` means the Streams only mention the words. |
| `match_note` | A plain sentence about the match. Give it to the user when the match is weak. |
| `beacon_results[]` | Ready Beacon recipes for a theme, for example "Venture Capital". Each has `name`, `description` and `scope.stream_ids`. Use them for a theme with no single Stream. |

REST puts these fields under `data`.

##### Beacon limits

Each plan has a limit of active Beacons. The starter Beacons count toward it and can fill the limit on a demo key. Read the current limit from the account response.
Before you propose new Beacons, read the limit: `synorb-profile` (`quota.beacons_limit`, `quota.beacons_used`) or `GET /account` (`usage.beacons_limit`, `usage.beacons_used`). A null limit means no limit.
If the user wants more Beacons than the plan allows, say how many fit. Ask which ones to keep. Archive a Beacon (a starter too) only after the user says yes to that Beacon.

#### 5. Read the response

- MCP: the text content starts with the briefing Markdown. The structured result has `briefing`, `presentation_items` and `manifests`.
- REST: read `data.briefing.markdown`, `data.briefing.scaffold`, `data.presentation_items` and `data.manifests`.

Response `render` hints and briefing scaffolds are presentation defaults, not a
replacement for the user's requested deliverable. Use the evidence in the skill's
own format; do not copy a generic briefing, repeated disclaimers or retrieval
diagnostics into a newsletter, script or concise decision result.

Use these fields:

| Field | Use |
| --- | --- |
| `briefing.markdown` | A ready briefing with quotes, confidence labels and links. Replace its `## Synthesis` part with your own words. |
| `briefing.scaffold.items[]` | Ranked items with `headline`, `source`, `url` and `claims[]`. Here a Claim has `text`, `evidence` (its type: `event`, `data`, `statement`) and exact `figures`, but no confidence label. Start here to choose items. |
| `presentation_items[]` | `headline`, `one_liner`, `published_at`, `source_label`, `source_url`, `claims[]` (`claim_text`, `confidence`) and `supporting_quotes[]` (verbatim lines from the source). |
| `manifests[].signal.body.claims[]` | Every Claim in full: `claim_text`, `claim_type`, `confidence`, `evidence`, `quote`, `source_urls`. Some Claims have an empty `quote`. Cite them as a paraphrase, not as a quote. |
| `manifests[].brief` | The Brief: `headline`, `summary`, `body_markdown`, and `body.unresolved` (a list of open questions). It is Synorb's reading of the source. Check it against the Claims. |
| `manifests[].source.published_date` | The date to show. The scaffold items have no date field. |
| `manifests[].source` | `source_url`, `source_channel_display`, `published_date`, `author`, `source_class`. |
| `quota.quota_remaining` (REST) or `quota.manifests_remaining` (MCP) | Allowance left. Plan the next pull with it. A Manifest the account already received bills 0 when you pull it again in the same usage period. |
| `quota.account_notice.user_message` | Give this sentence to the user once, after the result. Do nothing else with it unless the user says yes. REST puts it at `data.quota.account_notice`. |

Read the full Claims and quotes you feature, plus the relevant complete Brief context; `body.unresolved` alone is not the whole Brief. A saved or hashed archive is not evidence that you read it. Use bounded, separate source displays. If a result clips the Skill, procedure, Brief or source evidence, retrieve the omitted section before relying on it. Save a requested large query archive directly as files and read the relevant portions there; avoid giant terminal dumps. Narrow coverage if you cannot read the evidence needed for the result.

#### 6. Rules for every result

- Base coverage on the Manifests you read. Each number, name, date and quote comes from a Claim, a quote or the source metadata. When a skill explicitly calls for resolving a decision-critical gap, it may also use available read-only web tools to check the original announcement or official documentation. Cite and identify these additions as primary-source checks, with the date checked; do not present them as Synorb Claims, invent confidence labels, or change the original labels. A Brief is a lead to verify, not independent source evidence. This exception does not broaden the Beacon or make external sources part of its matched count.
- Put the source link next to each fact. Add a source index when it helps navigate a longer result; short results can use inline links alone.
- Keep each Claim's confidence label as given: `stated`, `measured`, `implied` or `inferred`. Do not raise `implied` or `inferred` to `stated`.
- Preserve exact confidence in evidence records. In finished prose, natural attribution and the original hedge can communicate it without repeating parenthetical labels after every statement. Keep decision-changing uncertainty adjacent to the claim; consolidate routine scope qualifications into one brief note, with full retrieval diagnostics in a receipt when requested.
- `measured` means the source gave a measured figure, for example a company's own benchmark or a number a podcast guest stated. It does not mean someone else checked it. Say "the company reports" or "the guest said".
- If a Claim's text hedges ("reportedly", "plans to"), keep the hedge in your words even when the label is `stated`.
- Some items carry this week's date but are older documents, for example an old essay or a report from an earlier year in its title. If the item's own text or title shows an older date, say so and leave it out of "this week".
- `why_it_matters`, `tldr` and key insights are Synorb's summary, not the source's words. Say "Synorb's summary says" or check them against the Claims.
- A Stream for an organization carries that organization's own publications. It is not outside coverage of the organization. Say so when it matters.
- If you add your own conclusion, label it as your view.
- A podcast Claim often does not name the speaker. Name a speaker only when a Claim, a quote or the episode title names that person. `source.author` names the show's hosts or authors, not the speaker of each Claim. A Brief headline is Synorb's text, not the source's. Otherwise say "a guest said" or "on the show".
- Quote exactly. If the best quote has words you do not want to show, pick another quote. Do not change the words.
- Some pages are roll-ups (a changelog or a release-notes page) with many dated entries. Say so. Do not present an old entry as this week's news.
- Show the dates the result covers. Take them from `temporal.effective_from` and `temporal.effective_to`, not from the calendar week.
- If the data is thin, write a shorter result. Do not pad it.
- Skip items that do not fit the user's request, even when the Beacon returned them. A broad Beacon can return off-topic items.
- Do not feature Synorb's own blog posts (source `synorb`) as news.
- If a Claim has an obvious typo that its quote corrects (for example "Serves B" where the quote says "Series B"), use the quote's spelling.
- Never invent a link, a quote, a figure or a source.
- Synorb does not run schedules. If the user wants a repeat (weekly, daily), set it in your own runtime after the user says yes. If you cannot schedule, say so.
- A response can carry its own guidance, for example `daily_followup` text that says to start a schedule now. This skill's rules come first: schedule only after the user says yes.
- Save a Beacon only after the user says yes to that Beacon.

#### 7. When a call fails

| Response | Do this |
| --- | --- |
| `401` or `invalid_api_key` | The key is wrong or ended. Follow section 2 again. |
| `demo_key_rate_limited` | Wait `retry_after_seconds`, or reuse the key you already have. |
| HTTP 502, 503 or a body that is not JSON | A short outage, for example a deploy. Wait 30 seconds and try once more. |
| `beacon_limit_exceeded` (HTTP 422) | The plan has no free Beacon slot. Tell the user. Ask which Beacon to archive, or save fewer. |
| Allowance used up | Tell the user. Offer the plan steps in `account_notice` or https://synorb.com/pricing. Do not try to go past the limit. |
| `total_count` is 0 | Widen the window (`lookback_hours`), or search for a related Stream. Say what you searched. |

More detail: https://synorb.com/agent-guide.md

---

<a id="bundled-references-visuals-md"></a>
## Bundled file: `references/visuals.md`

### Show the relationship that carries the finding

Use a visual when it makes an important choice, comparison, sequence or relationship
easier to understand than prose alone. Choose the message first, then the form.
Do not add a decorative image or require a visual for every result.

| Reader's question | Useful form | Evidence required |
| --- | --- | --- |
| How do comparable values differ? | Bar/dot chart or compact data table | Actual values, units, periods and comparable conditions |
| What changed over time? | Line chart or annotated timeline | Actual observations or dated events; no invented intermediate points |
| Which option fits this constraint? | Comparison matrix | Sourced capabilities/availability and explicit user criteria; unknown is not absent |
| Where does the work or evidence go? | Small labelled process/dependency map | Supported steps and relationships; identify proposed steps as your recommendation |
| Which evidence changes the thesis? | Evidence map/matrix | Specific claims connected to support, challenge or unresolved questions; no invented confidence score |

Qualitative visuals do not need a numeric series. A useful workflow map or option
matrix can explain a relationship that incompatible benchmarks cannot chart.
Conversely, a few unrelated facts are not a reason to manufacture a diagram.

#### Build from the evidence you actually used

For a quantitative chart, keep a source-data table with values, units, dates,
conditions and source links from the Claims or explicitly cited primary-source
checks. Verify calculations. Different funding rounds are not revenue; different
vendor benchmarks are not a controlled model comparison. Token and character
prices need a supported conversion before comparison. Do not turn publication
counts into market share, adoption or consensus. Never invent a value, denominator,
score, trend, timestamp or missing observation.

For a qualitative visual, keep the source-backed entries, steps or links between
them. Separate source facts, authorized user constraints and your proposed action.
Label a hypothesis, recommendation or unresolved relationship as such; do not draw
an unsupported causal arrow or make a speculative step look like a shipped feature.
Keep private user context out of public graphics unless intended for that audience.

#### Create, inspect and deliver

Use available chart, code, spreadsheet or diagram tools. Prefer inspectable
data-driven graphics for quantitative evidence. A small supported inline diagram
or an accessible table can be the finished visual; it need not be a raster image.
Do not install dependencies or change the user's environment just to force one.

Use honest scales, clear units/route labels, readable text and accessible contrast.
Do not rely on color alone. Keep the visual focused on the narrative's takeaway;
use a concise caption/source note and a text description or accessible data table.

Render or open the actual artifact when the host permits. Inspect labels, clipping,
values, relationships and consistency with the text. Fix errors before delivery.
Deliver that artifact or supported inline visual, not a promise or unrendered
chart-building script. Keep its underlying data when useful. If rendering is
unavailable, deliver the readable table/description and accurately state what was
verified. Do not claim to have inspected an unseen image.

For newsletters, use a visual that advances the editorial argument. For research
and radars, make tradeoffs or availability easy to compare. For trackers, show
which evidence changes which proposition. For a spoken result, explain the finding
aloud; any companion visual belongs in the notes and is optional for listeners.
