Documentation
¶
Overview ¶
Package appflows composes experimental, caller-reported application behavior evidence.
Index ¶
- Constants
- func AdmitTransition(o Origins, origin, effectClass string) error
- func Classify(attempts []RunAttempt) string
- func CompileInventory(set IntentSet) ([]byte, error)
- func Decode(data []byte, out any) error
- func Digest(b []byte) string
- func EncodeRunEvidence(r TestRunEvidence) ([]byte, error)
- func ExportProvider(ctx context.Context, root string, set IntentSet) ([]byte, error)
- func ExportRequest(ctx context.Context, root string, envelope, inventory []byte) ([]byte, error)
- func FlowGaps(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence) ([]byte, error)
- func FlowImpact(ctx context.Context, root string, set IntentSet, base string, ...) ([]byte, error)
- func FlowImpactAt(ctx context.Context, root string, set IntentSet, base string) ([]byte, error)
- func FlowLookup(ctx context.Context, root string, set IntentSet, path, testKey string) ([]byte, error)
- func FlowMap(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence) ([]byte, error)
- func FlowNavigationMap(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence, ...) ([]byte, error)
- func FlowNavigationPacket(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence, ...) ([]byte, error)
- func FlowStability(ctx context.Context, root, name string, evidence []TestRunEvidence) ([]byte, error)
- func FlowsDir(root, dir string) (string, error)
- func Import(root, dir string, raw []byte, format, source string) ([]string, error)
- func ReadFile(filename string) ([]byte, error)
- func Record(in Input, raw []byte, filename string) error
- func RenderDocs(ctx context.Context, root string, set IntentSet, o DocOptions) ([]byte, []byte, error)
- func ReplaceConfined(root, rel string, data []byte) error
- func ResolveRevision(ctx context.Context, root, revision string) (string, error)
- func ValidateEvidence(in Input, e Evidence) error
- func ValidateIntent(f FlowIntent) error
- func ValidateManifest(m Manifest) error
- func ValidateRunEvidence(r TestRunEvidence) error
- func ValueDigest(v json.RawMessage) string
- func Verified(r TestRunEvidence) bool
- func WriteConfined(root, filename string, data []byte) error
- func WriteDocs(root string, o DocOptions, page, claims []byte) error
- type Action
- type Anchor
- type Assertion
- type Binding
- type Candidate
- type Check
- type CheckResult
- type Control
- type Coverage
- type CoverageFile
- type CoverageRecord
- type CoverageTier
- type DocCheck
- type DocClaim
- type DocClaims
- type DocCoverage
- type DocEvidence
- type DocFailure
- type DocOptions
- type DocWaiver
- type DocWaivers
- type E2EDiscovery
- type E2EFallback
- type E2EInput
- type E2EOmission
- type E2EProof
- type E2ESelection
- type E2ETest
- type EvaluatedLink
- type Evidence
- type Flow
- type FlowAdapter
- type FlowIntent
- type FlowLink
- type FlowNavigation
- type FlowOutcome
- type FlowStep
- type FlowVariation
- type Gap
- type GapFlow
- type GapsReport
- type ImpactFlow
- type ImpactGraph
- type ImpactHit
- type ImpactReport
- type Ingested
- type Input
- type IntentSet
- type Inventory
- type InventoryFlow
- type InventoryTest
- type LinkTarget
- type LookupReport
- type Manifest
- type MapFlow
- type MapMember
- type MapReport
- type MapVariation
- type NavFlow
- type NavLocator
- type NavState
- type NavStep
- type NavigationMap
- type NavigationPacket
- type NegativeControl
- type Origins
- type PacketFlow
- type ProofLink
- type Report
- type Retired
- type ReverseHit
- type ReviewSummary
- type Run
- type RunAggregate
- type RunAggregateReport
- type RunAnchor
- type RunAttachment
- type RunAttempt
- type RunContribution
- type RunContributionReport
- type RunControl
- type RunDigestRef
- type RunHeader
- type RunPolicy
- type RunRegistry
- type RunRunner
- type RunSource
- type RunStabilityReport
- type Scenario
- type SelectionProvider
- type Source
- type Test
- type TestEvidence
- type TestRunEvidence
- type TrafficRecord
- type Transition
Constants ¶
const ( DocClaimsSchema = "flow-doc-claims/0" DocWaiversSchema = "flow-doc-waivers/0" DocCheckSchema = "flow-doc-check/0" )
Proven-documentation schemas (AFU-V1-030, AFU-V1-032).
const ( ClaimProven = "PROVEN" ClaimContradicted = "CONTRADICTED" ClaimStale = "STALE" ClaimUnproven = "UNPROVEN" )
Claim states (AFU-V1-031).
const ( DocLostProven = "claim-lost-proven" DocBytesDiffer = "rendered-bytes-differ" DocUnknownClaim = "unknown-anchor" DocBadAnchor = "invalid-anchor" )
The closed `flows docs --check` failure codes (AFU-V1-032, AFU-V1-033).
const ( InventorySchema = "application-flow-inventory/1" FlowsInputID = "application-flows" ProviderID = "corvint-application-flows" ProviderRepoID = "repository" )
Export identities (AFU-V1-003).
const ( FormatAdapterRequest = "behavior-adapter-request" FormatOpenAPI = "openapi" FormatPlaywrightList = "playwright-list" )
Import formats (AFU-V1-004).
const ( FlowIntentSchema = "application-flow-intent/1" RetiredSchema = "application-flow-retired/1" RetiredFile = "retired.json" OriginsFile = "origins.json" MaxFlows = 512 )
Wire identities and bounds of the AFU-V1 intent model (AFU-V1-001, AFU-V1-002, AFU-V1-037).
const ( TrafficSchema = "application-flow-traffic/0" EffectRead = "read" EffectWriteReversible = "write-reversible" EffectWriteIrreversible = "write-irreversible" EffectExternal = "external-side-effect" GrantGranted = "granted" GrantRequired = "requires-grant" )
Navigation wire identities, the effect ladder and the packet bound (AFU-V1-025..028).
const ( MapSchema = "application-flow-map/1" LookupSchema = "application-flow-lookup/1" GapsSchema = "application-flow-gaps/1" )
Query document schemas (AFU-V1-015..017).
const ( GapUnmappedFlow = "unmapped-flow" GapNoTest = "no-test" GapTestWithoutAssertion = "test-without-assertion" GapAssertionUnlinked = "assertion-unlinked" GapStaleLink = "stale-link" GapInferredOnly = "inferred-only" GapEvidenceMissing = "evidence-missing" GapEvidenceStale = "evidence-stale" GapEvidenceFlaky = "evidence-flaky" GapNegativeControlMissing = "negative-control-missing" GapCleanupUnverified = "cleanup-unverified" GapUnreviewed = "unreviewed" )
The closed gap codes (AFU-V1-016).
const ( ReviewReviewed = "reviewed" ReviewStale = "stale" ReviewNotAncestor = "anchor-not-ancestor" ReviewNotIntentChange = "anchor-not-intent-change" ReviewAnchorUnknown = "anchor-unknown" ReviewLinkNotAtAnchor = "link-not-at-anchor" ReviewTargetUnpinned = "target-unpinned" ReviewUnreviewed = "unreviewed" ReviewInferred = "inferred" )
Evaluated review states; only `reviewed` makes a link's basis `reviewed` (AFU-V1-008, AFU-V1-009).
const ( RunEvidenceSchema = "test-run-evidence/0" AuthorityIngested = "INGESTED" AuthorityLocallyObserved = "LOCALLY_OBSERVED" AuthorityStatic = "STATIC" )
Wire identity, authorities and bounds of test-run-evidence/0 (AFU-V1-011, AFU-V1-014, AFU-V1-037).
const ( BoundBytes = "run-evidence-byte-bound" BoundRecords = "run-evidence-record-bound" BoundAttempts = "run-evidence-attempt-bound" BoundLinks = "run-evidence-link-bound" BoundTraversal = "run-evidence-traversal-bound" )
Named codes of an incomplete run-evidence ingest; each names the bound that was exceeded (AFU-V1-037).
const ( FormatPlaywrightJSON = "playwright-json" FormatJUnitXML = "junit-xml" FormatGoTestJSON = "go-test-json" )
Run-evidence ingest formats (AFU-V1-012).
const ( RunRegistrySchema = "flows-run-registry/0" RunStabilitySchema = "flows-run-stability/0" )
Wire identity of the separate run registry and its stability report (AFU-V1-041, AFU-V1-042).
const ( RegistryInvalid = "run-registry-invalid" RegistryRepetition = "run-registry-invalid-repetition" RegistryIncomplete = "run-registry-planned-incomplete" RegistryDuplicateRun = "run-registry-duplicate-run" RegistryMissingRecord = "run-registry-missing-record" RegistryAmbiguousRecord = "run-registry-ambiguous-record" RegistryUnusableRecord = "run-registry-unusable-record" RegistryInfrastructure = "run-registry-contradictory-infrastructure" RegistryCrossIdentity = "run-registry-cross-identity" )
Named refusals of a run-registry aggregate; each leaves no verdict (AFU-V1-042, DCP-V1-022).
const ( E2ESafeProfile = "e2e-safe" E2ESafeSchema = "e2e-safe-selection/0" SelectionProviderSchema = "application-flow-selection-provider/1" CoverageSchema = "application-flow-coverage/0" BasisCoverage = "coverage" BasisReviewedLinks = "reviewed-links" )
The e2e-safe profile of `corvint affected --selection-profile` (AFU-V1-019..024).
const ( CodeUnmappedChange = "e2e-unmapped-change" CodeInventoryIncomplete = "e2e-inventory-incomplete" CodeExclusionUnproven = "e2e-exclusion-unproven" CodeGlobalPathChanged = "e2e-global-path-changed" CodeMapStale = "e2e-map-stale" CodeInferredLinkOnly = "e2e-inferred-link-only" CodeBoundExceeded = "e2e-bound-exceeded" )
The closed fallback codes (AFU-V1-022). Any one of them yields the full relevant suite.
const ( IntentProfile = "application-flow-intent/0" EvidenceProfile = "application-flow-evidence/0" ReportProfile = "application-flow-report/0" MaxBytes = 5 << 20 MaxSources = 128 )
const ImpactDirtyWorktree = "DIRTY_WORKTREE"
ImpactDirtyWorktree is the graph unknown reason of an impact report built from a worktree that differs from HEAD.
const ImpactSchema = "application-flow-impact/1"
ImpactSchema names the `flows impact` document (AFU-V1-017).
const OriginsSchema = "application-flow-origins/0"
OriginsSchema is the repository-owned origins.json in the flows directory (AFU-V1-029).
const ReviewIdentityNote = "" /* 185-byte string literal not displayed */
ReviewIdentityNote is stated wherever reviewed links are reported (AFU-V1-008).
Variables ¶
This section is empty.
Functions ¶
func AdmitTransition ¶
AdmitTransition is the observer gate: a read or write-reversible transition runs anywhere; any other class, including an unknown one, runs only against a listed disposable origin.
func Classify ¶
func Classify(attempts []RunAttempt) string
Classify is the per-test result of one run: the last attempt's outcome, except that a passed last attempt after a failed or timed-out one is flaky, never passed (AFU-V1-013).
func CompileInventory ¶
CompileInventory compiles the intent set to canonical inventory bytes. It carries no proposed marker.
func Decode ¶
Decode rejects duplicate keys, excessive depth, unknown fields and secret-shaped content.
func EncodeRunEvidence ¶
func EncodeRunEvidence(r TestRunEvidence) ([]byte, error)
EncodeRunEvidence is the canonical encoding and the last step before any write: it validates the record, then refuses secret-shaped content and an encoding over the byte bound (AFU-V1-037, AFU-V1-038).
func ExportProvider ¶
ExportProvider compiles one EEP-V1 provider record at the revision the set was committed at; a working-tree set is refused (AFU-V1-003, AFU-V1-007).
func ExportRequest ¶
ExportRequest fills the envelope's application-flows input with the inventory, maps the flows and variations kinds to it, and runs the result through the existing DCP-V1 adapter (AFU-V1-003). The input anchor must name, through Git, a committed blob whose bytes are exactly the inventory.
func FlowGaps ¶
func FlowGaps(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence) ([]byte, error)
FlowGaps reports each flow's closed-code gaps at the set's revision (AFU-V1-016).
func FlowImpact ¶
func FlowImpact(ctx context.Context, root string, set IntentSet, base string, graph *affected.Graph, plan affected.Plan) ([]byte, error)
FlowImpact reports the flows reached from plan's changed paths (AFU-V1-017). The caller builds the graph and selects plan over the base..HEAD tree diff.
func FlowImpactAt ¶
FlowImpactAt is the `flows impact` pipeline shared by the CLI verb and the MCP tool: it diffs the resolved base commit against HEAD, builds the impact graph over every supported language, marks the graph scope UNKNOWN when the worktree differs from HEAD, and reports through FlowImpact.
func FlowLookup ¶
func FlowLookup(ctx context.Context, root string, set IntentSet, path, testKey string) ([]byte, error)
FlowLookup answers one reverse lookup, source path or test key to flows (AFU-V1-010). A path that is not in the canonical repository-relative form of a link target is refused, never an empty answer.
func FlowMap ¶
func FlowMap(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence) ([]byte, error)
FlowMap reports every flow, member, link and variation evidence state at the set's revision (AFU-V1-015), with the reviewed denominator and its self-attestation limitation (AFU-V1-008, 009).
func FlowNavigationMap ¶
func FlowNavigationMap(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence, traffic []TrafficRecord) ([]byte, error)
FlowNavigationMap derives the navigation map at the set's revision (AFU-V1-025..027).
func FlowNavigationPacket ¶
func FlowNavigationPacket(ctx context.Context, root string, set IntentSet, evidence []TestRunEvidence, traffic []TrafficRecord, goal, maxEffect string) ([]byte, error)
FlowNavigationPacket returns the bounded packet for one goal flow, each step above maxEffect marked requires-grant with the class it needs (AFU-V1-028).
func FlowStability ¶
func FlowStability(ctx context.Context, root, name string, evidence []TestRunEvidence) ([]byte, error)
FlowStability aggregates repeated runs of each registry aggregate from the registry committed at HEAD and the given records (AFU-V1-041, AFU-V1-042). It reads only; any refusal leaves no report.
func FlowsDir ¶
FlowsDir checks that dir is a repository-relative real directory under root, following no symlink.
func Import ¶
Import compiles raw into new proposed intents with inferred links and writes each as a new file under dir. It is all-or-nothing: the combined set is bounded and validated before any write, every file is created exclusively, and a failed write removes exactly the files this call created (AFU-V1-004, AFU-V1-037). Flow IDs are lowercase and every case variant of a .json name is loaded as an intent, so a name that differs only in case from an existing file is refused before writing.
func ReadFile ¶
ReadFile reads a flow input only when Lstat shows a regular file before it is opened (AFU-V1-036).
func Record ¶
Record is explicit opt-in learning: a new private artifact, never an implicit index update.
func RenderDocs ¶
func RenderDocs(ctx context.Context, root string, set IntentSet, o DocOptions) ([]byte, []byte, error)
RenderDocs regenerates the page and its sidecar from the committed intents and hand-written docs (AFU-V1-030). An anchor failure refuses the render (AFU-V1-033).
func ReplaceConfined ¶
ReplaceConfined replaces rel under root through a temporary file created exclusively in the same directory and a rename, following no symlink; an existing target must be a regular file (AFU-V1-036).
func ResolveRevision ¶
ResolveRevision names the evaluated commit.
func ValidateEvidence ¶
func ValidateIntent ¶
func ValidateIntent(f FlowIntent) error
ValidateIntent checks one intent's closed shape and internal references.
func ValidateManifest ¶
func ValidateRunEvidence ¶
func ValidateRunEvidence(r TestRunEvidence) error
ValidateRunEvidence checks one record's closed shape (AFU-V1-011, AFU-V1-014).
func ValueDigest ¶
func ValueDigest(v json.RawMessage) string
func Verified ¶
func Verified(r TestRunEvidence) bool
Verified reports whether a record may be shown as verified. An invalid or STATIC record never is (AFU-V1-014); any other needs a passed classification, cleanup done and every negative control observed failing.
func WriteConfined ¶
WriteConfined exclusively creates filename under root and writes data, following no symlink inside or out of the root (AFU-V1-036).
Types ¶
type Candidate ¶
type Candidate struct {
ID string `json:"id"`
Basis string `json:"basis"`
Route string `json:"route"`
Actions []Action `json:"actions"`
Source Anchor `json:"source"`
Freshness string `json:"freshness"`
}
Candidate is an inferred multi-step journey, independent of the supplied intent inventory.
type CheckResult ¶
type CoverageFile ¶
type CoverageFile struct {
Schema string `json:"schema"`
Records []CoverageRecord `json:"records"`
}
CoverageFile is the ingested coverage the provider names; it lives outside the provider so that a new record does not change a global path after its own evidence commit.
type CoverageRecord ¶
type CoverageRecord struct {
TestKey string `json:"test_key"`
Commit string `json:"commit"`
Tiers []CoverageTier `json:"tiers"`
}
CoverageRecord is one test's ingested per-tier coverage from its run at Commit.
type CoverageTier ¶
type DocCheck ¶
type DocCheck struct {
Schema string `json:"schema"`
Revision string `json:"revision"`
Status string `json:"status"`
Failures []DocFailure `json:"failures"`
Waived []string `json:"waived"`
Coverage *DocCoverage `json:"coverage,omitempty"`
}
DocCheck is the flow-doc-check/0 report of `flows docs --check`.
func CheckDocs ¶
func CheckDocs(ctx context.Context, root string, set IntentSet, o DocOptions, waiversPath, today string) (DocCheck, error)
CheckDocs compares the committed page and sidecar with regeneration at HEAD (AFU-V1-032). It reads only committed files, so it never mutates the repository; today is the UTC date YYYY-MM-DD.
type DocClaim ¶
type DocClaim struct {
ID string `json:"id"`
Source string `json:"source"`
Flow string `json:"flow"`
Variation string `json:"variation"`
Outcome string `json:"outcome"`
Evidence []DocEvidence `json:"evidence"`
State string `json:"state"`
}
DocClaim is one claim: an outcome of a variation, stated on the page or in an anchored document.
type DocClaims ¶
type DocClaims struct {
Schema string `json:"schema"`
Page string `json:"page"`
Claims []DocClaim `json:"claims"`
}
DocClaims is the flow-doc-claims/0 sidecar: every rendered and anchored claim, sorted by ID.
type DocCoverage ¶
type DocCoverage struct {
Row string `json:"row"`
Value int `json:"value"`
Denominator int `json:"denominator"`
Revision string `json:"revision"`
Rule string `json:"rule"`
Limitation string `json:"limitation"`
Paths []string `json:"paths"`
}
DocCoverage is the single row listing unanchored documents under the docs root (AFU-V1-033).
type DocEvidence ¶
type DocEvidence struct {
TestKey string `json:"test_key"`
Project string `json:"project,omitempty"`
}
DocEvidence identifies one required test key and project pair; run IDs are not claim identity.
type DocFailure ¶
type DocFailure struct {
Code string `json:"code"`
Claim string `json:"claim,omitempty"`
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Detail string `json:"detail"`
}
DocFailure is one check failure with a closed code.
type DocOptions ¶
type DocOptions struct {
Page, Claims, DocsRoot string
Evidence []TestRunEvidence
}
DocOptions names the committed page, its claim sidecar, the optional hand-written docs root and the run evidence, all repository-relative except the evidence files, which are already read.
type DocWaiver ¶
type DocWaiver struct {
Claim string `json:"claim"`
Reason string `json:"reason"`
Reviewer string `json:"reviewer"`
Expires string `json:"expires"`
}
DocWaiver excuses one claim until its expiry date (YYYY-MM-DD, UTC), exclusive.
type DocWaivers ¶
DocWaivers is the repository-owned flow-doc-waivers/0 file.
type E2EDiscovery ¶
type E2EFallback ¶
type E2EInput ¶
type E2EInput struct {
Provider string
Discovery string
Revision string
Base string
Graph *affected.Graph
Plan affected.Plan
Mandatory []any
}
E2EInput is what `affected` hands the profile. Provider and Discovery are repository-relative; Base is empty for a worktree-only run; Changed is the plan's changed paths.
type E2EOmission ¶
type E2EProof ¶
type E2EProof struct {
Links []ProofLink `json:"links,omitempty"`
Coverage *CoverageRecord `json:"coverage,omitempty"`
DisjointFrom []string `json:"disjoint_from"`
Attestation string `json:"attestation,omitempty"`
}
E2EProof names what an exclusion rests on and the changed paths it is disjoint from.
type E2ESelection ¶
type E2ESelection struct {
Schema string `json:"schema"`
Profile string `json:"profile"`
State string `json:"state"`
StateReason string `json:"state_reason"`
Base string `json:"base"`
Mandatory []any `json:"mandatory"`
Discovery E2EDiscovery `json:"discovery"`
Selected []E2ETest `json:"selected"`
OmittedTests []E2EOmission `json:"omitted_tests"`
OmissionsPerBasis map[string]int `json:"omissions_per_basis"`
Fallback []E2EFallback `json:"fallback"`
Note string `json:"note"`
UntrustedTextFields []string `json:"untrusted_text_fields"`
}
E2ESelection is the e2e-safe test_selection member (AFU-V1-023).
type E2ETest ¶
type E2ETest struct {
TestKey string `json:"test_key"`
Project string `json:"project"`
Path string `json:"path"`
Reasons []string `json:"reasons"`
}
E2ETest is one selected test; a discovered test missing from the inventory has no test key.
type EvaluatedLink ¶
type EvaluatedLink struct {
Flow string `json:"flow"`
From string `json:"from"`
Basis string `json:"basis"`
ReviewState string `json:"review_state"`
Target LinkTarget `json:"target"`
Blob string `json:"blob,omitempty"`
Revision string `json:"revision"`
ReviewedAt string `json:"reviewed_at,omitempty"`
ReviewAttestation string `json:"review_attestation,omitempty"`
}
EvaluatedLink is one forward link evaluated at one revision (AFU-V1-007).
func EvaluateLinks ¶
func EvaluateLinks(ctx context.Context, root string, set IntentSet, revision string) ([]EvaluatedLink, error)
EvaluateLinks evaluates every forward link at revision. It reads only object IDs, ancestry and blob content; Git author, committer and signature fields are never read (AFU-V1-008).
type Evidence ¶
type Evidence struct {
Profile string `json:"profile"`
Authority string `json:"authority"`
Binding Binding `json:"binding"`
RunID string `json:"runId"`
Mode string `json:"mode"`
Parser string `json:"parser"`
ProviderDigest string `json:"providerDigest"`
NodeVersion string `json:"nodeVersion"`
PlaywrightVersion string `json:"playwrightVersion"`
Browser string `json:"browser"`
Tests []Test `json:"tests"`
InventoryComplete bool `json:"inventoryComplete"`
Controls []Control `json:"controls"`
Runs []Run `json:"runs"`
Gaps []string `json:"gaps"`
Cleanup bool `json:"cleanup"`
CleanupScope string `json:"cleanupScope"`
BrowserClosed bool `json:"browserClosed"`
ServerExited bool `json:"serverExited"`
}
type FlowAdapter ¶
type FlowAdapter struct {
Derivation string `json:"derivation"`
Evidence doccorpus.Anchor `json:"evidence"`
RequiredPages []string `json:"required_pages"`
NegativeControls []string `json:"negative_controls"`
OrderedEvents []doccorpus.BehaviorEvent `json:"ordered_events"`
MissingReview *doccorpus.Anchor `json:"missing_e2e_review,omitempty"`
}
FlowAdapter carries the DCP-V1-027 flow-record fields the intent model does not otherwise own.
type FlowIntent ¶
type FlowIntent struct {
Schema string `json:"schema"`
FlowID string `json:"flow_id"`
Revision int `json:"revision"`
Proposed bool `json:"proposed,omitempty"`
Kind string `json:"kind"`
Actor string `json:"actor"`
Preconditions []string `json:"preconditions"`
Steps []FlowStep `json:"steps"`
Outcomes []FlowOutcome `json:"outcomes"`
Variations []FlowVariation `json:"variations"`
Links []FlowLink `json:"links"`
Adapter *FlowAdapter `json:"adapter,omitempty"`
}
FlowIntent is one closed application-flow-intent/1 document (AFU-V1-001).
type FlowLink ¶
type FlowLink struct {
From string `json:"from"`
Basis string `json:"basis"`
Target LinkTarget `json:"target"`
ReviewedAt string `json:"reviewed_at,omitempty"`
}
FlowLink is one stored forward link; `reviewed` is never stored, only evaluated (AFU-V1-008).
type FlowNavigation ¶
type FlowNavigation struct {
}
FlowNavigation is an intent's optional navigation block: the flows that must run first, such as sign-in, and per-step locators taken from the intent or test source (AFU-V1-025, AFU-V1-026).
type FlowOutcome ¶
type FlowVariation ¶
type Gap ¶
type Gap struct {
Code string `json:"code"`
Member string `json:"member,omitempty"`
TestKey string `json:"test_key,omitempty"`
Project string `json:"project,omitempty"`
Detail string `json:"detail"`
}
Gap is one closed-code gap. Member names the flow, variation, outcome or link source it is about.
type GapFlow ¶
type GapFlow struct {
FlowID string `json:"flow_id"`
Status string `json:"status"`
Gaps []Gap `json:"gaps"`
}
GapFlow is one flow; any gap makes it incomplete.
type GapsReport ¶
type GapsReport struct {
Schema string `json:"schema"`
Revision string `json:"revision"`
Flows []GapFlow `json:"flows"`
}
GapsReport is `flows gaps`.
type ImpactFlow ¶
type ImpactFlow struct {
FlowID string `json:"flow_id"`
Variations []string `json:"variations"`
TestKeys []string `json:"test_keys"`
Hits []ImpactHit `json:"hits"`
}
ImpactFlow is one reached flow with the variations and test keys its hit links reach.
type ImpactGraph ¶
type ImpactGraph struct {
Digest string `json:"digest"`
Scope string `json:"scope"`
Unknown []string `json:"unknown"`
}
ImpactGraph identifies the impact graph walked; an UNKNOWN scope means a hit list may be short.
type ImpactHit ¶
type ImpactHit struct {
From string `json:"from"`
Basis string `json:"basis"`
ReviewState string `json:"review_state"`
Target LinkTarget `json:"target"`
Via []string `json:"via"`
}
ImpactHit is one link whose target a changed path reaches. Via is the path: the changed path, then each impact-graph unit from the changed one to the one owning the target, then the target path; a target path that itself changed has Via of that path alone.
type ImpactReport ¶
type ImpactReport struct {
Schema string `json:"schema"`
Base string `json:"base"`
Revision string `json:"revision"`
ChangedPaths []string `json:"changed_paths"`
Graph ImpactGraph `json:"graph"`
Flows []ImpactFlow `json:"flows"`
}
ImpactReport names what the base..HEAD changed paths reach through links and the impact graph.
type Ingested ¶
type Ingested struct {
Records []TestRunEvidence
Incomplete string
}
Ingested is one ingest result. When a bound is exceeded Incomplete names it and Records is empty, so a bounded ingest is never a truncated success (AFU-V1-037).
func IngestRunEvidence ¶
IngestRunEvidence turns one test report into INGESTED test-run-evidence/0 records, one per test, keeping every attempt in order (AFU-V1-011..014, AFU-V1-037, AFU-V1-038).
type Input ¶
type Input struct {
Manifest Manifest `json:"manifest"`
Binding Binding `json:"binding"`
Sources []Source `json:"sources"`
Root string `json:"root"`
Observe bool `json:"observe"`
RunID string `json:"runId"`
}
Input is passed over stdin to the optional parser/observer; sources never execute in scan mode.
type IntentSet ¶
type IntentSet struct {
Dir string
Flows []FlowIntent
Retired Retired
// Revision is the commit the set was read from by LoadIntentsAt; it is empty for a working-tree read.
Revision string
}
IntentSet is the validated intent directory, flows sorted by ID.
func LoadIntents ¶
LoadIntents reads and validates every intent in dir (AFU-V1-001, AFU-V1-002).
func LoadIntentsAt ¶
LoadIntentsAt reads and validates the intents committed in dir at revision, never the working tree, so a dirty or untracked intent file cannot reach an export that names the revision (AFU-V1-001, AFU-V1-003). Every entry keeps the working-tree bounds: count before any read, size, Decode and the secret screen.
func (IntentSet) IntentPath ¶
IntentPath is the repository-relative path of a flow's intent file.
type Inventory ¶
type Inventory struct {
Schema string `json:"schema"`
Flows []InventoryFlow `json:"flows"`
Variations []doccorpus.BehaviorAdapterVariation `json:"variations"`
}
Inventory is the compiled flow and variation document the adapter request maps (AFU-V1-003).
type InventoryFlow ¶
type InventoryFlow struct {
ID string `json:"id"`
Derivation string `json:"derivation"`
Evidence doccorpus.Anchor `json:"evidence"`
RequiredPages []string `json:"required_pages"`
NegativeControls []string `json:"negative_controls"`
OrderedEvents []doccorpus.BehaviorEvent `json:"ordered_events"`
MissingReview *doccorpus.Anchor `json:"missing_e2e_review,omitempty"`
}
InventoryFlow is one DCP-V1-027 flow record compiled from an intent.
type InventoryTest ¶
type InventoryTest struct {
TestKey string `json:"test_key"`
Project string `json:"project"`
Path string `json:"path"`
}
InventoryTest is one E2E test the provider declares, by test key, runner project and file.
type LinkTarget ¶
type LinkTarget struct {
Type string `json:"type"`
Path string `json:"path,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
TestKey string `json:"test_key,omitempty"`
Assertion string `json:"assertion,omitempty"`
Digest string `json:"digest,omitempty"`
}
LinkTarget is a link's target identity (AFU-V1-007).
type LookupReport ¶
type LookupReport struct {
Schema string `json:"schema"`
Revision string `json:"revision"`
Path string `json:"path,omitempty"`
TestKey string `json:"test_key,omitempty"`
Flows []ReverseHit `json:"flows"`
}
LookupReport is a reverse lookup derived at query time from the forward links (AFU-V1-010).
type Manifest ¶
type Manifest struct {
Profile string `json:"profile"`
Application string `json:"application"`
Origin string `json:"origin"`
Sources []string `json:"sources"`
Tests []string `json:"tests"`
BackendSource string `json:"backendSource"`
Fixture string `json:"fixture"`
IdentityPath string `json:"identityPath"`
ResetPath string `json:"resetPath"`
Server []string `json:"server"`
Scenarios []Scenario `json:"scenarios"`
}
type MapFlow ¶
type MapFlow struct {
FlowID string `json:"flow_id"`
Proposed bool `json:"proposed"`
Status string `json:"status"`
Steps []MapMember `json:"steps"`
Outcomes []MapMember `json:"outcomes"`
Variations []MapVariation `json:"variations"`
}
MapFlow is one flow; Status is complete only when `flows gaps` reports no gap for it.
type MapMember ¶
type MapMember struct {
ID string `json:"id"`
Links []EvaluatedLink `json:"links"`
}
MapMember is one step or outcome and the links whose from names it.
type MapReport ¶
type MapReport struct {
Schema string `json:"schema"`
Revision string `json:"revision"`
Review ReviewSummary `json:"review"`
Flows []MapFlow `json:"flows"`
}
MapReport is `flows map`: every flow member with its evaluated links and variation evidence.
type MapVariation ¶
type MapVariation struct {
ID string `json:"id"`
Steps []string `json:"steps"`
Outcomes []string `json:"outcomes"`
Projects []string `json:"projects"`
Links []EvaluatedLink `json:"links"`
Evidence []TestEvidence `json:"evidence"`
Verified bool `json:"verified"`
}
MapVariation is verified only when it has a non-inferred test and every required evidence pair is.
type NavFlow ¶
type NavFlow struct {
}
NavFlow is one flow's transitions, one per intent step in intent order.
type NavLocator ¶
type NavLocator struct {
}
NavLocator is an accessible role and name, a test ID, or an API method and path template.
type NavState ¶
type NavState struct {
}
NavState is a route template or an API operation with its stable ID.
type NavStep ¶
type NavStep struct {
}
NavStep places one intent step: its route template (ui), locator, readiness condition, input fixture ID, expected outcomes, declared effect class and recovery step.
type NavigationMap ¶
type NavigationMap struct {
}
NavigationMap is `flows navigate` without --goal.
type NavigationPacket ¶
type NavigationPacket struct {
}
NavigationPacket is `flows navigate --goal`: the precondition flows then the goal, in run order.
type NegativeControl ¶
type NegativeControl struct {
TestKey string `json:"test_key"`
Expected string `json:"expected"`
Observed string `json:"observed"`
}
NegativeControl is a control test with the outcome it must show and the classification it showed.
type Origins ¶
Origins lists the origins an observer may perform irreversible or external transitions against.
type PacketFlow ¶
PacketFlow is one flow of the packet with its completeness status.
type ProofLink ¶
type ProofLink struct {
Flow string `json:"flow"`
From string `json:"from"`
Target LinkTarget `json:"target"`
ReviewedAt string `json:"reviewed_at"`
}
type Report ¶
type Report struct {
Profile string `json:"profile"`
Authority string `json:"authority"`
Application string `json:"application"`
Binding Binding `json:"binding"`
Freshness string `json:"freshness"`
RunID string `json:"runId"`
ProviderDigest string `json:"providerDigest"`
Flows []Flow `json:"flows"`
Candidates []Candidate `json:"candidates"`
Discovered []Control `json:"discovered"`
Frontier []string `json:"frontier"`
Complete bool `json:"complete"`
}
type Retired ¶
type Retired struct {
Schema string `json:"schema"`
FlowIDs []string `json:"flow_ids"`
VariationIDs []string `json:"variation_ids"`
}
Retired reserves deleted flow and variation IDs (AFU-V1-002).
type ReverseHit ¶
type ReverseHit struct {
Flow string `json:"flow"`
From string `json:"from"`
Basis string `json:"basis"`
ReviewState string `json:"review_state"`
}
ReverseHit is one flow reached from a source path or test key.
func FlowsForPath ¶
func FlowsForPath(links []EvaluatedLink, file string) []ReverseHit
FlowsForPath derives source path to flows at query time from forward links; nothing is stored (AFU-V1-010).
func FlowsForTestKey ¶
func FlowsForTestKey(links []EvaluatedLink, key string) []ReverseHit
FlowsForTestKey derives test key to flows at query time from forward links (AFU-V1-010).
type ReviewSummary ¶
type ReviewSummary struct {
Revision string `json:"revision"`
Reviewed int `json:"reviewed"`
ReviewedDenominator int `json:"reviewed_denominator"`
Stale int `json:"stale"`
Inferred int `json:"inferred"`
ReviewAttestation string `json:"review_attestation"`
Limitation string `json:"limitation"`
}
ReviewSummary counts reviewed links over declared links only; inferred links stay separate (AFU-V1-009).
func Summarize ¶
func Summarize(revision string, links []EvaluatedLink) ReviewSummary
Summarize counts reviewed links; the denominator is declared links only (AFU-V1-008, AFU-V1-009).
type Run ¶
type Run struct {
Scenario string `json:"scenario"`
Outcome string `json:"outcome"`
Checks []CheckResult `json:"checks"`
States []string `json:"states"`
IdentityMatched bool `json:"identityMatched"`
}
type RunAggregate ¶
type RunAggregateReport ¶
type RunAggregateReport struct {
ID string `json:"id"`
Scope string `json:"scope"`
TestKey string `json:"test_key"`
Project string `json:"project"`
Runner RunRunner `json:"runner"`
Source RunSource `json:"source"`
Threshold doccorpus.StabilityThreshold `json:"threshold"`
Counts doccorpus.StabilityCounts `json:"counts"`
Verdict string `json:"verdict"`
Contributions []RunContributionReport `json:"contributions"`
}
type RunAttachment ¶
RunAttachment is the path the runner recorded, never the attachment's content.
type RunAttempt ¶
type RunAttempt struct {
Ordinal int `json:"ordinal"`
Outcome string `json:"outcome"`
DurationMS int64 `json:"duration_ms"`
AssertionAnchors []RunAnchor `json:"assertion_anchors"`
Failure string `json:"failure,omitempty"`
Attachments []RunAttachment `json:"attachments"`
}
RunAttempt is one attempt, in run order, with its ordinal starting at 1 (AFU-V1-011, AFU-V1-012).
type RunContribution ¶
type RunContributionReport ¶
type RunContributionReport struct {
RunContribution
Classification string `json:"classification"`
Cleanup string `json:"cleanup"`
Attempts []RunAttempt `json:"attempts"`
}
type RunControl ¶
RunControl declares that TestKey is a negative control of Subject and must show Expected.
type RunDigestRef ¶
type RunHeader ¶
type RunHeader struct {
RunID string
RunnerVersion string
Source RunSource
BuildArtifactDigest string
Environment RunDigestRef
Fixture RunDigestRef
Cleanup string
Controls []RunControl
}
RunHeader is the run context a test report does not carry, declared by the caller.
type RunPolicy ¶
type RunPolicy struct {
ID string `json:"id"`
Thresholds []doccorpus.StabilityThreshold `json:"thresholds"`
}
type RunRegistry ¶
type RunRegistry struct {
Schema string `json:"schema"`
Policy RunPolicy `json:"policy"`
Aggregates []RunAggregate `json:"aggregates"`
}
RunRegistry is the repository-owned source of what a run-evidence record does not carry: planned ordinals, run kind, the infrastructure class and the stability policy (AFU-V1-041, decision 0417).
type RunStabilityReport ¶
type RunStabilityReport struct {
Schema string `json:"schema"`
Revision string `json:"revision"`
Registry string `json:"registry"`
RegistrySHA256 string `json:"registry_sha256"`
PolicyID string `json:"policy_id"`
Aggregates []RunAggregateReport `json:"aggregates"`
Limitations []string `json:"limitations"`
}
RunStabilityReport is `flows stability` (AFU-V1-042).
type SelectionProvider ¶
type SelectionProvider struct {
Schema string `json:"schema"`
Flows string `json:"flows"`
RunnerConfig string `json:"runner_config"`
Discovery string `json:"discovery,omitempty"`
GlobalPaths []string `json:"global_paths"`
Inventory []InventoryTest `json:"inventory"`
FlowTiers map[string][]string `json:"flow_tiers,omitempty"`
Coverage string `json:"coverage,omitempty"`
}
SelectionProvider is one closed application-flow-selection-provider/1 document.
type TestEvidence ¶
type TestEvidence struct {
TestKey string `json:"test_key"`
Project string `json:"project,omitempty"`
State string `json:"state"`
Authority string `json:"authority"`
}
TestEvidence is the evidence state of one required test key and project pair.
type TestRunEvidence ¶
type TestRunEvidence struct {
Schema string `json:"schema"`
Authority string `json:"authority"`
RunID string `json:"run_id"`
Runner RunRunner `json:"runner"`
Source RunSource `json:"source"`
BuildArtifactDigest string `json:"build_artifact_digest"`
Environment RunDigestRef `json:"environment"`
Fixture RunDigestRef `json:"fixture"`
TestKey string `json:"test_key"`
Project string `json:"project,omitempty"`
Attempts []RunAttempt `json:"attempts"`
Cleanup string `json:"cleanup"`
NegativeControls []NegativeControl `json:"negative_controls"`
}
TestRunEvidence is one closed test-run-evidence/0 record: one test key in one run (AFU-V1-011).
func DecodeRunEvidence ¶
func DecodeRunEvidence(raw []byte) (TestRunEvidence, error)
DecodeRunEvidence reads one record strictly and accepts only its canonical encoding.
func ReadRunEvidence ¶
func ReadRunEvidence(filenames []string) ([]TestRunEvidence, error)
ReadRunEvidence reads --evidence files of canonical test-run-evidence/0 records, one per line, each with the flow-input discipline: regular file before open, byte bound, strict decode and the secret screen. The record bound applies to all files together (AFU-V1-036, AFU-V1-037).
type TrafficRecord ¶
type TrafficRecord struct {
Schema string `json:"schema"`
FlowID string `json:"flow_id"`
StepID string `json:"step_id"`
Method string `json:"method"`
FormSubmit bool `json:"form_submit"`
}
TrafficRecord is one observed request of a step, one application-flow-traffic/0 JSONL line.
func ReadTraffic ¶
func ReadTraffic(filenames []string) ([]TrafficRecord, error)
ReadTraffic reads --traffic files of application-flow-traffic/0 records with the flow-input discipline; all files together share the run-evidence record bound.
type Transition ¶
type Transition struct {
FlowID string `json:"flow_id"`
StepID string `json:"step_id"`
Action string `json:"action"`
State string `json:"state,omitempty"`
Locator *NavLocator `json:"locator,omitempty"`
Preconditions []string `json:"preconditions"`
Ready *NavLocator `json:"ready,omitempty"`
InputFixture string `json:"input_fixture,omitempty"`
Expect []FlowOutcome `json:"expect"`
EffectClass string `json:"effect_class"`
EffectBasis string `json:"effect_basis"`
Recovery string `json:"recovery,omitempty"`
Verification string `json:"verification"`
Grant string `json:"grant,omitempty"`
GrantNeeded string `json:"grant_needed,omitempty"`
}
Transition is one step. A step without a navigation entry has no state or locator and is write-irreversible; grant fields appear only in a packet.