{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://humansmd.dev/schema/0.2/humans-group.schema.json",
  "title": "Experimental merged HUMANS.md profile, version 0.2 (draft)",
  "description": "Deterministic experimental output under SPEC § 9. No active state, identity, notes, anonymity, presence or orchestration guarantee. Cross-field counts and exact merge behavior also require procedural checks.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "humans_group",
    "coverage",
    "conflicts"
  ],
  "properties": {
    "humans_group": {
      "const": "0.2"
    },
    "coverage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "with_profile",
        "total"
      ],
      "properties": {
        "with_profile": {
          "type": "integer",
          "minimum": 0
        },
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "stale": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "languages": {
      "type": "array",
      "items": {
        "$ref": "humans.schema.json#/$defs/language"
      },
      "minItems": 1,
      "uniqueItems": true,
      "maxItems": 10
    },
    "reading": {
      "type": "object",
      "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": 2,
          "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."
        },
        "appendix_depth": {
          "enum": [
            "balanced",
            "expert"
          ],
          "description": "Optional depth for separately requested details or an appendix within the same whole-message max_words cap."
        }
      },
      "minProperties": 1
    },
    "deciding": {
      "type": "object",
      "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",
      "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": {
        "knows_well": {
          "type": "array",
          "maxItems": 15,
          "uniqueItems": true,
          "items": {
            "$ref": "humans.schema.json#/$defs/topic"
          },
          "minItems": 1,
          "description": "Intersection over every eligible member; absent or empty list prevents a common-knowledge claim."
        },
        "knows_little": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "humans.schema.json#/$defs/topic"
          },
          "minItems": 1,
          "maxItems": 81
        }
      },
      "minProperties": 1
    },
    "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
    },
    "conflicts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "enum": [
              "reading.lead_with",
              "reading.length",
              "reading.max_words",
              "reading.structure",
              "reading.technical_depth",
              "reading.jargon",
              "reading.tone",
              "reading.evidence",
              "reading.uncertainty",
              "deciding.reversible",
              "deciding.batch_questions",
              "deciding.default_answer",
              "deciding.asks_per_message",
              "deciding.format",
              "deciding.challenge",
              "deciding.out_of_scope_steps",
              "interrupting.interrupt_for",
              "interrupting.group_by",
              "interrupting.channel_hint"
            ]
          },
          "values": {
            "type": "array",
            "description": "Included only when at least 3 eligible members voted for this field. No anonymity guarantee.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "value",
                "count"
              ],
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    }
                  ]
                },
                "count": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "minItems": 2,
            "uniqueItems": true
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.lead_with"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "tldr",
                          "decision_needed",
                          "context",
                          "question"
                        ],
                        "description": "What the first line holds."
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.length"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "minimal",
                          "short",
                          "standard",
                          "thorough"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.max_words"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "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."
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.structure"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "bullets",
                          "prose",
                          "mixed"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.technical_depth"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "non_technical",
                          "balanced",
                          "expert"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.jargon"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "avoid",
                          "define",
                          "ok"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.tone"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "direct",
                          "neutral",
                          "warm"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.evidence"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "numbers_and_sources",
                          "key_numbers",
                          "light"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "reading.uncertainty"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "flag_explicitly",
                          "inline"
                        ],
                        "description": "flag_explicitly: say what was checked and what was assumed."
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.reversible"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "decide_and_report",
                          "ask"
                        ],
                        "description": "Only for actions the agent is already allowed to take. Never grants a permission."
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.batch_questions"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "end_of_task",
                          "as_they_come"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.default_answer"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "always",
                          "when_obvious"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.asks_per_message"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "one",
                          "few",
                          "any"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.format"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "recommendation_first",
                          "options_then_recommendation",
                          "options_only"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.challenge"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "welcome_early",
                          "after_draft",
                          "on_request"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "deciding.out_of_scope_steps"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "omit_unless_blocking",
                          "list"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "interrupting.interrupt_for"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "blocking_only",
                          "blocking_or_risky",
                          "anything"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "interrupting.group_by"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "project",
                          "none"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "field": {
                  "const": "interrupting.channel_hint"
                }
              },
              "required": [
                "field"
              ]
            },
            "then": {
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "enum": [
                          "async_written",
                          "sync_call",
                          "either"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "maxItems": 19
    }
  }
}
