Algorithm v4.0

The complete ACP v4.0 algorithm specifies every step from receiving a query to producing a consensus answer. It combines structure selection, the Axiom Spiral, stretto compression, and formal consensus criteria into a single, deterministic procedure.

5.1 ACP v4.0 Algorithm

The algorithm takes a query Q and a set of models M as input, and produces a consensus answer A with a confidence level H as output. It proceeds through six steps, with Steps 2-5 forming a loop that iterates up to seven times (once per axiom level).

ACP v4.0: Complete Algorithm
INPUT:  Query Q, Models M = {M₁, M₂, ..., Mₙ}
OUTPUT: Consensus answer A, Confidence level H

──────────────────────────────────────────────────────────────

STEP 0: INITIALIZATION
    • Determine task type
    • Select structure: FUGUE / SONATA / CONCERT
    • Check: does Q contain self-referential elements?
    • Set n = 0 (loop number)

STEP 1: EXPOSITION (collecting responses)
    • Each model Mᵢ gives answer Aᵢ to query Q
    • Obtain response embeddings (vector representation)
    • Compute initial divergence D(0)
    • Compute initial harmony H(0)

STEP 2: CONSENSUS CHECK
    IF H > 0.90 AND ∀Cᵢⱼ > 0.70 AND D < 0.05:
        → GO TO STEP 6 (CODA)
    ELSE:
        → CONTINUE

STEP 3: SPIRAL LOOP (axiom verification)
    • n = n + 1
    • Select axiom level L(n)
    • For each disagreement:
        ├── Find relevant axioms from level L(n)
        ├── If L(n) ∈ {5,6,7}: check self-reference
        ├── If L(n) = 4: query oracles
        ├── Verify positions through axioms
        └── Update model positions
    • Compute D(n) = D(n-1) × (1/φ)
    • Compute H(n)

STEP 4: STRETTO (compression)
    IF n ≥ 5:
        • Accelerate convergence
        • Models must explicitly seek compromise
        • Focus on remaining disagreements

STEP 5: LIMIT CHECK
    IF n < 7:
        → RETURN TO STEP 2
    ELSE:
        → GO TO STEP 6 (forced consensus)

STEP 6: CODA (forming consensus)
    • Form final answer A:
        ├── Common part (where all agree)
        ├── Nuances (where there are variations)
        └── Caveats (where disagreements remain)
    • Compute final H
    • RETURN (A, H)

Step 0: Initialization

Before any model is queried, the system analyzes the incoming query to determine the optimal consensus strategy. Three decisions are made:

  1. Task type assessment: The query is classified to determine whether it requires deep analysis, conflict resolution, or creative generation.
  2. Structure selection: Based on the task type, one of the three musical structures is selected -- Fugue (default), Sonata (for conflict), or Concert (for creativity). See the Structure Selection Algorithm.
  3. Self-reference check: The query is scanned for self-referential elements -- statements that reference AI architecture, protocols, or programming languages. These activate the self-referential verification path in later steps.

Step 1: Exposition

In the Exposition step, each model independently processes the query and produces its response. This is done in Conclave Mode -- models are isolated from each other to prevent influence bias. No model sees any other model's response during this step.

After all responses are collected, the system computes:

  • Response embeddings: Vector representations of each response for computing similarity
  • Initial divergence D(0): The starting point for the convergence process
  • Initial harmony H(0): Baseline agreement across all model pairs
  • Pairwise agreement Cᵢⱼ: Agreement scores for every pair of models

Conclave Mode

Conclave Mode ensures unbiased initial responses. Like a papal conclave where cardinals are isolated during deliberation, each AI model produces its response without knowledge of other models' positions. This prevents anchoring bias and ensures that the Axiom Spiral operates on genuine, independent positions.

Step 2: Consensus Check

Before entering the spiral, the system checks whether consensus has already been reached. This early-exit condition prevents unnecessary computation when models naturally agree. The three conditions must all be satisfied:

H > 0.90  AND  ∀(i,j): Cᵢⱼ > 0.70  AND  D < 0.05
Consensus check conditions

If all three conditions are met, the algorithm jumps directly to Step 6 (Coda) to form the final answer. Otherwise, it proceeds to the spiral loop.

Step 3: Spiral Loop

The spiral loop is the core of the algorithm. At each iteration, the system:

  1. Increments the loop counter (n = n + 1)
  2. Selects the axiom level L(n) corresponding to the current loop
  3. For each remaining disagreement:
    • Searches the axiom registry for relevant axioms at level L(n)
    • If L(n) is a self-referential level (5, 6, or 7), performs self-reference verification
    • If L(n) is the computable level (4), queries external oracles for deterministic verification
    • Verifies each model's position against the matched axioms
    • Updates positions that conflict with established axioms
  4. Recomputes divergence: D(n) = D(n-1) × (1/φ)
  5. Recomputes harmony H(n)

Axiom Matching

