{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://scaledlegal.io/atticus/schema/corpus-2.0.json",
  "title": "Atticus corpus entry file (v2.0)",
  "description": "Contract between the content track (corpus/v2.0/entries.json) and the site/API track. Owner of this file: content track (A1 atticus-corpus-v2). Change log at the bottom ($comment_changelog). Matches SPEC.md v3 sections 4.1-4.3: every entry carries must_quote, citations with snapshot sha256, last_verified, review_window_days; stale is computed by the API, not stored.",
  "type": "object",
  "required": [
    "schema_version",
    "pack",
    "corpus_version",
    "generated_at",
    "entries"
  ],
  "properties": {
    "schema_version": {
      "const": "2.0.0"
    },
    "pack": {
      "const": "la-pi"
    },
    "corpus_version": {
      "type": "string",
      "pattern": "^2\\.[01]\\.[0-9]+$"
    },
    "generated_at": {
      "type": "string",
      "description": "ISO 8601 with offset, America/Los_Angeles"
    },
    "sources_manifest": {
      "type": "string",
      "description": "Relative path to SOURCES.json; every citation.source_id resolves there"
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/entry"
      }
    }
  },
  "$defs": {
    "entry": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "pack",
        "kind",
        "topic",
        "audience",
        "trigger",
        "answer",
        "citations",
        "confidence",
        "refuse_if",
        "related",
        "verification",
        "jurisdiction",
        "entry_sha256"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^atx:la-pi:[a-z0-9]+(-[a-z0-9]+)*$",
          "description": "Stable. Never reused after a drop."
        },
        "pack": {
          "const": "la-pi"
        },
        "kind": {
          "enum": [
            "deadline",
            "rule",
            "procedure",
            "local_rule",
            "form",
            "checklist",
            "damages",
            "lien",
            "definition",
            "ethics"
          ]
        },
        "topic": {
          "enum": [
            "courts-and-filing",
            "government-claims",
            "limitations-and-tolling",
            "pleading-and-motions",
            "discovery",
            "experts",
            "case-management-and-trial-setting",
            "adr-and-settlement",
            "offers-998",
            "damages",
            "medical-malpractice",
            "liens",
            "insurance",
            "liability",
            "minors-and-death-cases",
            "trial",
            "post-trial-and-costs",
            "ethics-and-practice"
          ]
        },
        "audience": {
          "type": "array",
          "minItems": 1,
          "items": {
            "enum": [
              "attorney",
              "staff",
              "student"
            ]
          }
        },
        "trigger": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "question",
            "keywords"
          ],
          "properties": {
            "question": {
              "type": "string",
              "maxLength": 200
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 12,
              "description": "Fixed-vocabulary lookup terms (SPEC v3 4.5: no free text from users)"
            },
            "moments": {
              "type": "array",
              "items": {
                "enum": [
                  "intake",
                  "pre-filing",
                  "filing",
                  "service",
                  "discovery",
                  "motion",
                  "cmc",
                  "mediation",
                  "settlement",
                  "trial",
                  "post-trial",
                  "hallway",
                  "study"
                ]
              }
            }
          }
        },
        "answer": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "short",
            "must_quote"
          ],
          "properties": {
            "short": {
              "type": "string",
              "maxLength": 320,
              "description": "One or two sentences an agent can say aloud"
            },
            "steps": {
              "type": "array",
              "maxItems": 6,
              "items": {
                "type": "string",
                "maxLength": 240
              }
            },
            "must_quote": {
              "type": "string",
              "maxLength": 500,
              "description": "Exact text the agent relays with the cite and last_verified date"
            }
          }
        },
        "compute": {
          "type": "object",
          "description": "Present only for gated computations (SPEC v3 4.2). Inputs are dates and enumerated flags only.",
          "additionalProperties": false,
          "required": [
            "type",
            "inputs",
            "rule"
          ],
          "properties": {
            "type": {
              "enum": [
                "deadline",
                "amount_cap"
              ]
            },
            "inputs": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "name",
                  "type"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "date",
                      "flag",
                      "enum",
                      "integer"
                    ]
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "rule": {
              "type": "string",
              "description": "Machine rule, e.g. 'trigger_date + 6 months' ; human text lives in must_quote"
            },
            "gate": {
              "const": "enter_first",
              "description": "The API refuses reveal until gate.commit exists"
            }
          }
        },
        "citations": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "authority",
              "type",
              "pinpoint",
              "url",
              "source_id",
              "primary"
            ],
            "properties": {
              "authority": {
                "type": "string",
                "description": "e.g. 'Gov. Code, § 911.2' ; 'Cal. Rules of Court, rule 3.110' ; 'Howell v. Hamilton Meats & Provisions, Inc. (2011) 52 Cal.4th 541'"
              },
              "type": {
                "enum": [
                  "statute",
                  "rule_of_court",
                  "local_rule",
                  "standing_order",
                  "form",
                  "jury_instruction",
                  "case",
                  "federal_statute",
                  "federal_regulation",
                  "agency"
                ]
              },
              "pinpoint": {
                "type": "string",
                "description": "Subdivision, page or paragraph"
              },
              "quote": {
                "type": "string",
                "maxLength": 400,
                "description": "Verbatim span from the stored source (checked by lint against the hashed text)"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "source_id": {
                "type": "string",
                "description": "Key into SOURCES.json (sha256, retrieved_at, method)"
              },
              "primary": {
                "type": "boolean"
              }
            }
          }
        },
        "secondary_pointers": {
          "type": "array",
          "description": "Public secondary material (e.g. CAALA public pages). Pointer only; never copied text.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "title",
              "url",
              "publisher"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "publisher": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            }
          }
        },
        "confidence": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "level",
            "rule"
          ],
          "properties": {
            "level": {
              "enum": [
                "high",
                "medium",
                "low"
              ]
            },
            "rule": {
              "type": "string",
              "description": "Why this level: e.g. 'statute text is direct' / 'depends on case-law application' / 'local practice may vary by department'"
            }
          }
        },
        "refuse_if": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          },
          "description": "Conditions where the agent must say it has no reliable answer and stop"
        },
        "related": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "ref"
            ],
            "properties": {
              "type": {
                "enum": [
                  "entry",
                  "form",
                  "local_rule",
                  "standing_order",
                  "jury_instruction",
                  "statute",
                  "index_item"
                ]
              },
              "ref": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          }
        },
        "jurisdiction": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "state",
            "scope"
          ],
          "properties": {
            "state": {
              "const": "CA"
            },
            "scope": {
              "enum": [
                "statewide",
                "local",
                "federal"
              ],
              "description": "statewide: California law that applies in every county. local: specific to one county's court (here LA County / LASC local rules, general orders, programs); county and court are set. federal: federal law applied to California PI matters. Clients filter on this field."
            },
            "county": {
              "type": [
                "string",
                "null"
              ],
              "description": "Set when scope is local, e.g. \"Los Angeles\""
            },
            "court": {
              "type": [
                "string",
                "null"
              ],
              "description": "Set when scope is local"
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "scope": {
                    "const": "local"
                  }
                }
              },
              "then": {
                "properties": {
                  "county": {
                    "type": "string"
                  },
                  "court": {
                    "type": "string"
                  }
                },
                "required": [
                  "county",
                  "court"
                ]
              }
            }
          ]
        },
        "effective": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "as_of": {
              "type": "string"
            },
            "note": {
              "type": "string"
            }
          }
        },
        "verification": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "retrieved_at",
            "last_verified",
            "review_window_days"
          ],
          "properties": {
            "status": {
              "enum": [
                "confirmed",
                "corrected",
                "new"
              ]
            },
            "v1_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Atlas v1.2 ids folded into this entry (internal; the API may omit)"
            },
            "retrieved_at": {
              "type": "string"
            },
            "last_verified": {
              "type": "string",
              "description": "YYYY-MM-DD (PT)"
            },
            "review_window_days": {
              "type": "integer",
              "description": "statutes 180, rules of court 180, local rules and standing orders 90, forms 180, cases 365"
            },
            "verifier": {
              "type": "string",
              "description": "author pass + separate-context verifier id or PENDING"
            },
            "attorney_signoff": {
              "type": "string",
              "description": "Sponsoring firm content sign-off: 'pending' until done"
            }
          }
        },
        "entry_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "sha256 of the canonical JSON (sorted keys, no whitespace, UTF-8) of the entry without this field"
        }
      }
    }
  },
  "$comment_changelog": [
    "2.0.0 (2026-11-30 PT): first contract. Site/API track: read-only consumer; propose changes in corpus/SCHEMA-CHANGE-REQUESTS.md rather than editing this file.",
    "2.0.0 (2026-11-30 PT, content track): added required jurisdiction.scope (statewide | local | federal) so entries can be filtered statewide CA vs LA County/court-specific; county and court required when scope is local. Additive for readers; no other field changed."
  ]
}