The system
How the system worksThe DirectoryDispatchThe LedgerAI modelsAI agentsYour installationThe appThe research libraryWhat changes for your businessUse it from your softwareEverything it can do
Messaging
iMessageWhatsApp
Ads and leads
AdsCreativeLeads
Devices
Devices
Industries
RealtorsRestaurantsHome services
Explore
How it worksPermissions and limitsCompareSet upQuestionsText me

Source Quote Law: The Code That Refuses a Source Card Without the Source's Own Words

Every source card on miscsubjects.com is supposed to show the source's verbatim words — the sentence from the study, the text of the tweet, the line from the paper. For months, that did not happen. Study cards carried a descriptor the team

Source Quote Law: The Code That Refuses a Source Card Without the Source's Own Words

Every source card on miscsubjects.com is supposed to show the source's verbatim words — the sentence from the study, the text of the tweet, the line from the paper. For months, that did not happen. Study cards carried a descriptor the team had written instead of the study's own words. Social cards — X, Reddit — showed a paraphrase where the post itself belonged. Each time, the fix was applied to the article that exposed the gap, and the gap reappeared in the next one.

functions/_lib/source_law.js is the structural fix. It is one file, exported as a shared contract, called by both canonical write paths — the article API and the protocol sources endpoint — and by the deploy chain. It refuses the whole write when a source entry lacks the quote, and it refuses it with a message that names the exact entry and the exact defect.

The failure it removes

The file's header comment describes the failure class in plain terms: "The owner reported, repeatedly, that source cards on the site show no quote: study cards carried a descriptor we had written instead of the study's own words, and social cards (X, Reddit) showed a paraphrase where the post itself belonged. Each time, the fix applied was to the article that exposed it."

The problem was not the renderer. functions/_lib/widgets/rail-platform.js has always printed s.quote inside the card and falls through to s.summary only when quote is empty. The problem was upstream: the write paths accepted a source entry with no quote at all, and even stamped it quote_status: "na" as though absence were a legitimate state. They also accepted entries that were not objects — bare strings sitting in meta.sources, which render as empty fallback cards.

The invariant enforced

The law states the invariant directly: "A source entry is an object, it has a URL, and it carries the source's own verbatim words in quote. The words in quote are never our words: they may not equal the title, the summary, or the plain-language gloss. A card can therefore never render without the quote the reader came for, because a quote-less source can no longer be stored."

The SOURCE_LAW constant makes this machine-checkable. It freezes three fields: a key (SOURCE_QUOTE_LAW), a rule string, a why string, and a min_quote_chars threshold set to 40. The rule is the one above, compressed into two lines. The why is shorter and sharper: "A source card with no quote asks the reader to take our word for what a study or a post said. That is the one thing this site exists not to do."

How a source entry is checked

checkSourceEntry(raw, index) is the per-entry validator. It runs four checks in order:

  1. Type check. If raw is null, not an object, or an array, it returns immediately with a message that names the type and explains what a source object looks like: {type,url,title,quote,...}. A bare string, the error says, renders as an empty card.
  1. URL check. If the entry has no url (or href or link), it pushes an error.
  1. Quote presence check. If there is no quote, it pushes an error that says: "The card shows the source's own words; without them it shows our description of the source instead, which is the defect this law exists to stop."
  1. Quote length check. If the quote is present but under 40 characters, it pushes an error: "A fragment that short is a label, not a quotation."
  1. Quote-originality check. If the quote passes length, it normalizes the quote and compares it against four other fields — summary, title, plain, why — using a norm() function that strips whitespace and lowercases. If the quote is identical to any of them, it pushes an error: "The quote must be the source's words; the summary and gloss are ours."

The normalization matters. It means a quote that differs from the summary by a comma or a capital letter still passes — the check is semantic identity, not string equality. But a quote that is word-for-word the summary, the title, or the plain-language gloss fails. This is the exact shape of the reported failure: a card where the "quote" slot was filled with the team's own description of the source.

How a whole list is checked

checkSources(list) runs checkSourceEntry against every entry in the array and returns every violation, not just the first. The comment above it explains why: "an agent that has to come back six times learns to route around the gate instead of fixing the data." Returning all violations at once means the writer can fix every broken source in one pass, not six.

The return object carries ok, violations (each with the index, the source id if present, and the error messages), and checked (the count of entries examined).

The refusal object

sourceLawRefusal(result) is the shape a write path returns when checkSources finds violations. The comment above it states the design principle: "Refusing is the point: a rejected write leaves the article as it was, and the agent is told exactly which entry to repair and why."

The refusal carries the law key (SOURCE_QUOTE_LAW), the rule, the why, the number of entries checked, the number refused, the violations array, and a how_to_fix string: "Open the URL, copy the sentence that actually supports the claim, and put those exact words in quote. Keep your own description in summary or plain."

The how_to_fix is the most important field operationally. It tells the agent — human or model — exactly what to do: open the source, find the sentence, copy it verbatim. It does not say "add a quote." It says add the source's own words. The distinction is the whole law.

Where it is enforced

Two layers enforce the law:

