package packs

import (
	"database/sql"
)

// CONTROL-PLANE SEAM — control-plane imports bootstrap = ZERO (W5/S7).
//
// standardFlowActiveVersionIsPackOwned is the db-passing route to the shared
// bootstrap standard-flow active-version reader, used by the relocated
// standard-flows tests in this package so the test does not import
// internal/bootstrap directly. The reader STAYS in internal/bootstrap
// (standard_flow_active_version.go) because it is consulted by the SHARED
// standard-action internal-access-scope reader exposed via the contract
// runtimeports.StandardActionReader port; only the write/seed side relocated to
// controlplane. The packs package no longer references internal/bootstrap; the
// concrete reader is injected at the composition roots (packs test wiring;
// bootstrap.StandardFlowActiveVersionIsPackOwned) via
// SetStandardFlowActiveVersionIsPackOwned — never defaulted here.
//
// Mandatory injection: any caller MUST wire it first, or it is nil. (Currently
// consulted only by the relocated tests.)
var standardFlowActiveVersionIsPackOwned func(*sql.DB, string) (bool, error)

// SetStandardFlowActiveVersionIsPackOwned injects the standard-flow
// active-version reader. Intended for the composition roots / packs test wiring,
// which supply bootstrap.StandardFlowActiveVersionIsPackOwned.
func SetStandardFlowActiveVersionIsPackOwned(f func(*sql.DB, string) (bool, error)) {
	if f == nil {
		return
	}
	standardFlowActiveVersionIsPackOwned = f
}
