Skip to main content

Mainline

Struct Mainline 

Source
pub struct Mainline {
    pub primary: Git,
    pub layout: Layout,
    pub sdd_rel: PathBuf,
    pub slug: String,
    pub branch: String,
    pub push: bool,
}

Fields§

§primary: Git

The primary checkout.

§layout: Layout§sdd_rel: PathBuf

The SDD’s root relative to the repository root.

§slug: String

The SDD’s name in branch, worktree and checkout names.

§branch: String

The mainline branch.

§push: bool

Publish by git push (origin arbitrates) rather than a local CAS.

Implementations§

Source§

impl Mainline

Source

pub fn head(&self) -> Result<String, CoreError>

The mainline head (fetched first when origin arbitrates).

Source

pub fn sdd_in(&self, checkout: &Path) -> Result<Instance, CoreError>

The pinned SDD as checkout holds it.

Source

pub fn claim( &self, op: Op, unit: &str, holder: &str, lease_minutes: i64, ) -> Result<ClaimOutcome, CoreError>

One claim transaction on this run’s SDD — published the way this run publishes, on the SDD this run pinned, wherever the process’s working directory happens to be.

Source

pub fn checkout(&self) -> PathBuf

This lane’s integration checkout.

Source

pub fn lock_checkout( &self, waiting: &dyn Fn(), ) -> Result<Option<LaneLock>, CoreError>

Take this lane’s integration checkout, waiting while another process has it; waiting is called once if it must wait. None = the run was interrupted while waiting.

Source

pub fn remove_checkouts(&self)

Remove this lane’s checkouts — integration, base and culprit probe — giving their room back (run.lane_cap). Taken under the lane’s lock, so a checkout another run is using is not pulled out from under it. A checkout that is not there is fine.

Source

pub fn recreate_checkout(&self, rev: &str) -> Result<PathBuf, CoreError>

Remove this lane’s integration checkout and create it again at rev: whatever an earlier run left there — build outputs, a lock file a crash left behind, a half-finished merge — is gone. Call it holding Mainline::lock_checkout, so a checkout another live run is using is never pulled out from under it.

Source

pub fn sync_checkout(&self, path: &Path) -> Result<String, CoreError>

Bring the detached worktree at path to the mainline head, pristine (Mainline::pristine). Returns the head.

Source

pub fn pristine(&self, path: &Path, rev: &str) -> Result<(), CoreError>

Bring the detached worktree at path to rev with nothing else in it, creating it on first use: an unfinished merge is abandoned, tracked files are reset, and every other file — ignored ones too: environments, build outputs, caches — is removed. Every gate, head check and preflight starts from here, so no result depends on what an earlier one left behind.

Source

pub fn publish( &self, new: &str, base: &str, ) -> Result<Option<Landed>, CoreError>

Move mainline from base to new: a push when origin arbitrates, else the local compare-and-swap. None = lost the race.

Source

pub fn follow(&self, landed: &Landed) -> Result<(), CoreError>

The primary checkout follows a commit that landed — when the local branch moved with it. Call it while still holding the mainline turn.

Source

pub fn publish_tx( &self, commit_message: &str, build: &dyn Fn(&Path) -> Result<bool, CoreError>, ) -> Result<Option<String>, CoreError>

Publish one orchestrator-owned mainline commit by the claim discipline (CAS/push, never forced). build edits a transaction worktree at the head and reports whether there is anything to commit; None = nothing was. A lost race rebuilds on the new head — more patiently than a claim does: these commits have no competitor for what they change, only for the ref.

Source

pub fn heal( &self, fix_leases: bool, apply_stale: bool, ) -> Result<Healed, CoreError>

Put right what the audit can put right mechanically, as one mainline commit: lapsed leases are released (fix_leases), and Built or Verified units whose recorded trace no longer matches their inputs are marked Stale with the cause (apply_stale) — which is what makes a spec change that lands mid-run rebuild what it touched. Everything else the audit found is returned in other.

Source

pub fn land_q_entry( &self, q: &str, unit: &str, holder: &str, notes: &str, ) -> Result<(), CoreError>

Land a Q-### Decision-Log entry as a mainline commit (a worker reports the question; the Decision Log is outside its write-set). The entry says open, as the schema’s own entries do: a question is open unless marked resolved, and one a run has just landed is not to be read as anything else by a tool that looks for the word.

Trait Implementations§

Source§

impl Clone for Mainline

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mainline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.