All contracts

Workspace Intelligence / JSON Schema

Workspai Graph Retrieval Token-Efficiency Report

A reproducible character-based estimate comparing readable proof-source text with one bounded graph retrieval payload. It is not an answer-quality or billing claim.

Schema version
workspace-graph-token-efficiency.v1
Contract path
contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json
Publication
json-schema
Defined fields
31
Artifact bindings
0

Why this contract exists

Architecture role

Relates workspace structure and change so downstream reasoning remains traceable.

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.

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
corpusobjectYesDefines the corpus value at this contract boundary.additionalProperties: false
corpus.artifactCountintegerYesDefines the artifactcount value at this contract boundary.minimum: 0
corpus.characterCountintegerYesDefines the charactercount value at this contract boundary.minimum: 0
corpus.estimatedTokensintegerYesDefines the estimatedtokens value at this contract boundary.minimum: 0
corpus.unreadableArtifactsarrayYesDefines the unreadableartifacts value at this contract boundary.
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
graphobjectYesDefines the graph value at this contract boundary.additionalProperties: false
graph.entityCountintegerYesDefines the entitycount value at this contract boundary.minimum: 0
graph.proofCountintegerYesDefines the proofcount value at this contract boundary.minimum: 0
graph.relationCountintegerYesDefines the relationcount value at this contract boundary.minimum: 0
graph.schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-knowledge-graph.v1"
graph.sourceArtifactstringYesDefines the sourceartifact value at this contract boundary.minLength: 1
graph.sourceHashstringYesDefines the sourcehash value at this contract boundary.pattern: ^[a-f0-9]{64}$
methodologyobjectYesDefines the methodology value at this contract boundary.additionalProperties: false
methodology.charsPerTokennumberYesDefines the charspertoken value at this contract boundary.const: 4
methodology.claimBoundarystringYesDefines the claimboundary value at this contract boundary.minLength: 1
methodology.estimatedbooleanYesDefines the estimated value at this contract boundary.const: true
methodology.idstringYesDefines the id value at this contract boundary.const: "indexed-corpus-vs-bounded-retrieval.v1"
querystringYesDefines the query value at this contract boundary.minLength: 1
retrievalobjectYesDefines the retrieval value at this contract boundary.additionalProperties: false
retrieval.characterCountintegerYesDefines the charactercount value at this contract boundary.minimum: 0
retrieval.estimatedTokensintegerYesDefines the estimatedtokens value at this contract boundary.minimum: 0
retrieval.matchCountintegerYesDefines the matchcount value at this contract boundary.minimum: 0 · maximum: 100
retrieval.payloadreferenceYesDefines the payload value at this contract boundary.ref: workspace-knowledge-search.v1.json
retrieval.truncatedbooleanYesDefines the truncated value at this contract boundary.
savingsobjectYesDefines the savings value at this contract boundary.additionalProperties: false
savings.estimatedTokensAvoidedintegerYesDefines the estimatedtokensavoided value at this contract boundary.minimum: 0
savings.reductionPercentnumberYesDefines the reductionpercent value at this contract boundary.minimum: 0 · maximum: 100
savings.reductionRationumberYesDefines the reductionratio value at this contract boundary.minimum: 0
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-graph-token-efficiency.v1"
workspacePathstringYesDefines the workspacepath 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://getrapidkit.com/schemas/workspace-graph-token-efficiency.v1.json",
  "title": "Workspai Graph Retrieval Token-Efficiency Report",
  "description": "A reproducible character-based estimate comparing readable proof-source text with one bounded graph retrieval payload. It is not an answer-quality or billing claim.",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "workspacePath",
    "query",
    "graph",
    "methodology",
    "corpus",
    "retrieval",
    "savings"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-graph-token-efficiency.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "workspacePath": {
      "type": "string",
      "minLength": 1
    },
    "query": {
      "type": "string",
      "minLength": 1
    },
    "graph": {
      "type": "object",
      "required": [
        "schemaVersion",
        "sourceArtifact",
        "sourceHash",
        "entityCount",
        "relationCount",
        "proofCount"
      ],
      "properties": {
        "schemaVersion": {
          "const": "workspace-knowledge-graph.v1"
        },
        "sourceArtifact": {
          "type": "string",
          "minLength": 1
        },
        "sourceHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "entityCount": {
          "type": "integer",
          "minimum": 0
        },
        "relationCount": {
          "type": "integer",
          "minimum": 0
        },
        "proofCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "methodology": {
      "type": "object",
      "required": [
        "id",
        "estimated",
        "charsPerToken",
        "claimBoundary"
      ],
      "properties": {
        "id": {
          "const": "indexed-corpus-vs-bounded-retrieval.v1"
        },
        "estimated": {
          "const": true
        },
        "charsPerToken": {
          "const": 4
        },
        "claimBoundary": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "corpus": {
      "type": "object",
      "required": [
        "artifactCount",
        "characterCount",
        "estimatedTokens",
        "unreadableArtifacts"
      ],
      "properties": {
        "artifactCount": {
          "type": "integer",
          "minimum": 0
        },
        "characterCount": {
          "type": "integer",
          "minimum": 0
        },
        "estimatedTokens": {
          "type": "integer",
          "minimum": 0
        },
        "unreadableArtifacts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "retrieval": {
      "type": "object",
      "required": [
        "matchCount",
        "characterCount",
        "estimatedTokens",
        "truncated",
        "payload"
      ],
      "properties": {
        "matchCount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "characterCount": {
          "type": "integer",
          "minimum": 0
        },
        "estimatedTokens": {
          "type": "integer",
          "minimum": 0
        },
        "truncated": {
          "type": "boolean"
        },
        "payload": {
          "$ref": "workspace-knowledge-search.v1.json"
        }
      },
      "additionalProperties": false
    },
    "savings": {
      "type": "object",
      "required": [
        "estimatedTokensAvoided",
        "reductionRatio",
        "reductionPercent"
      ],
      "properties": {
        "estimatedTokensAvoided": {
          "type": "integer",
          "minimum": 0
        },
        "reductionRatio": {
          "type": "number",
          "minimum": 0
        },
        "reductionPercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}