spec 1.0 · normativo

Índice del contexto de Leji

Traducción asistida por agentes de IA. Ante cualquier diferencia, prevalece la página en inglés. Si encuentra algún problema en el texto, abra un issue o envíe un pull request.

Mapa generado de la capa de contexto. Nunca se mantiene a mano; regenérelo con cada cambio.

$id canónico: https://leji.org/schemas/v1.0/context-index.schema.json
Archivo original: context-index.schema.json

Campos

#schemaVersionstringobligatorio

La línea de especificación de Leji contra la que se escribió este artefacto, por ejemplo "1.0".

Patrón ^\d+\.\d+$

#generatedAtstringobligatorio

Marca de tiempo ISO 8601 del momento en que se generó el índice.

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

#generatorobject

La herramienta que generó este índice.

namestring

Nombre de la herramienta generadora, por ejemplo "leji".

versionstring

Versión de la herramienta generadora.

#rootPathstringobligatorio

La raíz de la capa de contexto para la que se generó este índice; refleja el rootPath del manifiesto. Las rutas de las entradas son relativas a la raíz del repositorio, no se recalculan a partir de ella.

Patrón ^(?!/)(?!\./)(?!.*(^|/)\.\.(/|$))(?!.*\\).*$

#entriesarray de objetosobligatorio

Una entrada por cada documento indexado de la capa de contexto. Los valores de id y de path son únicos en el conjunto de entradas; el validador de referencia impone esta unicidad (JSON Schema no puede, porque la restricción recae sobre un subcampo y no sobre el objeto entero).

idstringobligatorio

Identificador estable; los cambios de nombre y los traslados actualizan la ruta, nunca el id.

pathstringobligatorio

Ruta al documento, relativa a la raíz del repositorio.

titlestringobligatorio

Título legible por personas, tomado del primer encabezado del documento o de su frontmatter.

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

A qué categoría de contenido pertenece este documento.

kind"intent" · "record"

Si el documento es verdad presente mantenida (intent) o evidencia fechada (record). Si falta, se entiende intent.

datestring

La fecha de un registro, tomada únicamente de un campo date válido del frontmatter.

summarystring

Resumen en una línea del documento, para el enrutamiento y la navegación.

tagsarray de cadenas

Etiquetas libres; opcional.

ownersarray de cadenas

Responsables de este documento; opcional.

lastModifiedstring

Fecha ISO 8601 del último cambio del documento, tomada del control de versiones cuando está disponible.

contentHashstring

Hash del contenido del documento, con el que se detectan desviaciones y traslados estables.

freshnessobject

Horizonte de revisión de este documento.

reviewAfterstring

Fecha ISO 8601 a partir de la cual conviene revisar el documento por si está desactualizado.

linksarray de cadenas

Referencias salientes de este documento; opcional.

#mountsarray de objetos

Registros de enrutamiento de las capas de contexto hermanas federadas, derivados de federation.mounts del manifiesto (especificación: distribution.md, machine-readable-surface.md). Son únicamente metadatos de enrutamiento: el utillaje MUST NOT copiar aquí las entradas de índice ni la prosa de una hermana. Un registro de montaje nunca revela nada que la audiencia de la anfitriona no pueda ver.

namestringobligatorio

El nombre de la capa hermana; coincide con el nombre que lleva su propio manifiesto.

sourcestringobligatorio

Localizador de repositorio normalizado de la capa hermana.

pinstringobligatorio

Id de commit completo e inmutable (SHA-1 o SHA-256) de la revisión de la hermana que lee la anfitriona.

trackingRefstring

Referencia testigo completamente cualificada contra la que se comparan la alcanzabilidad y la desactualización, cuando se declara.

ownerobjectobligatorio

El responsable de la capa hermana.

namestringobligatorio
contactstring
rolestring

Descripción en prosa de lo que lleva la hermana.

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

Los ámbitos de categoría de contenido sobre los que esta hermana puede responder.

topicsarray de cadenas

Etiquetas de tema breves para el enrutamiento por relevancia.

requiredWhenarray de cadenas

Condiciones de tarea en las que un lector debe resolver este montaje o fallar en cerrado.

Esquema y ejemplo

{
  "$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
            }
          }
        }
      }
    }
  }
}

Un índice del contexto generado, que la CLI regenera con cada cambio.

{
  "$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": "Adoptar la capa de contexto Leji",
      "category": "decisions",
      "kind": "record",
      "date": "2026-06-10",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:9680ba24ad268894"
    },
    {
      "id": "glossary",
      "path": "docs/domain/glossary.md",
      "title": "Glosario",
      "category": "domain",
      "kind": "intent",
      "summary": "Qué significan invoice, credit note y settlement en Acme.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:22d9bcc4fe0ce860"
    },
    {
      "id": "system-invariants",
      "path": "docs/system/invariants.md",
      "title": "Invariantes del sistema",
      "category": "system",
      "kind": "intent",
      "summary": "Manejo del dinero, regla de solo anexión del libro mayor, fronteras entre servicios.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:6e179b4fa71bd5ad",
      "freshness": {
        "reviewAfter": "2026-12-10"
      }
    }
  ]
}

← Todos los esquemas