// Package runlimit owns the dependency-free resource limits and deterministic
// number semantics shared by the pure Workflow Run reducer, runtime
// projection, and durable Store boundary.
package runlimit

const (
	// MaxRunActivations is the upper bound for one materialized Workflow Run.
	MaxRunActivations = 10_000

	// One independently persisted Run input, output, effect, or event payload.
	MaxRunPayloadBytes       = 4 << 20
	MaxRunPayloadJSONNesting = 32
	MaxRunPayloadJSONValues  = 8192

	// The aggregate reducer snapshot contains many independently bounded
	// payloads and therefore has a larger byte and structural budget.
	MaxRunStateBytes       = 32 << 20
	MaxRunStateJSONNesting = 64
	MaxRunStateJSONValues  = MaxRunActivations * 64
	// TiDB's per-row entry ceiling is lower than the logical reducer snapshot
	// budget. The projector compacts repeated large values below this boundary
	// while preserving MaxRunStateBytes as the semantic aggregate budget.
	MaxRunStateStorageBytes         = 5 << 20
	MaxRunStateCompactionValueBytes = 1 << 20
)
