Skip to content

Add prompt graph integrity checks (issue #111 step 1)#114

Merged
Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Alan-Jowett:feature/graph-integrity-checks
Mar 30, 2026
Merged

Add prompt graph integrity checks (issue #111 step 1)#114
Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Alan-Jowett:feature/graph-integrity-checks

Conversation

@Alan-Jowett
Copy link
Copy Markdown
Member

Summary

Adds a comprehensive prompt graph integrity validator ( ests/validate-graph-integrity.py) that detects structural issues across all PromptKit components. This addresses Step 1: Prompt Graph Integrity Checks from the Self-Improvement Roadmap.

Checks Implemented

Check Tag What it catches
Broken paths [broken-path] Manifest path fields pointing to non-existent files
Broken references [broken-ref] Template persona/protocol/format/taxonomy refs that don't resolve to manifest entries
Orphaned files [orphan] Component files on disk not listed in manifest.yaml
Missing companions [missing-companion] Templates missing required persona or protocols
Pipeline integrity [broken-pipeline] Pipeline stage templates not found in manifest

CI Changes

  • Renamed workflow to Validate Prompt Library (was Validate Manifest)
  • Added a second job: Check prompt graph integrity
  • Expanded trigger paths to include all component directories (personas/, protocols/, formats/, taxonomies/)

Design Decisions

  • No external dependencies — uses the same lightweight YAML parsing approach as the existing validate-manifest.py
  • Format field is optional — templates like generate-commit-message legitimately use format: null when output structure is defined inline
  • persona: configurable — treated as a valid value (not a broken reference)

Verification

Both validators pass cleanly:
\
$ python tests/validate-graph-integrity.py
OK: all graph integrity checks passed.

$ python tests/validate-manifest.py
OK: manifest.yaml protocols match all template frontmatter.
\\

Closes the Prompt Graph Integrity Checks milestone in #111.

Copilot AI review requested due to automatic review settings March 30, 2026 02:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new repository-wide validator to ensure PromptKit’s component “prompt graph” remains structurally consistent (manifest paths, references, pipelines, and orphan detection), and wires it into CI alongside the existing manifest/frontmatter protocol-sync check.

Changes:

  • Introduce tests/validate-graph-integrity.py to validate manifest paths, template references, orphans, missing companions, and pipeline stage integrity.
  • Add a new hardware-focused template (review-enclosure) plus supporting persona (mechanical-engineer) and analysis protocol (enclosure-design-review).
  • Update CI workflow to run both manifest protocol-sync validation and the new graph integrity validator, and expand workflow triggers to all component directories.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/validate-graph-integrity.py New structural validator for manifest/component graph integrity checks.
templates/review-enclosure.md New enclosure design review template using investigation-report output.
protocols/analysis/enclosure-design-review.md New analysis protocol defining a 7-phase enclosure review process.
personas/mechanical-engineer.md New mechanical engineer persona for enclosure/DFM/environmental reviews.
manifest.yaml Register new persona/protocol/template entries in the library manifest.
.github/workflows/validate-manifest.yml Rename workflow and add CI job to run graph integrity validation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Alan Jowett and others added 3 commits March 29, 2026 19:42
Add tests/validate-graph-integrity.py that validates structural
integrity across all PromptKit components:

- Broken paths: manifest path fields point to actual files on disk
- Broken references: template persona/protocol/format/taxonomy refs
  resolve to entries in the manifest
- Orphaned files: component files on disk not listed in the manifest
- Missing companions: templates lacking required persona or protocols
- Pipeline integrity: pipeline stage templates exist in the manifest

Update CI workflow to run the new check alongside the existing
manifest protocol sync validator, and trigger on all component
directories (personas/, protocols/, formats/, taxonomies/).

Closes the 'Prompt Graph Integrity Checks' milestone in microsoft#111.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update docstring to reflect that format is intentionally optional
- Initialize list-valued extra fields (protocols, taxonomies) with []
  instead of empty string for type consistency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Check 6: parse template file frontmatter and validate persona,
  protocol, format, and taxonomy references against manifest entries.
  Protocol paths are normalized to short names. Handles configurable
  personas and template variables.
- Use .is_file() instead of .exists() for broken-path detection to
  reject directories that accidentally match a manifest path.
- Frontmatter parser only matches top-level fields (indent 0) to avoid
  false matches inside nested blocks like params.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett force-pushed the feature/graph-integrity-checks branch from 191770b to 1c9ea91 Compare March 30, 2026 02:42
Copilot AI review requested due to automatic review settings March 30, 2026 02:42
@Alan-Jowett Alan-Jowett merged commit 17ad21e into microsoft:main Mar 30, 2026
4 checks passed
@Alan-Jowett Alan-Jowett deleted the feature/graph-integrity-checks branch March 30, 2026 02:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants