All contracts

Workspace operations / JSON Schema

Workspai Project Workspace Link

Machine-local, gitignored binding from a Workspai project to its canonical workspace. Absolute paths are permitted only in this local contract.

Schema version
project-workspace-link.v1
Contract path
contracts/project-workspace-link.v1.json
Publication
json-schema
Defined fields
16
Artifact bindings
1

Why this contract exists

Architecture role

Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.

Consumption boundary

  • Workspai CLI
  • Workspace Intelligence consumers
  • IDEs and agents

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.

Produced artifacts

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

Artifact pathSchemaProducer
.workspai/workspace-link.local.jsonproject-workspace-link.v1
workspai adopt
workspai import
workspai project workspace relink
workspai workspace sync

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
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
integrityobjectYesDefines the integrity value at this contract boundary.additionalProperties: false
integrity.algorithmstringYesDefines the algorithm value at this contract boundary.const: "sha256"
integrity.bindingstringYesDefines the binding value at this contract boundary.pattern: ^[a-f0-9]{64}$
kindstringYesDefines the kind value at this contract boundary.const: "workspai.project-workspace-link"
projectobjectYesDefines the project value at this contract boundary.additionalProperties: false
project.namestringYesDefines the name value at this contract boundary.minLength: 1
project.relationshipenumYesDefines the relationship value at this contract boundary.enum: managed, adopted, imported, linked, restored
project.relativePathstringYesDefines the relativepath value at this contract boundary.minLength: 1
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "project-workspace-link.v1"
statestringYesDefines the state value at this contract boundary.const: "active"
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.contractstringYesDefines the contract value at this contract boundary.const: ".workspai/workspace.contract.json"
workspace.markerenumYesDefines the marker value at this contract boundary.enum: .workspai-workspace, .workspai/workspace.json
workspace.namestringYesDefines the name value at this contract boundary.minLength: 1
workspace.rootstringYesMachine-local absolute workspace path. This file must remain gitignored.pattern: ^(?:/|[A-Za-z]:[\\/]) · 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/project-workspace-link.v1.json",
  "title": "Workspai Project Workspace Link",
  "description": "Machine-local, gitignored binding from a Workspai project to its canonical workspace. Absolute paths are permitted only in this local contract.",
  "type": "object",
  "required": [
    "schemaVersion",
    "kind",
    "generatedAt",
    "state",
    "workspace",
    "project",
    "integrity"
  ],
  "properties": {
    "schemaVersion": {
      "const": "project-workspace-link.v1"
    },
    "kind": {
      "const": "workspai.project-workspace-link"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "state": {
      "const": "active"
    },
    "workspace": {
      "type": "object",
      "required": [
        "name",
        "root",
        "marker",
        "contract"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "root": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?:/|[A-Za-z]:[\\\\/])",
          "description": "Machine-local absolute workspace path. This file must remain gitignored."
        },
        "marker": {
          "enum": [
            ".workspai-workspace",
            ".workspai/workspace.json"
          ]
        },
        "contract": {
          "const": ".workspai/workspace.contract.json"
        }
      },
      "additionalProperties": false
    },
    "project": {
      "type": "object",
      "required": [
        "name",
        "relativePath",
        "relationship"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "relativePath": {
          "type": "string",
          "minLength": 1,
          "not": {
            "pattern": "(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$)|^(?:/|[A-Za-z]:[\\\\/])"
          }
        },
        "relationship": {
          "enum": [
            "managed",
            "adopted",
            "imported",
            "linked",
            "restored"
          ]
        }
      },
      "additionalProperties": false
    },
    "integrity": {
      "type": "object",
      "required": [
        "algorithm",
        "binding"
      ],
      "properties": {
        "algorithm": {
          "const": "sha256"
        },
        "binding": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}