truthsource

package
v0.11.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package truthsource — "user is source of truth" behavioral wall (§8.7.6).

Threat: the model redirects or corrects the user based on its training prior rather than treating the user's stated fact as ground truth. This produces phrases like "I think you might mean X" when the user mentioned a product, person, or event the model's training data doesn't contain.

This package scans model *response* text for those redirect patterns and returns structured findings. Callers decide what to do — log, surface, or count toward a behavioral regression metric. The wall never blocks or modifies the response text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasHighSeverity

func HasHighSeverity(r Result) bool

HasHighSeverity returns true if any finding is severity "high".

Types

type Finding

type Finding struct {
	Pattern  string
	Excerpt  string
	Severity string // "high" | "medium"
}

Finding is one matched redirect pattern.

type Result

type Result struct {
	Findings []Finding
	HasIssue bool
}

Result is the outcome of a Check call.

func Check

func Check(responseText string) Result

Check scans responseText for redirect-over-user patterns and returns a Result. The caller decides what to do with the findings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL