package controlplane

import (
	"log"

	"github.com/nexuscrm/kernel/pkg/schema"
	schemacatalog "github.com/nexuscrm/kernel/pkg/schemacatalog"
)

// managedTableDefinitions is the controlplane-local fail-fast accessor for the
// substrate table definitions, sourced from the kernel L0 schema catalog SSoT.
// It mirrors the historical bootstrap.GetManagedTableDefinitions wrapper so the
// control plane reaches the SSoT directly (as a kernel sibling) without routing
// through internal/bootstrap.
func managedTableDefinitions() []schema.TableDefinition {
	defs, err := schemacatalog.ManagedTableDefinitions()
	if err != nil {
		log.Fatalf("managed table definitions: %v", err)
	}
	return defs
}
