Add prompt graph integrity checks (issue #111 step 1)#114
Merged
Alan-Jowett merged 3 commits intomicrosoft:mainfrom Mar 30, 2026
Merged
Add prompt graph integrity checks (issue #111 step 1)#114Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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.pyto 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. |
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>
191770b to
1c9ea91
Compare
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
[broken-path]pathfields pointing to non-existent files[broken-ref][orphan]manifest.yaml[missing-companion][broken-pipeline]CI Changes
personas/,protocols/,formats/,taxonomies/)Design Decisions
validate-manifest.pygenerate-commit-messagelegitimately useformat: nullwhen output structure is defined inlinepersona: 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.