Expand description
SRD-77 refine plan — pre-computed skip set + next-execution
id, derived from a session’s prior phase_outcomes rows.
The runner builds one when nmbrs refine re-attaches to an
existing session; the executor’s phase-walk gate checks it
before dispatching each phase’s per-cycle work.
SRD-77 refine: the per-execution skip plan.
When nmbrs refine re-attaches to an existing session, it
reads the session’s phase_outcomes table and builds a
[RefinePlan] — the set of (phase_name, phase_labels)
pairs that have already completed across any prior
execution, plus the next execution id to record outcomes
under.
The plan rides on the executor context (ExecCtx::refine_plan)
and the phase-walk gate checks each phase against
[is_completed] before dispatching run_phase. Skipped
phases still get their scene-tree node pushed (so the TUI /
progress display shows them with a “skipped — prior outcome”
status) but no cycles run and no new outcome row is written.
Scope (MVP): --scope=missing only — skip phases whose
exact identity already has a completed outcome row.
--scope=changed (hash compare) and --scope=all are
follow-up pushes. --on-removed= policies likewise deferred.
Structs§
- Prior
Completion - The chronologically-latest completed outcome’s provenance for one phase identity (SRD-77 base hash + SRD-107 consumed-params JSON).
- Refine
Plan - Pre-computed skip set + next-execution id for one refine invocation.
Enums§
- Execution
Qualifier - SRD-77 — Every read-side path that touches session data is
execution-qualified: it accepts an
ExecutionQualifierat the call boundary, and the storage layer applies a matchingexec_idfilter to its queries. The “aggregate across every execution” intent is the explicitExecutionQualifier::Allvariant, not an unqualified default — callers can never accidentally read across multiple executions when they meant the latest. - Refine
Scope - SRD-77
--scope=modes. - Skip
Blocker - Why a phase may NOT skip under the refine hash gate (SRD-107 Push 3) — surfaced in diagnostics so an operator sees “re-running load_train: param ‘dataset’ changed” instead of a bare hash mismatch.
Constants§
- LATEST_
LITERAL - SRD-77 — the reserved CLI-side virtual qualifier that
means “the most recent execution recorded in the session
store”. Resolvers translate this to a concrete exec_id at
query-construction time. Must never appear in stored
data — the metric_instance reserved-word guard refuses
any write carrying
session="latest"orexec_id="latest".
Functions§
- latest_
exec_ id_ for_ session - Read the maximum
exec_idrecorded in the session’sphase_outcomestable — i.e. “which execution_id is the most recent one in this session’s history”. Used byExecutionQualifier::latestto resolve the latest- execution intent into a concrete id. - warn_
multi_ execution_ default - SRD-77 — emit a per-command banner when the active session
has more than one execution in its history. Tells the
operator which execution the implicit
latestdefault resolved to and lists the latest three in temporal order (newest first), with<-- latestmarking the one their query is currently bound to.