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

# schemaVersion string required

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

Pattern ^\d+\.\d+$

# generatedAt string required

ISO 8601 timestamp when the index was generated.

Pattern ^\d{4}-\d{2}-\d{2}[T ].+$

# generator object

The tool that generated this index.

name string

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

version string

Version of the generating tool.

# rootPath string required

Context root the entries are relative to; mirrors the manifest's rootPath.

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

# entries array of objects required

One entry per indexed document in the context layer.

id string required

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

path string required

Repository-root-relative path to the document.

title string required

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.

summary string

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

tags array of strings

Optional free-form tags.

owners array of strings

Optional owners of this document.

lastModified string

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

contentHash string

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

freshness object

Review horizon for this document.

reviewAfter string

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

links array of strings

Optional outbound references from this document.

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}-\\d{2}-\\d{2}[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": "Context root the entries are relative to; mirrors the manifest's rootPath.",
      "type": "string",
      "pattern": "^(?!/)(?!\\./)(?!.*(^|/)\\.\\.(/|$))(?!.*\\\\).*$"
    },
    "entries": {
      "description": "One entry per indexed document in the context layer.",
      "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"
            ]
          },
          "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}-\\d{2}-\\d{2}([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}-\\d{2}-\\d{2}$"
              }
            }
          },
          "links": {
            "description": "Optional outbound references from this document.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}

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

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

← All schemas