{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/geniffy-com/json-schema/geniffy-com-export-out-schema.json",
  "title": "ExportOut",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/geniffy-com-openapi.json#/components/schemas/ExportOut",
  "properties": {
    "exported_at": {
      "type": "string",
      "title": "Exported At"
    },
    "stored_in": {
      "type": "string",
      "title": "Stored In",
      "description": "Where the memory is kept"
    },
    "memories": {
      "items": {
        "$ref": "#/$defs/ExportedMemory"
      },
      "type": "array",
      "title": "Memories",
      "description": "Everything held, current or not, each with its status"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/Source"
      },
      "type": "array",
      "title": "Sources",
      "description": "Everything that was added"
    },
    "files": {
      "items": {
        "$ref": "#/$defs/FileRow"
      },
      "type": "array",
      "title": "Files",
      "description": "Every file kept, in path order: GET /v1/files?path= hands back each one's text, exactly as written"
    },
    "episodes": {
      "items": {
        "$ref": "#/$defs/ExportedEpisode"
      },
      "type": "array",
      "title": "Episodes",
      "description": "Every story of what happened, oldest first, each with its status"
    },
    "lessons": {
      "items": {
        "$ref": "#/$defs/ExportedLesson"
      },
      "type": "array",
      "title": "Lessons",
      "description": "Every rule, how-to and lesson, oldest first, in use or not"
    },
    "intentions": {
      "items": {
        "$ref": "#/$defs/ExportedIntention"
      },
      "type": "array",
      "title": "Intentions",
      "description": "Every promise and plan, oldest first: open, done or dropped"
    },
    "now": {
      "items": {
        "$ref": "#/$defs/StateOut"
      },
      "type": "array",
      "title": "Now",
      "description": "Where things stand, per project"
    }
  },
  "type": "object",
  "required": [
    "exported_at",
    "stored_in",
    "memories",
    "sources"
  ],
  "$defs": {
    "ExportedEpisode": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title"
        },
        "what_happened": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "What Happened"
        },
        "outcome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome",
          "description": "How it ended"
        },
        "led_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Led To",
          "description": "What it led to"
        },
        "people": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "People"
        },
        "decisions": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Decisions",
          "description": "{what, why}"
        },
        "revised": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Revised",
          "description": "Endings a later conversation corrected, oldest first: {was, why, at}"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "ended_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ended At"
        },
        "source": {
          "$ref": "#/$defs/SourceRef"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status",
          "description": "closed, or open: still going when its source ended"
        }
      },
      "type": "object",
      "required": [
        "id",
        "source"
      ],
      "title": "ExportedEpisode"
    },
    "ExportedIntention": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project"
        },
        "what": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "What"
        },
        "owner": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Owner",
          "description": "Who promised or planned it"
        },
        "trigger": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trigger",
          "description": "time, context, person or event"
        },
        "at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "At",
          "description": "When it is due: a day (2026-10-31), or a time of day with its offset (2026-11-03T15:00:00-08:00) when one was said"
        },
        "due": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Due",
          "description": "That day in words: \"31 October 2026\", \"the end of Q1 2027\", \"Tuesday 3 November 2026 at 15:00\""
        },
        "overdue": {
          "type": "boolean",
          "title": "Overdue",
          "description": "Still open, and its day has gone by where the user is",
          "default": false
        },
        "when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "When",
          "description": "Its trigger in words: \"when testing ends\""
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status",
          "description": "open, done or dropped"
        },
        "moved_from": {
          "items": {
            "$ref": "#/$defs/MovedFrom"
          },
          "type": "array",
          "title": "Moved From",
          "description": "When it was due before a later conversation moved it, oldest first: {at, when}. Empty when it was never moved"
        },
        "sources": {
          "items": {
            "$ref": "#/$defs/SourceRef"
          },
          "type": "array",
          "title": "Sources",
          "description": "Every source it came from, oldest first"
        },
        "sources_total": {
          "type": "integer",
          "title": "Sources Total",
          "description": "How many sources it came from in all",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "ExportedIntention"
    },
    "ExportedLesson": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "project": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project"
        },
        "kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Kind",
          "description": "rule, how_to or lesson"
        },
        "statement": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Statement"
        },
        "applies_when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Applies When"
        },
        "why": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Why"
        },
        "strength": {
          "type": "integer",
          "title": "Strength",
          "description": "How many times it was learned again",
          "default": 1
        },
        "sources": {
          "items": {
            "$ref": "#/$defs/SourceRef"
          },
          "type": "array",
          "title": "Sources",
          "description": "Every source it was learned from, oldest first"
        },
        "sources_total": {
          "type": "integer",
          "title": "Sources Total",
          "description": "How many sources it was learned from in all",
          "default": 0
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status",
          "description": "current, or why it is no longer used: merged (into another lesson) or struck"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "ExportedLesson"
    },
    "ExportedMemory": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "about": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "About"
        },
        "kind": {
          "type": "string",
          "title": "Kind",
          "description": "people, plan, pref or detail"
        },
        "learned_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Learned At"
        },
        "said_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Said At",
          "description": "When it was said"
        },
        "date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Date",
          "description": "The day it is about, when it is about one, worked out from the words on the clock of whoever said them: 2027-03-12, 2027-03 for a month, 2027-Q1, 2027, or --02-14 for a day every year"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "Where it stands: current, conflicted, superseded (an older value), ended (a later word said it stopped), and so on"
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourceRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "quote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quote",
          "description": "The sentence it was learned from"
        }
      },
      "type": "object",
      "required": [
        "id",
        "text",
        "kind",
        "status"
      ],
      "title": "ExportedMemory"
    },
    "FileRow": {
      "properties": {
        "path": {
          "type": "string",
          "title": "Path"
        },
        "size": {
          "type": "integer",
          "title": "Size",
          "description": "How many characters it holds"
        },
        "updated_at": {
          "type": "string",
          "title": "Updated At",
          "description": "When it was last written"
        }
      },
      "type": "object",
      "required": [
        "path",
        "size",
        "updated_at"
      ],
      "title": "FileRow"
    },
    "MovedFrom": {
      "properties": {
        "at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "At",
          "description": "When it was due before, for a time"
        },
        "when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "When",
          "description": "Its trigger before, in words: \"on Friday\""
        }
      },
      "type": "object",
      "title": "MovedFrom"
    },
    "Source": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "kind": {
          "type": "string",
          "enum": [
            "note",
            "file",
            "link"
          ],
          "title": "Kind"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "file_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Name"
        },
        "file_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Type"
        },
        "size_bytes": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Size Bytes"
        },
        "status": {
          "type": "string",
          "enum": [
            "reading",
            "learned",
            "failed",
            "waiting"
          ],
          "title": "Status",
          "description": "waiting: saved past this month's included use, kept, and learned once there is room"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "facts": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Facts"
        },
        "added_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Added By"
        },
        "added_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Added At"
        },
        "external_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "External Id",
          "description": "Your own id for it, when you gave one"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Labels",
          "description": "Your own name/value pairs on it"
        }
      },
      "type": "object",
      "required": [
        "id",
        "kind",
        "title",
        "status"
      ],
      "title": "Source"
    },
    "SourceRef": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Labels",
          "description": "The labels on the source it came from"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "title"
      ],
      "title": "SourceRef"
    },
    "StateOut": {
      "properties": {
        "project": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Project",
          "description": "The project, as its sources were labelled; null: no project"
        },
        "goal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Goal"
        },
        "focus": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Focus",
          "description": "What is being worked on right now"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status",
          "description": "Where the work stands, in one sentence: what works, what fails or is half done, what it waits on"
        },
        "open": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Open",
          "description": "What is still open: {text, since}"
        },
        "decisions": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Decisions",
          "description": "{what, why, when}, latest last"
        },
        "next_steps": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Next Steps",
          "description": "What comes next, in the order it was said"
        },
        "blockers": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Blockers"
        },
        "done": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Done",
          "description": "What was finished: {text, when, by}. when is a day (2026-11-02) when only a day was said; by: the words that settled it, when known"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        }
      },
      "type": "object",
      "title": "StateOut"
    }
  }
}