Help us shape the future of Go! Take the 2026 Go Developer Survey

notes

package
v0.2.0 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 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Ref = "refs/notes/xis"

Variables

View Source
var ErrBadSignature = errors.New("signature does not match the note")

Functions

func KeyExists

func KeyExists(keysDir string) bool

func LoadOrCreateKey

func LoadOrCreateKey(keysDir string) (ed25519.PrivateKey, bool, error)

func ModelID

func ModelID(m string) string

ModelID follows the models.dev "provider/model-name" convention.

func PublicKey

func PublicKey(key ed25519.PrivateKey) ed25519.PublicKey

func Show

func Show(repo, commit string) ([]byte, error)

func Sign

func Sign(n Note, key ed25519.PrivateKey) ([]byte, error)

func Write

func Write(repo, commit string, note []byte) error

Types

type ATContributor

type ATContributor struct {
	Type    string `json:"type"`
	ModelID string `json:"model_id,omitempty"`
}

type ATConversation

type ATConversation struct {
	URL         string         `json:"url,omitempty"`
	Contributor *ATContributor `json:"contributor,omitempty"`
	Ranges      []ATRange      `json:"ranges"`
}

type ATFile

type ATFile struct {
	Path          string           `json:"path"`
	Conversations []ATConversation `json:"conversations"`
}

type ATRange

type ATRange struct {
	StartLine   int    `json:"start_line"`
	EndLine     int    `json:"end_line"`
	ContentHash string `json:"content_hash,omitempty"`
}

type ATRecord

type ATRecord struct {
	Version   string         `json:"version"`
	ID        string         `json:"id"`
	Timestamp string         `json:"timestamp"`
	VCS       *ATVCS         `json:"vcs,omitempty"`
	Tool      *ATTool        `json:"tool,omitempty"`
	Files     []ATFile       `json:"files"`
	Metadata  map[string]any `json:"metadata,omitempty"`
}

Agent Trace v0.1.0 (agent-trace.dev).

func AgentTrace

func AgentTrace(in TraceInput) ATRecord

type ATTool

type ATTool struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type ATVCS

type ATVCS struct {
	Type     string `json:"type"`
	Revision string `json:"revision"`
}

type Note

type Note struct {
	V          int           `json:"v"`
	Sessions   []NoteSession `json:"sessions"`
	Hunks      []NoteHunk    `json:"hunks"`
	Flags      NoteFlags     `json:"flags"`
	Review     NoteReview    `json:"review"`
	XisVersion string        `json:"xis_version"`
	CreatedAt  string        `json:"created_at"`
	Sig        string        `json:"sig,omitempty"`
	PubKey     string        `json:"pubkey"`
}

Note holds only hashes, counts and IDs: never transcript text, prompts or code.

func Verify

func Verify(raw []byte, localPub ed25519.PublicKey) (n Note, trusted bool, err error)

Verify checks the signature with the public key in the note. trusted is true when that key is the local signing key.

type NoteFlags

type NoteFlags struct {
	High       int          `json:"high"`
	Medium     int          `json:"medium"`
	Low        int          `json:"low"`
	Info       int          `json:"info"`
	Suppressed []Suppressed `json:"suppressed"`
}

type NoteHunk

type NoteHunk struct {
	File        string `json:"file"`
	NewStart    int    `json:"new_start"`
	NewLines    int    `json:"new_lines"`
	ContentHash string `json:"content_hash"`
	Steps       int    `json:"steps"`
	Contributor string `json:"contributor"`
}

type NoteReview

type NoteReview struct {
	Units      int `json:"units"`
	Understood int `json:"understood"`
}

type NoteSession

type NoteSession struct {
	ID           string   `json:"id"`
	Agent        string   `json:"agent"`
	AgentVersion string   `json:"agent_version"`
	Models       []string `json:"models"`
	Fidelity     string   `json:"fidelity"`
}

type Suppressed

type Suppressed struct {
	Rule   string `json:"rule"`
	Reason string `json:"reason"`
}

type TraceInput

type TraceInput struct {
	Revision    string
	Target      string
	Hunks       []model.Hunk
	RawPatches  map[string]string
	LineSteps   map[string]map[int]string
	StepSession map[string]string
	ActorKind   map[string]string
	Sessions    []model.Session
	XisVersion  string
	Now         time.Time
}

Jump to

Keyboard shortcuts

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