package agent

import "strings"

// runtimeCallerAuthority is the daemon-proven caller identity used by the
// Codex delegated-child effect gate. It is deliberately separate from message
// delivery state: a provider child is restricted only when the daemon can
// positively identify it as different from the primary thread.
type runtimeCallerAuthority struct {
	processGeneration string
	runtime           string
	providerThreadID  string
	primaryThreadID   string
}

func (a runtimeCallerAuthority) isPrimary() bool {
	provider := strings.TrimSpace(a.providerThreadID)
	primary := strings.TrimSpace(a.primaryThreadID)
	if provider == "" || primary == "" {
		return true
	}
	return provider == primary
}
