UmweltDocs
Reference/Commands/propose
proposecommandsince 0.1

Holds a commit for review instead of applying it.

Request
umwelt call story.umw propose '{
  "projectId": "ball",
  "event": {
    "id": "confession",
    "type": "scene",
    "title": "The confession",
    "position": { "tick": 10 },
    "participants": ["bob", "duchess"],
    "provenance": { "origin": { "kind": "human" } }
  },
  "records": [
    {
      "kind": "holding",
      "id": "duchess-knows",
      "position": { "tick": 10 },
      "provenance": { "origin": { "kind": "human" } },
      "holder": "duchess",
      "attitude": "knows",
      "confidence": 1,
      "accessibility": "available",
      "acquisition": {
        "kind": "told-by",
        "sourceHolderId": "bob",
        "sourceRecordId": "bob-did",
        "intent": "honest"
      },
      "claim": {
        "subject": "bob",
        "predicate": "stole",
        "object": { "kind": "entity", "id": "necklace" },
        "polarity": true
      }
    }
  ],
  "transitions": [
    {
      "targetRecordId": "duchess-told",
      "status": "superseded",
      "supersededBy": "duchess-knows",
      "position": { "tick": 10 },
      "provenance": { "origin": { "kind": "human" } }
    }
  ]
}'
Request
const result = await client.propose({
  projectId: 'ball',
  event: {
    id: 'confession',
    type: 'scene',
    title: 'The confession',
    position: { tick: 10 },
    participants: ['bob', 'duchess'],
    provenance: provenance,
  },
  records: [
    {
      kind: 'holding',
      id: 'duchess-knows',
      position: { tick: 10 },
      provenance: provenance,
      holder: 'duchess',
      attitude: 'knows',
      confidence: 1,
      accessibility: 'available',
      acquisition: {
        kind: 'told-by',
        sourceHolderId: 'bob',
        sourceRecordId: 'bob-did',
        intent: 'honest',
      },
      claim: theft,
    },
  ],
  transitions: [
    {
      targetRecordId: 'duchess-told',
      status: 'superseded',
      supersededBy: 'duchess-knows',
      position: { tick: 10 },
      provenance: provenance,
    },
  ],
});
Request
var result = engine.Propose(new ProposeInput
{
    ProjectId = "ball",
    Event = new EventInput
    {
        Id = "confession",
        Type = "scene",
        Title = "The confession",
        Position = new Position { Tick = 10 },
        Participants = new() { "bob", "duchess" },
        Provenance = provenance,
    },
    Records = new()
    {
        new RecordInput.Holding
        {
            Id = "duchess-knows",
            Position = new Position { Tick = 10 },
            Provenance = provenance,
            Holder = "duchess",
            Attitude = Attitude.Knows,
            Confidence = 1.0,
            Accessibility = Accessibility.Available,
            Acquisition = new Acquisition.ToldBy
            {
                SourceHolderId = "bob",
                SourceRecordId = "bob-did",
                Intent = Intent.Honest,
            },
            Claim = theft,
        },
    },
    Transitions = new()
    {
        new TransitionInput
        {
            TargetRecordId = "duchess-told",
            Status = TransitionStatus.Superseded,
            SupersededBy = "duchess-knows",
            Position = new Position { Tick = 10 },
            Provenance = provenance,
        },
    },
});
Response
{
  "id": "01a1cbd8-63fc-7ec1-aac1-c0b733797443",
  "status": "pending",
  "input": {
    "projectId": "ball",
    "event": {
      "id": "confession",
      "title": "The confession",
      "position": { "tick": 10 },
      "evidence": [],
      "participants": ["bob", "duchess"],
      "provenance": { "origin": { "kind": "human" } },
      "type": "scene"
    },
    "records": [
      {
        "kind": "holding",
        "id": "duchess-knows",
        "holder": "duchess",
        "claim": {
          "subject": "bob",
          "predicate": "stole",
          "object": { "kind": "entity", "id": "necklace" },
          "polarity": true,
          "qualifiers": {}
        },
        "attitude": "knows",
        "confidence": 1.0,
        "accessibility": "available",
        "acquisition": {
          "kind": "told-by",
          "intent": "honest",
          "sourceHolderId": "bob",
          "sourceRecordId": "bob-did"
        },
        "position": { "tick": 10 },
        "provenance": { "origin": { "kind": "human" } }
      }
    ],
    "transitions": [
      {
        "status": "superseded",
        "position": { "tick": 10 },
        "provenance": { "origin": { "kind": "human" } },
        "supersededBy": "duchess-knows",
        "targetRecordId": "duchess-told"
      }
    ]
  },
  "reviews": []
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to write to.
eventrequiredEventInputThe event the records are written in: its type, title and position, and optionally its participants, location, evidence and positions on other axes.
recordsRecordInput[]default []The records proposed.
transitionsTransitionInput[]default []The transitions proposed.
timelineIdstringdefault "main"The timeline to write to.
expectedVersionintegerFails the write with VERSION_CONFLICT unless the timeline’s head is still this version.

Result

FieldTypeDescription
statusalways"pending" | "applied" | "partially-applied" | "rejected"pending, for a new proposal.
idalwaysstringThe proposal’s id.
inputalwaysProposeInputThe commit it holds: the event, records and transitions, as proposed.
reviewsProposalReview[]Every review so far, oldest first. The latest one for an operation decides it.
rejectionRationalestringWhy it was rejected, when it was.

Rules

Operations are numbered. Records first, then transitions, from 0. Reviews name them by that index.

Nothing is written yet. The proposal is checked when it is rebased or applied, against the timeline as it is then.

Errors

VALIDATION_FAILEDThe payload is malformed.
NOT_FOUNDThe project does not exist.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?