provenance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const EventsRelativePath = "provenance/events.jsonl"

EventsRelativePath is the project-relative path of the append-only event ledger.

Variables

This section is empty.

Functions

func Append

func Append(projectPath string, event Event) error

Append records one Provenance event in the project JSONL ledger.

func LastOutputEquals

func LastOutputEquals(projectPath, action, key string, expected any) (bool, error)

LastOutputEquals reports whether the latest event with action has output key equal to expected.

func Note added in v0.1.11

func Note(projectPath, message, actorName string) error

Note appends a researcher annotation event to the project provenance log. It is the CLI-safe path for recording human observations without a full search run.

func ReadRelativePath added in v0.2.0

func ReadRelativePath(projectPath string) string

ReadRelativePath selects the canonical ledger, falling back to the legacy path only when the canonical ledger is absent. Invalid canonical files are not hidden by a legacy ledger. Callers must still validate the selected file before reading.

Types

type Event

type Event struct {
	SchemaVersion string           `json:"schemaVersion"`
	ID            string           `json:"id"`
	Timestamp     string           `json:"timestamp"`
	Actor         string           `json:"actor"`
	ActorKind     automation.Actor `json:"actor_kind,omitempty"`
	RunID         string           `json:"run_id,omitempty"`
	Action        string           `json:"action"`
	Target        string           `json:"target"`
	Inputs        map[string]any   `json:"inputs"`
	Outputs       map[string]any   `json:"outputs"`
	Warnings      []string         `json:"warnings"`
}

Event is one append-only Provenance record in a ResearchForge project.

func Read

func Read(projectPath string) ([]Event, error)

Read returns all Provenance events from the project JSONL ledger.

type Level added in v0.2.0

type Level string

Level describes mechanical provenance, never the truth of a research claim.

const (
	Unverified     Level = "unverified"
	AgentReported  Level = "agent_reported"
	EngineVerified Level = "engine_verified"
)

func DirectoryLevel added in v0.2.0

func DirectoryLevel(root string) Level

DirectoryLevel is the fail-closed display level for current project outputs. A topic index takes precedence and checks every referenced run. Without an index, a newer checksum-bound engine event supersedes an older receipt only when its entire output set is covered by newer, validated runs. Historical receipts remain immutable and can still be validated explicitly.

type Output added in v0.2.0

type Output struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
}

type Validation added in v0.2.0

type Validation struct {
	Level    Level    `json:"provenance_level"`
	RunID    string   `json:"run_id,omitempty"`
	Warnings []string `json:"warnings"`
}

func Validate added in v0.2.0

func Validate(path string) (Validation, error)

Validate computes the level using output bytes, the immutable run receipt and its engine-kind ledger event. It does not trust a declared engine level.

func WriteRun added in v0.2.0

func WriteRun(root, action string, metadata map[string]any, paths []string, aliases ...string) (Validation, error)

WriteRun writes an exclusive, immutable receipt and binds it to an engine event in the output directory (no initialized project is necessary).

Jump to

Keyboard shortcuts

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