Examples

Three programmes, one language

The examples contrast observations against a reference record, successive checkpoints across participants, and structured places and their contents over time. Each is a coherent intended programme in the design preview, not a statement of what is implemented today, and nothing runs in the browser.

Reference comparison

Does the observed object agree with its catalogue record?

Catalogue verification · Per-instruction specialization, bounded retrieval, independent media scrutiny and a finite claim.

Claim

Finite maker/model catalogue-record agreement, with variant facets undetermined. Not authenticity, condition, unique SKU or individual-object identity.

Participants

  • Capturer: observes the object, acquires clues, searches and dispatches one sealed bundle.
  • Verifier: opens the bundle, searches independently and inspects the retained media, at most seven times.

Retained state

  • The sealed evidence bundle: observation, clues, candidates and the selected knowledge reference.
  • Search results are candidates, not proof.

Possible outcomes

  • Maker/model agreement within the finite scope
  • Insufficient evidence
  • Ambiguous
  • Rejected or a named technical stop

See how it runs →

Programme

evicatalogue-verification.evi (website excerpt)
# Evidome language — design preview.
program CatalogueVerification

let bounds = { catalogueRequests = 4, candidates = 2, searches = 1 }
let scope = {
    required = [ Maker, Model ],
    excludes = [ Authenticity, Condition, UniqueSku, IndividualObjectIdentity ]
}

searchCatalogue clues selectedKnowledge = flow
    issued <- catalogue.search @typeof(clues) clues with
        context = selectedKnowledge,
        requestLimit = bounds.catalogueRequests,
        candidateLimit = bounds.candidates,
        searchLimit = bounds.searches
    classifySearch issued

role Capturer (subject, mediaSource, verifier, preparedKnowledge) = flow
    capture <- captureEvidence subject mediaSource
    match capture with
    | CaptureReady observed clues ->
        search <- searchCatalogue clues preparedKnowledge
        match search with
        | SearchCandidates candidates ->
            let bundle = makeEvidenceBundle
                subject observed clues candidates preparedKnowledge.reference
            result <- verification.request verifier bundle with
                verifierEntry = Verifier,
                dispatchLimit = 1
            finishCapture result
        | SearchInsufficient reason -> conclude InsufficientEvidence reason
        | SearchAmbiguous details -> conclude Ambiguous details
        | SearchTechnical terminal -> stop terminal
    | CaptureStopped terminal -> stop terminal

role Verifier (bundleReference, preparedKnowledge) = flow
    opened <- evidence.open bundleReference with ingestLimit = 1
    match opened with
    | Admitted captured ->
        resolved <- knowledge.resolve captured.selectedKnowledge with
            expected = preparedKnowledge.reference
        match resolved with
        | Resolved selected ->
            search <- searchCatalogue captured.identifyingEvidence selected
            match search with
            | SearchCandidates candidates ->
                issued <- media.inspect
                    @typeof({ media = captured.media, candidates = candidates })
                    captured.media candidates with
                    context = selected,
                    inspectionLimit = 7
                match issued with
                | Issued report ->
                    match assessInspection report candidates
                        captured.media.reference selected.catalogueAgreementPolicy with
                    | InspectionSupported agreement -> conclude Match {
                        record = agreement.record, scope = scope
                      }
                    | InspectionInsufficient details -> conclude InsufficientEvidence details
                    | InspectionAmbiguous details -> conclude Ambiguous details
                | InspectionTechnical terminal -> stop terminal
            | SearchInsufficient reason -> conclude InsufficientEvidence reason
            | SearchAmbiguous details -> conclude Ambiguous details
            | SearchTechnical terminal -> stop terminal
        | KnowledgeNotReady terminal -> stop terminal
        | KnowledgeTechnical terminal -> stop terminal
    | IngestTechnical terminal -> stop terminal
Full reference: catalogue-verification.evi
evicatalogue-verification.eviDownload
# Evidome language — design preview.
# Website excerpt; complete helper/outcome mappings follow in the appendix.

program CatalogueVerification

let catalogueBounds = { requestLimit = 4, candidateLimit = 2, searchLimit = 1 }
let claimScope = {
    purpose = CatalogueRecordAttributeAgreement,
    requiredAttributes = [ Maker, Model ],
    variantFacets = Undetermined,
    excludes = [ Authenticity, Condition, UniqueSku, IndividualObjectIdentity ]
}

# Shared effectful search; @typeof selects the validated prepared specialization.
searchCatalogue clues selectedKnowledge = flow
    issued <- catalogue.search @typeof(clues) clues with
        context = selectedKnowledge,
        requestLimit = catalogueBounds.requestLimit,
        candidateLimit = catalogueBounds.candidateLimit,
        searchLimit = catalogueBounds.searchLimit
    classifySearch issued

