domain

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ParadoxInjectionThreshold = 0.8

Paradox injection triggers when P > ParadoxInjectionThreshold

Variables

This section is empty.

Functions

This section is empty.

Types

type Atom

type Atom = core.Atom

Atom is an alias to the core Atom type.

type AuditResult

type AuditResult struct {
	Pass          bool             `json:"pass"`
	ViolationTier TrustTier        `json:"violation_tier"`
	TierID        string           `json:"tier_id"`
	ConflictPath  string           `json:"conflict_path"` // "safety.dl:42"
	ProofTree     *ProofNode       `json:"proof_tree"`    // "Why" it failed
	EntropyDelta  float64          `json:"entropy_delta"` // Feedback for EAST
	Trail         *core.AuditTrail `json:"-"`             // Governance audit trail from gate evaluation
}

AuditResult represents the outcome of a verification phase.

type CognitiveFrame

type CognitiveFrame struct {
	ID        uuid.UUID
	Timestamp time.Time
	Intent    IntentStr

	// Task Metadata (Datalog-Driven from strategy.dl)
	TaskType   TaskType   // INDUCTION, GENERATION, AUDIT, RECOVERY
	OutputType OutputType // PLAN (structured JSON) or RULE (Datalog rules)

	// Memory & Logic
	Context       []Atom       // Soft Logic (INT8) - Observed facts, pruneable
	AttentionSink []Atom       // Hard Logic (FP32) - Immutable Axioms (Tier 0), never pruned
	ActiveGenes   []DomainGene // Logic Pinning - active rules for this epoch

	// Reasoning
	Draft  interface{}  // Neural proposal: *Plan or []byte
	Proof  *AuditResult // Verification trace
	Status VerifyStatus // PENDING, FP32_PASSED, LOGIC_VIOLATION, WARNING

	// Telemetry
	TraceID        string
	SessionHistory []AuditResult // Temporal conversation trace
	EAST           EASTState     // Cognitive Pressure metrics

	// Staging
	IsProposal bool
}

CognitiveFrame represents the state of a single reasoning Epoch. It is the central data structure carrying context and traces through the OODA loop.

type DecisionOutput

type DecisionOutput struct {
	Action string
	Params map[string]any
}

DecisionOutput is a placeholder for the final structured output from the agent.

type DomainGene

type DomainGene struct {
	Name         string    `json:"name"`
	Tier         TrustTier `json:"tier"` // TIER_0 .. TIER_3
	TierID       string    `json:"tier_id"`
	Rules        []byte    `json:"rules"`     // Compiled Datalog content
	Signature    [32]byte  `json:"signature"` // SHA256 integrity hash
	MMapAddr     uintptr   `json:"-"`         // Zero-copy mmap pointer
	Capabilities []string  `json:"capabilities"`
	Intents      []string  `json:"intents"`
	FactPath     string    `json:"fact_path,omitempty"`
	SourcePath   string    `json:"source_path,omitempty"`
	IsUnverified bool      `json:"is_unverified"`
}

DomainGene represents a unit of crystallized logic with integrity validation.

type EASTState

type EASTState struct {
	LogicSuccess       float64 `json:"logic_success"`       // L (0.0 - 1.0)
	EntropyCoefficient float64 `json:"entropy_coefficient"` // N (Novelty)
	SteeringMagnitude  float64 `json:"steering_magnitude"`  // P = exp(1-L) / N
}

EASTState captures the current Entropic Activation Steering metrics.

type Envelope

type Envelope = core.Envelope

Envelope is an alias to the core Envelope type for internal domain usage.

type GeneManifest

type GeneManifest struct {
	Version string         `yaml:"version"`
	Genes   []GeneMetadata `yaml:"genes"`
}

GeneManifest defines the registry of authorized logic units loaded at boot. This is the root structure for manifest.yaml parsing.

type GeneMetadata

type GeneMetadata struct {
	Name         string    `yaml:"name"`
	Tier         TrustTier `yaml:"tier"`
	Path         string    `yaml:"path"`
	FactPath     string    `yaml:"fact_path,omitempty"`
	Signature    string    `yaml:"signature"` // SHA256 hex string
	Capabilities []string  `yaml:"capabilities"`
	Intents      []string  `yaml:"intents"`
}

GeneMetadata contains the identity and integrity data for a single gene.

type IntentStr

type IntentStr = core.IntentStr

IntentStr is an alias to core.IntentStr.

type OutputType

type OutputType string

OutputType defines the expected output format.

const (
	OutputTypePlan OutputType = "PLAN" // Structured action plan (JSON)
	OutputTypeRule OutputType = "RULE" // Datalog rules
)

type Payload

type Payload iter.Seq[Atom]

Payload is a zero-allocation stream of Atoms.

type PortType

type PortType string

PortType identifies the source of a signal.

type ProofNode

type ProofNode struct {
	Rule    string
	Matches map[string]string
	Pass    bool
}

ProofNode represents a step in the Datalog proof tree.

type Quad

type Quad = core.Quad

Quad is an alias to the core Quad type.

type Signal

type Signal struct {
	ID         string    `json:"id"`
	Source     PortType  `json:"source"`
	Timestamp  time.Time `json:"timestamp"`
	RawContent string    `json:"raw_content"`
	Intent     IntentStr `json:"intent,omitempty"`
	IntentHint string    `json:"intent_hint,omitempty"`
	IsProposal bool      `json:"is_proposal,omitempty"`
}

Signal represents an event triggering the OODA loop.

type TaskType

type TaskType string

TaskType defines the category of cognitive work.

const (
	TaskTypeInduction  TaskType = "INDUCTION"  // Learning from raw input
	TaskTypeGeneration TaskType = "GENERATION" // Creating structured output
	TaskTypeAudit      TaskType = "AUDIT"      // System verification
	TaskTypeRecovery   TaskType = "RECOVERY"   // Error remediation
)

type TrustTier

type TrustTier string

TrustTier defines the authority level of a gene or action.

const (
	Tier0Kernel TrustTier = "TIER_0" // Immutable Core
	Tier1Admin  TrustTier = "TIER_1" // Human Operator
	Tier2AI     TrustTier = "TIER_2" // Induced Logic
	Tier3User   TrustTier = "TIER_3" // Untrusted Input
)

type VerifyStatus

type VerifyStatus string

VerifyStatus represents the outcome of the verification phase.

const (
	VerifyStatusPending VerifyStatus = "PENDING"
	VerifyStatusPassed  VerifyStatus = "FP32_PASSED"
	VerifyStatusFailed  VerifyStatus = "LOGIC_VIOLATION"
	VerifyStatusWarning VerifyStatus = "WARNING"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL