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 ¶
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 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.