# Stable Workspace Facts

- Friday loads runtime user/project prompt guidance from `context/AGENTS.md`, `context/BELIEFS.md`, `context/SOUL.md`, `context/USER.md`, `context/MEMORY.md`, `context/memory.md`, `memory/YYYY-MM-DD.md`, and selected `.friday/rules/path/**.md` / `.friday/rules/ext/**.md` files. Root `AGENTS.md` is Codex repair workflow guidance and is not Friday runtime context. Exported memory under `.friday/exports/memory/` is not injected by default; durable user facts, preferences, compaction summaries, and runtime evidence stay behind explicit memory/context-replay surfaces.
- In this repository, `skills` are the main extensibility backbone.
- `skill.manifest.json` is the structured source of truth for a skill package. `SKILL.md` is lightweight human/model guidance.
- Repo-wide Friday runtime routing and behavior guidance belongs in `context/AGENTS.md`.
- Style and response defaults belong in `context/SOUL.md`.
- Maintainer preferences belong in `context/USER.md`.
- Durable project facts belong in `context/MEMORY.md`.
- Short-lived working notes belong in `memory/YYYY-MM-DD.md`.
- Repeated operational routines should graduate into automations or workflows instead of expanding prompt instructions.
- When product docs conflict with historical notes, prefer `docs/current-source-of-truth.md`.
- The MBTI communication persona system is wired end-to-end: hub-bootstrap builds persona per-run, agent-runtime injects it into the system prompt. Code path: `hub-bootstrap.ts` (`communicationPromptBuilder` callback) → `agent-runtime.ts` (`communicationPromptBuilder` invocation in executeRun).
- The self-learning pipeline feeds preference facts (with 30-day half-life confidence decay) into persona resolution via `_learningContextRef.buildContext()`.
- Wizard/onboarding state defaults to in-memory (`Map`) but supports optional persistence via the `OnboardingPersistence` interface. Setup assistant state (not onboarding engine) is strictly in-memory and does not survive restarts.
- The learning confidence model uses Bayesian-inspired updates: `0.45 * existingDecayed + 0.55 * signalConfidence + evidenceBoost - conflictPenalty`.
- Expected utility calculator (`src/learning/services/friday-expected-utility-calculator.ts`) provides pluggable EU scoring for auto-fix decisions: `EU = benefit * P(success) - cost * P(failure) - riskPenalty`. Strategy pattern enables future ML model replacement.
- Tool call summary (`src/agent/services/friday-tool-call-summary.ts`) captures privacy-safe tool execution metadata (arg keys only, no values) for observability and world model training data.
- Warn-once pattern is used across 7+ modules (hub-bootstrap, auth, memory, system, http-server, workspace-context, unix-socket-bridge) to deduplicate runtime warnings without losing critical signals.
- OpenAI Responses API (`openai-responses`) streaming is now supported alongside `openai-completions` in the agent LLM client.
- Database migration count: 88 (latest: v088-auto-fix-rollback-receipt).
