All contracts

Workspace Intelligence / JSON Schema

Workspai agent task route

A bounded project route from Workspai evidence. Suggested actions do not grant permission or attest to execution.

Schema version
https://workspai.dev/schemas/workspace-intelligence/agent-task-route.v1.json
Contract path
contracts/workspace-intelligence/agent-task-route.v1.json
Publication
json-schema
Defined fields
50
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
$defs.inspect.effectstringYesDefines the effect value at this contract boundary.const: "read"
$defs.inspect.filesarrayYesDefines the files value at this contract boundary.minItems: 1 · maxItems: 3
$defs.inspect.files[].evidenceIdstringNoDefines the evidenceid value at this contract boundary.minLength: 1
$defs.inspect.files[].lineintegerNoDefines the line value at this contract boundary.minimum: 1
$defs.inspect.files[].pathstringYesDefines the path value at this contract boundary.minLength: 1
$defs.inspect.files[].relationobjectNoDefines the relation value at this contract boundary.additionalProperties: false
$defs.inspect.files[].relation.idstringYesDefines the id value at this contract boundary.minLength: 1
$defs.inspect.files[].relation.kindenumYesDefines the kind value at this contract boundary.enum: imports, calls, tests
$defs.inspect.idstringYesDefines the id value at this contract boundary.const: "source.inspect"
$defs.inspect.scopestringYesDefines the scope value at this contract boundary.const: "project"
$defs.review.effectstringYesDefines the effect value at this contract boundary.const: "read"
$defs.review.idstringYesDefines the id value at this contract boundary.const: "lifecycle.review"
$defs.review.manifeststringNoDefines the manifest value at this contract boundary.minLength: 1
$defs.review.reasonstringYesDefines the reason value at this contract boundary.const: "no-suggested-test"
$defs.review.scopestringYesDefines the scope value at this contract boundary.const: "project"
$defs.review.whenstringYesDefines the when value at this contract boundary.const: "after-source-change"
$defs.search.cwdstringYesDefines the cwd value at this contract boundary.const: "."
$defs.search.effectstringYesDefines the effect value at this contract boundary.const: "read"
$defs.search.idstringYesDefines the id value at this contract boundary.const: "source.search"
$defs.search.scopestringYesDefines the scope value at this contract boundary.const: "project"
$defs.select.argsarrayYesDefines the args value at this contract boundary.const: ["project","lifecycle","plan","--project","<verified-source-root>","--path","<verified-source-path>","--strict","--json"]
$defs.select.cwdstringYesDefines the cwd value at this contract boundary.const: "."
$defs.select.effectstringYesDefines the effect value at this contract boundary.const: "read"
$defs.select.executablestringYesDefines the executable value at this contract boundary.const: "workspai"
$defs.select.idstringYesDefines the id value at this contract boundary.const: "lifecycle.select"
$defs.select.scopestringYesDefines the scope value at this contract boundary.const: "project"
$defs.select.whenstringYesDefines the when value at this contract boundary.const: "source-path-known"
$defs.test.argvSequencearrayNoDefines the argvsequence value at this contract boundary.minItems: 1
$defs.test.argvSequence[].argsarrayYesDefines the args value at this contract boundary.—
$defs.test.argvSequence[].executablestringYesDefines the executable value at this contract boundary.minLength: 1
$defs.test.commandstringYesDefines the command value at this contract boundary.minLength: 1
$defs.test.confidenceenumYesDefines the confidence value at this contract boundary.enum: high, medium
$defs.test.cwdstringYesDefines the cwd value at this contract boundary.minLength: 1
$defs.test.effectstringYesDefines the effect value at this contract boundary.const: "execute-project-check"
$defs.test.focusstringNoDefines the focus value at this contract boundary.minLength: 1
$defs.test.idstringYesDefines the id value at this contract boundary.const: "lifecycle.test"
$defs.test.manifeststringYesDefines the manifest value at this contract boundary.minLength: 1
$defs.test.preflightenumYesDefines the preflight value at this contract boundary.enum: executable-and-inputs, executable
$defs.test.provenancestringYesDefines the provenance value at this contract boundary.const: "manifest-derived"
$defs.test.runnerstringYesDefines the runner value at this contract boundary.const: "inspect-once"
$defs.test.scopestringYesDefines the scope value at this contract boundary.const: "project"
$defs.test.selectedByenumYesDefines the selectedby value at this contract boundary.enum: exact-manifest, source-runtime, single-unit
$defs.test.setupobjectNoDefines the setup value at this contract boundary.additionalProperties: false
$defs.test.setup.argsarrayYesDefines the args value at this contract boundary.—
$defs.test.setup.executablestringYesDefines the executable value at this contract boundary.minLength: 1
$defs.test.sourceManifeststringNoDefines the sourcemanifest value at this contract boundary.minLength: 1
$defs.test.whenstringYesDefines the when value at this contract boundary.const: "after-source-change"
$defs.test.workspaceOwnerobjectNoDefines the workspaceowner value at this contract boundary.additionalProperties: false
$defs.test.workspaceOwner.manifeststringYesDefines the manifest value at this contract boundary.minLength: 1
$defs.test.workspaceOwner.rootstringYesDefines the root value at this contract boundary.minLength: 1

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/agent-task-route.v1.json",
  "title": "Workspai agent task route",
  "description": "A bounded project route from Workspai evidence. Suggested actions do not grant permission or attest to execution.",
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "status",
        "scope",
        "selection",
        "cwdBase",
        "host",
        "grounding",
        "graph",
        "actions",
        "budget",
        "integrity",
        "execution"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspai.agent-task-route.v1"
        },
        "status": {
          "enum": [
            "ready",
            "partial"
          ]
        },
        "scope": {
          "$ref": "agent-task-context.v1.json#/oneOf/0/properties/scope"
        },
        "selection": {
          "$ref": "agent-task-context.v1.json#/oneOf/0/properties/selection"
        },
        "cwdBase": {
          "const": "canonical-project-root"
        },
        "host": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "availability",
            "permission",
            "execution"
          ],
          "properties": {
            "availability": {
              "const": "not-observed"
            },
            "permission": {
              "const": "not-observed"
            },
            "execution": {
              "const": "not-observed"
            }
          }
        },
        "grounding": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status",
            "sourceMutation",
            "findings"
          ],
          "properties": {
            "status": {
              "enum": [
                "ready",
                "degraded",
                "blocked",
                "unavailable",
                "insufficient-budget"
              ]
            },
            "sourceMutation": {
              "enum": [
                "governed-cli-transaction-only",
                "risk-and-project-policy-based",
                "unknown"
              ]
            },
            "findings": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "uniqueItems": true
            },
            "goalEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 2
            }
          }
        },
        "graph": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "enum": [
                "candidates",
                "no-matches",
                "unavailable",
                "insufficient-budget"
              ]
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "evidence": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "executable",
                "cwd",
                "args"
              ],
              "properties": {
                "executable": {
                  "const": "workspai"
                },
                "cwd": {
                  "const": "."
                },
                "args": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1
                }
              }
            }
          }
        },
        "actions": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/inspect"
              },
              {
                "$ref": "#/$defs/search"
              },
              {
                "$ref": "#/$defs/access"
              },
              {
                "$ref": "#/$defs/test"
              },
              {
                "$ref": "#/$defs/select"
              },
              {
                "$ref": "#/$defs/review"
              }
            ]
          },
          "minItems": 2,
          "maxItems": 3
        },
        "budget": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "maxBytes",
            "usedBytes",
            "accounting"
          ],
          "properties": {
            "maxBytes": {
              "type": "integer",
              "minimum": 1024,
              "maximum": 131072
            },
            "usedBytes": {
              "type": "integer",
              "minimum": 1
            },
            "accounting": {
              "const": "utf8-json-with-newline"
            }
          }
        },
        "integrity": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "algorithm",
            "payloadHash"
          ],
          "properties": {
            "algorithm": {
              "const": "sha256"
            },
            "payloadHash": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        },
        "execution": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "projectRoot"
          ],
          "properties": {
            "projectRoot": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "anchor",
                "relativePath"
              ],
              "properties": {
                "anchor": {
                  "const": "request-project-root"
                },
                "relativePath": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "status",
        "reason",
        "recovery",
        "budget"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspai.agent-task-route.v1"
        },
        "status": {
          "const": "project-selection-required"
        },
        "reason": {
          "enum": [
            "unverified-working-directory",
            "path-not-found",
            "nested-project-boundary"
          ]
        },
        "recovery": {
          "$ref": "#/$defs/recovery"
        },
        "budget": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "maxBytes",
            "usedBytes",
            "accounting"
          ],
          "properties": {
            "maxBytes": {
              "type": "integer",
              "minimum": 1024,
              "maximum": 131072
            },
            "usedBytes": {
              "type": "integer",
              "minimum": 1
            },
            "accounting": {
              "const": "utf8-json-with-newline"
            }
          }
        }
      }
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "status",
        "reason",
        "recovery",
        "budget"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspai.agent-task-route.v1"
        },
        "status": {
          "const": "insufficient-budget"
        },
        "reason": {
          "const": "route-exceeds-budget"
        },
        "recovery": {
          "$ref": "#/$defs/recovery"
        },
        "budget": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "maxBytes",
            "usedBytes",
            "accounting",
            "requiredBytes"
          ],
          "properties": {
            "maxBytes": {
              "type": "integer",
              "minimum": 1024,
              "maximum": 131072
            },
            "usedBytes": {
              "type": "integer",
              "minimum": 1
            },
            "accounting": {
              "const": "utf8-json-with-newline"
            },
            "requiredBytes": {
              "type": "integer",
              "minimum": 1025
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "inspect": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "scope",
        "effect",
        "files"
      ],
      "properties": {
        "id": {
          "const": "source.inspect"
        },
        "scope": {
          "const": "project"
        },
        "effect": {
          "const": "read"
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "line": {
                "type": "integer",
                "minimum": 1
              },
              "evidenceId": {
                "type": "string",
                "minLength": 1
              },
              "relation": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "kind"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "enum": [
                      "imports",
                      "calls",
                      "tests"
                    ]
                  }
                }
              }
            }
          },
          "minItems": 1,
          "maxItems": 3
        }
      }
    },
    "search": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "scope",
        "effect",
        "cwd"
      ],
      "properties": {
        "id": {
          "const": "source.search"
        },
        "scope": {
          "const": "project"
        },
        "effect": {
          "const": "read"
        },
        "cwd": {
          "const": "."
        }
      }
    },
    "access": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "scope",
            "effect",
            "when",
            "approval",
            "retry"
          ],
          "properties": {
            "id": {
              "const": "graph.access"
            },
            "scope": {
              "const": "project"
            },
            "effect": {
              "const": "read"
            },
            "when": {
              "const": "graph-needed"
            },
            "approval": {
              "const": "host-read"
            },
            "retry": {
              "const": "same-command"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "scope",
            "effect",
            "when",
            "approval",
            "retry",
            "options"
          ],
          "properties": {
            "id": {
              "const": "graph.access"
            },
            "scope": {
              "const": "project"
            },
            "effect": {
              "const": "read"
            },
            "when": {
              "const": "graph-needed"
            },
            "approval": {
              "const": "canonical-workspace-selection"
            },
            "retry": {
              "const": "approved-workspace"
            },
            "options": {
              "oneOf": [
                {
                  "const": [
                    "--workspace"
                  ]
                },
                {
                  "const": [
                    "--workspace-default",
                    "--workspace"
                  ]
                }
              ]
            }
          }
        }
      ]
    },
    "test": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "scope",
        "effect",
        "when",
        "cwd",
        "manifest",
        "command",
        "preflight",
        "confidence",
        "provenance",
        "selectedBy",
        "runner"
      ],
      "properties": {
        "id": {
          "const": "lifecycle.test"
        },
        "scope": {
          "const": "project"
        },
        "effect": {
          "const": "execute-project-check"
        },
        "when": {
          "const": "after-source-change"
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "manifest": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "argvSequence": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "executable",
              "args"
            ],
            "properties": {
              "executable": {
                "type": "string",
                "minLength": 1
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "minItems": 1
        },
        "preflight": {
          "enum": [
            "executable-and-inputs",
            "executable"
          ]
        },
        "confidence": {
          "enum": [
            "high",
            "medium"
          ]
        },
        "provenance": {
          "const": "manifest-derived"
        },
        "workspaceOwner": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "root",
            "manifest"
          ],
          "properties": {
            "root": {
              "type": "string",
              "minLength": 1
            },
            "manifest": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "selectedBy": {
          "enum": [
            "exact-manifest",
            "source-runtime",
            "single-unit"
          ]
        },
        "runner": {
          "const": "inspect-once"
        },
        "sourceManifest": {
          "type": "string",
          "minLength": 1
        },
        "setup": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "executable",
            "args"
          ],
          "properties": {
            "executable": {
              "type": "string",
              "minLength": 1
            },
            "args": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "focus": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "select": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "scope",
        "effect",
        "when",
        "cwd",
        "executable",
        "args"
      ],
      "properties": {
        "id": {
          "const": "lifecycle.select"
        },
        "scope": {
          "const": "project"
        },
        "effect": {
          "const": "read"
        },
        "when": {
          "const": "source-path-known"
        },
        "cwd": {
          "const": "."
        },
        "executable": {
          "const": "workspai"
        },
        "args": {
          "const": [
            "project",
            "lifecycle",
            "plan",
            "--project",
            "<verified-source-root>",
            "--path",
            "<verified-source-path>",
            "--strict",
            "--json"
          ]
        }
      }
    },
    "recovery": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "message"
        ],
        "properties": {
          "kind": {
            "enum": [
              "retry",
              "native",
              "select-project",
              "select-path",
              "select-workspace"
            ]
          },
          "requiredOption": {
            "enum": [
              "--project",
              "--path",
              "--workspace",
              "--workspace-default"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "minItems": 1,
      "maxItems": 3
    },
    "review": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "scope",
        "effect",
        "when",
        "reason"
      ],
      "properties": {
        "id": {
          "const": "lifecycle.review"
        },
        "scope": {
          "const": "project"
        },
        "effect": {
          "const": "read"
        },
        "when": {
          "const": "after-source-change"
        },
        "reason": {
          "const": "no-suggested-test"
        },
        "manifest": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}