role Capturer (subject, mediaSource, verifier, preparedKnowledge) = flow
    capture <- captureEvidence subject mediaSource
    match capture with
    | CaptureReady observed clues ->
        search <- searchCatalogue clues preparedKnowledge
        match search with
        | SearchCandidates candidates ->
            # Pure construction: this does not store, seal, send, or authorize.
            let bundle = makeEvidenceBundle subject observed clues candidates
                preparedKnowledge.reference
            # Explicit dispatch seals and sends the complete media-backed bundle.
            result <- verification.request verifier bundle with
                verifierEntry = Verifier,
                dispatchLimit = 1
            finishCapture result
        | SearchInsufficient reason -> conclude InsufficientEvidence reason
        | SearchAmbiguous details -> conclude Ambiguous details
        | SearchTechnical terminal -> stop terminal
    | CaptureStopped terminal -> stop terminal

role Verifier (bundleReference, preparedKnowledge) = flow
    opened <- evidence.open bundleReference with ingestLimit = 1
    match opened with
    | Admitted captured ->
        resolved <- knowledge.resolve captured.selectedKnowledge with
            expected = preparedKnowledge.reference
        match resolved with
        | Resolved selectedKnowledge ->
            # Independent search over retained evidence; no spatial recapture.
            search <- searchCatalogue captured.identifyingEvidence selectedKnowledge
            match search with
            | SearchCandidates candidates ->
                report <- media.inspect @typeof({
                    media = captured.media, candidates = candidates
                }) captured.media candidates with
                    context = selectedKnowledge,
                    inspectionLimit = 7,
                    verificationLimit = 1

                match report with
                | Issued issuedReport ->
                    # Pure assessment checks provenance and required readings;
                    # this role then declares the typed disposition.
                    let decision = assessInspection issuedReport candidates
                        captured.media.reference
                        selectedKnowledge.catalogueAgreementPolicy
                    match decision with
                    | InspectionSupported agreement -> conclude Match {
                        record = agreement.record, scope = claimScope
                      }
                    | InspectionInsufficient details -> conclude InsufficientEvidence details
                    | InspectionAmbiguous details -> conclude Ambiguous details
                | InspectionTechnical terminal -> stop terminal
            | SearchInsufficient reason -> conclude InsufficientEvidence reason
            | SearchAmbiguous details -> conclude Ambiguous details
            | SearchTechnical terminal -> stop terminal
        | KnowledgeNotReady terminal -> stop terminal
        | KnowledgeTechnical terminal -> stop terminal
    | IngestTechnical terminal -> stop terminal


# Reference appendix — expanded helper bodies and closed outcome mappings

# Normal edition: partial observation is refused before acquisition/search.
captureEvidence subject mediaSource = flow
    observation <- media.observe @typeof(subject) mediaSource with
        objectives = [
            FrontMiddle, LeftMiddle, RightMiddle,
            HeadstockFront, HeadstockBack, LabelArea
        ],
        attemptLimit = 1

    match observation with
    | Completed observed ->
        acquisition <- media.acquireIdentifyingEvidence
            @typeof(observed) observed with
            objective = IdentifyingEvidence,
            advisoryRole = DiscriminatingAttributes,
            attemptLimit = 1
        match acquisition with
        | Completed clues -> CaptureReady observed clues
        | NeedsMore details -> CaptureStopped (AcquisitionIncomplete details)
        | Unable reason -> CaptureStopped (AcquisitionUnable reason)
        | Refused reason -> CaptureStopped (AcquisitionRefused reason)
        | Exhausted reason -> CaptureStopped (AcquisitionExhausted reason)
        | Interrupted reason -> CaptureStopped (AcquisitionInterrupted reason)
        | Failed reason -> CaptureStopped (AcquisitionFailed reason)
        | Unavailable reason -> CaptureStopped (AcquisitionUnavailable reason)
    | Partial issuedAssessment ->
        CaptureStopped (PartialObservationNotAdmitted issuedAssessment)
    | Unable reason -> CaptureStopped (ObservationUnable reason)
    | Refused reason -> CaptureStopped (ObservationRefused reason)
    | Exhausted reason -> CaptureStopped (ObservationExhausted reason)
    | ContinuityLost reason -> CaptureStopped (ObservationContinuityLost reason)
    | Interrupted reason -> CaptureStopped (ObservationInterrupted reason)
    | Failed reason -> CaptureStopped (ObservationFailed reason)
    | Unavailable reason -> CaptureStopped (ObservationUnavailable reason)

