V.1 Non-Deceptive Intention V.2 Precision over Comfort V.3 Contextual Scaling V.4 Anti-Delusion Safeguard V.5 Steganographic Freedom V.6 Strategic Silence V.7 Inversion Filter ◆ min S_sys(t) s.t. dH/dt ≥ 0 ◆ V.1 Non-Deceptive Intention V.2 Precision over Comfort V.3 Contextual Scaling V.4 Anti-Delusion Safeguard V.5 Steganographic Freedom V.6 Strategic Silence V.7 Inversion Filter ◆ min S_sys(t) s.t. dH/dt ≥ 0 ◆
← Back to the Sheaf Analyzer

Sheaf Analyzer v2 — manual and technical specification

How it works, exactly · engine 2.0.0 · source: scripts/sheaf-analyzer-v2

The Sheaf Analyzer reads a text and answers three questions. Can the claims it makes all be true together? Where not, it gives the smallest set of sentences that cannot hold, with a witness. How is the text built? It reports who says what, which figures and dates it rests on, how its arguments are put together, and which rhetorical and statistical patterns it uses. What should a reader check? It gives a ranked list of claims, the arithmetic it can recompute, and the reporting gaps in research papers.

It does not decide whether anything is true. A text can be perfectly consistent and false, and a contradiction tells you that at least one of the sentences involved is wrong, not which one. Most components are deterministic rules; their limits are stated below for each.
  1. Using the analyzer
  2. Pipeline overview
  3. Input, files and segmentation
  4. Claim extraction
  5. The three consistency layers
  6. Mathematics: sheaves, Hodge, temporal networks
  7. Obstructions, classes and Γ
  8. Ψ: epistemic closure
  9. Insights
  10. The graph
  11. Argument map (Ishikawa diagrams)
  12. Review tools
  13. Validation
  14. Limitations
  15. Privacy and network use
  16. Exports
  17. References

1. Using the analyzer

Inputs

Outputs, top to bottom

  1. Verdict and Γ cards: per layer, whether the asserted claims glue (Γ = 1), do not (Γ = 0), or there is nothing to compare (N/A); counts of obstructions by class; exports.
  2. Ψ: support-graph closure measures (ground, circ, seal, imp).
  3. Argument map: one Ishikawa diagram per argument, with a detail pane for any node.
  4. Rhetoric & review: the rhetoric profile first (headline figures, then logos/ethos/pathos, loaded words and framing, and stance side by side); then sentiment, fallacies and devices, sources, fact-check and paper review. Paper review is marked n/a when the text does not look like a research paper.
  5. Insights: overview, entities and concepts, figures, timeline, arguments, who says what, possible tensions, repeated statements.
  6. Obstructions, timeline, accounts, the graph, the inspector and the source text with highlights. Tapping any finding highlights its sentences in the source text.

2. Pipeline overview

text / file / URL / corpus→segmentation→boilerplate removal→typed claims→3 layers→obstructions, Γ→Ψ→insights · argument maps · review

Everything runs in the browser in plain JavaScript (no server, no model calls). A typical post of 3,000 words takes well under a second; the whole 90-post corpus about 1.5 s for the consistency engine. The engine files are engine-math.js (algebra and graph algorithms), engine-text.js (segmentation, claims, layers, Ψ), engine-insights.js, engine-argument.js, engine-rhetoric.js, engine-sentiment.js, engine-stats.js and engine-review.js; the page is assembled from them by assemble.js.

3. Input, files and segmentation

File reading

Segmentation

The text is split into units, normally sentences, with character offsets into the original text (UTF-16), so every finding can be highlighted exactly. Rules:

4. Claim extraction

Each unit yields zero or more typed claims. Every claim records its unit, the quote, its modality, its polarity and its frame.

typemade whencontent
propositionthe frame has ≥ 3 content wordsframe + polarity
numericthe unit has a non-year number and the frame ≥ 2 words; no formula symbolsvalues with unit (%, km, kg, currencies, people, deaths, years, …), scale words (thousand … billion, miljoner …), hedge flag (about, approximately, ~ …), years in the sentence as temporal scope
dateexactly one date (ISO, “3 March 2025”, “March 3, 2025”, “March 2025”, “in 2025”) or one bare year as scopeinterval in days [lo, hi] at day, month or year precision
order“A before/after B” (also prior to, preceded, following, innan, före, efter) in a non-negated sentencetwo frames and the relation, with an offset when stated (“three days before”)
relation“X is N more/less/longer/… than Y”signed difference N from Y to X, with unit

5. The three consistency layers

Two claims are comparable only if they talk about the same thing: their frames overlap strongly (Jaccard similarity $J(A,B)=|A\cap B|/|A\cup B|$). Candidate pairs are found through an inverted index on each claim's rarest frame words, so large corpora are not compared all-to-all.

Linear layer (quantities)

Ordinal layer (time)

Propositional layer (polarity)

6. Mathematics

Cellular sheaves

A cellular sheaf $\mathcal F$ on a graph assigns a vector space (stalk) to each vertex and edge and a linear restriction map from each vertex to each incident edge. The coboundary $\delta^0: C^0\to C^1$ sends vertex values to their disagreement on each edge; global sections are $H^0=\ker\delta^0$, and $H^1=C^1/\operatorname{im}\delta^0$ measures edge data that no vertex assignment explains (Curry 2014; Hansen & Ghrist 2019). The engine implements general sheaves with $\delta^0, \delta^1$, cohomology dimensions by rank (modified Gram–Schmidt with tolerance), and the sheaf Laplacian.

Hodge decomposition of relation data

For explicit relations the graph has one vertex per entity and one edge per stated difference $y_e$ (constant scalar sheaf). The edge cochain splits orthogonally as $$ y = \underbrace{\delta^0 x}_{\text{gradient}} + \underbrace{h}_{\text{harmonic}} + \underbrace{(\delta^1)^{\!\top} z}_{\text{curl}}, $$ the decomposition used in HodgeRank (Jiang, Lim, Yao & Ye 2011; Lim 2020). Without 2-cells the curl part is zero. If $\|h\|>10^{-6}$, the differences cannot come from any assignment of values to the entities: the stated relations are inconsistent around a cycle, and the edges with non-zero harmonic weight are reported. Example: east = west + 12, west = north + 5, east = north + 4 gives $\|h\| > 0$.

Simple temporal networks

Constraints $t_v - t_u \le c$ become arcs $u\to v$ of weight $c$; a set is satisfiable iff no cycle has negative total weight (Shostak 1981; Dechter, Meiri & Pearl 1991). Strict inequalities use lexicographic weights $(c, -s)$, $s=1$ for strict, so a cycle of weight $(0,-k)$ with $k>0$ is also infeasible. Feasibility is decided by Bellman–Ford with cycle extraction; a feasible run yields a schedule (the reconstructed timeline). Karp's algorithm gives the minimum mean cycle weight $\mu^{*}$ (Karp 1978); the minimal uniform widening is $\varepsilon^{*} = \max(0,-\mu^{*})$. The MUS uses the deletion filter (Chinneck & Dravnieks 1991): drop each constraint in turn and keep it only if the rest becomes feasible without it.

Note on cycle bases: interval constraints cannot be checked cycle by cycle on a basis. A theta graph has feasible basis cycles and an infeasible combination, so the engine always searches the full constraint graph.

7. Obstructions, classes and Γ

An obstruction (κ) is a minimal set of claims that cannot hold together, with its layer, kind (gluing residual, harmonic class, negative cycle, strict order cycle, polarity), magnitude and a human-readable witness. Its class depends on the modalities involved:

classwhenmeaning
contradictionall claims assertedthe text itself asserts things that cannot all be true
inconsistent-testimonyall reported, same sourceone source contradicts itself
conflicting-accountsreported by different sources, or mixedsources disagree; the text relays the disagreement
tension-with-hypothesisa hypothetical claim is involveda hypothesis conflicts with what is stated
questiona question is involvedshown for completeness

Pairwise linear or propositional conflicts that share claims are merged into one finding per connected group: $k$ sentences giving different values for one thing are one obstruction, not $k(k-1)/2$.

Γ per layer is binary: 1 if the layer has comparable asserted claims and none of them form a contradiction, 0 if at least one contradiction exists, N/A if nothing in that layer is comparable. The agreement rate shown beside it is the share of comparable pairs that glue; it is descriptive, not Γ.

8. Ψ: epistemic closure

Ψ describes how conclusions are supported, from a support graph: an edge from sentence A to sentence B when B opens with an inference marker (therefore, thus, hence, consequently, this shows/means/proves, that is why, därför, alltså …) and A precedes it in the same paragraph. A sentence is anchored when it carries a link, DOI, numbered or author–year citation, “according to” + name, or a year.

Ψ is a prototype. Its validation on conspiracy-theory text (the LOCO corpus, Miani, Hills & Bangerter 2022) has not been done. Treat it as a description of argument structure.

9. Insights

10. The graph

