Documentation
¶
Overview ¶
Package doccorpus compiles the proposed DCP-V1 documentation evidence profile. Identity validation does not establish semantic truth or accepted intent.
Index ¶
- Constants
- func CEMProjection(ctx context.Context, root string, a *Artifact, data []byte, claimID string) (map[string]any, error)
- func CapabilityFor(operation string) string
- func Digest(data []byte) string
- func Encode(value any) ([]byte, error)
- func Freshness(ctx context.Context, root string, a *Artifact) (string, []string, error)
- func Impact(a *Artifact, paths []string, freshness string) map[string]any
- func ReadFile(root, path string) ([]byte, error)
- type Anchor
- type Artifact
- type BehaviorAdapterArtifact
- type BehaviorAdapterClaimRecord
- type BehaviorAdapterCoverage
- type BehaviorAdapterDelta
- type BehaviorAdapterDiagnostic
- type BehaviorAdapterInput
- type BehaviorAdapterMapping
- type BehaviorAdapterOutcome
- type BehaviorAdapterRequest
- type BehaviorAdapterResult
- type BehaviorAdapterTestClaim
- type BehaviorAdapterVariation
- type BehaviorAssertion
- type BehaviorDiscovery
- type BehaviorEvent
- type BehaviorExecution
- type BehaviorFlow
- type BehaviorLegacyCase
- type BehaviorLegacyCriterion
- type BehaviorLegacyMapping
- type BehaviorLegacyRun
- type BehaviorMigration
- type BehaviorRegistry
- type BehaviorReport
- type BehaviorRevisions
- type BehaviorRun
- type BehaviorRuntime
- type BehaviorSource
- type BehaviorTest
- type Builder
- type Capability
- type CapabilityDeclaration
- type Claim
- type Error
- type Evidence
- type Gap
- type Input
- type Journey
- type JourneyRun
- type Maintenance
- type Manifest
- type Observation
- type ObservationLink
- type Profile
- type Provider
- type ProviderRecord
- type Receipt
- type Relation
- type Rendered
- type Repository
- type Request
- type Scope
- type StabilityAggregate
- type StabilityAttempt
- type StabilityContribution
- type StabilityCounts
- type StabilityIdentity
- type StabilityPolicy
- type StabilityReceiptInput
- type StabilityRegistry
- type StabilityReport
- type StabilityThreshold
- type StabilityTopology
- type StabilityTopologyBinding
- type StabilityTopologyDocument
- type Step
- type StepObservation
- type Subject
Constants ¶
const ( BehaviorAdapterRequestSchema = "corvint-behavior-adapter-request/1" BehaviorAdapterResultSchema = "corvint-behavior-adapter-result/1" )
const ( StabilitySchema = "corvint-playwright-stability/1" BehaviorStabilityProviderSchema = "corvint-corpus-behavior-stability-provider/1" StabilityTopologySchema = "corvint-playwright-stability-topology/1" )
const ( Schema = "corvint-evidence-corpus/1" ManifestSchema = "corvint-corpus-input/1" ProviderSchema = "corvint-corpus-provider/1" ReceiptSchema = "corvint-corpus-receipt/1" MaxBytes = 4 << 20 MaxRecords = 4096 MaxResults = 256 )
const BehaviorProviderSchema = "corvint-corpus-behavior-provider/1"
BehaviorProviderSchema is experimental: declarations never authorize narrowing.
Variables ¶
This section is empty.
Functions ¶
func CEMProjection ¶
func CEMProjection(ctx context.Context, root string, a *Artifact, data []byte, claimID string) (map[string]any, error)
CEMProjection preserves the immutable original span and carries corpus provenance beside the frozen wire. It never cites generated prose as intent.
func CapabilityFor ¶
Types ¶
type Anchor ¶
type Anchor struct {
Repository string `json:"repository"`
Revision string `json:"revision"`
Path string `json:"path"`
Blob string `json:"blob"`
SHA256 string `json:"sha256"`
Start int `json:"start_line"`
End int `json:"end_line"`
SpanSHA256 string `json:"span_sha256"`
Symbol string `json:"symbol"`
Region string `json:"region"`
Authority string `json:"authority"`
Kind string `json:"evidence_kind"`
Reason string `json:"reason"`
}
type Artifact ¶
type Artifact struct {
BehaviorContracts []BehaviorReport `json:"behavior_contracts,omitempty"`
StabilityEvidence []StabilityReport `json:"stability_evidence,omitempty"`
Schema string `json:"schema"`
Builder Builder `json:"builder"`
Manifest Manifest `json:"manifest"`
ManifestSHA256 string `json:"manifest_sha256"`
ProfileSHA256 string `json:"profile_sha256"`
Tree string `json:"tree"`
Subjects []Subject `json:"subjects"`
Claims []Claim `json:"claims"`
Relations []Relation `json:"relations"`
Journeys []Journey `json:"journeys"`
Observations []Observation `json:"observations"`
Capabilities []Capability `json:"capabilities"`
Gaps []Gap `json:"gaps"`
SHA256 string `json:"sha256"`
}
func ParseArtifact ¶
func (*Artifact) HasCapability ¶
type BehaviorAdapterArtifact ¶
type BehaviorAdapterClaimRecord ¶
type BehaviorAdapterClaimRecord struct {
TestID string `json:"test_id"`
Claim BehaviorAdapterTestClaim `json:"claim"`
}
type BehaviorAdapterCoverage ¶
type BehaviorAdapterDelta ¶
type BehaviorAdapterInput ¶
type BehaviorAdapterMapping ¶
type BehaviorAdapterOutcome ¶
type BehaviorAdapterRequest ¶
type BehaviorAdapterRequest struct {
Schema string `json:"schema"`
ProviderID string `json:"provider_id"`
ProviderVersion string `json:"provider_version"`
ContractID string `json:"contract_id"`
Source Repository `json:"source"`
Revisions BehaviorRevisions `json:"revisions"`
SourceRevision string `json:"source_revision"`
DocumentationRevision string `json:"documentation_revision"`
MigrationInput string `json:"migration_input"`
DiscoveryInput string `json:"discovery_input"`
Inputs []BehaviorAdapterInput `json:"inputs"`
Mappings []BehaviorAdapterMapping `json:"mappings"`
Observations []ObservationLink `json:"observations"`
}
type BehaviorAdapterResult ¶
type BehaviorAdapterResult struct {
Schema string `json:"schema"`
Provider ProviderRecord `json:"provider"`
Variations []BehaviorAdapterVariation `json:"variations"`
Claims []BehaviorAdapterClaimRecord `json:"claims"`
Artifacts []BehaviorAdapterArtifact `json:"artifacts"`
Coverage []BehaviorAdapterCoverage `json:"coverage"`
Frontier []BehaviorAdapterDiagnostic `json:"frontier"`
Delta BehaviorAdapterDelta `json:"delta"`
Fallback string `json:"fallback"`
Limitations []string `json:"limitations"`
}
func BuildBehaviorAdapter ¶
func BuildBehaviorAdapter(requestRaw, previousRaw []byte) (BehaviorAdapterResult, error)
type BehaviorAdapterVariation ¶
type BehaviorAdapterVariation struct {
ID string `json:"variation_id"`
Flow string `json:"flow"`
Preconditions []string `json:"preconditions"`
Actions []string `json:"actions"`
ObservableFacts []string `json:"observable_facts"`
ExpectedOutcomes []BehaviorAdapterOutcome `json:"expected_outcomes"`
Projects []string `json:"projects"`
Tests []string `json:"tests"`
}
type BehaviorAssertion ¶
type BehaviorDiscovery ¶
type BehaviorDiscovery struct {
Schema string `json:"schema"`
Mode string `json:"mode"`
Revisions BehaviorRevisions `json:"revisions"`
Config Anchor `json:"config"`
Executions []BehaviorExecution `json:"executions"`
}
type BehaviorEvent ¶
type BehaviorEvent struct {
Context string `json:"browser_context"`
Page string `json:"page"`
Frame string `json:"frame"`
ParentPage string `json:"parent_page"`
Behavior string `json:"behavior"`
Criterion string `json:"criterion"`
Matcher string `json:"matcher"`
Locator string `json:"locator"`
Value string `json:"value"`
Sequence int `json:"sequence"`
Kind string `json:"kind"`
ID string `json:"id"`
Passed bool `json:"passed"`
}
type BehaviorExecution ¶
type BehaviorFlow ¶
type BehaviorFlow struct {
Derivation string `json:"derivation"`
ID string `json:"id"`
Evidence Anchor `json:"evidence"`
Criteria []string `json:"criteria"`
Tests []string `json:"tests"`
RequiredPages []string `json:"required_pages"`
NegativeControls []string `json:"negative_controls"`
OrderedEvents []BehaviorEvent `json:"ordered_events"`
MissingReview *Anchor `json:"missing_e2e_review,omitempty"`
}
type BehaviorLegacyCase ¶
type BehaviorLegacyCase struct {
ID string `json:"id"`
Suite string `json:"suite"`
Case string `json:"case"`
Evidence Anchor `json:"evidence"`
State string `json:"state"`
Fixtures []string `json:"fixtures"`
Roles []string `json:"roles"`
Criteria []BehaviorLegacyCriterion `json:"criteria"`
Runtime *BehaviorRuntime `json:"runtime,omitempty"`
RuntimeTestID string `json:"runtime_test_id,omitempty"`
RuntimeProject string `json:"runtime_project,omitempty"`
}
Legacy criteria describe observables, not test-name similarity or inferred intent.
type BehaviorLegacyCriterion ¶
type BehaviorLegacyMapping ¶
type BehaviorLegacyRun ¶
type BehaviorLegacyRun struct {
Schema string `json:"schema"`
ContractSHA256 string `json:"contract_sha256"`
Revisions BehaviorRevisions `json:"revisions"`
CaseID string `json:"case_id"`
SourceSHA256 string `json:"source_sha256"`
RunSHA256 string `json:"run_sha256"`
TestID string `json:"test_id"`
Project string `json:"project"`
Retry int `json:"retry"`
Cleanup string `json:"cleanup"`
Fixtures []string `json:"fixtures"`
Roles []string `json:"roles"`
Criteria []BehaviorLegacyCriterion `json:"criteria"`
}
type BehaviorMigration ¶
type BehaviorMigration struct {
Revisions BehaviorRevisions `json:"revisions"`
Schema int `json:"schema"`
ContractID string `json:"contract_id"`
SourceRevision string `json:"source_revision"`
DocumentationRevision string `json:"documentation_revision"`
}
type BehaviorRegistry ¶
type BehaviorRegistry struct {
Revisions BehaviorRevisions `json:"revisions"`
Discovery Anchor `json:"discovery"`
Schema int `json:"schema"`
ContractID string `json:"contract_id"`
ContractSHA256 string `json:"contract_sha256"`
SourceRevision string `json:"source_revision"`
DocumentationRevision string `json:"documentation_revision"`
Manifest Anchor `json:"migration_manifest"`
Flows []BehaviorFlow `json:"flows"`
Behaviors []BehaviorSource `json:"source_behaviors"`
Tests []BehaviorTest `json:"tests"`
Legacy []BehaviorLegacyCase `json:"legacy,omitempty"`
Stability *StabilityRegistry `json:"stability,omitempty"`
}
type BehaviorReport ¶
type BehaviorReport struct {
Discovery BehaviorDiscovery `json:"discovery"`
Provider string `json:"provider"`
Registry BehaviorRegistry `json:"registry"`
VerifiedTests []string `json:"verified_tests"`
LinkedFlows []string `json:"linked_flows"`
LinkedBehaviors []string `json:"linked_behaviors"`
VerifiedFlows []string `json:"verified_flows"`
Fallback string `json:"fallback"`
Limitations []string `json:"limitations"`
LegacyRuntimeParity []string `json:"legacy_runtime_parity"`
}
type BehaviorRevisions ¶
type BehaviorRevisions struct {
App Repository `json:"app"`
E2E Repository `json:"golf_e2e"`
Docs Repository `json:"docs_corpus"`
}
type BehaviorRun ¶
type BehaviorRun struct {
Fixtures []string `json:"fixtures,omitempty"`
Roles []string `json:"roles,omitempty"`
Revisions BehaviorRevisions `json:"revisions"`
Schema string `json:"schema"`
ContractID string `json:"contract_id"`
ContractSHA256 string `json:"contract_sha256"`
SourceRevision string `json:"source_revision"`
DocumentationRevision string `json:"documentation_revision"`
RunSHA256 string `json:"run_sha256"`
TestID string `json:"test_id"`
Project string `json:"project"`
Retry int `json:"retry"`
Cleanup string `json:"cleanup"`
Events []BehaviorEvent `json:"events"`
}
BehaviorRun is a separate, digest-pinned ordered witness, not a passing-test claim.
type BehaviorRuntime ¶
type BehaviorSource ¶
type BehaviorTest ¶
type BehaviorTest struct {
ID string `json:"id"`
Project string `json:"project"`
Title string `json:"title"`
Evidence Anchor `json:"evidence"`
Flows []string `json:"flows"`
Criteria []string `json:"criteria"`
Assertions []BehaviorAssertion `json:"assertions"`
Runtime *BehaviorRuntime `json:"runtime,omitempty"`
Legacy []BehaviorLegacyMapping `json:"legacy_criteria,omitempty"`
Fixtures []string `json:"fixtures,omitempty"`
Roles []string `json:"roles,omitempty"`
}
type Capability ¶
type Capability struct {
Name string `json:"name"`
State string `json:"state"`
Reason string `json:"reason"`
Records []string `json:"records"`
Providers []string `json:"providers"`
Tools []string `json:"tools"`
Count int `json:"count"`
Denominator int `json:"denominator"`
Rule string `json:"rule"`
}
type CapabilityDeclaration ¶
type Evidence ¶
type Evidence struct {
ReportedTrust string `json:"reported_trust"`
Derivation string `json:"derivation"`
Trust string `json:"trust"`
State string `json:"state"`
Freshness string `json:"freshness"`
Anchors []Anchor `json:"anchors"`
Unknown string `json:"unknown"`
Limitations []string `json:"limitations"`
}
type JourneyRun ¶
type JourneyRun struct {
Schema string `json:"schema"`
RunSHA256 string `json:"run_sha256"`
SourceRevision string `json:"source_revision"`
Package string `json:"package"`
Test string `json:"test"`
Cleanup string `json:"cleanup"`
Steps []StepObservation `json:"steps"`
}
JourneyRun is independently retained step observation data. A native passing test alone cannot populate these ordered expected/observed records.
type Maintenance ¶
type Maintenance struct {
Schema string `json:"schema"`
ArtifactSHA256 string `json:"artifact_sha256"`
Page string `json:"page"`
Before string `json:"before_sha256"`
After string `json:"after_sha256"`
Recovery string `json:"recovery_path"`
Applied bool `json:"applied"`
Proposed string `json:"proposed"`
}
type Manifest ¶
type Manifest struct {
BehaviorRevisions *BehaviorRevisions `json:"behavior_revisions,omitempty"`
Schema string `json:"schema"`
Repository Repository `json:"repository"`
BuiltAt string `json:"built_at"`
Profile Profile `json:"profile"`
Scopes []Scope `json:"scopes"`
Inputs []Input `json:"inputs"`
Providers []Provider `json:"providers"`
MergeRule string `json:"merge_rule"`
}
func ParseManifest ¶
type Observation ¶
type Observation struct {
Trust string `json:"trust"`
Limitations []string `json:"limitations"`
Link ObservationLink `json:"link"`
InputSHA256 string `json:"input_sha256"`
Document testvaliditydoc.Document `json:"document"`
}
type ObservationLink ¶
type ObservationLink struct {
TestID string `json:"test_id,omitempty"`
Project string `json:"project,omitempty"`
StepInput string `json:"step_input"`
StepRevision string `json:"step_revision"`
SourcePaths map[string]string `json:"source_paths"`
ID string `json:"id"`
Subject string `json:"subject"`
Input string `json:"input"`
InputRevision string `json:"input_revision"`
SourceRevision string `json:"source_revision"`
RunID string `json:"run_id"`
Package string `json:"package"`
Test string `json:"test"`
StepEvidence []Anchor `json:"step_evidence"`
}
ObservationLink refers to a retained native receipt by immutable input path. Its package/name join is exact, and StepEvidence proves only the provider's recorded expected observation, not an independently assessed assertion.
type ProviderRecord ¶
type ProviderRecord struct {
BehaviorContracts *BehaviorRegistry `json:"behavior_contracts,omitempty"`
Schema string `json:"schema"`
ID string `json:"id"`
Version string `json:"version"`
Source Repository `json:"source"`
Subjects []Subject `json:"subjects"`
Claims []Claim `json:"claims"`
Relations []Relation `json:"relations"`
Journeys []Journey `json:"journeys"`
Observations []ObservationLink `json:"observations"`
Capabilities []CapabilityDeclaration `json:"capabilities"`
}
type Receipt ¶
type Receipt struct {
Schema string `json:"schema"`
Operation string `json:"operation"`
ArtifactSHA256 string `json:"artifact_sha256"`
Repository Repository `json:"repository"`
Tree string `json:"tree"`
Trust string `json:"trust"`
Freshness string `json:"freshness"`
State string `json:"state"`
Miss string `json:"miss"`
Results []any `json:"results"`
Citations []Anchor `json:"citations"`
Capabilities []Capability `json:"capabilities"`
Limitations []string `json:"limitations"`
Omitted int `json:"omitted"`
}
type Rendered ¶
type Repository ¶
type StabilityAggregate ¶
type StabilityAggregate struct {
ID string `json:"id"`
Scope string `json:"scope"`
PolicyID string `json:"policy_id"`
Planned int `json:"planned"`
TestID string `json:"test_id"`
Project string `json:"project"`
ContractID string `json:"contract_id"`
ContractSHA256 string `json:"contract_sha256"`
Contributions []StabilityContribution `json:"contributions"`
}
type StabilityAttempt ¶
type StabilityAttempt struct {
Retry int `json:"retry"`
State string `json:"state"`
FailureClass string `json:"failure_class"`
Artifacts []jstestprovider.FailureArtifact `json:"artifacts"`
Cleanup string `json:"cleanup"`
}
type StabilityContribution ¶
type StabilityContribution struct {
RunKind string `json:"run_kind"`
Repetition int `json:"repetition"`
ManualRunID string `json:"manual_run_id,omitempty"`
Receipt StabilityReceiptInput `json:"receipt"`
SourcePaths map[string]string `json:"source_paths"`
Identity StabilityIdentity `json:"identity"`
Topology StabilityTopologyBinding `json:"topology"`
Cleanup string `json:"cleanup"`
Attempts []StabilityAttempt `json:"attempts"`
}
type StabilityCounts ¶
type StabilityCounts struct {
Planned int `json:"planned"`
Started int `json:"started"`
Completed int `json:"completed"`
Passed int `json:"passed"`
Failed int `json:"failed"`
TimedOut int `json:"timed_out"`
Interrupted int `json:"interrupted"`
InfrastructureFailed int `json:"infrastructure_failed"`
Skipped int `json:"skipped"`
Flaky int `json:"flaky"`
RetryConsumed int `json:"retry_consumed"`
CleanupFailed int `json:"cleanup_failed"`
ManualReruns int `json:"manual_reruns"`
}
type StabilityIdentity ¶
type StabilityIdentity struct {
ApplicationRevision string `json:"application_revision"`
TestRevision string `json:"test_revision"`
ConfigSHA256 string `json:"config_sha256"`
ContractSHA256 string `json:"contract_sha256"`
Runner string `json:"runner"`
RunnerVersion string `json:"runner_version"`
Browser string `json:"browser"`
Project string `json:"project"`
WorkerPolicy string `json:"worker_policy"`
RetryPolicy string `json:"retry_policy"`
EnvironmentClass string `json:"environment_class"`
EnvironmentSHA256 string `json:"environment_sha256"`
FixtureSchema string `json:"fixture_schema"`
FixtureSHA256 string `json:"fixture_sha256"`
}
type StabilityPolicy ¶
type StabilityPolicy struct {
ID string `json:"id"`
SHA256 string `json:"sha256"`
Topology StabilityTopologyBinding `json:"topology"`
MatrixDimensions []string `json:"matrix_dimensions"`
Thresholds []StabilityThreshold `json:"thresholds"`
}
type StabilityReceiptInput ¶
type StabilityRegistry ¶
type StabilityRegistry struct {
Schema string `json:"schema"`
Policy StabilityPolicy `json:"policy"`
Aggregates []StabilityAggregate `json:"aggregates"`
}
type StabilityReport ¶
type StabilityReport struct {
ID string `json:"id"`
Provider string `json:"provider"`
Scope string `json:"scope"`
PolicyID string `json:"policy_id"`
PolicySHA256 string `json:"policy_sha256"`
Topology StabilityTopologyBinding `json:"topology"`
MatrixDimensions []string `json:"matrix_dimensions"`
TestID string `json:"test_id"`
Project string `json:"project"`
ContractID string `json:"contract_id"`
ContractSHA256 string `json:"contract_sha256"`
Counts StabilityCounts `json:"counts"`
Verdict string `json:"verdict"`
ContributingReceipts []StabilityContribution `json:"contributing_receipts"`
Limitations []string `json:"limitations"`
}
type StabilityThreshold ¶
type StabilityThreshold struct {
Scope string `json:"scope"`
RequiredRepetitions int `json:"required_repetitions"`
MinimumPassed int `json:"minimum_passed"`
MaximumFailed int `json:"maximum_failed"`
MaximumTimedOut int `json:"maximum_timed_out"`
MaximumInterrupted int `json:"maximum_interrupted"`
MaximumInfrastructureFailed int `json:"maximum_infrastructure_failed"`
MaximumSkipped int `json:"maximum_skipped"`
MaximumFlaky int `json:"maximum_flaky"`
MaximumRetryConsumed int `json:"maximum_retry_consumed"`
}
type StabilityTopology ¶
type StabilityTopology struct {
CINodes int `json:"ci_nodes"`
CIShards int `json:"ci_shards"`
PlaywrightWorkersPerNode int `json:"playwright_workers_per_node"`
DatabaseMode string `json:"database_mode"`
Projects []string `json:"projects"`
SplitAlgorithm string `json:"split_algorithm"`
SplitVersion string `json:"split_version"`
ResourceClass string `json:"resource_class"`
}
type StabilityTopologyBinding ¶
type StabilityTopologyBinding struct {
Evidence Anchor `json:"evidence"`
Value StabilityTopology `json:"value"`
}
type StabilityTopologyDocument ¶
type StabilityTopologyDocument struct {
Schema string `json:"schema"`
Kind string `json:"kind"`
PolicyID string `json:"policy_id"`
ReceiptSHA256 string `json:"receipt_sha256,omitempty"`
Topology StabilityTopology `json:"topology"`
}