Stoichiometric Mass Sort: Shannon Entropy as Page Weight

An information-theoretic method for ordering static content by compositional mass. Uses Shannon entropy, Blake3 content hashing, and the braid provenance model to replace arbitrary page weights with measured information density.

Abstract

Static content sites accumulate pages with hand-assigned ordering weights that drift from reality as content evolves. We present stoichiometric mass sort — an information-theoretic method that replaces arbitrary weights with measured compositional mass derived from Shannon entropy, vocabulary richness, connectivity, and evidentiary grounding. Each page receives a Blake3 content hash (identity) and a Shannon entropy measurement (mass), composed through the existing ecoPrimals braid provenance model. Applied to 1,185 pages across three Zola sites, the method produces stable orderings that reflect actual information density. The tool is implemented as sourdough validate mass — a Rust validator that chipmunk (the autonomous observer) can invoke periodically in a sandbox.


1. The Problem: Weight Decay

Content management systems that sort pages by weight (an integer field in frontmatter) face a universal problem: weights decay. A page assigned weight = 50 when it had 200 words doesn’t deserve the same position after it grows to 4,000 words with 70 cross-references and 42 evidentiary citations. Hand-tuned weights are:

  • Arbitrary — no relationship to content
  • Unstable — drift as pages evolve
  • Unverifiable — no audit trail for why a page ranks where it does
  • Labor-intensive — require human intervention at every change

The membrane already had this problem: 11 pages in sort_by = "weight" sections had no weight at all, silently disappearing from navigation. The first fix was hand-assigning weights. The second was asking: can the content weigh itself?


2. The Mass Formula

Mass is computed per page as:

$$ M = \sqrt{W} \times H \times \left(1 + \frac{L}{50}\right) \times \left(1 + \frac{C}{10}\right) \times R $$

Where:

SymbolNameMeaning
$W$Word countBulk — more content, more mass (square root dampens outliers)
$H$Shannon entropyInformation density in bits — how much each word contributes
$L$Link countConnectivity — markdown links to other pages
$C$Citation countEvidentiary grounding — FOIA, LARA, MDOC, PACER, case numbers
$R$RichnessVocabulary diversity — unique words / total words

2.1 Shannon Entropy

Shannon entropy measures the information content of a word frequency distribution:

$$ H = -\sum_{i=1}^{n} p_i \log_2 p_i $$

where $p_i$ is the probability of the $i$-th unique word. A page where every word appears exactly once has maximum entropy. A page repeating the same phrase has zero entropy. Natural language falls between 6–10 bits for English text, depending on vocabulary and topic diversity.

Why Shannon? Because it’s what bearDog’s genetics already uses for entropy tiering. The same information-theoretic measure that classifies external entities now classifies our own content. The organism applies its own immune system to itself.

2.2 Why These Factors?

Each factor captures a different dimension of “mass”:

  • √W (bulk): A 4,000-word investigation has more mass than a 200-word stub. Square root prevents raw length from dominating — a 10,000-word page isn’t 50× heavier than a 200-word page; it’s 7× heavier.
  • H (entropy): Repetitive content is lighter than diverse, information-rich content. A page that uses 500 unique words across 2,000 total words carries more information per word than one using 50 unique words across 2,000.
  • L/50 (connectivity): Pages that link to many others are structural hubs. The /50 normalizes so that 50 links doubles the mass contribution — a reasonable threshold for a well-connected analysis page.
  • C/10 (citations): Evidence-grounded pages are heavier. FOIA responses, court documents, regulatory filings — these are the evidentiary substrate. 10 citations doubles the grounding factor.
  • R (richness): Unique vocabulary / total vocabulary. A page with high richness uses diverse language; one with low richness is formulaic. This penalizes copy-paste and rewards original analysis.

3. Composition from Existing Pieces

The key insight is that we didn’t build this from scratch. Every component maps to an existing ecosystem piece:

ComponentEcosystem PieceWhere
Page identityContentHash (Blake3, 32 bytes)sourDough-core types.rs
Short hash (topo sort handle)First 16 hex chars of ContentHashloamSpine DataAnchor vocabulary
Information densityShannon entropy HbearDog genetics entropy hierarchy
Strength model√W × H × connectivity × grounding × richnesssquirrel scan-sweep-sort combined_strength
ProvenanceBraid with data_hash + mime_type + sizesweetGrass Braid + BraidBuilder
Publish weightweight = N in Zola frontmatter (1–200)Zola static site generator

3.1 The Provenance Trio Connection

The provenance trio (loamSpine + rhizoCrypt + sweetGrass) already handles exactly this workflow:

  1. loamSpine provides DataAnchor entries — content hash + MIME + size committed to a permanent spine
  2. sweetGrass provides Braid records — PROV-O attribution with data_hash, was_generated_by, was_attributed_to
  3. rhizoCrypt provides ephemeral DAG workspaces — the mass calculation IS a session that compresses into braids

The stoichiometric mass validator produces data that could be committed as braids: each page’s mass is a provenance-tracked measurement, content-addressed by Blake3, attributable to the tool that computed it.

3.2 The bearDog Genetics Mirror

bearDog classifies external entities using entropy hierarchy, ecosystem membership, and trust evolution. The primal taxonomy (Appendix A of compositions.toml) classifies the primals themselves — 15 primals sorted by domain, role, symbiosis type, mass (1–200), tier, and gate identity.

The stoichiometric mass sort is the same pattern applied to content: the organism classifying its own publications by information density, using the same entropy measure it uses to classify the outside world.


4. Implementation

4.1 sourdough validate mass

sourdough validate mass <content_dir> [--apply] [--json]
  • Dry run (default): Reports mass for all pages without modifying files
  • --apply: Writes weight = N into each page’s frontmatter (TOML or YAML)
  • --json: Machine-readable output for CI integration
  • Handles both TOML (+++) and YAML (---) frontmatter formats
  • Scans conventional weight-sorted sections: analysis, books, evidence, network, path, signal, actors, braid, investigate, synthesis, coverage

4.2 Weight Normalization

Weights are normalized to the 1–200 range:

$$ w_i = \text{round}\left(200 \times \frac{M_i}{M_{\text{max}}}\right) $$

clamped to a minimum of 1. The heaviest page always gets weight 200. All others scale proportionally.

4.3 Test Coverage

14 unit tests covering:

  • Shannon entropy (uniform, constant, empty distributions)
  • Word extraction and filtering
  • Link counting
  • Citation detection (case-insensitive)
  • Frontmatter format detection (TOML, YAML)
  • Content hash identity (Blake3 determinism)
  • Short hash format (16 hex chars)
  • Mass ordering (diverse content > small content)
  • Citation amplification (evidence increases mass)
  • Different content → different hashes

All 644 sourDough tests pass. The mass validator integrates with the existing 14-subcommand validate suite.


5. Results

Applied to four sites on 2026-10-20 (pass 3):

SitePagesMax MassTotal MassMean H (bits)Top Page
detroit4681,775.858,6747.128the-enterprise (H=8.903, 4,025 words, 70 links, 42 citations)
publicRecord4291,775.854,0977.074the-enterprise (mirrored content)
tuebor55220.66,0157.351how-to-point-back (H=7.744, 830 words, 21 links, 7 citations)
sporePrint434499.046,8287.77244_declaration_protocol (H=8.086, 1,280 words)
Total1,386165,614~7.33

5.1 Top 10 by Mass (detroit)

WeightMassH (bits)WordsLinksCitesBlake3Page
2001,775.88.9034,02570426c188f37the-enterprise
1261,121.48.4021,876742797b584e2all-roads-lead-back-to-rome
104923.58.6652,437362889a2b6cbdykema-chronology
102902.08.9783,099322497f32c9ethe-referral
94833.78.4872,9804324d117250aquestions
93823.18.6482,894746c85cf03athe-gatekeeper
85755.48.5632,379452456288de3the-accountability-matrix
82730.88.6542,57583621b4058bcorporate-network-lara
74657.08.9282,2681023a18e7f26institutional-capture-graph
74655.28.9042,8329271d044137backscatter