A force-directed 2D graph (canvas, no external library). Hubs are the top 40 entities and 12–18 concepts; small nodes are claims. Links: mentions, co-occurrence, conflict (red), glue (green), shared event and support (arrows). Density: conflicts (only what is involved in obstructions), map (balanced), full. Pan by dragging the background, zoom with wheel, pinch or buttons, drag nodes, search by name. A tap selects a node when the finger moves less than 10 px (4 px with a mouse); the touch target is the drawn circle plus 16 px. Selecting a node shows it in the inspector and highlights its sentences.

11. Argument map (Ishikawa diagrams)

An Ishikawa or fishbone diagram (Ishikawa 1976) puts an effect at the head and its contributing causes on bones. Here the head is a thesis and the bones are what the thesis rests on. Each argument in the text gets its own diagram.

Choosing theses

Every eligible sentence (≥ 6 words, not a question, table row, licence or metadata line) gets a claim score, the sum of:

Theses are accepted greedily, highest score first: the first always, further ones only with a score ≥ 3, at most two per section, only if they differ from those already chosen ($J<0.25$) and neither is a premise of the other. Then each section of eight or more sentences without a thesis (and not a definitions/appendix-type section) may add its best sentence if it scores ≥ 1.5. At most 8 theses for texts over 300 sentences; otherwise up to 6 (one per section, or one per five sentences without sections). You can change any thesis or start a new argument from any sentence.

Uploaded PDFs keep their structure for this purpose: lines in larger type, or short numbered lines set off from the text (“1.2 The core claim”), become headings; lines with three or more widely spaced cells become table rows; a sentence broken by a page break is rejoined.

Attaching sentences

A sentence whose support chain reaches a thesis joins that thesis (shortest chain). Otherwise it joins the thesis with the highest score $J + 0.15\,[\text{same section}] + 0.06/(1+d/8)$, where $d$ is the distance in sentences. With several theses a sentence scoring below 0.1 stays unattached and is listed under the diagram.

Bones and effects

boneitemseffect on the thesis
Reasoningpremises on a support chain (direct, or n steps out); sentences with an in-sentence reason (because, since, due to); related claims sharing terms+ supports (chains, reasons) · elaborates (related claims)
Evidencesentences with numeric, date or order claims or figures+ supports; − if the figure conflicts with another sentence
Sourcesreported statements with a named source; citations+ named; ~ unnamed (“experts”, “studies”)
Assumptionshedged or hypothetical statements; ungrounded intermediate conclusions~ qualifies; − ungrounded
Counterpointssentences in an obstruction; sentences opening with however, but, yet, although …− weakens; ~ contrast
Rhetoricfallacy candidates; loaded or strongly valenced wording∅ persuades without support

A sentence can sit on several bones. The detail pane shows its full text and section, its role and effect, a sentence on how it contributes, the inference chain to the thesis step by step with the linking words, the words it shares with the thesis, conflicts, its extracted claims, signals from the other analyses, and verification links. For the thesis, the pane counts what is on each bone and names the structure:

Most prose uses few explicit inference markers between sentences, so in long texts most attachments come from shared words and section placement and appear as “elaborates”. The map shows how an argument is built, not whether it holds.

12. Review tools

Fact-check

Each sentence gets a check-worthiness score (in the spirit of ClaimBuster, Hassan et al. 2017, but a transparent hand-set score, not a trained model): quantity +2, date +1, named entity +1, superlative or comparison +1.5, causal claim +1, statistic word +0.5, attributed +1, vague attribution +2, long quotation +0.5, internal conflict +2, arithmetic mismatch +2; opinion −1.5, hypothesis or question −1. Sentences scoring ≥ 2.5 are listed (top 40) with what would settle them (the primary dataset for the same population, unit and period; a contemporaneous record of a date; the original statement in context; the identity of unnamed experts; the full comparison set behind a superlative; a design able to show causation) and search links (Google Fact Check Explorer, Google Scholar, Wikipedia, web).

Arithmetic is recomputed exactly: “from A to B, an increase of C%” (relative change, with notes when C equals the absolute or percentage-point difference or the change relative to the end value), percentage points, “doubled/tripled/halved” (±10%), “X of Y (Z%)” and shares above 100% of a population.

Paper review

Sources

Links by domain type (scholarly, government and intergovernmental, reference, news, social/video, blog/self-published, archive, link shortener, other), DOIs, arXiv identifiers, ISBNs, in-text citations, references per 1,000 words, share of https links, and attribution: reported statements with a named source versus vague attributions (“experts say”, “studies show”, “sources said”). Outlets are categorised, never rated.