# Pure search classification. Technical categories retain their identity and
# payload. Interrupted and cancelled share the authored interruption terminal,
# while the origin remains explicit.
classifySearch issued =
    match issued with
    | Found candidates -> SearchCandidates candidates
    | NoMatches -> SearchInsufficient NoCatalogueRecord
    | NoAvailableRecords reason -> SearchInsufficient reason
    | OverCandidateLimit count -> SearchAmbiguous count
    | Refused reason -> SearchTechnical (SearchRefused reason)
    | Unavailable reason -> SearchTechnical (SearchUnavailable reason)
    | Interrupted reason ->
        SearchTechnical (SearchInterrupted { origin = Interrupted, reason = reason })
    | Cancelled reason ->
        SearchTechnical (SearchInterrupted { origin = Cancelled, reason = reason })
    | Exhausted reason -> SearchTechnical (SearchExhausted reason)
    | Failed reason -> SearchTechnical (SearchFailed reason)

# Pure construction preserves the actual retained media and selected knowledge.
makeEvidenceBundle subject observed clues candidates knowledgeReference =
    evidenceBundle {
        subject = subject,
        media = observed.media,
        observation = observed,
        identifyingEvidence = clues,
        catalogueCandidates = candidates,
        selectedKnowledge = knowledgeReference,
        claimScope = claimScope
    }

# Pure authored predicate for one required reading. A Supported tag is only an
# input: the reading must belong to this evidence and selected record, then the
# validated prepared policy must compare it with that record's authored value.
assessReading report record attribute expectedEvidence policy =
    match report.readings.lookup attribute with
    | Missing ->
        ReadingMissing attribute
    | Found reading ->
        let association = {
            attribute = reading.attribute == attribute,
            record = reading.record == record.reference,
            evidence = reading.evidence == expectedEvidence
        }

        match association with
        | { attribute = true, record = true, evidence = true } ->
            match reading.status with
            | Supported issuedValue provenance ->
                let referenceValue = record.attributes.lookup attribute
                match policy.compareReading attribute issuedValue referenceValue with
                | Agrees proof -> ReadingAgrees {
                    issuedValue, referenceValue, provenance, proof
                  }
                | Contradicts proof -> ReadingContradicted proof
                | Unknown details -> ReadingUnknown details
                | OutsideAdmittedMethod details -> ReadingOutsideBounds details
            | Contradicted details -> ReadingContradicted details
            | Unknown details -> ReadingUnknown details
            | OutsideAuthoredBounds details -> ReadingOutsideBounds details
        | { attribute = false, record = _, evidence = _ } ->
            ReadingOutsideBounds WrongReadingAttribute
        | { attribute = true, record = false, evidence = _ } ->
            ReadingOutsideBounds ReadingRecordAssociationMismatch
        | { attribute = true, record = true, evidence = false } ->
            ReadingOutsideBounds ReadingEvidenceAssociationMismatch

# Pure and exhaustive combination of the two required readings.
assessRequiredReadings report record expectedEvidence policy =
    let maker = assessReading report record Maker expectedEvidence policy
    let model = assessReading report record Model expectedEvidence policy

    match maker with
    | ReadingContradicted details -> InspectionInsufficient details
    | ReadingOutsideBounds details -> InspectionAmbiguous details
    | ReadingUnknown details -> InspectionInsufficient details
    | ReadingMissing details -> InspectionInsufficient details
    | ReadingAgrees makerReading ->
        match model with
        | ReadingContradicted details -> InspectionInsufficient details
        | ReadingOutsideBounds details -> InspectionAmbiguous details
        | ReadingUnknown details -> InspectionInsufficient details
        | ReadingMissing details -> InspectionInsufficient details
        | ReadingAgrees modelReading ->
            InspectionSupported {
                record = record,
                maker = makerReading,
                model = modelReading
            }

