Skip to content

Add maintenance-workflow: periodic drift detection and correction#126

Merged
Alan-Jowett merged 4 commits intomicrosoft:mainfrom
Alan-Jowett:feature/maintenance-workflow
Mar 30, 2026
Merged

Add maintenance-workflow: periodic drift detection and correction#126
Alan-Jowett merged 4 commits intomicrosoft:mainfrom
Alan-Jowett:feature/maintenance-workflow

Conversation

@Alan-Jowett
Copy link
Copy Markdown
Member

Summary

Adds a maintenance-workflow -- a periodic health check that detects drift, classifies findings with the user, generates corrective patches, and restores alignment.

Closes #118

Completes the Engineering Lifecycle Triad

spec-extraction-workflow (#119) -- bootstrap: no specs -> semantic baseline engineering-workflow (#116) -- evolve: change -> propagate -> audit -> deliver maintenance-workflow (this PR) -- maintain: detect drift -> classify -> fix -> deliver

Workflow Phases

Phase 1: Full Audit (D1-D13 across all layers) Phase 2: Human Classification (intentional vs accidental drift) Phase 3: Corrective Patch Generation (fix-spec / fix-impl / fix-both) Phase 4: Patch Audit (adversarial verification) Phase 5: Human Approval (loop back if needed) Phase 6: Create Deliverable (PR with corrections)

Entry point: read and execute templates/maintenance-workflow.md

New Components

Just 1 template -- everything else is reused:

Reused Component Role
traceability-audit protocol Document-level drift (D1-D7)
code-compliance-audit protocol Code-level drift (D8-D10)
test-compliance-audit protocol Test-level drift (D11-D13)
change-propagation protocol Corrective patch generation
iterative-refinement protocol Spec corrections
adversarial-falsification protocol Patch verification
specification-drift taxonomy D1-D13 classifications
investigation-report format Drift report structure
structured-patch format Corrective patch structure

Key Design Decisions

  • Domain-agnostic: Configurable persona for any domain
  • 5 drift classifications: fix-spec, fix-impl, fix-both, accept, defer
  • RECLASSIFY verdict: Audit can reveal misclassified findings, sending user back to Phase 2
  • Zero new protocols/formats/personas: Maximum reuse
  • Quality checklist: 11 verification items

Validation

Both validators pass cleanly.

Add an interactive orchestration template that performs periodic health
checks on repositories with existing semantic baselines.

Workflow phases:
1. Full audit (D1-D13 across all artifact layers)
2. Human classification loop (intentional vs accidental drift)
3. Corrective patch generation (fix-spec, fix-impl, fix-both)
4. Patch audit (adversarial verification)
5. Human approval (loop back if needed)
6. Create deliverable (PR with corrective patches)

Key design decisions:
- Domain-agnostic: configurable persona for any engineering domain
- 5 drift classifications: fix-spec, fix-impl, fix-both, accept, defer
- Reuses all existing audit protocols (traceability-audit,
  code-compliance-audit, test-compliance-audit)
- Reuses change-propagation and iterative-refinement for patches
- Format skeletons follow exact format spec section structures
- RECLASSIFY verdict for when audit reveals misclassified findings
- Zero new protocols, formats, or personas

Completes the engineering lifecycle triad:
  spec-extraction (bootstrap) -> engineering-workflow (evolve)
  -> maintenance-workflow (maintain)

Closes microsoft#118

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 30, 2026 15:52
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 interactive PromptKit orchestration template that implements the “maintenance” leg of the lifecycle triad: periodically auditing a repo for semantic drift, guiding human classification, generating corrective patches, adversarially re-auditing, and preparing a deliverable PR.

Changes:

  • Added templates/maintenance-workflow.md interactive workflow template with phased audit → classify → patch → audit → approve → deliver flow.
  • Registered the new template in manifest.yaml with protocols/taxonomy/format metadata.

Reviewed changes

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

File Description
templates/maintenance-workflow.md New interactive maintenance workflow template describing phases, inputs, outputs, gates, and quality checklist.
manifest.yaml Adds the maintenance-workflow template entry so it’s discoverable by the bootstrap/assembly tooling.

- Fix triad reference to use full component name spec-extraction-workflow
- Expand Findings field list to match investigation-report format
  (Category with D-label, Location, Description, Evidence, Root Cause,
  Impact, Confidence, Remediation)
- Inline structured-patch constraints for multi-artifact context:
  CHG-NNN IDs, 'None identified' for empty sections, upstream-ref
  rules, 6-section structure

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 3 comments.

…abels

- Restrict Phase 1 to full-read specs only; implementation/verification
  uses search-then-selective-read per operational-constraints protocol
- Use exact structured-patch heading text with numeric prefixes
  (## 1. Change Context, etc.)
- Standardize classification labels to lowercase (fix-spec, fix-impl,
  fix-both, accept, defer) consistently throughout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 3 comments.

- Clarify D5/D6 mapping: D5 for assumption drift, D6 for constraint
  violations (not vaguely 'consistency')
- Fix escaped underscores in D-label example (D2\_UNTESTED\_ ->
  D2_UNTESTED_REQUIREMENT in code format)
- Use exact investigation-report heading text with numeric prefixes
  and backtick formatting
- Add severity ordering rule for findings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett requested a review from Copilot March 30, 2026 16:29
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Alan-Jowett Alan-Jowett merged commit f1e0cef into microsoft:main Mar 30, 2026
3 checks passed
@Alan-Jowett Alan-Jowett deleted the feature/maintenance-workflow branch March 30, 2026 16:35
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.

🧹 Maintenance Workflow

2 participants