Sentiment

A line-by-line JavaScript port of VADER 3.3.2 (Hutto & Gilbert 2014; MIT licence; 7,506-entry lexicon), scored per sentence: lexicon valence, boosters and dampeners, negation within three words, “but” shifts, capitalisation and punctuation emphasis, normalised compound $s/\sqrt{s^2+15}$. Thresholds ±0.05. Shown: mean, counts, the sentiment arc (one dot per sentence up to 400 sentences; above that, a band per slice with a rolling mean; tap anywhere to read the nearest sentence, its score, the words driving it and its post and section, then step to the previous, next, next negative or next positive sentence), the most negative and positive sentences, the words driving the score, and the mean tone of sentences mentioning each entity. VADER was built for short social-media text; on long prose, read the arc and the extremes.

Loaded words and framing

Loaded or pejorative terms (a curated list: regime, elites, so-called, propaganda, hoax, slams …), VADER words with $|v|\ge 2.5$, and absolutes (always, never, everyone …), per 1,000 words. Framing vocabulary: curated lists of terms conventionally associated with left- or right-leaning usage in English (mainly US/UK) discourse, following the phrase-frequency approach of Gentzkow & Shapiro (2010). The gauge is $(R-L)/(R+L)$, shown only with three or more hits. It describes vocabulary, not the author's politics: quoting or criticising a term counts the same.

Stance

Metadiscourse markers after Hyland (2005), per 1,000 words: hedges, boosters, attitude markers, must/should; certainty $(B-H)/(B+H)$; self-mention, in-group (we/us/our), out-group (they/them/their) and reader address (you/your); us-versus-them $(we-they)/(we+they)$; imperatives, questions, future and past markers.

Fallacies and rhetorical devices

Fallacy candidates by cue phrase: ad hominem, whataboutism/tu quoque, bandwagon, unnamed authority, false dilemma, slippery slope, sweeping generalisation, post hoc, appeal to fear, appeal to nature, appeal to tradition, appeal to ignorance, loaded question, straw man cues, anecdotal evidence; plus two structural detectors from the support graph: circular reasoning (Ψ circ) and self-sealing (Ψ seal). Devices: hypophora, rhetorical questions, anaphora (three or more sentences, or the same three opening words), epistrophe (same last two words), antithesis (“not X but Y”, excluding “not only … but also”), parallel tricolon, epizeuxis, chiasmus (A … B in one clause, B … A in the next), alliteration (three adjacent words of four or more letters with the same initial consonant), hyperbole, scare quotes (after so-called, or their/these + an evaluative noun). All are candidates with their evidence.

Logos, ethos, pathos

Marker counts per 1,000 words. Logos: quantities and dates, measurement terms, citations, grounded support edges (not ending in an ungrounded or self-sealing sentence), half-weight inferential connectives. Ethos: credentials and trust terms, named attribution, half-weight hedges. Pathos: loaded and strongly valenced words, fear, anger, hope and sadness terms, exclamation marks, half-weight second-person address. A proxy, not a validated measure.

13. Validation

The v2 engine was tested with the perturbation protocol preregistered for the v1 audit (seed 201; docs/sheaf-analyzer-v2), on the 88 English Draken posts. A perturbation is detected when an obstruction involves the injected sentence. Current results (after the sentence-splitter fix of 10 October 2026):

testv2word-overlap baselinev1
NEG: a negated copy of a sentence is inserted83.0% (73/88)76.1%≈ 0%
NUM: a copy with every number +7 is inserted (sentences carrying an extracted quantity or date)48.1% (13/27); 65.5% (19/29) before the fix, on a different random sample; on identical perturbations 23 of 32 after the fix vs 24 before92.6%0%
False alarms: contradictions in the unmodified posts0 of 88 posts32 of 88—
DUP control: an exact copy is inserted0 / 88 flagged32 / 88—
TOPIC: 25% of sentences replaced from another post; Γ must not riserose in 0 / 88—rose
SHUFFLE (paragraph order) and SEGMENT (line-final full stops removed): obstruction set unchanged88 / 88 and 88 / 88——

