sheaf-cohomology

sheaf-cohomology is a skill for Codex from plurigrid/asi. It costs 24 tokens per session (1,615 once invoked), scanned A, original, MIT.

A mathematical checker for verifying that locally consistent code patches and data schemas combine into one consistent whole.

In plain words
What is it for?
It is for checking consistency across code modules, file patches, and data schemas.
Why use it?
It helps find problems that only appear when separate files or modules are joined together.

Skill for Codex

Written for Codex: installed under .codex/.

Good fit It is for checking consistency across code modules, file patches, and data schemas.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plurigrid/asi/sheaf-cohomology
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add plurigrid/asi --skill sheaf-cohomology
Clone the repo
git clone --depth 1 https://github.com/plurigrid/asi

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sheaf-cohomology

README.md
[![agentmods](https://agentmods.dev/badge/skills/plurigrid/asi/sheaf-cohomology/github.svg)](https://agentmods.dev/skills/plurigrid/asi/sheaf-cohomology)
Your own site
<a href="https://agentmods.dev/skills/plurigrid/asi/sheaf-cohomology"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/sheaf-cohomology/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sheaf-cohomology

Your own site · 80×15
<a href="https://agentmods.dev/skills/plurigrid/asi/sheaf-cohomology"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/sheaf-cohomology.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,615 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.01615
Opus 5 $0.00012 $0.00807
Sonnet 5 $0.00005 $0.00323
Haiku 4.5 $0.00002 $0.00161

Measured 8d ago against content hash 57633a06840c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

sheaf-cohomology scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ies/music-topos/.codex/skills/sheaf-cohomology/SKILL.md · 211 lines

How it starts

The opening of the file, as written. The whole thing — 211 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sheaf Cohomology Skill: Local-to-Global Verification

Status: ✅ Production Ready Trit: -1 (MINUS - validator/constraint) Color: #2626D8 (Blue) Principle: Local consistency → Global correctness Frame: Čech cohomology with descent conditions


Overview

Sheaf Cohomology validates that locally consistent data/code patches glue correctly into globally consistent structures. Uses:

  1. Čech cohomology: H^n(U, F) obstruction classes
  2. Nerve of coverage: N(U) simplicial complex from open cover
  3. Descent conditions: Cocycle conditions for morphisms
  4. tree-sitter integration: AST-level local consistency

Correct by construction: If local patches satisfy cocycle conditions, global structure is guaranteed.

Core Formula

H⁰(U, F) = ker(d⁰)           # Global sections (agree everywhere)
H¹(U, F) = ker(d¹)/im(d⁰)    # Obstruction to gluing
H²(U, F) = ker(d²)/im(d¹)    # Higher obstructions

For code verification:

# Three patches (files/modules) are consistent iff:
# On U_ij ∩ U_jk ∩ U_ik: g_ij ∘ g_jk = g_ik  (cocycle condition)

cocycle_satisfied?(patch_i, patch_j, patch_k)
  == (compose(g_ij, g_jk) == g_ik)

Why Sheaf Cohomology for Code?

  1. Module boundaries: Each module is an "open set"
  2. Import/export: Transition functions between patches
  3. Type consistency: Cocycle = type compatibility
  4. Refactoring safety: H¹ = 0 means safe global transform

Gadgets

1. ČechCoverVerifier

Verify local consistency across code patches:

verifier = SheafCohomology::CechCoverVerifier.new(
  coverage: [:module_a, :module_b, :module_c]
)
verifier.add_transition(:module_a, :module_b, transition_ab)
verifier.add_transition(:module_b, :module_c, transition_bc)
verifier.add_transition(:module_a, :module_c, transition_ac)

verifier.cocycle_satisfied?  # => true if g_ab ∘ g_bc = g_ac
verifier.h1_obstruction      # => 0 if globally consistent

2. NerveConstructor

Build simplicial complex from coverage:

Read the full file on GitHub · 211 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 211 lines · 24 tokens per session scan A 57633a06840c

Subscribe to this mod's changes

sheaf-cohomology is a skill published in the GitHub repository plurigrid/asi (62 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 1,615 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.