Skip to content

docs(adr): a record that picks a tool says how to replace it #5427

Open

Description

@dan-petty

Problem or Motivation

The owner set a direction on 2026-11-13: the project stays flexible on tools, libraries, extensions and workflow as it grows and its scope changes. A tool that fits today (Argo Workflows, pydantic-ai, Valkey, release-please, OpenSpec, gidgethub, a sandbox runtime) can stop fitting later.

The ADR rules in docs/adr/README.md say when to write a record for "a dependency or a tool", but they do not ask the record how the project leaves that tool. So a record can pick a tool and wire it in with no seam, no signal to look again and no cost to leave. Then the next change of scope becomes a rewrite. ADR 0018 shows the good form: it adopts the container boundary and says that a gVisor RuntimeClass or the agent-sandbox controller can replace it later "without a change of the tool".

Proposed Solution

  1. Add one rule to docs/adr/README.md: a record that picks a tool, a library, an extension or a workflow engine states three facts in a short section:
    • Interface: the standard interface through which the project uses the tool (for example a Kubernetes Job, a RuntimeClass, an OCI image, MCP, A2A, OTLP, an OpenAI-compatible API, a git remote, a webhook or a check run), and the one adapter module that holds the code of that tool.
    • Revisit when: the measured signal that makes the choice due for review (for example a success band, a cost, a maintenance state, or a new scope).
    • Exit cost: what a replacement changes, in files or in tokens and time.
  2. tests/invariants/test_adr_records.py fails when a new record (after the last record on main when this merges) that sets a new front-matter key kind: tool lacks the section. Existing records do not change (an accepted record does not change); the superseding records of docs(adr): track the ADR modernization #5233 add the section when they restate a tool choice.
  3. Add one sentence to ARCHITECTURE.md: tool-specific code stays behind one adapter, so a replacement changes that adapter and the configuration, not the callers.

Acceptance Criteria

  • docs/adr/README.md has the rule with the three facts.
  • uv run pytest tests/invariants/test_adr_records.py passes, and a new test proves that a fixture record with kind: tool and no section fails.
  • ARCHITECTURE.md has the adapter sentence.
  • No accepted record body changes (the body-hash test passes).

Existing Tool Considered

MADR 4 has optional sections ("Pros and Cons of the Options", "More Information") but no exit section, and adr-tools and log4brains add none. The rule is a section of the project template plus one check in the existing ADR test. Cost to build (estimate): 0.2 M tokens and 1 hour. Keep: one section in each tool record. Fix: about 0.05 M tokens for each wrong rule.

Related

#5233 (the ADR modernization tracker), ADR 0018 (the sandbox record names its replacements), #2695 (the sandbox measurement of gVisor and agent-sandbox).

Source: #5233

Alternatives check of 2026-11-17: not-applicable.
Class: docs, no search.
Tool: none found.

Proposed design

Problem statement

The ADR rules say when to write a record for a tool, but not how the project leaves the tool. A record can pick a tool with no seam, no revisit signal and no exit cost. The next change of scope then becomes a rewrite. This change adds the rule to docs/adr/README.md, one check to the ADR record check, and one sentence to ARCHITECTURE.md.

Acceptance criteria

Requirement: The ADR rules state the tool exit facts

docs/adr/README.md SHALL state that a record with kind: tool gives its interface, its revisit signal and its exit cost, and SHALL list kind in its front-matter table.

Scenario: The docs check passes

  • WHEN uv run devops docs check runs on the changed repository
  • THEN the command exits 0 and reports no out-of-date document

Requirement: A tool record without the section fails the check

The ADR record check MUST report a problem for a record text that sets kind: tool and gives no exit section.

Scenario: A fixture record with the key and no section

  • WHEN record_problems reads one fixture record text with kind: tool and no ## Leaving the Tool heading
  • THEN the returned problems name the record and the missing section

Requirement: A tool record with the three facts passes the check

The ADR record check MUST report no problem for a record text that sets kind: tool and gives the three facts.

Scenario: A fixture record with the key and the section

  • WHEN record_problems reads one fixture record text with kind: tool, the ## Leaving the Tool heading and the Interface:, Revisit when: and Exit cost: labels
  • THEN the returned problems are empty

Requirement: A record without the key keeps its rules

The ADR record check MUST apply the new section only to a record that sets kind: tool.