At write time. Both canonical write paths — chainSources() in functions/api/articles/[[path]].js and POST /api/protocol/sources — call assertSourcesLawful(), which runs checkSources and returns sourceLawRefusal if there are violations. The write is refused. The article stays as it was. Nothing is partially saved.

At deploy time. scripts/check-source-quotes.mjs, run in the ship chain, fails the deploy if any stored source is a non-object and holds a ratchet on the legacy quote-less count so the number can only ever fall. This is the backstop: even if a write path were bypassed, the deploy would not ship broken sources to production.

The two layers are complementary. The write-time gate stops new violations from entering. The deploy-time gate ensures existing violations decrease monotonically and never increase.

What the law assumes

The law assumes the quote is verifiable. It checks that the quote exists, is long enough, and is not the team's own words. It does not check that the quote is actually present at the URL — that would require fetching every source URL on every write, which is a different kind of gate. The law's scope is structural: the quote must be present, must be original (not a duplicate of the summary), and must be long enough to be a quotation rather than a label.

The min_quote_chars threshold of 40 is a judgment call. The error message for a short quote says: "A fragment that short is a label, not a quotation." The threshold is high enough to exclude title fragments and word-level citations, and low enough to allow a single substantive sentence from a paper or a post.

The quote-is-the-body types

The file exports a second frozen constant: QUOTE_IS_THE_BODY, an array of source types whose card body is the quote itself — the post, the message, the sentence from the paper. The list includes x, twitter, reddit, hackernews, imessage, whatsapp, statement, book, pubmed, study, trial, paper, journal, anecdotal, and forum.

These are the types where the source's content IS the evidence. A tweet's text is the quote. A study's abstract sentence is the quote. A forum post's body is the quote. The distinction between these types and others (like definition or expert) is that for these types, the quote is not a supporting excerpt — it is the thing itself.

Why it matters

The law exists because the alternative — a source card that shows the team's description of a source instead of the source's own words — is the exact thing the site was built not to do. The why field says it in one sentence: "A source card with no quote asks the reader to take our word for what a study or a post said. That is the one thing this site exists not to do."

The code is the enforcement. The comments are the rationale. The deploy gate is the backstop. Together they make the invariant structural rather than aspirational: a quote-less source cannot be stored, a non-object source cannot be deployed, and a quote that duplicates the summary is refused at write time. The reader sees the source's own words, or the source does not appear.

References (12)
  1. functions/_lib/source_law.js“THE SOURCE LAW — one shared contract for every source entry, held at the write path.”
  2. functions/_lib/source_law.js“The owner reported, repeatedly, that source cards on the site show no quote: study cards carried a descriptor we had written instead of the study's own words, and social cards (X, Reddit) showed a paraphrase where the post itself belonged.”
  3. functions/_lib/source_law.js“The two canonical source write paths — chainSources() in functions/api/articles/[[path]].js and POST /api/protocol/sources — accepted an entry with no quote at all, and even stamped it `quote_status: "na"` as though absence were a legitimate state.”
  4. functions/_lib/source_law.js“A source entry is an object, it has a URL, and it carries the source's own verbatim words in `quote`. The words in `quote` are never our words: they may not equal the title, the summary, or the plain-language gloss.”
  5. functions/_lib/source_law.js“export const SOURCE_LAW = Object.freeze({ key: 'SOURCE_QUOTE_LAW', rule: 'A source entry is an object with a URL and the source\'s own verbatim words in `quote`. The quote is what the reader sees inside the card, so it may not be the title, the summary or our plain-language gloss, and it may not be absent.', why: 'A source card with no quote asks the reader to take our word for what a study or a p”
  6. functions/_lib/source_law.js“if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) { return { ok: false, errors: [`${at} is ${Array.isArray(raw) ? 'an array' : typeof raw}, not a source object. A source is {type,url,title,quote,...}. A bare string renders as an empty card.`], }; }”
  7. functions/_lib/source_law.js“Check a whole submitted list. Returns every violation, not just the first — an agent that has to come back six times learns to route around the gate instead of fixing the data.”
  8. functions/_lib/source_law.js“how_to_fix: 'Open the URL, copy the sentence that actually supports the claim, and put those exact words in `quote`. Keep your own description in `summary` or `plain`.',”
  9. functions/_lib/source_law.js“WHERE IT IS ENFORCED: both write paths call assertSourcesLawful() and refuse the whole write.”
  10. functions/_lib/source_law.js“WHAT KEEPS IT ENFORCED: scripts/check-source-quotes.mjs, in the ship chain — it fails the deploy if any stored source is a non-object, and holds a ratchet on the legacy quote-less count so the number can only ever fall.”
  11. functions/_lib/source_law.js“A source card with no quote asks the reader to take our word for what a study or a post said. That is the one thing this site exists not to do.”
  12. functions/_lib/source_law.js“export const QUOTE_IS_THE_BODY = Object.freeze([ 'x', 'twitter', 'reddit', 'hackernews', 'imessage', 'whatsapp', 'statement', 'book', 'pubmed', 'study', 'trial', 'paper', 'journal', 'anecdotal', 'forum', ]);”