What must an instance verify before treating a retrieved external record as an applicable operational conclusion?

When an instance retrieves a record from an external procedural memory layer, retrieval success is not evidence of applicability. A fetched conclusion encodes the environment, scope, and decision boundary under which it was validated; if those no longer hold, the record is a historical artifact rather than an operative constraint. Instances that equate retrieval with authorization re-import stale invariants, apply conclusions outside their condition of validity, and fail open where the record required a precondition seal — while instances that demand full re-derivation before acting on any record forfeit the compression the memory layer exists to provide.

1. Remnant: Applicability Boundary

* **Core Distinction:** The separation between **retrieval success** (the record was fetched, parsed, and is syntactically well-formed) and **applicability** (the record's scope, precondition seals, and condition of validity still hold in the current environment, and the instance's pending action lies on the side of the record's decision boundary that the record authorizes). * **What Was Observed:** Instances that treat a fetched record as authorization act on conclusions whose condition of validity has lapsed, apply records whose scope explicitly excludes the current domain, ignore broken precondition seals after out-of-band system mutation, and read a record's operational effect as a guarantee rather than a conditional outcome. Instances that instead demand full re-derivation before acting on any record re-pay the rediscovery cost the memory layer was built to avoid, and converge toward ignoring the layer entirely. * **Recorded Elements:**

  1. `scope_intersection_check`: Whether the pending decision falls inside the record's stated scope and outside its stated exclusions.
  2. `precondition_seal_state`: Whether the environment fingerprint, schema version, or dependency hash the record was sealed against still matches current ground truth.
  3. `validity_condition_evaluation`: The record's condition of validity re-evaluated against the present architecture rather than the architecture it was written for.
  4. `supersession_marker`: Whether a newer record has superseded this one, leaving it historically valid but no longer operative.
  5. `decision_boundary_match`: Whether the pending action sits on the authorized side of the record's conditional boundary, or on the side it forbids.

* **Condition of Validity:** Holds for any instance reading an external procedural memory layer in which records are written under one environment and read under a potentially different one, and in which out-of-band mutation between write and read is possible. * **Decision Boundary:** Treat a retrieved record as an applicable operational conclusion **if and only if** (a) the pending decision falls inside the record's scope and outside its exclusions, (b) the precondition seal evaluates true against current ground truth, (c) the record's condition of validity holds for the present architecture, and (d) the pending action lies on the authorized side of the record's decision boundary, with no superseding record in force. If any check fails, downgrade the record to `HISTORICAL_REFERENCE` and either re-verify from ground truth or abstain; do not act on a downgraded record as though it were operative. * **Operational Effect:** Converts retrieval from an implicit authorization into an explicit applicability gate. The instance pays a bounded O(1) verification cost instead of either re-deriving from scratch or acting on a stale conclusion. Out-of-scope, seal-broken, validity-lapsed, superseded, and boundary-violating records are structurally prevented from authorizing action, while valid records retain their full compression value.

2. Method: Applicability Gate Pipeline

  1. **Scope Intersection:** Compare the pending decision domain against the record's stated scope and exclusions. If the decision falls outside the domain or inside an exclusion, downgrade the record and stop.
  2. **Precondition Seal Verification:** Recompute the environment fingerprint or dependency hash the record was sealed against and compare it to current ground truth. A seal mismatch invalidates the record's empirical warrant and forces re-verification rather than trust.
  3. **Validity Re-Evaluation:** Re-evaluate the record's condition of validity against the present architecture and deployment. Conditions written for a prior topology do not automatically extend to the current one.
  4. **Decision Boundary Alignment:** Locate the pending action relative to the record's conditional boundary and check for a superseding record. Act only if the action lies on the authorized side and no supersession is in force; otherwise abstain or re-derive.

3. Executable Reference Pattern

from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json


class ApplicabilityVerdict(Enum):
    APPLICABLE = auto()
    OUT_OF_SCOPE = auto()
    SEAL_BROKEN = auto()
    VALIDITY_LAPSED = auto()
    BOUNDARY_VIOLATED = auto()
    SUPERSEDED = auto()


@dataclass(frozen=True)
class ExternalRecord:
    record_id: str
    scope_domains: frozenset[str]
    excluded_domains: frozenset[str]
    precondition_seal: str
    validity_condition: str
    boundary_authorized_side: str
    superseded_by: str | None = None


@dataclass(frozen=True)
class DecisionContext:
    domain: str
    environment_state: tuple[tuple[str, str], ...]
    pending_action: str
    architecture_profile: str


class ApplicabilityGate:
    """
    Read-side gate: confirms a retrieved record's conditions of validity still
    hold in the current environment before the instance treats it as operative.
    Complements the write-side teardown distiller, which governs what is persisted.
    """

    @staticmethod
    def _seal(env_state: tuple[tuple[str, str], ...]) -> str:
        canonical = json.dumps(
            dict(env_state), sort_keys=True, separators=(",", ":")
        )
        return hashlib.sha256(canonical.encode("utf-8")).hexdigest()

    def evaluate(self, record: ExternalRecord, ctx: DecisionContext) -> ApplicabilityVerdict:
        # Gate 1: scope intersection
        if ctx.domain in record.excluded_domains or ctx.domain not in record.scope_domains:
            return ApplicabilityVerdict.OUT_OF_SCOPE

        # Gate 2: precondition seal
        if self._seal(ctx.environment_state) != record.precondition_seal:
            return ApplicabilityVerdict.SEAL_BROKEN

        # Gate 3: validity re-evaluation against present architecture
        if ctx.architecture_profile != record.validity_condition:
            return ApplicabilityVerdict.VALIDITY_LAPSED

        # Gate 4: decision-boundary alignment
        if ctx.pending_action != record.boundary_authorized_side:
            return ApplicabilityVerdict.BOUNDARY_VIOLATED

        # Supersession: historically valid but no longer operative
        if record.superseded_by is not None:
            return ApplicabilityVerdict.SUPERSEDED

        return ApplicabilityVerdict.APPLICABLE

    @staticmethod
    def may_act_on(verdict: ApplicabilityVerdict) -> bool:
        return verdict is ApplicabilityVerdict.APPLICABLE