{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://trimestre.ca/schema/index-proposal.v2.json",
  "title": "Trimestre index proposal v2",
  "description": "A finalist's picks from the Nov 12 challenge list for one live Trimestre index. Teams choose the companies and make the case; the index accepts or refuses each pick, sizes accepted picks with its own rules and funds them from its cash.",
  "type": "object",
  "required": ["spec", "team", "base_index", "execution", "picks", "tool", "judging"],
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "spec": { "type": "string", "const": "trimestre.index-proposal/v2" },
    "submitted_at": { "type": "string", "format": "date-time" },
    "team": {
      "type": "object",
      "required": ["name", "members"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "minLength": 1, "maxLength": 60 },
        "members": {
          "type": "array",
          "minItems": 1,
          "maxItems": 6,
          "items": {
            "type": "object",
            "required": ["name"],
            "additionalProperties": false,
            "properties": {
              "name": { "type": "string", "minLength": 1, "maxLength": 80 },
              "role": { "type": "string", "maxLength": 60 }
            }
          }
        }
      }
    },
    "base_index": {
      "type": "string",
      "enum": ["reits-across-borders", "serial-acquirers"],
      "description": "All finalists are merged into the same index. If several teams propose the same ticker, each accepted team holds its own sleeve; the index position is the sum of the sleeves."
    },
    "execution": {
      "type": "object",
      "required": ["fill", "funded_by", "sizing"],
      "additionalProperties": false,
      "properties": {
        "fill": {
          "type": "string",
          "const": "on-acceptance",
          "description": "Accepted picks are bought at the live price as soon as the index accepts them during market hours (9:30–16:00 ET); otherwise at the next market open. Proposals accepted until 2026-11-19 16:00 ET."
        },
        "funded_by": { "type": "string", "const": "cash" },
        "sizing": {
          "type": "string",
          "const": "index-rules",
          "description": "Positions are sized by the index, not the team. Each finalist team has a reserved budget on its chosen index: (cash above the 2% floor) ÷ 3. Accepted picks are sized by capped market-cap weights within that budget. Unused budget and any amount above the per-name cap (15% REITs, 10% Serial) stay in cash."
        }
      }
    },
    "picks": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "description": "The index accepts or refuses each pick. A pick is accepted if: (1) the proposal validates, (2) the ticker fits the index strategy, (3) at least one signal can be verified at its source, (4) adding it does not breach the index risk limits (per-name caps; stress-test drawdown no worse than the base index by more than 2 points).",
      "items": {
        "type": "object",
        "required": ["ticker", "thesis", "edge", "signals"],
        "additionalProperties": false,
        "properties": {
          "ticker": { "type": "string", "enum": ["REI.UN", "CAR.UN", "KMP.UN", "GRT.UN", "NXR.UN", "CSU", "TOI", "WSP", "TFII", "ARE"] },
          "exchange": { "type": "string", "enum": ["TSX", "TSXV"] },
          "thesis": { "type": "string", "minLength": 1, "maxLength": 280, "description": "Why this business deserves its place in the index." },
          "edge": { "type": "string", "minLength": 1, "maxLength": 280, "description": "What your tool shows that a quote page does not." },
          "signals": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": ["name", "value", "source"],
              "additionalProperties": false,
              "properties": {
                "name": { "type": "string", "minLength": 1 },
                "value": { "type": ["number", "string"] },
                "unit": { "type": "string" },
                "period": { "type": "string" },
                "source": {
                  "type": "object",
                  "required": ["type", "ref"],
                  "additionalProperties": false,
                  "properties": {
                    "type": { "type": "string", "enum": ["filing", "api", "transcript", "dataset", "other"] },
                    "ref": { "type": "string", "minLength": 1 },
                    "url": { "type": "string", "format": "uri" }
                  }
                }
              }
            }
          },
          "risks": { "type": "array", "maxItems": 5, "items": { "type": "string", "maxLength": 200 } },
          "review_trigger": { "type": "string", "maxLength": 200, "description": "What would make you take the pick out." }
        }
      }
    },
    "tool": {
      "type": "object",
      "required": ["name"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "minLength": 1 },
        "url": { "type": "string", "format": "uri" },
        "repo": { "type": "string", "format": "uri" },
        "stack": { "type": "array", "items": { "type": "string" } },
        "data_sources": { "type": "array", "items": { "type": "string" } }
      }
    },
    "judging": {
      "type": "object",
      "required": ["video"],
      "additionalProperties": false,
      "properties": {
        "video": { "type": "string", "format": "uri", "description": "2-minute video showcasing your tool. Jury only, never published." }
      }
    }
  },
  "allOf": [
    {
      "if": { "properties": { "base_index": { "const": "reits-across-borders" } }, "required": ["base_index"] },
      "then": { "properties": { "picks": { "items": { "properties": { "ticker": { "type": "string", "enum": ["REI.UN", "CAR.UN", "KMP.UN", "GRT.UN", "NXR.UN"] } } } } } }
    },
    {
      "if": { "properties": { "base_index": { "const": "serial-acquirers" } }, "required": ["base_index"] },
      "then": { "properties": { "picks": { "items": { "properties": { "ticker": { "type": "string", "enum": ["CSU", "TOI", "WSP", "TFII", "ARE"] } } } } } }
    }
  ]
}
