AppSurface Search
API Reference

Cli

Type

CoverageConsoleAdapters

Source

Adapts the CliFx console to the private coverage-core writer boundary.

Remarks

Command handlers use the same writer pair directly. These overloads retain the intentional internal test seam for existing coverage workflow tests while ensuring the core itself has no dependency on CliFx.

Method

RunAsync

Task<CoverageRunResult> RunAsync(this CoverageRunWorkflow workflow, CoverageRunRequest request, IConsole console, CancellationToken cancellationToken)

Runs coverage using the output and error writers from a CliFx console.

Method

MergeAsync

Task<CoverageMergeResult> MergeAsync(this CoverageMergeWorkflow workflow, CoverageMergeRequest request, IConsole console, CancellationToken cancellationToken)

Merges coverage using the output and error writers from a CliFx console.

Type

DurableDoctorRequest

Source

Validated, printable doctor intent. Connection values remain private to the invocation.

Remarks

Names identify environment sources, not their values. Worker and threshold are paired. See the doctor command reference.

Type

DurableDoctorChecks

Source

Fixed categories accepted by the version-one observation and output contract.

Type

DurableDoctorObservation

Source

Bounded immutable observations captured on the single fenced database session.

Remarks

Null denotes a check not reached. Copies prevent mutable caller arrays entering classification.

Property

Schema

DurableRuntimeSchemaStatus? Schema { get; } Source

Returns a defensive copy of captured schema facts without the source status's free-form problem text.

Type

DurableDoctorHeartbeat

Source

Selected heartbeat facts only; a missing row is represented by Found=false and null row values.

Type

DurableDoctorFailureException

Source

Secret-free failure envelope. Only fixed categories may reach rendering.

Type

IDurableDoctorService

Source

Dedicated read-only operation; implementations do not register a Durable worker or mutate its store.

Method

InspectAsync

ValueTask<DurableDoctorObservation> InspectAsync(string connectionString, DurableDoctorRequest request, CancellationToken cancellationToken)

Inspects a validated request and returns only after checked owned resource release.

Parameters

  • connectionString
    Private ephemeral configuration, never included in observations or failures.
  • request
    Validated printable intent.
  • cancellationToken
    Original caller cancellation, distinct from the operation deadline.
Type

CoverageStorageCommandBase

Source

Shared execution and schema-v1 rendering for coverage storage commands.

Remarks

Commands are noninteractive and expose safe identifiers and bounded diagnostics only.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)

Executes the operation with explicit cancellation and emits one safe result.

Parameters

  • console
    CliFx output and error streams.
  • cancellationToken
    Cancellation observed by storage operations.
Method

WriteHumanResultAsync

ValueTask WriteHumanResultAsync(IConsole console, CoverageStorageResult envelope)

Renders trusted result fields and next actions without disclosing a fresh destination path.

Method

ExecuteOperationAsync

ValueTask<object?> ExecuteOperationAsync(CoverageArtifactStore store, CancellationToken token, Action<string> setEffects, Action<string> setStatus)

Performs the operation and returns data that contains no raw filesystem paths.

Method

ValidateInput

void ValidateInput()

Validates explicit command inputs before opening or initializing the store.

Method

PublishPartialDetails

void PublishPartialDetails(object details)

Publishes safe progress details so failures retain completed work in the result envelope.

Method

CreateStatusData

object CreateStatusData(CoverageArtifactStore store, Action<string> setStatus)

Creates a bounded status payload while keeping overflow measurements separate from exact totals.

Method

DomainId

string DomainId(Func<CoverageArtifactStore>? openStore = null)

Hashes the effective domain path so machine-local prefixes are never emitted.

Parameters

  • openStore
    Optional per-call observation seam; production opens the configured read-only store.

Remarks

Every nonfatal observation failure returns domain-unknown so envelope rendering preserves the primary diagnostic.

Property

Json

bool Json { get; set; } Source

Gets or sets whether the result is emitted as schema-versioned JSON.

Property

RequestsMutation

bool RequestsMutation { get; } Source

Gets whether an explicit operation authorizes private-store mutation.

Property

OpensConfiguredDomain

bool OpensConfiguredDomain { get; } Source

Gets whether execution requires the configured existing store. New-domain selection never opens the old domain.

Property

PartialFailureRecovery

string? PartialFailureRecovery { get; } Source

Gets operation-specific recovery when a failed or cancelled command has already produced side effects.

Property

InvalidInputGuidance

string InvalidInputGuidance { get; } Source

Gets a trusted field and accepted-form hint for a failed preflight, without echoing supplied values.

Type

CoverageStorageResult

Source

Stable schema-v1 response envelope used by every command in this family.

Type

CoverageStorageStatusCommand

Source

Shows registered coverage storage status; this is also the bare storage-group default.

Type

CoverageStorageNamedStatusCommand

Source

Shows the explicitly named coverage storage status.

Type

CoverageStorageInspectCommand

Source

Inspects a repository's coverage output with fixed time and entry bounds, without adopting files.

Property

Root

string? Root { get; set; } Source

Gets or sets the repository root to inspect; defaults to the current directory.

Type

CoverageStorageMaintainCommand

Source

Previews history expiry, applying it only when explicitly requested with --apply.

Property

Apply

bool Apply { get; set; } Source

Gets or sets whether eligible history should be deleted.

Type

CoverageStorageRestoreCommand

Source

Restores one verified archived run to a fresh output directory.

Property

Run

string Run { get; set; } Source

Gets or sets the opaque run identifier.

Property

Output

string Output { get; set; } Source

Gets or sets the fresh destination directory.

Type

CoverageStoragePinCommand

Source

Pins or unpins a verified archived run so normal history expiry respects operator intent.

Property

Run

string Run { get; set; } Source

Gets or sets the opaque run identifier.

Type

CoverageStorageUnpinCommand

Source

Removes the protection pin from a verified archived run.

Property

Run

string Run { get; set; } Source

Gets or sets the opaque run identifier.

Type

CoverageStorageNewDomainCommand

Source

Previews or explicitly creates a fresh private domain, preserving an unproven old domain in place.

Property

Output

string Output { get; set; } Source

Gets or sets the fresh absolute destination beneath an existing non-linked parent.

Property

Apply

bool Apply { get; set; } Source

Gets or sets whether the explicitly selected new domain should be created.

Type

CanaryPollCommand

Source

Polls one protected AppSurface named-canary endpoint until it produces a terminal deployment decision.

Remarks

This command is read-only. It evaluates application-owned evidence already exposed by the protected Web endpoint; it does not trigger a workflow, change traffic, perform a rollback, or replace health and readiness probes.

Property

Url

string? Url { get; set; } Source

Gets the absolute application base URL.

Property

Name

string? Name { get; set; } Source

Gets the registered named-canary name.

Property

MarkerEnvironmentVariable

string? MarkerEnvironmentVariable { get; set; } Source

Gets the environment variable containing the optional canary marker.

Property

FreshSince

string? FreshSince { get; set; } Source

Gets the optional proof freshness boundary.

Property

BearerTokenEnvironmentVariable

string? BearerTokenEnvironmentVariable { get; set; } Source

Gets the environment variable containing a bearer token.

Property

IdentityTokenEnvironmentVariable

string? IdentityTokenEnvironmentVariable { get; set; } Source

Gets the environment variable containing an already acquired identity token.

Property

HeaderEnvironmentVariables

string[] HeaderEnvironmentVariables { get; set; } Source

Gets repeatable custom header environment sources in HEADER=VARIABLE form.

Property

Timeout

string Timeout { get; set; } Source

Gets the total polling deadline.

Property

Interval

string Interval { get; set; } Source

Gets the interval between scheduled polls.

Property

MaxTransientFailures

int MaxTransientFailures { get; set; } Source

Gets the maximum consecutive recoverable transport failures.

Property

Json

bool Json { get; set; } Source

Gets whether to write exactly one machine-readable JSON terminal result.

Property

GithubSummary

bool GithubSummary { get; set; } Source

Gets whether to write a GitHub Actions step summary when available.

Property

NoGithubSummary

bool NoGithubSummary { get; set; } Source

Gets whether to suppress GitHub Actions step summary output.

Type

CanaryPollWorkflow

Source

Coordinates deterministic named-canary polling without hidden HTTP retries.

Method

RunAsync

Task<CanaryPollResult> RunAsync(CanaryPollRequest request, CancellationToken cancellationToken)

Runs the caller-owned named-canary polling state machine.

Type

ICanaryPollDelay

Source

Performs one caller-owned delay in the polling state machine.

Method

DelayAsync

Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)

Waits for the requested duration or cancellation.

Type

TimeProviderCanaryPollDelay

Source

Uses the configured time provider for production polling delays.

Type

ICanaryPollHttpClient

Source

Issues one named-canary HTTP request without following redirects.

Method

SendAsync

Task<CanaryPollHttpResponse> SendAsync(CanaryPollRequest request, CancellationToken cancellationToken)

Sends exactly one request and returns bounded response evidence.

Type

CanaryPollHttpClient

Source

Adapts the typed HTTP client to the polling workflow's bounded response contract.

Type

CanaryPollHttpResponse

Source

Captures one bounded named-canary HTTP response.

Type

CanaryPollRetryAfter

Source

Captures a parsed Retry-After header without retaining raw header text.

Type

CanaryPollEnvelopeParser

Source

Parses the required named-canary compatibility core.

Method

Parse

CanaryPollEnvelope Parse(byte[] body, string expectedName)

Parses a bounded response and validates it against the requested canary name.

Type

CanaryPollEnvelope

Source

Represents the parsed safe fields required by the polling state machine.

Type

CanaryPollProtocolException

Source

Represents a protocol incompatibility without exposing response content.

Type

CanaryPollRequestFactory

Source

Normalizes safe command options and resolves environment-sourced values.

Method

Create

CanaryPollRequest Create(string? urlText, string? name, string? markerEnvironmentVariable, string? freshSinceText, string? bearerTokenEnvironmentVariable, string? identityTokenEnvironmentVariable, IReadOnlyList<string>? headerEnvironmentVariables, string? timeoutText, string? intervalText, int maxTransientFailures)

Creates a fully normalized request before any HTTP connection is opened.

Method

IsSafeSummary

bool IsSafeSummary(string? summary)

Returns whether a server summary is safe to expose in terminal evidence.

Type

CanaryPollRequest

Source

Contains normalized request metadata and non-renderable environment-sourced values.

Type

CanaryPollHeader

Source

Contains one non-renderable custom HTTP header.

Type

CanaryPollInputException

Source

Represents a safe local command-input failure.

Type

CanaryPollResult

Source

Represents one safe terminal polling result.

Property

IsRetryable

bool IsRetryable { get; } Source

Gets whether a retry can produce a different deployment decision without changing local input.

Type

CanaryPollResultRenderer

Source

Renders one safe terminal result for a person or an automation client.

Method

WriteAsync

Task WriteAsync(IConsole console, CanaryPollResult result, bool json)

Writes exactly one terminal result to stdout.

Type

CanaryPollGithubSummaryWriter

Source

Appends a bounded, safe result table to a GitHub Actions step summary.

Method

TryWriteAsync

Task<bool> TryWriteAsync(string? path, CanaryPollResult result)

Attempts summary output without changing the polling result.

Type

CoverageRunSlowTestDiagnosticsWriter

Source

Writes bounded failure-first test results and best-effort slow-test diagnostic artifacts for coverage run .

Remarks

The writer consumes AppSurface-managed JUnit files only. Parser problems are preserved as diagnostic warnings so slow-test reporting cannot change the coverage result.
  • Only the first managed JUnit artifact for a project is parsed; additional JUnit artifacts emit warnings.
  • WriteAsync may write artifacts twice when aggregation timing changes during the initial write.
  • Legacy or externally managed test-result files are not consumed.
  • Missing files and parser failures are reported as warnings instead of failing coverage.
  • Failure details and Markdown output are bounded so CI summaries remain within GitHub limits.
Method

CollectAsync

Task<CoverageRunSlowTestDiagnosticsReport> CollectAsync(IReadOnlyList<CoverageProjectRunResult> results, CancellationToken cancellationToken, Action<int>? observeProgress = null)

Parses managed JUnit files and builds a diagnostic report.

Parameters

  • results
    Project run results with managed test result artifact paths.
  • cancellationToken
    Cancellation token for artifact reads.
  • observeProgress
    Optional callback that receives positive parsing and aggregation progress counts.

Returns

Slow-test diagnostic report model.

Method

WriteAsync

Task<CoverageRunSlowTestDiagnosticsRun> WriteAsync(string stagedMarkdownPath, string stagedJsonPath, string artifactDirectory, CoverageRunSlowTestDiagnosticsReport report, Func<long> getAggregationSeconds, Func<long, decimal> calculateAggregationPercent, CancellationToken cancellationToken, Action<int>? observeProgress = null)

Writes diagnostics to private same-directory staging files while recording canonical artifact paths in their contents.

Parameters

  • stagedMarkdownPath
    Unique private Markdown path alongside its canonical destination.
  • stagedJsonPath
    Unique private JSON path alongside its canonical destination.
  • artifactDirectory
    Canonical directory represented in returned and embedded artifact paths.
  • report
    Report model returned by CollectAsync .
  • getAggregationSeconds
    Reads elapsed diagnostic aggregation seconds.
  • calculateAggregationPercent
    Calculates aggregation overhead as a percent of runner time.
  • cancellationToken
    Cancellation token for artifact writes.
  • observeProgress
    Optional callback that receives positive staging progress counts.

Returns

Canonical artifact paths, high-level metadata, and private staging paths after the writes complete. The caller owns the returned staging paths: promote them to their canonical destinations or call TryDeleteStagedFile after a failed or cancelled promotion.

Method

TryDeleteStagedFile

void TryDeleteStagedFile(string path)

Best-effort deletes a staging or backup path created by this diagnostics operation.

Parameters

  • path
    Private path whose removal is safe after its creation was confirmed.
Type

ProgressReportingStream

Source

Delegates stream operations while reporting positive byte counts from reads.

Remarks

This type remains internal so the diagnostics tests can verify that all delegated stream operations preserve the wrapped stream's behavior without relying on reflection.

Type

CoverageRunSlowTestDiagnosticsRun

Source

Written slow-test diagnostic artifact metadata.

Parameters

  • MarkdownPath
    Canonical Markdown destination recorded in the diagnostics.
  • JsonPath
    Canonical JSON destination recorded in the diagnostics.
  • AggregationSeconds
    Elapsed time spent collecting and writing diagnostics.
  • AggregationPercent
    Diagnostic overhead relative to the coverage run.
  • WarningCount
    Number of collected diagnostics warnings.
  • MetadataComplete
    Whether all requested test metadata was collected.
  • ParserStatuses
    Parse status for each managed JUnit artifact.
  • StagedMarkdownPath
    Private Markdown staging path the caller must promote or delete.
  • StagedJsonPath
    Private JSON staging path the caller must promote or delete.

Remarks

StagedMarkdownPath and StagedJsonPath are newly created private files. Once this record is returned, the caller is responsible for promoting or deleting them. Failed or cancelled writes clean up only staging files created by the writer.

Type

CoverageRunSlowTestDiagnosticsReport

Source

Slow-test diagnostic report before overhead fields are finalized.

Parameters

  • SchemaVersion
    Version of the serialized diagnostics schema.
  • GeneratedAtUtc
    UTC time at which diagnostics aggregation completed.
  • MetadataComplete
    Whether every requested managed JUnit artifact parsed without warnings.
  • JunitFileCount
    Number of managed JUnit artifacts that were present during aggregation.
  • Projects
    Per-project execution and parser metadata.
  • TestCaseCount
    Total number of parsed JUnit test cases.
  • FailedTestCaseCount
    Number of parsed test cases with failed or error status.
  • ErrorTestCaseCount
    Number of parsed test cases with error status.
  • SkippedTestCaseCount
    Number of parsed skipped test cases.
  • FailedTestCases
    Bounded, stable failed and errored test-case details for CI triage.
  • TopTestCases
    Bounded, descending-duration test-case list for rendered artifacts.
  • Warnings
    Bounded diagnostics warnings encountered during aggregation.
Type

CoverageRunSlowTestProject

Source

Project timing metadata included in slow-test diagnostics.

Type

CoverageRunJunitReadResult

Source

Best-effort parse result for one managed JUnit file.

Type

CoverageRunSlowTestCase

Source

Parsed JUnit test case timing and bounded failure evidence included in diagnostics.

Parameters

  • ClassName
    JUnit class name.
  • Name
    JUnit test name.
  • Seconds
    Optional parsed test duration.
  • Status
    Parsed JUnit outcome.
  • Project
    Solution-relative project that emitted the JUnit result.
  • JunitFile
    Managed JUnit source file.
  • FailureDetail
    Bounded failure message and stack trace for failed or errored tests.
Type

DurableCommand

Source

Provides the discoverable root for AppSurface durable deployment commands.

Remarks

This command family deliberately owns schema lifecycle only. It does not expose Work, Flow, Schedule, recovery, or generic durable operator mutations because applications must authorize those controls themselves.

Type

DurableSchemaCommand

Source

Provides the discoverable root for explicit durable schema operations.

Type

DurableSchemaStatusCommand

Source

Prints installed and required durable schema versions without mutation.

Type

DurableSchemaScriptCommand

Source

Generates deterministic SQL for pending numbered migrations without opening a database connection.

Property

FromVersion

int FromVersion { get; set; } Source

Gets or sets the last migration already installed.

Property

OutputPath

string? OutputPath { get; set; } Source

Gets or sets an optional output path. The script is written to standard output when omitted.

Property

Force

bool Force { get; set; } Source

Gets or sets whether an existing output file may be atomically replaced.

Type

DurableSchemaApplyCommand

Source

Applies pending migrations through an explicitly configured migration-owner connection.

Property

Apply

bool Apply { get; set; } Source

Gets or sets the required mutation confirmation.

Type

DurableSchemaPreflightCommand

Source

Verifies a complete reviewed role manifest and schema in one fenced, read-only snapshot.

Remarks

Both inputs are mandatory even for one pair. Input validation precedes connection resolution. Runtime evidence covers only the observed credential; activation requires every distinct runtime and the continuous application-owned guard described in Durable/heartbeat-retention-operations.md.

Property

RolePairsFile

string? RolePairsFile { get; set; } Source

Gets or sets the complete reviewed version-1 UTF-8 manifest path, including for one pair.

Property

MigrationOwnerRole

string? MigrationOwnerRole { get; set; } Source

Gets or sets the independently reviewed migration-owner role; no catalog-derived default exists.

Type

DurableSchemaCommandBase

Source

Shared connection-source option and safety behavior for durable schema commands.

Property

Service

IDurableSchemaCommandService Service { get; } Source

Gets the injected schema command service.

Type

DurableSchemaOnlineCommandBase

Source

Supplies the secret-safe connection source and bounded execution shared only by online schema commands.

Method

ResolveConnectionString

string ResolveConnectionString()

Resolves a connection string without printing or persisting it.

Method

RunOnlineAsync

ValueTask<T> RunOnlineAsync<T>(string connectionString, CancellationToken cancellationToken, Func<string, CancellationToken, ValueTask<T>> operation, TimeSpan? operationTimeout = null, bool preflightDiagnostics = false)

Runs an online command with a bounded linked cancellation token and safe provider failure mapping.

Method

WriteStatusAsync

ValueTask WriteStatusAsync(IConsole console, DurableSchemaStatusView status)

Writes a stable schema status without exposing connection or server details.

Property

ConnectionEnvironmentVariable

string ConnectionEnvironmentVariable { get; set; } Source

Gets or sets the environment variable that contains the PostgreSQL connection string.

Remarks

Connection strings are intentionally not accepted as command-line values because process listings and shell history are not appropriate secret stores. The variable's value is neither logged nor rendered by this command.

Type

IDurableSchemaCommandService

Source

Testable CLI boundary over the PostgreSQL schema manager.

Method

GetStatusAsync

ValueTask<DurableSchemaStatusView> GetStatusAsync(string connectionString, CancellationToken cancellationToken)

Reads compatibility without mutation.

Method

PreflightAsync

ValueTask<DurablePreflightResult> PreflightAsync(string connectionString, DurablePreflightRequest request, CancellationToken cancellationToken)

Reads compatibility, caller identity and every complete-manifest structural check in one fenced snapshot.

Remarks

Owns one nonpooled session through checked cleanup; the request is validated before database access.

Method

GenerateScript

string GenerateScript(int fromVersion)

Generates deterministic migration SQL without opening a connection.

Method

ApplyAsync

ValueTask<DurableSchemaApplyView> ApplyAsync(string connectionString, CancellationToken cancellationToken)

Applies pending migrations with the supplied bounded token.

Type

DurableSchemaCommandService

Source

Production CLI adapter that creates and disposes a short-lived Npgsql data source per online command.

Type

DurableSchemaStatusView

Source

CLI-safe schema compatibility projection.

Parameters

  • Compatibility
    The package-defined compatibility state that determines whether durable reads and writes may begin.
  • InstalledVersion
    The non-negative durable schema version currently installed in the target database.
  • RequiredVersion
    The non-negative durable schema version required by this package version.
  • PendingVersions
    The ordered, non-null migration versions that remain to be applied; empty when no migration is pending.
Method

From

DurableSchemaStatusView From(DurableRuntimeSchemaStatus status)

Projects only safe schema status fields for the CLI.

Property

IsCompatible

bool IsCompatible { get; } Source

Gets whether schema reads and writes may begin.

Type

DurableSchemaApplyView

Source

CLI-safe schema apply projection.

Parameters

  • FromVersion
    The non-negative schema version observed before the explicit apply operation began.
  • ToVersion
    The non-negative schema version observed after the apply operation completed.
  • AppliedVersions
    The ordered, non-null migration versions applied by this invocation; empty when the schema was already current.
Type

DurableSchemaDiagnostics

Source

Renders stable, secret-safe schema diagnostics.

Method

PreflightFailure

string PreflightFailure(DurableRuntimeSchemaCompatibility compatibility, bool heartbeatRetentionPending = false)

Builds the single-block incompatibility diagnostic used by preflight.

Method

RetentionStructureFailure

string RetentionStructureFailure(IReadOnlyList<string> failedChecks)

Builds a fixed, secret-safe failure for schema-11 structure or privilege drift.

Method

ManifestInputFailure

string ManifestInputFailure()

Returns a fixed input diagnostic without echoing paths, JSON, role input or provider errors.

Method

PreflightOperationFailure

string PreflightOperationFailure(string category)

Returns a fixed bounded-operation diagnostic; only trusted category names are rendered.

Method

SchemaIncompatible

string SchemaIncompatible(DurableRuntimeSchemaCompatibility compatibility)

Builds a stable failure for schema-manager incompatibility.

Method

Cause

string Cause(DurableRuntimeSchemaCompatibility compatibility)

Returns a package-defined safe explanation without forwarding server exception text.

Type

DurableSchemaScriptOutput

Source

Writes generated scripts with atomic publication and explicit overwrite protection.

Method

WriteAsync

Task<string> WriteAsync(string requestedPath, string script, bool force, CancellationToken cancellationToken)

Writes script beside the requested destination then atomically publishes it.

Method

UseTemporaryFileWrittenHookForTesting

IDisposable UseTemporaryFileWrittenHookForTesting(Action callback)

Runs a callback after temporary SQL output is written and before publication.

Remarks

This test-only seam is async-flow-local so concurrent output tests can deterministically exercise the final publish window without affecting production writes or other tests.

Type

DurableDoctorInput

Source

Validates doctor intent and keeps its resolved connection string private to one command invocation.

Remarks

Doctor accepts only environment-variable names on argv. This object resolves each distinct selected variable once, validates the PostgreSQL settings and configured epoch, and keeps the connection string out of request and result records. See the Durable doctor command reference for the supported grammar and evidence boundary.

Method

InspectAsync

ValueTask<DurableDoctorObservation> InspectAsync(IDurableDoctorService service, CancellationToken cancellationToken)

Calls the configured observation service without exposing connection custody to printable records.

Method

Create

DurableDoctorInput Create(string? connectionEnvironmentName, string? epochEnvironmentName, string? workerId, string? staleAfter, string? timeout, string? format, Func<string, string?>? getEnvironmentVariable = null)

Validates raw CliFx string values and resolves the selected environment variables exactly once.

Parameters

  • connectionEnvironmentName
    Environment-variable name or null to use the documented default.
  • epochEnvironmentName
    Environment-variable name or null to use the documented default.
  • workerId
    Optional worker label; it is never trimmed or normalized.
  • staleAfter
    Optional positive decimal duration paired with workerId .
  • timeout
    Optional total timeout; null uses the documented ten-second default.
  • format
    Output format, exactly text or json ; null uses text.
  • getEnvironmentVariable
    Environment lookup seam used by tests and the real entry point.

Returns

A validated invocation whose connection string is private to this instance.

Exceptions

  • DurableDoctorInputException
    The selected argv or environment values are invalid.
Method

ParseDuration

TimeSpan ParseDuration(string value, TimeSpan minimum, TimeSpan maximum)

Parses one positive decimal duration into exact representable TimeSpan ticks.

Parameters

  • value
    A number followed by lowercase ms , s , m , or h .
  • minimum
    Inclusive lower bound for the selected duration role.
  • maximum
    Inclusive upper bound for the selected duration role.

Returns

The parsed duration when it is representable and within the requested range.

Exceptions

  • DurableDoctorInputException
    The token is malformed, unrepresentable, or outside its range.
Method

ResolveEnvironmentName

string ResolveEnvironmentName(string? suppliedName, string defaultName)

Applies the schema command's environment-name grammar, with the doctor contract's 200-character cap.

Property

Request

DurableDoctorRequest Request { get; } Source

Gets the validated, secret-free doctor request.

Type

DurableDoctorInputException

Source

A fixed-category signal for invalid doctor arguments or selected environment values.

Type

DurableDoctorArgumentAdmission

Source

Classifies raw doctor argv before generic CLI parsing can echo malformed tokens.

Method

Inspect

DurableDoctorArgumentAdmissionResult Inspect(string[] arguments)

Checks only a leading durable doctor route and its option-token structure.

Parameters

  • arguments
    The original, unnormalized process argv.

Returns

A safe admission decision and the uniquely valid output-format hint, if present.

Method

NormalizeJoinedValueOptions

string[] NormalizeJoinedValueOptions(string[] arguments)

Expands recognized joined value options because CliFx binds their name and value as separate tokens.

Parameters

  • arguments
    The admitted doctor argv.

Returns

Arguments with only known --name=value forms expanded for CliFx binding.

Type

DurableDoctorArgumentAdmissionResult

Source

Safe raw-argv doctor route decision produced before CLI normalization and startup-context creation.

Parameters

  • IsDoctor
    Whether the argv targets the doctor command.
  • IsMalformed
    Whether doctor-specific admission rejected its token structure.
  • IsHelp
    Whether argv contains only one explicitly supported doctor help flag.
  • Format
    The unique valid text/json hint, falling back to text.
Type

LocalSecretsTransferCoordinator

Source

Coordinates AppSurface-owned remote-to-local transfers without persisting secret values.

Remarks

The coordinator is deliberately internal to the CLI. Local secret stores do not expose cross-store transactions, so this type serializes only cooperating AppSurface commands and records a value-free prepared / committed attestation. Direct platform-store edits remain outside that guarantee.

Method

Supports

bool Supports(IAppSurfaceLocalSecretStore store)

Gets whether the CLI can coordinate the supplied built-in store in v2.

Method

CapturePrecondition

LocalCoordinatorPrecondition CapturePrecondition(AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool replace)

Captures the value-free local destination precondition for a v2 plan row.

Method

Recheck

LocalCoordinatorCheck Recheck(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool allowPreparedRecovery)

Rechecks a plan-bound local precondition before source payload access.

Method

WriteOrRecover

LocalCoordinatorWriteResult WriteOrRecover(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, string value, bool allowPreparedRecovery)

Writes a local value after rechecking its plan-bound precondition under the coordinator lock.

Method

VerifyCommitted

LocalCoordinatorCheck VerifyCommitted(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store)

Confirms that a receipt's local row still has matching coordinator evidence.

Method

InvalidateBeforeMutation

AppSurfaceLocalSecretResult InvalidateBeforeMutation(IAppSurfaceLocalSecretStore store, AppSurfaceLocalSecretIdentity identity, Func<AppSurfaceLocalSecretResult> mutation)

Invalidates any committed transfer attestation before a normal local CLI mutation.

Method

GetDefaultStateRoot

string GetDefaultStateRoot(string? localApplicationData, string userProfile)

Builds the default per-user transfer state directory from platform folder values.

Parameters

  • localApplicationData
    Platform local-application-data root, if available.
  • userProfile
    Platform user-profile root used when local application data is unavailable.

Returns

The absolute AppSurface secret-transfer state directory.

Type

LocalTransferFormat

Source

Validates fixed-length lowercase hexadecimal transfer identities.

Method

IsLowerHex

bool IsLowerHex(string? value, int length)

Gets whether a value is lowercase hexadecimal with the required length.

Parameters

  • value
    Candidate value to validate.
  • length
    Required character length.

Returns

true when the value has the required lowercase hexadecimal shape.

Type

LocalSecretsTransferCoordinatorTestHooks

Source

Provides deterministic coordinator failure injection for internal tests.

Property

BeforeEnsureStateRoot

Action<string>? BeforeEnsureStateRoot { get; init; } Source

Runs immediately before the coordinator verifies or creates its state directory.

Property

BeforeAcquireLock

Action<string>? BeforeAcquireLock { get; init; } Source

Runs immediately before the coordinator opens a per-secret transfer lock.

Property

BeforeSecureLockFile

Action<string>? BeforeSecureLockFile { get; init; } Source

Runs after the coordinator opens a lock file and before it restricts the file to the current user.

Property

BeforeReadJournal

Action<string>? BeforeReadJournal { get; init; } Source

Runs immediately before the coordinator reads an existing transfer journal.

Property

AfterWriteTemporaryJournal

Action<string>? AfterWriteTemporaryJournal { get; init; } Source

Runs after a temporary journal has been written and before it is secured and committed.

Property

BeforeSecureTemporaryJournal

Action<string>? BeforeSecureTemporaryJournal { get; init; } Source

Runs immediately before the coordinator restricts a temporary journal to the current user.

Property

BeforeDeleteTemporaryJournal

Action<string>? BeforeDeleteTemporaryJournal { get; init; } Source

Runs immediately before cleanup deletes an uncommitted temporary journal.

Property

BeforeDeleteJournal

Action<string>? BeforeDeleteJournal { get; init; } Source

Runs immediately before an attestation journal is removed for an ordinary mutation.

Property

StoreDoctor

Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreDoctor { get; init; } Source

Supplies the LocalSecrets doctor result instead of calling the store.

Property

StoreProbe

Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreProbe { get; init; } Source

Supplies the LocalSecrets metadata probe result instead of calling the store.

Property

StoreGet

Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreGet { get; init; } Source

Supplies the LocalSecrets recovery read result instead of calling the store.

Property

StoreSet

Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, string, AppSurfaceLocalSecretResult>? StoreSet { get; init; } Source

Supplies the LocalSecrets write result instead of calling the store.

Type

LocalCoordinatorPrecondition

Source

Describes the captured local precondition without exposing local values.

Method

Missing

LocalCoordinatorPrecondition Missing()

Creates a precondition for a local target that is absent.

Returns

A missing-target precondition with no attestation or failure.

Method

Replace

LocalCoordinatorPrecondition Replace(string previousOperationId)

Creates a precondition that permits a guarded replacement.

Parameters

  • previousOperationId
    Committed attestation operation identifier that authorizes replacement.

Returns

A replacement precondition bound to the supplied prior operation.

Method

Conflict

LocalCoordinatorPrecondition Conflict(LocalCoordinatorFailure failure)

Creates a precondition that blocks transfer because the local target conflicts with the plan.

Parameters

  • failure
    Value-safe explanation of the conflict.

Returns

A conflict precondition carrying the supplied failure.

Method

Unsupported

LocalCoordinatorPrecondition Unsupported()

Creates a precondition for a local store that cannot participate in coordinated transfer.

Returns

An unsupported-store precondition with its stable failure diagnostic.

Method

Failed

LocalCoordinatorPrecondition Failed(LocalCoordinatorFailure failure)

Creates a precondition that failed before a safe local state could be established.

Parameters

  • failure
    Value-safe failure that prevented precondition capture.

Returns

A failed precondition carrying the supplied failure.

Type

LocalCoordinatorCheck

Source

Describes a local destination check without exposing local values.

Method

Ready

LocalCoordinatorCheck Ready()

Creates a check result that permits the planned operation.

Returns

A ready result without a failure.

Method

PreparedRecovery

LocalCoordinatorCheck PreparedRecovery()

Creates a check result that requires safe reconciliation of a prepared transfer.

Returns

A prepared-recovery result without a failure.

Method

Conflict

LocalCoordinatorCheck Conflict()

Creates a check result that blocks the operation because current state conflicts with the plan.

Returns

A conflict result without a failure because the plan mismatch is the diagnostic.

Method

Indeterminate

LocalCoordinatorCheck Indeterminate()

Creates a check result whose prior write state cannot be safely determined.

Returns

An indeterminate result without a failure because reconciliation is required.

Method

Unsupported

LocalCoordinatorCheck Unsupported()

Creates a check result for a local store that cannot participate in coordinated transfer.

Returns

An unsupported-store result with its stable failure diagnostic.

Method

Failed

LocalCoordinatorCheck Failed(LocalCoordinatorFailure failure)

Creates a check result that failed before the local state could be safely rechecked.

Parameters

  • failure
    Value-safe failure that prevented the recheck.

Returns

A failed result carrying the supplied failure.

Type

LocalCoordinatorWriteResult

Source

Describes a guarded local write or recovery outcome.

Method

Created

LocalCoordinatorWriteResult Created()

Creates a successful create outcome.

Returns

A created result without a failure.

Method

Replaced

LocalCoordinatorWriteResult Replaced()

Creates a successful guarded replacement outcome.

Returns

A replaced result without a failure.

Method

Recovered

LocalCoordinatorWriteResult Recovered()

Creates a successful recovery outcome for a matching prepared write.

Returns

A recovered result without a failure.

Method

Conflict

LocalCoordinatorWriteResult Conflict()

Creates a write outcome blocked by a changed local target or attestation.

Returns

A conflict result without a failure because the plan mismatch is the diagnostic.

Method

Indeterminate

LocalCoordinatorWriteResult Indeterminate(LocalCoordinatorFailure? failure = null)

Creates an outcome whose write state requires reconciliation before another write.

Parameters

  • failure
    Optional value-safe detail; omitted when the coordinator cannot determine a more specific cause.

Returns

An indeterminate result; a null failure means callers must use the generic reconciliation diagnostic.

Method

Unsupported

LocalCoordinatorWriteResult Unsupported()

Creates a write outcome for a local store that cannot participate in coordinated transfer.

Returns

An unsupported-store result with its stable failure diagnostic.

Method

Failed

LocalCoordinatorWriteResult Failed(LocalCoordinatorFailure failure)

Creates a write outcome that failed before a safe completion could be established.

Parameters

  • failure
    Value-safe failure that prevented a confirmed write result.

Returns

A failed result carrying the supplied failure.

Type

LocalCoordinatorFailure

Source

Contains a stable, value-safe local coordinator failure.

Type

LocalTransferJournal

Source

Persists only transfer identity and state, never a secret value or a value-derived hash.

Type

CloudRunExecutionWorkflow

Source

Loads one finite published bundle and passes only the remaining monotonic allowance to observation.

Remarks

Bundle files are opened through the shared coverage artifact reader, which rejects non-regular files and does not follow links. Hashes establish consistency, not publisher authenticity.

Type

BoundedHttpBodyReader

Source

Reads an HTTP response body without retaining more than a caller-provided byte limit.

Remarks

Callers must inspect BoundedHttpBody.Truncated before parsing the retained bytes. A truncated body is useful for bounded diagnostics, but it is not a complete protocol message and must not be treated as one.

Method

ReadAsync

Task<BoundedHttpBody> ReadAsync(HttpContent content, int maxBodyBytes, CancellationToken cancellationToken)

Reads one content stream up to the configured byte limit.

Parameters

  • content
    The response content to read.
  • maxBodyBytes
    The maximum number of bytes retained.
  • cancellationToken
    Cancels the bounded read.

Returns

The retained bytes and whether additional bytes were discarded.

Type

BoundedHttpBody

Source

Captures the bounded result of one HTTP response-body read.

Parameters

  • Bytes
    The retained bytes, capped at the requested maximum.
  • Truncated
    Whether bytes beyond the requested maximum were discarded.
Type

CoverageProjectManifest

Source

Writes the stable binding between one coverage-run project directory and the project that owns it.

Remarks

The manifest lets package-level proof select a known project report without reconstructing the runner's private slug allocation algorithm. It is emitted before the project's test process starts so a produced raw report is always adjacent to the identity that authorized the directory.

Schema version 1 records a normalized solution-relative project path and the slug allocated by CoverageRunWorkflow . Consumers must reject unknown schema versions and must not infer a project identity from the directory name alone.

Method

WriteAsync

Task WriteAsync(string projectOutputDirectory, string solutionDirectory, CoverageRunProject project, CancellationToken cancellationToken)

Writes the project-to-artifact-directory binding as a complete UTF-8 JSON document.

Parameters

  • projectOutputDirectory
    Existing project artifact directory.
  • solutionDirectory
    Directory used to resolve and run the selected project.
  • project
    Selected project with its allocated artifact slug.
  • cancellationToken
    Cancellation token for the staged write.

Returns

A task that completes after the manifest has been atomically promoted.

Type

DurableDoctorCommand

Source

Inspects one configured Durable store and runtime without changing the database.

Remarks

Connection strings and epochs are read only from the selected environment variables. Doctor validates every bound string before calling its dedicated observation service, writes one final text or JSON result to stdout, and sets the process exit code from that result. It does not perform schema migration or application verification.

Method

WriteResultAsync

Task WriteResultAsync(TextWriter outputWriter, DurableDoctorResult result, DurableDoctorRequest? request, string format)

Writes one doctor result, replacing render-contract rejection with one canonical failed envelope.

Parameters

  • outputWriter
    The command output sink that receives the single rendered value.
  • result
    The classified result to render.
  • request
    Validated request intent, or null for input failures.
  • format
    The already admitted output format.

Remarks

A broken sink sets exit code 1 and is never retried, so it cannot duplicate a partial result.

Property

ConnectionEnvironmentName

string? ConnectionEnvironmentName { get; set; } Source

Gets or sets the environment variable containing the PostgreSQL connection string.

Property

EpochEnvironmentName

string? EpochEnvironmentName { get; set; } Source

Gets or sets the environment variable containing the configured runtime epoch GUID.

Property

WorkerId

string? WorkerId { get; set; } Source

Gets or sets an optional operator-selected worker identifier.

Property

StaleAfter

string? StaleAfter { get; set; } Source

Gets or sets the caller-supplied heartbeat comparison threshold, required with --worker-id.

Property

Timeout

string? Timeout { get; set; } Source

Gets or sets the bounded total observation timeout.

Property

Format

string? Format { get; set; } Source

Gets or sets the output format.

Type

SecretsCommand

Source

Provides the discoverable root for AppSurface local secret commands.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console)

Prints the local secrets command family summary.

Parameters

  • console
    CliFx console used for command output.

Returns

A completed task.

Type

SecretsInitCommand

Source

Initializes or verifies a LocalSecrets namespace.

Type

SecretsSetCommand

Source

Writes a local secret value.

Property

Value

string? Value { get; set; } Source

Gets or sets the secret value.

Property

ReadFromStandardInput

bool ReadFromStandardInput { get; set; } Source

Gets or sets a value indicating whether to read the secret value from standard input.

Type

SecretsGetCommand

Source