# Pure report assessment. The issued bounded-candidate disposition must first
# prove that exactly one candidate remains under the validated authored policy.
# A supporting report for one member of an unresolved two-candidate set cannot
# become Match.
assessInspection report candidates expectedEvidence policy =
    match report.candidateDisposition with
    | ResolvedOne selectedCandidate eliminatedAlternatives ->
        let disposition = {
            selectedInBound = candidates.contains selectedCandidate,
            selectedByReport = report.candidate == selectedCandidate,
            recordAssociated = report.record == selectedCandidate.record,
            evidenceAssociated = report.inspectedEvidence == expectedEvidence,
            policyBound = report.dispositionPolicy == policy.reference,
            alternativesCovered = eliminatedAlternatives.candidates
                == candidates.without selectedCandidate,
            alternativesResolved = eliminatedAlternatives.allResolved
        }

        match disposition with
        | {
            selectedInBound = true,
            selectedByReport = true,
            recordAssociated = true,
            evidenceAssociated = true,
            policyBound = true,
            alternativesCovered = true,
            alternativesResolved = true
          } ->
            match report.requiredAttributes with
            | Exactly [ Maker, Model ] ->
                assessRequiredReadings
                    report report.record expectedEvidence policy
            | Missing attributes ->
                InspectionInsufficient { missingRequiredAttributes = attributes }
            | Additional attributes ->
                InspectionAmbiguous { outsideAuthoredAttributes = attributes }
            | Different attributes ->
                InspectionInsufficient { wrongRequiredAttributes = attributes }
            | Empty ->
                InspectionInsufficient {
                    missingRequiredAttributes = [ Maker, Model ]
                }
        | other ->
            InspectionAmbiguous { invalidResolvedDisposition = other }
    | UnresolvedAlternatives alternatives ->
        InspectionAmbiguous { unresolvedCandidates = alternatives }
    | OutsideAuthoredBounds details ->
        InspectionAmbiguous details
    | NoCandidate ->
        InspectionInsufficient NoCatalogueRecord

# Typed verification-request endings. Cancellation and interruption deliberately
# share VerificationInterrupted, matching the current authored stop mapping.
finishCapture result =
    match result with
    | SupportedScoped {
        purpose = CatalogueRecordAttributeAgreement,
        requiredAttributes = [ Maker, Model ],
        variantFacets = Undetermined
      } -> conclude MakerModelLineAgreement claimScope
    | SupportedScoped otherScope -> stop (UnsupportedVerificationScope otherScope)
    | Insufficient details -> stop (VerificationInsufficient details)
    | Rejected details -> stop (VerificationRejected details)
    | Refused reason -> stop (RequestRefused reason)
    | Unavailable reason -> stop (TechnicalUnavailable reason)
    | Interrupted reason -> stop (VerificationInterrupted reason)
    | Cancelled reason -> stop (VerificationInterrupted reason)
    | Exhausted reason -> stop (VerificationRequestExhausted reason)
    | Failed reason -> stop (TechnicalFailure reason)

# DEV partial-completion delta only. Replace the normal Partial branch above.
# The full issued assessment is retained; acquisition finishes before search.
# The mutually exclusive partial path then follows the same search, pure bundle
# construction, and one-dispatch sequence shown in Capturer.
#
# | Partial issuedAssessment ->
#     acquisition <- media.acquireIdentifyingEvidence
#         @typeof(issuedAssessment) issuedAssessment with
#         objective = IdentifyingEvidence,
#         advisoryRole = DiscriminatingAttributes,
#         attemptLimit = 1
#     match acquisition with
#     | Completed clues -> CaptureReady issuedAssessment clues
#     | NeedsMore details -> CaptureStopped (AcquisitionIncomplete details)
#     | Unable reason -> CaptureStopped (AcquisitionUnable reason)
#     | Refused reason -> CaptureStopped (AcquisitionRefused reason)
#     | Exhausted reason -> CaptureStopped (AcquisitionExhausted reason)
#     | Interrupted reason -> CaptureStopped (AcquisitionInterrupted reason)
#     | Failed reason -> CaptureStopped (AcquisitionFailed reason)
#     | Unavailable reason -> CaptureStopped (AcquisitionUnavailable reason)

Download the lowering excerpt pack

Checkpoint comparison

What changed between checkpoints?

Incremental logistics handover · Cross-run state, incremental execution and several participants who need not know each other in advance.

Claim

Whether the item, packaging, seal and visible counts are consistent with the earlier checkpoint, as far as they are visible now. A courier who sees a sealed package cannot attest its unseen contents, and an observed difference does not say who caused it.

Participants

  • Seller: creates the dispatch baseline.
  • Carrier and later buyer: each adds a fresh inspection. Later participants need not be known when the first run happens.
  • Verifier: independently checks each comparison.

Retained state

  • A checkpoint chain: each checkpoint references the earlier attestation and preserves the history.
  • Access is owner-authorized per checkpoint. Receiving evidence does not confer the authority to grant it onward.

Possible outcomes

  • Consistent with earlier observations
  • Difference observed
  • Identity uncertain
  • Insufficient comparable evidence

See how it runs →

Programme

evihandover (draft)
# Evidome language: design preview (draft example).
program HandoverCheckpoint

let bounds = { resolves = 1, observations = 1, comparisons = 1, dispatches = 1 }
let scope = {
    compares = [ Item, Packaging, Seal, VisibleCount ],
    excludes = [ UnseenContents, Cause, Responsibility ]
}

# The seller's dispatch run creates the baseline; a carrier or buyer runs this role later.
role Checkpoint (subject, mediaSource, earlier, access, verifier) = flow
    prior <- checkpoint.resolve earlier with
        access = access,                     # owner-authorized; receiving grants no onward access
        resolveLimit = bounds.resolves
    match prior with
    | Resolved baseline ->
        observation <- media.observe @typeof(subject) mediaSource with
            objectives = baseline.comparableObjectives,
            attemptLimit = bounds.observations
        match observation with
        | Completed current ->
            compared <- evidence.compareObservations
                @typeof({ earlier = baseline, current = current })
                baseline current with
                comparisonLimit = bounds.comparisons
            match compared with
            | Compared delta ->
                finding <- verification.request verifier
                    (checkpointBundle baseline current delta) with
                    dispatchLimit = bounds.dispatches
                appendAndConclude baseline finding
            | NotComparable details -> conclude InsufficientComparableEvidence details
            | ComparisonTechnical terminal -> stop terminal
        | Partial current -> conclude InsufficientComparableEvidence current.coverage
        | ObservationStopped terminal -> stop terminal
    | AccessRefused reason -> stop reason

# appendAndConclude appends the new checkpoint to the chain, keeping the history,
# then concludes the finding the verifier returned:
#   ConsistentWithEarlier | DifferenceObserved | IdentityUncertain | InsufficientComparableEvidence

Draft example for review. Checkpoint and comparison operations are named explicitly; the catalogue-specific inspection is not implied to perform them.

Structured place and inventory comparison

What is here, where is it, and how does it compare?

Apartment inspection · Hierarchical evidence, location-aware observation, quantities and cross-run comparison. Catalogue lookup is optional, used only where the programme needs it.

Claim

Per-item comparison of matched locations against the check-in baseline. No automatic responsibility or deposit-deduction verdict.

Participants

  • Check-in inspection: establishes the baseline.
  • Checkout or a later inspection: references the baseline and captures fresh evidence.

Retained state

  • An evidence graph: apartment → room → furniture or item → surface or feature.
  • Observations and defects with object-map locations, relevant inventory quantities and their source media.
  • Missing earlier coverage is never read as proof that a defect is new, and occlusion is never read as absence.

Possible outcomes

  • Supported consistency (per item)
  • Difference observed (per item)
  • Insufficient coverage
  • Uncertain correspondence

Example scoped finding

Living room → sofa → left arm: a mark is visible at checkout; earlier coverage is insufficient to establish whether it was already present.

See how it runs →

Programme

eviapartment (draft)
# Evidome language: design preview (draft example).
program ApartmentInspection

let bounds = { resolves = 1, walkThroughs = 1, targeted = 1, comparisons = 1 }
let structure = [ Apartment, Room, Item, Surface ]
let scope = { excludes = [ Responsibility, DepositDeduction ] }

# Check-in establishes the baseline; checkout (or a later inspection) runs this role.
role Inspection (apartment, mediaSource, checkIn, access) = flow
    baseline <- checkpoint.resolve checkIn with
        access = access,
        resolveLimit = bounds.resolves
    match baseline with
    | Resolved earlier ->
        walk <- media.observe @typeof(apartment) mediaSource with
            objectives = earlier.mappedLocations,   # room -> item -> surface
            attemptLimit = bounds.walkThroughs
        match walk with
        | Completed current ->
            detail <- media.observe @typeof(earlier.uncertain) mediaSource with
                objectives = earlier.disputedDetails,   # fresh evidence, not a replay
                attemptLimit = bounds.targeted
            compared <- evidence.compareObservations
                @typeof({ earlier = earlier, current = current.with detail })
                earlier current with
                coverage = Required,                 # occlusion is not absence
                quantities = Counted,
                comparisonLimit = bounds.comparisons
            match compared with
            | Compared report ->
                appended <- checkpoint.append earlier report with appendLimit = 1
                conclude PerItemFindings report.items
            | NotComparable details -> conclude InsufficientCoverage details
            | ComparisonTechnical terminal -> stop terminal
        | Partial current -> conclude InsufficientCoverage current.coverage
        | ObservationStopped terminal -> stop terminal
    | AccessRefused reason -> stop reason

# Each item finding is one of:
#   SupportedConsistency | DifferenceObserved | InsufficientCoverage | UncertainCorrespondence

Draft example for review. Checkpoint and comparison operations are named explicitly; the catalogue-specific inspection is not implied to perform them.