AppSurface Search
API Reference

Cli

Type

EvidenceCliWorkflow

Source

Coordinates deterministic EvidenceHost CLI file operations for the AppSurface command assembly.

Method

InitializeAsync

Task<EvidenceInitializationResult> InitializeAsync(string rootPath, bool force, CancellationToken cancellationToken) Source

Writes the marked v1 starter files beneath rootPath.

Remarks

Existing unmarked files are never overwritten and fail with ASEVD201; existing marked files require force and otherwise fail with ASEVD202.

Method

DoctorAsync

Task<EvidenceDoctorReport> DoctorAsync(EvidencePlanningRequest request, CancellationToken cancellationToken) Source

Resolves an evidence plan and reports prerequisite readiness without provisioning resources or running producers.

Method

ExplainAsync

Task<EvidencePlan> ExplainAsync(EvidencePlanningRequest request, CancellationToken cancellationToken) Source

Resolves the checked-in policy and explicit changed paths into a deterministic evidence plan.

Remarks

Missing, malformed, or empty CLI inputs produce the stable ASEVD204 through ASEVD207 diagnostics. A hunked diff without Git file headers is rejected with ASEVD128 rather than planning from incomplete paths.

Method

ResolveAsync

Task<EvidencePlanningResolution> ResolveAsync(EvidencePlanningRequest request, CancellationToken cancellationToken) Source

Resolves an Evidence plan and retains the bounded diff snapshot used for planning.

Remarks

Only evidence run retains the snapshot through producer execution. Explain and doctor resolve the same inputs through this method but discard it after planning because they never evaluate a patch gate.

Method

WritePlanAsync

Task WritePlanAsync(EvidencePlan plan, string outputDirectory, CancellationToken cancellationToken) Source

Writes the canonical plan and its human-readable summary to outputDirectory.

Remarks

Replaces evidence-plan.json and evidence-summary.json when they already exist.

Method

WriteManifestAsync

Task WriteManifestAsync(EvidenceManifest manifest, string outputDirectory, CancellationToken cancellationToken) Source

Writes the canonical manifest and its human-readable summary to outputDirectory.

Remarks

Replaces evidence-manifest.json and evidence-summary.json when they already exist.

Method

VerifyAsync

Task<(EvidencePlan Plan, EvidenceManifest Manifest)> VerifyAsync(string planPath, string manifestPath, CancellationToken cancellationToken) Source

Verifies that a manifest is canonical and is bound to the supplied plan without rerunning producers.

Remarks

Missing files produce ASEVD208, malformed canonical JSON produces ASEVD209, and a missing, unresolvable, or non-binding policy snapshot produces ASEVD203.

Method

FormatSummary

2 overloads
string FormatSummary(EvidencePlan plan) Source

Formats a deterministic, human-readable summary of a resolved plan.

string FormatSummary(EvidenceManifest manifest) Source

Formats a deterministic, human-readable summary of an evidence claim and any remaining obligations.

Type

EvidencePlanningRequest

Source

Describes a policy and explicit changed-path input for an EvidenceHost planning operation.

Type

EvidencePlanningResolution

Source

Binds a resolved plan to the immutable diff bytes used to derive its changed paths.

Remarks

Keep this pair together from planning through coverage execution. Reopening the source path can observe a replaced diff and break the plan-to-gate integrity boundary; consumers must reuse DiffSnapshot when present.

Property

Plan

EvidencePlan Plan { get; } Source

Gets the nonnull plan resolved from the exact input set represented by this instance.

Property

DiffSnapshot

EvidenceDiffSnapshot? DiffSnapshot { get; } Source

Gets the optional immutable diff snapshot from which the plan's diff-derived paths were read.

Remarks

Pass this same value to the coverage producer for patch gates. Do not reopen a source path to obtain a newer diff, because that would no longer be the diff on which Plan was evaluated.

Type

EvidenceDiffSnapshot

Source

Holds the bounded unified diff input consumed by an Evidence planning operation.

Remarks

The snapshot owns a defensive copy of the bytes supplied at construction. It is bounded by the planning reader to 20 MiB, and consumers must reuse Bytes for planning-adjacent work such as patch coverage instead of reopening the source path. This preserves the SHA-256-integrity boundary when the original file is replaced later.

