ci: add ADR governance compliance#124
Open
dirvine wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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.pyto 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.ymland 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 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 on lines
+13
to
+17
| import os | ||
| import re | ||
| import subprocess | ||
| import sys | ||
| from pathlib import Path |
| for e in errors: | ||
| print(f"- {e}") | ||
| return 1 | ||
| print(f"ADR governance passed ({len(adr_files)} ADR file(s) checked).") |
| @@ -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" | |||
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 repository-local ADR governance and team-standard ADR tooling:
docs/adr/TEMPLATE.mdwith a structured ADR formatdocs/adr/TOOLING.mdwithadrs,adr-kit, Codex/Claude Code/OpenCode/pi harness guidance.adr-kit.yamlpolicy configscripts/adr-governance.pyvalidation for ADR format, required sections, status values, duplicate numbers, and immutableAcceptedADRs.github/workflows/adr-governance.ymlCI gateFor 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.
AcceptedADRs must not be rewritten; if a decision changes, we create a superseding ADR so the audit trail remains intact.Review focus
Acceptedenforcement is strict enough.Test plan
python3 scripts/adr-governance.pylocally on the branch.