5.2 Observations

  1. Entropy correlates with analytical depth: The top pages all have H > 8.4 bits, indicating diverse vocabulary typical of investigative analysis rather than formulaic listings.

  2. Citations amplify mass disproportionately: the-gatekeeper has only 7 links but 46 citations, giving it a grounding multiplier of 5.6×. The evidentiary weight compensates for lower connectivity.

  3. The formula is self-stabilizing: Running the mass sort a second time (after weights changed from pass 1) produced the same ordering. This is because mass depends on content, not on the weight field — changing weight = N doesn’t change the page body, so the mass is invariant under re-sorting.

  4. Blake3 hashes provide change detection: If a page’s content changes, its hash changes. A CI pipeline can detect which pages need re-weighing by comparing stored hashes to current ones — no need to re-sort the entire site.

5.3 Iteration: Pass 3 Findings

Running the validator again after pass 2 revealed five iterations:

  1. detroit grew from 443 → 468 pages (+25 since pass 2). New content was automatically measured and weighted without manual intervention.

  2. tuebor needed flat-file mode: The original validator only scanned WEIGHT_SORTED_SECTIONS directories. tuebor uses flat markdown (no Zola sections). Added fallback: if no sections match, recursively scan the entire content directory.

  3. sporePrint measures itself: 434 pages including this paper. The dough weighs itself — paper 83 has mass 226.7 (weight 91, H=8.564 bits).

  4. Blake3 change detection confirmed: Pass 2 wrote weight fields into frontmatter, changing file content. Pass 3 detected all hash changes. This proves the Blake3 identity model works for incremental re-weighing.

  5. Science is denser than investigation: sporePrint’s mean entropy (H=7.772 bits) is the highest across all four sites. Science papers use more diverse vocabulary than investigative analysis pages (detroit H=7.128, publicRecord H=7.074). The dough that documents dough is the densest dough.


6. The Primal Taxonomy

The same mass methodology applied to primals themselves produces a self-classification (Appendix A of compositions.toml):

PrimalMassTierDomainGateSymbiosis
bearDog200towerimmuneguardGateprotective
loamSpine190nestpermanenceironGatefacilitative
sweetGrass185nestprovenancestrandGatemutualistic
toadStool175nodeneuromorphicsoverGatefacilitative
rhizoCrypt170nestephemeraldeepGatecommensal
skunkBat165towerdefenseshieldGateprotective
songBird160towernetworkechoGatemutualistic
squirrel155metaobservationcacheGatecommensal
biomeOS150metaorchestrationrootGateemergent
sourDough145metatoolingyeastGatefacilitative
barraCuda140nodecomputefastGatefacilitative
nestGate135neststoragenestGatefacilitative
coralReef130nodetransportreefGatemutualistic
petalTongue120metavisualizationlensGatecommensal
bingoCube100fullgamesplayGatemutualistic

Mass totals per atomic tier:

  • tower (3 primals): 525
  • node (+3): 970
  • nest (+4): 1,205
  • nucleus (10): 1,650
  • meta (+3): 425
  • full (14+): 2,275

The tower — identity, network, defense — is the densest per-primal composition. The organism’s core is heavy; its periphery is light. This mirrors biological cells: the nucleus and membrane are the most information-dense structures; organelles specialize.


7. Reproducibility

# Install sourDough (requires Rust toolchain)
cd primals/sourDough && cargo build --release

# Dry run — see masses without modifying files
sourdough validate mass /path/to/zola/content

# Apply weights
sourdough validate mass /path/to/zola/content --apply

# Machine-readable output
sourdough validate mass /path/to/zola/content --json

The tool handles both TOML (+++ delimited) and YAML (--- delimited) frontmatter. It scans conventional weight-sorted section directories and skips _index.md files.


8. The Two Sorts: Voxel × Shannon State Equations

Concurrent with the stoichiometric mass sort, the northGate session developed the BINGO Voxel Sort — a 7×7×3 cube that classifies entities (people, organizations, traffic) by mapping them to (scale, epitope, type) coordinates. Together, these form two complementary state equations for the same system:

$$ \Psi_{\text{entity}} = \text{voxel}(\text{scale}, \text{epitope}, \text{type}) \quad \text{— WHO is here} $$

