diff --git a/schemas/host.schema.json b/schemas/host.schema.json index 04e41d7..c15f046 100644 --- a/schemas/host.schema.json +++ b/schemas/host.schema.json @@ -4,7 +4,7 @@ "type": "array", "items": { "type": "object", - "required": ["id", "name", "type", "status", "environment", "docs", "last_reviewed"], + "required": ["id", "name", "type", "status", "environment", "last_reviewed"], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, diff --git a/server/app/mcp_server.py b/server/app/mcp_server.py index a40d333..f0d227f 100644 --- a/server/app/mcp_server.py +++ b/server/app/mcp_server.py @@ -49,6 +49,12 @@ 4. Use commit_changes with a short factual summary. 5. For simple full-document replacements, update_doc may create, apply, validate, and commit in one call. +Inventory creation workflow (critical): +- Some inventory schemas (e.g., hosts) require a `docs` field linking to a Markdown file. +- Before creating an inventory item with a `docs` reference, use propose_doc_change to create the target Markdown document first, then apply_pending_change to apply it. +- Only after the document exists should you propose the inventory item with the `docs` path. +- Never use local filesystem tools to edit gnexus-book repository files directly — always use the MCP tools. + For propose_inventory_item_change, pass concrete top-level arguments, not a wrapper: inventory_type="hosts", item_id="bserv", mode="create", patch={"ip_address": "192.168.1.130", "user": "bserv"}, summary="Document bserv host". The patch object is the inventory item fields to create or update. @@ -98,6 +104,10 @@ 4. Use commit_changes with a concise factual summary. 5. Use update_doc only for simple full-document updates. +Inventory creation rule: +- When an inventory item requires a `docs` field, create the Markdown document first via propose_doc_change + apply_pending_change, then propose the inventory item. +- Never edit gnexus-book files directly through filesystem or terminal — always go through MCP tools. + Inventory write call shape: - propose_inventory_item_change(inventory_type, item_id, patch, summary, reason?, mode?) - Do not wrap arguments in params. diff --git a/server/app/validation.py b/server/app/validation.py index bba28b1..2c82985 100644 --- a/server/app/validation.py +++ b/server/app/validation.py @@ -70,7 +70,7 @@ issues.extend(_validate_schema_json(settings.repo_root / "schemas")) issues.extend(_validate_markdown_frontmatter(settings)) issues.extend(_validate_inventory(settings)) - issues.extend(_validate_inventory_doc_links(settings.repo_root)) + # _validate_inventory_doc_links disabled: docs links are now optional issues.extend(_validate_unique_inventory_ids(settings)) issues.extend(_validate_secret_patterns(settings.repo_root))