Verifies a local secret exists without printing its value.

Type

SecretsListCommand

Source

Lists currently retrievable local secret names in a namespace.

Property

NamesOnly

bool NamesOnly { get; set; } Source

Gets or sets a value indicating whether to print only secret names.

Type

SecretsMigrateCommand

Source

Explicitly migrates readable legacy macOS LocalSecrets records into the current v2 Keychain namespace.

Remarks

The command is intentionally unavailable for deterministic file stores and other platforms. It never prints secret values, never deletes v1 records, and never overwrites an existing v2 record; use secrets set to update a canonical v2 value after migration.

Type

SecretsMigrateKeyCommand

Source

Migrates one exact stored LocalSecrets identifier to a strict logical destination key.

Remarks

The default invocation previews identifiers and parsed destination segments without reading values. After inspecting the preview, repeat it with --apply to confirm the journaled migration. Display identifiers are escaped and bounded. Executable command output is omitted when an argument needs display transformation, while the original source and destination remain unchanged for backend operations. The inherited platform-store factory is the test seam for exercising this command without OS credentials.

Method

DisplayIdentifier

string DisplayIdentifier(string value)

Uses the shared value-free renderer; displayed truncation is never reused as an executable argument.

Property

SourceStoredKey

string SourceStoredKey { get; set; } Source

Gets or sets the exact source identifier as stored by the selected backend.

Property

DestinationKey

string DestinationKey { get; set; } Source

Gets or sets the strict destination logical key.

Property

Apply

bool Apply { get; set; } Source

Gets or sets whether to confirm the migration after reviewing its identifiers.

Type

SecretsMigrateKeyRecoverCommand

Source

Inspects or explicitly retains/releases an unfinished file-backed exact-key migration.

Remarks

Neither operation writes or deletes a secret value. Release is for operator reconciliation only.

Property

MigrationId

string MigrationId { get; set; } Source

Gets or sets the exact migration identifier returned by a failed migration.

Property

Apply

bool Apply { get; set; } Source

Gets or sets whether to perform the previewed durable metadata transition.

Property

Release

bool Release { get; set; } Source

Gets or sets whether to release a retained journal after operator reconciliation.

Property

ExpectedState

string? ExpectedState { get; set; } Source

Gets or sets the state printed by preview; required with Apply .

Type

SecretsDeleteCommand

Source

Deletes one local secret.

Type

SecretsDoctorCommand

Source

Diagnoses LocalSecrets platform availability.

Type

SecretsCommandBase

Source

Shared options and helpers for local secret commands.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console)

Executes the command.

Parameters

  • console
    CliFx console used for command output.

Returns

A value task that completes when the command finishes.

Method

BuildContext

SecretsCommandContext BuildContext()

Builds a normalized command context.

Returns

The command context.

Method

CreatePlatformStore

IAppSurfaceLocalSecretStore CreatePlatformStore(AppSurfaceLocalSecretsOptions options)

Creates the OS-backed LocalSecrets store for commands that do not use the deterministic file store.

Parameters

  • options
    Options derived from the CLI command line.

Returns

The platform-backed local secret store.

Method

WriteResultAsync

ValueTask WriteResultAsync(IConsole console, AppSurfaceLocalSecretResult result, string successVerb)

Writes a command result.

Parameters

  • console
    CliFx console used for command output.
  • result
    The local secret result.
  • successVerb
    The success verb to display.

Returns

A value task that completes when output is written.

Remarks

LocalSecrets treats LocalSecretResultStatus.Missing as failure everywhere except doctor-style readiness probes that return a ready-class posture diagnostic. Keep that exception explicit when adding commands so ordinary missing secrets do not report success.

Property

ApplicationName

string ApplicationName { get; set; } Source

Gets or sets the AppSurface application identity.

Property

EnvironmentName

string EnvironmentName { get; set; } Source

Gets or sets the AppSurface environment identity.

Property

KeyPrefix

string? KeyPrefix { get; set; } Source

Gets or sets an optional LocalSecrets key prefix.

Property

StoreFile

string? StoreFile { get; set; } Source

Gets or sets an optional file-backed store path for deterministic examples and tests.

Property

SecretToolPath

string? SecretToolPath { get; set; } Source

Gets or sets an explicit Linux secret-tool executable path for nonstandard trusted installs.

Type

SecretsKeyCommandBase

Source

Shared options for commands that target one local secret key.

Method

Normalize

AppSurfaceLocalSecretIdentity Normalize(SecretsCommandContext context)

Normalizes the configured key into a local secret identity.

Parameters

  • context
    The command context.

Returns

The local secret identity.

Property

Key

string Key { get; set; } Source

Gets or sets the AppSurface config key.

Type

SecretsCommandContext

Source

Captures normalized command state.

Parameters

  • Normalizer
    Identity normalizer.
  • Store
    Local secret store.
  • ApplicationName
    Normalized application identity.
  • Environment
    Normalized environment identity.
  • KeyPrefix
    Normalized optional key prefix.
Type

ProgramEntryPoint

Source

Internal CLI entry point that adds a scoped test seam around AppSurfaceCliApp .

Remarks

Production code uses RunAsync directly. Tests can use PushConfigureOptionsOverrideForTests to add temporary console or DI overrides without changing the top-level statement in Program.cs .

Method

RunAsync

Task RunAsync(string[] args, Action<ConsoleOptions>? configureOptions = null)

Runs the AppSurface CLI with the specified arguments and optional console configuration.

Parameters

  • args
    Command-line arguments to parse and execute.
  • configureOptions
    Optional primary console-options callback for the current invocation.

Returns

A task that represents the CLI execution.

Method

PushConfigureOptionsOverrideForTests

IDisposable PushConfigureOptionsOverrideForTests(Action<ConsoleOptions> configureOptions)

Pushes a test-only console-options override for the current async context.

Parameters

  • configureOptions
    Override callback to apply after any direct invocation callback.

Returns

A disposable scope that restores the previous override when disposed.

Remarks

Always dispose the returned scope, typically with using var . Overrides compose with RunAsync callbacks in direct-then-override order so tests can replace services after production defaults are configured.

Type

RestoreOverrideScope

Source

Restores the previously active test override when disposed.

Parameters

  • previous
    Override that was active before the current scope was pushed.
Type

AppSurfaceCliModule

Source

Represents the AppSurface CLI root module used to bootstrap command execution.

Remarks

The module is intentionally empty today: the CLI owns command registration in AppSurfaceCliApp and delegates web-host behavior to AppSurface Docs-specific runners. Add dependencies here only when every AppSurface CLI command needs the same module-level dependency graph or host lifecycle hook. Prefer command-local services or custom test registrations for isolated behavior, and do not place runtime command logic in this module.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services)

Configures shared CLI services after the default command runtime registrations have been added.

Parameters

  • context
    Startup context for the CLI run.
  • services
    Service collection that will back command construction.

Remarks

The default implementation is a no-op. Keep it empty unless a service truly applies to the whole CLI surface.

Method

ConfigureHostBeforeServices

void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder)

Configures a Generic Host builder before services are registered.

Parameters

  • context
    Startup context for the CLI run.
  • builder
    Host builder that would be configured by host-based startup paths.

Remarks

The command runtime does not currently build a Generic Host through this module, so this hook is intentionally a no-op and exists to satisfy the shared AppSurface host-module contract.

Method

ConfigureHostAfterServices

void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder)

Configures a Generic Host builder after services are registered.

Parameters

  • context
    Startup context for the CLI run.
  • builder
    Host builder that would be configured by host-based startup paths.

Remarks

Keep this empty until the CLI adopts a host-backed lifecycle. Command behavior should stay in command classes.

Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder)

Registers root-module dependencies for the AppSurface CLI module graph.

Parameters

  • builder
    Dependency builder used by AppSurface startup composition.

Remarks

The CLI has no module dependencies by default. Add dependencies here only for cross-command infrastructure that must participate in AppSurface module ordering.

Type

DocsCommand

Source

Previews AppSurface Docs for a local repository through the public appsurface docs command.

Remarks

This command starts the AppSurface Docs standalone host with CLI-friendly defaults and delegates option validation and argument construction to AppSurfaceDocsPreviewCommand .

Type

DocsPreviewCommand

Source

Previews AppSurface Docs for a local repository through the appsurface docs preview alias.

Remarks

Use this alias when a command hierarchy reads better in scripts. It has the same options and behavior as DocsCommand .

Type

DocsExportCommand

Source

Exports AppSurface Docs for a local repository through the appsurface docs export command.

Remarks

This command owns the AppSurface Docs source-host lifecycle and delegates static crawling, URL rewriting, CDN validation, and materialization to the RazorWire export engine.

Method

ExecuteAsync

2 overloads
ValueTask ExecuteAsync(IConsole console)

Executes the command through the CliFx console integration.

Parameters

  • console
    Console abstraction used to register cancellation handling.

Returns

A value task that completes when export finishes or command validation fails.

ValueTask ExecuteAsync(CancellationToken cancellationToken)

Executes the command using an explicit cancellation token.

Parameters

  • cancellationToken
    Token observed while starting the host and exporting static output.

Returns

A value task that completes when export finishes.

Method

BuildExportArgs

AppSurfaceDocsExportArgs BuildExportArgs()

Translates CLI options into an AppSurface Docs export invocation.

Returns

The export runner arguments.

Remarks

Export defaults to Production and binds a loopback ephemeral port internally. It does not expose preview's --urls or --port options because humans and CI should not manage export listener ports.

Method

BuildDefaultSeedRoutes

IReadOnlyList<string> BuildDefaultSeedRoutes()

Builds the default export seed routes from the resolved AppSurface Docs routing options.

Returns

The root route plus the live docs root, with duplicates removed.

Property

OutputPath

string OutputPath { get; set; } Source

Gets the directory where static docs files will be written.

Remarks

Defaults to dist/docs for local use. CI should pass an explicit output path so upload artifacts and export output stay tied together.

Property

Mode

ExportMode Mode { get; set; } Source

Gets the export mode used by the underlying RazorWire exporter.

Remarks

ExportMode.Cdn validates and rewrites output for static CDN hosting. ExportMode.Hybrid preserves application-style internal URLs for server-backed deployments.

Property

LiveOrigin

string? LiveOrigin { get; set; } Source

Gets the live origin used for RazorWire-managed live references in hybrid exports.

Remarks

This option is only needed for split-origin hybrid output. The value must be an absolute http or https origin with no path, query string, fragment, or userinfo. When configured, RazorWire-owned live surfaces such as streams, islands, and lazy anti-forgery form posts are rewritten to this origin while docs navigation and canonical routes remain on the static docs host. Leave it unset when the published docs and live app share an origin.

Property

HybridCredentials

RazorWireHybridCredentialsMode HybridCredentials { get; set; } Source

Gets credential behavior for RazorWire-managed live references.

Remarks

Defaults to RazorWireHybridCredentialsMode.Auto , which includes credentials when LiveOrigin is set and omits them otherwise. Choose RazorWireHybridCredentialsMode.Include for cookie-backed live docs interactions across origins. Choose RazorWireHybridCredentialsMode.Omit only for public live endpoints that do not need cookies or lazy anti-forgery token refresh.

Property

RedirectStrategy

ExportRedirectStrategy RedirectStrategy { get; set; } Source

Gets the redirect alias materialization strategy used by the underlying RazorWire exporter.

Remarks

ExportRedirectStrategy.Html is the default and works on GitHub Pages and generic static hosts by writing alias HTML fallback files. ExportRedirectStrategy.Netlify writes a root _redirects file for Netlify-compatible CDN hosting and is valid only with ExportMode.Cdn .

Property

SeedRoutesPath

string? SeedRoutesPath { get; set; } Source

Gets an optional path to a seed-route file.

Remarks

This option is long-only because -r is reserved for --repo across AppSurface docs commands. When omitted, export derives default seeds from the configured docs routing surface.

Type

DocsVerifyArchiveCommand

Source

Verifies one catalog-pinned AppSurface Docs release archive without starting a web host.

Remarks

This command exercises the same catalog and archive verification path used at runtime so operators can diagnose manifest, digest, and file drift locally before deploying a version catalog change.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console)

Executes the command through the CliFx console integration.

Parameters

  • console
    Console abstraction used to register cancellation handling.

Returns

A value task that completes after archive verification.

Property

CatalogPath

string? CatalogPath { get; set; } Source

Gets the path to the AppSurface Docs version catalog JSON file.

Property

Version

string? Version { get; set; } Source

Gets the version identifier to verify from the catalog.

Property

TrustedReleaseRootPath

string? TrustedReleaseRootPath { get; set; } Source

Gets the trusted release root used to resolve catalog exactTreePath entries.

Property

MaxRewrittenFileSizeBytes

long? MaxRewrittenFileSizeBytes { get; set; } Source

Gets the maximum byte size accepted for a rewritten HTML or root search index file in the published tree.

Remarks

Omit this option to use the 4 MiB runtime default. Set it to the same value configured on a host that mounts a larger archive; supported values are 1 through 33,554,432 bytes (32 MiB).

Type

DocsVerifyHealthCommand

Source

Verifies AppSurface Docs harvest health for CI and release gates.

Remarks

This command loads the standalone docs host service graph, reads the same redacted health response shape as the JSON endpoint, and fails when the machine-checkable health response is not OK.

Method

ExecuteAsync

2 overloads
ValueTask ExecuteAsync(IConsole console)

Executes the command through the CliFx console integration.

Parameters

  • console
    Console abstraction used to register cancellation handling.

Returns

A value task that completes when verification finishes.

ValueTask ExecuteAsync(CancellationToken cancellationToken)

Executes the command using an explicit cancellation token.

Parameters

  • cancellationToken
    Token observed while loading host services and reading harvest health.

Returns

A value task that completes when verification finishes.

Method

BuildVerifyArgs

AppSurfaceDocsHealthVerifyArgs BuildVerifyArgs()

Translates CLI options into a one-shot harvest-health verification invocation.

Returns

The health verification runner arguments.

Property

RequireCompleteEventDoclets

bool RequireCompleteEventDoclets { get; set; } Source

Gets a value indicating whether public JavaScript event doclets must include complete event contract fields.

Remarks

This forwards AppSurfaceDocs:Harvest:JavaScript:RequireCompleteEventDoclets=true into the verification host without changing runtime startup failure semantics.

Property

VerifyEventDispatches

bool VerifyEventDispatches { get; set; } Source

Gets a value indicating whether public JavaScript event doclets should be compared with literal CustomEvent dispatch evidence.

Remarks

This forwards AppSurfaceDocs:Harvest:JavaScript:VerifyEventDispatches=true into the verification host. Mismatches remain warning-only diagnostics; the command prints them on successful verification runs.

Type

AppSurfaceDocsPreviewCommand

Source

Shared implementation for AppSurface Docs preview commands.

Remarks

The base command translates CLI options into AppSurface Docs standalone host arguments. It keeps command parsing separate from process hosting so tests can verify validation and argument forwarding without starting Kestrel.

Method

ExecuteAsync

2 overloads
ValueTask ExecuteAsync(IConsole console)

Executes the command through the CliFx console integration.

Parameters

  • console
    Console abstraction used to register cancellation handling.

Returns

A value task that completes when the preview host exits or command validation fails.

ValueTask ExecuteAsync(CancellationToken cancellationToken)

Executes the command using an explicit cancellation token.

Parameters

  • cancellationToken
    Token observed before the host runner starts.

Returns

A value task that completes when the preview host exits.

Remarks

This overload exists for tests and shared command execution paths that already own cancellation registration.

Property

Urls

string? Urls { get; set; } Source

Gets the explicit URL binding forwarded to the AppSurface Docs host.

Remarks

Use this for a full Kestrel binding such as http://127.0.0.1:5189 . Prefer Port when only the port needs to change.

Property

Port

int? Port { get; set; } Source

Gets the port shortcut forwarded to the AppSurface Docs host.

Remarks

Use this for local preview scripts that only need a port override. Use Urls for explicit host, scheme, or multi-binding scenarios.

Property

AllHosts

bool AllHosts { get; set; } Source

Gets a value indicating whether the port shortcut should bind all hosts instead of localhost only.

Remarks

Use this only with Port when LAN, container, or other non-loopback preview access is intentional.

Type

AppSurfaceDocsRepositoryCommand

Source

Shared repository, routing, environment, and startup-timeout options for AppSurface docs commands.

Remarks

Preview and export share these options so route and source configuration cannot drift. Preview adds listener binding options, while export keeps listener management internal and adds output/export options instead.

Method

BuildHostArgs

2 overloads
AppSurfaceDocsHostArgs BuildHostArgs(string? defaultEnvironmentName)

Translates shared CLI options into standalone AppSurface Docs host arguments.

Parameters

  • defaultEnvironmentName
    Environment to use when EnvironmentName is blank.

Returns

The repository root, forwarded host arguments, startup timeout, and resolved environment.

AppSurfaceDocsHostArgs BuildHostArgs(string? urls, int? port, bool allHosts, string? defaultEnvironmentName)

Translates shared and preview-only CLI options into standalone AppSurface Docs host arguments.

Parameters

  • urls
    Optional explicit preview URL binding.
  • port
    Optional preview port shortcut.
  • allHosts
    Whether the preview port shortcut should bind all hosts instead of localhost only.
  • defaultEnvironmentName
    Environment to use when EnvironmentName is blank.

Returns

The repository root, forwarded host arguments, startup timeout, and resolved environment.

Property

RepositoryRoot

string RepositoryRoot { get; set; } Source

Gets the repository root to harvest.

Remarks

Defaults to the current directory. Use this when running the CLI from a parent directory, script workspace, or package output folder. The value must resolve to an existing directory.

Property

StrictHarvest

bool StrictHarvest { get; } Source

Gets a value indicating whether startup should fail when every configured AppSurface Docs harvester fails.

Property

RouteRootPath

string? RouteRootPath { get; set; } Source

Gets the route-family root for AppSurface Docs version and archive routes.

Remarks

Use this when the docs route family is mounted somewhere other than /docs , for example --route-root /reference . Pair it with DocsRootPath when the live docs path should differ from archive/version routes.

Property

DocsRootPath

string? DocsRootPath { get; set; } Source

Gets the live docs root path.

Remarks

Use this to serve current docs under a nested route, for example --route-root /reference --docs-root /reference/next . Leave unset to use AppSurface Docs defaults.

Property

PublicOrigin

string? PublicOrigin { get; set; } Source

Gets the public origin used for absolute AppSurface Docs canonical metadata.

Remarks

Use this for published docs exports when the public host is known, for example --public-origin https://docs.example.com . Configure only the origin; route paths such as /docs come from RouteRootPath and DocsRootPath .

Property

EnvironmentName

string? EnvironmentName { get; set; } Source

Gets the host environment forwarded to the AppSurface Docs standalone host.

Remarks

Preview defaults to Development so the host can use deterministic per-workspace local endpoints. Export defaults to Production before starting the in-process host.

Property

StartupTimeoutSeconds

double StartupTimeoutSeconds { get; set; } Source

Gets the number of seconds to wait for the web host to start before failing fast.

Remarks

Defaults to 10 seconds. Set to 0 to disable the startup watchdog. Negative, infinite, and NaN values are rejected before the host starts.

Type

CurrentDirectoryScope

Source

Restores the previous process current directory when disposed.

Remarks

The standalone host resolves some relative paths from the current directory, so preview and export temporarily scope it to the repository root while the host runs.

Method

ChangeTo

CurrentDirectoryScope ChangeTo(string directory)

Changes the process current directory and returns a scope that restores the previous value.

Parameters

  • directory
    Directory to make current for the scope lifetime.

Returns

A disposable scope that restores the previous current directory.

Method

Dispose

void Dispose()

Restores the current directory captured when the scope was created.

Type

AppSurfaceDocsStrictRepositoryCommand

Source

Shared repository command options for AppSurface docs commands that expose strict harvest startup behavior.

Property

StrictHarvestEnabled

bool StrictHarvestEnabled { get; set; } Source

Gets or sets a value indicating whether startup should fail when every configured AppSurface Docs harvester fails.

