org.cannadb.strainEdit

cannadb.org

Documentation

A field-level edit to a strain's living document (collaborative editing). Targets a strain via `subject` (the anchor record of the entity) and carries a sparse patch: scalar field overwrites in `set`, additive ops on open array fields in `add`/`remove`, and field clears in `unset`. The AppView folds accepted edits over the anchor record to materialize the canonical document; this record is one signed contribution, attributed to its publisher DID. See docs/05-collaborative-strains.md.

main record

A field-level edit to a strain's living document (collaborative editing). Targets a strain via `subject` (the anchor record of the entity) and carries a sparse patch: scalar field overwrites in `set`, additive ops on open array fields in `add`/`remove`, and field clears in `unset`. The AppView folds accepted edits over the anchor record to materialize the canonical document; this record is one signed contribution, attributed to its publisher DID. See docs/05-collaborative-strains.md.

Record Key tid Timestamp-based ID

Properties

add ref #arrayFields Optional

Values to add to open array fields (union at fold time).

basedOn string Optional

Materialized revision hash this edit was authored against, for conflict detection. Optional; absent for blind edits.

createdAt string datetime Required

Client-declared timestamp when this edit was created. Also the fold ordering key (ties broken by record URI).

remove ref #arrayFields Optional

Values to remove from open array fields (set-difference at fold time).

set ref #scalarFields Optional

Scalar and object-valued fields to overwrite (last-writer-wins per field at fold time).

subject string at-uri Required

AT-URI of the org.cannadb.strain record anchoring the entity this edit targets.

summary string Optional

Short human edit summary (the commit message). Capped at 200 graphemes (2000 bytes).

maxLength: 2000 bytesmaxGraphemes: 200 graphemes
unset array of string Optional

Field names to clear. Each must be an editable field of org.cannadb.strain.

View raw schema
{
  "key": "tid",
  "type": "record",
  "record": {
    "type": "object",
    "required": [
      "subject",
      "createdAt"
    ],
    "properties": {
      "add": {
        "ref": "#arrayFields",
        "type": "ref",
        "description": "Values to add to open array fields (union at fold time)."
      },
      "set": {
        "ref": "#scalarFields",
        "type": "ref",
        "description": "Scalar and object-valued fields to overwrite (last-writer-wins per field at fold time)."
      },
      "unset": {
        "type": "array",
        "items": {
          "type": "string",
          "description": "An editable strain field name to clear, e.g., \"growthOdour\"."
        },
        "description": "Field names to clear. Each must be an editable field of org.cannadb.strain."
      },
      "remove": {
        "ref": "#arrayFields",
        "type": "ref",
        "description": "Values to remove from open array fields (set-difference at fold time)."
      },
      "basedOn": {
        "type": "string",
        "description": "Materialized revision hash this edit was authored against, for conflict detection. Optional; absent for blind edits."
      },
      "subject": {
        "type": "string",
        "format": "at-uri",
        "description": "AT-URI of the org.cannadb.strain record anchoring the entity this edit targets."
      },
      "summary": {
        "type": "string",
        "maxLength": 2000,
        "description": "Short human edit summary (the commit message). Capped at 200 graphemes (2000 bytes).",
        "maxGraphemes": 200
      },
      "createdAt": {
        "type": "string",
        "format": "datetime",
        "description": "Client-declared timestamp when this edit was created. Also the fold ordering key (ties broken by record URI)."
      }
    }
  },
  "description": "A field-level edit to a strain's living document (collaborative editing). Targets a strain via `subject` (the anchor record of the entity) and carries a sparse patch: scalar field overwrites in `set`, additive ops on open array fields in `add`/`remove`, and field clears in `unset`. The AppView folds accepted edits over the anchor record to materialize the canonical document; this record is one signed contribution, attributed to its publisher DID. See docs/05-collaborative-strains.md."
}
arrayFields object

Open array fields that support additive add/remove merge. Lineage arrays (parents/versionOf and their parallel name arrays) are NOT here — they are replaced wholesale via `set` because their parallel-index structure does not merge element-wise.

Properties

alsoKnownAs array of string Optional

No description available.

characteristics array of string Optional

No description available.

effects array of string Optional

No description available.

flavors array of string Optional

No description available.

medicinalEffects array of string Optional

No description available.

seedAvailability array of string Optional

No description available.

terpenes array of string Optional

