Skip to content

No edge key is structurally required

The rule

Normative: this is the rule
  1. An edge MUST be accepted structurally whatever members it carries.
  2. An absent source, target or handle MUST stay absent: an implementation MUST NOT fill it with the empty string or null when it reads, stores or returns the edge.
  3. An absent collection MUST default to the empty array.
  4. An edge without a source or a target MUST NOT be refused as a parse failure.
  5. Validation MUST refuse it as an edge missing its source or target, so an author is told what is wrong with the wire rather than that the document could not be read.

Why

Recorded under OPEN-25, OPEN-26.

Fixtures

Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.

  • An edge with no handles reads back with no handles read-edge

    Not the empty string, not null.

    {
      "given": {
        "edge": {
          "source": "n1",
          "target": "n2"
        }
      },
      "expect": {
        "edge": {
          "source": "n1",
          "target": "n2"
        }
      }
    }

    fixtures/presence/edge-absent-handles-stay-absent.json

  • An edge's handles read back as sent read-edge
    {
      "given": {
        "edge": {
          "source": "n1",
          "target": "n2",
          "sourceHandle": "n1-output-text",
          "targetHandle": "n2-input-prompt"
        }
      },
      "expect": {
        "edge": {
          "source": "n1",
          "target": "n2",
          "sourceHandle": "n1-output-text",
          "targetHandle": "n2-input-prompt"
        }
      }
    }

    fixtures/presence/edge-handles-kept.json

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · EDGE-2 · changed in spec 1.0