All contracts

Workspace Intelligence / JSON Schema

Workspai Goal Agent Handoff

Defines the versioned goal agent handoff v1 boundary used by Workspai and its consumers.

Schema version
workspai.goal-agent-handoff.v1
Contract path
contracts/workspace-intelligence/goal-agent-handoff.v1.json
Publication
json-schema
Defined fields
40
Artifact bindings
0

Why this contract exists

Architecture role

Projects workspace intelligence into stable grounding surfaces for agents and integrations.

Consumption boundary

  • Workspai CLI
  • AI agents
  • IDEs and MCP clients

Related commands

Commands are linked only when the runtime contract identifies a direct production relationship. Supporting contracts may be consumed without having a single producer command.

This is a supporting, capability, cache, compatibility, or consumer contract. It has no single direct producer command in the canonical Workspace Intelligence execution registry.

Produced artifacts

These durable files are emitted by registered commands and validated against this contract.

No canonical file artifact is registered for this contract. It may describe capabilities, embedded data, runtime exchange, or supporting state instead of a standalone report.

Field reference

Every declared schema property or published capability path is listed here. Required means the contract declares or publishes that field at the shown boundary.

Field pathTypeRequiredMeaningConstraints
consumerenumYesDefines the consumer value at this contract boundary.enum: generic, claude, codex
discoveryobjectYesDefines the discovery value at this contract boundary.additionalProperties: false
discovery.indexstringYesDefines the index value at this contract boundary.const: ".workspai/goals/index.json"
discovery.requiredReadsarrayYesDefines the requiredreads value at this contract boundary.minItems: 3
discovery.statusCommandstringYesDefines the statuscommand value at this contract boundary.pattern: ^workspai goal --status
evidencearrayYesDefines the evidence value at this contract boundary.minItems: 3
evidence[].artifactstringYesDefines the artifact value at this contract boundary.pattern: ^\.workspai/
evidence[].bindingobjectYesDefines the binding value at this contract boundary.additionalProperties: false
evidence[].binding.algorithmstringYesDefines the algorithm value at this contract boundary.const: "sha256"
evidence[].binding.semanticsenumYesDefines the semantics value at this contract boundary.enum: workspace-model-structural-v1, canonical-json-v1
evidence[].binding.valuereferenceYesDefines the value value at this contract boundary.ref: #/$defs/hash
evidence[].roleenumYesDefines the role value at this contract boundary.enum: model, graph, goal
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
goalFingerprintreferenceYesDefines the goalfingerprint value at this contract boundary.ref: #/$defs/hash
goalIdstringYesDefines the goalid value at this contract boundary.pattern: ^[A-Za-z0-9][A-Za-z0-9._-]{7,95}$
guardrailsarrayYesDefines the guardrails value at this contract boundary.minItems: 5
objectivestringYesDefines the objective value at this contract boundary.minLength: 1 · maxLength: 2000
renewalobjectYesDefines the renewal value at this contract boundary.additionalProperties: false
renewal.commandstringYesDefines the command value at this contract boundary.pattern: ^workspai goal
renewal.reasonstringYesDefines the reason value at this contract boundary.minLength: 1
retrievalobjectYesDefines the retrieval value at this contract boundary.additionalProperties: false
retrieval.anchorsarrayYesDefines the anchors value at this contract boundary.maxItems: 20
retrieval.anchors[].entityIdstringYesDefines the entityid value at this contract boundary.
retrieval.anchors[].kindstringYesDefines the kind value at this contract boundary.
retrieval.anchors[].labelstringYesDefines the label value at this contract boundary.
retrieval.anchors[].proofIdsarrayYesDefines the proofids value at this contract boundary.
retrieval.queriesarrayYesDefines the queries value at this contract boundary.minItems: 1 · maxItems: 3
retrieval.statusenumYesDefines the status value at this contract boundary.enum: grounded, partial, empty
retrieval.strategystringYesDefines the strategy value at this contract boundary.const: "deterministic-category-v1"
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspai.goal-agent-handoff.v1"
scopeobjectYesDefines the scope value at this contract boundary.additionalProperties: false
scope.kindenumYesDefines the kind value at this contract boundary.enum: workspace, project, project-set
scope.projectsarrayYesDefines the projects value at this contract boundary.minItems: 1
scope.resolutionenumNoDefines the resolution value at this contract boundary.enum: selected, selection-required
scope.selectionSourceenumYesDefines the selectionsource value at this contract boundary.enum: workspace, single-project-workspace, invocation-project, explicit, interactive
stateenumYesDefines the state value at this contract boundary.enum: ready-to-plan, needs-confirmation, needs-evidence, blocked
workflowarrayYesDefines the workflow value at this contract boundary.minItems: 5
workflow[].instructionstringYesDefines the instruction value at this contract boundary.minLength: 1
workflow[].orderintegerYesDefines the order value at this contract boundary.minimum: 1
workflow[].ownerenumYesDefines the owner value at this contract boundary.enum: workspai-cli, agent, human

