AppSurface Search
API Reference

Validation

Type

RepositoryEvidenceWorkflow

Source

Resolves the repository's real changed-path inventory, executes only its selected acceptance producers, and verifies gate eligibility against the original plan and retained artifact bytes.

Remarks

This internal adapter accepts the native, solution coverage and package-check producer contracts. It does not provision resources, aggregate job manifests, or authenticate provenance. Inputs and outputs must come from the current trusted workflow workspace. See this tool's README for command contracts.

Method

RunAsync

Task<int> RunAsync(IReadOnlyDictionary<string, string> options, CancellationToken cancellationToken, Func<CancellationToken, Task>? verifyLocalSourceAsync = null)

Runs one explicit repository planning, execution, or gate operation; incomplete evidence returns nonzero.

Parameters

  • options
    Validated command options and trusted plan inputs.
  • cancellationToken
    Cancels execution and artifact verification.
  • verifyLocalSourceAsync
    Optional in-process local source and policy digest check; required for patch overrides.
Method

Declaration

EvidenceProducerDeclaration Declaration(string id)

Returns the closed declaration implemented by each repository producer; unknown IDs fail closed.

Method

VerifyAsync

Task VerifyAsync(EvidencePlan plan, EvidenceManifest manifest, string artifactRoot, CancellationToken cancellationToken)

Rejects edited claims, missing obligations, unsuccessful cleanup, and missing or altered retained artifacts.

Method

RequiresPackage

bool RequiresPackage(EvidenceProfile profile)

Whether the selected profile needs the separately packed CLI used by native acceptance journeys.

Method

ResolveScope

EvidencePlan ResolveScope(EvidencePolicy policy, IReadOnlyList<NormalizedDiffPath> paths, string scope)

Projects a validated shared policy into one execution lane without reclassifying changed paths.

Type

RepositoryChangeSet

Source

A pinned repository snapshot and its canonical changed-path inventory.

Type

RepositoryGitChanges

Source

Collects a deterministic, bounded Git change inventory for local development and workflow events.

Method

CollectLocalAsync

Task<RepositoryChangeSet> CollectLocalAsync(string repository, string baseRevision, CancellationToken ct)

Binds committed, staged, unstaged and nonignored untracked changes to a local source digest. Git observes executable bits on Unix and uses its configured file-mode behavior on Windows.

Method

WriteLocalPatchAsync

Task WriteLocalPatchAsync(string repository, string baseCommit, IReadOnlyList<NormalizedDiffPath> paths, string output, CancellationToken cancellationToken)

Writes a bounded patch with fixed a/ and b/ prefixes for local changed-line gating.

Method

ReadIdentityAsync

Task<string> ReadIdentityAsync(string repository, CancellationToken cancellationToken, params string[] arguments)

Reads a bounded scalar identity from Git without a shell.

Type

SolutionCoverageProducer

Source

Runs the complete repository solution coverage workflow and closes its aggregate and optional patch gates.

Method

ProduceAsync

ValueTask<EvidenceProducerResult> ProduceAsync(EvidenceProducerContext context, CancellationToken cancellationToken)

Runs collection, verifies the exact solution test inventory and timings, then evaluates coverage gates.

Type

LocalEvidenceWorkflow

Source

Runs the repository policy against a local branch and working tree, packing a candidate only after planning selects native producers. Uses the same host and manifest verifier as CI on the current OS.

Remarks

No results are reused. The merge-base diff, index, working tree and untracked files are collected by RepositoryGitChanges . Source drift prevents gate success. Output belongs outside the source inventory (the default is ignored TestResults); package and producer logs remain in that output.

Method

RunAsync

Task<int> RunAsync(IReadOnlyDictionary<string, string> options, CancellationToken cancellationToken)

Plans or executes current local changes and returns zero only for successful verification or an empty inventory.

Type

RepositoryCheckSettings

Source

Explicit execution inputs for solution coverage and package validation selected by repository policy.

Parameters

  • RepositoryRoot
    Checkout whose source and solution are being verified.
  • DotnetPath
    Absolute .NET host used by every child command.
  • OutputDirectory
    Fresh producer-owned output below the caller's evidence run.
  • DiffBase
    Pinned comparison commit for coverage; null means aggregate-only baseline.
  • NativeCoverageDirectory
    Optional same-run native capture parent for cross-platform patch fan-in.
  • DiffFile
    Immutable local patch snapshot including working-tree and untracked edits, when present.
