Skip to content

ci: add ADR governance compliance#124

Open
dirvine wants to merge 2 commits into
mainfrom
ci/adr-governance-compliance
Open

ci: add ADR governance compliance#124
dirvine wants to merge 2 commits into
mainfrom
ci/adr-governance-compliance

Conversation

@dirvine
Copy link
Copy Markdown
Collaborator

@dirvine dirvine commented Jun 1, 2026

Summary

Adds repository-local ADR governance and team-standard ADR tooling:

  • docs/adr/TEMPLATE.md with a structured ADR format
  • docs/adr/TOOLING.md with adrs, adr-kit, Codex/Claude Code/OpenCode/pi harness guidance
  • .adr-kit.yaml policy config
  • scripts/adr-governance.py validation for ADR format, required sections, status values, duplicate numbers, and immutable Accepted ADRs
  • .github/workflows/adr-governance.yml CI gate

For repos without existing ADRs, this also bootstraps ADR-0001: Adopt Architecture Decision Records.

Why

ADRs are part of our engineering safety system, especially now we use AI coding assistance. They preserve the reasoning, rejected alternatives, consequences, and validation behind architectural decisions. Accepted ADRs must not be rewritten; if a decision changes, we create a superseding ADR so the audit trail remains intact.

Review focus

  • Check the ADR template is suitable for this repository.
  • Check the immutable Accepted enforcement is strict enough.
  • Check the harness guidance matches how contributors use Codex, Claude Code, OpenCode, and other agents.

Test plan

  • Ran python3 scripts/adr-governance.py locally on the branch.

Copilot AI review requested due to automatic review settings June 1, 2026 15:05
Copy link
Copy Markdown

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 repository-local ADR governance: a CI workflow plus a Python validator to enforce ADR filename/section/status conventions and prevent edits to already-Accepted ADRs, along with starter ADR docs and tooling guidance under docs/adr/.

Changes:

  • Introduces scripts/adr-governance.py to validate ADR structure, status values, duplicate numbers, and “immutable Accepted” enforcement.
  • Adds ADR documentation scaffolding (docs/adr/*) including a template, tooling/harness guidance, and an initial ADR-0001.
  • Adds CI gating via .github/workflows/adr-governance.yml and repository policy config in .adr-kit.yaml.

Reviewed changes

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

Show a summary per file
File Description
scripts/adr-governance.py Implements ADR validation and immutable-Accepted enforcement used by CI.
docs/adr/TOOLING.md Documents local ADR tooling and AI harness instructions for contributors.
docs/adr/TEMPLATE.md Provides a standardized ADR template with required sections.
docs/adr/README.md Defines repo-specific ADR rules and links to template/tooling docs.
docs/adr/ADR-0001-adopt-architecture-decision-records.md Bootstraps ADR usage with an initial accepted decision.
.github/workflows/adr-governance.yml Adds a GitHub Actions job to run ADR governance checks on PRs/pushes.
.adr-kit.yaml Adds ADR-kit policy configuration (directory, filename pattern, statuses, required sections).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/adr-governance.py
Comment on lines +39 to +43
# On push, compare against first parent where available.
try:
return run(["git", "rev-parse", "HEAD^@"])
except Exception:
return None
Comment thread scripts/adr-governance.py
Comment on lines +13 to +17
import os
import re
import subprocess
import sys
from pathlib import Path
Comment thread scripts/adr-governance.py
for e in errors:
print(f"- {e}")
return 1
print(f"ADR governance passed ({len(adr_files)} ADR file(s) checked).")
Comment thread .adr-kit.yaml
@@ -0,0 +1,18 @@
# ADR kit configuration for repository-level decision governance.
adr_directory: docs/adr
filename_pattern: "ADR-[0-9]{4}-[a-z0-9-]+\.md"
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