Skip to content

Expand automated test suite: schema validation, pipeline contracts, graph integrity in CI #136

@Alan-Jowett

Description

@Alan-Jowett

Summary

Expand PromptKit's automated test suite beyond the current validate-manifest.py to include frontmatter schema validation, pipeline contract chain validation, and graph integrity checking — all running in CI.

Motivation

GitHub Spec Kit has 13 pytest modules covering:

  • Manifest validation and schema enforcement
  • Agent config consistency (all supported agents have correct metadata)
  • Template resolution priority ordering
  • Extension/preset manifest schema validation
  • Release artifact parity checking

PromptKit currently has:

  • validate-manifest.py — checks manifest ↔ template protocol sync
  • validate-graph-integrity.py — exists but may not be in CI
  • self-audit-prompt.md — manual self-audit prompt
  • ❌ No frontmatter schema validation (required fields by component type)
  • ❌ No pipeline contract chain validation
  • ❌ No component cross-reference validation

Proposed Additions

1. Frontmatter schema validation

Validate that every component has the required frontmatter fields for its type:

  • Persona: name, description, domain, tone
  • Protocol: name, type (guardrail|analysis|reasoning), description
  • Format: name, type (format), description, produces
  • Template: name, description, persona, protocols, format, params, input_contract, output_contract

2. Pipeline contract chain validation

For each pipeline in manifest.yaml, verify that stage N's output_contract matches stage N+1's input_contract. Catch broken chains before they reach users.

3. Graph integrity in CI

validate-graph-integrity.py already exists — add it to the CI workflow alongside validate-manifest.py so it runs on every push/PR.

4. Component cross-reference validation

  • Every persona referenced by a template exists in personas/
  • Every protocol referenced by a template exists in protocols/
  • Every format referenced by a template exists in formats/
  • Every taxonomy referenced exists in taxonomies/

5. Dead component detection

Flag components that exist in the repo but are not referenced by any template or pipeline.

Credit

The testing depth and structure is inspired by GitHub Spec Kit's test suite. See their tests/ directory and TESTING.md for their approach to structural validation and manual testing mapping rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions