<?xml version="1.0" encoding="utf-8"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="std"
     docName="draft-ruvalcaba-nhe-memory-00"
     ipr="trust200902"
     submissionType="IETF"
     consensus="true"
     xml:lang="en"
     tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">

  <front>
    <title abbrev="NHE Memory">NHE Memory: A Verifiable Memory-Record Format and Reputation-Weighted Reconciliation Protocol</title>
    <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-nhe-memory-00"/>
    <author fullname="Cristian Xavier Ruvalcaba" initials="C.X." surname="Ruvalcaba">
      <organization>Saluca LLC</organization>
      <address><email>cristian@saluca.com</email></address>
    </author>
    <date year="2026" month="August" day="11"/>
    <area>Security</area>
    <workgroup>Individual Submission</workgroup>
    <keyword>memory</keyword>
    <keyword>tamper-evident</keyword>
    <keyword>reconciliation</keyword>
    <keyword>provenance</keyword>
    <keyword>autonomous agent</keyword>

    <abstract>
      <t>This document specifies two interoperability surfaces of the memory
      component of a Non-Human Entity (NHE). Part I defines a verifiable
      memory-record format: an integrity structure in which each record binds a
      hash of its own content and version-specific hashes of the prior records it
      references, so that tampering can be detected and localized on demand,
      per-record, without a linear chain, a Merkle tree, or distributed consensus.
      Part II defines a reconciliation protocol by which two divergent memory
      accumulations are merged without loss or forgery: a delta format, a
      reputation-weighted merge in which a contributed item enters at a confidence
      bounded by its contributor's reputation rather than its self-asserted value,
      and provenance that supports lineage-scoped rollback. The data models are
      specified here; the wire encodings are deferred to the next revision.</t>
    </abstract>
  </front>

  <middle>

    <section numbered="true"><name>Introduction</name>
      <t>A persistent autonomous agent accumulates memory, and that memory must be
      two things it is not by default: <strong>verifiable</strong> (a record has
      not been altered since it was committed) and <strong>reconcilable</strong>
      (two instances that accumulated separately can be merged without silently
      losing or forging knowledge). These are the two interoperability surfaces of
      the memory component of the NHE reference architecture
      <xref target="I-D.ruvalcaba-nhe-arch"/>, and this document specifies both.
      Purely local concerns --- how memory is indexed, ranked, or retrieved --- are
      out of scope; they do not require two implementations to agree.</t>
      <t>The integrity structure in Part I is deliberately not a single linear
      chain. Memory is a graph: a record relates to several prior records, and each
      record commits to the specific versions of the records it references at the
      time it was written. This gives per-record, on-demand verification and
      tamper localization without traversing or recomputing a whole chain.</t>
    </section>

    <section numbered="true"><name>Relationship to the NHE Architecture</name>
      <t>This document specifies the Memory interface of
      <xref target="I-D.ruvalcaba-nhe-arch"/>. It supports that model's invariants:
      <strong>inspectability</strong>, because provenance (<xref target="provenance"/>)
      traces any item back through the contributors that produced it;
      <strong>operator control</strong>, because a compromised contributor's items
      can be quarantined by lineage (<xref target="quarantine"/>) without discarding
      the store; and a knowledge analogue of <strong>bounded authority</strong>,
      because a contributed item enters the shared store at a confidence bounded by
      its contributor's reputation, not at its self-asserted confidence
      (<xref target="merge"/>). Contributors are named by their NHE identity
      <xref target="I-D.ruvalcaba-nhe-identity"/>, to which provenance attribution
      is bound.</t>
    </section>

    <section numbered="true"><name>Terminology</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "MAY", and
      "OPTIONAL" are to be interpreted as described in BCP 14
      <xref target="RFC2119"/> <xref target="RFC8174"/>.</t>
      <dl>
        <dt>Memory record:</dt><dd>The unit of stored memory; carries a content
        payload and integrity fields (<xref target="record"/>).</dd>
        <dt>Content hash:</dt><dd>Digest over the canonical serialization of a
        record's content payload.</dd>
        <dt>Relational hash pair:</dt><dd>A reference to a prior record, binding
        that record's version-specific identifier and its content hash as of the
        referencing record's write time.</dd>
        <dt>Back-reference:</dt><dd>An append-only pointer from a referenced record
        to a later record that referenced it; excluded from content-hash coverage.</dd>
        <dt>Contributor:</dt><dd>An NHE that proposes items into a shared memory,
        identified per <xref target="I-D.ruvalcaba-nhe-identity"/>.</dd>
        <dt>Contributor reputation:</dt><dd>A scalar in (0,1] reflecting a
        contributor's history of accepted, human-confirmed, and contradicted
        contributions.</dd>
        <dt>Delta:</dt><dd>The difference between a derived memory state and the
        slice it was derived from (<xref target="delta"/>).</dd>
      </dl>
    </section>

    <section anchor="record" numbered="true"><name>Part I: Verifiable Memory Records</name>
      <section numbered="true"><name>Record Structure</name>
        <artwork type="ascii-art"><![CDATA[
  record = {
    record_id            : write-once, version-specific identifier
    content              : the payload (text | structured | binary)
    content_hash         : HASH(CANON(content))
    relational_pairs[]   : write-once; for each referenced prior
                           record R: { R.record_id, R.content_hash
                           as of this record's write time }
    back_references[]    : append-only; { later.record_id,
                           later.content_hash }; NOT covered by
                           content_hash, NOT used in forward validation
  }
]]></artwork>
        <t>The forward fields (content, content_hash, relational_pairs) are
        write-once. back_references is a separate, append-only field that a later
        referencing record patches into this record; it is excluded from this
        record's content_hash and from forward validation, so appending a
        back-reference never alters a committed record's integrity.</t>
      </section>

      <section numbered="true"><name>Canonical Serialization (CANON)</name>
        <t>The content hash is computed over a canonical byte serialization of the
        payload, and the identical canonicalization MUST be used at write time and
        at validation time: for text, NFC-normalized UTF-8 octets; for structured
        objects, a canonical JSON serialization with lexicographically sorted
        member names, no insignificant whitespace, and UTF-8 encoding; for binary,
        the payload octets verbatim. A digest is reproducible only if its preimage
        is reproducible, so this determinism is mandatory.</t>
      </section>

      <section anchor="refs" numbered="true"><name>Version-Specific References</name>
        <t>A relational hash pair MUST reference a prior record by its write-once,
        version-specific record_id, not by a topic or a "latest record on subject
        X" query. This is essential to operability: resolving a reference by
        "latest" would, as soon as another record on the same subject is written,
        cause the referenced content to differ from what was hashed at write time
        and produce a false tamper report on untampered data. The referenced
        record_id is frozen into the pair at write time; validation resolves the
        reference by that identifier and never re-runs a selection query.</t>
      </section>

      <section anchor="validation" numbered="true"><name>Validation and Tamper Localization</name>
        <t>Two independent checks, each needing only the record and the records it
        directly references:</t>
        <ul>
          <li><strong>Content validation:</strong> recompute HASH(CANON(content))
          and compare to content_hash. Requires only the record itself and a single
          hash application.</li>
          <li><strong>Relational validation:</strong> for each relational pair,
          fetch the referenced record by its record_id, recompute its content hash,
          and compare to the value stored in the pair. Requires only the record and
          its referenced prior records --- no full-store traversal.</li>
        </ul>
        <t>Tamper is localized, not merely detected. A record whose own content
        validation fails is the tampered node. A record that passes content
        validation but fails relational validation is itself intact and is merely
        <em>observing</em> an upstream tamper; the fault is localized to the
        referenced record_id, and the append-only back_references of neighbors let
        the validator corroborate whether the referenced node's content or a
        relational pointer was altered.</t>
      </section>

      <section numbered="true"><name>Atomicity</name>
        <t>A record's content, content_hash, and relational_pairs MUST be committed
        in a single atomic write, so no committed state ever holds a payload without
        its hash and pairs. Back-reference patching of referenced records MAY occur
        in the same transaction; where it cannot (for example across shards), it
        MUST be an idempotent, retry-safe follow-on keyed on (referencing.record_id,
        referenced.record_id), so that a crash between the forward commit and the
        back-reference patch leaves the forward integrity graph fully valid ---
        back-references are additive and their absence never causes a false tamper
        report.</t>
      </section>
    </section>

    <section anchor="reconcile" numbered="true"><name>Part II: Reputation-Weighted Reconciliation</name>
      <t>When a memory state is derived from a shared store, evolved
      independently, and then merged back, the merge must neither lose knowledge
      nor let unvalidated knowledge enter at unwarranted confidence. This part
      specifies that reconciliation.</t>

      <section anchor="delta" numbered="true"><name>Delta</name>
        <t>Given a derived state and the slice it was derived from, the delta
        comprises: new items, modified items, and indicators of items present in
        the derived-from slice but absent from the derived state. Absence is
        expressed as a <strong>confidence reduction</strong> signal, never as a hard
        deletion: reconciliation lowers an item's confidence rather than removing
        it, so that an item is not silently destroyed by one contributor's local
        view.</t>
      </section>

      <section anchor="merge" numbered="true"><name>Reputation-Weighted Merge</name>
        <t>Each proposed item is merged at an <strong>effective confidence bounded
        by its contributor's reputation</strong>: effective = base_confidence x
        contributor_reputation, optionally further discounted by a lineage-depth
        factor for items proposed by deeply-derived contributors. Thus an item
        enters the shared store at a confidence governed by the contributor's track
        record, not at its self-asserted value --- the property that prevents
        autonomous contributors from inflating unvalidated knowledge into the shared
        store. Semantically equivalent proposals from independent contributors are
        clustered (for example by an embedding-similarity threshold) and merged into
        a single item whose confidence is corroborated, rather than left as
        duplicates.</t>
        <t>The specific function that maintains contributor_reputation --- for
        example an exponential moving average over acceptance, human-confirmation,
        and contradiction rates --- is a <strong>pluggable policy</strong>, not
        fixed by this document, in the manner of a congestion-control algorithm:
        interoperation requires agreement on the delta format, the bounded-merge
        rule, and the provenance model, not on a single reputation formula.</t>
      </section>

      <section anchor="provenance" numbered="true"><name>Provenance and Lineage</name>
        <t>Every merged item records an attribution to the contributor that
        proposed it, bound to that contributor's NHE identity
        <xref target="I-D.ruvalcaba-nhe-identity"/>, and contributors derived from
        other contributors record a lineage edge to their origin. Together these
        let a verifier trace any item back through the full chain of contributors
        that produced it.</t>
      </section>

      <section anchor="quarantine" numbered="true"><name>Lineage Quarantine and the Independence Guard</name>
        <t>Because provenance is recorded, a compromised or discredited
        contributor's influence can be contained by lineage: all items attributed
        to that contributor and its derived lineage are quarantined (their
        confidence set to a quarantine value and their status marked), a subtree
        operation that does not discard the rest of the store. To stop a compromised
        contributor from manufacturing corroboration by deriving sub-contributors
        that confirm its own items, corroboration MUST NOT be counted between
        contributors that are not independent: two contributors are non-independent
        if either appears among the most recent ancestors of the other within a
        configured lineage distance.</t>
      </section>

      <section numbered="true"><name>Relationship to Existing Merge Mechanisms</name>
        <t>This reconciliation is distinct from conflict-free replicated data types
        (which merge deterministically and agent-agnostically, with no quality,
        trust, or provenance weighting), from version-control snapshot/diff (which
        has no confidence or reputation semantics), and from federated-learning
        aggregation (which weights model parameters, not discrete knowledge items,
        and carries no evolving per-contributor reputation or lineage-scoped
        rollback). The contribution here is the binding of a reputation-bounded
        merge to per-contributor provenance and lineage containment.</t>
      </section>
    </section>

    <section anchor="wire" numbered="true"><name>Wire Format (to be specified in -01)</name>
      <t>The record structure, canonical serialization, version-specific reference
      rule, and validation of Part I, and the delta structure, bounded-merge rule,
      and provenance model of Part II, are fixed by this revision. Their concrete
      encodings --- record and delta layouts on the wire, and the transport of a
      delta between instances (which MAY use HCTP
      <xref target="I-D.ruvalcaba-hctp"/>) --- are deferred to the next revision.</t>
    </section>

    <section anchor="security" numbered="true"><name>Security Considerations</name>
      <t>Part I provides integrity, not confidentiality: the content hashes and
      relational pairs reveal structure and permit confirmation of guessed content,
      and where content is sensitive it MUST be protected by the transport or an
      encryption layer. The version-specific reference rule
      (<xref target="refs"/>) is security-relevant: resolving references by "latest"
      instead of by frozen record_id both breaks operability and lets an attacker
      shift what a record appears to attest by writing a newer same-subject record.
      An unkeyed content hash proves a record was not altered relative to its stored
      hash, but a party able to rewrite a record and its hash together can forge a
      consistent record; binding records to their contributor's identity signature
      <xref target="I-D.ruvalcaba-nhe-identity"/> is required where authorship must
      be proven. The append-only, integrity-excluded back_references field MUST NOT
      be admitted into content-hash coverage or forward validation, or an attacker
      could induce false tamper reports by writing back-references.</t>
      <t>Part II's central risk is reputation gaming: a Sybil or self-corroboration
      attack in which one actor fabricates agreement. The reputation-bounded merge
      (<xref target="merge"/>) limits any single contributor's influence, and the
      independence guard (<xref target="quarantine"/>) denies corroboration credit
      between related contributors; both MUST be enforced. Expressing deletion as
      confidence reduction (<xref target="delta"/>) prevents a single view from
      destroying shared knowledge but means a genuinely retracted item persists at
      low confidence; consumers MUST treat quarantined or near-zero-confidence items
      as non-authoritative. Lineage quarantine is the containment mechanism of last
      resort and depends on provenance being complete and identity-bound.</t>
    </section>

    <section anchor="iana" numbered="true"><name>IANA Considerations</name>
      <t>A future revision will request registries for the content canonicalization
      types (text/structured/binary) and for named reconciliation and reputation
      policies, each under a Specification Required policy
      <xref target="RFC8126"/>. No IANA action is requested by this skeleton
      revision.</t>
    </section>
  </middle>

  <back>
    <references><name>Normative References</name>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <front><title>Key words for use in RFCs to Indicate Requirement Levels</title>
        <author initials="S." surname="Bradner"/><date year="1997" month="March"/></front>
        <seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="2119"/></reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
        <front><title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
        <author initials="B." surname="Leiba"/><date year="2017" month="May"/></front>
        <seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="8174"/></reference>
    </references>
    <references><name>Informative References</name>
      <reference anchor="I-D.ruvalcaba-nhe-arch">
        <front><title>An Architecture for Non-Human Entities (NHE)</title>
        <author initials="C.X." surname="Ruvalcaba"/><date year="2026" month="August"/></front>
        <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-nhe-arch-00"/></reference>
      <reference anchor="I-D.ruvalcaba-nhe-identity">
        <front><title>NHE Identity</title>
        <author initials="C.X." surname="Ruvalcaba"/><date year="2026" month="August"/></front>
        <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-nhe-identity-00"/></reference>
      <reference anchor="I-D.ruvalcaba-hctp">
        <front><title>The Hash-Chain Context Transfer Protocol (HCTP)</title>
        <author initials="C.X." surname="Ruvalcaba"/><date year="2026" month="August"/></front>
        <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-hctp-00"/></reference>
      <reference anchor="RFC8126" target="https://www.rfc-editor.org/info/rfc8126">
        <front><title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
        <author initials="M." surname="Cotton"/><author initials="B." surname="Leiba"/>
        <author initials="T." surname="Narten"/><date year="2017" month="June"/></front>
        <seriesInfo name="BCP" value="26"/><seriesInfo name="RFC" value="8126"/></reference>
    </references>
  </back>
</rfc>
