AppSurface Search
API Reference

Aspire

Type

EvidenceHostOptions

Source

Configures an explicit EvidenceHost lifecycle.

Parameters

  • RequireTrustedEnvelopeWhether every run requires an accepted envelope verifier result.
  • ArtifactDirectoryControlled root for producer artifacts. Defaults to TestResults/evidence/artifacts.
Type

EvidenceEnvelopeResult

Source

Describes a secret-safe execution-envelope validation result.

Parameters

  • AcceptedWhether the envelope is accepted for the requested claim scope.
  • AttestedWhether the verifier has independent attestation; v1 normally returns false.
  • DiagnosticSecret-safe failure or explanatory detail.
Type

IEvidenceExecutionEnvelopeVerifier

Source

Validates a CI-provided trusted execution envelope without exposing its secret values to a manifest.

Method

VerifyAsync

ValueTask<EvidenceEnvelopeResult> VerifyAsync(EvidencePlan plan, CancellationToken cancellationToken) Source

Validates the caller's protected CI context for the resolved plan.

Parameters

  • planResolved plan for the current execution.
  • cancellationTokenCancellation requested by the caller.

Returns

A constrained acceptance result.

Type

IEvidenceResourceReadiness

Source

Represents an explicitly registered readiness probe for a plan resource.

Method

WaitUntilReadyAsync

Task WaitUntilReadyAsync(CancellationToken cancellationToken) Source

Waits until the consumer-owned resource is ready or the supplied deadline cancels.

Parameters

  • cancellationTokenDeadline and caller cancellation.

Returns

A task that completes only when the resource is ready.

Property

Id

string Id { get; } Source

Gets the stable plan resource identifier handled by this probe.

Type

EvidenceHostRegistration

Source

Collects the only resource, producer, and envelope registrations an EvidenceHost may use.

Method

AddResource

void AddResource(IEvidenceResourceReadiness resource) Source

Adds one explicitly named readiness probe.

Parameters

  • resourceConsumer-owned resource readiness probe.
Method

AddProducer

void AddProducer(IEvidenceProducer producer) Source

Adds one explicitly named typed producer.

Parameters

  • producerConsumer-owned producer.
Method

SetEnvelopeVerifier

void SetEnvelopeVerifier(IEvidenceExecutionEnvelopeVerifier verifier) Source

Sets the single trusted execution-envelope verifier used by this host.

Parameters

  • verifierBase-owned verifier implementation.
Property

Resources

IReadOnlyDictionary<string, IEvidenceResourceReadiness> Resources { get; } Source

Gets explicitly registered resource readiness probes.

Property

Producers

IReadOnlyDictionary<string, IEvidenceProducer> Producers { get; } Source

Gets explicitly registered typed producers.

Property

EnvelopeVerifier

IEvidenceExecutionEnvelopeVerifier? EnvelopeVerifier { get; set; } Source

Gets the optional trusted execution-envelope verifier.

Type

EvidenceHostBootstrap

Source

Runs a separate, consumer-owned EvidenceHost with explicit registrations and bounded cleanup.

Method

Create

EvidenceHostBootstrap Create(EvidencePlan plan, Action<EvidenceHostRegistration> configure, EvidenceHostOptions? options = null, TimeProvider? timeProvider = null) Source

Creates a host with registrations supplied only by explicit caller code.

Parameters

  • planResolved immutable plan.
  • configureConsumer-owned registration callback.
  • optionsOptional lifecycle constraints.
  • timeProviderClock seam for deterministic tests and deadline handling.

Returns

A single-use EvidenceHost instance.

Method

RunAsync

Task<EvidenceManifest> RunAsync(bool observationOnly = false, CancellationToken cancellationToken = default) Source

Validates envelope and registrations, waits for resources, runs selected producers, and collects a manifest.

Parameters

  • observationOnlyWhether the caller intentionally requests a non-gate observation.
  • cancellationTokenCaller cancellation for the complete bounded lifecycle.

Returns

A terminal immutable manifest.

Method

DisposeAsync

ValueTask DisposeAsync() Source

Disposes registered resources and producers if the host has not already cleaned them up.

Returns

A task that completes when owned cleanup settles.

Property

Plan

EvidencePlan Plan { get; } Source

Gets the immutable plan owned by this host instance.

Property

State

EvidenceHostState State { get; set; } Source

Gets the current one-way EvidenceHost lifecycle state.

Type

EvidenceHostException

Source

Represents a stable, user-facing EvidenceHost lifecycle failure.

Property

Code

string Code { get; } Source

Gets the stable diagnostic code.

Property

Fix

string Fix { get; } Source

Gets the concrete recovery action.

Enum

EvidenceHostState

Source

Describes the lifecycle state of an explicit consumer-owned EvidenceHost instance.

Type

EvidenceAspireApplication

Source

Owns one consumer-composed Aspire application used only by an EvidenceHost run.

Remarks

Build the supplied IDistributedApplicationBuilder in test or CI composition code, then register readiness adapters from this lease with EvidenceHostBootstrap. This type does not inspect the entry assembly and must not be added to normal application startup.

Method

StartAsync

Task<EvidenceAspireApplication> StartAsync(IDistributedApplicationBuilder builder, CancellationToken cancellationToken = default) Source

Builds and starts an explicitly supplied consumer Aspire application.

Parameters

  • builderConsumer-composed Aspire builder.
  • cancellationTokenCancellation requested while building or starting the application.

Returns

An evidence-owned application lease that stops and disposes the application.

Method

CreateHealthReadiness

IEvidenceResourceReadiness CreateHealthReadiness(string evidenceResourceId, string aspireResourceName) Source

Creates a readiness adapter that waits for the named Aspire resource's healthy state.

Parameters

  • evidenceResourceIdDeclared EvidenceHost resource identifier.
  • aspireResourceNameConsumer-owned Aspire resource name.

Returns

An explicitly registered health readiness adapter.

Method

DisposeAsync

ValueTask DisposeAsync() Source

Stops and disposes the owned Aspire application. Repeated calls are safe.

Returns

A task that completes after bounded application cleanup.