1
0
Fork 0
Code Issues Pull requests Projects Releases 2 Packages Wiki Activity Actions Pages

feat: establish read-only DocForge MCP foundation

This commit is contained in:
Andraxion 2026-07-22 01:29:32 -04:00
commit 9702ed1265
32 changed files with 3323 additions and 0 deletions

View file

@ -0,0 +1,36 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/changeset-v1.json",
"title": "DocForge isolated changeset",
"type": "object",
"required": ["schema_version", "changeset_id", "project_id", "root_fingerprint", "base_revision", "base_source_hash", "creator", "operations"],
"properties": {
"schema_version": { "const": 1 },
"changeset_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"project_id": { "type": "string" },
"root_fingerprint": { "type": "string" },
"base_revision": { "type": "string" },
"base_source_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"creator": { "type": "string", "minLength": 1 },
"operations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["operation", "node_id", "expected_content_hash", "rationale"],
"properties": {
"operation": { "enum": ["create", "update", "move", "delete"] },
"node_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"expected_content_hash": { "type": ["string", "null"] },
"target_source": { "type": ["string", "null"] },
"metadata": { "type": ["object", "null"] },
"content": { "type": ["string", "null"] },
"relationship_changes": { "type": "array" },
"rationale": { "type": "string", "minLength": 1 }
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}

13
schemas/edge.schema.json Normal file
View file

@ -0,0 +1,13 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/edge-v1.json",
"title": "DocForge generic edge",
"type": "object",
"required": ["source_id", "relation", "target_id"],
"properties": {
"source_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"relation": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"target_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" }
},
"additionalProperties": false
}

24
schemas/node.schema.json Normal file
View file

@ -0,0 +1,24 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/node-v1.json",
"title": "DocForge generic node metadata",
"type": "object",
"required": ["schema_version", "id", "title", "family", "authority", "status", "tags", "summary"],
"properties": {
"schema_version": { "const": 1 },
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"title": { "type": "string", "minLength": 1 },
"family": { "type": "string", "minLength": 1 },
"authority": { "enum": ["authoritative", "approved_plan", "derived", "proposal", "historical"] },
"status": { "type": "string", "minLength": 1 },
"tags": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"summary": { "type": "string", "minLength": 1 },
"source_anchor": { "type": "string", "minLength": 1 },
"content": { "type": "string", "minLength": 1 }
},
"additionalProperties": {
"type": "array",
"items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"uniqueItems": true
}
}

View file

@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/project-v1.json",
"title": "DocForge project descriptor",
"type": "object",
"required": ["schema_version", "project_id", "title", "adapter", "sources", "derived", "graph"],
"properties": {
"schema_version": { "const": 1 },
"project_id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" },
"title": { "type": "string", "minLength": 1 },
"adapter": { "type": "string", "minLength": 1 },
"sources": {
"type": "object",
"required": ["content_roots", "authority_files"],
"properties": {
"content_roots": { "$ref": "#/$defs/pathList" },
"authority_files": { "$ref": "#/$defs/pathList" }
},
"additionalProperties": false
},
"derived": {
"type": "object",
"required": ["cache_root", "index"],
"properties": {
"cache_root": { "$ref": "#/$defs/relativePath" },
"index": { "$ref": "#/$defs/relativePath" }
},
"additionalProperties": false
},
"graph": {
"type": "object",
"required": ["allowed_relations"],
"properties": {
"allowed_relations": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{1,127}$" } }
},
"additionalProperties": false
},
"limits": { "type": "object" },
"profiles": { "type": "array" }
},
"$defs": {
"relativePath": { "type": "string", "minLength": 1, "not": { "pattern": "(^/|(^|/)\\.\\.(/|$))" } },
"pathList": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/relativePath" } }
},
"additionalProperties": false
}

View file

@ -0,0 +1,36 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://docforge.local/schema/result-v1.json",
"title": "DocForge result envelope",
"oneOf": [
{
"type": "object",
"required": ["status", "project_id", "source_hash"],
"properties": {
"status": { "const": "ok" },
"project_id": { "type": "string" },
"revision": { "type": "string" },
"source_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"adapter": { "type": "string" }
}
},
{
"type": "object",
"required": ["status", "error"],
"properties": {
"status": { "const": "error" },
"error": {
"type": "object",
"required": ["code", "message", "details"],
"properties": {
"code": { "type": "string", "minLength": 1 },
"message": { "type": "string", "minLength": 1 },
"details": { "type": "object" }
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}