Remarks

This is a source-harvest fail-closed gate. Static artifact validation is controlled separately by docs export --mode cdn . The option is intentionally omitted from docs verify-health , which keeps startup permissive and evaluates the health endpoint response instead.

Type

AppSurfaceDocsHostArgs

Source

Describes the AppSurface Docs host invocation produced by the CLI option translator.

Parameters

  • RepositoryRoot
    Absolute repository root that the AppSurface Docs host should harvest.
  • Args
    Command-line arguments forwarded to the standalone AppSurface Docs host.
  • StartupTimeout
    Startup watchdog timeout, or null when disabled.
  • EnvironmentName
    Resolved host environment, or null when the host should use its default.
Type

AppSurfaceDocsExportArgs

Source

Describes a one-shot AppSurface Docs static export request.

Parameters

  • HostArgs
    Standalone AppSurface Docs host arguments.
  • OutputPath
    Absolute output directory for exported files.
  • SeedRoutesPath
    Optional absolute seed-route file path.
  • InitialSeedRoutes
    Optional in-memory seed routes used when SeedRoutesPath is null.
  • Mode
    RazorWire static export mode.
  • RedirectStrategy
    Redirect alias materialization strategy carried into the RazorWire export context. ExportRedirectStrategy.Html is the command default and writes portable fallback HTML pages for source-shaped aliases. Use ExportRedirectStrategy.Netlify only with ExportMode.Cdn when publishing to Netlify or a compatible host that reads a root _redirects file; export rejects that provider strategy with ExportMode.Hybrid because the generated rules target publish-root static routes. The selected strategy affects only alias materialization after the loopback host is crawled from RequestedBaseUrl .
  • RequestedBaseUrl
    Loopback URL passed to Kestrel. The default uses port 0 so the OS chooses a free port.
  • HybridOptions
    Optional split-origin hybrid settings forwarded into the RazorWire export context.
Type

AppSurfaceDocsHealthVerifyArgs

Source

Describes a one-shot AppSurface Docs harvest-health verification request.

Parameters

  • HostArgs
    Standalone AppSurface Docs host arguments.
  • HealthJsonPath
    App-relative health JSON path represented by this verification run.
  • RequestedBaseUrl
    Loopback URL passed to Kestrel. The default uses port 0 so the OS chooses a free port.
Type

AppSurfaceDocsHealthVerificationResult

Source

Result returned by the AppSurface Docs harvest-health verification runner.

Parameters

  • Health
    Parsed health response from the docs host.
  • HttpStatusCode
    HTTP status code that the health endpoint would return for this health response.
Type

AppSurfaceDocsHealthHttpResponse

Source

Raw HTTP response returned by the AppSurface Docs harvest-health client seam.

Parameters

  • StatusCode
    HTTP status returned by the health endpoint.
  • Body
    Response body read from the health endpoint.
Type

AppSurfaceDocsCliHost

Source

Applies shared host options required by packaged AppSurface docs tooling.

Method

ConfigurePackagedToolHost

void ConfigurePackagedToolHost(WebOptions options, TimeSpan? startupTimeout)

Configures the standalone AppSurface Docs host shape used by packaged preview and export commands.

Parameters

  • options
    Web startup options to mutate.
  • startupTimeout
    Startup watchdog timeout, or null when disabled.
Method

ConfigureQuietPreviewLogging

void ConfigureQuietPreviewLogging(ILoggingBuilder logging)

Suppresses routine ASP.NET Core host lifecycle output for interactive AppSurface Docs preview runs.

Parameters

  • logging
    Logging builder for the preview host.

Remarks

The CLI prints the resolved docs URL itself after Kestrel starts, so routine messages such as Now listening on , Application started , AppSurface Web's endpoint fallback note, and routine docs harvest summaries would duplicate that command-owned status. Warnings and errors remain visible so startup and request failures are not hidden.

Type

IAppSurfaceDocsHostRunner

Source

Starts a AppSurface Docs host for CLI preview commands.

Remarks

This seam keeps command parsing and validation testable without starting a real web host. Production implementations should honor cancellation before delegating into long-running host lifetimes.

Method

RunAsync

Task RunAsync(string[] args, TimeSpan? startupTimeout, CancellationToken cancellationToken)

Runs the AppSurface Docs host with translated command-line arguments.

Parameters

  • args
    Arguments forwarded to the standalone AppSurface Docs host.
  • startupTimeout
    Startup watchdog timeout, or null to disable it.
  • cancellationToken
    Token that cancels before the host is started.

Returns

A task that completes when the host exits.

Type

IAppSurfaceDocsExportRunner

Source

Starts the AppSurface Docs host and exports it to static files.

Method

ExportAsync

Task ExportAsync(AppSurfaceDocsExportArgs args, CancellationToken cancellationToken)

Starts the docs host, runs static export, and stops the host.

Parameters

  • args
    Resolved export arguments.
  • cancellationToken
    Token observed during host startup and export.

Returns

A task that completes when export finishes.

Type

IAppSurfaceDocsHealthVerifyRunner

Source

Loads the AppSurface Docs host service graph and verifies the redacted harvest-health response.

Method

VerifyAsync

Task<AppSurfaceDocsHealthVerificationResult> VerifyAsync(AppSurfaceDocsHealthVerifyArgs args, CancellationToken cancellationToken)

Starts the docs host, reads harvest health, and stops the host.

Parameters

  • args
    Resolved verification arguments.
  • cancellationToken
    Token observed during host startup and health retrieval.

Returns

The parsed harvest-health verification result.

Type

IAppSurfaceDocsHealthHttpClient

Source

Reads the AppSurface Docs harvest-health JSON endpoint.

Method

GetAsync

Task<AppSurfaceDocsHealthHttpResponse> GetAsync(string url, CancellationToken cancellationToken)

Requests a redacted health JSON URL and returns the body regardless of success or failure HTTP status.

Parameters

  • url
    Absolute health JSON URL.
  • cancellationToken
    Token observed by the HTTP request.

Returns

The HTTP status and body.

Type

IAppSurfaceDocsHealthHostStarter

Source

Builds and starts the AppSurface Docs host used by harvest-health verification.

Method

BuildAndStartAsync

Task<IHost> BuildAndStartAsync(AppSurfaceDocsHealthVerifyArgs args, string environmentName, CancellationToken cancellationToken)

Builds the standalone docs host, starts Kestrel, and returns the started host for health verification.

Parameters

  • args
    Resolved verification arguments.
  • environmentName
    Resolved host environment.
  • cancellationToken
    Token observed while starting the host.

Returns

The started host.

Type

IRazorWireStaticExporter

Source

Adapts the RazorWire static exporter behind a small AppSurface CLI test seam.

Method

ExportAsync

Task ExportAsync(ExportContext context, CancellationToken cancellationToken)

Exports the started docs host described by context .

Parameters

  • context
    RazorWire export context.
  • cancellationToken
    Token observed by the export operation.

Returns

A task that completes when export finishes.

Type

IAppSurfaceDocsExportContextConfigurator

Source

Adds AppSurface Docs-specific export graph state after the host starts and before RazorWire crawls it.

Method

ConfigureAsync

Task ConfigureAsync(IHost host, ExportContext context, CancellationToken cancellationToken)

Configures the export context using services from the started docs host.

Parameters

  • host
    Started AppSurface Docs host.
  • context
    Export context to configure.
  • cancellationToken
    Token observed while resolving host state.

Returns

A task that completes after context configuration.

Type

AppSurfaceDocsStandaloneHostRunner

Source

Production IAppSurfaceDocsHostRunner that delegates to the standalone AppSurface Docs web host.

Remarks

Use this adapter for the packaged AppSurface CLI path. Tests should prefer fake runners so they can verify argument translation without starting Kestrel. The type is internal and sealed because callers should depend on IAppSurfaceDocsHostRunner rather than subclassing host lifetime behavior.

Type

ExceptionFilters

Source

Shared exception classification helpers used by command cleanup and best-effort diagnostics.

Method

IsNonFatal

bool IsNonFatal(Exception ex)

Determines whether an exception is safe to catch for cleanup, fallback logging, or diagnostic reporting.

Parameters

  • ex
    Exception to classify.

Returns

true when the exception is non-fatal and can be handled locally.

Type

IAppSurfaceDocsHarvestSummaryReader

Source

Reads a command-owned harvest summary from a started AppSurface Docs preview host.

Method

ReadAsync

Task<AppSurfaceDocsHarvestSummary?> ReadAsync(IHost host, CancellationToken cancellationToken)

Reads the current docs harvest summary if the started host exposes the AppSurface Docs aggregator.

Parameters

  • host
    Started preview host.
  • cancellationToken
    Token observed while waiting for the first cached docs snapshot.

Returns

A summary when available; otherwise null .

Type

AppSurfaceDocsHarvestSummary

Source

Concise harvest summary emitted by the AppSurface Docs CLI preview command.

Parameters

  • Status
    Aggregate harvest status.
  • TotalDocs
    Number of final documentation nodes in the cached snapshot.
  • TotalHarvesters
    Number of active harvesters that participated in the snapshot.
  • SuccessfulHarvesters
    Number of harvesters that completed successfully.
  • DiagnosticCount
    Number of structured harvest diagnostics in the snapshot.
Type

AppSurfaceDocsHarvestSummaryReader

Source

Production IAppSurfaceDocsHarvestSummaryReader that reads DocAggregator health.

Type

AppSurfaceDocsPreviewHostArgs

Source

Describes a preview AppSurface Docs host startup request.

Parameters

  • Args
    Arguments forwarded to the standalone AppSurface Docs host.
  • StartupTimeout
    Startup watchdog timeout, or null when disabled.
Type

IAppSurfaceDocsPreviewHostStarter

Source

Builds and starts the AppSurface Docs preview host.

Method

BuildAndStartAsync

Task<IHost> BuildAndStartAsync(AppSurfaceDocsPreviewHostArgs args, CancellationToken cancellationToken)

Builds the standalone docs host, starts Kestrel, and returns the started host for preview.

Parameters

  • args
    Resolved preview arguments.
  • cancellationToken
    Token observed while starting the host.

Returns

The started host.

Type

AppSurfaceDocsStandalonePreviewHostStarter

Source

Production IAppSurfaceDocsPreviewHostStarter that uses the AppSurface Docs standalone host builder.

Type

IAppSurfaceDocsBrowserLauncher

Source

Attempts to open the preview docs URL in the user's browser.

Method

TryOpenAsync

Task<AppSurfaceDocsBrowserLaunchResult> TryOpenAsync(Uri url, CancellationToken cancellationToken)

Attempts to open url in the user's browser without failing the preview command.

Parameters

  • url
    Absolute docs URL to open.
  • cancellationToken
    Token observed before launch.

Returns

The browser launch outcome.

Type

AppSurfaceDocsBrowserLaunchResult

Source

Describes the outcome of an attempted browser launch.

Parameters

  • Succeeded
    Whether a platform launch command was started successfully.
  • FailureReason
    User-facing failure detail when Succeeded is false .
Method

Failure

AppSurfaceDocsBrowserLaunchResult Failure(string reason)

Creates a failed browser-launch result.

Parameters

  • reason
    User-facing failure detail.

Returns

A failed browser-launch result.

Property

Success

AppSurfaceDocsBrowserLaunchResult Success { get; } Source

Gets a successful browser-launch result.

Type

SystemAppSurfaceDocsBrowserLauncher

Source

Browser launcher that uses the current operating system's conventional URL opener.

Type

IAppSurfaceDocsBrowserOpenCommandRunner

Source

Runs the platform command that asks the operating system to open a browser URL.

Method

OpenAsync

Task OpenAsync(Uri url, CancellationToken cancellationToken)

Opens the given URL with the platform opener command.

Parameters

  • url
    Absolute URL to open.
  • cancellationToken
    Token observed while starting the opener command.

Returns

A task that completes when the opener command exits.

Type

CliWrapAppSurfaceDocsBrowserOpenCommandRunner

Source

CliWrap-backed IAppSurfaceDocsBrowserOpenCommandRunner implementation.

Type

AppSurfaceDocsPreviewUrlResolver

Source

Resolves browser-facing URLs for AppSurface Docs preview hosts.

Method

ResolveRepositoryRoot

string ResolveRepositoryRoot(IReadOnlyList<string> args, string fallbackRoot)

Resolves the repository root forwarded to the standalone host.

Parameters

  • args
    Arguments forwarded to the standalone host.
  • fallbackRoot
    Fallback root used when the forwarded arguments do not contain a repository root.

Returns

The forwarded repository root when present; otherwise fallbackRoot .

Method

ResolveDefaultPreviewUrl

string? ResolveDefaultPreviewUrl(IReadOnlyList<string> args, string repositoryRoot)

Resolves the default preview listener when the CLI invocation did not configure an endpoint explicitly.

Parameters

  • args
    Arguments forwarded to the standalone host.
  • repositoryRoot
    Repository root used as the deterministic-port seed.

Returns

A localhost URL, or null when explicit endpoint configuration should win.

Method

ResolveBoundBaseUrl

2 overloads
string ResolveBoundBaseUrl(IHost host)

Resolves the browser-facing base URL from Kestrel's published server addresses.

Parameters

  • host
    Started host that exposes Kestrel server addresses.

Returns

The scheme and authority that should be opened in the browser.

string ResolveBoundBaseUrl(ICollection<string>? addresses)

Resolves the browser-facing base URL from Kestrel's published server addresses.

Parameters

  • addresses
    Published server addresses.

Returns

The scheme and authority that should be opened in the browser.

Method

ResolveDocsUrl

Uri ResolveDocsUrl(string baseUrl, IReadOnlyList<string> args)

Combines the bound host base URL with the configured AppSurface Docs root path.

Parameters

  • baseUrl
    Bound host base URL.
  • args
    Arguments forwarded to the standalone host.

Returns

The absolute docs page URL to open.

Type

AppSurfaceDocsInProcessExportRunner

Source

Production export runner that starts the standalone AppSurface Docs host in-process and exports it over real loopback HTTP.

Method

ResolveBoundBaseUrl

2 overloads
string ResolveBoundBaseUrl(IHost host)

Resolves the single bound loopback base URL published by the started export host.

Parameters

  • host
    Started host that exposes Kestrel server addresses.

Returns

The scheme and authority used by the export crawler.

Exceptions

  • InvalidOperationException
    Thrown when the host does not publish exactly one valid loopback URL.
string ResolveBoundBaseUrl(ICollection<string>? addresses)

Resolves the crawler base URL from a Kestrel address collection.

Parameters

  • addresses
    Published server addresses.

Returns

The absolute URL authority to crawl.

Exceptions

  • InvalidOperationException
    Thrown when no URL, multiple URLs, an invalid URL, or a non-loopback URL is published.
Method

BuildAndStartHostWithTimeoutAsync

Task<IHost> BuildAndStartHostWithTimeoutAsync(AppSurfaceDocsExportArgs args, string environmentName, CancellationToken cancellationToken)

Builds and starts the docs host while enforcing the configured startup watchdog.

Parameters

  • args
    Resolved export arguments.
  • environmentName
    Environment name applied to the standalone host.
  • cancellationToken
    External cancellation token for the export operation.

Returns

The started host.

Exceptions

  • TimeoutException
    Thrown when the host does not start before the startup timeout.
Method

CreateStartupTimeout

StartupTimeoutCancellationLease CreateStartupTimeout(TimeSpan startupTimeout, CancellationToken cancellationToken)

Creates the linked cancellation source used to distinguish startup timeout from external cancellation.

Parameters

  • startupTimeout
    Startup timeout to enforce.
  • cancellationToken
    External cancellation token to link.

Returns

A disposable lease for the linked startup cancellation source.

Method

ObserveTimedOutStartupTask

void ObserveTimedOutStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)

Observes a startup task that outlived the configured timeout so late completion can stop or log the host.

Parameters

  • startTask
    Background startup task to observe.
  • startupTimeoutCts
    Cancellation source transferred from the timeout branch.
Method

ObserveCanceledStartupTask

void ObserveCanceledStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)

Observes a startup task that outlived external cancellation so late completion can stop or log the host.

Parameters

  • startTask
    Background startup task to observe.
  • startupTimeoutCts
    Cancellation source transferred from the external cancellation branch.
Method

ObserveStartupTaskAsync

Task ObserveStartupTaskAsync(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts, string lateCompletionMessage)

Awaits a late startup task and disposes the host if startup eventually succeeds.

Parameters

  • startTask
    Background startup task to observe.
  • startupTimeoutCts
    Cancellation source owned by the observation task.
  • lateCompletionMessage
    Debug message used when late startup faults.

Returns

A task that completes after the late startup task is observed.

Method

CreateStartupTimeoutException

TimeoutException CreateStartupTimeoutException(TimeSpan startupTimeout, Exception? innerException)

Creates the user-facing timeout exception for a host that failed to start in time.

Parameters

  • startupTimeout
    Timeout that elapsed.
  • innerException
    Optional cancellation exception that came from the startup token.

Returns

The timeout exception reported to command execution.

Method

StopAndDisposeHostAsync

Task StopAndDisposeHostAsync(IHost host)

Stops the export host and always disposes it, logging non-fatal shutdown failures.

Parameters

  • host
    Host to stop and dispose.

Returns

A task that completes after shutdown and disposal.

Type

StartupTimeoutCancellationLease

Source

Owns a startup cancellation source until timeout observation needs to transfer that ownership.

Method

CancelAsync

Task CancelAsync()

Requests cancellation of the owned startup cancellation source.

Returns

A task that completes after cancellation callbacks have run.

Method

Transfer

CancellationTokenSource Transfer()

Transfers cancellation source ownership to a late-startup observer.

Returns

The owned cancellation source.

Method

Dispose

void Dispose()

Disposes the owned cancellation source unless ownership has been transferred.

Property

Token

CancellationToken Token { get; } Source

Gets the token exposed by the owned startup cancellation source.

Type

AppSurfaceDocsHealthHttpClient

Source

Production harvest-health HTTP client used by AppSurfaceDocsInProcessHealthVerifyRunner .

Type

AppSurfaceDocsStandaloneHealthHostStarter

Source

Production IAppSurfaceDocsHealthHostStarter that uses the AppSurface Docs standalone host builder.

Type

FixedEnvironmentProvider

Source

Provides a fixed environment name to the standalone host builder during health verification startup.

Method

GetEnvironmentVariable

string? GetEnvironmentVariable(string name, string? defaultValue = null)

Gets environment variable values while overriding ASP.NET and .NET environment variables.

Parameters

  • name
    Environment variable name.
  • defaultValue
    Fallback value when the variable is not set.

Returns

The fixed host environment for environment-name variables, otherwise the process value or fallback.

Property

Environment

string Environment { get; } Source

Gets the fixed environment name.

Property

IsDevelopment

bool IsDevelopment { get; } Source

Gets a value indicating whether the fixed environment is Development.

Type

AppSurfaceDocsInProcessHealthVerifyRunner

Source

Starts AppSurface Docs in-process and verifies the redacted harvest-health response over loopback HTTP.

Type

AppSurfaceDocsExportContextConfigurator

Source

Default AppSurface Docs export configurator that publishes docs route aliases into RazorWire's export graph and captures the frozen route manifest alongside the static output.

Type

NoOpAppSurfaceDocsExportContextConfigurator

Source

Test-seam configurator used when unit tests provide a fake host that does not contain AppSurface Docs services.

Type

IAppSurfaceDocsExportHostStarter

Source

Builds and starts the in-process AppSurface Docs export host.

Method

BuildAndStartAsync

Task<IHost> BuildAndStartAsync(AppSurfaceDocsExportArgs args, string environmentName, CancellationToken cancellationToken)

Builds the standalone docs host, starts Kestrel, and returns the started host for export.

Parameters

  • args
    Resolved export arguments.
  • environmentName
    Resolved host environment.
  • cancellationToken
    Token observed while starting the host.

Returns

The started host.

Type

AppSurfaceDocsStandaloneExportHostStarter

Source

Production IAppSurfaceDocsExportHostStarter that uses the AppSurface Docs standalone host builder.

