diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a09b83c08..df9115e746 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,6 +80,8 @@ Small adjustments in response to review feedback are normal iteration — this g ADRs (Architecture Decision Records) are **point-in-time records**. Once accepted, do not substantially rewrite their Context, Decision, or Consequences sections — if a decision needs to change, write a new ADR that supersedes the old one. Minor annotations are welcome: cross-references to related ADRs, short notes linking to newer decisions, and typo fixes. See the [ADR template](docs/ADRs/0000-adr-template.md) and [ADR 0001](docs/ADRs/0001-use-adrs-for-decision-making.md) for full details. +ADRs establish durable rules - they document new invariants. Use the [ADR filing test](skills/writing-adrs/SKILL.md#decide-whether-to-write-a-new-adr) to figure out if you need a new ADR. + ### ADRs and implementation code Human contributors may include an ADR and its implementation in the same PR when it makes sense. Bundling helps reviewers see what a decision actually means in code and avoids an extra review cycle. Use your judgment based on two factors: diff --git a/docs/contributing/adrs.md b/docs/contributing/adrs.md index 7d2a7c76ad..b49fd3818a 100644 --- a/docs/contributing/adrs.md +++ b/docs/contributing/adrs.md @@ -2,6 +2,8 @@ These rules apply whenever you touch `docs/ADRs/` or review a PR that does. Full authoring guidance is in [`skills/writing-adrs/SKILL.md`](../../skills/writing-adrs/SKILL.md); invoke that skill when writing a new ADR. +**Filing test:** Before drafting, check to see if the ADR captures a new invariant, changes boundaries or contracts, or if it supersedes an older decision. See the [writing-adrs skill](../../skills/writing-adrs/SKILL.md) for the test and borderline examples. + **Immutability:** Once an ADR on `main` has status **Accepted**, it is a point-in-time record. Do not substantially rewrite its Context, Decision, or Consequences sections. When circumstances change, write a **new** ADR that supersedes the old one. Minor annotations are welcome: cross-references to related ADRs, short notes linking to newer decisions, typo and broken-link fixes, and status changes (e.g., to Deprecated or Superseded). Call out any edits to accepted ADRs in the PR description. **New ADRs in pull requests:** Approval happens at **merge**, not when the branch is created. If the decision is made, set status to **Accepted** in the ADR you are proposing — not a lesser status merely because the PR is open. Valid statuses are **Accepted**, **Deprecated**, and **Superseded**. When status is Accepted, update `docs/architecture.md` and related problem docs in the same PR per the writing-adrs skill. When editing an ADR that has not yet merged to `main`, change the content directly — do not add "Revised" annotations, revision dates, or revision history sections. The ADR is still being authored; treat edits as normal authoring, not post-acceptance amendments. diff --git a/skills/writing-adrs/SKILL.md b/skills/writing-adrs/SKILL.md index cda783f364..ca13fda11c 100644 --- a/skills/writing-adrs/SKILL.md +++ b/skills/writing-adrs/SKILL.md @@ -53,7 +53,7 @@ reflect the current state of architectural decisions. When a new ADR is accepted to reflect the latest decision. It is the single place a reader can go to understand what is true *now*, without tracing a chain of ADRs. -## When to Use +## When to Use This Skill - A specific decision has emerged from discussion in a problem doc - You need to frame an upcoming decision @@ -61,6 +61,68 @@ understand what is true *now*, without tracing a chain of ADRs. Do NOT use for open-ended exploration -- that belongs in problem docs. +## Decide Whether to Write a New ADR + +An ADR is most useful when it establishes an **invariant**: a durable rule that +future designs, implementations, and reviews must preserve. Before writing one, +state the proposed invariant in a sentence and check existing ADRs and normative +contracts for it. The size of the implementation does not determine whether it +needs an ADR. + +**Write a new ADR when:** + +- The choice establishes a new architectural invariant, such as the forge + abstraction in [ADR 0005](../../docs/ADRs/0005-forge-abstraction-layer.md) or + the credential boundary in + [ADR 0017](../../docs/ADRs/0017-credential-isolation-for-sandboxed-agents.md). +- The choice establishes materially different security boundaries, + cross-component contracts, compatibility obligations, or operating models. +- The choice changes or supersedes an invariant in an Accepted ADR. Preserve + the old record and write a new one for the changed decision. + +Here, **compatibility obligations** means a new durable promise about how +components or configuration versions work together. It does not mean the +ordinary need to preserve every user-facing command or field. + +**Do not write a new ADR when:** + +- You are **applying an existing invariant** to another runtime, provider, + forge, field, or workflow. For example, + [ADR 0094](../../docs/ADRs/0094-pi-extensions-are-harness-resources.md) + requires extension tools to obey the same tool allowlist as other + tools. Applying that rule to another extension does not establish a new + invariant. +- A contract version change by itself does not establish a new invariant. + For example, [ADR 0170][entity-context-snapshot ADR] adopts snapshot v2 as + the model-facing field gate for every normalized-entity provider/kind pair. + Its expanded coverage and compatibility choices are the architectural + decision, not the version number. +- The change fixes a bug, chooses an internal algorithm, tunes a limit, or + adds a test mechanism without changing a durable rule. Send a normal PR that + explains the rationale and update the relevant guide, reference, normative + spec or user doc. +- The change only sets a local file location, internal naming convention, or + documentation layout. Put the convention in contributor guidance and enforce + it with linters where useful. +- You are correcting or clarifying an Accepted ADR without changing its + decision. Use a minor annotation as allowed above, and keep living documents + current. + +**Borderline example — ADR 0157.** ADR 0157 leaves the actor authorization +choices from ADR 0153 intact, so its startup check can look like a control under +an existing security boundary. It also ends the implicit fallback for +repositories using `jira-poll`, making an explicit authorization source a new +requirement after a deprecation period. That new configuration promise changes +the operating contract, so it warrants an ADR. + +[entity-context-snapshot ADR]: + ../../docs/ADRs/0170-align-entity-context-snapshot-with-normalized-entity.md + +If the choice is still open, explore the alternatives in a problem doc. A new +field, command, forge, or agent does not by itself establish a new invariant. +Implementing a security control under an existing boundary does not by itself +either; a new durable rule about configuration or operating behavior can. + ## The Rules ### One decision per ADR