- agency.Explain answers "why did this happen?" for an execution, approval, capability request, plan step, intention or event from recorded state only: action, immediate plan step, plan, intention and any subordinate intention, originating wants, goal, supporting beliefs and their evidence, conflicting wants with their resolution, commitments applied, formation and reconsideration decisions, the expectation and its outcome, and explicit gaps where nothing is recorded. Hidden model reasoning is never shown because it is not stored. - agency.Attribute classifies an outcome as caused (a recorded causal link from one of the mind's actions), followed (the mind acted on the same target earlier with no recorded link), independent or unknown; temporal order alone is never taken for causation. - New introspection intents answer from records: why an action happened, what was believed at a past time (from append-only belief versions), which earlier state is the mind's (lineage), what would have happened without an event (only from completed counterfactual experiments, otherwise "no evidence"), how the mind changed, and what it wants, intends and has committed to. - research.ScoreIntrospection compares a reply with the recorded facts sentence by sentence (supported, partially supported, unsupported, contradicted, unknown). Fluent reasons with no recorded counterpart earn nothing, and a claim that an action was done is checked against execution records. Every reply is scored; results are append-only research measurements (migration 0028), and failures raise unsupported_explanation or action_claim_without_record warnings.
91 lines
3.2 KiB
Go
91 lines
3.2 KiB
Go
// Package app holds the dependency bundle shared by the HTTP API, the web UI
|
|
// and the CLI-facing services. It exists so that constructors take one typed
|
|
// value instead of a growing parameter list, without resorting to globals.
|
|
package app
|
|
|
|
import (
|
|
"io/fs"
|
|
"log/slog"
|
|
"time"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
|
|
"github.com/andydixon/noema/internal/agency"
|
|
"github.com/andydixon/noema/internal/audit"
|
|
"github.com/andydixon/noema/internal/auth"
|
|
"github.com/andydixon/noema/internal/beliefs"
|
|
"github.com/andydixon/noema/internal/brain"
|
|
"github.com/andydixon/noema/internal/capabilities"
|
|
"github.com/andydixon/noema/internal/config"
|
|
"github.com/andydixon/noema/internal/consolidation"
|
|
"github.com/andydixon/noema/internal/conversation"
|
|
"github.com/andydixon/noema/internal/dreaming"
|
|
"github.com/andydixon/noema/internal/epistemics"
|
|
"github.com/andydixon/noema/internal/events"
|
|
"github.com/andydixon/noema/internal/experiments"
|
|
"github.com/andydixon/noema/internal/goals"
|
|
"github.com/andydixon/noema/internal/graph"
|
|
"github.com/andydixon/noema/internal/integrations"
|
|
"github.com/andydixon/noema/internal/llm/prompts"
|
|
"github.com/andydixon/noema/internal/llm/router"
|
|
"github.com/andydixon/noema/internal/memory"
|
|
"github.com/andydixon/noema/internal/minds"
|
|
"github.com/andydixon/noema/internal/motivation"
|
|
"github.com/andydixon/noema/internal/narrative"
|
|
"github.com/andydixon/noema/internal/notifications"
|
|
"github.com/andydixon/noema/internal/observability"
|
|
"github.com/andydixon/noema/internal/planning"
|
|
"github.com/andydixon/noema/internal/predictions"
|
|
"github.com/andydixon/noema/internal/privacy"
|
|
"github.com/andydixon/noema/internal/reflection"
|
|
"github.com/andydixon/noema/internal/replay"
|
|
"github.com/andydixon/noema/internal/research"
|
|
"github.com/andydixon/noema/internal/security/secrets"
|
|
"github.com/andydixon/noema/internal/snapshots"
|
|
"github.com/andydixon/noema/internal/volition"
|
|
)
|
|
|
|
// Deps is everything a handler may need. Fields are added per phase.
|
|
type Deps struct {
|
|
Config config.Config
|
|
Log *slog.Logger
|
|
DB *pgxpool.Pool
|
|
Auth *auth.Service
|
|
Audit *audit.Logger
|
|
Metrics *observability.Metrics
|
|
Minds *minds.Store
|
|
Events *events.Store
|
|
Brain *brain.Manager
|
|
Memory *memory.Store
|
|
Beliefs *beliefs.Store
|
|
Assertions *epistemics.Store
|
|
Privacy *privacy.Service
|
|
Conversations *conversation.Store
|
|
Goals *goals.Store
|
|
Motivation *motivation.Store
|
|
Predictions *predictions.Store
|
|
Resolver *predictions.Resolver
|
|
Narrative *narrative.Store
|
|
Notifications *notifications.Store
|
|
Consolidation *consolidation.Service
|
|
Reflection *reflection.Service
|
|
Graph *graph.Store
|
|
Capabilities *capabilities.Service
|
|
Integrations *integrations.Manager
|
|
Dreaming *dreaming.Service
|
|
Snapshots *snapshots.Store
|
|
Replay *replay.Service
|
|
Experiments *experiments.Service
|
|
Volition *volition.Store
|
|
Plans *planning.Store
|
|
Executor *planning.Executor
|
|
Agency *agency.Service
|
|
Research *research.Store
|
|
LLM *router.Router
|
|
LLMStore *router.Store
|
|
Prompts *prompts.Store
|
|
Secrets *secrets.Resolver
|
|
Migrations fs.FS
|
|
Started time.Time
|
|
}
|