← Latest papers
💻 computer science

A Multi-Agent Consensus Protocol for Stable Software Remodularization

This paper proposes a novel multi-agent consensus protocol called Asymmetric Monotonic Concession Protocol (AMCP) that reframes software remodularization as a distributed negotiation problem to effectively balance structural cohesion and evolutionary stability, outperforming traditional optimization methods when strict stability constraints are required.

Original authors: Ahmed F. Ibrahim

Published 2026-05-07
📖 4 min read☕ Coffee break read

Original authors: Ahmed F. Ibrahim

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a software system as a massive, messy library. Over time, books (code modules) get shuffled around, misplaced, or stacked in ways that don't make sense anymore. This is called "architectural erosion." To fix it, we need to reorganize the library so related books are together (high cohesion) and the shelves aren't too connected to each other (low coupling).

However, there's a catch: if you rearrange the library too drastically, the librarians (developers) get confused because they can't find their way around the new layout. They need the new arrangement to look somewhat familiar to the old one (high stability).

Traditionally, computer programs tried to solve this by finding the single "perfect" arrangement that maximizes organization, often ignoring how much it would confuse the librarians. This paper proposes a different approach: instead of a single computer trying to be perfect, it uses a negotiation between two digital agents.

The Two Agents

Think of the software as a room with two people arguing over how to arrange the furniture:

  1. The "Cohesion Agent" (The Organizer): This agent wants the furniture grouped by function. "All the lamps should be together! All the chairs should be in a circle!" They care about how tidy and logical the room looks.
  2. The "Stability Agent" (The Historian): This agent wants to keep the furniture exactly where it was yesterday. "Don't move the sofa! The librarians know where it is." They care about keeping things familiar.

The Negotiation: AMCP

The paper introduces a rulebook for their argument called the Asymmetric Monotonic Concession Protocol (AMCP). Here is how it works in simple terms:

  • The Starting Point: The room starts with the furniture exactly where it was yesterday (the previous software version).
  • The Proposal: The "Historian" (Stability Agent) is the only one allowed to suggest moving a single piece of furniture.
  • The Trade-off: The "Organizer" (Cohesion Agent) says, "If you move that lamp, the room gets 10% tidier. But if you move the sofa, the room only gets 1% tidier."
  • The Rule: The Historian looks at all possible moves and picks the one that gives the biggest boost to tidiness for the smallest cost to familiarity.
  • The Safety Net: The architect (the human in charge) sets a "Stability Budget." This is a hard limit, like a fence. The Historian can never move furniture in a way that crosses this fence. If a move would make the room too unfamiliar, it is rejected immediately.

The "Circuit Breaker"

The paper claims this system acts like a circuit breaker in an electrical panel.

  • If the architect says, "I don't care about stability, just make it perfect," the system behaves like a standard optimizer and rearranges everything for maximum efficiency.
  • But if the architect sets a strict limit ("Keep it 95% familiar"), the system acts as a safety switch. If the next best move would break that 95% rule, the system stops immediately. It doesn't force a bad move just to keep searching; it says, "We've reached the limit, and we stop here to protect the team's sanity."

The Results

The authors tested this on a real software system called Xwork (a Java framework).

  • Loose Rules: When they allowed the system to be flexible, the negotiation found a solution just as good as the best existing tools.
  • Strict Rules: When they set a strict stability limit, the system successfully refused to make moves that violated the limit, acting as a "circuit breaker" to enforce the architect's wishes.

Why This Matters

The paper argues that previous tools were "budget-blind"—they either ignored stability or tried to mix it into a single score with arbitrary math. This new method treats stability as a hard constraint that can be negotiated.

The authors proved mathematically that:

  1. The negotiation will always finish (it won't run forever).
  2. The agents act rationally, giving up the least amount of their own goal to gain the other's goal.
  3. The final result is a local "best possible" compromise that respects the safety limits.

In short, this paper turns software reorganization from a "search for perfection" into a "negotiated compromise" that respects the human need for stability.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →