# Engram knowledge layer

Source: https://usecns.dev/knowledge/

The documentation is also an **Engram Tier 1 knowledge layer**, following [Engram's Knowledge Layer Interoperability Contract (repository access may be required)](https://github.com/ivannovak/engram/blob/main/docs/KNOWLEDGE-LAYER-CONTRACT.md), §2.1–2.5. Both the human plates and the knowledge export are built from the same registry, contract document, CLI help and six curated [organ manuals and command references](https://usecns.dev/manuals/).

The upstream contract link may require repository access. The public interface and hydration instructions below are self-contained; source access is not required to inspect this site's manifest or download its bundle. Bundle-internal links use Markdown filenames and page-level destinations, not HTML section anchors. References to pages outside the bundle are explicitly marked website-only and are not offline links.

## Reading formats and discovery

Human pages use canonical `/<existing-slug>/` URLs (the homepage remains `/`). Old `.html` links redirect: GitHub Pages uses static meta-refresh plus JavaScript, with query strings and fragments preserved by JavaScript; Cloudflare uses generated 301 rules. Shared assets and browser search work from directory pages and project subpaths.

For reading without hydration, every non-search page has a general-purpose `<slug>.md` twin, with `index.md` for the homepage. Use **Read as Markdown** or the page's `text/markdown` alternate link. **For agents** links provide orientation through [llms.txt](https://usecns.dev/llms.txt); [sitemap.md](https://usecns.dev/sitemap.md) is the complete non-search index and [discovery.json](https://usecns.dev/discovery.json) catalogs both formats. These are explicit static URLs, not `Accept` content negotiation or a GitHub Pages runtime/MCP endpoint. All formats use the same approved public sources and retain the same source-access and publication boundaries.

These reading twins are **not the Engram seed bundle**. The separate `/knowledge/*.md` plates, manifest and `knowledge.zip` retain their stable keys, authority and hydration behavior; general reading pages do not become new compartments or memories automatically.

Canonical URLs, descriptions, social metadata, honest `TechArticle` JSON-LD, an XML sitemap and robots guidance are search-engine foundations; search itself is `noindex`. Markdown and agent discovery are optional conveniences. Google does not require `llms.txt`, Markdown or special AI schema for its AI features, and these formats promise neither rankings nor citations.

## Table K.1 · Published interfaces

| Interface | GitHub Pages | Cloudflare Pages |
| --- | --- | --- |
| [compartments.json](https://usecns.dev/knowledge/compartments.json) | Static manifest | Same static manifest |
| [Knowledge bundle](https://usecns.dev/knowledge.zip) | Downloadable Markdown directory | Same bundle |
| [Current keys](https://usecns.dev/knowledge/keys.json) | Publisher's current key inventory | Same inventory |
| `POST /knowledge` | Not supported by a static host | Read-only JSON-RPC pull tools |

The four compartments are `cns:docs:organ`, `cns:docs:contract`, `cns:docs:cli` and `cns:docs:guide`. All target **M2**, with explicit **curated\_knowledge** authority and stable `cns-docs-*` keys. Organ and contract plates use `architecture`; CLI and setup instructions use `procedure`. Navigation pages are not hydrated. No `> complete:` endorsement, no compiled guard and no claim of fleet canon is emitted.

The Tier 1 contract keeps these exports explicit: level-2 headings carry section keys, kind and authority (§2.1); entity identifiers must survive in any summary and injected wrappers are stripped (§2.2); vocabulary is exact, not inferred aliases (§2.3). This publisher uses heading tags rather than requiring a front-matter mapping (§2.4). The manifest lists literal relative page paths and hydration targets (§2.5); compartment names do not create isolated storage rings.

## Listing K.1 · Consumer setup: use the static bundle

This is the recommended consumer path on either host. It needs **no Cloudflare account, API token, proxy or source checkout**. You need an installed Engram CLI with `conformance` and `sync hydrate-knowledge` support, an OTE you control, and write access to the intended local store. Obtaining that CLI is separate from downloading this website's bundle; see the [distribution limitations](https://usecns.dev/install/).

1. Download the [knowledge bundle](https://usecns.dev/knowledge.zip) and unzip it into a local directory.
2. Locate `compartments.json` in the unpacked files. Use its containing directory as `/path/to/unpacked-knowledge` below; keep the manifest and Markdown pages together.
3. Review the OTE's M2 mount and use an isolated test store first. Run conformance before hydration, then inspect the resulting memories before using the same procedure in your working store.

```
engram conformance /path/to/unpacked-knowledge --ote /path/to/ote.toml
engram sync hydrate-knowledge --knowledge-dir /path/to/unpacked-knowledge \
  --ote /path/to/ote.toml
```

This bundle contains **public documentation**. Use a repository-scoped M2 mount in the OTE, or an explicit `--ring-id`, to keep its memories in the intended repository context rather than mixing unrelated projects in shared `repo:default`. A compartment name does **not** isolate ring storage. If you later use this workflow for private material, ring selection also determines which seats can recall it. The publisher never writes to your Engram store.

## Listing K.2 · Optional consumer path: Cloudflare pull API

Only use this path when the publisher has deployed a Cloudflare endpoint. **This GitHub Pages deployment does not provide `POST /knowledge`; use the static bundle here.** Engram 1.6.2 adds direct HTTPS hub transport. On a compatible CLI, substitute the publisher's actual endpoint in this example; the example hostname is not a running service.

The static bundle does not depend on this API. `POST /knowledge` implements `tools/call` for `list_knowledge_compartments` (optional `ring_filter`) and `read_knowledge_page` (`compartment_id`, `page`), returning MCP text content with the contract's `compartments` or `content_markdown` shape. It serves only listed pages, not Tier 2 fact storage, Tier 3 fact sync or JIT synthesis.

```
# Engram 1.6.2+; replace this with a deployed publisher's actual endpoint.
engram sync hydrate-knowledge --hub-url https://docs.example/knowledge \
  --ote /path/to/ote.toml
```

**Version boundary:** [Engram 1.6.2 (repository access may be required)](https://github.com/ivannovak/engram/releases/tag/v1.6.2) adds HTTPS support for hydration and conformance, with certificate validation. Earlier clients need the static bundle or a separately operated trusted local TLS proxy. Never send a bearer token over public plain HTTP or disable certificate validation. The release and upstream transport tests establish this version boundary; this website does not claim a live Cloudflare deployment or end-to-end validation of one.

If the publisher requires bearer authentication, obtain the token through their authorized channel and set `ENGRAM_HUB_TOKEN` locally without putting it in tracked files. A token is not needed for the public static bundle.

## Publisher note · Optional Cloudflare deployment and authentication

Cloudflare-specific setup belongs to the publisher, not a bundle consumer. A Cloudflare deployment uses `functions/knowledge.js` for `POST /knowledge`; set the deployment's `KNOWLEDGE_TOKEN` secret if bearer authentication is required. This protects the RPC endpoint **only**, not downloadable assets or human pages. Protect the whole site separately if its content is private. A private source repository is not site access control. None of these settings is required to consume the static manifest and bundle.

## Note K.1 · Update semantics and retirement

Engram hashes each page's exact bytes for its anchor pin when no snapshot pin is supplied. Supersession follows the compiled section's content-addressed identity (ring, key, kind and body), not the pin alone (§2.5). Rebuilding unchanged documentation produces identical knowledge pages; re-hydrating unchanged active sections creates no duplicate memories. Changing a section's body keeps its stable key and supersedes that key's old node on the next hydrate; restoring superseded content reactivates its existing node. Each organ command, task guide and interface entry is a separate page, so updating one command does not replace an entire manual memory. Upstream commit-only observations stay in publication metadata; they do not change the reading pages or mint new knowledge. Updating approved prose updates the corresponding stable memory.

Hydration alone does **not** retire removed keys. Keep the previous `keys.json` when updating a consumer; compare it with the current inventory and explicitly supersede removed keys in the same store and ring. This site has no authority to mutate downstream stores automatically. Only share compartments with seats intended to see all of that documentation.