{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "HuginnMindRequest", "description": "Every operation a mind answers. `Admit` carries the batch whole because the\nbatch already names the instance and the asker; a second `instance` beside\nit would be two declarations. Every read names the instance because ruling\n14 refuses another mind's identity whatever the transport, and a read of\nthe wrong mind is that same collision on the read side. `Whoami` names\nnone: it is how a client learns which mind it reached.", "oneOf": [ { "type": "string", "enum": [ "Whoami" ] }, { "type": "object", "properties": { "Admit": { "$ref": "#/$defs/PipelineAdmissionBatch" } }, "additionalProperties": false, "required": [ "Admit" ] }, { "type": "object", "properties": { "View": { "type": "object", "properties": { "id": { "$ref": "#/$defs/PipelineRef" }, "instance": { "$ref": "#/$defs/Slug" } }, "required": [ "instance", "id" ] } }, "additionalProperties": false, "required": [ "View" ] }, { "type": "object", "properties": { "Query": { "type": "object", "properties": { "instance": { "$ref": "#/$defs/Slug" }, "selection": { "$ref": "https://github.com/GameCult/CultLib/contracts/cultnet/cultnet.selection.schema.json" }, "semantic": { "anyOf": [ { "$ref": "#/$defs/SemanticQuery" }, { "type": "null" } ] } }, "required": [ "instance", "selection" ] } }, "additionalProperties": false, "required": [ "Query" ] }, { "description": "The mind's persona document, if one is stored.", "type": "object", "properties": { "PersonaGet": { "type": "object", "properties": { "instance": { "$ref": "#/$defs/Slug" } }, "required": [ "instance" ] } }, "additionalProperties": false, "required": [ "PersonaGet" ] }, { "description": "Replaces the mind's persona document whole. `expected_updated_at` is\nthe stored document's `updatedAt`, none for the first put. The\nprovenance is the asker's, as for `Admit`.", "type": "object", "properties": { "PersonaPut": { "type": "object", "properties": { "expected_updated_at": { "type": [ "string", "null" ] }, "instance": { "$ref": "#/$defs/Slug" }, "provenance": { "$ref": "#/$defs/PipelineProvenance" }, "state": true }, "required": [ "instance", "provenance", "state" ] } }, "additionalProperties": false, "required": [ "PersonaPut" ] }, { "description": "Semantic search over the source index: the public forge repos' code and\ndocs, which no mind holds. The daemon embeds the text and asks the\nindex it does not write.", "type": "object", "properties": { "SearchSources": { "type": "object", "properties": { "instance": { "$ref": "#/$defs/Slug" }, "query": { "$ref": "#/$defs/SourceQuery" } }, "required": [ "instance", "query" ] } }, "additionalProperties": false, "required": [ "SearchSources" ] }, { "description": "What others did in `repos` on the forge since the `after` cursor: the\ndaemon reads the forge and no document of the mind, and answers\n`Refused(Unavailable)` when it has no forge or the forge does not answer\nin time. The repos are the asker's to name (her stewardships); the\ninstance's own login is dropped from the answer.", "type": "object", "properties": { "StewardedActivity": { "type": "object", "properties": { "after": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0 }, "instance": { "$ref": "#/$defs/Slug" }, "repos": { "type": "array", "items": { "$ref": "#/$defs/OrgRepo" } } }, "required": [ "instance", "repos" ] } }, "additionalProperties": false, "required": [ "StewardedActivity" ] }, { "description": "Every root the mind holds a document under, with its newest admission and a campaign's repos in force: the mind's own\nrecords, one pass at the head.", "type": "object", "properties": { "RootsTouched": { "type": "object", "properties": { "instance": { "$ref": "#/$defs/Slug" } }, "required": [ "instance" ] } }, "additionalProperties": false, "required": [ "RootsTouched" ] } ], "$defs": { "AuthorityMap": { "type": "object", "properties": { "deletion_line": { "$ref": "#/$defs/Line" }, "derived_state": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 }, "forbidden_writers": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 }, "inputs": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 }, "outputs": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 }, "owner": { "$ref": "#/$defs/Line" }, "shared_paths": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 } }, "required": [ "owner", "inputs", "outputs", "derived_state", "forbidden_writers", "shared_paths", "deletion_line" ] }, "ClaimOutcome": { "type": "string", "enum": [ "Holds", "Falsified", "Unproven" ] }, "CodeLocation": { "type": "object", "properties": { "end_line": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0 }, "line": { "type": "integer", "format": "uint32", "minimum": 0 }, "path": { "$ref": "#/$defs/Short" }, "symbol": { "anyOf": [ { "$ref": "#/$defs/Symbol" }, { "type": "null" } ] } }, "required": [ "path", "line" ] }, "CommitRange": { "type": "object", "properties": { "base": { "$ref": "#/$defs/Sha" }, "head": { "$ref": "#/$defs/Sha" } }, "required": [ "base", "head" ] }, "CutDelete": { "type": "object", "properties": { "lines": { "type": "integer", "format": "uint32", "minimum": 0 }, "note": { "$ref": "#/$defs/Line" }, "path": { "$ref": "#/$defs/Short" } }, "required": [ "path", "lines", "note" ] }, "CutVerification": { "type": "object", "properties": { "builds": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 64 }, "negative": { "type": "array", "items": { "$ref": "#/$defs/NegativeCheck" }, "maxItems": 64 }, "operator": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 64 }, "tests": { "type": "array", "items": { "$ref": "#/$defs/VerificationTest" }, "maxItems": 64 } }, "required": [ "builds", "tests", "negative", "operator" ] }, "Date": { "description": "A calendar date, `YYYY-MM-DD`.", "type": "string", "maxLength": 10 }, "Deviation": { "type": "object", "properties": { "what": { "$ref": "#/$defs/Line" }, "why": { "$ref": "#/$defs/Line" } }, "required": [ "what", "why" ] }, "DocRef": { "type": "object", "properties": { "commit": { "$ref": "#/$defs/Sha" }, "end_line": { "type": "integer", "format": "uint32", "minimum": 0 }, "path": { "$ref": "#/$defs/Short" }, "start_line": { "type": "integer", "format": "uint32", "minimum": 0 } }, "required": [ "path", "start_line", "end_line", "commit" ] }, "Evidence": { "type": "object", "properties": { "kind": { "$ref": "#/$defs/EvidenceKind" }, "locator": { "$ref": "#/$defs/Line" }, "result": { "$ref": "#/$defs/Line" } }, "required": [ "kind", "locator", "result" ] }, "EvidenceKind": { "type": "string", "enum": [ "Command", "Test", "Mutation", "Probe", "SourceRead", "Capture" ] }, "Faculty": { "description": "Which faculty a batch was admitted as. Attribution, not authority\n(ruling 18): no admission rule trusts it, and Cut 9's views read it back\nfrom the receipt.", "type": "string", "enum": [ "SelfFaculty", "Imagination", "Hands", "Soul", "Life", "Eyes", "Operator" ] }, "FileChange": { "type": "object", "properties": { "change": { "$ref": "#/$defs/Line" }, "location": { "$ref": "#/$defs/CodeLocation" } }, "required": [ "location", "change" ] }, "FindingConfidence": { "type": "string", "enum": [ "Confirmed", "Plausible" ] }, "FindingOrigin": { "type": "string", "enum": [ "Introduced", "PreExisting" ] }, "FindingSeverity": { "type": "string", "enum": [ "Blocker", "High", "Medium", "Low" ] }, "ForeignRef": { "description": "A citation of a document in another repo's pipeline store (D6).", "type": "object", "properties": { "commit": { "$ref": "#/$defs/FullSha" }, "id": { "$ref": "#/$defs/Short" }, "kind": { "$ref": "#/$defs/PipelineKind" }, "payload_sha256": { "$ref": "#/$defs/Sha256Hex" }, "repo": { "$ref": "#/$defs/OrgRepo" } }, "required": [ "repo", "commit", "kind", "id", "payload_sha256" ] }, "FullSha": { "description": "A full git commit id: exactly 40 lowercase hex characters.", "type": "string", "maxLength": 40 }, "Label": { "description": "A key label: `[A-Za-z0-9_-]{1,64}`.", "type": "string", "maxLength": 64 }, "LandedName": { "description": "A name the cut landed, and where it lives.", "type": "object", "properties": { "name": { "$ref": "#/$defs/Short" }, "path": { "$ref": "#/$defs/Short" } }, "required": [ "name", "path" ] }, "Line": { "description": "Text of at most 1,000 UTF-8 bytes.", "type": "string", "maxLength": 1000 }, "MemoryOrigin": { "description": "Where a memory came from and whom she heard it from. The organ derives it\nfrom the batch of the turn that wrote the memory; the model never writes it.\n`about` names whom a memory concerns, this names the room and the voices.", "oneOf": [ { "description": "A turn in rooms: their aliases comma-joined, and the batch's other senders.", "type": "object", "properties": { "Room": { "type": "object", "properties": { "heard_from": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 8 }, "rooms": { "$ref": "#/$defs/Short" } }, "required": [ "rooms", "heard_from" ] } }, "additionalProperties": false, "required": [ "Room" ] }, { "description": "A direct message: the DM's room id, and the others who spoke in it (whom\nshe heard it from in confidence).", "type": "object", "properties": { "Direct": { "type": "object", "properties": { "room": { "$ref": "#/$defs/Short" }, "with": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 8 } }, "required": [ "room", "with" ] } }, "additionalProperties": false, "required": [ "Direct" ] }, { "description": "A wake: no one spoke.", "type": "string", "const": "Wake" }, { "description": "A Self run of hers, by its label.", "type": "object", "properties": { "SelfRun": { "type": "object", "properties": { "run": { "$ref": "#/$defs/Short" } }, "required": [ "run" ] } }, "additionalProperties": false, "required": [ "SelfRun" ] } ] }, "MemorySort": { "type": "string", "enum": [ "Asked", "Decided", "Committed", "Learned", "Did", "Idea", "Rapport" ] }, "MutationRecord": { "description": "One mutation a report ran: a key-safe label a verdict claim can name,\nthe exact edit, and the tree it was applied to.", "type": "object", "properties": { "after": { "$ref": "#/$defs/Line" }, "before": { "$ref": "#/$defs/Line" }, "commit": { "$ref": "#/$defs/Sha" }, "failed_as_expected": { "type": "boolean" }, "label": { "$ref": "#/$defs/Label" }, "location": { "$ref": "#/$defs/CodeLocation" }, "rule": { "$ref": "#/$defs/Line" } }, "required": [ "label", "rule", "location", "before", "after", "commit", "failed_as_expected" ] }, "NegativeCheck": { "type": "object", "properties": { "pattern": { "$ref": "#/$defs/Short" }, "scope": { "$ref": "#/$defs/Line" } }, "required": [ "pattern", "scope" ] }, "OrgRepo": { "description": "A GitHub repository as `Org/Repo`, at most 140 UTF-8 bytes (39 + 1 +\n100). The owner is 1 to 39 `[A-Za-z0-9-]` bytes with no leading or\ntrailing hyphen; the repo is 1 to 100 `[A-Za-z0-9._-]` bytes, is never\n`.` or `..`, and does not end in `.git`, ASCII-case-insensitively.\nIdentity is case-insensitive: `GameCult/Epiphany` and `gamecult/epiphany`\nare the same repository.", "type": "string", "maxLength": 140 }, "Para": { "description": "Text of at most 4,000 UTF-8 bytes; longer narrative is cited by `DocRef`.", "type": "string", "maxLength": 4000 }, "PipelineAdmissionBatch": { "description": "One admission request: the mind it is for, who asks, and the documents.\nRides the wire whole (`wire::HuginnMindRequest::Admit`).", "type": "object", "properties": { "documents": { "type": "array", "items": { "$ref": "#/$defs/PipelineDocument" } }, "instance": { "$ref": "#/$defs/Slug" }, "provenance": { "$ref": "#/$defs/PipelineProvenance" } }, "required": [ "instance", "provenance", "documents" ] }, "PipelineCampaign": { "type": "object", "properties": { "repos": { "type": "array", "items": { "$ref": "#/$defs/OrgRepo" }, "maxItems": 8 }, "slug": { "$ref": "#/$defs/Slug" }, "target_doc": { "$ref": "#/$defs/DocRef" }, "title": { "$ref": "#/$defs/Title" }, "working_branch": { "$ref": "#/$defs/Short" } }, "required": [ "slug", "title", "repos", "working_branch", "target_doc" ] }, "PipelineCutReport": { "type": "object", "properties": { "attempt": { "type": "integer", "format": "uint32", "minimum": 0 }, "branch": { "$ref": "#/$defs/Short" }, "campaign": { "$ref": "#/$defs/Slug" }, "commits": { "type": "array", "items": { "$ref": "#/$defs/ReportCommit" }, "maxItems": 128 }, "cut_spec": { "$ref": "#/$defs/Short" }, "deviations": { "type": "array", "items": { "$ref": "#/$defs/Deviation" }, "maxItems": 32 }, "forks": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 8 }, "landed_names": { "type": "array", "items": { "$ref": "#/$defs/LandedName" }, "maxItems": 128 }, "mutations": { "type": "array", "items": { "$ref": "#/$defs/MutationRecord" }, "maxItems": 64 }, "promises": { "type": "array", "items": { "$ref": "#/$defs/Promise" }, "maxItems": 64 }, "range": { "$ref": "#/$defs/CommitRange" }, "repo": { "$ref": "#/$defs/OrgRepo" }, "structural_delta": { "$ref": "#/$defs/StructuralDelta" }, "undone": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 32 }, "verification": { "type": "array", "items": { "$ref": "#/$defs/Evidence" }, "maxItems": 64 } }, "required": [ "campaign", "cut_spec", "attempt", "repo", "branch", "commits", "range", "verification", "mutations", "deviations", "forks", "structural_delta", "landed_names", "undone", "promises" ] }, "PipelineCutSpec": { "type": "object", "properties": { "adds": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 64 }, "authority_map": { "anyOf": [ { "$ref": "#/$defs/AuthorityMap" }, { "type": "null" } ] }, "base": { "$ref": "#/$defs/Sha" }, "branch": { "$ref": "#/$defs/Short" }, "campaign": { "$ref": "#/$defs/Slug" }, "cut": { "$ref": "#/$defs/Label" }, "deletes": { "type": "array", "items": { "$ref": "#/$defs/CutDelete" }, "maxItems": 64 }, "depends_on": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 8 }, "estimate": { "$ref": "#/$defs/StructuralDelta" }, "file_changes": { "type": "array", "items": { "$ref": "#/$defs/FileChange" }, "maxItems": 256 }, "first": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 16 }, "keeps_moves": { "type": "array", "items": { "$ref": "#/$defs/Line" }, "maxItems": 64 }, "questions": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 16 }, "reads": { "type": "array", "items": { "$ref": "#/$defs/ReadAnchor" }, "maxItems": 16 }, "repo": { "$ref": "#/$defs/OrgRepo" }, "revision": { "type": "integer", "format": "uint32", "minimum": 0 }, "rulings": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 32 }, "title": { "$ref": "#/$defs/Title" }, "verification": { "$ref": "#/$defs/CutVerification" } }, "required": [ "campaign", "cut", "revision", "title", "repo", "branch", "base", "depends_on", "first", "deletes", "keeps_moves", "adds", "file_changes", "verification", "estimate", "rulings", "questions" ] }, "PipelineDocument": { "description": "The envelope enum, adjacently tagged on the kind name: a document\non a wire is `{ kind, value }`, and `kind` is exactly what\n`PipelineKind::name()` returns, so a reader dispatches on the kind\nsegment it already knows from the key and needs no second registry\nmapping variant spellings to kinds. Adjacent rather than internal\nbecause a value is a named map of its own and an internal tag would\nhave to be merged into it; the tag stays beside the value instead.\nThis is not a published schema: `schemas/cultnet` publishes the\nsixteen per-kind value documents, and the envelope is the wire's\nshape, not a document's.", "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "campaign" }, "value": { "$ref": "#/$defs/PipelineCampaign" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "target" }, "value": { "$ref": "#/$defs/PipelineTarget" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "question" }, "value": { "$ref": "#/$defs/PipelineQuestion" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "ruling" }, "value": { "$ref": "#/$defs/PipelineRuling" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "cut_spec" }, "value": { "$ref": "#/$defs/PipelineCutSpec" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "cut_report" }, "value": { "$ref": "#/$defs/PipelineCutReport" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "verdict" }, "value": { "$ref": "#/$defs/PipelineVerdict" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "finding" }, "value": { "$ref": "#/$defs/PipelineFinding" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "follow_up" }, "value": { "$ref": "#/$defs/PipelineFollowUp" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "resolution" }, "value": { "$ref": "#/$defs/PipelineResolution" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "instance" }, "value": { "$ref": "#/$defs/PipelineInstance" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "stewardship" }, "value": { "$ref": "#/$defs/PipelineStewardship" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "hand_off" }, "value": { "$ref": "#/$defs/PipelineHandOff" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "run" }, "value": { "$ref": "#/$defs/PipelineRun" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "pulse" }, "value": { "$ref": "#/$defs/PipelinePulse" } }, "required": [ "kind", "value" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "memory" }, "value": { "$ref": "#/$defs/PipelineMemory" } }, "required": [ "kind", "value" ] } ] }, "PipelineFinding": { "type": "object", "properties": { "campaign": { "$ref": "#/$defs/Slug" }, "claim": { "$ref": "#/$defs/Line" }, "confidence": { "$ref": "#/$defs/FindingConfidence" }, "evidence": { "type": "array", "items": { "$ref": "#/$defs/Evidence" }, "maxItems": 16 }, "failure_scenario": { "$ref": "#/$defs/Para" }, "invariants": { "type": "array", "items": { "$ref": "#/$defs/Label" }, "maxItems": 8 }, "label": { "$ref": "#/$defs/Label" }, "locations": { "type": "array", "items": { "$ref": "#/$defs/CodeLocation" }, "maxItems": 16 }, "origin": { "$ref": "#/$defs/FindingOrigin" }, "precedents": { "type": "array", "items": { "$ref": "#/$defs/ForeignRef" }, "maxItems": 8 }, "range": { "$ref": "#/$defs/CommitRange" }, "severity": { "$ref": "#/$defs/FindingSeverity" }, "verdict": { "$ref": "#/$defs/Short" } }, "required": [ "campaign", "verdict", "label", "range", "confidence", "severity", "claim", "invariants", "locations", "failure_scenario", "evidence", "precedents", "origin" ] }, "PipelineFollowUp": { "type": "object", "properties": { "campaign": { "$ref": "#/$defs/Slug" }, "item": { "$ref": "#/$defs/Line" }, "label": { "$ref": "#/$defs/Label" }, "locations": { "type": "array", "items": { "$ref": "#/$defs/CodeLocation" }, "maxItems": 16 }, "owner": { "$ref": "#/$defs/Short" }, "repo": { "$ref": "#/$defs/OrgRepo" }, "source": { "$ref": "#/$defs/PipelineRef" }, "why_it_can_wait": { "$ref": "#/$defs/Line" } }, "required": [ "campaign", "label", "source", "repo", "locations", "item", "why_it_can_wait", "owner" ] }, "PipelineHandOff": { "description": "A reassignment of stewardship, recorded in both minds. `documents` names\nwhat travels with it.", "type": "object", "properties": { "documents": { "type": "array", "items": { "$ref": "#/$defs/Short" }, "maxItems": 256 }, "from_instance": { "$ref": "#/$defs/Slug" }, "handed_on": { "$ref": "#/$defs/Date" }, "reason": { "$ref": "#/$defs/Para" }, "repo": { "$ref": "#/$defs/OrgRepo" }, "to_instance": { "$ref": "#/$defs/Slug" } }, "required": [ "from_instance", "to_instance", "repo", "documents", "reason", "handed_on" ] }, "PipelineInstance": { "description": "A mind's identity document. A store is canonical to exactly one\ninstance, and this says which; identity lives in the state, not in a\npath.", "type": "object", "properties": { "created_at": { "$ref": "#/$defs/Date" }, "display_name": { "$ref": "#/$defs/Short" }, "host": { "$ref": "#/$defs/Short" }, "instance": { "$ref": "#/$defs/Slug" } }, "required": [ "instance", "display_name", "created_at", "host" ] }, "PipelineKind": { "type": "string", "enum": [ "Campaign", "Target", "Question", "Ruling", "CutSpec", "CutReport", "Verdict", "Finding", "FollowUp", "Resolution", "Instance", "Stewardship", "HandOff", "Run", "Pulse", "Memory" ] }, "PipelineMemory": { "description": "One thing a Mind keeps for herself, in her own mind: what she was asked,\ndecided, committed to, learned or did, an idea, or the rapport between\nher and another Mind or person. `text` is her own words. `about` names\nthe Matrix users it concerns (Minds included) and nothing about where it\ncame from; `origin` is where and from whom she learned it, and `sources`\nthe event ids, commits or documents it rests on; the organ fills both,\nnot the model. `salience_permille` ranks it and decides nothing.\n`consolidates` names the memories a consolidating memory replaces.\nInstance-rooted: the key is `:memory: