{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A grow — one documented cultivation run (a tent, a garden, a season's cycle). The grow is a lightweight container: it groups one or more `org.cannadb.plant` records and carries the shared setup and a publisher-chosen listing preference. Per-plant lifecycle, activities, notes, and measurements live in `org.cannadb.growEntry` records that reference a plant; photos live in `org.cannadb.growPhoto` records. Publishing this record IS the claim — every field is contextualized by the publisher DID at display time. NOTE on visibility: all atproto records are public regardless of `listed`; `listed` controls only whether the AppView includes this grow (and its plants/entries/photos) in public listing, search, and per-strain aggregation. Unlisted is not private.",
      "key": "tid",
      "record": {
        "properties": {
          "coverImage": {
            "accept": [
              "image/png",
              "image/jpeg",
              "image/webp"
            ],
            "description": "One representative image for the grow's listing card and header. Richer photo galleries belong in `org.cannadb.growPhoto` records. Capped at 2 MB to keep PDS storage burden modest; SVG is excluded for XSS safety.",
            "maxSize": 2000000,
            "type": "blob"
          },
          "createdAt": {
            "description": "Client-declared timestamp when this grow record was originally created.",
            "format": "datetime",
            "type": "string"
          },
          "description": {
            "description": "Markdown-formatted overview of the grow — setup, intent, lighting/nutrient regimen, room notes. Per-plant and per-event detail belongs in `org.cannadb.growEntry` records; this is the grow-wide writeup.",
            "maxGraphemes": 10000,
            "maxLength": 100000,
            "type": "string"
          },
          "endedAt": {
            "description": "When the grow run ended (final harvest, or the run was abandoned/archived). Optional.",
            "format": "datetime",
            "type": "string"
          },
          "environment": {
            "description": "Static setup descriptor for where the grow runs. Live sensor/environment/controller telemetry is out of scope for CannaDB (it remains the domain of self-hosted tools like Isley). Open vocabulary.",
            "knownValues": [
              "indoor",
              "outdoor",
              "greenhouse",
              "mixed"
            ],
            "type": "string"
          },
          "listed": {
            "description": "Publisher's index preference. Absent or true means the AppView MAY include this grow — and its plants, entries, and photos — in public listing, search, and per-strain grow aggregation. False means the AppView SHOULD exclude the whole grow subtree from those public surfaces. This controls indexing only: the records remain public on the PDS and resolvable by direct AT-URI regardless. It is independent of AppView moderation (a listed grow may still be editorially hidden).",
            "type": "boolean"
          },
          "medium": {
            "description": "Static setup descriptor for the growing medium. Open vocabulary.",
            "knownValues": [
              "soil",
              "living_soil",
              "coco",
              "hydro",
              "rockwool",
              "aeroponic",
              "other"
            ],
            "type": "string"
          },
          "name": {
            "description": "Display name for this grow, e.g., \"Wedding Cake — Spring '26 Tent\". Capped to keep listing cards tidy.",
            "maxGraphemes": 200,
            "maxLength": 2000,
            "type": "string"
          },
          "startedAt": {
            "description": "When the grow run began (typically the first germination/plant date). Optional.",
            "format": "datetime",
            "type": "string"
          },
          "status": {
            "description": "Coarse grow-level status. Distinct from per-plant lifecycle stage (which is event-sourced via `org.cannadb.growEntry`). Open vocabulary — clients should accept unknown values and fall back to generic display.",
            "knownValues": [
              "active",
              "harvested",
              "archived",
              "abandoned"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "org.cannadb.grow",
  "lexicon": 1
}
