Skip to Content
Validation

Validation

Context Nest defines validation rules for documents, source nodes, and cross-references. Run validation with:

ctx validate # Validate all documents ctx validate nodes/api # Validate a specific document ctx validate --json # JSON output for CI

Document rules

RuleCheck
1title is present and 1–200 characters
2type is a recognized node type
3tags are an array of strings starting with #
4status is draft or published
5version is a positive integer
6created_at / updated_at are valid ISO 8601 timestamps
7derived_from is a valid contextnest:// URI
8Body contains valid GFM markdown

Source node rules

RuleCheck
9source.transport is mcp, rest, cli, or file
10source.server references a server in config.yaml
11source.tools is an array of strings
12source.depends_on URIs are valid contextnest:// URIs
13source.cache_ttl is a non-negative integer
14Each depends_on URI resolves to a type: source node
15No circular dependencies in the source graph

Cross-reference rules

RuleCheck
16All contextnest:// URIs in document bodies resolve to existing documents
17Frontmatter depends_on and body-level references are consistent

CI integration

# GitHub Actions - name: Validate vault run: ctx validate --json

Exit code is non-zero if any validation fails.

Last updated on