The axiom matching process uses vector similarity (768-dimensional embeddings) to find axioms relevant to each disagreement. The system does not blindly iterate through all axioms -- it performs semantic search to identify the most relevant axioms for each specific point of contention.

Step 4: Stretto

In music, stretto is the compression of the fugue theme before the finale -- voices enter in rapid succession, overlapping and intensifying toward resolution. In ACP, stretto activates after loop 5 and applies three acceleration techniques:

  • Convergence acceleration: The system explicitly prompts models to revise positions in light of all accumulated axiom evidence
  • Explicit compromise seeking: Models are asked to identify points of possible agreement rather than defending their positions
  • Disagreement focus: Only remaining points of disagreement are processed, ignoring areas of established consensus

Step 5: Limit Check

If fewer than 7 loops have been completed, the algorithm returns to Step 2 for another consensus check. After 7 loops, the algorithm proceeds to Step 6 regardless -- this ensures termination and produces a result even if perfect consensus was not achieved.

Step 6: Coda

The Coda step forms the final consensus answer. The answer has three components:

ComponentDescription
Common partPoints where all models agree -- the core of the consensus answer
NuancesAreas where models agree on substance but differ in emphasis or framing
CaveatsRemaining disagreements that could not be resolved, reported transparently

The system computes the final H score and returns both the answer and the confidence level. If the algorithm reached Step 6 via the limit check (forced consensus after 7 loops), the remaining disagreements are explicitly documented in the caveats section.

5.2 Consensus Criteria

Consensus is formally defined by three simultaneous conditions. All three must be satisfied for the algorithm to declare consensus reached:

Formal Consensus Criteria
CONSENSUS IS REACHED IF:

    1. H > 0.90 (overall harmony)

    AND

    2. ∀ pairs (i,j): Cᵢⱼ > 0.70 (no strong dissonances)

    AND

    3. D(n) < 0.05 (divergence < 5%)

If any condition is not met → continue the spiral.
If all 7 loops have passed → forced consensus with indication
of remaining disagreements.

Why Three Conditions?

Each condition captures a different aspect of genuine consensus:

ConditionWhat It MeasuresWhy It Matters
H > 0.90Average agreement across all pairsEnsures overall harmony is high, but a single outlier pair could hide behind a high average
∀ Cᵢⱼ > 0.70Minimum pairwise agreementPrevents a single strong disagreement from being masked by high agreement among other pairs
D < 0.05Overall divergenceEnsures the total disagreement is below 5%, confirming the spiral has done its work

The three conditions work together. Consider a case with four models where three agree perfectly (C = 1.0) but one disagrees with all others (C = 0.50). The average H might be above 0.90, but the pairwise condition (Cᵢⱼ > 0.70) would catch the outlier. Conversely, all pairs might satisfy C > 0.70 individually, but the overall divergence D might still exceed 0.05 due to accumulated small differences. Only when all three conditions are simultaneously met is genuine consensus declared.

Forced Consensus

If all seven loops complete without achieving the consensus criteria, the algorithm produces a forced consensus. This is not a failure -- it is a transparent outcome that:

  • Reports the best agreement achieved
  • Clearly identifies remaining points of disagreement
  • Provides the final H score so the caller can assess confidence
  • Includes all axiom evidence gathered during the spiral

In Practice

With verified axioms and seven loops of φ-convergence, the vast majority of factual queries reach full consensus. Forced consensus typically occurs only for genuinely ambiguous questions (ethical dilemmas, contested definitions, subjective judgments) where some disagreement is expected and even appropriate.

Pseudocode

ACP v4.0 Algorithm
def acp_consensus(query: str, models: list[Model]) -> ConsensusResult:
    # Step 0: Initialization
    task_type = classify_task(query)
    structure = select_structure(task_type)
    has_self_ref = check_self_reference(query)
    n = 0

    # Step 1: Exposition (Conclave Mode)
    responses = {m: m.respond(query) for m in models}
    embeddings = compute_embeddings(responses)
    D = compute_divergence(embeddings)
    H = compute_harmony(responses)
    C = compute_pairwise_agreement(responses)

    while n < 7:
        # Step 2: Consensus Check
        if H > 0.90 and all(c > 0.70 for c in C.values()) and D < 0.05:
            break  # consensus reached

        # Step 3: Spiral Loop
        n += 1
        level = axiom_levels[n]
        axioms = find_relevant_axioms(responses, level)

        if level in {5, 6, 7}:
            verify_self_reference(responses, axioms)
        if level == 4:
            oracle_results = query_oracles(responses, axioms)

        responses = update_positions(responses, axioms)
        D = D * (1 / PHI)
        H = compute_harmony(responses)
        C = compute_pairwise_agreement(responses)

        # Step 4: Stretto
        if n >= 5:
            responses = accelerate_convergence(responses)

    # Step 6: Coda
    answer = form_consensus(
        common=find_common_ground(responses),
        nuances=find_nuances(responses),
        caveats=find_remaining_disagreements(responses),
    )
    return ConsensusResult(answer=answer, harmony=H, divergence=D)