string? Url { get; set; }
Source
Gets the absolute application base URL.
Provides the DI-backed execution runtime for AppSurface CLI commands.
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.
Task RunAsync(string[] args, Action<ConsoleOptions>? configureOptions = null)
Source
Runs the AppSurface CLI with the provided command-line arguments.
argsCommand-line arguments to parse and execute.configureOptionsOptional callback that customizes ConsoleOptions before execution. Defaults start from ConsoleOptions.Default with ConsoleOutputMode.CommandFirst so command output remains the primary console experience.A task that completes when the selected command finishes.
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.
void AddExportEngineServices(IServiceCollection services)
Source
Registers the RazorWire export engine dependencies used by AppSurface-owned export commands.
servicesThe service collection to populate.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.
void AddPwaVerifierServices(IServiceCollection services)
Source
Registers the HTTP client used by appsurface pwa verify.
servicesThe service collection to populate.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.
void AddCoverageServices(IServiceCollection services)
Source
Registers the shared coverage core and its CLI and Evidence adapters.
servicesService collection receiving the coverage command and Evidence registrations.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.
void AddCanaryPollingServices(IServiceCollection services)
Source
Registers the named-canary polling HTTP and delay services.
servicesThe service collection to populate.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.
Describes one driver's raw and canonical artifact locations for a project invocation.
DriverThe single driver selected for the run.ProjectOutputDirectoryThe AppSurface-owned canonical directory for this project.RawResultsDirectoryThe unique collector attachment directory, or null for MSBuild.OwnedArgumentsArguments generated by AppSurface that callers must not override.Result of normalizing one driver's current-invocation coverage artifact.
StatusStable artifact outcome: produced, missing, multiple, unreadable, escaping, or malformed.CoverageFileCanonical absolute Cobertura path when Status is produced.CauseStable diagnostic detail for a non-produced outcome, otherwise null.CleanupDiagnosticBest-effort staged-file cleanup warning that did not change the primary normalization outcome.Validates VSTest engine and direct package capabilities before coverage output is mutated.
Task ValidateAsync(CoverageRunDriver driver, string configuration, CoverageProjectResolution resolution, ICoverageRunProcessRunner processRunner, CoverageRunWatchdogSupervisor supervisor, CancellationToken cancellationToken)
Source
Validates the selected engine and every selected project's evaluated coverage package.
driverThe requested VSTest coverage driver.configurationThe evaluated build configuration.resolutionThe resolved solution and selected test projects.processRunnerRunner used for supervised MSBuild capability queries.supervisorRun-scoped supervisor for discovery operations and cancellation.cancellationTokenCancellation token for capability evaluation.A task that completes when every project is compatible.
Throws a stable coverage execution diagnostic for an engine incompatibility or aggregated project package and capability failures in stable project order.
string DriverName(CoverageRunDriver driver)
Source
Returns the stable lowercase CLI name for a coverage driver.
driverThe coverage driver value.collector or msbuild.
Owns coverage-driver arguments and deterministic per-project artifact normalization.
void ValidateTestArguments(CoverageRunDriver driver, IReadOnlyList<string> arguments)
Source
Validates user arguments that would override AppSurface-owned coverage behavior.
driverThe driver whose reserved arguments should be enforced.argumentsUser-supplied dotnet test arguments in invocation order.Throws a stable coverage execution diagnostic when an argument collides with driver-owned coverage configuration.
CoverageRunDriverInvocation CreateInvocation(CoverageRunRequest request, string projectOutputDirectory)
Source
Creates driver-owned arguments and raw artifact locations for one project invocation.
requestThe validated coverage-run request.projectOutputDirectoryAbsolute AppSurface-owned output directory for the project.The driver invocation, including its unique collector directory when applicable.
Throws a stable coverage execution diagnostic when a generated collector invocation directory collides with an existing filesystem object.
void AppendCollectorRunSettings(CoverageRunRequest request, List<string> arguments)
Source
Appends collector runsettings after user-controlled pre-separator arguments.
requestThe validated coverage-run request.argumentsMutable dotnet test argument list to complete.Task<bool> NormalizeAsync(CoverageRunDriverInvocation invocation, int processExitCode, string logFile, CancellationToken cancellationToken, Action<Action>? commitGate = null)
Source
Normalizes the current invocation's driver artifact into the canonical project path.
invocationThe driver invocation and its artifact locations.processExitCodeExit code from the corresponding dotnet test process.logFileProject log path included in artifact diagnostics.cancellationTokenCancellation token for artifact inspection and staging.commitGateOptional gate that must authorize canonical artifact replacement.true when the current invocation produced a canonical artifact; otherwise false.
Throws a stable coverage execution diagnostic when a successful test process produces an invalid artifact result.
Task<CoverageRunDriverNormalization> NormalizeDetailedAsync(CoverageRunDriverInvocation invocation, CancellationToken cancellationToken, Action<Action>? commitGate = null, Action? beforeArtifactOpen = null, Action<string>? deleteStagedFile = null)
Source
Normalizes an artifact and returns a stable status without selecting the run's primary failure.
invocationThe driver invocation and its artifact locations.cancellationTokenCancellation token for artifact inspection and staging.commitGateOptional gate that must authorize canonical artifact replacement.beforeArtifactOpenOptional test seam invoked after candidate discovery and before the artifact is opened.deleteStagedFileOptional test seam that replaces deletion of the staged coverage file.A stable normalization status and the canonical absolute artifact path only when produced.
Exception CreateArtifactFailure(string logFile, string rawDirectory, string cause)
Source
Creates the stable artifact-contract diagnostic used by workflow-level failure ordering.
logFileProject log path included in the diagnostic.rawDirectoryRaw or canonical artifact directory that failed validation.causeStable artifact failure detail.An ASCOV115 command failure.
Coverage integrations supported by the VSTest-based coverage run workflow.
Internal CLI entry point that adds a scoped test seam around AppSurfaceCliApp.
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.
Task RunAsync(string[] args, Action<ConsoleOptions>? configureOptions = null)
Source
Runs the AppSurface CLI with the specified arguments and optional console configuration.
argsCommand-line arguments to parse and execute.configureOptionsOptional primary console-options callback for the current invocation.A task that represents the CLI execution.
IDisposable PushConfigureOptionsOverrideForTests(Action<ConsoleOptions> configureOptions)
Source
Pushes a test-only console-options override for the current async context.
configureOptionsOverride callback to apply after any direct invocation callback.A disposable scope that restores the previous override when disposed.
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.
Restores the previously active test override when disposed.
previousOverride that was active before the current scope was pushed.Adapts the CliFx console to the private coverage-core writer boundary.
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.
Task<CoverageRunResult> RunAsync(this CoverageRunWorkflow workflow, CoverageRunRequest request, IConsole console, CancellationToken cancellationToken)
Source
Runs coverage using the output and error writers from a CliFx console.
Task<CoverageMergeResult> MergeAsync(this CoverageMergeWorkflow workflow, CoverageMergeRequest request, IConsole console, CancellationToken cancellationToken)
Source
Merges coverage using the output and error writers from a CliFx console.
Polls one protected AppSurface named-canary endpoint until it produces a terminal deployment decision.
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.
string? Url { get; set; }
Source
Gets the absolute application base URL.
string? Name { get; set; }
Source
Gets the registered named-canary name.
string? MarkerEnvironmentVariable { get; set; }
Source
Gets the environment variable containing the optional canary marker.
string? FreshSince { get; set; }
Source
Gets the optional proof freshness boundary.
string? BearerTokenEnvironmentVariable { get; set; }
Source
Gets the environment variable containing a bearer token.
string? IdentityTokenEnvironmentVariable { get; set; }
Source
Gets the environment variable containing an already acquired identity token.
string[] HeaderEnvironmentVariables { get; set; }
Source
Gets repeatable custom header environment sources in HEADER=VARIABLE form.
string Timeout { get; set; }
Source
Gets the total polling deadline.
string Interval { get; set; }
Source
Gets the interval between scheduled polls.
int MaxTransientFailures { get; set; }
Source
Gets the maximum consecutive recoverable transport failures.
bool Json { get; set; }
Source
Gets whether to write exactly one machine-readable JSON terminal result.
bool GithubSummary { get; set; }
Source
Gets whether to write a GitHub Actions step summary when available.
bool NoGithubSummary { get; set; }
Source
Gets whether to suppress GitHub Actions step summary output.
Coordinates deterministic named-canary polling without hidden HTTP retries.
Task<CanaryPollResult> RunAsync(CanaryPollRequest request, CancellationToken cancellationToken)
Source
Runs the caller-owned named-canary polling state machine.
Performs one caller-owned delay in the polling state machine.
Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)
Source
Waits for the requested duration or cancellation.
Uses the configured time provider for production polling delays.
Issues one named-canary HTTP request without following redirects.
Task<CanaryPollHttpResponse> SendAsync(CanaryPollRequest request, CancellationToken cancellationToken)
Source
Sends exactly one request and returns bounded response evidence.
Adapts the typed HTTP client to the polling workflow's bounded response contract.
Captures one bounded named-canary HTTP response.
Captures a parsed Retry-After header without retaining raw header text.
Parses the required named-canary compatibility core.
CanaryPollEnvelope Parse(byte[] body, string expectedName)
Source
Parses a bounded response and validates it against the requested canary name.
Represents the parsed safe fields required by the polling state machine.
Represents a protocol incompatibility without exposing response content.
Normalizes safe command options and resolves environment-sourced values.
CanaryPollRequest Create(string? urlText, string? name, string? markerEnvironmentVariable, string? freshSinceText, string? bearerTokenEnvironmentVariable, string? identityTokenEnvironmentVariable, IReadOnlyList<string>? headerEnvironmentVariables, string? timeoutText, string? intervalText, int maxTransientFailures)
Source
Creates a fully normalized request before any HTTP connection is opened.
bool IsSafeSummary(string? summary)
Source
Returns whether a server summary is safe to expose in terminal evidence.
Contains normalized request metadata and non-renderable environment-sourced values.
Contains one non-renderable custom HTTP header.
Represents a safe local command-input failure.
Represents one safe terminal polling result.
bool IsRetryable { get; }
Source
Gets whether a retry can produce a different deployment decision without changing local input.
Renders one safe terminal result for a person or an automation client.
Task WriteAsync(IConsole console, CanaryPollResult result, bool json)
Source
Writes exactly one terminal result to stdout.
Appends a bounded, safe result table to a GitHub Actions step summary.
Task<bool> TryWriteAsync(string? path, CanaryPollResult result)
Source
Attempts summary output without changing the polling result.
Resolves the AppSurface CLI version string shown by appsurface --version.
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.
string ResolveDisplayVersion(Assembly assembly)
Source
Resolves the display version from the supplied assembly metadata.
assemblyAssembly whose informational version carries the package identity.A single-line printable version suitable for CliFx --version output.
string NormalizeDisplayVersion(string? informationalVersion)
Source
Normalizes package identity metadata for user-facing CLI version output.
informationalVersionRaw assembly informational version.The package SemVer display value without a leading release-tag v or build metadata, or a truthful fallback when package identity metadata is unavailable.
Previews AppSurface Docs for a local repository through the public appsurface docs command.
This command starts the AppSurface Docs standalone host with CLI-friendly defaults and delegates option validation and argument construction to AppSurfaceDocsPreviewCommand.
Previews AppSurface Docs for a local repository through the appsurface docs preview alias.
Use this alias when a command hierarchy reads better in scripts. It has the same options and behavior as DocsCommand.
Exports AppSurface Docs for a local repository through the appsurface docs export command.
This command owns the AppSurface Docs source-host lifecycle and delegates static crawling, URL rewriting, CDN validation, and materialization to the RazorWire export engine.
ValueTask ExecuteAsync(IConsole console)
Source
Executes the command through the CliFx console integration.
consoleConsole abstraction used to register cancellation handling.A value task that completes when export finishes or command validation fails.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Source
Executes the command using an explicit cancellation token.
cancellationTokenToken observed while starting the host and exporting static output.A value task that completes when export finishes.
AppSurfaceDocsExportArgs BuildExportArgs()
Source
Translates CLI options into an AppSurface Docs export invocation.
The export runner arguments.
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.
IReadOnlyList<string> BuildDefaultSeedRoutes()
Source
Builds the default export seed routes from the resolved AppSurface Docs routing options.
The root route plus the live docs root, with duplicates removed.
string OutputPath { get; set; }
Source
Gets the directory where static docs files will be written.
Defaults to dist/docs for local use. CI should pass an explicit output path so upload artifacts and export output stay tied together.
ExportMode Mode { get; set; }
Source
Gets the export mode used by the underlying RazorWire exporter.
ExportMode.Cdn validates and rewrites output for static CDN hosting. ExportMode.Hybrid preserves application-style internal URLs for server-backed deployments.
string? LiveOrigin { get; set; }
Source
Gets the live origin used for RazorWire-managed live references in hybrid exports.
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.
RazorWireHybridCredentialsMode HybridCredentials { get; set; }
Source
Gets credential behavior for RazorWire-managed live references.
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.
ExportRedirectStrategy RedirectStrategy { get; set; }
Source
Gets the redirect alias materialization strategy used by the underlying RazorWire exporter.
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.
string? SeedRoutesPath { get; set; }
Source
Gets an optional path to a seed-route file.
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.
Verifies one catalog-pinned AppSurface Docs release archive without starting a web host.
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.
ValueTask ExecuteAsync(IConsole console)
Source
Executes the command through the CliFx console integration.
consoleConsole abstraction used to register cancellation handling.A value task that completes after archive verification.
string? CatalogPath { get; set; }
Source
Gets the path to the AppSurface Docs version catalog JSON file.
string? Version { get; set; }
Source
Gets the version identifier to verify from the catalog.
string? TrustedReleaseRootPath { get; set; }
Source
Gets the trusted release root used to resolve catalog exactTreePath entries.
Verifies AppSurface Docs harvest health for CI and release gates.
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.
ValueTask ExecuteAsync(IConsole console)
Source
Executes the command through the CliFx console integration.
consoleConsole abstraction used to register cancellation handling.A value task that completes when verification finishes.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Source
Executes the command using an explicit cancellation token.
cancellationTokenToken observed while loading host services and reading harvest health.A value task that completes when verification finishes.
AppSurfaceDocsHealthVerifyArgs BuildVerifyArgs()
Source
Translates CLI options into a one-shot harvest-health verification invocation.
The health verification runner arguments.
bool RequireCompleteEventDoclets { get; set; }
Source
Gets a value indicating whether public JavaScript event doclets must include complete event contract fields.
This forwards AppSurfaceDocs:Harvest:JavaScript:RequireCompleteEventDoclets=true into the verification host without changing runtime startup failure semantics.
bool VerifyEventDispatches { get; set; }
Source
Gets a value indicating whether public JavaScript event doclets should be compared with literal CustomEvent dispatch evidence.
This forwards AppSurfaceDocs:Harvest:JavaScript:VerifyEventDispatches=true into the verification host. Mismatches remain warning-only diagnostics; the command prints them on successful verification runs.
Shared implementation for AppSurface Docs preview commands.
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.
ValueTask ExecuteAsync(IConsole console)
Source
Executes the command through the CliFx console integration.
consoleConsole abstraction used to register cancellation handling.A value task that completes when the preview host exits or command validation fails.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Source
Executes the command using an explicit cancellation token.
cancellationTokenToken observed before the host runner starts.A value task that completes when the preview host exits.
This overload exists for tests and shared command execution paths that already own cancellation registration.
string? Urls { get; set; }
Source
Gets the explicit URL binding forwarded to the AppSurface Docs host.
Use this for a full Kestrel binding such as http://127.0.0.1:5189. Prefer Port when only the port needs to change.
int? Port { get; set; }
Source
Gets the port shortcut forwarded to the AppSurface Docs host.
Use this for local preview scripts that only need a port override. Use Urls for explicit host, scheme, or multi-binding scenarios.
bool AllHosts { get; set; }
Source
Gets a value indicating whether the port shortcut should bind all hosts instead of localhost only.
Use this only with Port when LAN, container, or other non-loopback preview access is intentional.
Shared repository, routing, environment, and startup-timeout options for AppSurface docs commands.
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.
AppSurfaceDocsHostArgs BuildHostArgs(string? defaultEnvironmentName)
Source
Translates shared CLI options into standalone AppSurface Docs host arguments.
defaultEnvironmentNameEnvironment to use when EnvironmentName is blank.The repository root, forwarded host arguments, startup timeout, and resolved environment.
AppSurfaceDocsHostArgs BuildHostArgs(string? urls, int? port, bool allHosts, string? defaultEnvironmentName)
Source
Translates shared and preview-only CLI options into standalone AppSurface Docs host arguments.
urlsOptional explicit preview URL binding.portOptional preview port shortcut.allHostsWhether the preview port shortcut should bind all hosts instead of localhost only.defaultEnvironmentNameEnvironment to use when EnvironmentName is blank.The repository root, forwarded host arguments, startup timeout, and resolved environment.
string RepositoryRoot { get; set; }
Source
Gets the repository root to harvest.
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.
bool StrictHarvest { get; }
Source
Gets a value indicating whether startup should fail when every configured AppSurface Docs harvester fails.
string? RouteRootPath { get; set; }
Source
Gets the route-family root for AppSurface Docs version and archive routes.
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.
string? DocsRootPath { get; set; }
Source
Gets the live docs root path.
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.
string? PublicOrigin { get; set; }
Source
Gets the public origin used for absolute AppSurface Docs canonical metadata.
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.
string? EnvironmentName { get; set; }
Source
Gets the host environment forwarded to the AppSurface Docs standalone host.
Preview defaults to Development so the host can use deterministic per-workspace local endpoints. Export defaults to Production before starting the in-process host.
double StartupTimeoutSeconds { get; set; }
Source
Gets the number of seconds to wait for the web host to start before failing fast.
Defaults to 10 seconds. Set to 0 to disable the startup watchdog. Negative, infinite, and NaN values are rejected before the host starts.
Restores the previous process current directory when disposed.
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.
CurrentDirectoryScope ChangeTo(string directory)
Source
Changes the process current directory and returns a scope that restores the previous value.
directoryDirectory to make current for the scope lifetime.A disposable scope that restores the previous current directory.
void Dispose()
Source
Restores the current directory captured when the scope was created.
Shared repository command options for AppSurface docs commands that expose strict harvest startup behavior.
bool StrictHarvestEnabled { get; set; }
Source
Gets or sets a value indicating whether startup should fail when every configured AppSurface Docs harvester fails.
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.
Describes the AppSurface Docs host invocation produced by the CLI option translator.
RepositoryRootAbsolute repository root that the AppSurface Docs host should harvest.ArgsCommand-line arguments forwarded to the standalone AppSurface Docs host.StartupTimeoutStartup watchdog timeout, or null when disabled.EnvironmentNameResolved host environment, or null when the host should use its default.Describes a one-shot AppSurface Docs static export request.
HostArgsStandalone AppSurface Docs host arguments.OutputPathAbsolute output directory for exported files.SeedRoutesPathOptional absolute seed-route file path.InitialSeedRoutesOptional in-memory seed routes used when SeedRoutesPath is null.ModeRazorWire static export mode.RedirectStrategyRedirect 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.RequestedBaseUrlLoopback URL passed to Kestrel. The default uses port 0 so the OS chooses a free port.HybridOptionsOptional split-origin hybrid settings forwarded into the RazorWire export context.Describes a one-shot AppSurface Docs harvest-health verification request.
HostArgsStandalone AppSurface Docs host arguments.HealthJsonPathApp-relative health JSON path represented by this verification run.RequestedBaseUrlLoopback URL passed to Kestrel. The default uses port 0 so the OS chooses a free port.Result returned by the AppSurface Docs harvest-health verification runner.
HealthParsed health response from the docs host.HttpStatusCodeHTTP status code that the health endpoint would return for this health response.Raw HTTP response returned by the AppSurface Docs harvest-health client seam.
StatusCodeHTTP status returned by the health endpoint.BodyResponse body read from the health endpoint.Applies shared host options required by packaged AppSurface docs tooling.
void ConfigurePackagedToolHost(WebOptions options, TimeSpan? startupTimeout)
Source
Configures the standalone AppSurface Docs host shape used by packaged preview and export commands.
optionsWeb startup options to mutate.startupTimeoutStartup watchdog timeout, or null when disabled.void ConfigureQuietPreviewLogging(ILoggingBuilder logging)
Source
Suppresses routine ASP.NET Core host lifecycle output for interactive AppSurface Docs preview runs.
loggingLogging builder for the preview host.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.
Starts a AppSurface Docs host for CLI preview commands.
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.
Task RunAsync(string[] args, TimeSpan? startupTimeout, CancellationToken cancellationToken)
Source
Runs the AppSurface Docs host with translated command-line arguments.
argsArguments forwarded to the standalone AppSurface Docs host.startupTimeoutStartup watchdog timeout, or null to disable it.cancellationTokenToken that cancels before the host is started.A task that completes when the host exits.
Starts the AppSurface Docs host and exports it to static files.
Task ExportAsync(AppSurfaceDocsExportArgs args, CancellationToken cancellationToken)
Source
Starts the docs host, runs static export, and stops the host.
argsResolved export arguments.cancellationTokenToken observed during host startup and export.A task that completes when export finishes.
Loads the AppSurface Docs host service graph and verifies the redacted harvest-health response.
Task<AppSurfaceDocsHealthVerificationResult> VerifyAsync(AppSurfaceDocsHealthVerifyArgs args, CancellationToken cancellationToken)
Source
Starts the docs host, reads harvest health, and stops the host.
argsResolved verification arguments.cancellationTokenToken observed during host startup and health retrieval.The parsed harvest-health verification result.
Reads the AppSurface Docs harvest-health JSON endpoint.
Task<AppSurfaceDocsHealthHttpResponse> GetAsync(string url, CancellationToken cancellationToken)
Source
Requests a redacted health JSON URL and returns the body regardless of success or failure HTTP status.
urlAbsolute health JSON URL.cancellationTokenToken observed by the HTTP request.The HTTP status and body.
Builds and starts the AppSurface Docs host used by harvest-health verification.
Task<IHost> BuildAndStartAsync(AppSurfaceDocsHealthVerifyArgs args, string environmentName, CancellationToken cancellationToken)
Source
Builds the standalone docs host, starts Kestrel, and returns the started host for health verification.
argsResolved verification arguments.environmentNameResolved host environment.cancellationTokenToken observed while starting the host.The started host.
Adapts the RazorWire static exporter behind a small AppSurface CLI test seam.
Task ExportAsync(ExportContext context, CancellationToken cancellationToken)
Source
Exports the started docs host described by context.
contextRazorWire export context.cancellationTokenToken observed by the export operation.A task that completes when export finishes.
Adds AppSurface Docs-specific export graph state after the host starts and before RazorWire crawls it.
Task ConfigureAsync(IHost host, ExportContext context, CancellationToken cancellationToken)
Source
Configures the export context using services from the started docs host.
hostStarted AppSurface Docs host.contextExport context to configure.cancellationTokenToken observed while resolving host state.A task that completes after context configuration.
Production IAppSurfaceDocsHostRunner that delegates to the standalone AppSurface Docs web host.
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.
Shared exception classification helpers used by command cleanup and best-effort diagnostics.
bool IsNonFatal(Exception ex)
Source
Determines whether an exception is safe to catch for cleanup, fallback logging, or diagnostic reporting.
exException to classify.true when the exception is non-fatal and can be handled locally.
Reads a command-owned harvest summary from a started AppSurface Docs preview host.
Task<AppSurfaceDocsHarvestSummary?> ReadAsync(IHost host, CancellationToken cancellationToken)
Source
Reads the current docs harvest summary if the started host exposes the AppSurface Docs aggregator.
hostStarted preview host.cancellationTokenToken observed while waiting for the first cached docs snapshot.A summary when available; otherwise null.
Concise harvest summary emitted by the AppSurface Docs CLI preview command.
StatusAggregate harvest status.TotalDocsNumber of final documentation nodes in the cached snapshot.TotalHarvestersNumber of active harvesters that participated in the snapshot.SuccessfulHarvestersNumber of harvesters that completed successfully.DiagnosticCountNumber of structured harvest diagnostics in the snapshot.Production IAppSurfaceDocsHarvestSummaryReader that reads DocAggregator health.
Describes a preview AppSurface Docs host startup request.
ArgsArguments forwarded to the standalone AppSurface Docs host.StartupTimeoutStartup watchdog timeout, or null when disabled.Builds and starts the AppSurface Docs preview host.
Task<IHost> BuildAndStartAsync(AppSurfaceDocsPreviewHostArgs args, CancellationToken cancellationToken)
Source
Builds the standalone docs host, starts Kestrel, and returns the started host for preview.
argsResolved preview arguments.cancellationTokenToken observed while starting the host.The started host.
Production IAppSurfaceDocsPreviewHostStarter that uses the AppSurface Docs standalone host builder.
Attempts to open the preview docs URL in the user's browser.
Task<AppSurfaceDocsBrowserLaunchResult> TryOpenAsync(Uri url, CancellationToken cancellationToken)
Source
Attempts to open url in the user's browser without failing the preview command.
urlAbsolute docs URL to open.cancellationTokenToken observed before launch.The browser launch outcome.
Describes the outcome of an attempted browser launch.
SucceededWhether a platform launch command was started successfully.FailureReasonUser-facing failure detail when Succeeded is false.AppSurfaceDocsBrowserLaunchResult Failure(string reason)
Source
Creates a failed browser-launch result.
reasonUser-facing failure detail.A failed browser-launch result.
AppSurfaceDocsBrowserLaunchResult Success { get; }
Source
Gets a successful browser-launch result.
Browser launcher that uses the current operating system's conventional URL opener.
Runs the platform command that asks the operating system to open a browser URL.
Task OpenAsync(Uri url, CancellationToken cancellationToken)
Source
Opens the given URL with the platform opener command.
urlAbsolute URL to open.cancellationTokenToken observed while starting the opener command.A task that completes when the opener command exits.
CliWrap-backed IAppSurfaceDocsBrowserOpenCommandRunner implementation.
Resolves browser-facing URLs for AppSurface Docs preview hosts.
string ResolveRepositoryRoot(IReadOnlyList<string> args, string fallbackRoot)
Source
Resolves the repository root forwarded to the standalone host.
argsArguments forwarded to the standalone host.fallbackRootFallback root used when the forwarded arguments do not contain a repository root.The forwarded repository root when present; otherwise fallbackRoot.
string? ResolveDefaultPreviewUrl(IReadOnlyList<string> args, string repositoryRoot)
Source
Resolves the default preview listener when the CLI invocation did not configure an endpoint explicitly.
argsArguments forwarded to the standalone host.repositoryRootRepository root used as the deterministic-port seed.A localhost URL, or null when explicit endpoint configuration should win.
string ResolveBoundBaseUrl(IHost host)
Source
Resolves the browser-facing base URL from Kestrel's published server addresses.
hostStarted host that exposes Kestrel server addresses.The scheme and authority that should be opened in the browser.
string ResolveBoundBaseUrl(ICollection<string>? addresses)
Source
Resolves the browser-facing base URL from Kestrel's published server addresses.
addressesPublished server addresses.The scheme and authority that should be opened in the browser.
Uri ResolveDocsUrl(string baseUrl, IReadOnlyList<string> args)
Source
Combines the bound host base URL with the configured AppSurface Docs root path.
baseUrlBound host base URL.argsArguments forwarded to the standalone host.The absolute docs page URL to open.
Production export runner that starts the standalone AppSurface Docs host in-process and exports it over real loopback HTTP.
string ResolveBoundBaseUrl(IHost host)
Source
Resolves the single bound loopback base URL published by the started export host.
hostStarted host that exposes Kestrel server addresses.The scheme and authority used by the export crawler.
InvalidOperationExceptionThrown when the host does not publish exactly one valid loopback URL.string ResolveBoundBaseUrl(ICollection<string>? addresses)
Source
Resolves the crawler base URL from a Kestrel address collection.
addressesPublished server addresses.The absolute URL authority to crawl.
InvalidOperationExceptionThrown when no URL, multiple URLs, an invalid URL, or a non-loopback URL is published.Task<IHost> BuildAndStartHostWithTimeoutAsync(AppSurfaceDocsExportArgs args, string environmentName, CancellationToken cancellationToken)
Source
Builds and starts the docs host while enforcing the configured startup watchdog.
argsResolved export arguments.environmentNameEnvironment name applied to the standalone host.cancellationTokenExternal cancellation token for the export operation.The started host.
TimeoutExceptionThrown when the host does not start before the startup timeout.StartupTimeoutCancellationLease CreateStartupTimeout(TimeSpan startupTimeout, CancellationToken cancellationToken)
Source
Creates the linked cancellation source used to distinguish startup timeout from external cancellation.
startupTimeoutStartup timeout to enforce.cancellationTokenExternal cancellation token to link.A disposable lease for the linked startup cancellation source.
void ObserveTimedOutStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)
Source
Observes a startup task that outlived the configured timeout so late completion can stop or log the host.
startTaskBackground startup task to observe.startupTimeoutCtsCancellation source transferred from the timeout branch.void ObserveCanceledStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)
Source
Observes a startup task that outlived external cancellation so late completion can stop or log the host.
startTaskBackground startup task to observe.startupTimeoutCtsCancellation source transferred from the external cancellation branch.Task ObserveStartupTaskAsync(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts, string lateCompletionMessage)
Source
Awaits a late startup task and disposes the host if startup eventually succeeds.
startTaskBackground startup task to observe.startupTimeoutCtsCancellation source owned by the observation task.lateCompletionMessageDebug message used when late startup faults.A task that completes after the late startup task is observed.
TimeoutException CreateStartupTimeoutException(TimeSpan startupTimeout, Exception? innerException)
Source
Creates the user-facing timeout exception for a host that failed to start in time.
startupTimeoutTimeout that elapsed.innerExceptionOptional cancellation exception that came from the startup token.The timeout exception reported to command execution.
Task StopAndDisposeHostAsync(IHost host)
Source
Stops the export host and always disposes it, logging non-fatal shutdown failures.
hostHost to stop and dispose.A task that completes after shutdown and disposal.
Owns a startup cancellation source until timeout observation needs to transfer that ownership.
Task CancelAsync()
Source
Requests cancellation of the owned startup cancellation source.
A task that completes after cancellation callbacks have run.
CancellationTokenSource Transfer()
Source
Transfers cancellation source ownership to a late-startup observer.
The owned cancellation source.
void Dispose()
Source
Disposes the owned cancellation source unless ownership has been transferred.
CancellationToken Token { get; }
Source
Gets the token exposed by the owned startup cancellation source.
Production harvest-health HTTP client used by AppSurfaceDocsInProcessHealthVerifyRunner.
Production IAppSurfaceDocsHealthHostStarter that uses the AppSurface Docs standalone host builder.
Provides a fixed environment name to the standalone host builder during health verification startup.
string? GetEnvironmentVariable(string name, string? defaultValue = null)
Source
Gets environment variable values while overriding ASP.NET and .NET environment variables.
nameEnvironment variable name.defaultValueFallback value when the variable is not set.The fixed host environment for environment-name variables, otherwise the process value or fallback.
string Environment { get; }
Source
Gets the fixed environment name.
bool IsDevelopment { get; }
Source
Gets a value indicating whether the fixed environment is Development.
Starts AppSurface Docs in-process and verifies the redacted harvest-health response over loopback HTTP.
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.
Test-seam configurator used when unit tests provide a fake host that does not contain AppSurface Docs services.
Builds and starts the in-process AppSurface Docs export host.
Task<IHost> BuildAndStartAsync(AppSurfaceDocsExportArgs args, string environmentName, CancellationToken cancellationToken)
Source
Builds the standalone docs host, starts Kestrel, and returns the started host for export.
argsResolved export arguments.environmentNameResolved host environment.cancellationTokenToken observed while starting the host.The started host.
Production IAppSurfaceDocsExportHostStarter that uses the AppSurface Docs standalone host builder.
Provides a fixed environment name to the standalone host builder during export startup.
string? GetEnvironmentVariable(string name, string? defaultValue = null)
Source
Gets environment variable values while overriding ASP.NET and .NET environment variables.
nameEnvironment variable name.defaultValueFallback value when the variable is not set.The fixed host environment for environment-name variables, otherwise the process value or fallback.
string Environment { get; }
Source
Gets the fixed environment name.
bool IsDevelopment { get; }
Source
Gets a value indicating whether the fixed environment is Development.
Production IRazorWireStaticExporter that delegates to RazorWire's ExportEngine.
Previews or explicitly removes stale AppSurface coverage artifacts.
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.
ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)
Source
Executes the cleanup with an explicit cancellation token.
consoleConsole used for user-visible output.cancellationTokenCancellation token observed during filesystem traversal.A task that completes after the preview or deletion summary is written.
string? OutputDirectory { get; set; }
Source
Gets or sets the AppSurface coverage output directory cleaned by the default mode.
bool All { get; set; }
Source
Gets or sets a value indicating whether every descendant TestResults directory should be included.
This is broader than the default ownership-marker mode. It is intended for reclaiming disk space from a bounded local worktree and honors RootDirectory.
string? RootDirectory { get; set; }
Source
Gets or sets the scan root used only by --all.
bool Apply { get; set; }
Source
Gets or sets a value indicating whether the previewed artifacts may be deleted.
Provides the discoverable root for declared, value-safe secret-transfer commands.
Creates a value-free transfer plan for one declared endpoint job.
Applies one previously-created and still-valid secret-transfer plan.
Verifies that a running web app exposes AppSurface-compatible PWA install or push-readiness evidence.
string? Url { get; set; }
Source
Gets the app origin or URL to verify.
string? BaseUrl { get; set; }
Source
Gets the app base URL to verify.
string EntryPath { get; set; }
Source
Gets the app-root-relative entry path whose HTML should expose the manifest link or push registration helper.
string Surface { get; set; }
Source
Gets the verification surface. Install retains the schema-v2 default contract.
string? ExpectedPush { get; set; }
Source
Gets the expected server-known push posture for push or all verification.
string? DiagnosticsPath { get; set; }
Source
Gets the app-root-relative PWA diagnostics base path.
string? ExpectedStartUrl { get; set; }
Source
Gets the expected manifest start_url value.
string? ExpectedScope { get; set; }
Source
Gets the expected manifest scope value.
string? ExpectedDisplay { get; set; }
Source
Gets the expected manifest display mode.
string? ExpectedThemeColor { get; set; }
Source
Gets the expected manifest theme_color value.
string? ExpectedBackgroundColor { get; set; }
Source
Gets the expected manifest background_color value.
string[] ExpectedIcons { get; set; }
Source
Gets expected icon size tokens, optionally followed by a purpose after a colon.
bool Json { get; set; }
Source
Gets a value indicating whether machine-readable JSON should be written.
Task<PwaVerificationV3Report> VerifySurfaceAsync(PwaVerificationOptions options, CancellationToken cancellationToken)
Source
Verifies the additive schema-v3 push or combined readiness surface without modifying the default install path.
Fetches verifier resources without automatically following redirects.
Redirect custody stays with PwaVerifier so origin and path-base boundaries are checked before each hop.
Task<PwaHttpResponse> GetAsync(Uri uri, int maxBodyBytes, CancellationToken cancellationToken)
Source
Fetches one response and reads no more than the requested body limit.
uriThe absolute resource URI.maxBodyBytesThe maximum response-body bytes retained for evidence.cancellationTokenCancels the network request and bounded body read.The response metadata and bounded body.
Adapts HttpClient to the verifier's bounded, redirect-aware fetch contract.
httpClientA client configured with automatic redirect handling disabled.Enabling automatic redirects bypasses the verifier's same-origin and path-base checks.
Captures one bounded HTTP response before verifier-managed redirect handling.
StatusCodeThe actual server status code.ContentTypeThe response media type, or an empty string when absent.BodyBytesThe retained response bytes, capped by the requested read limit.RedirectLocationThe unmodified Location header value, when present.BodyTruncatedWhether bytes beyond the configured read limit were discarded.HeadersOnly the three response-header observations required by strict push verification, preserving duplicate values.IReadOnlyList<string> HeaderValues(string name)
Source
Gets bounded captured values for one strict-verification response header.
bool IsSuccess { get; }
Source
Gets whether the actual response status is in the HTTP 2xx range.
string Body { get; }
Source
Gets the retained body decoded as UTF-8 text.
Binary consumers should use BodyBytes instead.
Represents schema-versioned PWA verification evidence written by the CLI.
SchemaVersionThe JSON evidence schema version.PassedWhether no error-severity diagnostics were recorded.OriginThe verified scheme, host, and port without a path base.BaseUrlThe verified application root, including its path base.EntryPathThe app-root-relative entry path supplied to the verifier.EntryUrlThe absolute entry URL resolved under BaseUrl.ManifestPathThe app-origin-relative manifest path discovered or probed.StartUrlThe manifest start_url value, when parsed.ScopeThe manifest scope value, when parsed.DisplayThe manifest display value, when parsed.ThemeColorThe manifest theme_color value, when parsed.BackgroundColorThe manifest background_color value, when parsed.IconsBounded fetch and dimension evidence for manifest icons.DiagnosticsStable diagnostics supporting the pass or failure result.Consumers should branch on SchemaVersion and diagnostic codes instead of parsing human-readable messages.
Represents the schema-v3 report used only for explicitly requested push or combined PWA readiness verification.
Captures install observations embedded in a schema-v3 combined report.
Captures only server-known, privacy-safe push-readiness evidence.
Captures bounded shared-worker fetch evidence.
Captures bounded registration-helper discovery and fetch evidence.
Captures the safe VAPID identity contributed by the optional Push package.
Pairs schema-v3 push evidence with diagnostics collected while verifying it.
EvidenceThe bounded server-known push evidence.DiagnosticsDiagnostics emitted while collecting the evidence.Holds validated readiness evidence or the sanitized unavailable state.
ConfigurationStatusThe configured, not-configured, or unavailable readiness state.ActiveVapidKeyIdThe safe active VAPID key identifier, when configured.PublicKeyFingerprintThe safe SHA-256 public-key fingerprint, when configured.RouteMappedWhether the package-owned route is mapped, or null when not evaluated.Represents one stable, structured PWA verification observation.
CodeThe stable ASPWA2xx identifier.SeverityThe lowercase error, warning, or info token.MessageA human-readable explanation.SubjectThe bounded manifest field or verifier surface involved.ExpectedThe expected bounded value, when applicable.ActualThe observed redacted value, when applicable.FixA concise remediation, when known.DocsUrlCanonical documentation for the diagnostic, when available.Do not place query strings, fragments, response bodies, or other secrets in structured evidence.
Normalizes the trusted origin, application path base, and real entry route used by one verification run.
OriginThe scheme, host, and port boundary.BaseUriThe application root including its normalized path base.BasePathThe normalized path base ending in a slash.EntryPathThe validated app-root-relative entry path.EntryUriThe entry path resolved beneath BaseUri.Query strings and fragments belong in neither the base URL nor entry path because verifier evidence intentionally excludes them.
PwaVerificationTarget Create(Uri url, string entryPath = "/")
Source
Creates a normalized verification target after enforcing the URL and entry-path boundaries.
urlAn absolute HTTP or HTTPS application root without a query or fragment.entryPathAn app-root-relative path without traversal, query, fragment, or absolute URL syntax.The normalized target used for all verifier requests.
ArgumentExceptionThe URL or entry path violates a verifier boundary.Carries normalized CLI assertions into a PWA verification run.
BaseUrlThe absolute app root to verify.EntryPathThe app-root-relative HTML entry route.ExpectedStartUrlAn optional exact manifest start_url assertion.ExpectedScopeAn optional exact manifest scope assertion.ExpectedDisplayAn optional exact manifest display assertion.ExpectedThemeColorAn optional exact manifest theme_color assertion.ExpectedBackgroundColorAn optional exact manifest background_color assertion.ExpectedIconsParsed icon size and purpose assertions.SurfaceThe requested public verification surface.ExpectedPushThe expected server-known push posture for schema-v3 surfaces.DiagnosticsPathThe normalized app-root-relative PWA diagnostics base path.Target safety is enforced by PwaVerificationTarget.Create(Uri, string) before network access.
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)
Source
Creates verification options and parses repeated icon assertions.
baseUrlThe absolute app root to verify.entryPathThe app-root-relative entry route; blank values normalize to root.expectedStartUrlAn optional exact start_url assertion.expectedScopeAn optional exact scope assertion.expectedDisplayAn optional exact display assertion.expectedThemeColorAn optional exact theme_color assertion.expectedBackgroundColorAn optional exact background_color assertion.expectedIconsRepeated WIDTHxHEIGHT or WIDTHxHEIGHT:purpose assertions.surfaceInstall (default), push, or all.expectedPushEnabled (default) or disabled for push/all surfaces.diagnosticsPathThe app-root-relative PWA diagnostics base path.Normalized options for PwaVerifier.
ArgumentExceptionAn icon assertion is malformed.Parses the accepted install, push, and all PWA verification surface values.
PwaVerificationSurface Parse(string? value)
Source
Parses an optional PWA verification surface value.
valueAn optional install, push, or all value.The parsed surface; a missing value selects install.
ArgumentExceptionThe value is not install, push, or all.Parses the accepted enabled and disabled push-expectation values.
PwaExpectedPush Parse(string? value)
Source
Parses an optional expected push posture value.
valueAn optional enabled or disabled value.The parsed posture; a missing value selects enabled.
ArgumentExceptionThe value is not enabled or disabled.Represents one explicit manifest icon size and optional purpose assertion.
SizeA positive WIDTHxHEIGHT token.PurposeAn optional manifest purpose token such as maskable.PwaExpectedIcon Parse(string value)
Source
Parses a command-line icon assertion.
valueWIDTHxHEIGHT or WIDTHxHEIGHT:purpose.The parsed assertion.
ArgumentExceptionThe size or purpose token is malformed.string ToString()
Source
Formats the assertion using its command-line token shape.
WIDTHxHEIGHT or WIDTHxHEIGHT:purpose.
Captures the final verifier-managed fetch state after zero or more accepted redirects.
FinalUriThe URI that produced Response.ResponseThe actual final response without fabricated sentinel status codes.RedirectLimitExceededWhether this response was an unfollowed redirect beyond the hop limit.Callers must not reinterpret Response as a terminal HTTP failure when RedirectLimitExceeded is true; ASPWA264 is the authoritative failure.
IReadOnlyList<string> HeaderValues(string name)
Source
Gets bounded captured values for one strict-verification response header.
HttpStatusCode StatusCode { get; }
Source
Gets the actual final response status code.
string ContentType { get; }
Source
Gets the actual final response media type.
string Body { get; }
Source
Gets the retained final response body decoded as UTF-8.
byte[] BodyBytes { get; }
Source
Gets the retained final response bytes.
bool IsSuccess { get; }
Source
Gets whether the actual final response is in the HTTP 2xx range.
Represents dimensions decoded directly from a bounded PNG response.
WidthThe positive pixel width.HeightThe positive pixel height.Represents privacy-safe fetch and optional PNG dimension evidence for one manifest icon.
SourceThe manifest src value.SizesThe manifest sizes token list.TypeThe declared media type.PurposeThe declared purpose token list.PathThe fetched app-origin-relative path without query or fragment.ContentTypeThe observed response media type.WidthThe decoded PNG width, when available.HeightThe decoded PNG height, when available.FetchedWhether the icon returned an HTTP 2xx response.Models the manifest fields required for install-readiness verification.
NameThe manifest name.ShortNameThe manifest short_name.StartUrlThe manifest start_url.ScopeThe manifest scope.DisplayThe manifest display mode.ThemeColorThe manifest theme_color.BackgroundColorThe manifest background_color.IconsThe manifest icon declarations.Models one manifest icon declaration without trusting it as fetched evidence.
SourceThe manifest src value.SizesThe space-delimited manifest sizes tokens.TypeThe declared media type.PurposeThe space-delimited manifest purpose tokens.Models the server-known AppSurface PWA diagnostics used for install, worker, offline, and push posture checks.
EnabledWhether AppSurface PWA metadata is enabled.OfflineEnabledWhether the offline strategy is enabled.ServiceWorkerPathThe active service-worker path when offline is enabled.OfflineFallbackPathThe active offline fallback path when offline is enabled.ConfiguredServiceWorkerPathThe configured worker path used to prove absence when offline is disabled.WorkerEnabledWhether either offline or push configuration activates the shared service worker.WorkerPathThe active shared service-worker path when a worker capability is enabled.PushEnabledWhether push event handling is enabled in the shared service worker.WorkerScopeThe effective registration scope for the shared service worker.RegistrationHelperPathThe registration-helper path exposed when push is enabled.PushReadinessThe additive schema-versioned safe readiness contribution, when supported by the server.These server-known values do not prove browser runtime capability or registration state.
Models the versioned, sanitized push-readiness source object emitted by current Web servers.
Identifies the public PWA verification surface.
Identifies the expected server-known push posture.
Converts private coverage-core failures into the stable CliFx command contract.
CommandException Map(CoverageExecutionException exception)
Source
Maps a core failure without changing its rendered diagnostic or terminal exit code.
Creates stable command-layer validation diagnostics before a request enters the coverage core.
CommandException Create(string code, string problem, string cause, string fix, string docs, string? logPath = null)
Source
Creates a stable CLI diagnostic using the existing coverage message shape.
Writes the stable binding between one coverage-run project directory and the project that owns it.
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.
Task WriteAsync(string projectOutputDirectory, string solutionDirectory, CoverageRunProject project, CancellationToken cancellationToken)
Source
Writes the project-to-artifact-directory binding as a complete UTF-8 JSON document.
projectOutputDirectoryExisting project artifact directory.solutionDirectoryDirectory used to resolve and run the selected project.projectSelected project with its allocated artifact slug.cancellationTokenCancellation token for the staged write.A task that completes after the manifest has been atomically promoted.
Provides the discoverable root for AppSurface local secret commands.
ValueTask ExecuteAsync(IConsole console)
Source
Prints the local secrets command family summary.
consoleCliFx console used for command output.A completed task.
Initializes or verifies a LocalSecrets namespace.
Writes a local secret value.
string? Value { get; set; }
Source
Gets or sets the secret value.
bool ReadFromStandardInput { get; set; }
Source
Gets or sets a value indicating whether to read the secret value from standard input.
Verifies a local secret exists without printing its value.
Lists currently retrievable local secret names in a namespace.
bool NamesOnly { get; set; }
Source
Gets or sets a value indicating whether to print only secret names.
Explicitly migrates readable legacy macOS LocalSecrets records into the current v2 Keychain namespace.
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.
Deletes one local secret.
Diagnoses LocalSecrets platform availability.
Shared options and helpers for local secret commands.
ValueTask ExecuteAsync(IConsole console)
Source
Executes the command.
consoleCliFx console used for command output.A value task that completes when the command finishes.
SecretsCommandContext BuildContext()
Source
Builds a normalized command context.
The command context.
IAppSurfaceLocalSecretStore CreatePlatformStore(AppSurfaceLocalSecretsOptions options)
Source
Creates the OS-backed LocalSecrets store for commands that do not use the deterministic file store.
optionsOptions derived from the CLI command line.The platform-backed local secret store.
ValueTask WriteResultAsync(IConsole console, AppSurfaceLocalSecretResult result, string successVerb)
Source
Writes a command result.
consoleCliFx console used for command output.resultThe local secret result.successVerbThe success verb to display.A value task that completes when output is written.
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.
string ApplicationName { get; set; }
Source
Gets or sets the AppSurface application identity.
string EnvironmentName { get; set; }
Source
Gets or sets the AppSurface environment identity.
string? KeyPrefix { get; set; }
Source
Gets or sets an optional LocalSecrets key prefix.
string? StoreFile { get; set; }
Source
Gets or sets an optional file-backed store path for deterministic examples and tests.
string? SecretToolPath { get; set; }
Source
Gets or sets an explicit Linux secret-tool executable path for nonstandard trusted installs.
Shared options for commands that target one local secret key.
AppSurfaceLocalSecretIdentity Normalize(SecretsCommandContext context)
Source
Normalizes the configured key into a local secret identity.
contextThe command context.The local secret identity.
string Key { get; set; }
Source
Gets or sets the AppSurface config key.
Captures normalized command state.
NormalizerIdentity normalizer.StoreLocal secret store.ApplicationNameNormalized application identity.EnvironmentNormalized environment identity.KeyPrefixNormalized optional key prefix.Writes bounded failure-first test results and best-effort slow-test diagnostic artifacts for coverage run.
WriteAsync may write artifacts twice when aggregation timing changes during the initial write.Task<CoverageRunSlowTestDiagnosticsReport> CollectAsync(IReadOnlyList<CoverageProjectRunResult> results, CancellationToken cancellationToken, Action<int>? observeProgress = null)
Source
Parses managed JUnit files and builds a diagnostic report.
resultsProject run results with managed test result artifact paths.cancellationTokenCancellation token for artifact reads.observeProgressOptional callback that receives positive parsing and aggregation progress counts.Slow-test diagnostic report model.
Task<CoverageRunSlowTestDiagnosticsRun> WriteAsync(string stagedMarkdownPath, string stagedJsonPath, string artifactDirectory, CoverageRunSlowTestDiagnosticsReport report, Func<long> getAggregationSeconds, Func<long, decimal> calculateAggregationPercent, CancellationToken cancellationToken, Action<int>? observeProgress = null)
Source
Writes diagnostics to private same-directory staging files while recording canonical artifact paths in their contents.
stagedMarkdownPathUnique private Markdown path alongside its canonical destination.stagedJsonPathUnique private JSON path alongside its canonical destination.artifactDirectoryCanonical directory represented in returned and embedded artifact paths.reportReport model returned by CollectAsync.getAggregationSecondsReads elapsed diagnostic aggregation seconds.calculateAggregationPercentCalculates aggregation overhead as a percent of runner time.cancellationTokenCancellation token for artifact writes.observeProgressOptional callback that receives positive staging progress counts.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.
void TryDeleteStagedFile(string path)
Source
Best-effort deletes a staging or backup path created by this diagnostics operation.
pathPrivate path whose removal is safe after its creation was confirmed.Delegates stream operations while reporting positive byte counts from reads.
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.
Written slow-test diagnostic artifact metadata.
MarkdownPathCanonical Markdown destination recorded in the diagnostics.JsonPathCanonical JSON destination recorded in the diagnostics.AggregationSecondsElapsed time spent collecting and writing diagnostics.AggregationPercentDiagnostic overhead relative to the coverage run.WarningCountNumber of collected diagnostics warnings.MetadataCompleteWhether all requested test metadata was collected.ParserStatusesParse status for each managed JUnit artifact.StagedMarkdownPathPrivate Markdown staging path the caller must promote or delete.StagedJsonPathPrivate JSON staging path the caller must promote or delete.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.
Slow-test diagnostic report before overhead fields are finalized.
SchemaVersionVersion of the serialized diagnostics schema.GeneratedAtUtcUTC time at which diagnostics aggregation completed.MetadataCompleteWhether every requested managed JUnit artifact parsed without warnings.JunitFileCountNumber of managed JUnit artifacts that were present during aggregation.ProjectsPer-project execution and parser metadata.TestCaseCountTotal number of parsed JUnit test cases.FailedTestCaseCountNumber of parsed test cases with failed or error status.ErrorTestCaseCountNumber of parsed test cases with error status.SkippedTestCaseCountNumber of parsed skipped test cases.FailedTestCasesBounded, stable failed and errored test-case details for CI triage.TopTestCasesBounded, descending-duration test-case list for rendered artifacts.WarningsBounded diagnostics warnings encountered during aggregation.Project timing metadata included in slow-test diagnostics.
Best-effort parse result for one managed JUnit file.
Parsed JUnit test case timing and bounded failure evidence included in diagnostics.
ClassNameJUnit class name.NameJUnit test name.SecondsOptional parsed test duration.StatusParsed JUnit outcome.ProjectSolution-relative project that emitted the JUnit result.JunitFileManaged JUnit source file.FailureDetailBounded failure message and stack trace for failed or errored tests.Provides the discoverable root for consumer-owned release-note workflows.
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.
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.
CoverageRunOutputLease Acquire(string outputPath, Func<int, uint, int>? unixFChmod = null, Func<int, string, int, int>? unixUnlinkAt = null)
Source
Independently opens or creates every output-path component without following links.
outputPathAbsolute output directory path.unixFChmodOptional Unix permission operation used to verify marker-creation failures.unixUnlinkAtOptional Unix unlink operation used to verify staged-artifact cleanup failures.A lease retaining every opened component until disposal.
CoverageRunOutputLease? AcquireExisting(string outputPath)
Source
Independently opens every existing output-path component without creating a missing directory.
outputPathAbsolute output directory path.A retained lease, or null when the output directory does not exist.
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.
void ValidateExisting(string outputPath)
Source
Validates the existing path and output ownership without creating missing components.
outputPathAbsolute output directory path.void Prepare(bool clean, Action? beforeMutation, Action? beforeCleanup)
Source
Revalidates ownership, optionally removes known artifacts, and creates the marker and projects directory through the retained output object.
cleanWhether known artifacts should be removed.beforeMutationOptional test seam called after acquisition and before mutation.beforeCleanupOptional test seam called after authorization revalidation and before cleanup.CoverageOwnedCleanupPlan CleanKnownOwnedArtifacts(bool apply)
Source
Returns AppSurface-owned entries that an explicit coverage clean operation may remove and, when requested, deletes them through this retained output-directory lease.
applyWhether the known entries should be deleted after validation.A marker-ownership result and the relative entries selected for cleanup.
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.
void ValidateOwnedGateArtifacts(IReadOnlyList<string> artifactNames)
Source
Validates that each named gate artifact is either absent or a regular file in the retained output directory.
artifactNamesOwned gate artifact filenames to validate.Task WriteOwnedGateArtifactAsync(string artifactName, string contents, CancellationToken cancellationToken)
Source
Writes one owned gate artifact through the retained output directory.
artifactNameOwned gate artifact filename.contentsComplete UTF-8 artifact content.cancellationTokenCancellation token for the artifact content write.A task that completes after the complete artifact content is committed.
The content is staged privately before promotion so cancellation or a write failure leaves a pre-existing report intact.
void DeleteOwnedGateArtifact(string artifactName)
Source
Removes one owned gate artifact through the retained output directory when it exists.
artifactNameOwned gate artifact filename.string NormalizePlatformPath(string path)
Source
Canonicalizes fixed operating-system aliases before safety comparisons and no-follow traversal.
pathAn absolute platform path.The path with only fixed operating-system aliases canonicalized.
Provides the discoverable root for AppSurface EvidenceHost commands.
Creates a marked, non-overwriting EvidenceHost starter for an existing repository.
string RootPath { get; set; }
Source
Gets or sets the destination directory for generated starter files.
bool Force { get; set; }
Source
Gets or sets a value indicating whether an existing marked starter may be replaced.
bool Sample { get; set; }
Source
Gets or sets a value indicating whether to generate the supported v1 sample.
Checks selected EvidenceHost prerequisites without provisioning resources or executing tests.
Resolves a policy and explicit diff into a plan without starting resources or executing producers.
string OutputDirectory { get; set; }
Source
Gets or sets the output directory for plan and summary artifacts.
Executes the selected built-in evidence producer and emits a truthful manifest.
string OutputDirectory { get; set; }
Source
Gets or sets the output directory for plan, manifest, and producer artifacts.
string? SolutionPath { get; set; }
Source
Gets or sets the solution supplied to the in-process coverage producer.
bool ObservationOnly { get; set; }
Source
Gets or sets a value indicating whether the run is informative only and cannot satisfy a gate.
Verifies that an immutable evidence manifest binds to its resolved plan without rerunning producers.
string ManifestPath { get; set; }
Source
Gets or sets the manifest path to verify.
string? PlanPath { get; set; }
Source
Gets or sets the resolved plan path. Defaults next to the manifest.
Provides shared policy and diff options for non-mutating and execution EvidenceHost commands.
EvidencePlanningRequest CreatePlanningRequest()
Source
Creates the explicit policy-and-diff input consumed by a planning operation.
EvidenceCliWorkflow Workflow { get; }
Source
Gets the policy-planning workflow shared by derived EvidenceHost commands.
string PolicyPath { get; set; }
Source
Gets or sets the checked-in evidence policy path.
string[] Paths { get; set; }
Source
Gets or sets explicit changed repository-relative paths. Repeat for multiple paths.
string? DiffFile { get; set; }
Source
Gets or sets an optional unified diff used to derive changed paths.
Creates provider clients for declared Google transfer endpoints.
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.
Persists value-free receipt snapshots for crash-safe transfer recovery.
void Write(string path, SecretPromotionReceipt receipt)
Source
Atomically replaces the receipt at path.
pathDestination receipt path.receiptValue-free journal snapshot.Writes receipt snapshots through same-directory atomic replacement.
string ValidateCredentialFile(string? value, bool? isWindows = null)
Source
Validates a credential file path without returning its contents or path in diagnostics.
valueAbsolute credential-file path.isWindowsOptional platform seam used to verify fail-closed Windows behavior.The canonical absolute path after posture validation.
Runs declared, value-safe transfer jobs.
SecretPromotionRowResult ProbeLocalDestination(SecretPromotionPlanRow row, bool replace)
Source
Maps a captured local precondition to a value-safe planning result.
rowPlan row carrying the captured local precondition.replaceWhether the plan explicitly authorizes a guarded replacement.The value-safe planning result for the captured local state.
SecretPromotionRowResult MapLocalWriteResult(SecretPromotionPlanRow row, LocalCoordinatorWriteResult result)
Source
Maps a guarded local coordinator write outcome to a value-safe transfer row.
rowPlanned local destination row.resultCoordinator write or recovery result to render.The value-safe transfer row corresponding to the coordinator result.
bool IsProductionJob(ResolvedEndpoints endpoints)
Source
Returns whether either declared endpoint carries the production environment label.
string? SecretParentForVersionResource(string? value)
Source
Returns the canonical Google secret parent for a syntactically valid version resource.
Invalid resources return null so their existing shape diagnostic remains authoritative.
string ComputePlanIdentity(SecretPromotionPlanArtifact plan)
Source
Computes the value-free identity that binds every field of a transfer plan.
planPlan artifact whose identity fields should be hashed.Lowercase SHA-256 identity for the supplied artifact.
Describes a value-free request to create a transfer plan.
ConfigPathPath to the reviewed endpoint and job configuration.JobNameExact declared job name to plan.OutputPlanPathDestination for the value-free plan artifact.ReplaceWhether a Google destination may receive another version or an attested local destination may be replaced.ExpiryPositive lifetime after which apply must reject the plan.ContextLocalSecrets identity and metadata-only store context.Describes a dry-run or mutation-gated transfer apply request.
ConfigPathPath to the same reviewed configuration used for planning.PlanPathPath to the unexpired value-free plan.ApplyWhether destination mutations are permitted; false performs apply preflight only.ConfirmationExact job name required for production-labelled transfers and every guarded local replacement.ReceiptPathOptional value-free receipt path; defaults beside the plan.ResumeReceiptPathOptional prior receipt whose confirmed writes may be skipped.ContextLocalSecrets identity and store context used only after preflight permits payload access.Wraps the display-safe result returned after plan creation.
SummaryValue-free row summary and plan location.Defines the versioned endpoint and named-job configuration authorization boundary.
VersionConfiguration schema version: v1 writes an existing Google destination; v2 materializes pinned Google versions into LocalSecrets.EndpointsExplicit remote endpoint profiles; LocalSecrets is the built-in local endpoint.JobsReviewed jobs that bind exact sources, version-specific destinations, and rows.Declares one named provider endpoint without embedding credential values.
NameCase-sensitive endpoint name referenced by jobs.ProviderProvider identifier: google or the built-in local endpoint where the selected schema direction permits it.EnvironmentEnvironment label used to enforce production rules.CredentialExplicit Google credential mode; null is valid only for the built-in local endpoint.Chooses a Google credential acquisition mode without carrying raw credentials.
ModeapplicationDefault or credentialFile.PathAbsolute restricted credential-file path when that mode is selected; never emitted.Declares one reviewed, direction-specific transfer job.
NameCase-sensitive job identity used by plan, confirmation, and receipt checks.SourceBuilt-in local or a declared Google endpoint name.DestinationDeclared Google endpoint in v1, or the built-in local endpoint in v2.AllowMutableLocalSourceExplicit production exception for a mutable LocalSecrets source.RowsOrdered explicit key and resource mappings.Maps one logical LocalSecrets key to explicit provider resources.
KeyRequired logical AppSurface configuration key and row identity.SourceExplicit Google version resource, or null for a LocalSecrets source.DestinationExplicit existing Google secret parent resource in v1; omitted for a v2 LocalSecrets destination.Persists an expiring, value-free plan bound to all safety-relevant fields.
VersionPlan schema version.JobNameDeclared job identity.ConfigDigestDigest of the exact endpoint configuration bytes.CreatedAtUtcUTC creation timestamp included in plan identity.ExpiresAtUtcUTC expiration enforced before payload access.ReplaceWhether another enabled Google version or an attested LocalSecrets value is authorized to be replaced.ProductionValue-free production label captured for review.ReadyWhether all plan-time probes were ready or intentionally skipped.PlanIdentityStable SHA-256 identity over every plan safety field and row precondition.RowsOrdered canonical mappings and destination preconditions; never payloads.Captures one canonical, value-free plan row and its destination precondition.
RowNumberOne-based declared processing order.KeyExplicit logical LocalSecrets key.SourceEndpointDeclared source endpoint name.SourceResourceCanonical Google version resource, or local.DestinationEndpointDeclared Google destination endpoint or built-in local endpoint.DestinationResourceCanonical existing Google secret parent; null for a v2 LocalSecrets destination.LocalStorageNameNormalized LocalSecrets identity used to detect duplicate logical mappings.DestinationHasEnabledVersionsGoogle enabled-version precondition captured during planning.DestinationExistsLocal destination existence precondition in v2; null for v1 Google destinations.SecretPromotionRowResult Result(string status, string action, string? diagnosticCode, string? problem, bool? retryable, string? writtenResource = null)
Source
Creates a value-free row result while preserving canonical row identity.
statusStable workflow status.actionDisplay-safe operation classification.diagnosticCodeOptional stable diagnostic code.problemOptional paste-safe problem statement.retryableWhether an operator may retry without reconciliation.writtenResourceConfirmed written Google version resource, when available; null for a local write.A result that never includes secret payloads.
SecretPromotionRowResult GoogleSourceFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)
Source
Maps a Google source failure without misclassifying destination absence.
actionSource probe or access action.statusProvider status to classify.diagnosticOptional value-safe provider diagnostic.A value-free source result.
SecretPromotionRowResult GoogleDestinationFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)
Source
Maps a Google destination failure, preserving indeterminate write state.
actionDestination probe or write action.statusProvider status to classify.diagnosticOptional value-safe provider diagnostic.A value-free destination result.
string? DestinationKind { get; init; }
Source
Gets the destination contract for a v2 row; null preserves the v1 Google-only artifact shape.
string? LocalAttestationOperationId { get; init; }
Source
Gets the committed local attestation captured as a guarded replacement precondition for a v2 row.
string? LocalPreconditionKind { get; init; }
Source
Gets the value-free local precondition classification captured for a v2 plan row.
string? LocalPreconditionDiagnosticCode { get; init; }
Source
Gets the value-safe diagnostic code captured when local preflight could not establish a valid precondition.
string? LocalPreconditionProblem { get; init; }
Source
Gets the value-safe precondition problem captured for a failed v2 plan row.
bool? LocalPreconditionRetryable { get; init; }
Source
Gets whether the local precondition failure is safe to retry without reconciliation.
Reports one value-free row outcome.
RowNumberOne-based declared processing order.KeyLogical AppSurface key; never its value.SourceEndpointDeclared source endpoint name.SourceResourceCanonical source identity.DestinationEndpointDeclared Google destination endpoint or built-in local endpoint.DestinationResourcePlanned Google secret parent or confirmed written version resource; null for local writes.StatusStable result classification.ActionDisplay-safe action classification.DiagnosticCodeOptional stable diagnostic code.ProblemOptional paste-safe problem statement.RetryableWhether retry is safe without reconciliation.string? DestinationKind { get; init; }
Source
Gets the v2 destination kind when the result belongs to a local transfer row.
Aggregates ordered value-free plan or apply results.
Operationplan or apply.JobDeclared job name.ApplyWhether payload reads and destination writes were permitted.SucceededWhether every row completed or was intentionally skipped.RowsOrdered value-free row outcomes.PlanPathWritten plan path for plan output.ReceiptPathWritten receipt path when surfaced by a caller.Provides the durable, value-free apply journal and resume evidence.
PlanJobExact job name from the plan.ConfigDigestExact configuration digest from the plan.PlanIdentityIdentity binding every safety field and destination precondition.RowsAtomically persisted ordered outcomes; indeterminate rows block automatic resume.Provides the discoverable root for AppSurface durable deployment commands.
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.
Provides the discoverable root for explicit durable schema operations.
Prints installed and required durable schema versions without mutation.
Generates deterministic SQL for pending numbered migrations without opening a database connection.
int FromVersion { get; set; }
Source
Gets or sets the last migration already installed.
string? OutputPath { get; set; }
Source
Gets or sets an optional output path. The script is written to standard output when omitted.
bool Force { get; set; }
Source
Gets or sets whether an existing output file may be atomically replaced.
Applies pending migrations through an explicitly configured migration-owner connection.
bool Apply { get; set; }
Source
Gets or sets the required mutation confirmation.
Fails noninteractively unless the installed schema supports this runtime's readers and writers.
Shared connection-source option and safety behavior for durable schema commands.
IDurableSchemaCommandService Service { get; }
Source
Gets the injected schema command service.
Supplies the secret-safe connection source and bounded execution shared only by online schema commands.
string ResolveConnectionString()
Source
Resolves a connection string without printing or persisting it.
ValueTask<T> RunOnlineAsync<T>(string connectionString, CancellationToken cancellationToken, Func<string, CancellationToken, ValueTask<T>> operation)
Source
Runs an online command with a bounded linked cancellation token and safe provider failure mapping.
ValueTask WriteStatusAsync(IConsole console, DurableSchemaStatusView status)
Source
Writes a stable schema status without exposing connection or server details.
string ConnectionEnvironmentVariable { get; set; }
Source
Gets or sets the environment variable that contains the PostgreSQL connection string.
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.
Testable CLI boundary over the PostgreSQL schema manager.
ValueTask<DurableSchemaStatusView> GetStatusAsync(string connectionString, CancellationToken cancellationToken)
Source
Reads compatibility without mutation.
string GenerateScript(int fromVersion)
Source
Generates deterministic migration SQL without opening a connection.
ValueTask<DurableSchemaApplyView> ApplyAsync(string connectionString, CancellationToken cancellationToken)
Source
Applies pending migrations with the supplied bounded token.
Production CLI adapter that creates and disposes a short-lived Npgsql data source per online command.
CLI-safe schema compatibility projection.
CompatibilityThe package-defined compatibility state that determines whether durable reads and writes may begin.InstalledVersionThe non-negative durable schema version currently installed in the target database.RequiredVersionThe non-negative durable schema version required by this package version.PendingVersionsThe ordered, non-null migration versions that remain to be applied; empty when no migration is pending.DurableSchemaStatusView From(DurableRuntimeSchemaStatus status)
Source
Projects only safe schema status fields for the CLI.
bool IsCompatible { get; }
Source
Gets whether schema reads and writes may begin.
CLI-safe schema apply projection.
FromVersionThe non-negative schema version observed before the explicit apply operation began.ToVersionThe non-negative schema version observed after the apply operation completed.AppliedVersionsThe ordered, non-null migration versions applied by this invocation; empty when the schema was already current.Renders stable, secret-safe schema diagnostics.
string PreflightFailure(DurableRuntimeSchemaCompatibility compatibility)
Source
Builds the single-block incompatibility diagnostic used by preflight.
string SchemaIncompatible(DurableRuntimeSchemaCompatibility compatibility)
Source
Builds a stable failure for schema-manager incompatibility.
string Cause(DurableRuntimeSchemaCompatibility compatibility)
Source
Returns a package-defined safe explanation without forwarding server exception text.
Writes generated scripts with atomic publication and explicit overwrite protection.
Task<string> WriteAsync(string requestedPath, string script, bool force, CancellationToken cancellationToken)
Source
Writes script beside the requested destination then atomically publishes it.
IDisposable UseTemporaryFileWrittenHookForTesting(Action callback)
Source
Runs a callback after temporary SQL output is written and before publication.
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.
Reads an HTTP response body without retaining more than a caller-provided byte limit.
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.
Task<BoundedHttpBody> ReadAsync(HttpContent content, int maxBodyBytes, CancellationToken cancellationToken)
Source
Reads one content stream up to the configured byte limit.
contentThe response content to read.maxBodyBytesThe maximum number of bytes retained.cancellationTokenCancels the bounded read.The retained bytes and whether additional bytes were discarded.
Captures the bounded result of one HTTP response-body read.
BytesThe retained bytes, capped at the requested maximum.TruncatedWhether bytes beyond the requested maximum were discarded.Coordinates AppSurface-owned remote-to-local transfers without persisting secret values.
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.
bool Supports(IAppSurfaceLocalSecretStore store)
Source
Gets whether the CLI can coordinate the supplied built-in store in v2.
LocalCoordinatorPrecondition CapturePrecondition(AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool replace)
Source
Captures the value-free local destination precondition for a v2 plan row.
LocalCoordinatorCheck Recheck(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool allowPreparedRecovery)
Source
Rechecks a plan-bound local precondition before source payload access.
LocalCoordinatorWriteResult WriteOrRecover(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, string value, bool allowPreparedRecovery)
Source
Writes a local value after rechecking its plan-bound precondition under the coordinator lock.
LocalCoordinatorCheck VerifyCommitted(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store)
Source
Confirms that a receipt's local row still has matching coordinator evidence.
AppSurfaceLocalSecretResult InvalidateBeforeMutation(IAppSurfaceLocalSecretStore store, AppSurfaceLocalSecretIdentity identity, Func<AppSurfaceLocalSecretResult> mutation)
Source
Invalidates any committed transfer attestation before a normal local CLI mutation.
string GetDefaultStateRoot(string? localApplicationData, string userProfile)
Source
Builds the default per-user transfer state directory from platform folder values.
localApplicationDataPlatform local-application-data root, if available.userProfilePlatform user-profile root used when local application data is unavailable.The absolute AppSurface secret-transfer state directory.
Validates fixed-length lowercase hexadecimal transfer identities.
bool IsLowerHex(string? value, int length)
Source
Gets whether a value is lowercase hexadecimal with the required length.
valueCandidate value to validate.lengthRequired character length.true when the value has the required lowercase hexadecimal shape.
Provides deterministic coordinator failure injection for internal tests.
Action<string>? BeforeEnsureStateRoot { get; init; }
Source
Runs immediately before the coordinator verifies or creates its state directory.
Action<string>? BeforeAcquireLock { get; init; }
Source
Runs immediately before the coordinator opens a per-secret transfer lock.
Action<string>? BeforeSecureLockFile { get; init; }
Source
Runs after the coordinator opens a lock file and before it restricts the file to the current user.
Action<string>? BeforeReadJournal { get; init; }
Source
Runs immediately before the coordinator reads an existing transfer journal.
Action<string>? AfterWriteTemporaryJournal { get; init; }
Source
Runs after a temporary journal has been written and before it is secured and committed.
Action<string>? BeforeSecureTemporaryJournal { get; init; }
Source
Runs immediately before the coordinator restricts a temporary journal to the current user.
Action<string>? BeforeDeleteTemporaryJournal { get; init; }
Source
Runs immediately before cleanup deletes an uncommitted temporary journal.
Action<string>? BeforeDeleteJournal { get; init; }
Source
Runs immediately before an attestation journal is removed for an ordinary mutation.
Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreDoctor { get; init; }
Source
Supplies the LocalSecrets doctor result instead of calling the store.
Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreProbe { get; init; }
Source
Supplies the LocalSecrets metadata probe result instead of calling the store.
Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, AppSurfaceLocalSecretResult>? StoreGet { get; init; }
Source
Supplies the LocalSecrets recovery read result instead of calling the store.
Func<IAppSurfaceLocalSecretStore, AppSurfaceLocalSecretIdentity, string, AppSurfaceLocalSecretResult>? StoreSet { get; init; }
Source
Supplies the LocalSecrets write result instead of calling the store.
Describes the captured local precondition without exposing local values.
LocalCoordinatorPrecondition Missing()
Source
Creates a precondition for a local target that is absent.
A missing-target precondition with no attestation or failure.
LocalCoordinatorPrecondition Replace(string previousOperationId)
Source
Creates a precondition that permits a guarded replacement.
previousOperationIdCommitted attestation operation identifier that authorizes replacement.A replacement precondition bound to the supplied prior operation.
LocalCoordinatorPrecondition Conflict(LocalCoordinatorFailure failure)
Source
Creates a precondition that blocks transfer because the local target conflicts with the plan.
failureValue-safe explanation of the conflict.A conflict precondition carrying the supplied failure.
LocalCoordinatorPrecondition Unsupported()
Source
Creates a precondition for a local store that cannot participate in coordinated transfer.
An unsupported-store precondition with its stable failure diagnostic.
LocalCoordinatorPrecondition Failed(LocalCoordinatorFailure failure)
Source
Creates a precondition that failed before a safe local state could be established.
failureValue-safe failure that prevented precondition capture.A failed precondition carrying the supplied failure.
Describes a local destination check without exposing local values.
LocalCoordinatorCheck Ready()
Source
Creates a check result that permits the planned operation.
A ready result without a failure.
LocalCoordinatorCheck PreparedRecovery()
Source
Creates a check result that requires safe reconciliation of a prepared transfer.
A prepared-recovery result without a failure.
LocalCoordinatorCheck Conflict()
Source
Creates a check result that blocks the operation because current state conflicts with the plan.
A conflict result without a failure because the plan mismatch is the diagnostic.
LocalCoordinatorCheck Indeterminate()
Source
Creates a check result whose prior write state cannot be safely determined.
An indeterminate result without a failure because reconciliation is required.
LocalCoordinatorCheck Unsupported()
Source
Creates a check result for a local store that cannot participate in coordinated transfer.
An unsupported-store result with its stable failure diagnostic.
LocalCoordinatorCheck Failed(LocalCoordinatorFailure failure)
Source
Creates a check result that failed before the local state could be safely rechecked.
failureValue-safe failure that prevented the recheck.A failed result carrying the supplied failure.
Describes a guarded local write or recovery outcome.
LocalCoordinatorWriteResult Created()
Source
Creates a successful create outcome.
A created result without a failure.
LocalCoordinatorWriteResult Replaced()
Source
Creates a successful guarded replacement outcome.
A replaced result without a failure.
LocalCoordinatorWriteResult Recovered()
Source
Creates a successful recovery outcome for a matching prepared write.
A recovered result without a failure.
LocalCoordinatorWriteResult Conflict()
Source
Creates a write outcome blocked by a changed local target or attestation.
A conflict result without a failure because the plan mismatch is the diagnostic.
LocalCoordinatorWriteResult Indeterminate(LocalCoordinatorFailure? failure = null)
Source
Creates an outcome whose write state requires reconciliation before another write.
failureOptional value-safe detail; omitted when the coordinator cannot determine a more specific cause.An indeterminate result; a null failure means callers must use the generic reconciliation diagnostic.
LocalCoordinatorWriteResult Unsupported()
Source
Creates a write outcome for a local store that cannot participate in coordinated transfer.
An unsupported-store result with its stable failure diagnostic.
LocalCoordinatorWriteResult Failed(LocalCoordinatorFailure failure)
Source
Creates a write outcome that failed before a safe completion could be established.
failureValue-safe failure that prevented a confirmed write result.A failed result carrying the supplied failure.
Contains a stable, value-safe local coordinator failure.
Persists only transfer identity and state, never a secret value or a value-derived hash.
Classifies the value-free precondition captured for a local transfer target.
Classifies a value-free recheck of a plan-bound local destination.
Classifies a guarded local write or recovery outcome.
Tracks the value-free lifecycle of a local transfer journal.
Appends the bounded coverage-gate Markdown artifact to a GitHub Actions step summary.
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.
Task AppendAsync(string? githubStepSummaryPath, string markdownReportPath, CancellationToken cancellationToken)
Source
Appends the supplied Markdown artifact when GitHub provided a summary path.
Provides the discoverable root for AppSurface coverage commands.
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.
ValueTask ExecuteAsync(IConsole console)
Source
Prints the coverage command family summary.
consoleCliFx console used for command output.A completed task.
Exports an AppSurface/RazorWire application through the product-facing appsurface export command.
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.
string? PublishRootExtrasPath { get; set; }
Source
Gets or sets an optional path to a publish-root deployment extras manifest.
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.
string? LiveOrigin { get; set; }
Source
Gets or sets the optional live origin for RazorWire-managed split-origin hybrid interactions.
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.
RazorWireHybridCredentialsMode HybridCredentials { get; set; }
Source
Gets or sets credential behavior for RazorWire-managed live calls in hybrid output.
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.
Parses the intentionally narrow duration grammar used by coverage watchdog options.
TimeSpan Parse(string? value, string option, bool allowZero)
Source
Parses a lowercase integer duration such as 500ms, 30s, 10m, or 1h.
valueRaw option value.optionOption name used in diagnostics.allowZeroWhether the exact value 0 is accepted.The parsed duration.
Serializes coverage-run console messages so heartbeat and incident blocks do not interleave.
Task WriteOutputAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true, bool coalesceIfWritePending = false)
Source
Writes one serialized block to standard output.
textComplete output block.cancellationTokenBounds how long the caller waits without cancelling an accepted write.appendNewLineWhether to append the platform newline.coalesceIfWritePendingWhether to omit this periodic update when an earlier write is still pending. Diagnostic and terminal blocks must leave this disabled.A task that completes when the write finishes or the caller's bounded wait ends.
Task WriteErrorAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true)
Source
Writes one serialized block to standard error.
Task WriteCriticalErrorAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true)
Source
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.
textComplete error block.cancellationTokenBounds how long the caller waits without cancelling an accepted write.appendNewLineWhether to append the platform newline.A task that completes after the ordered attempt or bounded direct fallback.
Tracks one active coverage-run operation and exposes bounded progress updates.
void ObserveBytes(int count)
Source
Records a positive count of observed child-process bytes as progress.
void Transition(string state)
Source
Records an explicit operation state transition as progress.
CoverageRunProcessLease ReserveProcess()
Source
Reserves a supervisor-owned process lease before invoking the process runner.
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.
void Attach(Process process)
Source
Attaches the root process delivered by CliWrap's start callback.
void Complete()
Source
Marks the command complete and unregisters the lease.
Supervises coverage-run orchestration using per-operation monotonic progress clocks.
void BindOutputDirectory(string outputDirectory)
Source
Binds watchdog artifacts to an AppSurface-owned output directory after full output validation.
outputDirectoryAbsolute prepared output directory for canonical watchdog artifacts.Promotion failures are reported as ASCOV122 and do not replace the watchdog's terminal outcome.
CoverageRunOperation Start(string kind, string? project = null, int order = 0, string state = "running", string? log = null, IReadOnlyList<string>? commandOptions = null)
Source
Starts a supervised operation. Queued work should call this only when it becomes active.
kindStable operation kind used for ordering and diagnostics.projectOptional solution-relative project path.orderStable execution order among operations of the same kind.stateInitial operation state.logOptional output-relative log path.commandOptionsSafe command option names; values must already be excluded.A disposable operation that marks completion and exposes progress/process seams.
OperationCanceledExceptionThrown after the watchdog claims terminal ownership.CoverageRunProcessLease ReserveProcess()
Source
Reserves a process lease before a child-process start callback can attach its root process.
A lease registered for terminal cleanup.
OperationCanceledExceptionThrown after the watchdog claims terminal ownership.void ReleaseProcess(CoverageRunProcessLease lease)
Source
Releases a completed process lease from terminal cleanup tracking.
leaseThe completed lease.void ObserveBytes(long id, int count)
Source
Records positive observed output bytes for an active operation.
idOperation identifier.countPositive byte count reported by the process observer.void Transition(long id, string state)
Source
Records an explicit state transition as operation progress.
idOperation identifier.stateNew stable state.void Complete(long id)
Source
Marks an active operation complete exactly once.
idOperation identifier.void ThrowIfFailed()
Source
Converts watchdog-owned cancellation into the stable ASCOV121 exit-124 diagnostic.
CommandExceptionThrown with exit code 124 after terminal cleanup and the bounded incident-write attempt finish.void Commit(Action commit)
Source
Revalidates that the watchdog has not claimed terminal ownership before an atomic artifact commit.
commitSynchronous canonical replacement performed while terminal ownership is locked.ArgumentNullExceptionThrown when commit is null.OperationCanceledExceptionThrown when the watchdog already owns the terminal outcome.CancellationToken CancellationToken { get; }
Source
Gets the token shared by all supervised coverage work.
CoverageRunConsoleSink Console { get; }
Source
Gets the run-scoped bounded console sink used by all coverage workflow messages.
Controls how coverage run responds when an active operation produces no observable progress.
Describes one request to preview or remove TestResults directories through coverage clean --all.
RootDirectoryOptional scan root; the current directory is used when omitted.ApplyWhether discovered directories may be deleted.Describes the completed TestResults cleanup operation.
RootDirectoryCanonical absolute scan root.DirectoriesCanonical absolute directories found below the root.EstimatedBytesTotal regular-file bytes measured without following links.ReparsePointsSkippedSymbolic links or reparse points not traversed or counted.AppliedWhether the listed directories were deleted.Discovers, sizes, and explicitly removes private TestResults directories.
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.
Task<TestResultsCleanupResult> CleanAsync(TestResultsCleanupRequest request, IConsole console, CancellationToken cancellationToken)
Source
Previews or deletes matching directories and writes a bounded operator summary.
requestThe root and explicit deletion confirmation.consoleConsole used for summary output.cancellationTokenCancellation token observed during filesystem traversal.A value describing the discovered directories and estimated byte count.
CommandExceptionThrown when the root is unsafe, cannot be inspected, or deletion fails.void DeleteDirectoryTree(string directory, CancellationToken cancellationToken)
Source
Removes one validated TestResults directory without traversing linked entries.
directoryDirectory or linked directory entry to remove.cancellationTokenCancellation token observed between directory entries.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.
long SaturatingAdd(long current, long next)
Source
Returns the non-negative sum without exceeding long.MaxValue.
string FormatBytes(long bytes)
Source
Formats a non-negative regular-file byte count for cleanup output.
string Pluralize(string singular, int count)
Source
Formats a singular noun for one or more cleanup entries.
Represents the AppSurface CLI root module used to bootstrap command execution.
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.
void ConfigureServices(StartupContext context, IServiceCollection services)
Source
Configures shared CLI services after the default command runtime registrations have been added.
contextStartup context for the CLI run.servicesService collection that will back command construction.The default implementation is a no-op. Keep it empty unless a service truly applies to the whole CLI surface.
void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder)
Source
Configures a Generic Host builder before services are registered.
contextStartup context for the CLI run.builderHost builder that would be configured by host-based startup paths.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.
void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder)
Source
Configures a Generic Host builder after services are registered.
contextStartup context for the CLI run.builderHost builder that would be configured by host-based startup paths.Keep this empty until the CLI adopts a host-backed lifecycle. Command behavior should stay in command classes.
void RegisterDependentModules(ModuleDependencyBuilder builder)
Source
Registers root-module dependencies for the AppSurface CLI module graph.
builderDependency builder used by AppSurface startup composition.The CLI has no module dependencies by default. Add dependencies here only for cross-command infrastructure that must participate in AppSurface module ordering.
Composes independently authored release-note entries into a Markdown document.
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.
ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)
Source
Executes composition with an explicit cancellation token.
consoleConsole receiving the validation summary and composed Markdown.cancellationTokenToken observed while reading entry files and writing output.A task that completes after the preview or write result is reported.
string? RootDirectory { get; set; }
Source
Gets or sets the project root that bounds the template, entries, and optional output paths.
string? EntriesDirectory { get; set; }
Source
Gets or sets the flat directory containing append-only entry files.
string? TemplatePath { get; set; }
Source
Gets or sets the Markdown template that declares the entry sections.
string? OutputPath { get; set; }
Source
Gets or sets the destination for a composed document.
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.
bool Apply { get; set; }
Source
Gets or sets a value indicating whether the composed document may be written.