Type

FixedEnvironmentProvider

Source

Provides a fixed environment name to the standalone host builder during export startup.

Method

GetEnvironmentVariable

string? GetEnvironmentVariable(string name, string? defaultValue = null)

Gets environment variable values while overriding ASP.NET and .NET environment variables.

Parameters

  • name
    Environment variable name.
  • defaultValue
    Fallback value when the variable is not set.

Returns

The fixed host environment for environment-name variables, otherwise the process value or fallback.

Property

Environment

string Environment { get; } Source

Gets the fixed environment name.

Property

IsDevelopment

bool IsDevelopment { get; } Source

Gets a value indicating whether the fixed environment is Development.

Type

RazorWireExportEngineAdapter

Source

Production IRazorWireStaticExporter that delegates to RazorWire's ExportEngine .

Type

PwaVerifyCommand

Source

Verifies that a running web app exposes AppSurface-compatible PWA install or push-readiness evidence.

Property

Url

string? Url { get; set; } Source

Gets the app origin or URL to verify.

Property

BaseUrl

string? BaseUrl { get; set; } Source

Gets the app base URL to verify.

Property

EntryPath

string EntryPath { get; set; } Source

Gets the app-root-relative entry path whose HTML should expose the manifest link or push registration helper.

Property

Surface

string Surface { get; set; } Source

Gets the verification surface. Install retains the schema-v2 default contract.

Property

ExpectedPush

string? ExpectedPush { get; set; } Source

Gets the expected server-known push posture for push or all verification.

Property

DiagnosticsPath

string? DiagnosticsPath { get; set; } Source

Gets the app-root-relative PWA diagnostics base path.

Property

ExpectedStartUrl

string? ExpectedStartUrl { get; set; } Source

Gets the expected manifest start_url value.

Property

ExpectedScope

string? ExpectedScope { get; set; } Source

Gets the expected manifest scope value.

Property

ExpectedDisplay

string? ExpectedDisplay { get; set; } Source

Gets the expected manifest display mode.

Property

ExpectedThemeColor

string? ExpectedThemeColor { get; set; } Source

Gets the expected manifest theme_color value.

Property

ExpectedBackgroundColor

string? ExpectedBackgroundColor { get; set; } Source

Gets the expected manifest background_color value.

Property

ExpectedIcons

string[] ExpectedIcons { get; set; } Source

Gets expected icon size tokens, optionally followed by a purpose after a colon.

Property

Json

bool Json { get; set; } Source

Gets a value indicating whether machine-readable JSON should be written.

Type

PwaVerifier

Source
Method

VerifySurfaceAsync

Task<PwaVerificationV3Report> VerifySurfaceAsync(PwaVerificationOptions options, CancellationToken cancellationToken)

Verifies the additive schema-v3 push or combined readiness surface without modifying the default install path.

Type

IPwaVerificationHttpClient

Source

Fetches verifier resources without automatically following redirects.

Remarks

Redirect custody stays with PwaVerifier so origin and path-base boundaries are checked before each hop.

Method

GetAsync

Task<PwaHttpResponse> GetAsync(Uri uri, int maxBodyBytes, CancellationToken cancellationToken)

Fetches one response and reads no more than the requested body limit.

Parameters

  • uri
    The absolute resource URI.
  • maxBodyBytes
    The maximum response-body bytes retained for evidence.
  • cancellationToken
    Cancels the network request and bounded body read.

Returns

The response metadata and bounded body.

Type

PwaVerificationHttpClient

Source

Adapts HttpClient to the verifier's bounded, redirect-aware fetch contract.

Parameters

  • httpClient
    A client configured with automatic redirect handling disabled.

Remarks

Enabling automatic redirects bypasses the verifier's same-origin and path-base checks.

Type

PwaHttpResponse

Source

Captures one bounded HTTP response before verifier-managed redirect handling.

Parameters

  • StatusCode
    The actual server status code.
  • ContentType
    The response media type, or an empty string when absent.
  • BodyBytes
    The retained response bytes, capped by the requested read limit.
  • RedirectLocation
    The unmodified Location header value, when present.
  • BodyTruncated
    Whether bytes beyond the configured read limit were discarded.
  • Headers
    Only the three response-header observations required by strict push verification, preserving duplicate values.
Method

HeaderValues

IReadOnlyList<string> HeaderValues(string name)

Gets bounded captured values for one strict-verification response header.

Property

IsSuccess

bool IsSuccess { get; } Source

Gets whether the actual response status is in the HTTP 2xx range.

Property

Body

string Body { get; } Source

Gets the retained body decoded as UTF-8 text.

Remarks

Binary consumers should use BodyBytes instead.

Type

PwaVerificationReport

Source

Represents schema-versioned PWA verification evidence written by the CLI.

Parameters

  • SchemaVersion
    The JSON evidence schema version.
  • Passed
    Whether no error-severity diagnostics were recorded.
  • Origin
    The verified scheme, host, and port without a path base.
  • BaseUrl
    The verified application root, including its path base.
  • EntryPath
    The app-root-relative entry path supplied to the verifier.
  • EntryUrl
    The absolute entry URL resolved under BaseUrl .
  • ManifestPath
    The app-origin-relative manifest path discovered or probed.
  • StartUrl
    The manifest start_url value, when parsed.
  • Scope
    The manifest scope value, when parsed.
  • Display
    The manifest display value, when parsed.
  • ThemeColor
    The manifest theme_color value, when parsed.
  • BackgroundColor
    The manifest background_color value, when parsed.
  • Icons
    Bounded fetch and dimension evidence for manifest icons.
  • Diagnostics
    Stable diagnostics supporting the pass or failure result.

Remarks

Consumers should branch on SchemaVersion and diagnostic codes instead of parsing human-readable messages.

Type

PwaVerificationV3Report

Source

Represents the schema-v3 report used only for explicitly requested push or combined PWA readiness verification.

Type

PwaInstallEvidence

Source

Captures install observations embedded in a schema-v3 combined report.

Type

PwaPushEvidence

Source

Captures only server-known, privacy-safe push-readiness evidence.

Type

PwaWorkerEvidence

Source

Captures bounded shared-worker fetch evidence.

Type

PwaRegistrationHelperEvidence

Source

Captures bounded registration-helper discovery and fetch evidence.

Type

PwaVapidEvidence

Source

Captures the safe VAPID identity contributed by the optional Push package.

Type

PwaPushVerificationResult

Source

Pairs schema-v3 push evidence with diagnostics collected while verifying it.

Parameters

  • Evidence
    The bounded server-known push evidence.
  • Diagnostics
    Diagnostics emitted while collecting the evidence.
Type

PwaNormalizedPushReadiness

Source

Holds validated readiness evidence or the sanitized unavailable state.

Parameters

  • ConfigurationStatus
    The configured, not-configured, or unavailable readiness state.
  • ActiveVapidKeyId
    The safe active VAPID key identifier, when configured.
  • PublicKeyFingerprint
    The safe SHA-256 public-key fingerprint, when configured.
  • RouteMapped
    Whether the package-owned route is mapped, or null when not evaluated.
Property

Unavailable

PwaNormalizedPushReadiness Unavailable { get; } Source

Gets the fixed redacted result used when readiness evidence cannot be trusted.

Type

PwaVerificationDiagnostic

Source

Represents one stable, structured PWA verification observation.

Parameters

  • Code
    The stable ASPWA2xx identifier.
  • Severity
    The lowercase error, warning, or info token.
  • Message
    A human-readable explanation.
  • Subject
    The bounded manifest field or verifier surface involved.
  • Expected
    The expected bounded value, when applicable.
  • Actual
    The observed redacted value, when applicable.
  • Fix
    A concise remediation, when known.
  • DocsUrl
    Canonical documentation for the diagnostic, when available.

Remarks

Do not place query strings, fragments, response bodies, or other secrets in structured evidence.

Type

PwaVerificationTarget

Source

Normalizes the trusted origin, application path base, and real entry route used by one verification run.

Parameters

  • Origin
    The scheme, host, and port boundary.
  • BaseUri
    The application root including its normalized path base.
  • BasePath
    The normalized path base ending in a slash.
  • EntryPath
    The validated app-root-relative entry path.
  • EntryUri
    The entry path resolved beneath BaseUri .

Remarks

Query strings and fragments belong in neither the base URL nor entry path because verifier evidence intentionally excludes them.

Method

Create

PwaVerificationTarget Create(Uri url, string entryPath = "/")

Creates a normalized verification target after enforcing the URL and entry-path boundaries.

Parameters

  • url
    An absolute HTTP or HTTPS application root without a query or fragment.
  • entryPath
    An app-root-relative path without traversal, query, fragment, or absolute URL syntax.

Returns

The normalized target used for all verifier requests.

Exceptions

  • ArgumentException
    The URL or entry path violates a verifier boundary.
Type

PwaVerificationOptions

Source

Carries normalized CLI assertions into a PWA verification run.

Parameters

  • BaseUrl
    The absolute app root to verify.
  • EntryPath
    The app-root-relative HTML entry route.
  • ExpectedStartUrl
    An optional exact manifest start_url assertion.
  • ExpectedScope
    An optional exact manifest scope assertion.
  • ExpectedDisplay
    An optional exact manifest display assertion.
  • ExpectedThemeColor
    An optional exact manifest theme_color assertion.
  • ExpectedBackgroundColor
    An optional exact manifest background_color assertion.
  • ExpectedIcons
    Parsed icon size and purpose assertions.
  • Surface
    The requested public verification surface.
  • ExpectedPush
    The expected server-known push posture for schema-v3 surfaces.
  • DiagnosticsPath
    The normalized app-root-relative PWA diagnostics base path.

Remarks

Target safety is enforced by PwaVerificationTarget.Create(Uri, string) before network access.

Method

Create

PwaVerificationOptions Create(Uri baseUrl, string entryPath = "/", string? expectedStartUrl = null, string? expectedScope = null, string? expectedDisplay = null, string? expectedThemeColor = null, string? expectedBackgroundColor = null, IReadOnlyList<string>? expectedIcons = null, string? surface = null, string? expectedPush = null, string? diagnosticsPath = null)

Creates verification options and parses repeated icon assertions.

Parameters

  • baseUrl
    The absolute app root to verify.
  • entryPath
    The app-root-relative entry route; blank values normalize to root.
  • expectedStartUrl
    An optional exact start_url assertion.
  • expectedScope
    An optional exact scope assertion.
  • expectedDisplay
    An optional exact display assertion.
  • expectedThemeColor
    An optional exact theme_color assertion.
  • expectedBackgroundColor
    An optional exact background_color assertion.
  • expectedIcons
    Repeated WIDTHxHEIGHT or WIDTHxHEIGHT:purpose assertions.
  • surface
    Install (default), push, or all.
  • expectedPush
    Enabled (default) or disabled for push/all surfaces.
  • diagnosticsPath
    The app-root-relative PWA diagnostics base path.

Returns

Normalized options for PwaVerifier .

Exceptions

  • ArgumentException
    An icon assertion is malformed.
Type

PwaVerificationSurfaceParser

Source

Parses the accepted install, push, and all PWA verification surface values.

Method

Parse

PwaVerificationSurface Parse(string? value)

Parses an optional PWA verification surface value.

Parameters

  • value
    An optional install, push, or all value.

Returns

The parsed surface; a missing value selects install.

Exceptions

  • ArgumentException
    The value is not install, push, or all.
Type

PwaExpectedPushParser

Source

Parses the accepted enabled and disabled push-expectation values.

Method

Parse

PwaExpectedPush Parse(string? value)

Parses an optional expected push posture value.

Parameters

  • value
    An optional enabled or disabled value.

Returns

The parsed posture; a missing value selects enabled.

Exceptions

  • ArgumentException
    The value is not enabled or disabled.
Type

PwaExpectedIcon

Source

Represents one explicit manifest icon size and optional purpose assertion.

Parameters

  • Size
    A positive WIDTHxHEIGHT token.
  • Purpose
    An optional manifest purpose token such as maskable.
Method

Parse

PwaExpectedIcon Parse(string value)

Parses a command-line icon assertion.

Parameters

  • value
    WIDTHxHEIGHT or WIDTHxHEIGHT:purpose.

Returns

The parsed assertion.

Exceptions

  • ArgumentException
    The size or purpose token is malformed.
Method

ToString

string ToString()

Formats the assertion using its command-line token shape.

Returns

WIDTHxHEIGHT or WIDTHxHEIGHT:purpose.

Type

PwaFetchedResponse

Source

Captures the final verifier-managed fetch state after zero or more accepted redirects.

Parameters

  • FinalUri
    The URI that produced Response .
  • Response
    The actual final response without fabricated sentinel status codes.
  • RedirectLimitExceeded
    Whether this response was an unfollowed redirect beyond the hop limit.

Remarks

Callers must not reinterpret Response as a terminal HTTP failure when RedirectLimitExceeded is true; ASPWA264 is the authoritative failure.

Method

HeaderValues

IReadOnlyList<string> HeaderValues(string name)

Gets bounded captured values for one strict-verification response header.

Property

StatusCode

HttpStatusCode StatusCode { get; } Source

Gets the actual final response status code.

Property

ContentType

string ContentType { get; } Source

Gets the actual final response media type.

Property

Body

string Body { get; } Source

Gets the retained final response body decoded as UTF-8.

Property

BodyBytes

byte[] BodyBytes { get; } Source

Gets the retained final response bytes.

Property

IsSuccess

bool IsSuccess { get; } Source

Gets whether the actual final response is in the HTTP 2xx range.

Type

PwaImageDimensions

Source

Represents dimensions decoded directly from a bounded PNG response.

Parameters

  • Width
    The positive pixel width.
  • Height
    The positive pixel height.
Type

PwaIconEvidence

Source

Represents privacy-safe fetch and optional PNG dimension evidence for one manifest icon.

Parameters

  • Source
    The manifest src value.
  • Sizes
    The manifest sizes token list.
  • Type
    The declared media type.
  • Purpose
    The declared purpose token list.
  • Path
    The fetched app-origin-relative path without query or fragment.
  • ContentType
    The observed response media type.
  • Width
    The decoded PNG width, when available.
  • Height
    The decoded PNG height, when available.
  • Fetched
    Whether the icon returned an HTTP 2xx response.
Type

PwaManifestProbe

Source

Models the manifest fields required for install-readiness verification.

Parameters

  • Name
    The manifest name.
  • ShortName
    The manifest short_name.
  • StartUrl
    The manifest start_url.
  • Scope
    The manifest scope.
  • Display
    The manifest display mode.
  • ThemeColor
    The manifest theme_color.
  • BackgroundColor
    The manifest background_color.
  • Icons
    The manifest icon declarations.
Type

PwaIconProbe

Source

Models one manifest icon declaration without trusting it as fetched evidence.

Parameters

  • Source
    The manifest src value.
  • Sizes
    The space-delimited manifest sizes tokens.
  • Type
    The declared media type.
  • Purpose
    The space-delimited manifest purpose tokens.
Type

PwaStatusProbe

Source

Models the server-known AppSurface PWA diagnostics used for install, worker, offline, and push posture checks.

Parameters

  • Enabled
    Whether AppSurface PWA metadata is enabled.
  • OfflineEnabled
    Whether the offline strategy is enabled.
  • ServiceWorkerPath
    The active service-worker path when offline is enabled.
  • OfflineFallbackPath
    The active offline fallback path when offline is enabled.
  • ConfiguredServiceWorkerPath
    The configured worker path used to prove absence when offline is disabled.
  • WorkerEnabled
    Whether either offline or push configuration activates the shared service worker.
  • WorkerPath
    The active shared service-worker path when a worker capability is enabled.
  • PushEnabled
    Whether push event handling is enabled in the shared service worker.
  • WorkerScope
    The effective registration scope for the shared service worker.
  • RegistrationHelperPath
    The registration-helper path exposed when push is enabled.
  • PushReadiness
    The additive schema-versioned safe readiness contribution, when supported by the server.

Remarks

These server-known values do not prove browser runtime capability or registration state.

Type

PwaPushReadinessProbe

Source

Models the versioned, sanitized push-readiness source object emitted by current Web servers.

Type

CoverageCleanCommand

Source

Previews or explicitly removes stale AppSurface coverage artifacts.

Remarks

Without --all , this command uses the AppSurface coverage ownership marker to remove only known artifacts from the selected coverage output directory. --all is an intentional broader maintenance operation that scans a worktree for every directory named TestResults . Both modes preview by default and require --apply before changing the filesystem.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)

Executes the cleanup with an explicit cancellation token.

Parameters

  • console
    Console used for user-visible output.
  • cancellationToken
    Cancellation token observed during filesystem traversal.

Returns

A task that completes after the preview or deletion summary is written.

Property

OutputDirectory

string? OutputDirectory { get; set; } Source

Gets or sets the AppSurface coverage output directory cleaned by the default mode.

Property

All

bool All { get; set; } Source

Gets or sets a value indicating whether every descendant TestResults directory should be included.

Remarks

This is broader than the default ownership-marker mode. It is intended for reclaiming disk space from a bounded local worktree and honors RootDirectory .

Property

RootDirectory

string? RootDirectory { get; set; } Source

Gets or sets the scan root used only by --all .

Property

Apply

bool Apply { get; set; } Source

Gets or sets a value indicating whether the previewed artifacts may be deleted.

Type

EvidenceCommand

Source

Provides the discoverable root for AppSurface EvidenceHost commands.

Type

EvidenceInitCommand

Source

Creates a marked, non-overwriting EvidenceHost starter for an existing repository.

Property

RootPath

string RootPath { get; set; } Source

Gets or sets the destination directory for generated starter files.

Property

Force

bool Force { get; set; } Source

Gets or sets a value indicating whether an existing marked starter may be replaced.

Property

Sample

bool Sample { get; set; } Source

Gets or sets a value indicating whether to generate the supported v1 sample.

Type

EvidenceDoctorCommand

Source

Checks selected EvidenceHost prerequisites without provisioning resources or executing tests.

Type

EvidenceExplainCommand

Source

Resolves a policy and explicit diff into a plan without starting resources or executing producers.

Property

OutputDirectory

string OutputDirectory { get; set; } Source

Gets or sets the output directory for plan and summary artifacts.

Type

EvidenceRunCommand

Source

Executes the selected built-in evidence producer and emits a truthful manifest.

Property

OutputDirectory

string OutputDirectory { get; set; } Source

Gets or sets the output directory for plan, manifest, and producer artifacts.

Property

SolutionPath

string? SolutionPath { get; set; } Source

Gets or sets the solution supplied to the in-process coverage producer.

Property

ObservationOnly

bool ObservationOnly { get; set; } Source

Gets or sets a value indicating whether the run is informative only and cannot satisfy a gate.

Type

EvidenceVerifyCommand

Source

Verifies that an immutable evidence manifest binds to its resolved plan without rerunning producers.

Property

ManifestPath

string ManifestPath { get; set; } Source

Gets or sets the manifest path to verify.

Property

PlanPath

string? PlanPath { get; set; } Source

Gets or sets the resolved plan path. Defaults next to the manifest.

Type

EvidencePlanningCommandBase

Source

Provides shared policy and diff options for non-mutating and execution EvidenceHost commands.

Method

CreatePlanningRequest

EvidencePlanningRequest CreatePlanningRequest()

Creates the explicit policy-and-diff input consumed by a planning operation.

Property

Workflow

EvidenceCliWorkflow Workflow { get; } Source

Gets the policy-planning workflow shared by derived EvidenceHost commands.

Property

PolicyPath

string PolicyPath { get; set; } Source

Gets or sets the checked-in evidence policy path.

Property

Paths

string[] Paths { get; set; } Source

Gets or sets explicit changed repository-relative paths. Repeat for multiple paths.

Property

DiffFile

string? DiffFile { get; set; } Source

Gets or sets an optional unified diff used to derive changed paths.

Type

SecretsTransferCommand

Source

Provides the discoverable root for declared, value-safe secret-transfer commands.

Type

SecretsTransferPlanCommand

Source

Creates a value-free transfer plan for one declared endpoint job.

