DurableRuntimeSchemaStatus? Schema { get; }
Source
Returns a defensive copy of captured schema facts without the source status's free-form problem text.
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)
Runs coverage using the output and error writers from a CliFx console.
Task<CoverageMergeResult> MergeAsync(this CoverageMergeWorkflow workflow, CoverageMergeRequest request, IConsole console, CancellationToken cancellationToken)
Merges coverage using the output and error writers from a CliFx console.
Validated, printable doctor intent. Connection values remain private to the invocation.
Names identify environment sources, not their values. Worker and threshold are paired. See the doctor command reference.
Fixed categories accepted by the version-one observation and output contract.
Bounded immutable observations captured on the single fenced database session.
Null denotes a check not reached. Copies prevent mutable caller arrays entering classification.
DurableRuntimeSchemaStatus? Schema { get; }
Source
Returns a defensive copy of captured schema facts without the source status's free-form problem text.
Selected heartbeat facts only; a missing row is represented by Found=false and null row values.
Secret-free failure envelope. Only fixed categories may reach rendering.
Dedicated read-only operation; implementations do not register a Durable worker or mutate its store.
ValueTask<DurableDoctorObservation> InspectAsync(string connectionString, DurableDoctorRequest request, CancellationToken cancellationToken)
Inspects a validated request and returns only after checked owned resource release.
connectionString
request
cancellationToken
Shared execution and schema-v1 rendering for coverage storage commands.
Commands are noninteractive and expose safe identifiers and bounded diagnostics only.
ValueTask ExecuteAsync(IConsole console, CancellationToken cancellationToken)
Executes the operation with explicit cancellation and emits one safe result.
console
cancellationToken
ValueTask WriteHumanResultAsync(IConsole console, CoverageStorageResult envelope)
Renders trusted result fields and next actions without disclosing a fresh destination path.
ValueTask<object?> ExecuteOperationAsync(CoverageArtifactStore store, CancellationToken token, Action<string> setEffects, Action<string> setStatus)
Performs the operation and returns data that contains no raw filesystem paths.
void ValidateInput()
Validates explicit command inputs before opening or initializing the store.
void PublishPartialDetails(object details)
Publishes safe progress details so failures retain completed work in the result envelope.
object CreateStatusData(CoverageArtifactStore store, Action<string> setStatus)
Creates a bounded status payload while keeping overflow measurements separate from exact totals.
string DomainId(Func<CoverageArtifactStore>? openStore = null)
Hashes the effective domain path so machine-local prefixes are never emitted.
openStore
Every nonfatal observation failure returns domain-unknown so envelope rendering preserves the primary diagnostic.
bool Json { get; set; }
Source
Gets or sets whether the result is emitted as schema-versioned JSON.
bool RequestsMutation { get; }
Source
Gets whether an explicit operation authorizes private-store mutation.
bool OpensConfiguredDomain { get; }
Source
Gets whether execution requires the configured existing store. New-domain selection never opens the old domain.
string? PartialFailureRecovery { get; }
Source
Gets operation-specific recovery when a failed or cancelled command has already produced side effects.
string InvalidInputGuidance { get; }
Source
Gets a trusted field and accepted-form hint for a failed preflight, without echoing supplied values.
Stable schema-v1 response envelope used by every command in this family.
Shows registered coverage storage status; this is also the bare storage-group default.
Shows the explicitly named coverage storage status.
Inspects a repository's coverage output with fixed time and entry bounds, without adopting files.
string? Root { get; set; }
Source
Gets or sets the repository root to inspect; defaults to the current directory.
Previews history expiry, applying it only when explicitly requested with --apply.
bool Apply { get; set; }
Source
Gets or sets whether eligible history should be deleted.
Restores one verified archived run to a fresh output directory.
string Run { get; set; }
Source
Gets or sets the opaque run identifier.
string Output { get; set; }
Source
Gets or sets the fresh destination directory.
Pins or unpins a verified archived run so normal history expiry respects operator intent.
string Run { get; set; }
Source
Gets or sets the opaque run identifier.
Removes the protection pin from a verified archived run.
string Run { get; set; }
Source
Gets or sets the opaque run identifier.
Previews or explicitly creates a fresh private domain, preserving an unproven old domain in place.
string Output { get; set; }
Source
Gets or sets the fresh absolute destination beneath an existing non-linked parent.
bool Apply { get; set; }
Source
Gets or sets whether the explicitly selected new domain should be created.
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)
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)
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)
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)
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)
Creates a fully normalized request before any HTTP connection is opened.
bool IsSafeSummary(string? summary)
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)
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)
Attempts summary output without changing the polling result.
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)
Parses managed JUnit files and builds a diagnostic report.
results
cancellationToken
observeProgress
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)
Writes diagnostics to private same-directory staging files while recording canonical artifact paths in their contents.
stagedMarkdownPath
stagedJsonPath
artifactDirectory
report
CollectAsync
.getAggregationSeconds
calculateAggregationPercent
cancellationToken
observeProgress
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)
Best-effort deletes a staging or backup path created by this diagnostics operation.
path
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.
MarkdownPath
JsonPath
AggregationSeconds
AggregationPercent
WarningCount
MetadataComplete
ParserStatuses
StagedMarkdownPath
StagedJsonPath
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.
SchemaVersion
GeneratedAtUtc
MetadataComplete
JunitFileCount
Projects
TestCaseCount
FailedTestCaseCount
ErrorTestCaseCount
SkippedTestCaseCount
FailedTestCases
TopTestCases
Warnings
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.
ClassName
Name
Seconds
Status
Project
JunitFile
FailureDetail
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.
Verifies a complete reviewed role manifest and schema in one fenced, read-only snapshot.
Both inputs are mandatory even for one pair. Input validation precedes connection resolution. Runtime evidence covers only the observed credential; activation requires every distinct runtime and the continuous application-owned guard described in Durable/heartbeat-retention-operations.md.
string? RolePairsFile { get; set; }
Source
Gets or sets the complete reviewed version-1 UTF-8 manifest path, including for one pair.
string? MigrationOwnerRole { get; set; }
Source
Gets or sets the independently reviewed migration-owner role; no catalog-derived default exists.
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()
Resolves a connection string without printing or persisting it.
ValueTask<T> RunOnlineAsync<T>(string connectionString, CancellationToken cancellationToken, Func<string, CancellationToken, ValueTask<T>> operation, TimeSpan? operationTimeout = null, bool preflightDiagnostics = false)
Runs an online command with a bounded linked cancellation token and safe provider failure mapping.
ValueTask WriteStatusAsync(IConsole console, DurableSchemaStatusView status)
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)
Reads compatibility without mutation.
ValueTask<DurablePreflightResult> PreflightAsync(string connectionString, DurablePreflightRequest request, CancellationToken cancellationToken)
Reads compatibility, caller identity and every complete-manifest structural check in one fenced snapshot.
Owns one nonpooled session through checked cleanup; the request is validated before database access.
string GenerateScript(int fromVersion)
Generates deterministic migration SQL without opening a connection.
ValueTask<DurableSchemaApplyView> ApplyAsync(string connectionString, CancellationToken cancellationToken)
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.
Compatibility
InstalledVersion
RequiredVersion
PendingVersions
DurableSchemaStatusView From(DurableRuntimeSchemaStatus status)
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.
FromVersion
ToVersion
AppliedVersions
Renders stable, secret-safe schema diagnostics.
string PreflightFailure(DurableRuntimeSchemaCompatibility compatibility, bool heartbeatRetentionPending = false)
Builds the single-block incompatibility diagnostic used by preflight.
string RetentionStructureFailure(IReadOnlyList<string> failedChecks)
Builds a fixed, secret-safe failure for schema-11 structure or privilege drift.
string ManifestInputFailure()
Returns a fixed input diagnostic without echoing paths, JSON, role input or provider errors.
string PreflightOperationFailure(string category)
Returns a fixed bounded-operation diagnostic; only trusted category names are rendered.
string SchemaIncompatible(DurableRuntimeSchemaCompatibility compatibility)
Builds a stable failure for schema-manager incompatibility.
string Cause(DurableRuntimeSchemaCompatibility compatibility)
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)
Writes script
beside the requested destination then atomically publishes it.
IDisposable UseTemporaryFileWrittenHookForTesting(Action callback)
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.
Validates doctor intent and keeps its resolved connection string private to one command invocation.
Doctor accepts only environment-variable names on argv. This object resolves each distinct selected variable once, validates the PostgreSQL settings and configured epoch, and keeps the connection string out of request and result records. See the Durable doctor command reference for the supported grammar and evidence boundary.
ValueTask<DurableDoctorObservation> InspectAsync(IDurableDoctorService service, CancellationToken cancellationToken)
Calls the configured observation service without exposing connection custody to printable records.
DurableDoctorInput Create(string? connectionEnvironmentName, string? epochEnvironmentName, string? workerId, string? staleAfter, string? timeout, string? format, Func<string, string?>? getEnvironmentVariable = null)
Validates raw CliFx string values and resolves the selected environment variables exactly once.
connectionEnvironmentName
epochEnvironmentName
workerId
staleAfter
workerId
.timeout
format
text
or json
; null uses text.getEnvironmentVariable
A validated invocation whose connection string is private to this instance.
DurableDoctorInputException
TimeSpan ParseDuration(string value, TimeSpan minimum, TimeSpan maximum)
Parses one positive decimal duration into exact representable TimeSpan ticks.
value
ms
, s
, m
, or h
.minimum
maximum
The parsed duration when it is representable and within the requested range.
DurableDoctorInputException
string ResolveEnvironmentName(string? suppliedName, string defaultName)
Applies the schema command's environment-name grammar, with the doctor contract's 200-character cap.
DurableDoctorRequest Request { get; }
Source
Gets the validated, secret-free doctor request.
A fixed-category signal for invalid doctor arguments or selected environment values.
Classifies raw doctor argv before generic CLI parsing can echo malformed tokens.
DurableDoctorArgumentAdmissionResult Inspect(string[] arguments)
Checks only a leading durable doctor
route and its option-token structure.
arguments
A safe admission decision and the uniquely valid output-format hint, if present.
string[] NormalizeJoinedValueOptions(string[] arguments)
Expands recognized joined value options because CliFx binds their name and value as separate tokens.
arguments
Arguments with only known --name=value
forms expanded for CliFx binding.
Safe raw-argv doctor route decision produced before CLI normalization and startup-context creation.
IsDoctor
IsMalformed
IsHelp
Format
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)
Gets whether the CLI can coordinate the supplied built-in store in v2.
LocalCoordinatorPrecondition CapturePrecondition(AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool replace)
Captures the value-free local destination precondition for a v2 plan row.
LocalCoordinatorCheck Recheck(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, bool allowPreparedRecovery)
Rechecks a plan-bound local precondition before source payload access.
LocalCoordinatorWriteResult WriteOrRecover(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store, string value, bool allowPreparedRecovery)
Writes a local value after rechecking its plan-bound precondition under the coordinator lock.
LocalCoordinatorCheck VerifyCommitted(SecretPromotionPlanArtifact plan, SecretPromotionPlanRow row, AppSurfaceLocalSecretIdentity identity, IAppSurfaceLocalSecretStore store)
Confirms that a receipt's local row still has matching coordinator evidence.
AppSurfaceLocalSecretResult InvalidateBeforeMutation(IAppSurfaceLocalSecretStore store, AppSurfaceLocalSecretIdentity identity, Func<AppSurfaceLocalSecretResult> mutation)
Invalidates any committed transfer attestation before a normal local CLI mutation.
string GetDefaultStateRoot(string? localApplicationData, string userProfile)
Builds the default per-user transfer state directory from platform folder values.
localApplicationData
userProfile
The absolute AppSurface secret-transfer state directory.
Validates fixed-length lowercase hexadecimal transfer identities.
bool IsLowerHex(string? value, int length)
Gets whether a value is lowercase hexadecimal with the required length.
value
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()
Creates a precondition for a local target that is absent.
A missing-target precondition with no attestation or failure.
LocalCoordinatorPrecondition Replace(string previousOperationId)
Creates a precondition that permits a guarded replacement.
previousOperationId
A replacement precondition bound to the supplied prior operation.
LocalCoordinatorPrecondition Conflict(LocalCoordinatorFailure failure)
Creates a precondition that blocks transfer because the local target conflicts with the plan.
failure
A conflict precondition carrying the supplied failure.
LocalCoordinatorPrecondition Unsupported()
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)
Creates a precondition that failed before a safe local state could be established.
failure
A failed precondition carrying the supplied failure.
Describes a local destination check without exposing local values.
LocalCoordinatorCheck Ready()
Creates a check result that permits the planned operation.
A ready result without a failure.
LocalCoordinatorCheck PreparedRecovery()
Creates a check result that requires safe reconciliation of a prepared transfer.
A prepared-recovery result without a failure.
LocalCoordinatorCheck Conflict()
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()
Creates a check result whose prior write state cannot be safely determined.
An indeterminate result without a failure because reconciliation is required.
LocalCoordinatorCheck Unsupported()
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)
Creates a check result that failed before the local state could be safely rechecked.
failure
A failed result carrying the supplied failure.
Describes a guarded local write or recovery outcome.
LocalCoordinatorWriteResult Created()
LocalCoordinatorWriteResult Replaced()
Creates a successful guarded replacement outcome.
A replaced result without a failure.
LocalCoordinatorWriteResult Recovered()
Creates a successful recovery outcome for a matching prepared write.
A recovered result without a failure.
LocalCoordinatorWriteResult Conflict()
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)
Creates an outcome whose write state requires reconciliation before another write.
failure
An indeterminate result; a null failure
means callers must use the generic reconciliation diagnostic.
LocalCoordinatorWriteResult Unsupported()
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)
Creates a write outcome that failed before a safe completion could be established.
failure
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.
Loads one finite published bundle and passes only the remaining monotonic allowance to observation.
Bundle files are opened through the shared coverage artifact reader, which rejects non-regular files and does not follow links. Hashes establish consistency, not publisher authenticity.
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)
Reads one content stream up to the configured byte limit.
content
maxBodyBytes
cancellationToken
The retained bytes and whether additional bytes were discarded.
Captures the bounded result of one HTTP response-body read.
Bytes
Truncated
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)
Writes the project-to-artifact-directory binding as a complete UTF-8 JSON document.
projectOutputDirectory
solutionDirectory
project
cancellationToken
A task that completes after the manifest has been atomically promoted.
Inspects one configured Durable store and runtime without changing the database.
Connection strings and epochs are read only from the selected environment variables. Doctor validates every bound string before calling its dedicated observation service, writes one final text or JSON result to stdout, and sets the process exit code from that result. It does not perform schema migration or application verification.
Task WriteResultAsync(TextWriter outputWriter, DurableDoctorResult result, DurableDoctorRequest? request, string format)
Writes one doctor result, replacing render-contract rejection with one canonical failed envelope.
outputWriter
result
request
format
A broken sink sets exit code 1 and is never retried, so it cannot duplicate a partial result.
string? ConnectionEnvironmentName { get; set; }
Source
Gets or sets the environment variable containing the PostgreSQL connection string.
string? EpochEnvironmentName { get; set; }
Source
Gets or sets the environment variable containing the configured runtime epoch GUID.
string? WorkerId { get; set; }
Source
Gets or sets an optional operator-selected worker identifier.
string? StaleAfter { get; set; }
Source
Gets or sets the caller-supplied heartbeat comparison threshold, required with --worker-id.
string? Timeout { get; set; }
Source
Gets or sets the bounded total observation timeout.
string? Format { get; set; }
Source
Gets or sets the output format.
Provides the discoverable root for AppSurface local secret commands.
ValueTask ExecuteAsync(IConsole console)
Prints the local secrets command family summary.
console
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.
Migrates one exact stored LocalSecrets identifier to a strict logical destination key.
The default invocation previews identifiers and parsed destination segments without reading values. After inspecting the preview, repeat it with --apply
to confirm the journaled migration. Display identifiers are escaped and bounded. Executable command output is omitted when an argument needs display transformation, while the original source and destination remain unchanged for backend operations. The inherited platform-store factory is the test seam for exercising this command without OS credentials.
string DisplayIdentifier(string value)
Uses the shared value-free renderer; displayed truncation is never reused as an executable argument.
string SourceStoredKey { get; set; }
Source
Gets or sets the exact source identifier as stored by the selected backend.
string DestinationKey { get; set; }
Source
Gets or sets the strict destination logical key.
bool Apply { get; set; }
Source
Gets or sets whether to confirm the migration after reviewing its identifiers.
Inspects or explicitly retains/releases an unfinished file-backed exact-key migration.
Neither operation writes or deletes a secret value. Release is for operator reconciliation only.
string MigrationId { get; set; }
Source
Gets or sets the exact migration identifier returned by a failed migration.
bool Apply { get; set; }
Source
Gets or sets whether to perform the previewed durable metadata transition.
bool Release { get; set; }
Source
Gets or sets whether to release a retained journal after operator reconciliation.
string? ExpectedState { get; set; }
Source
Gets or sets the state printed by preview; required with Apply
.
Deletes one local secret.
Diagnoses LocalSecrets platform availability.
Shared options and helpers for local secret commands.
ValueTask ExecuteAsync(IConsole console)
Executes the command.
console
A value task that completes when the command finishes.
SecretsCommandContext BuildContext()
IAppSurfaceLocalSecretStore CreatePlatformStore(AppSurfaceLocalSecretsOptions options)
Creates the OS-backed LocalSecrets store for commands that do not use the deterministic file store.
options
The platform-backed local secret store.
ValueTask WriteResultAsync(IConsole console, AppSurfaceLocalSecretResult result, string successVerb)
Writes a command result.
console
result
successVerb
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)
Normalizes the configured key into a local secret identity.
context
The local secret identity.
string Key { get; set; }
Source
Gets or sets the AppSurface config key.
Captures normalized command state.
Normalizer
Store
ApplicationName
Environment
KeyPrefix
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)
Runs the AppSurface CLI with the specified arguments and optional console configuration.
args
configureOptions
A task that represents the CLI execution.
IDisposable PushConfigureOptionsOverrideForTests(Action<ConsoleOptions> configureOptions)
Pushes a test-only console-options override for the current async context.
configureOptions
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.
previous
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)
Configures shared CLI services after the default command runtime registrations have been added.
context
services
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)
Configures a Generic Host builder before services are registered.
context
builder
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)
Configures a Generic Host builder after services are registered.
context
builder
Keep this empty until the CLI adopts a host-backed lifecycle. Command behavior should stay in command classes.
void RegisterDependentModules(ModuleDependencyBuilder builder)
Registers root-module dependencies for the AppSurface CLI module graph.
builder
The CLI has no module dependencies by default. Add dependencies here only for cross-command infrastructure that must participate in AppSurface module ordering.
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)
Executes the command through the CliFx console integration.
console
A value task that completes when export finishes or command validation fails.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Executes the command using an explicit cancellation token.
cancellationToken
A value task that completes when export finishes.
AppSurfaceDocsExportArgs BuildExportArgs()
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()
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)
Executes the command through the CliFx console integration.
console
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.
long? MaxRewrittenFileSizeBytes { get; set; }
Source
Gets the maximum byte size accepted for a rewritten HTML or root search index file in the published tree.
Omit this option to use the 4 MiB runtime default. Set it to the same value configured on a host that mounts a larger archive; supported values are 1 through 33,554,432 bytes (32 MiB).
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)
Executes the command through the CliFx console integration.
console
A value task that completes when verification finishes.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Executes the command using an explicit cancellation token.
cancellationToken
A value task that completes when verification finishes.
AppSurfaceDocsHealthVerifyArgs BuildVerifyArgs()
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)
Executes the command through the CliFx console integration.
console
A value task that completes when the preview host exits or command validation fails.
ValueTask ExecuteAsync(CancellationToken cancellationToken)
Executes the command using an explicit cancellation token.
cancellationToken
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)
Translates shared CLI options into standalone AppSurface Docs host arguments.
defaultEnvironmentName
EnvironmentName
is blank.The repository root, forwarded host arguments, startup timeout, and resolved environment.
AppSurfaceDocsHostArgs BuildHostArgs(string? urls, int? port, bool allHosts, string? defaultEnvironmentName)
Translates shared and preview-only CLI options into standalone AppSurface Docs host arguments.
urls
port
allHosts
defaultEnvironmentName
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)
Changes the process current directory and returns a scope that restores the previous value.
directory
A disposable scope that restores the previous current directory.
void Dispose()
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.
RepositoryRoot
Args
StartupTimeout
null
when disabled.EnvironmentName
null
when the host should use its default.Describes a one-shot AppSurface Docs static export request.
HostArgs
OutputPath
SeedRoutesPath
InitialSeedRoutes
SeedRoutesPath
is null.Mode
RedirectStrategy
ExportRedirectStrategy.Html
is the command default and writes portable fallback HTML pages for source-shaped aliases. Use ExportRedirectStrategy.Netlify
only with ExportMode.Cdn
when publishing to Netlify or a compatible host that reads a root _redirects
file; export rejects that provider strategy with ExportMode.Hybrid
because the generated rules target publish-root static routes. The selected strategy affects only alias materialization after the loopback host is crawled from RequestedBaseUrl
. RequestedBaseUrl
HybridOptions
Describes a one-shot AppSurface Docs harvest-health verification request.
HostArgs
HealthJsonPath
RequestedBaseUrl
Result returned by the AppSurface Docs harvest-health verification runner.
Health
HttpStatusCode
Raw HTTP response returned by the AppSurface Docs harvest-health client seam.
StatusCode
Body
Applies shared host options required by packaged AppSurface docs tooling.
void ConfigurePackagedToolHost(WebOptions options, TimeSpan? startupTimeout)
Configures the standalone AppSurface Docs host shape used by packaged preview and export commands.
options
startupTimeout
null
when disabled.void ConfigureQuietPreviewLogging(ILoggingBuilder logging)
Suppresses routine ASP.NET Core host lifecycle output for interactive AppSurface Docs preview runs.
logging
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)
Runs the AppSurface Docs host with translated command-line arguments.
args
startupTimeout
null
to disable it.cancellationToken
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)
Starts the docs host, runs static export, and stops the host.
args
cancellationToken
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)
Starts the docs host, reads harvest health, and stops the host.
args
cancellationToken
The parsed harvest-health verification result.
Reads the AppSurface Docs harvest-health JSON endpoint.
Task<AppSurfaceDocsHealthHttpResponse> GetAsync(string url, CancellationToken cancellationToken)
Requests a redacted health JSON URL and returns the body regardless of success or failure HTTP status.
url
cancellationToken
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)
Builds the standalone docs host, starts Kestrel, and returns the started host for health verification.
args
environmentName
cancellationToken
The started host.
Adapts the RazorWire static exporter behind a small AppSurface CLI test seam.
Task ExportAsync(ExportContext context, CancellationToken cancellationToken)
Exports the started docs host described by context
.
context
cancellationToken
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)
Configures the export context using services from the started docs host.
host
context
cancellationToken
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)
Determines whether an exception is safe to catch for cleanup, fallback logging, or diagnostic reporting.
ex
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)
Reads the current docs harvest summary if the started host exposes the AppSurface Docs aggregator.
host
cancellationToken
A summary when available; otherwise null
.
Concise harvest summary emitted by the AppSurface Docs CLI preview command.
Status
TotalDocs
TotalHarvesters
SuccessfulHarvesters
DiagnosticCount
Production IAppSurfaceDocsHarvestSummaryReader
that reads DocAggregator
health.
Describes a preview AppSurface Docs host startup request.
Args
StartupTimeout
null
when disabled.Builds and starts the AppSurface Docs preview host.
Task<IHost> BuildAndStartAsync(AppSurfaceDocsPreviewHostArgs args, CancellationToken cancellationToken)
Builds the standalone docs host, starts Kestrel, and returns the started host for preview.
args
cancellationToken
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)
Attempts to open url
in the user's browser without failing the preview command.
url
cancellationToken
The browser launch outcome.
Describes the outcome of an attempted browser launch.
Succeeded
FailureReason
Succeeded
is false
.AppSurfaceDocsBrowserLaunchResult Failure(string reason)
Creates a failed browser-launch result.
reason
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)
Opens the given URL with the platform opener command.
url
cancellationToken
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)
Resolves the repository root forwarded to the standalone host.
args
fallbackRoot
The forwarded repository root when present; otherwise fallbackRoot
.
string? ResolveDefaultPreviewUrl(IReadOnlyList<string> args, string repositoryRoot)
Resolves the default preview listener when the CLI invocation did not configure an endpoint explicitly.
args
repositoryRoot
A localhost URL, or null
when explicit endpoint configuration should win.
string ResolveBoundBaseUrl(IHost host)
Resolves the browser-facing base URL from Kestrel's published server addresses.
host
The scheme and authority that should be opened in the browser.
string ResolveBoundBaseUrl(ICollection<string>? addresses)
Resolves the browser-facing base URL from Kestrel's published server addresses.
addresses
The scheme and authority that should be opened in the browser.
Uri ResolveDocsUrl(string baseUrl, IReadOnlyList<string> args)
Combines the bound host base URL with the configured AppSurface Docs root path.
baseUrl
args
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)
Resolves the single bound loopback base URL published by the started export host.
host
The scheme and authority used by the export crawler.
InvalidOperationException
string ResolveBoundBaseUrl(ICollection<string>? addresses)
Resolves the crawler base URL from a Kestrel address collection.
addresses
The absolute URL authority to crawl.
InvalidOperationException
Task<IHost> BuildAndStartHostWithTimeoutAsync(AppSurfaceDocsExportArgs args, string environmentName, CancellationToken cancellationToken)
Builds and starts the docs host while enforcing the configured startup watchdog.
args
environmentName
cancellationToken
The started host.
TimeoutException
StartupTimeoutCancellationLease CreateStartupTimeout(TimeSpan startupTimeout, CancellationToken cancellationToken)
Creates the linked cancellation source used to distinguish startup timeout from external cancellation.
startupTimeout
cancellationToken
A disposable lease for the linked startup cancellation source.
void ObserveTimedOutStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)
Observes a startup task that outlived the configured timeout so late completion can stop or log the host.
startTask
startupTimeoutCts
void ObserveCanceledStartupTask(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts)
Observes a startup task that outlived external cancellation so late completion can stop or log the host.
startTask
startupTimeoutCts
Task ObserveStartupTaskAsync(Task<IHost> startTask, CancellationTokenSource startupTimeoutCts, string lateCompletionMessage)
Awaits a late startup task and disposes the host if startup eventually succeeds.
startTask
startupTimeoutCts
lateCompletionMessage
A task that completes after the late startup task is observed.
TimeoutException CreateStartupTimeoutException(TimeSpan startupTimeout, Exception? innerException)
Creates the user-facing timeout exception for a host that failed to start in time.
startupTimeout
innerException
The timeout exception reported to command execution.
Task StopAndDisposeHostAsync(IHost host)
Stops the export host and always disposes it, logging non-fatal shutdown failures.
host
A task that completes after shutdown and disposal.
Owns a startup cancellation source until timeout observation needs to transfer that ownership.
Task CancelAsync()
Requests cancellation of the owned startup cancellation source.
A task that completes after cancellation callbacks have run.
CancellationTokenSource Transfer()
Transfers cancellation source ownership to a late-startup observer.
The owned cancellation source.
void Dispose()
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)
Gets environment variable values while overriding ASP.NET and .NET environment variables.
name
defaultValue
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)
Builds the standalone docs host, starts Kestrel, and returns the started host for export.
args
environmentName
cancellationToken
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)
Gets environment variable values while overriding ASP.NET and .NET environment variables.
name
defaultValue
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
.
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)
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)
Fetches one response and reads no more than the requested body limit.
uri
maxBodyBytes
cancellationToken
The response metadata and bounded body.
Adapts HttpClient
to the verifier's bounded, redirect-aware fetch contract.
httpClient
Enabling automatic redirects bypasses the verifier's same-origin and path-base checks.
Captures one bounded HTTP response before verifier-managed redirect handling.
StatusCode
ContentType
BodyBytes
RedirectLocation
BodyTruncated
Headers
IReadOnlyList<string> HeaderValues(string name)
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.
SchemaVersion
Passed
Origin
BaseUrl
EntryPath
EntryUrl
BaseUrl
.ManifestPath
StartUrl
Scope
Display
ThemeColor
BackgroundColor
Icons
Diagnostics
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.
Evidence
Diagnostics
Holds validated readiness evidence or the sanitized unavailable state.
ConfigurationStatus
ActiveVapidKeyId
PublicKeyFingerprint
RouteMapped
Represents one stable, structured PWA verification observation.
Code
Severity
Message
Subject
Expected
Actual
Fix
DocsUrl
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.
Origin
BaseUri
BasePath
EntryPath
EntryUri
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 = "/")
Creates a normalized verification target after enforcing the URL and entry-path boundaries.
url
entryPath
The normalized target used for all verifier requests.
ArgumentException
Carries normalized CLI assertions into a PWA verification run.
BaseUrl
EntryPath
ExpectedStartUrl
ExpectedScope
ExpectedDisplay
ExpectedThemeColor
ExpectedBackgroundColor
ExpectedIcons
Surface
ExpectedPush
DiagnosticsPath
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)
Creates verification options and parses repeated icon assertions.
baseUrl
entryPath
expectedStartUrl
expectedScope
expectedDisplay
expectedThemeColor
expectedBackgroundColor
expectedIcons
surface
expectedPush
diagnosticsPath
Normalized options for PwaVerifier
.
ArgumentException
Parses the accepted install, push, and all PWA verification surface values.
PwaVerificationSurface Parse(string? value)
Parses an optional PWA verification surface value.
value
The parsed surface; a missing value selects install.
ArgumentException
Parses the accepted enabled and disabled push-expectation values.
PwaExpectedPush Parse(string? value)
Parses an optional expected push posture value.
value
The parsed posture; a missing value selects enabled.
ArgumentException
Represents one explicit manifest icon size and optional purpose assertion.
Size
Purpose
PwaExpectedIcon Parse(string value)
Parses a command-line icon assertion.
value
The parsed assertion.
ArgumentException
string ToString()
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.
FinalUri
Response
.Response
RedirectLimitExceeded
Callers must not reinterpret Response
as a terminal HTTP failure when RedirectLimitExceeded
is true; ASPWA264 is the authoritative failure.
IReadOnlyList<string> HeaderValues(string name)
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.
Width
Height
Represents privacy-safe fetch and optional PNG dimension evidence for one manifest icon.
Source
Sizes
Type
Purpose
Path
ContentType
Width
Height
Fetched
Models the manifest fields required for install-readiness verification.
Name
ShortName
StartUrl
Scope
Display
ThemeColor
BackgroundColor
Icons
Models one manifest icon declaration without trusting it as fetched evidence.
Source
Sizes
Type
Purpose
Models the server-known AppSurface PWA diagnostics used for install, worker, offline, and push posture checks.
Enabled
OfflineEnabled
ServiceWorkerPath
OfflineFallbackPath
ConfiguredServiceWorkerPath
WorkerEnabled
WorkerPath
PushEnabled
WorkerScope
RegistrationHelperPath
PushReadiness
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.
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)
Executes the cleanup with an explicit cancellation token.
console
cancellationToken
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 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()
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.
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.
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)
Runs the AppSurface CLI with the provided command-line arguments.
args
configureOptions
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.
string[] RestoreCoverageTestArguments(string[] arguments)
Restores the literal test tokens bound through this invocation's opaque placeholders.
arguments
The original literal tokens, or the input when no normalization map is active.
void AddExportEngineServices(IServiceCollection services)
Registers the RazorWire export engine dependencies used by AppSurface-owned export commands.
services
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)
Registers the HTTP client used by appsurface pwa verify
.
services
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)
Registers the shared coverage core and its CLI and Evidence adapters.
services
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)
Registers the named-canary polling HTTP and delay services.
services
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.
The CliFx-safe argv and immutable per-invocation map back to literal test tokens.
Arguments
RestoreValues
Normalizes only the registered coverage run
command's literal test option values.
CoverageRunNormalizedArguments Normalize(string[] arguments)
Replaces split and joined --test-argument
values with opaque CliFx-safe tokens.
arguments
CliFx input plus a map for restoration after binding.
A split option consumes exactly its next token, even if that token begins with a dash.
Owns one result's serialization, write, flush and exit decision.
Delivery failure is latched: no catch or cancellation path writes a second object or diagnostic.
Versioned safe serialization shape; provider free text is never a member.
Owns a nonpooled physical session and one fenced, read-only repeatable-read doctor snapshot.
One monotonic budget reserves min(2s, timeout/5) for rollback, unlock and physical disposal. The original caller token remains distinct from that deadline. A terminal outcome discards every database fact. The stage seam is internal and production composition supplies no observer. It never starts background work. See the doctor reference and the separate complete-manifest deployment preflight.
NpgsqlConnectionStringBuilder CreateSessionSettings(string connectionString, TimeSpan workTimeout)
Applies dedicated-session settings without extending shorter configured driver waits.
DurableDoctorFailureException ClassifyFailure(Exception exception, CancellationToken caller, bool deadlineExpired, CancellationToken ownedToken = default)
Retains caller/deadline provenance and the provider's propagate-by-default allowlist.
ValueTask<DurableDoctorObservation> ReadRuntimeAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, DurableDoctorRequest request, DurableRuntimeSchemaStatus schema, IReadOnlyList<string> credential, IReadOnlyList<string> retention, TimeSpan remaining, CancellationToken token)
Captures one database clock and exact selected row, then checks agreement with the authoritative schema reader.
Single monotonic deadline; remaining budgets shrink across every stage including cleanup.
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)
Appends the supplied Markdown artifact when GitHub provided a summary path.
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)
Independently opens or creates every output-path component without following links.
outputPath
unixFChmod
unixUnlinkAt
A lease retaining every opened component until disposal.
CoverageRunOutputLease? AcquireExisting(string outputPath)
Independently opens every existing output-path component without creating a missing directory.
outputPath
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)
Validates the existing path and output ownership without creating missing components.
outputPath
void Prepare(bool clean, Action? beforeMutation, Action? beforeCleanup)
Revalidates ownership, optionally removes known artifacts, and creates the marker and projects directory through the retained output object.
clean
beforeMutation
beforeCleanup
CoverageOwnedCleanupPlan CleanKnownOwnedArtifacts(bool apply)
Returns AppSurface-owned entries that an explicit coverage clean operation may remove and, when requested, deletes them through this retained output-directory lease.
apply
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)
Validates that each named gate artifact is either absent or a regular file in the retained output directory.
artifactNames
Task WriteOwnedGateArtifactAsync(string artifactName, string contents, CancellationToken cancellationToken)
Writes one owned gate artifact through the retained output directory.
artifactName
contents
cancellationToken
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)
Removes one owned gate artifact through the retained output directory when it exists.
artifactName
string NormalizePlatformPath(string path)
Canonicalizes fixed operating-system aliases before safety comparisons and no-follow traversal.
path
The path with only fixed operating-system aliases canonicalized.
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)
Executes composition with an explicit cancellation token.
console
cancellationToken
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.
Immutable, secret-safe evidence from one complete fenced catalog snapshot.
Pair indices are one-based and identify only the observed runtime credential. An owner-diagnostic result never covers a runtime. Null epochs remain null; preflight does not initialize or rotate store identity. Copies prevent caller mutation. See Durable/heartbeat-retention-operations.md for the combined guard gate.
DurableSchemaStatusView Status { get; }
Source
Gets package-defined compatibility from the shared provider reader.
Guid StoreId { get; }
Source
Gets the provider-observed StoreId.
Guid? ActiveRuntimeEpoch { get; }
Source
Gets the nullable provider-observed active epoch.
string CallerEvidenceKind { get; }
Source
Gets runtime, owner-diagnostic, or unresolved caller evidence.
string? CallerRole { get; }
Source
Gets a request-validated caller role, never uncontrolled server text.
int? PairIndex { get; }
Source
Gets a one-based runtime pair, or null for owner/unresolved credentials.
IReadOnlyList<string> FailedChecks { get; }
Source
Gets deterministic fixed categories, optionally qualified by validated pair identity.
Fixed safe failure for bounded preflight operations or uncertain resource cleanup.
string Category { get; }
Source
Gets the trusted diagnostic category; no provider message or connection data is retained.
Owns a single dedicated session, shared fence and read-only repeatable-read verification.
Acquire the session fence BEFORE beginning repeatable read, so waiting for a preceding writer never pins a stale snapshot. One monotonic 30-second budget reserves up to two seconds for independent cleanup. Pooling, ambient enlistment and multiplexing are disabled. Callers must review endpoint session affinity; these settings cannot make a transaction/statement pooler safe. No success escapes before commit, explicit unlock and physical disposal. This is an internal CLI adapter, not a provider preflight or activation API.
ValueTask<DurablePreflightResult> VerifyAsync(string connectionString, DurablePreflightRequest request, CancellationToken cancellationToken)
Validates one complete request on an owned session with checked, independently bounded cleanup.
connectionString
request
cancellationToken
Evidence only after every owned resource has been safely released.
NpgsqlConnectionStringBuilder CreateSessionSettings(string connectionString)
Constrains driver budgets without expanding any shorter supplied connection timeout.
IReadOnlyList<string> MapCatalogResult(object? raw, DurablePreflightRequest request)
Rejects null, unexpected, unbounded or unknown catalog results without rendering their contents.
void ValidateEvidenceResult(DurablePreflightResult? result, DurablePreflightRequest request)
Rejects incomplete successful evidence before rendering output from the service boundary.
A null epoch is valid for a structural pass; only the combined activation gate requires initialization.
ValueTask VerifyFenceAffinityAsync(NpgsqlConnection connection, NpgsqlTransaction? transaction, CancellationToken cancellationToken)
Verifies that the connection still owns the existing migration fence on its original backend.
connection
transaction
cancellationToken
This shared seam performs no lock acquisition or cleanup. Failure keeps the existing preflight cleanup
category; the doctor adapter maps that fixed failure to its session-affinity category.
ValueTask<(string Kind, string? Role, int? Pair, string? Failure)> ReadCallerAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, DurablePreflightRequest request, CancellationToken cancellationToken)
Classifies the credential and effective role inside the caller-owned fenced snapshot.
Neither opens a connection nor changes session identity or transaction ownership. Both PostgreSQL identities must resolve to the same OID on the original backend. This internal seam also allows tests to construct an actual SET ROLE session without depending on driver startup-option behavior.
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)
Atomically replaces the receipt at path
.
path
receipt
Writes receipt snapshots through same-directory atomic replacement.
string ValidateCredentialFile(string? value, bool? isWindows = null)
Validates a credential file path without returning its contents or path in diagnostics.
value
isWindows
The canonical absolute path after posture validation.
Runs declared, value-safe transfer jobs.
SecretPromotionRowResult ProbeLocalDestination(SecretPromotionPlanRow row, bool replace)
Maps a captured local precondition to a value-safe planning result.
row
replace
The value-safe planning result for the captured local state.
SecretPromotionRowResult MapLocalWriteResult(SecretPromotionPlanRow row, LocalCoordinatorWriteResult result)
Maps a guarded local coordinator write outcome to a value-safe transfer row.
row
result
The value-safe transfer row corresponding to the coordinator result.
bool IsProductionJob(ResolvedEndpoints endpoints)
Returns whether either declared endpoint carries the production environment label.
string? SecretParentForVersionResource(string? value)
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)
Computes the value-free identity that binds every field of a transfer plan.
plan
Lowercase SHA-256 identity for the supplied artifact.
Describes a value-free request to create a transfer plan.
ConfigPath
JobName
OutputPlanPath
Replace
Expiry
Context
Describes a dry-run or mutation-gated transfer apply request.
ConfigPath
PlanPath
Apply
Confirmation
ReceiptPath
ResumeReceiptPath
Context
Wraps the display-safe result returned after plan creation.
Summary
Defines the versioned endpoint and named-job configuration authorization boundary.
Version
Endpoints
local
endpoint.Jobs
Declares one named provider endpoint without embedding credential values.
Name
Provider
google
or the built-in local
endpoint where the selected schema direction permits it.Environment
Credential
Chooses a Google credential acquisition mode without carrying raw credentials.
Mode
applicationDefault
or credentialFile
.Path
Declares one reviewed, direction-specific transfer job.
Name
Source
local
or a declared Google endpoint name.Destination
local
endpoint in v2.AllowMutableLocalSource
Rows
Maps one logical LocalSecrets key to explicit provider resources.
Key
Source
Destination
Persists an expiring, value-free plan bound to all safety-relevant fields.
Version
JobName
ConfigDigest
CreatedAtUtc
ExpiresAtUtc
Replace
Production
Ready
PlanIdentity
Rows
Captures one canonical, value-free plan row and its destination precondition.
RowNumber
Key
SourceEndpoint
SourceResource
local
.DestinationEndpoint
DestinationResource
LocalStorageName
DestinationHasEnabledVersions
DestinationExists
SecretPromotionRowResult Result(string status, string action, string? diagnosticCode, string? problem, bool? retryable, string? writtenResource = null)
Creates a value-free row result while preserving canonical row identity.
status
action
diagnosticCode
problem
retryable
writtenResource
A result that never includes secret payloads.
SecretPromotionRowResult GoogleSourceFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)
Maps a Google source failure without misclassifying destination absence.
action
status
diagnostic
A value-free source result.
SecretPromotionRowResult GoogleDestinationFailure(string action, GoogleSecretManagerTransferStatus status, AppSurfaceGoogleSecretTransferDiagnostic? diagnostic)
Maps a Google destination failure, preserving indeterminate write state.
action
status
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.
RowNumber
Key
SourceEndpoint
SourceResource
DestinationEndpoint
DestinationResource
Status
Action
DiagnosticCode
Problem
Retryable
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.
Operation
plan
or apply
.Job
Apply
Succeeded
Rows
PlanPath
ReceiptPath
Provides the durable, value-free apply journal and resume evidence.
PlanJob
ConfigDigest
PlanIdentity
Rows
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)
Prints the coverage command family summary.
console
A completed task.
Shared PostgreSQL predicates for the Durable heartbeat-retention structure.
The fragments assume the aliases documented beside each property. They describe local structure only; complete preflight adds its independently reviewed migration-owner identity and exact manifest ACL rules. Keep this helper internal so catalog inspection does not become a deployment-authorization API.
Describes one request to preview or remove TestResults
directories through coverage clean --all
.
RootDirectory
Apply
Describes the completed TestResults
cleanup operation.
RootDirectory
Directories
EstimatedBytes
ReparsePointsSkipped
Applied
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)
Previews or deletes matching directories and writes a bounded operator summary.
request
console
cancellationToken
A value describing the discovered directories and estimated byte count.
CommandException
void DeleteDirectoryTree(string directory, CancellationToken cancellationToken)
Removes one validated TestResults
directory without traversing linked entries.
directory
cancellationToken
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)
Returns the non-negative sum without exceeding long.MaxValue
.
string FormatBytes(long bytes)
Formats a non-negative regular-file byte count for cleanup output.
string Pluralize(string singular, int count)
Formats a singular noun for one or more cleanup entries.
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)
Resolves the display version from the supplied assembly metadata.
assembly
A single-line printable version suitable for CliFx --version
output.
string NormalizeDisplayVersion(string? informationalVersion)
Normalizes package identity metadata for user-facing CLI version output.
informationalVersion
The package SemVer display value without a leading release-tag v
or build metadata, or a truthful fallback when package identity metadata is unavailable.
Purely classifies one completed Durable doctor observation and its validated request.
This type performs no I/O and reads no process clock. A compatible schema always receives an independent store-epoch check; selected worker evidence is interpreted only after that prerequisite. See the durable doctor contract for the v1 short-circuit, category, and output matrices.
DurableDoctorResult Classify(DurableDoctorRequest request, DurableDoctorObservation observation)
Classifies a complete service observation; malformed or incomplete evidence becomes ASDUR415.
DurableDoctorResult Terminal(DurableDoctorRequest? request, string status, IReadOnlyList<string> categories)
Builds one fixed terminal envelope, discarding all database evidence and retaining valid request intent.
request
status
categories
A result with the canonical descriptor and status-specific exit code.
bool IsValidRequest(DurableDoctorRequest? request)
Validates command-derived request bounds before using any request value in result or action output.
DurableDoctorAction ExpectedActionFor(DurableDoctorRequest request, string code)
Returns the exact renderer expectation for a finding's canonical follow-up action.
Converts private coverage-core failures into the stable CliFx command contract.
CommandException Map(CoverageExecutionException exception)
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)
Creates a stable CLI diagnostic using the existing coverage message shape.
A safe, relative observation from one VSTest sequence file.
RelativePath
LastStartedTest
Bounded reader for VSTest sequence files beneath an owned coverage results directory.
InspectionResult Inspect(string ownedResultsDirectory, string outputDirectory, TimeProvider? clock = null, InspectionIo? io = null)
Inspects sequence candidates under a verified invocation directory using output root for containment.
ownedResultsDirectory
outputDirectory
clock
io
File operations that a reader test can replace to verify failures at traversal and open boundaries.
GetPathAttributes
EnumerateChildren
GetChildAttributes
OpenRegularFile
InspectionIo Live { get; }
Source
Production operations, including the shared physical-containment file opener.
A bounded inspection status and zero or more scoped sequence observations.
Status
Sequences
Parses the intentionally narrow duration grammar used by coverage watchdog options.
TimeSpan Parse(string? value, string option, bool allowZero)
Parses a lowercase integer duration such as 500ms
, 30s
, 10m
, or 1h
.
value
option
allowZero
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)
Writes one serialized block to standard output.
text
cancellationToken
appendNewLine
coalesceIfWritePending
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)
Writes one serialized block to standard error.
Task WriteCriticalErrorAsync(string text, CancellationToken cancellationToken = default, bool appendNewLine = true)
Writes a terminal diagnostic in FIFO order when possible, then bypasses a blocked queue after the bounded wait. The fallback can interleave with a hung earlier output block, but atomically abandons its queued continuation so the critical diagnostic is emitted at most once.
text
cancellationToken
appendNewLine
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)
Records a positive count of observed child-process bytes as progress.
void Transition(string state)
Records an explicit operation state transition as progress.
CoverageRunProcessLease ReserveProcess()
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)
Attaches the root process delivered by CliWrap's start callback.
void Complete(bool processExited = false)
Marks the command complete and unregisters the lease.
processExited
Reports whether all registered child processes were confirmed exited during bounded cleanup.
Confirmed
Status
complete
, deadline-exceeded
, or failed
.Supervises coverage-run orchestration using per-operation monotonic progress clocks.
Task<CoverageRunProcessDrainResult> TerminateAndDrainProcessesAsync()
Terminates and drains registered child processes within the watchdog cleanup bound.
Safe to call after caller/Evidence cancellation; concurrent watchdog cleanup joins the same attempt.
void BindOutputDirectory(string outputDirectory)
Binds watchdog artifacts to an AppSurface-owned output directory after full output validation.
outputDirectory
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)
Starts a supervised operation. Queued work should call this only when it becomes active.
kind
project
order
state
log
commandOptions
A disposable operation that marks completion and exposes progress/process seams.
OperationCanceledException
CoverageRunProcessLease ReserveProcess()
Reserves a process lease before a child-process start callback can attach its root process.
A lease registered for terminal cleanup.
OperationCanceledException
void ReleaseProcess(CoverageRunProcessLease lease)
Releases a completed process lease from terminal cleanup tracking.
lease
void ObserveBytes(long id, int count)
Records positive observed output bytes for an active operation.
id
count
void Transition(long id, string state)
Records an explicit state transition as operation progress.
id
state
void Complete(long id)
void ThrowIfFailed()
Converts watchdog-owned cancellation into the stable ASCOV121
exit-124 diagnostic.
CommandException
void Commit(Action commit)
Revalidates that the watchdog has not claimed terminal ownership before an atomic artifact commit.
commit
ArgumentNullException
commit
is null
.OperationCanceledException
Action<string>? ArtifactPublished { get; set; }
Source
Gets the artifact writer callback bound to the participating output inventory.
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.
Describes the effective collector-settings inspection for one evaluated project.
State
Cause
EffectivePath
Project
Framework
null
for outer evaluation.Resolves and inspects runsettings for the actual test invocation without changing its arguments.
CoverageArtifactSettingsResult Observe(CoverageRunProject project, string? framework, string capabilityJson, string configuration, IReadOnlyList<string> testArguments)
Observes effective settings from evaluated MSBuild properties and recognized invocation overrides.
project
framework
null
for outer evaluation.capabilityJson
configuration
testArguments
A bounded state and internal effective path; paths must never be copied to public diagnostics.
string[] NormalizeJoinedValueOptions(string[] args)
Rebuilds admitted value options as separate name/value tokens for CliFx binding.
args
Equivalent admitted options, or the original argv for help, another command, or invalid input.
Call after raw admission so malformed input uses the safe diagnostic path. Values retain embedded equals signs.
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.
Describes one driver's raw and canonical artifact locations for a project invocation.
Driver
ProjectOutputDirectory
RawResultsDirectory
null
for caller-owned MSBuild results.OwnedArguments
Result of normalizing one driver's current-invocation coverage artifact.
Status
produced
, missing
, multiple
, unreadable
, escaping
, or malformed
. CoverageFile
Status
is produced
.Cause
null
.CleanupDiagnostic
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, IReadOnlyList<string>? testArguments = null, Action<CoverageRunProject, string?, string>? observeCapabilities = null)
Validates the selected engine and every selected project's evaluated coverage package.
driver
configuration
resolution
processRunner
supervisor
cancellationToken
testArguments
observeCapabilities
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)
Returns the stable lowercase CLI name for a coverage driver.
driver
collector
or msbuild
.
Owns coverage-driver arguments and deterministic per-project artifact normalization.
void ValidateTestArguments(CoverageRunDriver driver, IReadOnlyList<string> arguments)
Validates user arguments that would override AppSurface-owned coverage behavior.
driver
arguments
dotnet test
arguments in invocation order.Throws a stable coverage execution diagnostic when an argument collides with driver-owned coverage configuration.
void ValidateHangArguments(CoverageRunRequest request)
Reserves MSBuild result-directory ownership before discovery in fail mode when the user did not claim the blame policy. This guard also applies if the later launch budget is too short.
CoverageRunDriverInvocation CreateInvocation(CoverageRunRequest request, string projectOutputDirectory, CoverageRunHangPlan? hangPlan = null)
Creates driver-owned arguments and raw artifact locations for one project invocation.
request
projectOutputDirectory
hangPlan
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)
Appends collector runsettings after user-controlled pre-separator arguments.
request
arguments
dotnet test
argument list to complete.Task<bool> NormalizeAsync(CoverageRunDriverInvocation invocation, int processExitCode, string logFile, CancellationToken cancellationToken, Action<Action>? commitGate = null)
Normalizes the current invocation's driver artifact into the canonical project path.
invocation
processExitCode
dotnet test
process.logFile
cancellationToken
commitGate
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, bool removeRedundantRaw = false)
Normalizes an artifact and returns a stable status without selecting the run's primary failure.
invocation
cancellationToken
commitGate
beforeArtifactOpen
deleteStagedFile
removeRedundantRaw
A stable normalization status and the canonical absolute artifact path only when produced.
Exception CreateArtifactFailure(string logFile, string rawDirectory, string cause)
Creates the stable artifact-contract diagnostic used by workflow-level failure ordering.
logFile
rawDirectory
cause
An ASCOV115
command failure.
One reviewed dispatcher/runtime role identity and its dispatcher capability profile.
Names are preserved exactly as supplied. PostgreSQL role names are compared ordinally; values are not trimmed, normalized, case-folded, interpolated into SQL, or shortened. See the schema-11 operations guide for manifest custody and the deployment workflow.
A bounded immutable copy of the reviewed version-1 role manifest and its exact-byte SHA-256 digest.
ReadAsync(string, CancellationToken)
reads at most 64 KiB once from the selected file and hashes those exact bytes. Parse(ReadOnlySpan{byte})
is the equivalent parser seam for internal callers and tests; it does not retain or expose the input buffer. Pairs are ordered as reviewed and are immutable. The format is deliberately complete even for one-pair stores: version 1, one to 32 pairs, and exactly the three pair fields. See the canonical operations guide for when this manifest is used and its release/activation limits.
ValueTask<DurableRoleManifest> ReadAsync(string path, CancellationToken cancellationToken)
Reads one bounded manifest file and validates its complete version-1 input before a connection opens.
path
cancellationToken
An immutable manifest with a digest over the exact bytes read.
ArgumentException
ArgumentException
OperationCanceledException
ValueTask<DurableRoleManifest> ReadStreamAsync(Stream stream, CancellationToken cancellationToken)
Reads and validates a bounded manifest from a caller-owned stream.
stream
cancellationToken
The same immutable manifest and exact-byte digest as the path-based reader.
ArgumentNullException
ArgumentException
OperationCanceledException
This internal file-boundary seam reads forward once and never disposes, seeks or retains the stream. It permits deterministic partial-read cancellation and I/O failure verification without changing the public CLI input contract. Parsing occurs only after a complete bounded read; failures contain neither stream contents nor provider exception text. The caller owns stream cleanup.
DurableRoleManifest Parse(ReadOnlySpan<byte> utf8Json)
Validates strict UTF-8 JSON and constructs an immutable manifest without retaining the input memory.
utf8Json
Validated ordered role pairs and the SHA-256 of exactly utf8Json
.
ArgumentException
ImmutableArray<DurableRolePair> Pairs { get; }
Source
Gets the ordered, immutable role pairs exactly as declared in the reviewed input.
string Sha256 { get; }
Source
Gets the lowercase hexadecimal SHA-256 of the original manifest bytes, including whitespace.
An immutable manifest plus the independently reviewed migration-owner role used for one preflight.
The owner is deliberately supplied separately from the manifest, validated by the same exact UTF-8 byte and control-character rules, and must not equal any dispatcher or runtime name. Neither value is inferred from the catalog. The caller retains ownership of database connections and the continuous maintenance guard; this request owns only its immutable manifest reference and validated owner string. See the schema-11 operations guide for ordering, custody and deployment evidence requirements.
DurableRoleManifest Manifest { get; }
Source
Gets the complete immutable reviewed manifest.
string MigrationOwnerRole { get; }
Source
Gets the exact validated migration-owner role name.
Reads fixed credential and retention evidence from a caller-owned PostgreSQL snapshot.
Each operation executes one bounded statement and returns only ordered, package-defined failed categories. Callers establish session affinity, compatible schema where required, and a read-only transaction first. Catalog values such as role names, ACLs, function configuration and index definitions stay inside SQL.
ValueTask<IReadOnlyList<string>> ReadCredentialAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, CancellationToken cancellationToken)
Reads the six fixed connected-credential checks from the caller's active transaction.
connection
transaction
cancellationToken
Credential failure categories in the fixed doctor contract order.
Ownership, grant-option and direct heartbeat ACL checks use the live catalog namespace; no relation is resolved through regclass
.
ValueTask<IReadOnlyList<string>> ReadRetentionAsync(NpgsqlConnection connection, NpgsqlTransaction transaction, CancellationToken cancellationToken)
Reads the nine fixed schema-11 retention checks from a compatible-schema snapshot.
connection
transaction
cancellationToken
Retention failure categories in the fixed doctor contract order.
Missing the exact function signature contributes only that finding; absent dependent function facts are treated as not applicable.
IReadOnlyList<string> MapCredentialProjection(object?[]? projection)
Maps a six-boolean credential projection without retaining provider-controlled values.
projection
Failed categories in the credential contract order.
InvalidOperationException
IReadOnlyList<string> MapRetentionProjection(object?[]? projection)
Maps a nine-boolean retention projection without retaining provider-controlled values.
projection
Failed categories in the retention contract order.
InvalidOperationException
Immutable, bounded projection shared by the doctor's text and JSON renderers.
One fixed v1 check entry in credential, schema, epoch, retention, worker order.
Schema facts projected according to the v1 compatibility and availability matrix.
Secret-free evidence that the connected role passed or failed the fixed runtime-role checks.
Secret-free evidence for the schema-11 heartbeat-retention capability.
Bounded facts for only the worker identity explicitly selected by the caller.
Canonical catalog wording and the finding-specific action for one diagnosis.
One safe command or application-composition handoff with an absolute documentation destination.
Validated executable and bounded argv; arguments remain separate from shell formatting.
Copies bounded-result collections into read-only arrays before they cross the pure output boundary.
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.
Renders the same bounded classified result as stable v1 JSON or operator-oriented text.
JSON uses an explicit writer so every property, null, array and ordering decision is fixed. Unsupported or malformed render inputs throw a fixed contract exception before output is written. Both formats are capped at 32 KiB and end with exactly one line feed. See DurableDoctorClassifier
for the observation contract.
string Render(DurableDoctorResult result, DurableDoctorRequest? request, string format)
Renders one result as JSON only for the exact format token json
; all other tokens use safe text.
result
request
format
A bounded final-newline string.
Terminal execution family, with caller cancellation winning over every other family.
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.
Identifies the public PWA verification surface.
Identifies the expected server-known push posture.
Observation stages exposed internally for deterministic pause, denial and cleanup verification.
Controls how coverage run
responds when an active operation produces no observable progress.
Coverage integrations supported by the VSTest-based coverage run
workflow.