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

observer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observer

type Observer struct {
	// contains filtered or unexported fields
}

Observer is the single persistent, deterministic process per ticket. It claims signals before dispatching a one-shot agent invocation for them, preventing two goroutines from ever answering the same signal twice (spec: Concurrency Model — signal claiming, commit coalescing).

`claimed` is in-memory only and does not survive an observer restart. Resume-safety instead comes from DispatchForCommit checking the log itself before claiming — a FINDING/BLOCKER already logged for a role+commitSHA is proof the work happened in a prior run. The in-memory map is only a fast-path guard against two goroutines racing within the same process.

func New

func New(logPath string, runner agentrunner.Runner) *Observer

func (*Observer) DispatchForCommit

func (o *Observer) DispatchForCommit(role, commitSHA, diff, rolePrompt string) error

DispatchForCommit claims the (role, commitSHA) pair and, if it wasn't already claimed — in memory this run, or in the log from a prior run — runs a one-shot invocation and appends the result to the log. This is what prevents duplicate FINDING/BLOCKER entries for one signal, both across racing goroutines and across an observer restart.

func (*Observer) IsInFlight

func (o *Observer) IsInFlight(role, commitSHA string) bool

IsInFlight reports whether a dispatch for this role+commit is already claimed (running or completed within this Observer's lifetime).

Jump to

Keyboard shortcuts

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