Publish-Time Gates
Last updated: November 20, 2026
A written rule is only as good as the thing that enforces it. This page describes the gates our publishing code runs before a document goes out. For each one we say what it catches, which channels it covers, and whether it blocks (the code stops the action) or warns (the code reports it and carries on). Where a rule depends on an editor’s judgment instead of code, we say so.
Counts on this page were measured from the code as of November 20, 2026.
Four doors, one standard
Four channels carry our words to readers:
- Knowledge-base articles, published with
scripts/ca_publish.py. - Substack newsletter exports, made with
scripts/ca_substack.py. - Generated tracker pages, published with
scripts/ca_publish_pages.py. - Timeline stories, generated from an article’s dated events inside Compose, our editing console.
Each channel has its own entry point, its own record of what was sent, and its own gate code. That is a risk: a gate added to one channel and forgotten on another leaves a side door open. It has happened. The Substack and tracker-page channels each shipped for a time without gates the main channel had.
So a test, tests/test_gate_reachability.py, finds the gates by reading each channel’s code structurally, rather than from a hand-kept list. It then requires every gate to be on every channel or to carry a written reason for its absence. As of November 20, 2026 that discovery finds:
| Channel | Gates found |
|---|---|
| KB articles | 8 |
| Substack export | 5 |
| Tracker pages | 2 |
| Timeline stories | 4 |
Eight distinct gate modules exist across the four. Every absence in the table is a recorded exemption with a reason, or the test fails.
When the gates run
On the KB channel the content gates (citation, inclusion, reuse, guard audit and empty-article) run when a document is about to go live. A push to WordPress as a draft, used to check how a page renders, skips them. The missing-image check runs when the page is rendered, so it applies to any push. All of them run before the write, never after. That is a design fact worth stating plainly: a gate can only judge what we are about to send, so it cannot tell us whether what a reader now sees matches it. That second question is answered by a different tool, covered in Post-Publish Verification and Corrections.
The gates
| Gate | Channel(s) | Blocks or warns | What it catches |
|---|---|---|---|
Citation gate (citation_gate) |
KB, Substack block; timeline stories warn; not applicable to tracker pages | Blocks (warns on timeline stories) | A profile that states a person has a criminal record or is facing a criminal case, but carries no checkable source: no docket or case number, no external link, no named Sources entry. Links to our own site do not count |
Inclusion gate (inclusion_gate) |
KB, Substack, timeline | Blocks | A document whose structured pre-screen result is anything other than pass |
related: integrity (related_integrity) |
KB, Substack | Blocks | A related: entry that points at a document that does not exist |
Reuse-terms notice (reuse_gate) |
All four | Warns | A cited source whose terms limit reuse or derivative works |
Guard audit (guardrails) |
All four | Blocks for 11 rules, warns for the rest | The rule list below |
Empty-article refusal (embed_check) |
KB | Blocks only when the article is empty | An article with no text, which the search index could not use |
Missing-image refusal (media) |
KB | Blocks that document | An image reference that does not resolve to a real file |
Sourcing-score floor (dcs_gate) |
KB | Blocks only if switched on | Thin sourcing on a person profile. Off by default |
| Batch-size confirmation | KB | Blocks until confirmed | More than 25 documents in one push |
| Sensitive-category confirmation | KB | Blocks until confirmed | A batch that includes documents in the people and organization categories or the administration category |
Some details that the table cannot hold:
- Citation gate. Draft pushes are exempt, so an author can draft an uncited claim while fixing it. On timeline stories it is a warning because a story is a fragment of its parent article, never a page of its own, and the parent carries the Sources section the gate already checked. A test pins that fact; if it stops being true, the exemption goes.
- Inclusion gate. A non-
passscreen is refused unless a scoped, written ruling covers that subject and that reason. Then the document publishes with a warning naming the ruling. There is no override flag: the ruling is the override. Free text in a field clears nothing. On timeline stories the gate runs whatever the source article’s status, so no story is generated from an article that would be refused. related:integrity. A missing reciprocal link is never a refusal; it is repaired when the document is saved.- Reuse-terms notice. It can see which sources are cited but not what was quoted, so it only warns. A blocking rule would refuse every document that merely links to a strict source.
- Empty-article refusal. An over-long article is reported but still publishes, so its address stays stable. Only an empty one is refused.
- Tracker pages carry no frontmatter and no category, so the citation, inclusion and
related:gates cannot apply. We record that as an exemption rather than let a gate that always passes pose as coverage. - Missing images and empty articles are checked on the KB channel only. The reachability test records both as known gaps on the other channels, with a reason, rather than letting them pass unnoticed.
The guard audit
The guard audit is the largest gate. It is the same set of rules Compose shows an author when a document is saved, so an author learns of a problem while the document is still in front of them. As of November 20, 2026, scripts/lib/guardrails.py holds 23 rules. Thirteen are error-level. Eleven of those block a publish. The other two are exempt from blocking, each with a written reason. The remaining ten only warn.
Blocking (11)
| Rule | What it catches |
|---|---|
pii-ssn |
A Social Security number pattern (###-##-####) in the body. This is the only personal-data pattern the code detects |
stream-residue |
Leaked tool or stream markers from an AI session pasted into the article |
missing-defamation-guard |
A document that states an instrument assessment but has no Legal Disclaimer block |
staging-self-reference |
Reader-visible text that talks about drafts or staging folders |
meta-description-length |
A search description that is not 80 to 160 characters |
dma-designation-mismatch, dma-scores-unparsed |
A stated DMA designation that does not compute from its own scores, or scores that cannot be read |
sma-designation-mismatch, sma-scores-unparsed |
The same two checks for the SMA instrument |
shared-marker-unknown |
A {{marker}} that names no registered shared block, which would publish as literal text |
template-skeleton (error form) |
A document still carrying template placeholder structure |
Error-level but not blocking (2). The excluded-source rule flags a mention of one named, excluded database. It publishes with a warning, because a bare word match cannot tell a citation from a document that describes our sourcing policy; a new hit is a prompt for a human look. draft-slug-filename-mismatch applies only to files in staging folders, which no publish channel can reach. The promotion step refuses it instead.
Warn-only (10). broken-wikilink, staging-path-pointer, link-target-placeholder, heading-id-tag, needs-verification, prohibited-language, stored-shared-block, dma-designation-missing, sma-designation-missing and sma-designation-unverifiable.
Two of these are worth stating carefully. A needs-verification tag left in a document warns at publish; it does not stop it. The prohibited-language rule is a heuristic over a short list of six loaded labels, covering treason, terrorism, coup plotting and two kinds of abuser, and every hit needs a human read. Wider wording standards are written policy applied by editors, described in Evidence, Sourcing and Language Rules.
On the tracker-page and timeline channels the audit runs the subset that can be judged on generated text: the SSN pattern, stream residue, staging text and unexpanded markers, plus the missing-disclaimer check on timeline stories. Rules that cannot fire there, such as a designation check on a one-event story, are exempted with a written reason.
Bypass flags are a human decision
Some gates have a documented bypass, for a real exception:
--allow-uncitedskips the citation gate.--allow-auditlets the blocking guard rules through. The findings are still printed as warnings, never dropped.--forcebypasses the batch-size, hash-scheme and sensitive-category confirmations.--confirm-sensitivebypasses only the last.--allow-retargetpermits changing a published document’s post type, which otherwise would trash a live post by accident.
The flag help text says to use the first two “only with documented sign-off”. We hold to that. The code cannot judge whether a sign-off exists, so using a bypass is a human decision, never an AI agent’s. The publish plan prints which gate a flag bypassed, and the run log records the refusal reason for every blocked document.
A bypass is also scoped. When a publish moves a page address and the tool re-renders the pages that link to it, the bypass flags are cleared for those pages. An override granted for one document never unlocks another.
What the gates cannot tell you
A gate that passes tells you the source text met the rule. It does not tell you the claim is true, that an editor weighed an inclusion decision well, or that the live page matches what was sent. Those are separate layers: Draft Checks and Human Review before this step, Post-Publish Verification and Corrections after it.
Factual correction requests: If you believe information in this page is incorrect, please contact factcheck@citizenanalyst.ai with your name (optional), the specific claim, and any supporting documentation. We review all submissions and correct verified errors promptly.
