eta

package
v0.158.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 2 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

Overview

Package eta estimates when a queued message starts and finishes, from how long the turns already finished in the same project took. Pure arithmetic over durations; the daemon reads the durations (store.ProjectTurns) and the Queue view shows what this returns, always as a rough estimate with its basis (.ai/03-contracts.md § Queue, rule 6).

How good it is was measured before it was shown: on a copy of the owner's database (2026-10-12, 2,168 Claude Code turns with at least five earlier turns in their project) the median of the previous 200 turns missed a turn's length by 55 s at the median (the typical turn is 48 s), and the turn landed inside the predicted p25–p75 in 49% of cases and p10–p90 in 78%. So the view shows ranges, never a single time (.ai/12-risks.md RISK-08).

Index

Constants

View Source
const MinSamples = 5

MinSamples is the fewest finished turns an estimate is made from. Below it the view says how many there are instead of a number.

View Source
const Window = 200

Window is how many of a project's newest finished turns the estimate reads: recent work predicts the next turn a little better than the whole history (median miss 55 s against 63 s for every turn ever, same measurement).

Variables

This section is empty.

Functions

func Quantile

func Quantile(sorted []time.Duration, p float64) time.Duration

Quantile is the p-quantile of sorted durations by linear interpolation between the two nearest ranks; 0 for none.

Types

type Range

type Range struct {
	Lo, Mid, Hi time.Duration
}

Range is an estimate: Mid is the median, Lo and Hi the 25th and 75th percentiles. All are durations from now.

type Stats

type Stats struct {
	N      int
	P25    time.Duration
	Median time.Duration
	P75    time.Duration
	// contains filtered or unexported fields
}

Stats are the quantiles of a project's finished turn durations.

func New

func New(durations []time.Duration) (Stats, bool)

New returns the stats of durations, and false when there are fewer than MinSamples of them. Negative durations are dropped.

func (Stats) Queued

func (s Stats) Queued(rem Range, ahead int) (start, done Range)

Queued is when the message ahead turns after the current one starts and when it is done: the current turn's remaining time plus one typical turn per message ahead of it, then one more for itself. rem is the current turn's remaining time (zero when the session is at its prompt).

func (Stats) Remaining

func (s Stats) Remaining(elapsed time.Duration) (Range, bool)

Remaining is what is left of a turn that has run for elapsed, and false when no estimate can be made: the turn has outlasted all but a handful of the turns seen here.

Before the median it is the median minus elapsed (p25 and p75 the same way, floored at 0). Past the median that would say "any moment" for ever, and long turns are exactly the ones that run on, so it is the median of what the past turns that ran at least this long still took: on the owner's database the miss at 2 minutes in was 178 s this way against 211 s for the median minus elapsed, at 10 minutes 319 s against 381 s.

func (Stats) Turn

func (s Stats) Turn() Range

Turn is one turn's length as a range: p25, median, p75.

Jump to

Keyboard shortcuts

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