Canonical machine-readable definition

The raw synchronized contract remains authoritative. The educational sections above are projections of this definition.

Show raw JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/workspace-intelligence/goal-agent-handoff.v1.json",
  "title": "Workspai Goal Agent Handoff",
  "type": "object",
  "required": [
    "schemaVersion",
    "goalId",
    "goalFingerprint",
    "generatedAt",
    "consumer",
    "state",
    "objective",
    "scope",
    "discovery",
    "retrieval",
    "evidence",
    "guardrails",
    "workflow",
    "renewal"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspai.goal-agent-handoff.v1"
    },
    "goalId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{7,95}$"
    },
    "goalFingerprint": {
      "$ref": "#/$defs/hash"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "consumer": {
      "enum": [
        "generic",
        "claude",
        "codex"
      ]
    },
    "state": {
      "enum": [
        "ready-to-plan",
        "needs-confirmation",
        "needs-evidence",
        "blocked"
      ]
    },
    "objective": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
    },
    "scope": {
      "type": "object",
      "required": [
        "kind",
        "projects",
        "selectionSource"
      ],
      "properties": {
        "kind": {
          "enum": [
            "workspace",
            "project",
            "project-set"
          ]
        },
        "projects": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "selectionSource": {
          "enum": [
            "workspace",
            "single-project-workspace",
            "invocation-project",
            "explicit",
            "interactive"
          ]
        },
        "resolution": {
          "enum": [
            "selected",
            "selection-required"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "kind": {
                "const": "project"
              }
            }
          },
          "then": {
            "properties": {
              "projects": {
                "type": "array",
                "maxItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "project-set"
              }
            }
          },
          "then": {
            "properties": {
              "projects": {
                "type": "array",
                "minItems": 2
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "resolution": {
                "const": "selection-required"
              }
            },
            "required": [
              "resolution"
            ]
          },
          "then": {
            "properties": {
              "kind": {
                "const": "workspace"
              },
              "selectionSource": {
                "const": "workspace"
              }
            }
          }
        }
      ],
      "additionalProperties": false
    },
    "evidence": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "required": [
          "role",
          "artifact",
          "binding"
        ],
        "properties": {
          "role": {
            "enum": [
              "model",
              "graph",
              "goal"
            ]
          },
          "artifact": {
            "type": "string",
            "pattern": "^\\.workspai/"
          },
          "binding": {
            "type": "object",
            "required": [
              "algorithm",
              "semantics",
              "value"
            ],
            "properties": {
              "algorithm": {
                "const": "sha256"
              },
              "semantics": {
                "enum": [
                  "workspace-model-structural-v1",
                  "canonical-json-v1"
                ]
              },
              "value": {
                "$ref": "#/$defs/hash"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    },
    "discovery": {
      "type": "object",
      "required": [
        "index",
        "statusCommand",
        "requiredReads"
      ],
      "properties": {
        "index": {
          "const": ".workspai/goals/index.json"
        },
        "statusCommand": {
          "type": "string",
          "pattern": "^workspai goal --status "
        },
        "requiredReads": {
          "type": "array",
          "minItems": 3,
          "items": {
            "type": "string",
            "pattern": "^\\.workspai/"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "retrieval": {
      "type": "object",
      "required": [
        "status",
        "strategy",
        "queries",
        "anchors"
      ],
      "properties": {
        "status": {
          "enum": [
            "grounded",
            "partial",
            "empty"
          ]
        },
        "strategy": {
          "const": "deterministic-category-v1"
        },
        "queries": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "anchors": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "object",
            "required": [
              "entityId",
              "kind",
              "label",
              "proofIds"
            ],
            "properties": {
              "entityId": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "proofIds": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "guardrails": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "workflow": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": [
          "order",
          "owner",
          "instruction"
        ],
        "properties": {
          "order": {
            "type": "integer",
            "minimum": 1
          },
          "owner": {
            "enum": [
              "workspai-cli",
              "agent",
              "human"
            ]
          },
          "instruction": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    },
    "renewal": {
      "type": "object",
      "required": [
        "command",
        "reason"
      ],
      "properties": {
        "command": {
          "type": "string",
          "pattern": "^workspai goal "
        },
        "reason": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "hash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  },
  "additionalProperties": false
}