sheaf-bind
The port. Everything above this skill is domain-blind. Everything below it
is a product skin.
This skill does not glue, repair, Morse-reduce, or commit. It emits F
as a site + typed sheaf so sheaf-kernel can occupy the cover.
Types live in src/sheaf_port/types.py. Schema lives in
schemas/domain.package.yaml. Profiles live in profiles/.
Conserved quantity
Cell identity and observed incidence. A cell without a locator is not a cell.
An edge that was not seen in the source is not an overlap. Free text is
evidence about a stalk, never the stalk.
Input
A domain.package.yaml that fills DomainPackage:
id: <domain-id>
cells_from: <locator rule>
cover_from: <incidence rule>
stalk_schema: [<typed field names>]
shared_fields: [<fields glue will compare>]
mediators: [<nuisance interiors repair may quotient>]
critical_lenses: [<deterministic oracles>]
soft_lenses: [<judges>]
oracle: <executable command>
grain: <symbol | claim | edge | holding | custom>
grain_min: 2
grain_max: 10000
min_observed_edges: 1
three_sheaves:
knowledge: <what memory tracks>
capability: <what Φ commits>
conservation: <what the loop conserves>
forbidden:
- train_restriction_maps
- accept_on_H1
- treat_embedding_as_stalk
- invent_edges
shared_fields must be a non-empty subset of stalk_schema.
Embeddings, prose, and RAG chunks belong in Stalk.evidence, never in
shared_fields.
Output
A Sheaf:
cells[id] = Cell(id, kind, locator) — locator is a resolvable source address
stalks[id] = Stalk(cell_id, fields, g_v, evidence, sheaf_role) — fields
keys ⊆ stalk_schema
edges — only observed=True; shared_fields copied from the package
schema — the package stalk_schema
package_id, cover_generation = 0, morse_core = None
Restriction on an edge vw is the field projection
ρ(s) = { k: s.fields[k] for k in edge.shared_fields }
Functoriality is required on the cover poset: composing two projections is
the projection onto the deeper shared fields. Bind must not invent a ρ that
is not a projection.
Workflow
- Load and validate the package (
load_package / validate_package).
- Walk the source with
cells_from. Reject any candidate missing a locator.
- Walk the source with
cover_from. Keep an edge only with a cited incidence
(import, call, wikilink, FK, citation, adjacency, shared declared field).
- Allocate typed stalks. Put prose, summaries, embeddings in
evidence.
- Check grain:
grain_min ≤ |cells| ≤ grain_max and |edges| ≥ min_observed_edges.
- Emit
F. Hand it to sheaf-kernel. Do not run Φ here.
Hard rules
- Free text is not a stalk. A README paragraph, docstring, RAG chunk, or
tweet-length summary is evidence. BindError if it is placed in
fields.
- Do not invent edges. Complete-graph “to be safe” is domain leak (A4).
- Empty
shared_fields fails bind. Glue would have nothing exact to check.
- Embeddings are a soft lens on the knowledge sheaf. They are never a
shared field of the capability sheaf.
- L-C-O-P-V is a CETI profile, not a kernel constant. A codebase profile
uses
{path, symbol, apiRevision} (and friends). A wiki profile uses
{claimId, sourceId}. Do not force five CETI vertices onto a foreign site.
- A port is a functor. Restriction after transport equals transport of
restriction. If the adapter drops a shared field, Φ on the image is not
Φ on the source — refuse the package.
- Cover change increments
cover_generation and invalidates morse_core.
- Three sheaves stay apart. Knowledge-sheaf consistency is not capability Φ.
- Bind does not run the oracle. Glue does. Bind only records
oracle.
MUST NOT
- Treat a vector store as a cover.
- Train ρ, or emit a learned map in place of a field projection.
- Reuse stalks from package A on package B without an explicit restriction
(tell-apart / A12).
- Call the bind “ported” without a
sheaf-adversary battery log.
- Special-case CETI inside this skill. CETI occupies the loop after a
domain is bound.
Worked profiles
| Package |
Cells |
Cover |
Shared fields |
Oracle |
profiles/codebase.yaml |
symbols |
import + call graph |
path, symbol, apiRevision |
test runner |
profiles/wiki.yaml |
claims |
wikilink + backlink |
claimId, sourceId |
link checker |
profiles/kg.yaml |
typed edges |
incident schema edges |
src, rel, dst |
schema validator |
profiles/corpus.yaml |
holdings |
citation / issue graph |
holdingId, authority, pinpoint |
citation resolver |
Grain failures:
- Too coarse: two independent contracts share one cell → false Φ failure.
- Too fine: every sentence is a cell → Morse core explodes.
Bind records both as failed ports until grain is stable. That is attack L.
Requires
A source the locator schema can address, and a domain.package.yaml.
A bag of unrelated blobs is not a domain.
On failure
Raise BindError with the attack id when one applies (A1 false stalk, A4
invented edge, A12 identity collision, L grain). Do not emit a partial sheaf
and hope glue will catch it. Bind is the gate that keeps free-text out of Φ.
Compose
/sheaf-port <domain.package.yaml>
│
▼
sheaf-bind this skill
│
▼
sheaf-kernel type the cover; confirm overlaps against the source
sheaf-localize ∥ sheaf-preserve
│
▼
sheaf-morse reduce before Tailor when |X| is large
sheaf-glue ⇄ sheaf-repair
noether-harness dual-loop runtime
Eval: sheaf-adversary. A domain is ported only after the battery log.
Honesty
Present bind as a runtime-checked functor plus oracles, not a theorem
that any dataset is a sheaf. Batruin’s discovery gate failed. Φ is a
contract on the bound sheaf, not a claim about the sampler. This skill
implements the adapter surface, not a cohomological lift of SWE-bench.
1---2name: sheaf-bind3description: Domain adapter for sheaf-port. Turn an interconnected source (repo, wiki, knowledge graph, corpus, sensor/dep graph) into a finite cellular sheaf: cells with locators, typed stalks, restriction as field projection, observed incidence only. The only domain-specific surface in the plugin. Use when the user says bind this repo, bind this wiki, instantiate a knowledge sheaf, port the harness onto a domain, or supplies a domain.package.yaml. Trigger on "sheaf-bind", "/sheaf-port", "domain package", "typed stalks", "free-text is not a stalk", "observed incidence".4---56# sheaf-bind78The **port**. Everything above this skill is domain-blind. Everything below it9is a product skin.1011This skill does **not** glue, repair, Morse-reduce, or commit. It emits `F`12as a site + typed sheaf so `sheaf-kernel` can occupy the cover.1314Types live in `src/sheaf_port/types.py`. Schema lives in15`schemas/domain.package.yaml`. Profiles live in `profiles/`.1617## Conserved quantity1819Cell identity and observed incidence. A cell without a locator is not a cell.20An edge that was not seen in the source is not an overlap. Free text is21evidence *about* a stalk, never the stalk.2223## Input2425A `domain.package.yaml` that fills `DomainPackage`:2627```yaml28id: <domain-id>29cells_from: <locator rule>30cover_from: <incidence rule>31stalk_schema: [<typed field names>]32shared_fields: [<fields glue will compare>]33mediators: [<nuisance interiors repair may quotient>]34critical_lenses: [<deterministic oracles>]35soft_lenses: [<judges>]36oracle: <executable command>37grain: <symbol | claim | edge | holding | custom>38grain_min: 239grain_max: 1000040min_observed_edges: 141three_sheaves:42 knowledge: <what memory tracks>43 capability: <what Φ commits>44 conservation: <what the loop conserves>45forbidden:46 - train_restriction_maps47 - accept_on_H148 - treat_embedding_as_stalk49 - invent_edges50```5152`shared_fields` must be a non-empty subset of `stalk_schema`.53Embeddings, prose, and RAG chunks belong in `Stalk.evidence`, never in54`shared_fields`.5556## Output5758A `Sheaf`:5960- `cells[id] = Cell(id, kind, locator)` — locator is a resolvable source address61- `stalks[id] = Stalk(cell_id, fields, g_v, evidence, sheaf_role)` — `fields`62 keys ⊆ `stalk_schema`63- `edges` — only `observed=True`; `shared_fields` copied from the package64- `schema` — the package `stalk_schema`65- `package_id`, `cover_generation = 0`, `morse_core = None`6667Restriction on an edge `vw` is the field projection6869```70ρ(s) = { k: s.fields[k] for k in edge.shared_fields }71```7273Functoriality is required on the cover poset: composing two projections is74the projection onto the deeper shared fields. Bind must not invent a ρ that75is not a projection.7677## Workflow78791. Load and validate the package (`load_package` / `validate_package`).802. Walk the source with `cells_from`. Reject any candidate missing a locator.813. Walk the source with `cover_from`. Keep an edge only with a cited incidence82 (import, call, wikilink, FK, citation, adjacency, shared declared field).834. Allocate typed stalks. Put prose, summaries, embeddings in `evidence`.845. Check grain: `grain_min ≤ |cells| ≤ grain_max` and `|edges| ≥ min_observed_edges`.856. Emit `F`. Hand it to `sheaf-kernel`. Do not run Φ here.8687## Hard rules88891. Free text is not a stalk. A README paragraph, docstring, RAG chunk, or90 tweet-length summary is evidence. BindError if it is placed in `fields`.912. Do not invent edges. Complete-graph “to be safe” is domain leak (A4).923. Empty `shared_fields` fails bind. Glue would have nothing exact to check.934. Embeddings are a soft lens on the knowledge sheaf. They are never a94 shared field of the capability sheaf.955. L-C-O-P-V is a CETI profile, not a kernel constant. A codebase profile96 uses `{path, symbol, apiRevision}` (and friends). A wiki profile uses97 `{claimId, sourceId}`. Do not force five CETI vertices onto a foreign site.986. A port is a functor. Restriction after transport equals transport of99 restriction. If the adapter drops a shared field, Φ on the image is not100 Φ on the source — refuse the package.1017. Cover change increments `cover_generation` and invalidates `morse_core`.1028. Three sheaves stay apart. Knowledge-sheaf consistency is not capability Φ.1039. Bind does not run the oracle. Glue does. Bind only records `oracle`.104105## MUST NOT106107- Treat a vector store as a cover.108- Train ρ, or emit a learned map in place of a field projection.109- Reuse stalks from package A on package B without an explicit restriction110 (tell-apart / A12).111- Call the bind “ported” without a `sheaf-adversary` battery log.112- Special-case CETI inside this skill. CETI occupies the loop *after* a113 domain is bound.114115## Worked profiles116117| Package | Cells | Cover | Shared fields | Oracle |118|---|---|---|---|---|119| `profiles/codebase.yaml` | symbols | import + call graph | path, symbol, apiRevision | test runner |120| `profiles/wiki.yaml` | claims | wikilink + backlink | claimId, sourceId | link checker |121| `profiles/kg.yaml` | typed edges | incident schema edges | src, rel, dst | schema validator |122| `profiles/corpus.yaml` | holdings | citation / issue graph | holdingId, authority, pinpoint | citation resolver |123124Grain failures:125126- Too coarse: two independent contracts share one cell → false Φ failure.127- Too fine: every sentence is a cell → Morse core explodes.128 Bind records both as failed ports until grain is stable. That is attack L.129130## Requires131132A source the locator schema can address, and a `domain.package.yaml`.133A bag of unrelated blobs is not a domain.134135## On failure136137Raise `BindError` with the attack id when one applies (A1 false stalk, A4138invented edge, A12 identity collision, L grain). Do not emit a partial sheaf139and hope glue will catch it. Bind is the gate that keeps free-text out of Φ.140141## Compose142143```144/sheaf-port <domain.package.yaml>145 │146 ▼147 sheaf-bind this skill148 │149 ▼150 sheaf-kernel type the cover; confirm overlaps against the source151 sheaf-localize ∥ sheaf-preserve152 │153 ▼154 sheaf-morse reduce before Tailor when |X| is large155 sheaf-glue ⇄ sheaf-repair156 noether-harness dual-loop runtime157```158159Eval: `sheaf-adversary`. A domain is ported only after the battery log.160161## Honesty162163Present bind as a **runtime-checked functor plus oracles**, not a theorem164that any dataset is a sheaf. Batruin’s discovery gate failed. Φ is a165contract on the bound sheaf, not a claim about the sampler. This skill166implements the adapter surface, not a cohomological lift of SWE-bench.