spec 1.0 · normative

Leji context index

Generated map of the context layer. Never hand-maintained; regenerate on change.

Canonical $id:https://leji.org/schemas/v1.0/context-index.schema.json
Raw file:context-index.schema.json

Fields

#schemaVersionstringrequired

The Leji spec line this artifact was written against, e.g. "1.0".

Pattern ^\d+\.\d+$

#generatedAtstringrequired

ISO 8601 timestamp when the index was generated.

Pattern ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])[T ].+$

#generatorobject

The tool that generated this index.

namestring

Name of the generating tool, e.g. "leji".

versionstring

Version of the generating tool.

#rootPathstringrequired

The context layer root this index was generated for; mirrors the manifest's rootPath. Entry paths are repository-root-relative, not re-based under it.

Pattern ^(?!/)(?!\./)(?!.*(^|/)\.\.(/|$))(?!.*\\).*$

#entriesarray of objectsrequired

One entry per indexed document in the context layer. Each `id` and each `path` is unique across entries; the reference validator enforces this (JSON Schema cannot, since the constraint is on a sub-field, not the whole object).

idstringrequired

Stable identifier; renames and moves update the path, never the id.

pathstringrequired

Repository-root-relative path to the document.

titlestringrequired

Human-readable title, from the document's first heading or frontmatter.

category"domain" · "system" · "practice" · "governance" · "decisions"required

Which content category this document belongs to.

kind"intent" · "record"

Whether the document is maintained present truth (intent) or dated evidence (record). Absent means intent.

datestring

A record's date, sourced only from valid frontmatter date.

summarystring

One-line summary of the document, for routing and navigation.

tagsarray of strings

Optional free-form tags.

ownersarray of strings

Optional owners of this document.

lastModifiedstring

ISO 8601 date the document last changed, from version control where available.

contentHashstring

Hash of the document's contents, used to detect drift and stable moves.

freshnessobject

Review horizon for this document.

reviewAfterstring

ISO 8601 date after which the document should be reviewed for staleness.

linksarray of strings

Optional outbound references from this document.

#mountsarray of objects

Routing records for federated sibling context layers, derived from the manifest's federation.mounts (spec: distribution.md, machine-readable-surface.md). Routing metadata only: tooling MUST NOT copy a sibling's index entries or prose here. A mount record never discloses what the host's audience may not see.

namestringrequired

The sibling layer's name; matches the name in the sibling's own manifest.

sourcestringrequired

Normalized repository locator of the sibling layer.

pinstringrequired

Full immutable commit id (SHA-1 or SHA-256) of the sibling revision the host reads.

trackingRefstring

Fully qualified witness ref reachability and staleness are compared against, when declared.

ownerobjectrequired

The owner of the sibling layer.

namestringrequired
contactstring
rolestring

Prose description of what the sibling carries.

categoriesarray of "domain" · "system" · "practice" · "governance" · "decisions"

Content-category scopes this sibling can answer for.

topicsarray of strings

Short topic labels for relevance routing.

requiredWhenarray of strings

Task conditions under which a reader must resolve this mount or fail closed.

