Skip to main content

Module chase

Module chase 

Source
Expand description

The chase sweep: the pass that makes the board drive instead of report.

Every pass derives crossings from the board’s own marks and the chase log: a row past its estimate asks its owner once per estimate, a lead hears at the rung’s class cadence while its state holds, and a row that died, moved and died again is a new occurrence, named at once. The cadences are the settled two: five minutes for a state burning a resource (a drifting worker, a row at 1.5x its estimate), thirty for one parked and stuck (a dead row, a stalled queue, a stuck wait, a retro or a close owed). The chase log is the whole slate: every naming is deduped by it, so a restart re-reads it rather than re-firing, and a state that clears has its naming forgotten - off the log, where a fresh process reads - so a recurrence is named at once, whatever happened in between.

Delivery degrades, never wakes: a live owner is asked; with a dead owner the lead is; with every seat asleep the mark alone stands - except the user-wait nudge, whose one shot per row is kept unspent until a live lead takes it. A chase NEVER spawns a session - the board already shows the state, and waking a project is a cost the chase does not get to spend.

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use std::time::SystemTime; πŸ”’
use forge_primitives::tasks::By; πŸ”’
use forge_primitives::tasks::ChaseRung; πŸ”’
use forge_primitives::tasks::TaskChase; πŸ”’
use forge_primitives::tasks::TaskId; πŸ”’
use forge_primitives::tasks::TaskStatus; πŸ”’
use forge_primitives::tasks::TaskTransition; πŸ”’
use forge_primitives::tasks::WaitingKind; πŸ”’
use tracing::Instrument; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::board::BoardRow; πŸ”’
use crate::tasks::parked_on_user; πŸ”’
use crate::workspace::Workspace; πŸ”’

StructsΒ§

Crossing
One message the sweep decided to send.
PromptDeliver πŸ”’
The production delivery: a prompt into a live session, and the turn its words draw as.

EnumsΒ§

Delivery
What a delivery attempt found.

ConstantsΒ§

CADENCE_BURNING_SECS πŸ”’
The cadence of a rung whose state is burning a resource: a drifting worker, a row past 1.5x its estimate.
CADENCE_STUCK_SECS πŸ”’
The cadence of a rung whose state is parked and stuck: a dead row, a stalled queue, a stuck wait, a retro or a close owed.
CHASE_INTERVAL_SECS
How long between sweeps. The same number bounds how stale a time-derived mark can be in a held client snapshot.
WAIT_RESOLVED_WINDOW_SECS πŸ”’
How long after a wait resolves its message is still worth sending.

TraitsΒ§

Deliver
Where a chase message goes. A trait so tests can watch the ladder without a live session; the production impl injects a prompt.

FunctionsΒ§

crossings πŸ”’
The crossings one project’s board implies, given what already fired.
due πŸ”’
Whether a recurring rung has waited out its cadence: it is due when nothing fired since since (the instant its state appeared, where the history says), or when the newest firing since then is at least cadence seconds old.
durable_last_named πŸ”’
The log’s most recent naming of label by the seat-level rung.
failed_at πŸ”’
When a row last died, if the history says: a row that moved and died again is a new occurrence.
fired_already πŸ”’
Whether rung already fired for id and this subject - a restated estimate changes the subject, which arms the nudge again.
fired_since πŸ”’
Whether rung already fired for id at or after at - the shape a rung recurring with a new occurrence needs.
fmt_secs πŸ”’
ladder πŸ”’
The delivery ladder: the seat the crossing prefers when it is live, else the lead when it is, else nobody - and nobody means the mark alone stands.
released_at πŸ”’
When a released wait landed, if one did: a transition out of waiting into pending that the core drove.
retro_prompt πŸ”’
What an epic’s owner is asked when its children have all stopped: the numbers, computed here and authoritative, and the ask.
since_secs πŸ”’
How long now is after at, saturating: an at in the future reads as the longest age, so a skewed stamp never silences a rung.
waiting_since πŸ”’
When the row entered waiting, if the history says: the newest transition into waiting is the episode a user nudge is deduped on.