Property

VerifyLocalSourceAsync

Func<CancellationToken, Task>? VerifyLocalSourceAsync { get; init; } Source

Verifies the local source and policy digest captured by LocalEvidenceWorkflow . Required for a dirty local patch; direct command-line runs cannot supply this in-process callback.

Property

CommandEnvironment

IReadOnlyDictionary<string, string> CommandEnvironment { get; } Source

Keeps nested SDK commands on the selected host even when child tooling invokes dotnet by name.

Type

ValidationProof

Source

Independent input, JSON and byte assertions used by native acceptance producers.

Method

Require

void Require(bool condition, string contract)

Rejects a failed contract without copying untrusted output into a diagnostic.

Method

HashAsync

Task<string> HashAsync(string path, CancellationToken cancellationToken)

Computes a file digest without buffering the complete file.

Method

VerifyPackage

void VerifyPackage(ZipArchive archive, ValidationSettings settings)

Validates the package ID, exact version, and trusted source commit.

Method

Data

JsonElement Data(string output)

Reads the CLI JSON data envelope while rejecting a non-object response.

Method

ReadJsonFile

JsonDocument ReadJsonFile(string path, long maximumBytes, CancellationToken cancellationToken)

Reads a candidate-produced JSON file with a cumulative byte limit.

Method

InventoryAsync

Task<SortedDictionary<string, string>> InventoryAsync(string root, CancellationToken cancellationToken)

Inventories original bytes, excluding transient lock files only.

Method

Equal

bool Equal(IReadOnlyDictionary<string, string> first, IReadOnlyDictionary<string, string> second)

Compares complete path and hash inventories.

Type

ConsumerValidationOptions

Source

Overrides the checked-in consumer fixture used by the installed-package validation producer.

Parameters

  • SourceDirectory
    Optional source repository or fixture directory to copy into the owned workspace.
  • ExpectedCommit
    Required nonblank HEAD pin when SourceDirectory selects an external repository; optional for the built-in fixture.
  • SolutionPath
    Optional source-relative solution path.
  • TestProjects
    Optional source-relative test project paths. Supplying these skips solution discovery.
  • ExpectedRequiredTestFragments
    Test-case name or class fragments that must appear in passing JUnit cases.
  • PermittedSkipPatterns
    Optional case-insensitive testcase attribute fragments permitted to be skipped, mapped to a nonempty rationale. Omitted means zero skips are permitted.
  • DiffBase
    Optional git base used for the patch coverage gate.
  • Environment
    Optional child-process environment overrides.
Type

Program

Source

Plans and runs repository acceptance producers and publishes verifiable EvidenceHost manifests.

Type

PackedStorageProducer

Source

Exercises public storage commands from a verified packed CLI with independent byte assertions.

Method

WritePrivateRetentionPolicyAsync

Task WritePrivateRetentionPolicyAsync(string path, CancellationToken cancellationToken)

Writes this journey's zero-history policy inside its freshly owned scratch domain.

Parameters

  • path
    Policy path in the producer-owned domain; never a caller-owned policy.
  • cancellationToken
    Cancellation for the policy write.

Remarks

Uses Unix mode 0600 or a protected current-user Windows ACL before maintenance reads the policy. This internal seam lets native coverage tests verify the actual fixture permissions; it does not repair consumer policies.

Type

FailureArtifactDiagnostics

Source

Retains best-effort failure proofs without replacing the producer's primary failure.

Method

WriteAsync

Task<string> WriteAsync(EvidenceArtifactWriter writer, IReadOnlyList<(string Name, byte[] Contents)> artifacts)

Attempts each closed producer artifact independently and returns a diagnostic suffix containing only logical names and exception types. Exception messages and producer output are withheld.

Type

PackageChecksProducer

Source

Runs the repository's package manifest, generated-documentation and package-artifact checks.

Method

ProduceAsync

ValueTask<EvidenceProducerResult> ProduceAsync(EvidenceProducerContext context, CancellationToken cancellationToken)

Runs the package gate, generated-documentation verification and isolated package validation.

Type

InstalledConsumerProducer

Source

Runs the supplied CLI package against an isolated, source-integrity-checked consumer.

Method

ProduceAsync

ValueTask<EvidenceProducerResult> ProduceAsync(EvidenceProducerContext context, CancellationToken cancellationToken)

Runs package, test, report, gate, and source-integrity assertions.

Method

DisposeAsync

ValueTask DisposeAsync()

Disposes the producer-owned workspace so host cleanup is part of the claim.

Method

RedactAndBoundDiagnostic

string RedactAndBoundDiagnostic(string value, string root)

Redacts the owned workspace path and retains a UTF-8-safe trailing diagnostic bounded to 16 KiB.

Parameters

  • value
    Captured command output.
  • root
    Owned workspace path to redact before truncation.

Returns

A redacted string whose UTF-8 encoding is at most 16 KiB.

Method

IsContractFailure

bool IsContractFailure(Exception exception)

Identifies malformed or inaccessible evidence errors that must become a stable failed result.

Parameters

  • exception
    Failure raised while validating the consumer journey.

Returns

true for expected input and contract failures.

Method

VerifyInstalledAssembliesAsync

Task<bool> VerifyInstalledAssembliesAsync(string storePath, string expectedHash, CancellationToken cancellationToken)

Verifies every CLI assembly materialized in the installed tool's private package store.

Parameters

  • storePath
    The tool path's `.store` directory; workspace decoys are intentionally excluded.
  • expectedHash
    SHA-256 digest from the verified package archive.
  • cancellationToken
    Cancellation for hashing each candidate.

Returns

true only when at least one store assembly exists and every candidate matches.

Method

ValidateSettingsForTests

void ValidateSettingsForTests(ValidationSettings settings)

Validates the required native-consumer settings without starting a command journey.

Method

ContainedSourcePathForTests

string ContainedSourcePathForTests(string root, string relative)

Resolves a consumer path only when it remains inside the owned source root.

Method

CountTestProjectsForTests

int CountTestProjectsForTests(string root, string solutionPath)

Counts test projects using the same solution inventory contract as acceptance.

Method

IsTestProjectForTests

bool IsTestProjectForTests(string path)

Checks whether a project is classified as an executable test project.

Method

ValidateJUnitCountsForTests

void ValidateJUnitCountsForTests(XElement root, IReadOnlyList<XElement> testCases)

Validates independent JUnit suite counters against testcase elements.

Method

ReadJUnitReportsForTests

IReadOnlyList<XElement> ReadJUnitReportsForTests(string output, int expectedProjectCount, CancellationToken cancellationToken = default)

Reads only the declared JUnit inventory with report, aggregate and testcase bounds.

Method

IsPermittedSkipForTests

bool IsPermittedSkipForTests(XElement testCase, IReadOnlyDictionary<string, string>? permittedPatterns)

Checks whether a skipped testcase is explicitly permitted with a rationale.

Method

ValidateRequiredTestFragmentsForTests

void ValidateRequiredTestFragmentsForTests(IReadOnlyList<string> fragments, IReadOnlyList<XElement> testCases)

Validates that every required testcase fragment is present, passing, and not skipped.

Method

ValidateGateReportForTests

void ValidateGateReportForTests(string output, bool hasPatch, CancellationToken cancellationToken = default)

Validates the exact gate thresholds and zero-tolerance result JSON.

Property

Id

string Id { get; } Source

Gets the stable producer identifier.

Type

ValidationSettings

Source

Explicit candidate and workspace inputs for the repository's native acceptance journeys.

Parameters

  • RepositoryRoot
    Checkout containing this validation suite.
  • PackagePath
    Candidate CLI nupkg that must be installed and verified.
  • PackageVersion
    Exact candidate version; no floating package selection.
  • ExpectedSourceCommit
    Trusted candidate source commit checked against package metadata.
  • DotnetPath
    Explicit SDK host executable.
  • ScratchParent
    Existing parent for freshly owned workspace leases.
  • EvidenceDirectory
    Fresh caller-owned durable output outside scratch.
  • MaximumScratchBytes
    Per-producer logical scratch budget.
  • MinimumFreeBytes
    Free-space floor checked before and during commands.
  • Consumer
    Optional pinned external consumer; null selects the checked-in fixture.