spec 1.0 · normativo

Índice de contexto do Leji

Tradução assistida por agentes de IA. Em caso de divergência, prevalece a página em inglês. Se você encontrar algum problema no texto, abra uma issue ou envie um pull request.

Mapa gerado da camada de contexto. Nunca mantido à mão; regenere a cada mudança.

$id canônico: https://leji.org/schemas/v1.0/context-index.schema.json
Arquivo bruto: context-index.schema.json

Campos

#schemaVersionstringobrigatório

A linha da especificação Leji para a qual este artefato foi escrito, por exemplo "1.0".

Padrão ^\d+\.\d+$

#generatedAtstringobrigatório

O timestamp em ISO 8601 de quando o índice foi gerado.

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

#generatorobject

A ferramenta que gerou este índice.

namestring

O nome da ferramenta geradora, por exemplo "leji".

versionstring

A versão da ferramenta geradora.

#rootPathstringobrigatório

A raiz da camada de contexto para a qual este índice foi gerado; espelha o rootPath do manifesto. Os caminhos das entradas são relativos à raiz do repositório e não são recalculados a partir dela.

Padrão ^(?!/)(?!\./)(?!.*(^|/)\.\.(/|$))(?!.*\\).*$

#entriesarray de objetosobrigatório

Uma entrada para cada documento indexado da camada de contexto. Cada id e cada path são únicos entre as entradas; o validador de referência garante isso (o JSON Schema não consegue, porque a restrição recai sobre um subcampo e não sobre o objeto inteiro).

idstringobrigatório

Identificador estável; renomear e mover atualiza o path, nunca o id.

pathstringobrigatório

O caminho até o documento, relativo à raiz do repositório.

titlestringobrigatório

Título legível por pessoas, tirado do primeiro título do documento ou do frontmatter.

category"domain" · "system" · "practice" · "governance" · "decisions"obrigatório

A qual categoria de conteúdo este documento pertence.

kind"intent" · "record"

Se o documento é verdade presente mantida (intent) ou evidência datada (record). Ausente significa intent.

datestring

A data de um record, tirada apenas de uma date válida no frontmatter.

summarystring

Resumo em uma linha do documento, para roteamento e navegação.

tagsarray de strings

Etiquetas livres; opcional.

ownersarray de strings

Os donos deste documento; opcional.

lastModifiedstring

A data em ISO 8601 da última mudança no documento, vinda do controle de versão quando disponível.

contentHashstring

O hash do conteúdo do documento, usado para detectar desvio e movimentações estáveis.

freshnessobject

Horizonte de atualidade deste documento.

reviewAfterstring

Data em ISO 8601 a partir da qual o documento deve ser revisado para ver se está desatualizado.

linksarray de strings

As referências que saem deste documento; opcional.

#mountsarray de objetos

Registros de roteamento para camadas de contexto irmãs federadas, derivados de federation.mounts do manifesto (especificação: distribution.md, machine-readable-surface.md). São apenas metadados de roteamento: o ferramental MUST NOT copiar para cá as entradas de índice nem a prosa de uma irmã. Um registro de mount nunca revela o que o público da hospedeira não pode ver.

namestringobrigatório

O nome da camada irmã; coincide com o nome no manifesto da própria irmã.

sourcestringobrigatório

O localizador de repositório normalizado da camada irmã.

pinstringobrigatório

O id de commit completo e imutável (SHA-1 ou SHA-256) da revisão da irmã que a hospedeira lê.

trackingRefstring

A ref testemunha totalmente qualificada contra a qual a alcançabilidade e a desatualização são comparadas, quando declarada.

ownerobjectobrigatório

O dono da camada irmã.

namestringobrigatório
contactstring
rolestring

Descrição em prosa do que a irmã carrega.

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

Os escopos de categoria de conteúdo que esta irmã pode atender.

topicsarray de strings

Rótulos curtos de tópico para roteamento por relevância.

requiredWhenarray de strings

As condições de tarefa em que quem lê precisa resolver este mount ou então falhar fechado.

Schema e exemplo

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

Um índice de contexto gerado, que a CLI regenera a cada mudança.

{
  "$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": "Adotar a camada 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": "Glossário",
      "category": "domain",
      "kind": "intent",
      "summary": "O que invoice, credit note e settlement significam na Acme.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:22d9bcc4fe0ce860"
    },
    {
      "id": "system-invariants",
      "path": "docs/system/invariants.md",
      "title": "Invariantes do sistema",
      "category": "system",
      "kind": "intent",
      "summary": "Tratamento de dinheiro, regra de somente acréscimo do livro-razão, fronteiras entre serviços.",
      "lastModified": "2026-06-17",
      "contentHash": "sha256:6e179b4fa71bd5ad",
      "freshness": {
        "reviewAfter": "2026-12-10"
      }
    }
  ]
}

← Todos os schemas