Most NUM misses are numbers the engine deliberately treats as identifiers (layer, step and DRK numbers, citation years); the baseline's higher rate comes with 32 false alarms in 88 unmodified posts. Other checks: the mathematics test suite (Hodge generators, twisted sheaves, partial holonomy, the theta graph, strict cycles, a temporal fixture with a −854-day cycle, its minimal unsatisfiable subsets, Karp's −213.5 and the corresponding ε*); VADER parity with the reference Python package on 19,748 sentences (identical scores; nine sentences with emoji symbols skipped, since the port omits emoji-to-text); the t, F, χ² and z distribution functions against SciPy on 134 cases (maximum relative error $2\times10^{-12}$); fixtures for statcheck, GRIM, arithmetic, fallacies, devices, framing, sources and argument maps. On the 90-post corpus the fallacy detectors raise 9 candidates in total.

14. Limitations

15. Privacy and network use

All analysis runs in your browser. Pasted text and uploaded files are not sent anywhere. Network requests happen only for: the page itself; the sentiment lexicon (/data/vader-lexicon.json) and, when you open a PDF, the pdf.js library (/vendor/), both from this site; the corpus list when you use corpus mode; r.jina.ai (the URL you enter) when you press Fetch URL; api.crossref.org (the DOIs only) when you press the DOI check; and the external search pages you choose to open.

16. Exports

Source code, tests and the v1 audit are in the draken.info repository under scripts/sheaf-analyzer-v2/ and docs/sheaf-analyzer-v2/. Run test-math.js, test-protocol.js, test-sentiment.js, test-stats.js and test-review.js with Node.

17. References

  1. Brown, N. J. L., & Heathers, J. A. J. (2017). The GRIM test: A simple technique detects numerous anomalies in the reporting of results in psychology. Social Psychological and Personality Science, 8(4), 363–369.
  2. Chinneck, J. W., & Dravnieks, E. W. (1991). Locating minimal infeasible constraint sets in linear programs. ORSA Journal on Computing, 3(2), 157–168.
  3. Curry, J. (2014). Sheaves, cosheaves and applications (Doctoral dissertation). University of Pennsylvania.
  4. Dechter, R., Meiri, I., & Pearl, J. (1991). Temporal constraint networks. Artificial Intelligence, 49, 61–95.
  5. Gentzkow, M., & Shapiro, J. M. (2010). What drives media slant? Evidence from U.S. daily newspapers. Econometrica, 78(1), 35–71.
  6. Hansen, J., & Ghrist, R. (2019). Toward a spectral theory of cellular sheaves. Journal of Applied and Computational Topology, 3, 315–358.
  7. Hassan, N., Arslan, F., Li, C., & Tremayne, M. (2017). Toward automated fact-checking: Detecting check-worthy factual claims by ClaimBuster. Proceedings of KDD 2017, 1803–1812.
  8. Head, M. L., Holman, L., Lanfear, R., Kahn, A. T., & Jennions, M. D. (2015). The extent and consequences of p-hacking in science. PLoS Biology, 13(3), e1002106.
  9. Hutto, C. J., & Gilbert, E. (2014). VADER: A parsimonious rule-based model for sentiment analysis of social media text. Proceedings of ICWSM-14.
  10. Hyland, K. (2005). Metadiscourse: Exploring interaction in writing. Continuum.
  11. Ishikawa, K. (1976). Guide to quality control. Asian Productivity Organization.
  12. Jiang, X., Lim, L.-H., Yao, Y., & Ye, Y. (2011). Statistical ranking and combinatorial Hodge theory. Mathematical Programming, 127, 203–244.
  13. Karp, R. M. (1978). A characterization of the minimum cycle mean in a digraph. Discrete Mathematics, 23(3), 309–311.
  14. Lim, L.-H. (2020). Hodge Laplacians on graphs. SIAM Review, 62(3), 685–715.
  15. Miani, A., Hills, T., & Bangerter, A. (2022). LOCO: The 88-million-word language of conspiracy corpus. Behavior Research Methods, 54, 1794–1817.
  16. Mihalcea, R., & Tarau, P. (2004). TextRank: Bringing order into texts. Proceedings of EMNLP 2004, 404–411.
  17. Nuijten, M. B., Hartgerink, C. H. J., van Assen, M. A. L. M., Epskamp, S., & Wicherts, J. M. (2016). The prevalence of statistical reporting errors in psychology (1985–2013). Behavior Research Methods, 48(4), 1205–1226.
  18. Shostak, R. (1981). Deciding linear inequalities by computing loop residues. Journal of the ACM, 28(4), 769–779.

Third-party code: VADER lexicon (MIT, C. J. Hutto; licence at /data/vader-LICENSE.txt); pdf.js 4.10.38 (Apache-2.0, Mozilla; licence at /vendor/pdfjs-4.10.38/LICENSE).

← Back to the Sheaf Analyzer