Scenario: The records of the repository pass

  • WHEN uv run pytest tests/invariants/test_adr_records.py runs
  • THEN the run exits 0 and each accepted record keeps its body-hash

Requirement: The architecture states the adapter rule

ARCHITECTURE.md SHALL state that tool-specific code stays behind one adapter, so a replacement changes that adapter and the configuration, not the callers.

Scenario: The docs check passes

  • WHEN uv run devops docs check runs after the edit
  • THEN the command exits 0 and reports no out-of-date document

Existing Tool Considered

The alternatives check of 2026-11-17 in the issue body records not-applicable (class docs, no search) and names no tool. MADR 4 has optional sections, but no exit section, and adr-tools and log4brains add none. So no open tool covers the need, and the rule is one section of the project template plus one check in the existing ADR record check. Written cost: 0.2 M tokens and 1 hour to build. Keep: one section in each tool record. Fix: about 0.05 M tokens for each wrong rule.

Key questions

  • Which front-matter key marks a record that picks a tool?: A new front-matter key kind: tool, listed in the table of docs/adr/README.md. A record that sets no kind keeps its current rules. (best practice) [sources: docs/adr/README.md, tests/invariants/test_adr_records.py]
    • Chosen: A new front-matter key kind: tool. A key is one value that a check reads with no guess, and the front-matter table already lists each project key.
    • Rejected: A word match on the title or the body. Prose does not say when a record picks a tool, so the check would fire on a record that picks none.
    • Rejected: The section in every new record. A record that picks no tool has no exit cost, so the section would hold filler.
  • Where does the check live?: In record_problems of src/devops_cli/docs/adr_records.py. tests/invariants/test_adr_records.py calls that function, and so does uv run devops ci test tests/invariants/test_adr_records.py, so one function holds the rule. (best practice) [sources: tests/invariants/test_adr_records.py, docs/adr/README.md]
    • Chosen: In record_problems of the ADR record module. The invariant test is a thin wrapper, so one function serves the test, the CI row and devops docs check.
    • Rejected: In the body of the invariant test. A second caller would copy the rule, and the two copies would drift.
    • Rejected: In a new standalone test module. It duplicates the record reader and adds no coverage.
  • Which records does the check apply to, and how do the existing records stay unchanged?: Each record that sets kind: tool. No baseline number and no read of main is necessary: no record sets the key today, and a record without the key keeps its rules. The change edits no record, so each body-hash stays. (best practice) [sources: docs/adr/README.md, tests/invariants/test_adr_records.py]
    • Chosen: Each record that sets kind: tool, with no baseline. No record sets the key today, so the check changes no accepted record and needs no constant.
    • Rejected: A fixed baseline record number. It is a constant to keep and to bump, and it states the same rule as the key.
    • Rejected: A comparison with the records on main. The test runs offline on one commit and reads no second tree.
  • What shape does the exit section take?: A top-level section ## Leaving the Tool after ## Decision Outcome, with three labeled paragraphs: Interface:, Revisit when: and Exit cost:. The check requires the heading and each label. (best practice) [sources: docs/adr/README.md]
    • Chosen: One section with three labels. One heading and three labels give the check a stable form, and the section stays short under the word limit.
    • Rejected: Three sub-headings. Three headings lengthen each tool record and make the index of sections harder to read.
    • Rejected: The facts under ### Consequences. The facts are about leaving the tool, not about the choice, and a check needs a named heading.
  • Where does the adapter sentence go in ARCHITECTURE.md?: Section 7, "Universal Architectural Standards & Consistency Blueprint", as a new numbered item 4, "Tool adapters". That section already holds the standards that each subsystem follows. (best practice) [sources: ARCHITECTURE.md]
    • Chosen: Section 7, as a new numbered item. The section holds the cross-cutting standards, so one item states the adapter rule once.
    • Rejected: Section 1, in the diagram. A diagram shows components and states no rule.
    • Rejected: Section 5, the security model. An adapter is a design seam, not a security boundary.
  • Does this change wait on the ADR modernization tracker docs(adr): track the ADR modernization #5233?: No. The change edits no record, and the ADR rules say that an accepted record does not change. The superseding records of docs(adr): track the ADR modernization #5233 add the section when they restate a tool choice. [sources: docs/adr/README.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/docs
    scope/adr
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: docs. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  7. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 0581ec5 (see proposed design in issue body).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/adrsource/agentstatus/readytype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions