bisect

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNeedsReconciliation = errors.New("system state is inconsistent and needs reconciliation")

ErrNeedsReconciliation is returned by service methods that require a consistent state to operate, but detect that the state has been dirtied by user actions.

View Source
var ErrUndoStackEmpty = errors.New("cannot undo: undo stack is empty")

Functions

This section is empty.

Types

type ActionReport added in v1.0.1

type ActionReport struct {
	ModsSetProblematic  sets.Set
	ModsSetUnresolvable sets.Set
	HasChanges          bool
}

ActionReport describes the outcome of a state-changing operation like reconciliation or advancing to the next search round.

type Enumeration

type Enumeration struct {
	FoundConflictSets    []sets.Set
	ArchivedExecutionLog *imcs.ExecutionLog
}

Enumeration holds the state for the entire process of finding multiple independent conflict sets.

func NewEnumeration

func NewEnumeration() *Enumeration

NewEnumeration creates and initializes the state for a new enumeration process.

func (*Enumeration) AddFoundConflictSet

func (e *Enumeration) AddFoundConflictSet(conflictSet sets.Set)

AddFoundConflictSet records a newly found conflict set and removes its members from the master candidate pool for future searches.

func (*Enumeration) AppendLog

func (e *Enumeration) AppendLog(log *imcs.ExecutionLog)

AppendLog archives the history from a completed bisection run.

type Service

type Service struct {

	// The OnStateChange callback is now only for simple UI redraw notifications.
	OnStateChange func()
	// contains filtered or unexported fields
}

Service encapsulates the entire bisection business logic.

func NewService

func NewService(stateMgr *mods.StateManager, activator *mods.Activator) (*Service, error)

NewService creates a new bisect service from pre-loaded components.

func (*Service) Activator

func (s *Service) Activator() *mods.Activator

func (*Service) CancelTest

func (s *Service) CancelTest(changes []mods.BatchStateChange)

CancelTest reverts file changes and invalidates the current test plan.

func (*Service) ContinueSearch

func (s *Service) ContinueSearch() (ActionReport, error)

ContinueSearch transitions the system to the next search round. It archives the last result, reconciles the candidate list, creates a new engine, and returns a report of the changes.

func (*Service) Engine

func (s *Service) Engine() *imcs.Engine

func (*Service) EnumerationState

func (s *Service) EnumerationState() *Enumeration

func (*Service) GetCombinedExecutionLog

func (s *Service) GetCombinedExecutionLog() []imcs.CompletedTest

GetCombinedExecutionLog returns a complete history of all test steps taken during the entire session, combining archived logs from previous enumeration runs with the log from the currently active bisection.

func (*Service) GetCurrentExecutionLog

func (s *Service) GetCurrentExecutionLog() *imcs.ExecutionLog

GetCurrentExecutionLog returns the log of completed tests from the active engine.

func (*Service) GetCurrentState

func (s *Service) GetCurrentState() imcs.SearchState

GetCurrentState returns a read-only snapshot of the engine's state.

func (*Service) NeedsReconciliation added in v1.0.1

func (s *Service) NeedsReconciliation() bool

NeedsReconciliation returns true if the system state may be inconsistent and a call to ReconcileState is required before performing major operations.

func (*Service) PlanAndApplyNextTest

func (s *Service) PlanAndApplyNextTest() (plan *imcs.TestPlan, changes []mods.BatchStateChange, err error)

PlanAndApplyNextTest is the single entry point for the UI's "Step" action. It will fail if the system state is inconsistent.

func (*Service) ReconcileState added in v1.0.1

func (s *Service) ReconcileState() (report ActionReport)

ReconcileState checks for and resolves dependency inconsistencies. It is safe to call multiple times; it will do nothing if the state is already consistent. It returns a report of any mods whose state was changed.

func (*Service) ResetSearch

func (s *Service) ResetSearch()

ResetSearch performs a hard reset of the entire bisection process.

func (*Service) StateManager

func (s *Service) StateManager() *mods.StateManager

--- Direct Component Access ---

func (*Service) SubmitTestResult

func (s *Service) SubmitTestResult(result imcs.TestResult, changes []mods.BatchStateChange)

SubmitTestResult processes the outcome of a test.

func (*Service) UndoLastStep

func (s *Service) UndoLastStep() error

UndoLastStep orchestrates a complete undo operation. It reverts the bisection engine to its previous state.

Jump to

Keyboard shortcuts

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