package layoutgraph

import 

// SharedWorkStepper is the narrow accounting boundary used when a sibling
// layout domain supplies the aggregate work budget for graph traversal.
type SharedWorkStepper interface {
	Step() error
	Finish() error
}

// NodeGraphOwnershipJournal records the graph pointer owned by each node
// before a subgraph split temporarily redirects it.
type NodeGraphOwnershipJournal struct {
	original nodeGraphOwnershipJournal
}

// Restore restores every graph pointer captured by the split.
func ( NodeGraphOwnershipJournal) () {
	.original.restore()
}

// OriginalGraph reports the graph pointer captured for node by the split.
func ( NodeGraphOwnershipJournal) ( *Node) (*Graph, bool) {
	,  := .original[]
	return , 
}

// SplitSubgraphsTracked splits a graph while returning the exact ownership
// journal needed by callers that keep the temporary subgraphs alive during a
// larger atomic operation.
func ( *Graph) (
	 context.Context,
	 SplitOptions,
	 SharedWorkStepper,
) ([]*Graph, NodeGraphOwnershipJournal, error) {
	var  nodeGraphOwnershipJournal
	var  workStepper
	if  != nil {
		 = 
	}
	,  := .splitSubgraphsWithOwnership(
		,
		,
		&,
		,
	)
	return , NodeGraphOwnershipJournal{original: }, 
}