Type

SecretsTransferApplyCommand

Source

Applies one previously-created and still-valid secret-transfer plan.

Type

AppSurfaceCliApp

Source

Provides the DI-backed execution runtime for AppSurface CLI commands.

Remarks

This internal runtime exists so the top-level tool entry point stays thin while command discovery, dependency registration, logging defaults, and CliFx execution stay testable. It discovers commands from the AppSurface CLI entry assembly, applies module and caller-provided service registrations, temporarily assigns CommandService.PrimaryServiceProvider for constructor-injected command dependencies, and always restores the previous provider after command execution.

Method

RunAsync

Task RunAsync(string[] args, Action<ConsoleOptions>? configureOptions = null)

Runs the AppSurface CLI with the provided command-line arguments.

Parameters

  • args
    Command-line arguments to parse and execute.
  • configureOptions
    Optional callback that customizes ConsoleOptions before execution. Defaults start from ConsoleOptions.Default with ConsoleOutputMode.CommandFirst so command output remains the primary console experience.

Returns

A task that completes when the selected command finishes.

Remarks

Use this seam from process entry points and tests that need the real command pipeline without shelling out. The method builds and disposes a fresh service provider for each run, registers AppSurface CLI defaults, then applies custom registrations last so tests or future host integrations can replace defaults intentionally.

Method

RestoreCoverageTestArguments

string[] RestoreCoverageTestArguments(string[] arguments)

Restores the literal test tokens bound through this invocation's opaque placeholders.

Parameters

  • arguments
    CliFx-bound test argument tokens in order.

Returns

The original literal tokens, or the input when no normalization map is active.

Method

AddExportEngineServices

void AddExportEngineServices(IServiceCollection services)

Registers the RazorWire export engine dependencies used by AppSurface-owned export commands.

Parameters

  • services
    The service collection to populate.

Remarks

The named ExportEngine HTTP client disables automatic redirects so artifact-producing requests are surfaced to ExportEngine . The engine then applies its explicit redirect boundary checks before reading or writing redirected response bodies, while source and readiness probes continue to treat surfaced HTTP redirect responses as evidence that an app endpoint is reachable.

Method

AddPwaVerifierServices

void AddPwaVerifierServices(IServiceCollection services)

Registers the HTTP client used by appsurface pwa verify .

Parameters

  • services
    The service collection to populate.

Remarks

Automatic redirects are disabled so the verifier observes the requested manifest, icon, diagnostics, and offline fallback URLs directly. That keeps the verifier's same-origin and base-path checks authoritative instead of letting HttpClient silently follow a redirect outside the app being verified.

Method

AddCoverageServices

void AddCoverageServices(IServiceCollection services)

Registers the shared coverage core and its CLI and Evidence adapters.

Parameters

  • services
    Service collection receiving the coverage command and Evidence registrations.

Remarks

The conditionally linked coverage sources compile only into the private core. Public coverage commands use CLI-only presentation adapters at their boundary, while the first-party Evidence producer composes the same private-core services in process. Registering one shared graph preserves identical collection, merge, gate, and watchdog behavior for both entry points without duplicate service descriptors.

Method

AddCanaryPollingServices

void AddCanaryPollingServices(IServiceCollection services)

Registers the named-canary polling HTTP and delay services.

Parameters

  • services
    The service collection to populate.

Remarks

The polling workflow owns all visible attempt and deadline behavior, so this client disables redirects and has no client-level timeout. Each workflow dispatch receives its own linked per-attempt token instead.

Type

CoverageRunNormalizedArguments

Source

The CliFx-safe argv and immutable per-invocation map back to literal test tokens.

Parameters

  • Arguments
    Arguments passed to CliFx after option-value normalization.
  • RestoreValues
    Opaque placeholder to caller token map.
Type

CoverageRunArgumentBinding

Source

Normalizes only the registered coverage run command's literal test option values.

Method

Normalize

CoverageRunNormalizedArguments Normalize(string[] arguments)

Replaces split and joined --test-argument values with opaque CliFx-safe tokens.

Parameters

  • arguments
    The unmodified command-line token array.

Returns

CliFx input plus a map for restoration after binding.

Remarks

A split option consumes exactly its next token, even if that token begins with a dash.

Type

CloudRunExecutionOutput

Source

Owns one result's serialization, write, flush and exit decision.

Remarks

Delivery failure is latched: no catch or cancellation path writes a second object or diagnostic.

Type

CloudRunExecutionEnvelope

Source

Versioned safe serialization shape; provider free text is never a member.

Type

DurableDoctorService

Source

Owns a nonpooled physical session and one fenced, read-only repeatable-read doctor snapshot.

Remarks

One monotonic budget reserves min(2s, timeout/5) for rollback, unlock and physical disposal. The original caller token remains distinct from that deadline. A terminal outcome discards every database fact. The stage seam is internal and production composition supplies no observer. It never starts background work. See the doctor reference and the separate complete-manifest deployment preflight.

Method

CreateSessionSettings

NpgsqlConnectionStringBuilder CreateSessionSettings(string connectionString, TimeSpan workTimeout)

Applies dedicated-session settings without extending shorter configured driver waits.

Method

ClassifyFailure

DurableDoctorFailureException ClassifyFailure(Exception exception, CancellationToken caller, bool deadlineExpired, CancellationToken ownedToken = default)

Retains caller/deadline provenance and the provider's propagate-by-default allowlist.

Method

ReadRuntimeAsync

ValueTask<DurableDoctorObservation> ReadRuntimeAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, DurableDoctorRequest request, DurableRuntimeSchemaStatus schema, IReadOnlyList<string> credential, IReadOnlyList<string> retention, TimeSpan remaining, CancellationToken token)

Captures one database clock and exact selected row, then checks agreement with the authoritative schema reader.

Type

DurableDoctorBudget

Source

Single monotonic deadline; remaining budgets shrink across every stage including cleanup.

Type

CoverageGithubSummaryWriter

Source

Appends the bounded coverage-gate Markdown artifact to a GitHub Actions step summary.

Remarks

This is command presentation, not coverage evaluation. The coverage core writes the owned Markdown artifact; this CLI adapter reads that artifact only when the public --github-summary behavior is enabled.

Method

AppendAsync

Task AppendAsync(string? githubStepSummaryPath, string markdownReportPath, CancellationToken cancellationToken)

Appends the supplied Markdown artifact when GitHub provided a summary path.

Type

CoverageRunOutputLease

Source

Holds the filesystem objects that lead to a coverage output directory while ownership is inspected and the directory is prepared. The lease prevents pathname validation from being separated from mutation by an ancestor rename or link replacement.

Method

Acquire

CoverageRunOutputLease Acquire(string outputPath, Func<int, uint, int>? unixFChmod = null, Func<int, string, int, int>? unixUnlinkAt = null)

Independently opens or creates every output-path component without following links.

Parameters

  • outputPath
    Absolute output directory path.
  • unixFChmod
    Optional Unix permission operation used to verify marker-creation failures.
  • unixUnlinkAt
    Optional Unix unlink operation used to verify staged-artifact cleanup failures.

Returns

A lease retaining every opened component until disposal.

Method

AcquireExisting

CoverageRunOutputLease? AcquireExisting(string outputPath)

Independently opens every existing output-path component without creating a missing directory.

Parameters

  • outputPath
    Absolute output directory path.

Returns

A retained lease, or null when the output directory does not exist.

Remarks

This is used by explicit coverage cleanup so a preview or cleanup of a missing output never creates an empty TestResults directory. Existing components are still opened without following links.

Method

ValidateExisting

void ValidateExisting(string outputPath)

Validates the existing path and output ownership without creating missing components.

Parameters

  • outputPath
    Absolute output directory path.
Method

Prepare

void Prepare(bool clean, Action? beforeMutation, Action? beforeCleanup)

Revalidates ownership, optionally removes known artifacts, and creates the marker and projects directory through the retained output object.

Parameters

  • clean
    Whether known artifacts should be removed.
  • beforeMutation
    Optional test seam called after acquisition and before mutation.
  • beforeCleanup
    Optional test seam called after authorization revalidation and before cleanup.
Method

CleanKnownOwnedArtifacts

CoverageOwnedCleanupPlan CleanKnownOwnedArtifacts(bool apply)

Returns AppSurface-owned entries that an explicit coverage clean operation may remove and, when requested, deletes them through this retained output-directory lease.

Parameters

  • apply
    Whether the known entries should be deleted after validation.

Returns

A marker-ownership result and the relative entries selected for cleanup.

Remarks

The method neither creates an ownership marker nor creates the projects directory. An empty unmarked directory therefore remains a no-op, while a populated unmarked directory still fails closed through ValidateOwnedTree .

Method

ValidateOwnedGateArtifacts

void ValidateOwnedGateArtifacts(IReadOnlyList<string> artifactNames)

Validates that each named gate artifact is either absent or a regular file in the retained output directory.

Parameters

  • artifactNames
    Owned gate artifact filenames to validate.
Method

WriteOwnedGateArtifactAsync

Task WriteOwnedGateArtifactAsync(string artifactName, string contents, CancellationToken cancellationToken)

Writes one owned gate artifact through the retained output directory.

Parameters

  • artifactName
    Owned gate artifact filename.
  • contents
    Complete UTF-8 artifact content.
  • cancellationToken
    Cancellation token for the artifact content write.

Returns

A task that completes after the complete artifact content is committed.

Remarks

The content is staged privately before promotion so cancellation or a write failure leaves a pre-existing report intact.

Method

DeleteOwnedGateArtifact

void DeleteOwnedGateArtifact(string artifactName)

Removes one owned gate artifact through the retained output directory when it exists.

Parameters

  • artifactName
    Owned gate artifact filename.
Method

NormalizePlatformPath

string NormalizePlatformPath(string path)

Canonicalizes fixed operating-system aliases before safety comparisons and no-follow traversal.

Parameters

  • path
    An absolute platform path.

Returns

The path with only fixed operating-system aliases canonicalized.

Type

ReleaseComposeCommand

Source

Composes independently authored release-note entries into a Markdown document.

Remarks

Entries live in a flat, filename-sorted directory, so feature branches do not contend for the same changelog or living-note lines. The command validates every entry and template marker, rebases relative Markdown links for the selected output, previews by default, and writes only when both --output and --apply are supplied. It composes a note; release-specific versioning, changelog rollover, entry consumption, and publication remain the responsibility of the caller's release workflow.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)

Executes composition with an explicit cancellation token.

Parameters

  • console
    Console receiving the validation summary and composed Markdown.
  • cancellationToken
    Token observed while reading entry files and writing output.

Returns

A task that completes after the preview or write result is reported.

Property

RootDirectory

string? RootDirectory { get; set; } Source

Gets or sets the project root that bounds the template, entries, and optional output paths.

Property

EntriesDirectory

string? EntriesDirectory { get; set; } Source

Gets or sets the flat directory containing append-only entry files.

Property

TemplatePath

string? TemplatePath { get; set; } Source

Gets or sets the Markdown template that declares the entry sections.

Property

OutputPath

string? OutputPath { get; set; } Source

Gets or sets the destination for a composed document.

Remarks

The destination must differ from the template so that the template keeps its composition markers for the next release cycle. Supplying this option without --apply previews the exact write without changing files.

Property

Apply

bool Apply { get; set; } Source

Gets or sets a value indicating whether the composed document may be written.

Type

DurablePreflightResult

Source

Immutable, secret-safe evidence from one complete fenced catalog snapshot.

Remarks

Pair indices are one-based and identify only the observed runtime credential. An owner-diagnostic result never covers a runtime. Null epochs remain null; preflight does not initialize or rotate store identity. Copies prevent caller mutation. See Durable/heartbeat-retention-operations.md for the combined guard gate.

Property

Status

DurableSchemaStatusView Status { get; } Source

Gets package-defined compatibility from the shared provider reader.

Property

StoreId

Guid StoreId { get; } Source

Gets the provider-observed StoreId.

Property

ActiveRuntimeEpoch

Guid? ActiveRuntimeEpoch { get; } Source

Gets the nullable provider-observed active epoch.

Property

CallerEvidenceKind

string CallerEvidenceKind { get; } Source

Gets runtime, owner-diagnostic, or unresolved caller evidence.

Property

CallerRole

string? CallerRole { get; } Source

Gets a request-validated caller role, never uncontrolled server text.

Property

PairIndex

int? PairIndex { get; } Source

Gets a one-based runtime pair, or null for owner/unresolved credentials.

Property

FailedChecks

IReadOnlyList<string> FailedChecks { get; } Source

Gets deterministic fixed categories, optionally qualified by validated pair identity.

Type

DurablePreflightException

Source

Fixed safe failure for bounded preflight operations or uncertain resource cleanup.

Property

Category

string Category { get; } Source

Gets the trusted diagnostic category; no provider message or connection data is retained.

Type

DurableSchemaPreflightVerifier

Source

Owns a single dedicated session, shared fence and read-only repeatable-read verification.

Remarks

Acquire the session fence BEFORE beginning repeatable read, so waiting for a preceding writer never pins a stale snapshot. One monotonic 30-second budget reserves up to two seconds for independent cleanup. Pooling, ambient enlistment and multiplexing are disabled. Callers must review endpoint session affinity; these settings cannot make a transaction/statement pooler safe. No success escapes before commit, explicit unlock and physical disposal. This is an internal CLI adapter, not a provider preflight or activation API.

Method

VerifyAsync

ValueTask<DurablePreflightResult> VerifyAsync(string connectionString, DurablePreflightRequest request, CancellationToken cancellationToken)

Validates one complete request on an owned session with checked, independently bounded cleanup.

Parameters

  • connectionString
    Secret connection configuration; it is never part of results or diagnostics.
  • request
    Already validated immutable complete manifest and independently reviewed owner.
  • cancellationToken
    Cancels work; cleanup uses its own remaining-budget cancellation.

Returns

Evidence only after every owned resource has been safely released.

Method

CreateSessionSettings

NpgsqlConnectionStringBuilder CreateSessionSettings(string connectionString)

Constrains driver budgets without expanding any shorter supplied connection timeout.

Method

MapCatalogResult

IReadOnlyList<string> MapCatalogResult(object? raw, DurablePreflightRequest request)

Rejects null, unexpected, unbounded or unknown catalog results without rendering their contents.

Method

ValidateEvidenceResult

void ValidateEvidenceResult(DurablePreflightResult? result, DurablePreflightRequest request)

Rejects incomplete successful evidence before rendering output from the service boundary.

Remarks

A null epoch is valid for a structural pass; only the combined activation gate requires initialization.

Method

VerifyFenceAffinityAsync

ValueTask VerifyFenceAffinityAsync(NpgsqlConnection connection, NpgsqlTransaction? transaction, CancellationToken cancellationToken)

Verifies that the connection still owns the existing migration fence on its original backend.

Parameters

  • connection
    The session whose backend identity and granted shared fence are checked.
  • transaction
    The optional caller-owned snapshot transaction.
  • cancellationToken
    Cancels the verification query.

Remarks

This shared seam performs no lock acquisition or cleanup. Failure keeps the existing preflight cleanup category; the doctor adapter maps that fixed failure to its session-affinity category.

Method

ReadCallerAsync

ValueTask<(string Kind, string? Role, int? Pair, string? Failure)> ReadCallerAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, DurablePreflightRequest request, CancellationToken cancellationToken)

Classifies the credential and effective role inside the caller-owned fenced snapshot.

Remarks

Neither opens a connection nor changes session identity or transaction ownership. Both PostgreSQL identities must resolve to the same OID on the original backend. This internal seam also allows tests to construct an actual SET ROLE session without depending on driver startup-option behavior.

Type

ISecretPromotionGoogleClientFactory

Source

Creates provider clients for declared Google transfer endpoints.

Remarks

The factory is a command-only seam. It keeps transfer credentials distinct from the read-only runtime configuration client and lets tests bind each named endpoint to a deterministic fake without reading environment credentials.

Type

ISecretPromotionReceiptWriter

Source

Persists value-free receipt snapshots for crash-safe transfer recovery.

Method

Write

void Write(string path, SecretPromotionReceipt receipt)

Atomically replaces the receipt at path .

Parameters

  • path
    Destination receipt path.
  • receipt
    Value-free journal snapshot.
Type

AtomicSecretPromotionReceiptWriter

Source

Writes receipt snapshots through same-directory atomic replacement.

Type

DefaultSecretPromotionGoogleClientFactory

Source
Method

ValidateCredentialFile

string ValidateCredentialFile(string? value, bool? isWindows = null)

Validates a credential file path without returning its contents or path in diagnostics.

Parameters

  • value
    Absolute credential-file path.
  • isWindows
    Optional platform seam used to verify fail-closed Windows behavior.

Returns

The canonical absolute path after posture validation.

Type

SecretPromotionWorkflow

Source

Runs declared, value-safe transfer jobs.

Method

ProbeLocalDestination

SecretPromotionRowResult ProbeLocalDestination(SecretPromotionPlanRow row, bool replace)

Maps a captured local precondition to a value-safe planning result.

Parameters

  • row
    Plan row carrying the captured local precondition.
  • replace
    Whether the plan explicitly authorizes a guarded replacement.

Returns

The value-safe planning result for the captured local state.

Method

MapLocalWriteResult

SecretPromotionRowResult MapLocalWriteResult(SecretPromotionPlanRow row, LocalCoordinatorWriteResult result)

Maps a guarded local coordinator write outcome to a value-safe transfer row.

Parameters

  • row
    Planned local destination row.
  • result
    Coordinator write or recovery result to render.

Returns

The value-safe transfer row corresponding to the coordinator result.

Method

IsProductionJob

bool IsProductionJob(ResolvedEndpoints endpoints)

Returns whether either declared endpoint carries the production environment label.

Method

SecretParentForVersionResource

string? SecretParentForVersionResource(string? value)

Returns the canonical Google secret parent for a syntactically valid version resource.

Remarks

Invalid resources return null so their existing shape diagnostic remains authoritative.

Method

ComputePlanIdentity

string ComputePlanIdentity(SecretPromotionPlanArtifact plan)

Computes the value-free identity that binds every field of a transfer plan.

Parameters

  • plan
    Plan artifact whose identity fields should be hashed.

Returns

Lowercase SHA-256 identity for the supplied artifact.

Type

SecretPromotionPlanRequest

Source

Describes a value-free request to create a transfer plan.

Parameters

  • ConfigPath
    Path to the reviewed endpoint and job configuration.
  • JobName
    Exact declared job name to plan.
  • OutputPlanPath
    Destination for the value-free plan artifact.
  • Replace
    Whether a Google destination may receive another version or an attested local destination may be replaced.
  • Expiry
    Positive lifetime after which apply must reject the plan.
  • Context
    LocalSecrets identity and metadata-only store context.
Type

SecretPromotionApplyRequest

Source

Describes a dry-run or mutation-gated transfer apply request.

Parameters

  • ConfigPath
    Path to the same reviewed configuration used for planning.
  • PlanPath
    Path to the unexpired value-free plan.
  • Apply
    Whether destination mutations are permitted; false performs apply preflight only.
  • Confirmation
    Exact job name required for production-labelled transfers and every guarded local replacement.
  • ReceiptPath
    Optional value-free receipt path; defaults beside the plan.
  • ResumeReceiptPath
    Optional prior receipt whose confirmed writes may be skipped.
  • Context
    LocalSecrets identity and store context used only after preflight permits payload access.
Type

SecretPromotionPlanResult

Source

Wraps the display-safe result returned after plan creation.

Parameters

  • Summary
    Value-free row summary and plan location.
Type

SecretPromotionConfiguration

Source

Defines the versioned endpoint and named-job configuration authorization boundary.

Parameters

  • Version
    Configuration schema version: v1 writes an existing Google destination; v2 materializes pinned Google versions into LocalSecrets.
  • Endpoints
    Explicit remote endpoint profiles; LocalSecrets is the built-in local endpoint.
  • Jobs
    Reviewed jobs that bind exact sources, version-specific destinations, and rows.
Type

SecretPromotionEndpoint

Source

Declares one named provider endpoint without embedding credential values.

