doctor

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package doctor provides repository health checking and repair operations.

Index

Constants

View Source
const (
	RepairCleanLocks             = "clean_locks"
	RepairRebindWorkspacePaths   = "rebind_workspace_paths"
	RepairCleanRuntimeTmp        = "clean_runtime_tmp"
	RepairCleanRuntimeOperations = "clean_runtime_operations"
)
View Source
const (
	ErrorCodeFormatVersionMissing        = "E_FORMAT_VERSION_MISSING"
	ErrorCodeFormatVersionInvalid        = "E_FORMAT_VERSION_INVALID"
	ErrorCodeFormatVersionUnsupported    = "E_FORMAT_VERSION_UNSUPPORTED"
	ErrorCodeWorktreeListFailed          = "E_WORKTREE_LIST_FAILED"
	ErrorCodeWorktreePayloadInvalid      = "E_WORKTREE_PAYLOAD_INVALID"
	ErrorCodeWorktreePathBindingInvalid  = "E_WORKTREE_PATH_BINDING_INVALID"
	ErrorCodeWorktreePayloadMissing      = "E_WORKTREE_PAYLOAD_MISSING"
	ErrorCodeWorktreeHeadMissing         = "E_WORKTREE_HEAD_MISSING"
	ErrorCodeWorktreeHeadInvalid         = "E_WORKTREE_HEAD_INVALID"
	ErrorCodeWorktreeInvalidSnapshotID   = "E_WORKTREE_INVALID_SNAPSHOT_ID"
	ErrorCodeWorktreeHeadLatestMismatch  = "E_WORKTREE_HEAD_LATEST_MISMATCH"
	ErrorCodeDescriptorControlInvalid    = "E_DESCRIPTOR_CONTROL_INVALID"
	ErrorCodeDescriptorFilenameInvalid   = "E_DESCRIPTOR_FILENAME_INVALID"
	ErrorCodeLineageDescriptorListFailed = "E_LINEAGE_DESCRIPTOR_LIST_FAILED"
	ErrorCodeIntentControlInvalid        = "E_INTENT_CONTROL_INVALID"
	ErrorCodeIntentOrphan                = "E_INTENT_ORPHAN"
	ErrorCodeReadyControlInvalid         = "E_READY_CONTROL_INVALID"
	ErrorCodeReadyInvalid                = snapshot.PublishStateCodeReadyInvalid
	ErrorCodeReadyInvalidSnapshotID      = "E_READY_INVALID_SNAPSHOT_ID"
	ErrorCodeReadyDescriptorInvalid      = "E_READY_DESCRIPTOR_INVALID"
	ErrorCodeReadyDescriptorMissing      = snapshot.PublishStateCodeReadyDescriptorMissing
	ErrorCodeReadyMissing                = snapshot.PublishStateCodeReadyMissing
	ErrorCodeStrictVerifyFailed          = "E_STRICT_VERIFY_FAILED"
	ErrorCodeTmpControlInvalid           = "E_TMP_CONTROL_INVALID"
	ErrorCodeTmpOrphan                   = "E_TMP_ORPHAN"
	ErrorCodeAuditScanFailed             = "E_AUDIT_SCAN_FAILED"
)

Variables

This section is empty.

Functions

func RuntimeRepairActionIDs

func RuntimeRepairActionIDs() []string

RuntimeRepairActionIDs returns executable public runtime-safe repair IDs.

Types

type Doctor

type Doctor struct {
	// contains filtered or unexported fields
}

Doctor performs repository health checks.

func NewDoctor

func NewDoctor(repoRoot string) *Doctor

NewDoctor creates a new doctor.

func (*Doctor) Check

func (d *Doctor) Check(strict bool) (*Result, error)

Check runs all diagnostic checks.

func (*Doctor) ListRepairActions

func (d *Doctor) ListRepairActions() []RepairAction

ListRepairActions returns executable public runtime-safe repair actions.

func (*Doctor) Repair

func (d *Doctor) Repair(actions []string) ([]RepairResult, error)

Repair executes the specified repair actions.

type Finding

type Finding struct {
	Category    string `json:"category"`
	Description string `json:"description"`
	Severity    string `json:"severity"`
	ErrorCode   string `json:"error_code,omitempty"`
	Path        string `json:"path,omitempty"`
}

Finding represents a detected issue.

type RepairAction

type RepairAction struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	AutoSafe    bool   `json:"auto_safe"`
}

RepairAction describes a repair operation.

type RepairResult

type RepairResult struct {
	Action  string `json:"action"`
	Success bool   `json:"success"`
	Message string `json:"message"`
	Cleaned int    `json:"cleaned,omitempty"`
}

RepairResult contains the result of a repair operation.

type Result

type Result struct {
	Healthy  bool      `json:"healthy"`
	Findings []Finding `json:"findings"`
}

Result contains doctor check results.

Jump to

Keyboard shortcuts

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