Our eight-person team supported four payment providers and needed to support twenty. Each integration had its own workflow. Every time we added a provider, we had to review the sequence of operations, error handling, and database updates again.

I use decision ownership to organize knowledge, set AI guardrails, divide team work, and plan how a service changes. This payment example shows how component colors help decide what the team must know and who should implement and review each change.

Consider a simplified card payment. Authorization reserves funds on the card. Capture starts collection of those funds. In this example, the provider accepts the capture, but the merchant never receives the reply.

The provider confirms authorization and accepts capture. Its capture reply is lost, and the merchant times out.

The merchant sees only the timeout. Whether it can safely retry depends on how the provider handles a second capture request.

To support twenty providers, we had to remove repeated retry logic from the individual provider integrations. A shared workflow could own the retry decision, with each provider’s behavior as an input. Each new provider would then use the same payment rules.

Color the responsibility

Green components follow a contract. Yellow components make decisions with limited consequences. Red components own critical rules.

I use color to plan work and compare the risks and tradeoffs of a feature change. On the component diagram, I mark who owns each decision and what happens if it is wrong. Then I sketch one more provider. If its adapter decides when to retry a capture, the next integration adds another place where a mistake can charge a customer twice. If it only reports the outcome, the team can add a provider without reviewing a new retry policy. The colors help us choose where to change a rule, who should implement it, and how much review it needs.

Color How I assign it
Green The contract already defines the decision. I can give someone examples and check their implementation against them.
Yellow The component makes its own decisions. I can describe what users lose when it makes a wrong decision, and that loss is limited.
Red The component owns a rule whose failure can cause serious loss or unavailability. Payment completion is one such rule.

A red payment workflow and green provider adapters

Before the change, each integration owned a workflow. Afterward, one workflow owns the payment rules and each adapter follows the same contract.

We moved the payment rules into a shared workflow. Each provider adapter translated an operation into a provider request and reported the result. The workflow decided what to record and what to do next.

We called the original provider workflows yellow because each provider had an independent payment flow and its own canary deployment. The canary released a change to a small share of that provider’s traffic before a wider release. The separate flows kept the change within one provider. A rule that can cause a second charge still deserves red review even when it serves one provider. Moving that rule into the shared workflow gives us one place to review it when it changes.

Each adapter passed the same acceptance scenarios for successful payments and failures. Consider one check I would include for the capture example. If the request times out, the adapter must report that the outcome is unknown. The workflow can then use the provider’s rules to decide whether to check the payment status or retry.

Suppose a new provider requires a separate authorization before capture. I would add authorization to the workflow and give the adapter that operation to translate. If confirmation takes several steps, the workflow can keep the payment pending while it waits. The adapter still has one job for each operation.

The same division applies to order fulfillment. The order workflow decides whether an order can ship. A carrier adapter requests the shipment and reports the carrier’s result.

Two more examples of how failure affects the color

An optional recommendation component can own its ranking rules. Suppose the page omits the recommendations when ranking fails, and a poor ranking only changes which suggestions appear. I would color that component yellow. The reader can still use the page.

Our payment service had a less obvious case. A sanitizer removed sensitive values from provider request dumps before we logged them. Providers often sent data without a clear schema. If the sanitizer reported an error, we logged <sanitizer breaks> and discarded the original message. We lost diagnostic detail.

Now consider a sensitive field the sanitizer fails to recognize. It can return success with the value still present. The error handler never runs. Before I color this component yellow, I need to know what prevents that value from reaching the log. If the sanitizer alone protects it, I treat the disclosure rule as red.

Match agent work to the color

Green work uses automated acceptance checks. Yellow work needs review after implementation. Red work needs human design and review at each step.

When I introduce AI agents to a project, I start with a green component whose contract I can explain with examples. The color helps me decide what to prepare before the agent starts and when a person needs to review its work.

For green work, I give the agent the contract and acceptance checks. For yellow work, I let the agent finish and then review its decisions. For the recommendation example, I would check what the reader sees when the ranking operation fails.

For red work, a human defines the rules and implementation steps first. Two or three reviewers who understand the rules assess each step. Suppose an adapter change adds an automatic retry after a capture timeout. I would ask for a check that counts capture requests after the timeout. A second request means the adapter now makes a payment decision. I would review the retry rule with someone who knows the provider’s duplicate-request behavior.

A separate practice for reviewing and verifying changes

For each change, I would choose a failure a user could observe and ask someone who knows the component to review it. The reviewer explains the expected behavior, then checks whether the changed implementation produces it.

Component What I would ask the reviewer to verify
Provider adapter Use the contract to check how the adapter reports a timeout.
Recommendation ranking Trace the page response when ranking fails.
Payment workflow Simulate a lost capture reply. Count the capture requests and check that the retry rule permits each one.

If only one person can review the retry rule, I would pair that person with a second reviewer on a real change. The second reviewer can run the timeout scenario and explain how its result supports the decision to approve the change.

Start with one system diagram

  1. Pick a decision that several components make.
  2. Trace one failure from the component to the person it affects.
  3. Assign the color from the decision and its consequences.
  4. Record how to check the rule.
  5. Revisit the diagram when a change moves the decision.

On our payment project, the practical gain came when we added the next provider. We could review its adapter against the shared contract. We reviewed the payment rules again when those rules changed.

Vertical slices and domain-driven design

Vertical slice architecture groups the code for one use case. A payment status slice can validate the request, read the payment record, and format the response. If the response needs a field that the record already contains, I can keep the change in that slice. I would treat it as green work if the response contract defines the field. Jimmy Bogard, Vertical Slice Architecture

Domain-driven design (DDD) uses a domain model and a shared language to express business rules. A bounded context defines where that model applies. In the payment context, an unknown capture outcome means the provider may already have accepted the capture. The initial capture request and a later recovery job can both ask the payment workflow what to do with that outcome. Eric Evans, Domain-Driven Design Reference