Data Model: origin freshness
FreshnessState (enum, foundation-agnostic values)
up_to_date, behind, ahead, diverged, local_missing, remote_missing, unreachable, no_remote.
Divergence (kernel value object)
| Field | Type | Meaning |
|---|---|---|
behind | int | commits on the remote-tracking ref not on local (optionally path-scoped) |
ahead | int | commits on local not on the remote-tracking ref |
FreshnessVerdict (application value object)
| Field | Type | Meaning |
|---|---|---|
branch | str | local branch name |
remote | str \ | None |
state | FreshnessState | classification |
behind / ahead | int | counts (0 when not applicable) |
scope | str \ | None |
detail | str \ | None |
remote_sha | str \ | None |
Invariants: up_to_date and remote_missing only when the remote answered in this invocation; behind > 0 and ahead > 0 ⇔ diverged.
OriginCheckMode
enforce (default) | warn; carries source ∈ {default, flag, environment, read-only} (read-only = accept --no-commit / --diagnose). Unknown env value ⇒ enforce with a warning.
Refusal codes
ORIGIN_STATUS_STALE, ORIGIN_LANE_STALE, ORIGIN_LANE_DIVERGED, ORIGIN_UNREACHABLE.
Review lane action (application)
keep | fast_forward(to_sha) | create_from(remote_ref) | refuse(code) | warn(state).