syncstatus

package
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package syncstatus implements the read-only inspection behind `workloom sync status` (实施计划 M8.1, 方案 §14.4).

It answers one question: is this device ready to hand the project to another device? Every check is read-only — no git fetch, no lock creation, no recovery, no writes of any kind. A handoff that reports ready still requires the operator to have stopped the old device first: sync status inspects state, it cannot prove another machine stopped writing (方案 §14.4).

Index

Constants

View Source
const (
	CodePendingTransactions  = "pending-transactions"
	CodeUnmergedPaths        = "unmerged-paths"
	CodeMergeInProgress      = "merge-in-progress"
	CodeActiveLeases         = "active-leases"
	CodeExpiredLeases        = "expired-leases"
	CodeOrphanLeases         = "orphan-leases"
	CodeUnreadableLeases     = "unreadable-leases"
	CodeUncommittedDevsys    = "uncommitted-devsys"
	CodeDivergedFromUpstream = "diverged-from-upstream"
	CodeNoUpstream           = "no-upstream"
)

Blocker codes are stable for script consumption.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker

type Blocker struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

Blocker is one reason the handoff is not ready.

type Lease

type Lease struct {
	WorkitemID string `json:"workitem_id"`
	Owner      string `json:"owner"`
	RunID      string `json:"run_id,omitempty"`
	Kind       string `json:"kind"`
}

Lease names one scheduling lease the report considered.

type Status

type Status struct {
	Branch   string `json:"branch"`
	Commit   string `json:"commit"`
	Upstream string `json:"upstream,omitempty"`
	Ahead    int    `json:"ahead"`
	Behind   int    `json:"behind"`
	// Unmerged lists conflicted paths git could not reconcile.
	Unmerged []string `json:"unmerged"`
	// MergeWork lists in-progress merge machinery (MERGE_HEAD, ...).
	MergeWork []string `json:"merge_work,omitempty"`
	// UncommittedDevsys tracks .devsys/ paths with uncommitted changes;
	// UncommittedOther tracks everything else (reported, not blocking).
	UncommittedDevsys []string `json:"uncommitted_devsys"`
	UncommittedOther  []string `json:"uncommitted_other"`
	// Pending names transactions awaiting recovery (方案 §15.4).
	Pending []string `json:"pending_transactions,omitempty"`
	// LeasesDeferred is true when pending transactions forced the lease
	// audit to be skipped: the snapshot would be partial, so no lease
	// claim — active or clear — is made.
	LeasesDeferred bool      `json:"leases_deferred,omitempty"`
	Leases         []Lease   `json:"leases,omitempty"`
	HandoffReady   bool      `json:"handoff_ready"`
	Blockers       []Blocker `json:"blockers"`
	// Note carries soft-failures that are reported, never hidden.
	Note string `json:"note,omitempty"`
}

Status is the handoff verdict.

func Check

func Check(ctx context.Context, root string) (Status, error)

Check inspects root and returns the handoff verdict. It writes nothing: git is only ever read, storage is only ever diagnosed or inspected, and no fetch touches the network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL