Skip to content

Add code compliance audit template (spec+design → code)#42

Merged
Alan-Jowett merged 2 commits intomicrosoft:mainfrom
Alan-Jowett:add-code-compliance-audit
Mar 20, 2026
Merged

Add code compliance audit template (spec+design → code)#42
Alan-Jowett merged 2 commits intomicrosoft:mainfrom
Alan-Jowett:add-code-compliance-audit

Conversation

@Alan-Jowett
Copy link
Member

Summary

Adds a new template that audits source code against requirements and design documents for code compliance drift — gaps between what was specified and what was built. Closes #37.

New Components

Component File Purpose
Protocol \protocols/reasoning/code-compliance-audit.md\ 7-phase methodology: spec inventory → code inventory → forward traceability → backward traceability → constraint verification → classification → coverage summary
Template \ emplates/audit-code-compliance.md\ Consumes requirements + code + optional design; produces investigation-report

Extended Components

Component Change
Taxonomy D8–D10 labels defined in \specification-drift\ (previously reserved)
Scenarios Code compliance scenario moved from Future to Existing

New Drift Types (D8–D10)

Label Description
D8_UNIMPLEMENTED_REQUIREMENT Requirement in spec has no implementation in code
D9_UNDOCUMENTED_BEHAVIOR Code implements behavior not in any requirement
D10_CONSTRAINT_VIOLATION_IN_CODE Code violates a stated constraint

D11–D13 remain reserved for the future \�udit-test-compliance\ template (#38).

Reused Components

  • \specification-analyst\ persona
  • \investigation-report\ format
  • \�nti-hallucination\ + \self-verification\ + \operational-constraints\ guardrails
  • \specification-drift\ taxonomy (extended)

Validation

  • \ ests/validate-manifest.py\ passes ✅
  • Assembly smoke test confirms D8/D9/D10 taxonomy content is included in assembled prompt ✅

Add a new template that audits source code against requirements and
design documents for specification drift. Detects unimplemented
requirements (D8), undocumented behavior (D9), and constraint
violations in code (D10).

New components:
- Protocol: code-compliance-audit — 7-phase methodology for mapping
  spec claims to code behavior (spec inventory, code inventory,
  forward/backward traceability, constraint verification)
- Template: audit-code-compliance — consumes requirements + code +
  optional design, produces investigation-report

Extended components:
- Taxonomy: specification-drift — D8-D10 labels defined, D11-D13
  remain reserved for test compliance
- Ranking criteria updated to include D8-D10
- Scenarios gallery updated (moved from future to existing)

Closes microsoft#37

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 20, 2026 02:21
Copy link
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 PromptKit template + reasoning protocol to audit source code vs. requirements/design for “code compliance drift”, extending the existing specification-drift taxonomy to cover D8–D10 and documenting the new scenario as an existing capability.

Changes:

  • Added audit-code-compliance template that consumes requirements + code context (+ optional design) and produces an investigation report classified with D8–D10.
  • Added code-compliance-audit reasoning protocol defining a phased audit methodology (spec inventory → code inventory → forward/backward tracing → constraint verification → classification → coverage).
  • Extended specification-drift taxonomy with D8–D10 labels and updated docs/manifest registrations accordingly.

Reviewed changes

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

Show a summary per file
File Description
templates/audit-code-compliance.md New audit template wiring persona/protocols/taxonomy/format plus task instructions and quality checklist.
protocols/reasoning/code-compliance-audit.md New 7-phase reasoning protocol for code↔spec compliance auditing and reporting.
taxonomies/specification-drift.md Adds D8–D10 code-compliance drift labels; updates applicability and ranking criteria.
manifest.yaml Registers the new protocol and template in the component manifest.
docs/scenarios.md Moves the code-compliance audit scenario into “Existing Templates” and documents the assembled components.

…us scoping

- INCONCLUSIVE is now a confidence level (Low), not a competing label
- PARTIALLY IMPLEMENTED maps to D8 with Medium confidence
- D9 findings use 'None — no matching requirement identified' for spec
  location since undocumented behavior has no requirement by definition
- Focus area scoping applies to code modules, not just requirements

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
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 5 out of 5 changed files in this pull request and generated no new comments.

@Alan-Jowett Alan-Jowett merged commit 5e33b4c into microsoft:main Mar 20, 2026
6 checks passed
@Alan-Jowett Alan-Jowett deleted the add-code-compliance-audit branch March 20, 2026 03:29
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.

Add code compliance audit template (spec+design → code)

2 participants