package runtimeports

// FieldProvenanceInitializer is the composition seam for installing the
// process-level field-provenance classifier from L0 system metadata (and,
// for the installed-runtime path, from active source-backed pack object-spec
// payloads).
//
// The concrete implementation (internal/bootstrap.FieldProvenanceInitializerImpl)
// delegates each method to the canonical bootstrap function of the same name, so
// behavior is byte-for-byte identical to calling the bootstrap function directly.
// The port exists so that control-plane consumers (internal/controlplane and
// internal/controlplane/packs) depend on this neutral interface instead of
// importing internal/bootstrap for these process-default writes. The concrete
// impl is wired at the runtime composition root (pkg/serverruntime).
//
// None of the underlying bootstrap functions take a *sql.DB — they read L0
// system metadata + internal packspec and mutate the fieldprovenance package
// default — so this port binds no per-call DB. It carries no behavior, DB
// access, or global state of its own; like every symbol in this package it is
// interface-only.
type FieldProvenanceInitializer interface {
	// DefaultPlatformStandardFields returns the APINames of every field the
	// platform injects into every custom object at CreateSchema time. The result
	// is passed to InitFieldProvenance / InitFieldProvenanceFromStandardObjectSpecs
	// as the platform-standard-field template. It performs no DB / env / global
	// access (pure static provider).
	DefaultPlatformStandardFields() []string

	// InitFieldProvenance builds a Classifier from L0 system metadata and installs
	// it as the fieldprovenance package-level default. Must be called once at
	// startup before any consumer issues its first classify call. Safe to call
	// multiple times (later calls replace the default).
	InitFieldProvenance(platformStandardFields []string) error

	// InitFieldProvenanceFromStandardObjectSpecs builds a Classifier from L0
	// system metadata plus the supplied object-spec payloads (active source-backed
	// pack declarations) and installs it as the fieldprovenance package-level
	// default.
	InitFieldProvenanceFromStandardObjectSpecs(platformStandardFields []string, objectSpecPayloads ...[]byte) error
}
