observer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 8 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

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, model string) *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