Skip to content

Add instruction-fidelity guardrail across prompts - #266

Merged
Alan Jowett (Alan-Jowett) merged 2 commits into
mainfrom
alanjo/instruction-fidelity-guardrail
Aug 4, 2026
Merged

Add instruction-fidelity guardrail across prompts#266
Alan Jowett (Alan-Jowett) merged 2 commits into
mainfrom
alanjo/instruction-fidelity-guardrail

Conversation

@Alan-Jowett

Copy link
Copy Markdown
Member

Summary

  • add a universal instruction-fidelity guardrail and register it in the manifest
  • wire the guardrail into every template and strengthen bootstrap plus generated prompt formats to preserve it verbatim where needed
  • add tests/validate-instruction-fidelity.py, run it in CI, and update contributor documentation

Validation

  • python tests/validate-manifest.py
  • python tests/validate-instruction-fidelity.py
  • python tests/validate-graph-integrity.py

Introduce a universal instruction-fidelity guardrail and wire it into every PromptKit template and manifest entry.

Strengthen bootstrap and generated prompt formats so ambiguity escalation, approval gates, and instruction priority remain explicit, including non-condensable handling for agent instructions.

Add CI enforcement with tests/validate-instruction-fidelity.py and update contributor documentation to reflect the new validation flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Copilot AI review requested due to automatic review settings August 3, 2026 02:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Not ready to approve

docs/faq.md now has a duplicated “4.” step in the numbered contribution list, which should be renumbered for clarity.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR strengthens PromptKit’s prompt-composition contract by introducing a universal instruction-fidelity guardrail and enforcing its presence and preservation across templates, bootstrap behavior, and output formats, with CI validation to prevent regressions.

Changes:

  • Adds the new protocols/guardrails/instruction-fidelity.md guardrail and registers it in manifest.yaml.
  • Wires guardrails/instruction-fidelity into template frontmatter and adds instruction-fidelity to every template’s manifest protocol list.
  • Introduces tests/validate-instruction-fidelity.py, runs it in CI, and updates formats + docs to preserve and document the contract.
File summaries
File Description
tests/validate-instruction-fidelity.py New validator enforcing universal guardrail coverage + critical marker preservation
protocols/guardrails/instruction-fidelity.md Adds the new universal instruction-fidelity guardrail protocol
manifest.yaml Registers the new protocol and adds instruction-fidelity to template protocol lists
bootstrap.md Adds explicit instruction-fidelity contract and preservation guidance to bootstrap
formats/agent-instructions.md Requires verbatim inclusion of the instruction-fidelity contract in generated instruction files
formats/copilot-prompt-file.md Requires verbatim preservation of instruction-fidelity semantics when repackaging prompts
.github/workflows/validate-manifest.yml Runs the new instruction-fidelity validation in CI and updates path triggers
.github/copilot-instructions.md Updates contributor-facing CI guidance to include the new validation script
README.md Documents the new guardrail in the protocol list
CATALOG.md Updates protocol counts and catalog to include instruction-fidelity
CONTRIBUTING.md Updates applicable_to: all guidance and CI check references for the new validator
docs/architecture.md Updates CI and architecture docs to mention the new validation and coverage requirement
docs/contributing-components.md Adds the new validation step to contributor workflow and checklist
docs/faq.md Adds the new validation step to “add a template” and troubleshooting guidance
templates/validate-simulation.md Adds guardrails/instruction-fidelity to template frontmatter
templates/validate-budget.md Adds guardrails/instruction-fidelity to template frontmatter
templates/triage-pull-requests.md Adds guardrails/instruction-fidelity to template frontmatter
templates/triage-issues.md Adds guardrails/instruction-fidelity to template frontmatter
templates/spec-extraction-workflow.md Adds guardrails/instruction-fidelity to template frontmatter
templates/scaffold-test-project.md Adds guardrails/instruction-fidelity to template frontmatter
templates/root-cause-ci-failure.md Adds guardrails/instruction-fidelity to template frontmatter
templates/revise-for-readability.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-schematic.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-pull-request.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-layout.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-infrastructure.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-enclosure.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-cpp-code.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-code.md Adds guardrails/instruction-fidelity to template frontmatter
templates/review-bom.md Adds guardrails/instruction-fidelity to template frontmatter
templates/reverse-engineer-requirements.md Adds guardrails/instruction-fidelity to template frontmatter
templates/respond-to-pr-comments.md Adds guardrails/instruction-fidelity to template frontmatter
templates/reconstruct-behavior.md Adds guardrails/instruction-fidelity to template frontmatter
templates/reconcile-requirements.md Adds guardrails/instruction-fidelity to template frontmatter
templates/profile-session.md Adds guardrails/instruction-fidelity to template frontmatter
templates/plan-implementation.md Adds guardrails/instruction-fidelity to template frontmatter
templates/maintenance-workflow.md Adds guardrails/instruction-fidelity to template frontmatter
templates/lint-prompt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/investigate-trace.md Adds guardrails/instruction-fidelity to template frontmatter
templates/investigate-security.md Adds guardrails/instruction-fidelity to template frontmatter
templates/investigate-bug.md Adds guardrails/instruction-fidelity to template frontmatter
templates/interactive-design.md Adds guardrails/instruction-fidelity to template frontmatter
templates/hardware-design-workflow.md Adds guardrails/instruction-fidelity to template frontmatter
templates/generate-spec-changes.md Adds guardrails/instruction-fidelity to template frontmatter
templates/generate-implementation-changes.md Adds guardrails/instruction-fidelity to template frontmatter
templates/generate-commit-message.md Adds guardrails/instruction-fidelity to template frontmatter
templates/fix-compiler-warnings.md Adds guardrails/instruction-fidelity to template frontmatter
templates/find-and-fix-bugs.md Adds guardrails/instruction-fidelity to template frontmatter
templates/extract-rfc-requirements.md Adds guardrails/instruction-fidelity to template frontmatter
templates/extract-invariants.md Adds guardrails/instruction-fidelity to template frontmatter
templates/extend-library.md Adds guardrails/instruction-fidelity to template frontmatter
templates/exhaustive-bug-hunt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/evolve-protocol.md Adds guardrails/instruction-fidelity to template frontmatter
templates/evaluate-prompt-portability.md Adds guardrails/instruction-fidelity to template frontmatter
templates/enhance-prompt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/engineering-workflow.md Adds guardrails/instruction-fidelity to template frontmatter
templates/emit-manufacturing-artifacts.md Adds guardrails/instruction-fidelity to template frontmatter
templates/discover-tests-for-changes.md Adds guardrails/instruction-fidelity to template frontmatter
templates/diff-specifications.md Adds guardrails/instruction-fidelity to template frontmatter
templates/design-schematic.md Adds guardrails/instruction-fidelity to template frontmatter
templates/design-pcb-layout.md Adds guardrails/instruction-fidelity to template frontmatter
templates/decompose-prompt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/collaborate-requirements-change.md Adds guardrails/instruction-fidelity to template frontmatter
templates/classify-findings.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-workflow-prompts.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-validation-plan.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-test-prompt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-session-handoff.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-rfc.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-requirements-doc.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-release.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-protocol-validation.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-presentation.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-pipeline.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-north-star.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-known-conditions-registry.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-interface-contract.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-implementation-prompt.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-design-doc.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-architecture-spec.md Adds guardrails/instruction-fidelity to template frontmatter
templates/author-agent-instructions.md Adds guardrails/instruction-fidelity and updates agent-instruction generation constraints
templates/audit-traceability.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-test-compliance.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-spec-invariants.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-spec-alignment.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-link-budget.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-library-health.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-library-consistency.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-interface-contract.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-integration-compliance.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-implementation-alignment.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-coverage-gaps.md Adds guardrails/instruction-fidelity to template frontmatter
templates/audit-code-compliance.md Adds guardrails/instruction-fidelity to template frontmatter
templates/analyze-protocol-conflicts.md Adds guardrails/instruction-fidelity to template frontmatter
Review details
  • Files reviewed: 94/94 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread docs/faq.md Outdated
Address review feedback on PR #266 by renumbering the final step in docs/faq.md after adding the instruction-fidelity validation step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Copilot AI review requested due to automatic review settings August 3, 2026 02:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Ready to approve

The new guardrail is consistently integrated across templates/manifest/formats and is enforced by a dedicated CI validation script with matching marker checks.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 94/94 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread protocols/guardrails/instruction-fidelity.md
@Alan-Jowett
Alan Jowett (Alan-Jowett) merged commit ca0a078 into main Aug 4, 2026
6 checks passed
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.

3 participants