dev.idiolect.encounter

A signed record of a single lens invocation. Encounters are the emergent-channel primitive: they record that a translation occurred, with enough context for aggregators (observations) and correctors to reason about it. Narrative commentary lives in annotations; the structured payload in use covers the action / material / purpose / actor of the invocation.

Source: lexicons/dev/idiolect/encounter.json · Rust: idiolect_records::Encounter · TS: @idiolect-dev/schema/encounter · Fixture: idiolect_records::examples::encounter

Shape

FieldTypeRequiredNotes
lenslensRefyesThe lens that was invoked.
sourceSchemaschemaRefyesSource schema the lens translated from.
targetSchemaschemaRefnoTarget schema produced by the lens. Often implied by the lens; elided when unambiguous.
sourceInstancecid-linknoContent-addressed reference to the source instance. Omit when visibility restricts publishing source data.
producedOutputcid-linknoContent-addressed reference to the produced output.
useuseyesStructured action / material / purpose / actor.
downstreamResultopen enumnosuccess / corrected / rejected / unknown.
downstreamResultVocabvocabRefnoVocab the slug resolves against.
annotationsstring (≤4000 graphemes)noNarrative commentary.
holderdidnoParty the encounter is attributed to. Omit for first-party records.
basisbasisnoStructured grounding when holder differs from the repo owner.
kindopen enumyesCorpus-kind slug (invocation-log, curated, roundtrip-verified, production, adversarial).
kindVocabvocabRefnoVocab the kind slug resolves against.
visibilityvisibilityyespublic-detailed / public-minimal / public-aggregate-only / community-scoped / private.
occurredAtdatetimeyesWhen the invocation happened. Distinct from the record's createdAt.

Field details

use

The structured payload. A use carries:

  • action (open-enum slug, resolved against actionVocabulary).
  • material (a materialSpec: scope plus optional corpus pointer).
  • purpose (open-enum slug, resolved against purposeVocabulary).
  • actor (string; who ultimately performs or benefits).

All four together form the "what was done, on what, for what end, by which actor" tuple. Consumers that match on actions match on subsumption against the referenced vocabulary, not on substring equality. Two communities that disagree on whether train_model subsumes fine_tune produce different routing decisions from the same encounter, which is the right answer.

kind

The encounter-kind slug declares what the corpus represents:

SlugMeaning
invocation-logA real production invocation.
curatedA hand-picked sample, often used for evaluation.
roundtrip-verifiedAn invocation where put(get(a)) == a was verified at write time.
productionSynonym for invocation-log in some pipelines; exists for distinct trust weighting.
adversarialAn invocation explicitly chosen to stress the lens.

Observers declare in their method which kinds they weight and how. An observation aggregating invocation-log plus curated encounters is meaningfully different from one aggregating only adversarial ones; the kind plus the observer's method together is what makes the observation interpretable.

downstreamResult

The invoking party's at-record-time assessment of the outcome:

SlugMeaning
successThe output was accepted unchanged.
correctedThe output was edited; a dev.idiolect.correction record exists or is expected.
rejectedThe output was unusable.
unknownThe party publishing did not know yet.

corrected is the link between the emergent-channel encounter record and the correction record that documents the edit. Consumers reading correction records traverse back through the encounter's downstreamResult to confirm the link.

holder and basis

Most encounters are first-party: the repo owner is the party that invoked the lens. Some are third-party: a labeler records that another party invoked a lens. holder names the party the record is attributed to; basis carries structured grounds for the attribution (a community policy, an external signal, an inference from another record). See defs#basis for the variants.

visibility

The five values are policy hints, not access control. The substrate does not enforce them today. Records marked community-scoped should not be served to parties outside the named community once the substrate supports scope enforcement; records marked private should not be published at all.

Example

{
  "$type": "dev.idiolect.encounter",
  "lens":         { "uri": "at://did:plc:lens-author/dev.panproto.schema.lens/3l5" },
  "sourceSchema": { "uri": "at://did:plc:schema-author/dev.panproto.schema.schema/v1" },
  "targetSchema": { "uri": "at://did:plc:schema-author/dev.panproto.schema.schema/v2" },
  "use": {
    "action":   "train_model",
    "material": { "scope": "production_logs" },
    "purpose":  "non_commercial",
    "actor":    "researchers"
  },
  "downstreamResult": "success",
  "kind":             "invocation-log",
  "visibility":       "public-detailed",
  "occurredAt":       "2026-04-19T12:30:00.000Z"
}

How encounters are consumed

flowchart LR
    PUB[publisher] -->|writes| ENC[encounter]
    ENC -->|firehose| OBS[observer]
    OBS -->|tally| OBSREC[observation]
    ENC -.referenced by.-> COR[correction]
    ENC -.referenced by.-> RET[retrospection]
    OBSREC -.cited by.-> BEL[belief]

An encounter is the unit; observations and corrections reference it. A dev.idiolect.belief may cite either the encounter directly (for narrow claims) or an observation that aggregated it (for broad claims). A dev.idiolect.retrospection references an encounter to record a delayed finding about it.

Cross-references