Schema and example

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://leji.org/schemas/v1.0/context-index.schema.json",
  "title": "Leji context index",
  "description": "Generated map of the context layer. Never hand-maintained; regenerate on change.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "rootPath",
    "entries"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "Optional pointer to this schema, for editor validation and tooling.",
      "type": "string"
    },
    "schemaVersion": {
      "description": "The Leji spec line this artifact was written against, e.g. \"1.0\".",
      "type": "string",
      "pattern": "^\\d+\\.\\d+$"
    },
    "generatedAt": {
      "description": "ISO 8601 timestamp when the index was generated.",
      "type": "string",
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])[T ].+$"
    },
    "generator": {
      "description": "The tool that generated this index.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "description": "Name of the generating tool, e.g. \"leji\".",
          "type": "string"
        },
        "version": {
          "description": "Version of the generating tool.",
          "type": "string"
        }
      }
    },
    "rootPath": {
      "description": "The context layer root this index was generated for; mirrors the manifest's rootPath. Entry paths are repository-root-relative, not re-based under it.",
      "type": "string",
      "pattern": "^(?!/)(?!\\./)(?!.*(^|/)\\.\\.(/|$))(?!.*\\\\).*$"
    },
    "entries": {
      "description": "One entry per indexed document in the context layer. Each `id` and each `path` is unique across entries; the reference validator enforces this (JSON Schema cannot, since the constraint is on a sub-field, not the whole object).",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "path",
          "title",
          "category"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "Stable identifier; renames and moves update the path, never the id.",
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
          },
          "path": {
            "description": "Repository-root-relative path to the document.",
            "type": "string",
            "pattern": "^(?!/)(?!\\./)(?!.*(^|/)\\.\\.(/|$))(?!.*\\\\).+$"
          },
          "title": {
            "description": "Human-readable title, from the document's first heading or frontmatter.",
            "type": "string",
            "minLength": 1
          },
          "category": {
            "description": "Which content category this document belongs to.",
            "enum": [
              "domain",
              "system",
              "practice",
              "governance",
              "decisions"
            ]
          },
          "kind": {
            "description": "Whether the document is maintained present truth (intent) or dated evidence (record). Absent means intent.",
            "enum": [
              "intent",
              "record"
            ]
          },
          "date": {
            "description": "A record's date, sourced only from valid frontmatter date.",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
            "type": "string"
          },
          "summary": {
            "description": "One-line summary of the document, for routing and navigation.",
            "type": "string"
          },
          "tags": {
            "description": "Optional free-form tags.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "description": "Optional owners of this document.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lastModified": {
            "description": "ISO 8601 date the document last changed, from version control where available.",
            "type": "string",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])([T ].*)?$"
          },
          "contentHash": {
            "description": "Hash of the document's contents, used to detect drift and stable moves.",
            "type": "string"
          },
          "freshness": {
            "description": "Review horizon for this document.",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "reviewAfter": {
                "description": "ISO 8601 date after which the document should be reviewed for staleness.",
                "type": "string",
                "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
              }
            }
          },
          "links": {
            "description": "Optional outbound references from this document.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "mounts": {
      "description": "Routing records for federated sibling context layers, derived from the manifest's federation.mounts (spec: distribution.md, machine-readable-surface.md). Routing metadata only: tooling MUST NOT copy a sibling's index entries or prose here. A mount record never discloses what the host's audience may not see.",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "source",
          "pin",
          "owner"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The sibling layer's name; matches the name in the sibling's own manifest.",
            "type": "string",
            "minLength": 1
          },
          "source": {
            "description": "Normalized repository locator of the sibling layer.",
            "type": "string",
            "minLength": 1
          },
          "pin": {
            "description": "Full immutable commit id (SHA-1 or SHA-256) of the sibling revision the host reads.",
            "type": "string",
            "pattern": "^([0-9a-f]{40}|[0-9a-f]{64})$"
          },
          "trackingRef": {
            "description": "Fully qualified witness ref reachability and staleness are compared against, when declared.",
            "type": "string",
            "pattern": "^refs/(heads|tags)/.+$"
          },
          "owner": {
            "description": "The owner of the sibling layer.",
            "type": "object",
            "required": [
              "name"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "contact": {
                "type": "string"
              }
            }
          },
          "role": {
            "description": "Prose description of what the sibling carries.",
            "type": "string"
          },
          "categories": {
            "description": "Content-category scopes this sibling can answer for.",
            "type": "array",
            "items": {
              "enum": [
                "domain",
                "system",
                "practice",
                "governance",
                "decisions"
              ]
            }
          },
          "topics": {
            "description": "Short topic labels for relevance routing.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "requiredWhen": {
            "description": "Task conditions under which a reader must resolve this mount or fail closed.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  }
}

A generated context index, regenerated by the CLI on change.

{
  "$schema": "https://leji.org/schemas/v1.0/context-index.schema.json",
  "schemaVersion": "1.0",
  "generatedAt": "2026-07-31T12:23:37.412Z",
  "generator": {
    "name": "leji",
    "version": "1.3.1"
  },
  "rootPath": "docs/",
  "entries": [
    {
      "id": "adopt-leji",
      "path": "docs/decisions/0001-adopt-leji.md",
      "title": "Adopt the Leji context layer",
      "category": "decisions",
      "kind": "record",
      "date": "2026-06-10",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:9680ba24ad268894"
    },
    {
      "id": "glossary",
      "path": "docs/domain/glossary.md",
      "title": "Glossary",
      "category": "domain",
      "kind": "intent",
      "summary": "What invoice, credit note, and settlement mean at Acme.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:22d9bcc4fe0ce860"
    },
    {
      "id": "system-invariants",
      "path": "docs/system/invariants.md",
      "title": "System Invariants",
      "category": "system",
      "kind": "intent",
      "summary": "Money handling, ledger append-only rule, service boundaries.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:6e179b4fa71bd5ad",
      "freshness": {
        "reviewAfter": "2026-12-10"
      }
    }
  ]
}

← All schemas