spec 1.0 · 規範

Leji 決定記録のフロントマター

AI エージェントの支援による翻訳です。内容に相違がある場合は、英語版ページが優先されます。文章に問題を見つけた際は、Issueまたはプルリクエストをお願いします。

決定記録の YAML フロントマターを検証します。markdown の本文が、文脈と決定と帰結を散文で担います。

正規の $idhttps://leji.org/schemas/v1.0/decision-record.schema.json
生ファイル:decision-record.schema.json

フィールド

#idstring必須

この決定の安定した識別子です。たとえば "adopt-leji"。

パターン ^[a-z0-9]+(-[a-z0-9]+)*$

#titlestring必須

決定の短いタイトルです。

#status"proposed" · "accepted" · "superseded" · "deprecated" · "rejected"必須

決定のライフサイクル上の状態です。

#datestring必須

決定が下された日付(ISO 8601)です。いったん公開されたら不変であり、後から状態が変わってもこの日付は動きません。

パターン ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

#deciders文字列の配列

その決定を下した人たちです。

#supersedesstring

この決定が置き換える記録の id です。

#supersededBystring

この記録を置き換えた記録の id です。status が "superseded" のときは必須(REQUIRED)です。置き換えられた記録は後継を指していなければならず、そうすることで置き換えのつながりを双方向にたどれます。

#affectedPaths文字列の配列

その決定が影響するパスです。リポジトリルートからの相対で指定します。

#affectedCategories"domain" · "system" · "practice" · "governance" · "decisions" の配列

その決定が影響するコンテンツカテゴリです。

外向きの参照です。たとえば関連する決定や issue へのもの。任意です。

スキーマと実例

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://leji.org/schemas/v1.0/decision-record.schema.json",
  "title": "Leji decision record frontmatter",
  "description": "Validates the YAML frontmatter of a decision record. The markdown body carries context, decision, and consequences in prose.",
  "type": "object",
  "required": [
    "id",
    "title",
    "status",
    "date"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Stable identifier for this decision, e.g. \"adopt-leji\".",
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
    },
    "title": {
      "description": "Short title of the decision.",
      "type": "string",
      "minLength": 1
    },
    "status": {
      "description": "Lifecycle status of the decision.",
      "enum": [
        "proposed",
        "accepted",
        "superseded",
        "deprecated",
        "rejected"
      ]
    },
    "date": {
      "description": "ISO 8601 date the decision was made; it is immutable once published, and a later status change does not move it.",
      "type": "string",
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
    },
    "deciders": {
      "description": "People who made the decision.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "supersedes": {
      "type": "string",
      "description": "id of the record this decision replaces."
    },
    "supersededBy": {
      "type": "string",
      "description": "id of the record that replaced this one. REQUIRED when status is \"superseded\": a superseded record must point to its successor so the supersession link is navigable in both directions."
    },
    "affectedPaths": {
      "description": "Repository-root-relative paths the decision affects.",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^(?!/)(?!\\./)(?!.*(^|/)\\.\\.(/|$))(?!.*\\\\).+$"
      }
    },
    "affectedCategories": {
      "description": "Content categories the decision affects.",
      "type": "array",
      "items": {
        "enum": [
          "domain",
          "system",
          "practice",
          "governance",
          "decisions"
        ]
      }
    },
    "links": {
      "description": "Optional outbound references, e.g. to related decisions or issues.",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "if": {
    "properties": {
      "status": {
        "const": "superseded"
      }
    },
    "required": [
      "status"
    ]
  },
  "then": {
    "required": [
      "supersededBy"
    ]
  }
}

適合する決定記録です。このスキーマが検証するのは YAML フロントマターで、markdown 本文が文脈と決定と帰結を担います。

---
id: adopt-leji
title: Leji コンテキストレイヤーの導入
status: accepted
date: 2026-06-10
deciders:
  - Jo Lee
affectedCategories:
  - governance
---

# Leji コンテキストレイヤーの導入

## Context

技術的な知識は、人の頭の中と、チャットのスレッドと、少しずつ食い違う 3 つのツール設定ファイルに散らばっていた。不変条件がツールの読める場所のどこにも書かれていなかったため、エージェントは私たちの不変条件に合わないコードを生み出していた。

## Decision

Leji を `indexed` レベルで導入する。マニフェスト、ブートプロファイル、domain と system の内容、決定記録、生成されるインデックス、機械向けの変更履歴。

## Consequences

ベンダーの設定ファイルは、一行の誘導になる。コンテキストの修正は、それを浮かび上がらせた作業と同じ PR に乗せる。コンテキストレイヤーの所有者は Jo。

← スキーマ一覧