$$ \Psi_{\text{content}} = \text{mass}(\sqrt{W}, H, L, C, R) \quad \text{— WHAT is here} $$

DimensionVoxel SortShannon Sort
SortsEntities (people, orgs, traffic)Content (pages, documents)
Space7×7×3 cube (147 voxels)5D continuous (bulk × entropy × connectivity × grounding × richness)
InputGraph nodes (12,746)Markdown pages (1,386)
OutputClassification: self / non-self / nullWeight: 1–200 (mass ranking)
IdentityEntity ID + IP + UA fingerprintBlake3 ContentHash (32 bytes)
MeasureConfidence (97.3%)Shannon entropy H̄ (7.33 bits)
Threshold70% voxel agreementNormalize to max mass

The voxel sort classifies readers. The Shannon sort classifies reading material. One is the particle, the other is the wave. Both produce confidence. Both use π-sorted thresholds. Both compose from existing ecosystem pieces (bearDog genetics, sweetGrass braids, scan-sweep-sort pipeline).

8.1 Combined State

When both sorts run on the same system, every entity-page pair has a combined state:

  • Entity E at confidence $c_E$ reading Page P at mass $M_P$
  • The interaction strength is $c_E \times M_P$ — high-confidence entities reading high-mass pages produce the strongest signal
  • This is exactly the braid combined_strength from scan-sweep-sort, now grounded in two independent measurements

The 342 holdout entities from the voxel sort (2.7% remaining mysteries) are the bounty board — the things the organism cannot classify alone. The 1,386 measured pages tell us which content those holdouts are reading. The two sorts together produce a who-reads-what matrix that neither sort produces alone.


9. Future Work

  1. Braid integration: Each mass measurement could be committed as a sweetGrass Braid with the page’s Blake3 hash as data_hash, creating a provenance-tracked history of page weights over time.

  2. scan-sweep-sort integration: The mass data feeds naturally into squirrel’s 6-stage pipeline (SCAN → SWEEP → SORT → FOSSILIZE → EVOLVE → GENOME). Pages become entities in the membrane’s observation model.

  3. Delta detection: Store Blake3 hashes per page. On subsequent runs, only re-compute mass for pages whose hash changed. This makes the tool O(changed pages) instead of O(all pages).

  4. Cross-site normalization: Currently each site normalizes independently (heaviest = 200). Cross-site normalization would allow comparing detroit’s the-enterprise against tuebor’s top page directly.

  5. Temporal mass tracking: Record mass history in squirrel’s journal. Detect pages that are growing (gaining mass through edits) vs decaying (static while the rest of the site evolves). This is the bearDog genetics TrustEvolution pattern applied to content.


9. Conclusion

The stoichiometric mass sort demonstrates that information-theoretic measurements compose naturally from existing ecosystem primitives. We didn’t invent new math — Shannon entropy (1948), Blake3 hashing (2020), and PROV-O attribution (W3C 2013) are established tools. The contribution is recognizing that:

  1. Pages are entities in the same sense that membrane traffic entities are classified by scan-sweep-sort
  2. Content has measurable mass via Shannon entropy, and that mass is stable under re-sorting
  3. The organism’s immune system works on itself — bearDog genetics applied inward produces a self-taxonomy

The tool runs in under a second for 443 pages. It requires no external services, no API keys, no cloud. A sovereign sort for sovereign content.


References

  • Shannon, C.E. (1948). “A Mathematical Theory of Communication.” Bell System Technical Journal, 27(3), 379–423.
  • O’Connor, J. et al. (2020). “BLAKE3: One function, fast everywhere.” Specification and reference implementation.
  • W3C (2013). “PROV-O: The PROV Ontology.” W3C Recommendation.
  • Credit: Sollimann for bonsai-bt behavioral tree architecture.
  • ecoPrimals Authorship: Kevin Mok / Tamison / ecoPrimal / attsi, ORCID 0009-0004-2141-0321.
🔥 The mirror asks back — what did you see?

Anonymous. No names, no IPs, no sessions. Just words and the shape they make.