Skip to content

Commit 7f1eed5

Browse files
desekjunie-agent
andauthored
feat(governance): add source traceability fields and Bats test infrastructure (#19)
Co-authored-by: Junie <junie@jetbrains.com>
1 parent da553e3 commit 7f1eed5

File tree

13 files changed

+608
-4
lines changed

13 files changed

+608
-4
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright Daniel Grenemark 2026
2+
name: Test
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
bats:
14+
name: Bats Tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
23+
- name: Install Bats
24+
run: npm install -g bats
25+
26+
- name: Run tests
27+
run: bats tests/ --recursive

docs/cr/CR-0011-governance-source-traceability.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
name: cr-0011-governance-source-traceability
33
description: Add source branch and commit metadata to CR and ADR templates to enable traceability and staleness detection for governance documents.
44
id: "CR-0011"
5-
status: "proposed"
6-
date: 2026-03-08
5+
status: "implemented"
6+
date: 2026-03-09
77
requestor: desek
88
stakeholders: desek
99
priority: "medium"
@@ -29,12 +29,16 @@ Adding source traceability metadata enables:
2929
1. **Staleness detection** — Compare the document's `source-commit` against the current HEAD to see what has changed since the document was written.
3030
2. **Conflict identification** — When multiple CRs are in-flight, reviewers can determine if one CR's implementation invalidates another CR's analysis.
3131
3. **Audit trail** — Provides a clear link between governance documents and the repository state they were based on.
32+
4. **Multi-CR branch coordination** — A single working branch may contain multiple CRs when the change is complex enough to warrant decomposition. Source traceability allows each CR to record the exact commit it was based on, making it possible to verify that later CRs in the branch correctly build upon the state left by earlier ones. This also encourages keeping individual CRs small and focused — overly large CRs (measured by the number of rows in the document) risk loss of implementation details and reduce review quality.
33+
5. **Known-unknowns management** — During implementation, new questions and uncertainties inevitably surface that were not anticipated when the CR was written. Source traceability makes it possible to compare the document's assumptions against the actual repository state at any point, helping teams identify and track these known unknowns rather than letting them silently invalidate the original plan.
3234

3335
## Change Drivers
3436

3537
* CRs can invalidate each other when implemented out of order, but there is no mechanism to detect this today
3638
* Reviewers have no way to assess whether a CR's "Current State" section is still accurate
3739
* ADR decisions may need revisiting after significant codebase changes, but there is no baseline to compare against
40+
* Complex changes often span multiple CRs on the same working branch, and without source traceability there is no way to verify sequential consistency between them
41+
* Overly large CRs risk loss of implementation details; source traceability supports decomposing work into smaller, traceable CRs
3842

3943
## Current State
4044

0 commit comments

Comments
 (0)