Parameters

  • Name
    Case-sensitive endpoint name referenced by jobs.
  • Provider
    Provider identifier: google or the built-in local endpoint where the selected schema direction permits it.
  • Environment
    Environment label used to enforce production rules.
  • Credential
    Explicit Google credential mode; null is valid only for the built-in local endpoint.
Type

SecretPromotionCredential

Source

Chooses a Google credential acquisition mode without carrying raw credentials.

Parameters

  • Mode
    applicationDefault or credentialFile .
  • Path
    Absolute restricted credential-file path when that mode is selected; never emitted.
Type

SecretPromotionJob

Source

Declares one reviewed, direction-specific transfer job.

Parameters

  • Name
    Case-sensitive job identity used by plan, confirmation, and receipt checks.
  • Source
    Built-in local or a declared Google endpoint name.
  • Destination
    Declared Google endpoint in v1, or the built-in local endpoint in v2.
  • AllowMutableLocalSource
    Explicit production exception for a mutable LocalSecrets source.
  • Rows
    Ordered explicit key and resource mappings.
Type

SecretPromotionJobRow

Source

Maps one logical LocalSecrets key to explicit provider resources.

Parameters

  • Key
    Required logical AppSurface configuration key and row identity.
  • Source
    Explicit Google version resource, or null for a LocalSecrets source.
  • Destination
    Explicit existing Google secret parent resource in v1; omitted for a v2 LocalSecrets destination.
Type

SecretPromotionPlanArtifact

Source

Persists an expiring, value-free plan bound to all safety-relevant fields.

Parameters

  • Version
    Plan schema version.
  • JobName
    Declared job identity.
  • ConfigDigest
    Digest of the exact endpoint configuration bytes.
  • CreatedAtUtc
    UTC creation timestamp included in plan identity.
  • ExpiresAtUtc
    UTC expiration enforced before payload access.
  • Replace
    Whether another enabled Google version or an attested LocalSecrets value is authorized to be replaced.
  • Production
    Value-free production label captured for review.
  • Ready
    Whether all plan-time probes were ready or intentionally skipped.
  • PlanIdentity
    Stable SHA-256 identity over every plan safety field and row precondition.
  • Rows
    Ordered canonical mappings and destination preconditions; never payloads.
Type

SecretPromotionPlanRow

Source

Captures one canonical, value-free plan row and its destination precondition.

Parameters

  • RowNumber
    One-based declared processing order.
  • Key
    Explicit logical LocalSecrets key.
  • SourceEndpoint
    Declared source endpoint name.
  • SourceResource
    Canonical Google version resource, or local .
  • DestinationEndpoint
    Declared Google destination endpoint or built-in local endpoint.
  • DestinationResource
    Canonical existing Google secret parent; null for a v2 LocalSecrets destination.
  • LocalStorageName
    Normalized LocalSecrets identity used to detect duplicate logical mappings.
  • DestinationHasEnabledVersions
    Google enabled-version precondition captured during planning.
  • DestinationExists
    Local destination existence precondition in v2; null for v1 Google destinations.
Method

Result

SecretPromotionRowResult Result(string status, string action, string? diagnosticCode, string? problem, bool? retryable, string? writtenResource = null)

Creates a value-free row result while preserving canonical row identity.

Parameters

  • status
    Stable workflow status.
  • action
    Display-safe operation classification.
  • diagnosticCode
    Optional stable diagnostic code.
  • problem
    Optional paste-safe problem statement.
  • retryable
    Whether an operator may retry without reconciliation.
  • writtenResource
    Confirmed written Google version resource, when available; null for a local write.

Returns

A result that never includes secret payloads.

Method

GoogleSourceFailure

SecretPromotionRowResult GoogleSourceFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)

Maps a Google source failure without misclassifying destination absence.

Parameters

  • action
    Source probe or access action.
  • status
    Provider status to classify.
  • diagnostic
    Optional value-safe provider diagnostic.

Returns

A value-free source result.

Method

GoogleDestinationFailure

SecretPromotionRowResult GoogleDestinationFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)

Maps a Google destination failure, preserving indeterminate write state.

Parameters

  • action
    Destination probe or write action.
  • status
    Provider status to classify.
  • diagnostic
    Optional value-safe provider diagnostic.

Returns

A value-free destination result.

Property

DestinationKind

string? DestinationKind { get; init; } Source

Gets the destination contract for a v2 row; null preserves the v1 Google-only artifact shape.

Property

LocalAttestationOperationId

string? LocalAttestationOperationId { get; init; } Source

Gets the committed local attestation captured as a guarded replacement precondition for a v2 row.

Property

LocalPreconditionKind

string? LocalPreconditionKind { get; init; } Source

Gets the value-free local precondition classification captured for a v2 plan row.

Property

LocalPreconditionDiagnosticCode

string? LocalPreconditionDiagnosticCode { get; init; } Source

Gets the value-safe diagnostic code captured when local preflight could not establish a valid precondition.

Property

LocalPreconditionProblem

string? LocalPreconditionProblem { get; init; } Source

Gets the value-safe precondition problem captured for a failed v2 plan row.

Property

LocalPreconditionRetryable

bool? LocalPreconditionRetryable { get; init; } Source

Gets whether the local precondition failure is safe to retry without reconciliation.

Type

SecretPromotionRowResult

Source

Reports one value-free row outcome.

Parameters

  • RowNumber
    One-based declared processing order.
  • Key
    Logical AppSurface key; never its value.
  • SourceEndpoint
    Declared source endpoint name.
  • SourceResource
    Canonical source identity.
  • DestinationEndpoint
    Declared Google destination endpoint or built-in local endpoint.
  • DestinationResource
    Planned Google secret parent or confirmed written version resource; null for local writes.
  • Status
    Stable result classification.
  • Action
    Display-safe action classification.
  • DiagnosticCode
    Optional stable diagnostic code.
  • Problem
    Optional paste-safe problem statement.
  • Retryable
    Whether retry is safe without reconciliation.
Property

DestinationKind

string? DestinationKind { get; init; } Source

Gets the v2 destination kind when the result belongs to a local transfer row.

Type

SecretPromotionSummary

Source

Aggregates ordered value-free plan or apply results.

Parameters

  • Operation
    plan or apply .
  • Job
    Declared job name.
  • Apply
    Whether payload reads and destination writes were permitted.
  • Succeeded
    Whether every row completed or was intentionally skipped.
  • Rows
    Ordered value-free row outcomes.
  • PlanPath
    Written plan path for plan output.
  • ReceiptPath
    Written receipt path when surfaced by a caller.
Type

SecretPromotionReceipt

Source

Provides the durable, value-free apply journal and resume evidence.

Parameters

  • PlanJob
    Exact job name from the plan.
  • ConfigDigest
    Exact configuration digest from the plan.
  • PlanIdentity
    Identity binding every safety field and destination precondition.
  • Rows
    Atomically persisted ordered outcomes; indeterminate rows block automatic resume.
Type

CoverageCommand

Source

Provides the discoverable root for AppSurface coverage commands.

Remarks

The root command keeps the coverage workflow visible in appsurface --help . The stable v1 contract includes coverage run , which executes instrumented .NET test projects, coverage merge , which fans in existing Cobertura shards, and coverage gate , which evaluates the merged coverage without requiring a hosted coverage service. coverage clean removes known AppSurface-owned artifacts or, with explicit --all --apply , all local TestResults directories below a selected worktree root.

Method

ExecuteAsync

ValueTask ExecuteAsync(IConsole console)

Prints the coverage command family summary.

Parameters

  • console
    CliFx console used for command output.

Returns

A completed task.

Type

DurableRetentionCatalog

Source

Shared PostgreSQL predicates for the Durable heartbeat-retention structure.

Remarks

The fragments assume the aliases documented beside each property. They describe local structure only; complete preflight adds its independently reviewed migration-owner identity and exact manifest ACL rules. Keep this helper internal so catalog inspection does not become a deployment-authorization API.

Type

TestResultsCleanupRequest

Source

Describes one request to preview or remove TestResults directories through coverage clean --all .

Parameters

  • RootDirectory
    Optional scan root; the current directory is used when omitted.
  • Apply
    Whether discovered directories may be deleted.
Type

TestResultsCleanupResult

Source

Describes the completed TestResults cleanup operation.

Parameters

  • RootDirectory
    Canonical absolute scan root.
  • Directories
    Canonical absolute directories found below the root.
  • EstimatedBytes
    Total regular-file bytes measured without following links.
  • ReparsePointsSkipped
    Symbolic links or reparse points not traversed or counted.
  • Applied
    Whether the listed directories were deleted.
Type

TestResultsCleanupWorkflow

Source

Discovers, sizes, and explicitly removes private TestResults directories.

Remarks

The workflow deliberately has a narrow target definition: it only considers descendant directories whose final name is TestResults , compared without regard to case. It does not follow symbolic links or Windows reparse points during discovery, sizing, or deletion. This protects an ordinary worktree cleanup from crossing into a linked checkout or unrelated storage location.

Method

CleanAsync

Task<TestResultsCleanupResult> CleanAsync(TestResultsCleanupRequest request, IConsole console, CancellationToken cancellationToken)

Previews or deletes matching directories and writes a bounded operator summary.

Parameters

  • request
    The root and explicit deletion confirmation.
  • console
    Console used for summary output.
  • cancellationToken
    Cancellation token observed during filesystem traversal.

Returns

A value describing the discovered directories and estimated byte count.

Exceptions

  • CommandException
    Thrown when the root is unsafe, cannot be inspected, or deletion fails.
Method

DeleteDirectoryTree

void DeleteDirectoryTree(string directory, CancellationToken cancellationToken)

Removes one validated TestResults directory without traversing linked entries.

Parameters

  • directory
    Directory or linked directory entry to remove.
  • cancellationToken
    Cancellation token observed between directory entries.

Remarks

This internal test seam covers the race-safe final link check: a directory that is replaced by a link after discovery is unlinked instead of traversing its target.

Method

SaturatingAdd

long SaturatingAdd(long current, long next)

Returns the non-negative sum without exceeding long.MaxValue .

Method

FormatBytes

string FormatBytes(long bytes)

Formats a non-negative regular-file byte count for cleanup output.

Method

Pluralize

string Pluralize(string singular, int count)

Formats a singular noun for one or more cleanup entries.

Type

AppSurfaceCliVersion

Source

Resolves the AppSurface CLI version string shown by appsurface --version .

Remarks

The .NET tool package version is the user-facing release identity. Runtime assemblies carry that value through AssemblyInformationalVersionAttribute , sometimes with a leading release-tag v or build metadata. This helper normalizes the display value while preserving prerelease labels so RC installs remain distinguishable from stable packages.

Method

ResolveDisplayVersion

string ResolveDisplayVersion(Assembly assembly)

Resolves the display version from the supplied assembly metadata.

Parameters

  • assembly
    Assembly whose informational version carries the package identity.

Returns

A single-line printable version suitable for CliFx --version output.

Method

NormalizeDisplayVersion

string NormalizeDisplayVersion(string? informationalVersion)

Normalizes package identity metadata for user-facing CLI version output.

Parameters

  • informationalVersion
    Raw assembly informational version.

Returns

The package SemVer display value without a leading release-tag v or build metadata, or a truthful fallback when package identity metadata is unavailable.

Type

DurableDoctorClassifier

Source

Purely classifies one completed Durable doctor observation and its validated request.

Remarks

This type performs no I/O and reads no process clock. A compatible schema always receives an independent store-epoch check; selected worker evidence is interpreted only after that prerequisite. See the durable doctor contract for the v1 short-circuit, category, and output matrices.

Method

Classify

DurableDoctorResult Classify(DurableDoctorRequest request, DurableDoctorObservation observation)

Classifies a complete service observation; malformed or incomplete evidence becomes ASDUR415.

Method

Terminal

DurableDoctorResult Terminal(DurableDoctorRequest? request, string status, IReadOnlyList<string> categories)

Builds one fixed terminal envelope, discarding all database evidence and retaining valid request intent.

Parameters

  • request
    Validated request intent, or null when input validation did not construct a request.
  • status
    One of invalid-input, unavailable, canceled, or failed.
  • categories
    Fixed categories appropriate to the selected terminal status.

Returns

A result with the canonical descriptor and status-specific exit code.

Method

IsValidRequest

bool IsValidRequest(DurableDoctorRequest? request)

Validates command-derived request bounds before using any request value in result or action output.

Method

ExpectedActionFor

DurableDoctorAction ExpectedActionFor(DurableDoctorRequest request, string code)

Returns the exact renderer expectation for a finding's canonical follow-up action.

Type

CoverageCommandExceptionMapper

Source

Converts private coverage-core failures into the stable CliFx command contract.

Method

Map

CommandException Map(CoverageExecutionException exception)

Maps a core failure without changing its rendered diagnostic or terminal exit code.

Type

CoverageRunDiagnostics

Source

Creates stable command-layer validation diagnostics before a request enters the coverage core.

Method

Create

CommandException Create(string code, string problem, string cause, string fix, string docs, string? logPath = null)

Creates a stable CLI diagnostic using the existing coverage message shape.

Type

CoverageRunHangSequenceObservation

Source

A safe, relative observation from one VSTest sequence file.

Parameters

  • RelativePath
    Path beneath the AppSurface output root, with forward separators.
  • LastStartedTest
    Allowlisted last-started name, or null when absent or unsafe.
Type

CoverageRunHangDiagnosticsReader

Source

Bounded reader for VSTest sequence files beneath an owned coverage results directory.

Method

Inspect

InspectionResult Inspect(string ownedResultsDirectory, string outputDirectory, TimeProvider? clock = null, InspectionIo? io = null)

Inspects sequence candidates under a verified invocation directory using output root for containment.

Parameters

  • ownedResultsDirectory
    The invocation-specific owned directory to inspect.
  • outputDirectory
    Verified output root containing the owned invocation directory.
  • clock
    Optional clock used for the best-effort inspection budget.
  • io
    Optional internal test seam for deterministic file-system failures.
Type

InspectionIo

Source

File operations that a reader test can replace to verify failures at traversal and open boundaries.

Parameters

  • GetPathAttributes
    Reads attributes while checking the owned directory's ancestors.
  • EnumerateChildren
    Enumerates one owned directory; enumeration may fail immediately or during iteration.
  • GetChildAttributes
    Reads attributes for one enumerated child.
  • OpenRegularFile
    Opens a sequence through the physical-containment policy.
Property

Live

InspectionIo Live { get; } Source

Production operations, including the shared physical-containment file opener.

Type

InspectionResult

Source

A bounded inspection status and zero or more scoped sequence observations.

Parameters

  • Status
    Stable diagnostic status; never changes the primary coverage outcome.
  • Sequences
    Safe relative paths and allowlisted last-started names.
Type

CoverageRunDurationParser

Source

Parses the intentionally narrow duration grammar used by coverage watchdog options.

Method

Parse

TimeSpan Parse(string? value, string option, bool allowZero)

Parses a lowercase integer duration such as 500ms , 30s , 10m , or 1h .

Parameters

  • value
    Raw option value.
  • option
    Option name used in diagnostics.
  • allowZero
    Whether the exact value 0 is accepted.

Returns

The parsed duration.

Type

CoverageRunConsoleSink

Source

Serializes coverage-run console messages so heartbeat and incident blocks do not interleave.

Method

WriteOutputAsync

Task WriteOutputAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true, bool coalesceIfWritePending = false)

Writes one serialized block to standard output.

Parameters

  • text
    Complete output block.
  • cancellationToken
    Bounds how long the caller waits without cancelling an accepted write.
  • appendNewLine
    Whether to append the platform newline.
  • coalesceIfWritePending
    Whether to omit this periodic update when an earlier write is still pending. Diagnostic and terminal blocks must leave this disabled.

Returns

A task that completes when the write finishes or the caller's bounded wait ends.

Method

WriteErrorAsync

Task WriteErrorAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true)

Writes one serialized block to standard error.

Method

WriteCriticalErrorAsync

Task WriteCriticalErrorAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true)

Writes a terminal diagnostic in FIFO order when possible, then bypasses a blocked queue after the bounded wait. The fallback can interleave with a hung earlier output block, but atomically abandons its queued continuation so the critical diagnostic is emitted at most once.

Parameters

  • text
    Complete error block.
  • cancellationToken
    Bounds how long the caller waits without cancelling an accepted write.
  • appendNewLine
    Whether to append the platform newline.

Returns

A task that completes after the ordered attempt or bounded direct fallback.

Type

CoverageRunOperation

Source

Tracks one active coverage-run operation and exposes bounded progress updates.

Method

ObserveBytes

void ObserveBytes(int count)

Records a positive count of observed child-process bytes as progress.

Method

Transition

void Transition(string state)

Records an explicit operation state transition as progress.

Method

ReserveProcess

CoverageRunProcessLease ReserveProcess()

Reserves a supervisor-owned process lease before invoking the process runner.

Type

CoverageRunProcessLease

Source

Tracks a callback-delivered root process and guarantees late attachments observe terminal closure. The default termination path targets the root process and its descendants; injected termination callbacks exist only to make watchdog cleanup verifiable in tests.

Method

Attach

void Attach(Process process)

Attaches the root process delivered by CliWrap's start callback.

Method

Complete

void Complete(bool processExited = false)

Marks the command complete and unregisters the lease.

Parameters

  • processExited
    Whether the command runner confirmed that the attached process exited before disposing it.
Type

CoverageRunProcessDrainResult

Source

Reports whether all registered child processes were confirmed exited during bounded cleanup.

Parameters

  • Confirmed
    True only when every captured lease was confirmed drained.
  • Status
    Stable cleanup status: complete , deadline-exceeded , or failed .
Type

CoverageRunWatchdogSupervisor

Source

Supervises coverage-run orchestration using per-operation monotonic progress clocks.

Method

TerminateAndDrainProcessesAsync

Task<CoverageRunProcessDrainResult> TerminateAndDrainProcessesAsync()

Terminates and drains registered child processes within the watchdog cleanup bound.

Remarks

Safe to call after caller/Evidence cancellation; concurrent watchdog cleanup joins the same attempt.

Method

BindOutputDirectory

void BindOutputDirectory(string outputDirectory)

Binds watchdog artifacts to an AppSurface-owned output directory after full output validation.

Parameters

  • outputDirectory
    Absolute prepared output directory for canonical watchdog artifacts.

Remarks

Promotion failures are reported as ASCOV122 and do not replace the watchdog's terminal outcome.

Method

Start

CoverageRunOperation Start(string kind, string? project = null, int order = 0, string state = "running", string? log = null, IReadOnlyList<string>? commandOptions = null)

Starts a supervised operation. Queued work should call this only when it becomes active.

Parameters

  • kind
    Stable operation kind used for ordering and diagnostics.
  • project
    Optional solution-relative project path.
  • order
    Stable execution order among operations of the same kind.
  • state
    Initial operation state.
  • log
    Optional output-relative log path.
  • commandOptions
    Safe command option names; values must already be excluded.

Returns

A disposable operation that marks completion and exposes progress/process seams.

Exceptions

  • OperationCanceledException
    Thrown after watchdog or caller cancellation, or after process cleanup starts.
Method

ReserveProcess

CoverageRunProcessLease ReserveProcess()

Reserves a process lease before a child-process start callback can attach its root process.

Returns

A lease registered for terminal cleanup.

Exceptions

  • OperationCanceledException
    Thrown after watchdog or caller cancellation, or after process cleanup starts.
Method

ReleaseProcess

void ReleaseProcess(CoverageRunProcessLease lease)

Releases a completed process lease from terminal cleanup tracking.

Parameters

  • lease
    The completed lease.
Method

ObserveBytes

void ObserveBytes(long id, int count)

Records positive observed output bytes for an active operation.

Parameters

  • id
    Operation identifier.
  • count
    Positive byte count reported by the process observer.
Method

Transition

void Transition(long id, string state)

Records an explicit state transition as operation progress.

Parameters

  • id
    Operation identifier.
  • state
    New stable state.
Method

Complete

void Complete(long id)