No description available.

View raw schema
{
  "type": "object",
  "properties": {
    "effects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "flavors": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "terpenes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "alsoKnownAs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "characteristics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "medicinalEffects": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "seedAvailability": {
      "type": "array",
      "items": {
        "type": "string",
        "knownValues": [
          "regular",
          "feminized",
          "autoflower",
          "clone_only"
        ]
      }
    }
  },
  "description": "Open array fields that support additive add/remove merge. Lineage arrays (parents/versionOf and their parallel name arrays) are NOT here — they are replaced wholesale via `set` because their parallel-index structure does not merge element-wise."
}
scalarFields object

The strain's scalar and object-valued fields, all optional. Mirrors org.cannadb.strain. Range/yield objects reference the same shapes the strain lexicon defines. Identity fields (name, kind, breeder, holder) are expressible here; whether such an edit is accepted is an AppView fold/governance concern, not a lexicon constraint.

Properties

autoflower boolean Optional

No description available.

breeder string at-uri Optional

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

breederName string Optional

No description available.

cbdDominant boolean Optional

No description available.

cultivationNotes string Optional

No description available.

description string Optional

No description available.

generation string Optional

No description available.

growDifficulty string Optional

No description available.

Known values: easy, intermediate, hard
growthOdour string Optional

No description available.

Known values: low, medium, high
holder string at-uri Optional

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

holderName string Optional

No description available.

indicaSativa integer Optional

No description available.

minimum: 0maximum: 100
kind string Optional

No description available.

Known values: strain, cut
name string Optional

No description available.

originRegion string Optional

No description available.

originYear integer Optional

No description available.

parentBreederNames array of string Optional

No description available.

parentNames array of string Optional

No description available.

parents array of stringat-uri Optional

No description available.

shortDescription string Optional

No description available.

sourceUrl string uri Optional

A valid URI.

thcCbdRatio string Optional

No description available.

versionOf array of stringat-uri Optional

No description available.

versionOfNames array of string Optional

No description available.

View raw schema
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "knownValues": [
        "strain",
        "cut"
      ]
    },
    "name": {
      "type": "string"
    },
    "yield": {
      "ref": "org.cannadb.strain#yieldRange",
      "type": "ref"
    },
    "height": {
      "ref": "org.cannadb.strain#heightRange",
      "type": "ref"
    },
    "holder": {
      "type": "string",
      "format": "at-uri"
    },
    "breeder": {
      "type": "string",
      "format": "at-uri"
    },
    "parents": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "at-uri"
      }
    },
    "cbdRange": {
      "ref": "org.cannadb.strain#cannabinoidRange",
      "type": "ref"
    },
    "thcRange": {
      "ref": "org.cannadb.strain#cannabinoidRange",
      "type": "ref"
    },
    "cycleTime": {
      "ref": "org.cannadb.strain#dayRange",
      "type": "ref"
    },
    "sourceUrl": {
      "type": "string",
      "format": "uri"
    },
    "versionOf": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "at-uri"
      }
    },
    "autoflower": {
      "type": "boolean"
    },
    "generation": {
      "type": "string"
    },
    "holderName": {
      "type": "string"
    },
    "originYear": {
      "type": "integer"
    },
    "breederName": {
      "type": "string"
    },
    "cbdDominant": {
      "type": "boolean"
    },
    "description": {
      "type": "string"
    },
    "growthOdour": {
      "type": "string",
      "knownValues": [
        "low",
        "medium",
        "high"
      ]
    },
    "parentNames": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "thcCbdRatio": {
      "type": "string"
    },
    "indicaSativa": {
      "type": "integer",
      "maximum": 100,
      "minimum": 0
    },
    "originRegion": {
      "type": "string"
    },
    "growDifficulty": {
      "type": "string",
      "knownValues": [
        "easy",
        "intermediate",
        "hard"
      ]
    },
    "versionOfNames": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "cultivationNotes": {
      "type": "string"
    },
    "shortDescription": {
      "type": "string"
    },
    "parentBreederNames": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "description": "The strain's scalar and object-valued fields, all optional. Mirrors org.cannadb.strain. Range/yield objects reference the same shapes the strain lexicon defines. Identity fields (name, kind, breeder, holder) are expressible here; whether such an edit is accepted is an AppView fold/governance concern, not a lexicon constraint."
}

Lexicon Garden

@