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 ¶
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.
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 ¶
Types ¶
type Range ¶
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 ¶
New returns the stats of durations, and false when there are fewer than MinSamples of them. Negative durations are dropped.
func (Stats) Queued ¶
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 ¶
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.