Documentation
¶
Overview ¶
Package accuracy provides the synthetic, non-production credential corpus used for detector accuracy and differential tests.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
Fixture is one positive or negative example. Value is deliberately kept opaque to test diagnostics: callers should identify fixtures using RuleID, Positive, Ordinal and Format, never by printing Value.
func All ¶
func All() []Fixture
All returns a fresh copy of the corpus.
Example ¶
package main
import (
"fmt"
"github.com/baum-ai/goredact/internal/accuracy"
)
func main() {
corpus := accuracy.All()
positive, negative := 0, 0
for _, fixture := range corpus {
if fixture.Positive {
positive++
} else {
negative++
}
}
fmt.Printf("fixtures=%d positive=%d negative=%d\n", len(corpus), positive, negative)
}
Output: fixtures=511 positive=201 negative=310
type Format ¶
type Format string
Format describes the kind of text surrounding a corpus fixture.
const ( FormatAgentJSON Format = "agent-session-json" FormatAgentJSONL Format = "agent-session-jsonl" FormatShell Format = "shell-output" FormatGitDiff Format = "git-diff" FormatEnv Format = "environment-dump" FormatHTTPRequest Format = "http-request" FormatHTTPResponse Format = "http-response" FormatMinified Format = "minified" FormatEscaped Format = "escaped-content" FormatAdversarial Format = "keyword-adversarial-log" )
Click to show internal directories.
Click to hide internal directories.