Property

Bytes

ReadOnlyMemory<byte> Bytes { get; } Source

Gets a read-only view of the exact bytes defensively copied at construction.

Remarks

This view avoids another copy for internal consumers, but it exposes no writable access. Reuse it for patch coverage and related planning work; reopening the original file can violate the plan-to-gate integrity rule.

Property

Label

string Label { get; } Source

Gets the nonempty safe source label used in coverage artifacts and diagnostics.

Property

Sha256

string Sha256 { get; } Source

Gets the nonempty 64-character hexadecimal SHA-256 digest of Bytes at capture time.

Property

Text

string Text { get; } Source

Gets the UTF-8 decoding of Bytes used by the planner and coverage core.

Remarks

This value is derived only from the captured bytes. It must not be replaced with a fresh read of the original diff path after planning.

Type

IEvidenceDiffFileAccess

Source

Opens explicit unified diff files for Evidence planning.

Remarks

This narrow internal boundary keeps the production reader file-backed while allowing tests to prove that the bounded stream reader evaluates the bytes available when a path is actually opened, not stale file metadata.

Method

OpenRead

Stream OpenRead(string path) Source

Opens path for sequential read access.

Parameters

  • pathThe explicit path supplied through --diff-file.

Returns

A readable stream owned and disposed by the Evidence workflow.

Type

PhysicalEvidenceDiffFileAccess

Source

Opens Evidence diff files through the local physical file system.

Type

EvidenceInitializationResult

Source

Describes starter files created by an EvidenceHost initialization operation.

Type

EvidenceDoctorCheck

Source

Describes one environment or capability prerequisite observed by the evidence doctor.

Type

EvidenceDoctorReport

Source

Describes the plan and prerequisite checks produced by the evidence doctor.

Type

EvidenceCliException

Source

Represents a stable, user-actionable EvidenceHost CLI failure.

Property

Code

string Code { get; } Source

Gets the stable EvidenceHost diagnostic code.

Property

Fix

string Fix { get; } Source

Gets the recommended recovery action.

Type

CoverageEvidenceProducer

Source

Runs the private AppSurface coverage engine for the first-party Evidence workflow.

Remarks

This adapter owns Evidence-to-coverage translation and stable claim outcomes. The core owns the required collection-then-gate ordering, so this code neither recreates coverage execution nor invokes a second appsurface process.

Method

RunAsync

Task<EvidenceProducerResult> RunAsync(EvidenceProducerDeclaration producer, string? solutionPath, string outputDirectory, EvidenceDiffSnapshot? diffSnapshot, CoverageTextWriters writers, CancellationToken cancellationToken) Source

Runs one declared coverage producer through the private coverage core and returns its stable evidence outcome.

Parameters

  • producerThe explicit coverage declaration to execute. It must include coverage-gate requirements; unsupported kinds, missing gates, and patch gates without a captured diff return stable unavailable or invalid outcomes without starting the core.
  • solutionPathThe nonempty solution path used for AppSurface coverage discovery. The producer does not infer this value, so a missing path returns an unavailable outcome rather than selecting a solution implicitly.
  • outputDirectoryThe nonempty Evidence output directory. The producer creates and cleans its coverage child directory for the fixed Debug, serial, input-order collector run and its merged gate report.
  • diffSnapshotThe optional bounded immutable diff captured during planning. Patch gates require this snapshot; callers must pass the planning snapshot instead of reopening its source file.
  • writersThe nonnull ordered standard-output and standard-error writers owned by the caller for the shared core's diagnostics.
  • cancellationTokenThe caller cancellation token. Caller cancellation is propagated; only expiration of the producer's linked deadline yields EvidenceProducerOutcome.TimedOut.

Returns

A passed result only when collection and the declared gate both pass; a failed result for collection, gate, or nonfatal core failures (including independently thrown cancellation exceptions); or an unavailable or invalid result for declaration inputs that cannot safely start coverage.

Exceptions

  • OperationCanceledExceptionThe caller cancels cancellationToken.

Remarks

The private core owns collection-before-gate ordering. This adapter fixes the coverage run defaults to Debug, serial input-order execution, collector coverage, clean output, and the established AppSurface test exclusion; it does not expose a general-purpose coverage configuration surface to Evidence consumers.