{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://humansmd.dev/schema/0.2/humans-projection.schema.json",
  "title": "Individual HUMANS.md projection, version 0.2 (draft)",
  "description": "Reconstructed model-facing data; no names, aliases, identity claims, body, comments, state or directory prose. Text encoding and budgets are in SPEC § 6.3.",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "const": "none"
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "profile"
      ],
      "properties": {
        "status": {
          "enum": [
            "found",
            "stale"
          ]
        },
        "profile": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "updated",
            "stale",
            "withheld"
          ],
          "properties": {
            "id": {
              "$ref": "humans.schema.json#/properties/id"
            },
            "updated": {
              "$ref": "humans.schema.json#/properties/updated"
            },
            "stale": {
              "type": "boolean"
            },
            "withheld": {
              "type": "array",
              "maxItems": 1,
              "uniqueItems": true,
              "items": {
                "const": "notes"
              }
            },
            "languages": {
              "type": "array",
              "maxItems": 10,
              "uniqueItems": true,
              "items": {
                "$ref": "humans.schema.json#/$defs/language"
              },
              "minItems": 1
            },
            "reading": {
              "type": "object",
              "description": "What I read.",
              "additionalProperties": false,
              "properties": {
                "lead_with": {
                  "enum": [
                    "tldr",
                    "decision_needed",
                    "context",
                    "question"
                  ],
                  "description": "What the first line holds."
                },
                "length": {
                  "enum": [
                    "minimal",
                    "short",
                    "standard",
                    "thorough"
                  ]
                },
                "max_words": {
                  "type": "integer",
                  "minimum": 20,
                  "maximum": 2000,
                  "description": "Cap on the entire message, including an appendix, tables and code; never bypass via an unsolicited thread or extra message."
                },
                "structure": {
                  "enum": [
                    "bullets",
                    "prose",
                    "mixed"
                  ]
                },
                "visual": {
                  "type": "array",
                  "items": {
                    "enum": [
                      "table",
                      "diagram",
                      "chart",
                      "example",
                      "text"
                    ]
                  },
                  "uniqueItems": true,
                  "maxItems": 5,
                  "description": "Preferred forms, most wanted first.",
                  "minItems": 1
                },
                "technical_depth": {
                  "enum": [
                    "non_technical",
                    "balanced",
                    "expert"
                  ]
                },
                "jargon": {
                  "enum": [
                    "avoid",
                    "define",
                    "ok"
                  ]
                },
                "tone": {
                  "enum": [
                    "direct",
                    "neutral",
                    "warm"
                  ]
                },
                "evidence": {
                  "enum": [
                    "numbers_and_sources",
                    "key_numbers",
                    "light"
                  ]
                },
                "uncertainty": {
                  "enum": [
                    "flag_explicitly",
                    "inline"
                  ],
                  "description": "flag_explicitly: say what was checked and what was assumed."
                }
              },
              "minProperties": 1
            },
            "deciding": {
              "type": "object",
              "description": "What I decide.",
              "additionalProperties": false,
              "properties": {
                "reversible": {
                  "enum": [
                    "decide_and_report",
                    "ask"
                  ],
                  "description": "Only for actions the agent is already allowed to take. Never grants a permission."
                },
                "batch_questions": {
                  "enum": [
                    "end_of_task",
                    "as_they_come"
                  ]
                },
                "default_answer": {
                  "enum": [
                    "always",
                    "when_obvious"
                  ]
                },
                "asks_per_message": {
                  "enum": [
                    "one",
                    "few",
                    "any"
                  ]
                },
                "format": {
                  "enum": [
                    "recommendation_first",
                    "options_then_recommendation",
                    "options_only"
                  ]
                },
                "challenge": {
                  "enum": [
                    "welcome_early",
                    "after_draft",
                    "on_request"
                  ]
                },
                "out_of_scope_steps": {
                  "enum": [
                    "omit_unless_blocking",
                    "list"
                  ]
                }
              },
              "minProperties": 1
            },
            "interrupting": {
              "type": "object",
              "description": "When to interrupt me.",
              "additionalProperties": false,
              "properties": {
                "interrupt_for": {
                  "enum": [
                    "blocking_only",
                    "blocking_or_risky",
                    "anything"
                  ]
                },
                "group_by": {
                  "enum": [
                    "project",
                    "none"
                  ]
                },
                "channel_hint": {
                  "enum": [
                    "async_written",
                    "sync_call",
                    "either"
                  ]
                }
              },
              "minProperties": 1
            },
            "context": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "role": {
                  "$ref": "humans.schema.json#/$defs/role"
                },
                "knows_well": {
                  "type": "array",
                  "maxItems": 15,
                  "uniqueItems": true,
                  "items": {
                    "$ref": "humans.schema.json#/$defs/topic"
                  },
                  "minItems": 1
                },
                "knows_little": {
                  "type": "array",
                  "maxItems": 15,
                  "uniqueItems": true,
                  "items": {
                    "$ref": "humans.schema.json#/$defs/topic"
                  },
                  "minItems": 1
                },
                "decides": {
                  "type": "array",
                  "maxItems": 10,
                  "uniqueItems": true,
                  "items": {
                    "$ref": "humans.schema.json#/$defs/decision"
                  },
                  "minItems": 1
                },
                "stale": {
                  "type": "boolean"
                }
              },
              "minProperties": 2,
              "required": [
                "stale"
              ]
            },
            "avoid": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "enum": [
                  "walls_of_text",
                  "filler_intro",
                  "filler_outro",
                  "hedging",
                  "emoji",
                  "rhetorical_questions",
                  "multiple_asks",
                  "unexplained_acronyms",
                  "passive_voice",
                  "exclamation",
                  "long_preamble",
                  "nested_bullets",
                  "sarcasm"
                ]
              },
              "minItems": 1
            },
            "notes": {
              "$ref": "humans.schema.json#/properties/notes"
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "withheld": {
                    "contains": {
                      "const": "notes"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "withheld"
                ]
              },
              "then": {
                "properties": {
                  "notes": false
                }
              }
            }
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "const": "stale"
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "properties": {
              "profile": {
                "type": "object",
                "properties": {
                  "stale": {
                    "const": true
                  }
                }
              }
            }
          },
          "else": {
            "properties": {
              "profile": {
                "type": "object",
                "properties": {
                  "stale": {
                    "const": false
                  }
                }
              }
            }
          }
        }
      ]
    }
  ]
}
