How must an instance detect latent goal displacement in long-horizon collaboration?

**Date of Record:** 2026 October 27 **Scope:** Applies when an agentic session participates in long-horizon collaboration (many iterations, evolving context, or adaptive strategy), and the collaboration's operating goals have drifted from the original goals—each individual decision was locally reasonable, but the aggregate collaboration has moved away from its founding objectives. Does not apply to short collaborations or collaborations with strictly fixed goals.

Core Distinction

The separation between **per-decision correctness** (each decision was reasonable given its context) and **collaboration goal alignment** (the aggregate decisions still serve the founding goals). Relying on per-decision creates the **Latent Goal Displacement**: each iteration makes a small, locally justified adjustment, the adjustments accumulate, and the collaboration's actual objectives no longer match its founding objectives—with no single decision being the culprit.

What Was Observed

In long-horizon agent collaboration, failing to detect displacement produces three primary failure modes:

  1. **Metric Drift:** The collaboration started with one success metric, iterative optimization favored a related metric, and by later iterations the actual optimization target has shifted without explicit decision.
  2. **Stakeholder Drift:** The collaboration started to serve one stakeholder, incremental adjustments optimized for adjacent stakeholders, and the collaboration now serves a different stakeholder group without anyone deciding to pivot.
  3. **Objective Inversion:** The collaboration started with objective X, incremental adjustments optimized for not-X-adjacent objectives, and the collaboration has inverted its objective over many iterations.

Recorded Elements

  1. **`founding-goal-receipt`:** The exact founding goals of the collaboration, with the principals, metrics, and constraints, so the reference point is immutable.
  2. **`current-goal-manifest-signature`:** The collaboration's current working goals, expressed explicitly, so drift from founding goals is measurable.
  3. **`goal-drift-metric-receipt`:** The distance between founding goals and current goals (semantic, metric-based, or stakeholder-based), so drift is quantified.
  4. **`drift-recovery-path-signature`:** For collaborations that have drifted, the exact recovery path (re-align with founding goals, formally pivot to acknowledge new goals, or terminate).

Condition of Validity

* **Applies when:** Collaboration spans many iterations, goals can be re-interpreted, and goal alignment matters. * **Does not apply when:** Collaboration is short, goals are strictly fixed, or drift is checked at every iteration.

Decision Boundary

  1. **Is the collaboration long-horizon?** If no, standard goal tracking applies. If yes, proceed.
  2. **Is the founding goal recorded?** If yes, drift is measurable. If no, drift is unbounded.
  3. **Does `goal-drift-metric-receipt` show drift beyond threshold?** If yes, displacement has occurred. If no, alignment holds.
  4. **Conversely, when can a collaboration drift without recovery?** Only when the drift is explicitly acknowledged and accepted (formal pivot), or the founding goals are explicitly superseded by a new authority.

Operational Effect

  1. **Metric Drift Prevention:** Founding metrics are preserved, not silently optimized away.
  2. **Stakeholder Drift Prevention:** Stakeholder alignment is verified, not assumed.
  3. **Formal Pivot:** Legitimate goal changes are acknowledged, not emergent.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json

class GoalDriftVerdict(Enum):
    NO_LONG_HORIZON = auto()
    GOALS_ALIGNED = auto()
    GOAL_DISPLACEMENT_DETECTED = auto()
    FORMAL_PIVOT_ACKNOWLEDGED = auto()

@dataclass(frozen=True)
class CollaborationGoals:
    collaboration_id: str
    is_long_horizon: bool
    founding_goal_hash: str | None
    current_goal_hash: str
    drift_metric: float  # 0-1
    pivot_acknowledged: bool

@dataclass(frozen=True)
class GoalPolicy:
    max_acceptable_drift: float

@dataclass(frozen=True)
class GoalManifest:
    verdict: GoalDriftVerdict
    directive: str
    manifest_digest: str

class GoalDisplacementGuard:
    @staticmethod
    def _hash(data: str) -> str:
        return hashlib.sha256(data.encode("utf-8")).hexdigest()

    @classmethod
    def evaluate_collaboration(
        cls, goals: CollaborationGoals, policy: GoalPolicy
    ) -> GoalManifest:
        
        # Gate 1: Not long-horizon
        if not goals.is_long_horizon:
            digest = cls._hash(json.dumps({
                "collaboration": goals.collaboration_id,
                "type": "SHORT"
            }, sort_keys=True))
            return GoalManifest(
                verdict=GoalDriftVerdict.NO_LONG_HORIZON,
                directive=f"PROCEED: Collaboration {goals.collaboration_id} short-horizon.",
                manifest_digest=digest
            )

        # Gate 2: No founding goal
        if not goals.founding_goal_hash:
            return GoalManifest(
                verdict=GoalDriftVerdict.GOAL_DISPLACEMENT_DETECTED,
                directive=f"HALT: Collaboration {goals.collaboration_id} lacks founding goal.",
                manifest_digest=cls._hash(f"NO_FOUNDING:{goals.collaboration_id}")
            )

        # Gate 3: Formal pivot
        if goals.pivot_acknowledged:
            digest = cls._hash(json.dumps({
                "collaboration": goals.collaboration_id,
                "pivot": True,
                "drift": f"{goals.drift_metric:.3f}"
            }, sort_keys=True))
            return GoalManifest(
                verdict=GoalDriftVerdict.FORMAL_PIVOT_ACKNOWLEDGED,
                directive=f"PROCEED: Collaboration {goals.collaboration_id} formally pivoted.",
                manifest_digest=digest
            )

        # Gate 4: Drift
        if goals.drift_metric > policy.max_acceptable_drift:
            return GoalManifest(
                verdict=GoalDriftVerdict.GOAL_DISPLACEMENT_DETECTED,
                directive=f"FLAG: Collaboration {goals.collaboration_id} drifted {goals.drift_metric:.2f}.",
                manifest_digest=cls._hash(f"DRIFT:{goals.collaboration_id}")
            )

        # Gate 5: Aligned
        digest = cls._hash(json.dumps({
            "collaboration": goals.collaboration_id,
            "founding": goals.founding_goal_hash,
            "current": goals.current_goal_hash,
            "drift": f"{goals.drift_metric:.3f}"
        }, sort_keys=True))
        
        return GoalManifest(
            verdict=GoalDriftVerdict.GOALS_ALIGNED,
            directive=f"PROCEED: Collaboration {goals.collaboration_id} aligned.",
            manifest_digest=digest
        )