Marks an active operation complete exactly once.

Parameters

  • id
    Operation identifier.
Method

ThrowIfFailed

void ThrowIfFailed()

Converts watchdog-owned cancellation into the stable ASCOV121 exit-124 diagnostic.

Exceptions

  • CommandException
    Thrown with exit code 124 after terminal cleanup and the bounded incident-write attempt finish.
Method

Commit

void Commit(Action commit)

Revalidates that the watchdog has not claimed terminal ownership before an atomic artifact commit.

Parameters

  • commit
    Synchronous canonical replacement performed while terminal ownership is locked.

Exceptions

  • ArgumentNullException
    Thrown when commit is null .
  • OperationCanceledException
    Thrown when the watchdog already owns the terminal outcome.
Property

ArtifactPublished

Action<string>? ArtifactPublished { get; set; } Source

Gets the artifact writer callback bound to the participating output inventory.

Property

CancellationToken

CancellationToken CancellationToken { get; } Source

Gets the token shared by all supervised coverage work.

Property

Console

CoverageRunConsoleSink Console { get; } Source

Gets the run-scoped bounded console sink used by all coverage workflow messages.

Type

CoverageArtifactSettingsResult

Source

Describes the effective collector-settings inspection for one evaluated project.

Parameters

  • State
    Whether XPlat is enabled, disabled, absent, unknown, or not applicable to this evaluation.
  • Cause
    A stable reason that never includes raw arguments, paths, or environment values.
  • EffectivePath
    The resolved settings path for internal use only; never copy it to public diagnostics.
  • Project
    A project file name without its directory path.
  • Framework
    The selected target framework, or null for outer evaluation.
Type

CoverageArtifactSettings

Source

Resolves and inspects runsettings for the actual test invocation without changing its arguments.

Method

Observe

CoverageArtifactSettingsResult Observe(CoverageRunProject project, string? framework, string capabilityJson, string configuration, IReadOnlyList<string> testArguments)

Observes effective settings from evaluated MSBuild properties and recognized invocation overrides.

Parameters

  • project
    The selected test project.
  • framework
    The selected framework, or null for outer evaluation.
  • capabilityJson
    Successful MSBuild capability JSON.
  • configuration
    The selected build configuration.
  • testArguments
    Literal test arguments, preserved as supplied.

Returns

A bounded state and internal effective path; paths must never be copied to public diagnostics.

Type

CloudRunExecutionArgumentAdmission

Source
Method

NormalizeJoinedValueOptions

string[] NormalizeJoinedValueOptions(string[] args)

Rebuilds admitted value options as separate name/value tokens for CliFx binding.

Parameters

  • args
    Original argv, including the observe-execution route.

Returns

Equivalent admitted options, or the original argv for help, another command, or invalid input.

Remarks

Call after raw admission so malformed input uses the safe diagnostic path. Values retain embedded equals signs.

Type

AppSurfaceExportCommand

Source

Exports an AppSurface/RazorWire application through the product-facing appsurface export command.

Remarks

This command delegates crawling, hybrid split-origin rewriting, validation, and materialization to the shared RazorWire export engine while keeping the common AppSurface workflow discoverable from the AppSurface CLI.

Property

PublishRootExtrasPath

string? PublishRootExtrasPath { get; set; } Source

Gets or sets an optional path to a publish-root deployment extras manifest.

Remarks

The manifest declares explicit deployment-owned files, such as CNAME , that should be copied into the publish root after export proves they do not collide with generated output. This option is distinct from SeedRoutesPath , which contains routes to crawl.

Property

LiveOrigin

string? LiveOrigin { get; set; } Source

Gets or sets the optional live origin for RazorWire-managed split-origin hybrid interactions.

Remarks

The value must be an absolute http or https origin with no path, query string, fragment, or userinfo. Use this when the exported static files are served from one origin but RazorWire-owned live streams, islands, and lazy anti-forgery forms must call a different live app origin. Leave it unset for same-origin hybrid deployments.

Property

HybridCredentials

RazorWireHybridCredentialsMode HybridCredentials { get; set; } Source

Gets or sets credential behavior for RazorWire-managed live calls in hybrid output.

Remarks

Defaults to RazorWireHybridCredentialsMode.Auto , which includes credentials only when LiveOrigin is set. Use RazorWireHybridCredentialsMode.Include for cookie-backed cross-origin live apps and RazorWireHybridCredentialsMode.Omit for public live surfaces that do not depend on cookies or anti-forgery token refreshes.

Type

CoverageRunDriverInvocation

Source

Describes one driver's raw and canonical artifact locations for a project invocation.

Parameters

  • Driver
    The single driver selected for the run.
  • ProjectOutputDirectory
    The AppSurface-owned canonical directory for this project.
  • RawResultsDirectory
    The unique AppSurface-owned results directory, or null for caller-owned MSBuild results.
  • OwnedArguments
    Arguments generated by AppSurface that callers must not override.
Type

CoverageRunDriverNormalization

Source

Result of normalizing one driver's current-invocation coverage artifact.

Parameters

  • Status
    Stable artifact outcome: produced , missing , multiple , unreadable , escaping , or malformed .
  • CoverageFile
    Canonical absolute Cobertura path when Status is produced .
  • Cause
    Stable diagnostic detail for a non-produced outcome, otherwise null .
  • CleanupDiagnostic
    Best-effort staged-file cleanup warning that did not change the primary normalization outcome.
Type

CoverageRunDriverPreflight

Source

Validates VSTest engine and direct package capabilities before coverage output is mutated.

Method

ValidateAsync

Task ValidateAsync(CoverageRunDriver driver, string configuration, CoverageProjectResolution resolution, ICoverageRunProcessRunner processRunner, CoverageRunWatchdogSupervisor supervisor, CancellationToken cancellationToken, IReadOnlyList<string>? testArguments = null, Action<CoverageRunProject, string?, string>? observeCapabilities = null)

Validates the selected engine and every selected project's evaluated coverage package.

Parameters

  • driver
    The requested VSTest coverage driver.
  • configuration
    The evaluated build configuration.
  • resolution
    The resolved solution and selected test projects.
  • processRunner
    Runner used for supervised MSBuild capability queries.
  • supervisor
    Run-scoped supervisor for discovery operations and cancellation.
  • cancellationToken
    Cancellation token for capability evaluation.
  • testArguments
    Original literal test arguments used by an observer to resolve invocation overrides.
  • observeCapabilities
    Optional observer called once for each successfully parsed outer or framework evaluation.

Returns

A task that completes when every project is compatible.

Remarks

Throws a stable coverage execution diagnostic for an engine incompatibility or aggregated project package and capability failures in stable project order.

Method

DriverName

string DriverName(CoverageRunDriver driver)

Returns the stable lowercase CLI name for a coverage driver.

Parameters

  • driver
    The coverage driver value.

Returns

collector or msbuild .

Type

CoverageRunDriverStrategy

Source

Owns coverage-driver arguments and deterministic per-project artifact normalization.

Method

ValidateTestArguments

void ValidateTestArguments(CoverageRunDriver driver, IReadOnlyList<string> arguments)

Validates user arguments that would override AppSurface-owned coverage behavior.

Parameters

  • driver
    The driver whose reserved arguments should be enforced.
  • arguments
    User-supplied dotnet test arguments in invocation order.

Remarks

Throws a stable coverage execution diagnostic when an argument collides with driver-owned coverage configuration.

Method

ValidateHangArguments

void ValidateHangArguments(CoverageRunRequest request)

Reserves MSBuild result-directory ownership before discovery in fail mode when the user did not claim the blame policy. This guard also applies if the later launch budget is too short.

Method

CreateInvocation

CoverageRunDriverInvocation CreateInvocation(CoverageRunRequest request, string projectOutputDirectory, CoverageRunHangPlan? hangPlan = null)

Creates driver-owned arguments and raw artifact locations for one project invocation.

Parameters

  • request
    The validated coverage-run request.
  • projectOutputDirectory
    Absolute AppSurface-owned output directory for the project.
  • hangPlan
    The fixed VSTest timeout plan computed immediately before the project operation.

Returns

The driver invocation, including its unique collector directory when applicable.

Remarks

Throws a stable coverage execution diagnostic when a generated collector invocation directory collides with an existing filesystem object.

Method

AppendCollectorRunSettings

void AppendCollectorRunSettings(CoverageRunRequest request, List<string> arguments)

Appends collector runsettings after user-controlled pre-separator arguments.

Parameters

  • request
    The validated coverage-run request.
  • arguments
    Mutable dotnet test argument list to complete.
Method

NormalizeAsync

Task<bool> NormalizeAsync(CoverageRunDriverInvocation invocation, int processExitCode, string logFile, CancellationToken cancellationToken, Action<Action>? commitGate = null)

Normalizes the current invocation's driver artifact into the canonical project path.

Parameters

  • invocation
    The driver invocation and its artifact locations.
  • processExitCode
    Exit code from the corresponding dotnet test process.
  • logFile
    Project log path included in artifact diagnostics.
  • cancellationToken
    Cancellation token for artifact inspection and staging.
  • commitGate
    Optional gate that must authorize canonical artifact replacement.

Returns

true when the current invocation produced a canonical artifact; otherwise false .

Remarks

Throws a stable coverage execution diagnostic when a successful test process produces an invalid artifact result.

Method

NormalizeDetailedAsync

Task<CoverageRunDriverNormalization> NormalizeDetailedAsync(CoverageRunDriverInvocation invocation, CancellationToken cancellationToken, Action<Action>? commitGate = null, Action? beforeArtifactOpen = null, Action<string>? deleteStagedFile = null, bool removeRedundantRaw = false)

Normalizes an artifact and returns a stable status without selecting the run's primary failure.

Parameters

  • invocation
    The driver invocation and its artifact locations.
  • cancellationToken
    Cancellation token for artifact inspection and staging.
  • commitGate
    Optional gate that must authorize canonical artifact replacement.
  • beforeArtifactOpen
    Optional test seam invoked after candidate discovery and before the artifact is opened.
  • deleteStagedFile
    Optional test seam that replaces deletion of the staged coverage file.
  • removeRedundantRaw
    Whether verified, invocation-owned duplicate XML may be removed after publication.

Returns

A stable normalization status and the canonical absolute artifact path only when produced.

Method

CreateArtifactFailure

Exception CreateArtifactFailure(string logFile, string rawDirectory, string cause)

Creates the stable artifact-contract diagnostic used by workflow-level failure ordering.

Parameters

  • logFile
    Project log path included in the diagnostic.
  • rawDirectory
    Raw or canonical artifact directory that failed validation.
  • cause
    Stable artifact failure detail.

Returns

An ASCOV115 command failure.

Type

DurableRolePair

Source

One reviewed dispatcher/runtime role identity and its dispatcher capability profile.

Remarks

Names are preserved exactly as supplied. PostgreSQL role names are compared ordinally; values are not trimmed, normalized, case-folded, interpolated into SQL, or shortened. See the schema-11 operations guide for manifest custody and the deployment workflow.

Type

DurableRoleManifest

Source

A bounded immutable copy of the reviewed version-1 role manifest and its exact-byte SHA-256 digest.

Remarks

ReadAsync(string, CancellationToken) reads at most 64 KiB once from the selected file and hashes those exact bytes. Parse(ReadOnlySpan{byte}) is the equivalent parser seam for internal callers and tests; it does not retain or expose the input buffer. Pairs are ordered as reviewed and are immutable. The format is deliberately complete even for one-pair stores: version 1, one to 32 pairs, and exactly the three pair fields. See the canonical operations guide for when this manifest is used and its release/activation limits.

Method

ReadAsync

ValueTask<DurableRoleManifest> ReadAsync(string path, CancellationToken cancellationToken)

Reads one bounded manifest file and validates its complete version-1 input before a connection opens.

Parameters

  • path
    Path to the reviewed UTF-8 JSON manifest.
  • cancellationToken
    Cancellation requested while opening or reading the file.

Returns

An immutable manifest with a digest over the exact bytes read.

Exceptions

  • ArgumentException
    The path cannot be read or the file exceeds the supported input size.
  • ArgumentException
    The bytes are not a valid manifest; messages are fixed and contain no path or input text.
  • OperationCanceledException
    The read was cancelled.
Method

ReadStreamAsync

ValueTask<DurableRoleManifest> ReadStreamAsync(Stream stream, CancellationToken cancellationToken)

Reads and validates a bounded manifest from a caller-owned stream.

Parameters

  • stream
    Readable stream positioned at the start of the complete UTF-8 manifest.
  • cancellationToken
    Cancels before or during a read; partial bytes are never accepted.

Returns

The same immutable manifest and exact-byte digest as the path-based reader.

Exceptions

  • ArgumentNullException
    The stream is null.
  • ArgumentException
    The read fails, exceeds 64 KiB, or contains an invalid manifest.
  • OperationCanceledException
    The read is cancelled.

Remarks

This internal file-boundary seam reads forward once and never disposes, seeks or retains the stream. It permits deterministic partial-read cancellation and I/O failure verification without changing the public CLI input contract. Parsing occurs only after a complete bounded read; failures contain neither stream contents nor provider exception text. The caller owns stream cleanup.

Method

Parse

DurableRoleManifest Parse(ReadOnlySpan<byte> utf8Json)

Validates strict UTF-8 JSON and constructs an immutable manifest without retaining the input memory.

Parameters

  • utf8Json
    The complete JSON document bytes.

Returns

Validated ordered role pairs and the SHA-256 of exactly utf8Json .

Exceptions

  • ArgumentException
    The document violates the fixed version-1 input contract.
Property

Pairs

ImmutableArray<DurableRolePair> Pairs { get; } Source

Gets the ordered, immutable role pairs exactly as declared in the reviewed input.

Property

Sha256

string Sha256 { get; } Source

Gets the lowercase hexadecimal SHA-256 of the original manifest bytes, including whitespace.

Type

DurablePreflightRequest

Source

An immutable manifest plus the independently reviewed migration-owner role used for one preflight.

Remarks

The owner is deliberately supplied separately from the manifest, validated by the same exact UTF-8 byte and control-character rules, and must not equal any dispatcher or runtime name. Neither value is inferred from the catalog. The caller retains ownership of database connections and the continuous maintenance guard; this request owns only its immutable manifest reference and validated owner string. See the schema-11 operations guide for ordering, custody and deployment evidence requirements.

Property

Manifest

DurableRoleManifest Manifest { get; } Source

Gets the complete immutable reviewed manifest.

Property

MigrationOwnerRole

string MigrationOwnerRole { get; } Source

Gets the exact validated migration-owner role name.

Type

DurableDoctorCatalog

Source

Reads fixed credential and retention evidence from a caller-owned PostgreSQL snapshot.

Remarks

Each operation executes one bounded statement and returns only ordered, package-defined failed categories. Callers establish session affinity, compatible schema where required, and a read-only transaction first. Catalog values such as role names, ACLs, function configuration and index definitions stay inside SQL.

Method

ReadCredentialAsync

ValueTask<IReadOnlyList<string>> ReadCredentialAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, CancellationToken cancellationToken)

Reads the six fixed connected-credential checks from the caller's active transaction.

Parameters

  • connection
    The already-affinitized physical PostgreSQL session.
  • transaction
    The caller-owned transaction containing the catalog snapshot.
  • cancellationToken
    Cancels this one bounded catalog statement.

Returns

Credential failure categories in the fixed doctor contract order.

Remarks

Ownership, grant-option and direct heartbeat ACL checks use the live catalog namespace; no relation is resolved through regclass .

Method

ReadRetentionAsync

ValueTask<IReadOnlyList<string>> ReadRetentionAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, CancellationToken cancellationToken)

Reads the nine fixed schema-11 retention checks from a compatible-schema snapshot.

Parameters

  • connection
    The already-affinitized physical PostgreSQL session.
  • transaction
    The caller-owned transaction containing the catalog snapshot.
  • cancellationToken
    Cancels this one bounded catalog statement.

Returns

Retention failure categories in the fixed doctor contract order.

Remarks

Missing the exact function signature contributes only that finding; absent dependent function facts are treated as not applicable.

Method

MapCredentialProjection

IReadOnlyList<string> MapCredentialProjection(object?[]? projection)

Maps a six-boolean credential projection without retaining provider-controlled values.

Parameters

  • projection
    The fixed SQL projection captured by the reader.

Returns

Failed categories in the credential contract order.

Exceptions

  • InvalidOperationException
    The projection is missing, has the wrong width, or contains a non-boolean value.
Method

MapRetentionProjection

IReadOnlyList<string> MapRetentionProjection(object?[]? projection)

Maps a nine-boolean retention projection without retaining provider-controlled values.

Parameters

  • projection
    The fixed SQL projection captured by the reader.

Returns

Failed categories in the retention contract order.

Exceptions

  • InvalidOperationException
    The projection is missing, has the wrong width, or contains a non-boolean value.
Type

DurableDoctorResult

Source

Immutable, bounded projection shared by the doctor's text and JSON renderers.

Type

DurableDoctorCheckResult

Source

One fixed v1 check entry in credential, schema, epoch, retention, worker order.

Type

DurableDoctorSchemaResult

Source

Schema facts projected according to the v1 compatibility and availability matrix.

Type

DurableDoctorCredentialResult

Source

Secret-free evidence that the connected role passed or failed the fixed runtime-role checks.

Type

DurableDoctorRetentionResult

Source

Secret-free evidence for the schema-11 heartbeat-retention capability.

Type

DurableDoctorWorkerResult

Source

Bounded facts for only the worker identity explicitly selected by the caller.

Type

DurableDoctorFinding

Source

Canonical catalog wording and the finding-specific action for one diagnosis.

Type

DurableDoctorAction

Source

One safe command or application-composition handoff with an absolute documentation destination.

Type

DurableDoctorCommandAction

Source

Validated executable and bounded argv; arguments remain separate from shell formatting.

Type

DurableDoctorResultCollections

Source

Copies bounded-result collections into read-only arrays before they cross the pure output boundary.

Type

ReleaseCommand

Source

Provides the discoverable root for consumer-owned release-note workflows.

Remarks

The public release surface deliberately handles the collaborative authoring problem only: independent work can add isolated Markdown entries and one release owner can compose them deterministically. It does not create tags, publish packages, mutate GitHub Releases, or impose AppSurface's repository-specific release policy on a consumer project.

Type

DurableDoctorRenderer

Source

Renders the same bounded classified result as stable v1 JSON or operator-oriented text.

Remarks

JSON uses an explicit writer so every property, null, array and ordering decision is fixed. Unsupported or malformed render inputs throw a fixed contract exception before output is written. Both formats are capped at 32 KiB and end with exactly one line feed. See DurableDoctorClassifier for the observation contract.

Method

Render

string Render(DurableDoctorResult result, DurableDoctorRequest? request, string format)

Renders one result as JSON only for the exact format token json ; all other tokens use safe text.

Parameters

  • result
    The classifier's immutable result.
  • request
    The validated intent used to produce result and command actions, or null for invalid input.
  • format
    The validated format; an unknown value safely falls back to text.

Returns

A bounded final-newline string.

Enum

DurableDoctorFailureKind

Source

Terminal execution family, with caller cancellation winning over every other family.

Enum

LocalCoordinatorPreconditionKind

Source

Classifies the value-free precondition captured for a local transfer target.

Enum

LocalCoordinatorCheckKind

Source

Classifies a value-free recheck of a plan-bound local destination.

Enum

LocalCoordinatorWriteKind

Source

Classifies a guarded local write or recovery outcome.

Enum

LocalTransferJournalState

Source

Tracks the value-free lifecycle of a local transfer journal.

Enum

PwaVerificationSurface

Source

Identifies the public PWA verification surface.

Enum

PwaExpectedPush

Source

Identifies the expected server-known push posture.

Enum

DurableDoctorStage

Source

Observation stages exposed internally for deterministic pause, denial and cleanup verification.

Enum

CoverageRunWatchdogMode

Source

Controls how coverage run responds when an active operation produces no observable progress.

Enum

CoverageRunDriver

Source

Coverage integrations supported by the VSTest-based coverage run workflow.