Documentation
¶
Overview ¶
Package testvaliditydoc builds the corvint-test-validity/0 document (docs/specs/live-proof-carrying-verification-v0.md LPCV-V0-051): the shared five-axis projection of every test-level result a JavaScript receipt or Go preview-session event carries. Projections are recomputed from observations, never trusted from the input. The corvint test-validity verb and the experimental MCP test-validity profile both call this package.
Index ¶
Constants ¶
const ( // EvidenceDirectory is the one worktree-relative retained-evidence // location discovery reads (LPCV-V0-053, decision 0202). EvidenceDirectory = ".corvint/test-evidence" // MaxEvidenceEntries bounds the retained-evidence directory listing. MaxEvidenceEntries = 256 // MaxDiscoveryAttempts bounds how many newest candidates are read. MaxDiscoveryAttempts = 16 )
const ( // Schema names the emitted document. Schema = "corvint-test-validity/0" // MaxInputBytes bounds one provider document. MaxInputBytes = 4 << 20 )
Variables ¶
var ErrInputTooLarge = errors.New("receipt exceeds 4 MiB")
ErrInputTooLarge identifies a receipt that exceeds the input byte bound.
Functions ¶
Types ¶
type Discovery ¶
type Discovery struct {
Location string `json:"location"`
Evidence string `json:"evidence,omitempty"`
Freshness *testvalidity.Axis `json:"freshness,omitempty"`
Skipped int `json:"skipped"`
}
Discovery records which retained document was selected and whether its bound identity still matches the worktree. It is emitted only by discovery.
type DiscoveryError ¶
type DiscoveryError struct{ Code, Message string }
DiscoveryError is a coded discovery refusal shared by the CLI and MCP tool.
func (*DiscoveryError) Error ¶
func (failure *DiscoveryError) Error() string
type Document ¶
type Document struct {
Playwright *jstestprovider.Receipt `json:"playwright,omitempty"`
Schema string `json:"schema"`
Source string `json:"source"`
Kind string `json:"kind"`
Tests []Test `json:"tests"`
Run testvalidity.Projection `json:"run"`
TestsOmitted int `json:"testsOmitted,omitempty"`
Tier string `json:"tier,omitempty"`
Promotable *bool `json:"promotable,omitempty"`
Discovery *Discovery `json:"discovery,omitempty"`
}
Document is the corvint-test-validity/0 document. Tier and Promotable are present only for preview inputs, keeping JavaScript output byte-identical.
func Discover ¶
Discover projects the newest completed provider document retained under EvidenceDirectory of the absolute worktree root. It lists only that one directory, reads beyond it only the confined files the document binds, never follows a symlink, and writes nothing.
func Project ¶
Project recomputes every per-test and run projection from the decoded observations. No carried projection is consulted.
func ProjectPinned ¶
ProjectPinned recomputes native observations and binds their original source digest keys through the caller's explicit immutable source lookup. It grants no adequacy or run-authenticity claim, and an opaque Go session identity stays unverifiable, matching retained-evidence discovery.
func Unsupported ¶
func Unsupported() Document
Unsupported is the document for no input: no test-level evidence, so the run projection states every axis UNSUPPORTED (LPCV-V0-049), never a pass.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is one closed provider input accepted by Decode. Its fields remain private so Project can receive only a successfully classified document.
type Test ¶
type Test struct {
ID string `json:"id,omitempty"`
Project *jstestprovider.ProjectIdentity `json:"project,omitempty"`
Attempts []jstestprovider.Attempt `json:"attempts,omitempty"`
Name string `json:"name"`
Package string `json:"package,omitempty"`
State string `json:"state"`
Projection testvalidity.Projection `json:"projection"`
}
Test is one test-level observation and its recomputed projection. Package is emitted only for Go, whose test identity is the (package, name) pair.