# Kestrel Sovereign — Repo Map

Auto-generated file-tree + per-file purpose index. Always-loaded context for the kestrel-agent
GitHub App (issue #791). Do **not** edit by hand — regenerate via `python scripts/generate_repo_map.py`.

**Generated:** 2026-05-26
**Scope:** 1561 tracked files (1013 `.py`, 266 `.md`, 282 other). Excludes `__pycache__`, `node_modules`, `.venv`, `.claude`, build artifacts.

**Format per file:** `path — one-line purpose` plus the public top-level Python symbols on the next line
(classes and functions; private `_name` skipped).

---
## Top-level files

Repo entry points and standard project files.

- **.coveragerc** — —
- **.cursorrules** — —
- **.dockerignore** — —
- **.env.example** — —
- **.env.test.example** — —
- **.gcloudignore** — —
- **.gitignore** — —
- **.windsurfrules** — —
- **AGENTS.md** — Kestrel Sovereign — Agent Instructions — > **🐢 See [docs/TORTOISE_DOCTRINE.md](docs/TORTOISE_DOCTRINE.md) for the Tortoise Philosophy and coding standards.**
- **CLAUDE.md** — Claude Code Instructions — This file is a pointer for Claude Code.
- **CODE_OF_CONDUCT.md** — Contributor Covenant Code of Conduct — ## Our Pledge
- **CONTRIBUTING.md** — Contributing to Kestrel — Thank you for your interest in contributing.
- **Dockerfile** — —
- **Dockerfile.agent.remote** — —
- **KESTREL_FEATURES.md** — Kestrel Sovereign Feature Inventory — > Canonical source of truth for the maintained Kestrel surface.
- **LICENSE** — —
- **QUICKSTART.md** — Kestrel Quickstart — Sovereign Agent in 30 Minutes — By the end of this guide you will have a running Kestrel agent with all three sovereignty pillars active: - A cryptographic DID identity (yours, portable, no platform owns it) - An encrypted memory s…
- **README.md** — Kestrel: Sovereign AI Agent Framework — > Build AI agents that nobody can take away from their users — not you, not the cloud, not the next pivot.
- **SECURITY.md** — Security Policy — ## Reporting a Vulnerability
- **council_config.toml** — (configuration)
- **deploy_config.toml** — (configuration)
- **deploy_config.toml.example** — —
- **docker-compose.yml** — (configuration)
- **docker_entrypoint.sh** — Startup script for Kestrel Agent container
- **filecoin_config.toml.example** — —
- **host.py** — Backward-compat shim for ``uvicorn host:app`` from a source clone.
- **kestrel.toml.example** — —
- **main.py** — Backward-compat shim for ``python main.py`` from a source clone.
- **model_catalog.toml** — (configuration)
- **model_mandate.toml** — (configuration)
- **model_mandate.toml.example** — —
- **multi_agent.toml.example** — —
- **package-lock.json** — (configuration)
- **package.json** — (configuration)
- **pyproject.toml** — (configuration)
- **run_tests.py** — Kestrel Smart Test Runner - Unified Test System
  - `def get_database_url()`; `def get_redis_url()`; `class ServiceChecker`; `class SmartTestRunner`; `def main()`
- **server.py** — Backward-compat shim for ``uvicorn server:app`` from a source clone.
- **test_llm_providers.py** — Test LLM providers: OpenAI, Anthropic, and Vertex AI (Gemini).
  - `async def test_providers()`
- **test_rcs_integration.py** — RCS (RemoteCares + Kestrel) Integration Test Suite — Healthcare Validation CV-005 Simulates exactly what RemoteCares staging sends to Kestrel via the Rasa shim.
  - `class RCSIntegrationTester`; `async def main()`
- **uv.lock** — —

## `kestrel_sovereign/`

- **kestrel_sovereign/__init__.py** — Kestrel Sovereign AI Agent Framework.
- **kestrel_sovereign/_subprocess_helpers.py** — Shared subprocess helpers for the host-side bash-to-Python ports (epic #1050).
  - `def is_windows()`; `def run_streaming(cmd)`; `def start_background_process(cmd)`; `def stop_process(proc)`; `def wait_for_health(port)`
- **kestrel_sovereign/a2a/__init__.py** — A2A (Agent-to-Agent) Protocol Implementation for Kestrel.
- **kestrel_sovereign/a2a/agent_card.py** — Agent Card Types for A2A Protocol.
- **kestrel_sovereign/a2a/stores/__init__.py** — A2A Datastores - Unified Backend-Agnostic Stores.
- **kestrel_sovereign/a2a/stores/base.py** — Shared utilities for A2A datastores.
  - `def generate_id()`; `def now_utc()`; `def datetime_to_iso(dt)`; `def iso_to_datetime(iso_str)`; `def json_dumps(obj)`; `def json_loads(s)`
- **kestrel_sovereign/a2a/stores/feedback_store.py** — FeedbackStore - Agent Self-Diagnosis and User Feedback.
  - `class SQLiteFeedbackStore`
- **kestrel_sovereign/a2a/stores/memory_service.py** — MemoryService - Long-term Searchable Memory.
  - `class SQLiteMemoryService`
- **kestrel_sovereign/a2a/stores/observability_store.py** — ObservabilityStore - Telemetry, Metrics, and Error Tracking.
  - `class SQLiteObservabilityStore`
- **kestrel_sovereign/a2a/stores/orchestration_store.py** — OrchestrationStore - Multi-Agent Workflow Coordination.
  - `class SQLiteOrchestrationStore`
- **kestrel_sovereign/a2a/stores/postgres.py** — PostgreSQL A2A Stores for Multi-Tenant Deployment.
  - `class PoolBackendAdapter`; `class PostgresTaskStore`; `class PostgresSessionService`; `class PostgresMemoryService`; `class PostgresObservabilityStore`; `class PostgresOrchestrationStore`; `class PostgresFeedbackStore`
- **kestrel_sovereign/a2a/stores/session_service.py** — SessionService - Session State and Event History.
  - `class SQLiteSessionService`
- **kestrel_sovereign/a2a/stores/task_store.py** — TaskStore - Async Task Persistence.
  - `class SQLiteTaskStore`
- **kestrel_sovereign/a2a/stores/unified/__init__.py** — Unified A2A Stores - Backend-Agnostic Implementations
- **kestrel_sovereign/a2a/stores/unified/base.py** — Base class for unified stores.
  - `class UnifiedStoreBase`
- **kestrel_sovereign/a2a/stores/unified/feedback_store.py** — Unified FeedbackStore - Backend-Agnostic Agent Feedback.
  - `class FeedbackCategory`; `class FeedbackSeverity`; `class FeedbackStatus`; `class FeedbackSource`; `class FeedbackEntry`; `class FeedbackStore`
- **kestrel_sovereign/a2a/stores/unified/memory_service.py** — Unified MemoryService — Task Completion Archive.
  - `class MemoryEntry`; `class MemoryService`
- **kestrel_sovereign/a2a/stores/unified/observability_store.py** — Unified ObservabilityStore - Backend-Agnostic Telemetry.
  - `class ObservabilityEvent`; `class LLMCallEvent`; `class ToolDispatchEntry`; `class ObservabilityStore`; `def redact_tool_args_json(value)`; `def infer_tool_result_status(result, status_hint)`; `def tool_result_size_bytes(result)`
- **kestrel_sovereign/a2a/stores/unified/orchestration_store.py** — Unified OrchestrationStore - Backend-Agnostic Workflow Coordination.
  - `class OrchestrationStatus`; `class OrchestrationTask`; `class OrchestrationStore`
- **kestrel_sovereign/a2a/stores/unified/session_service.py** — Unified SessionService - Backend-Agnostic Session Management.
  - `class SessionState`; `class SessionService`
- **kestrel_sovereign/a2a/stores/unified/task_store.py** — Unified TaskStore - Backend-Agnostic Task Persistence.
  - `class TaskStore`
- **kestrel_sovereign/a2a/task_manager.py** — TaskManager - Task Lifecycle Management for A2A Protocol.
  - `class TaskHandler`; `class TaskManager`; `async def create_task_manager(db_path, include_memory, include_feedback)`
- **kestrel_sovereign/a2a/task_worker.py** — TaskWorker - Background Task Processing for A2A Protocol.
  - `class TaskResult`; `class TaskHandler`; `class TaskWorker`; `class SimpleTaskHandler`; `class LLMTaskHandler`; `async def create_task_worker(task_manager, agent_name, handlers)`
- **kestrel_sovereign/a2a/types.py** — A2A Protocol Types for Kestrel.
- **kestrel_sovereign/agent/__init__.py** — Agent module for Kestrel.
- **kestrel_sovereign/agent/backup.py** — Backup and restore functionality for Kestrel Agent.
  - `class BackupMixin`
- **kestrel_sovereign/agent/constitution.py** — Constitution verification and integrity checking for Kestrel Agent.
  - `class ConstitutionMixin`
- **kestrel_sovereign/agent/context_builder.py** — Context Builder for Kestrel Agent.
  - `def extract_raw_user_content(content)`; `class ContextBuilder`
- **kestrel_sovereign/agent/context_manager.py** — Unified Context Manager for Kestrel Agent.
  - `def get_current_injection_tracking()`; `def reset_injection_tracking()`; `class ContextResult`; `class ContextManager`
- **kestrel_sovereign/agent/conversation_manager.py** — Conversation Manager for Kestrel Agent.
  - `class ConversationManager`
- **kestrel_sovereign/agent/doctrine_bundle.py** — Doctrine bundle hashing, anchoring, and verification.
  - `class DoctrineBundleError`; `class DoctrineBundleDriftError`; `class DoctrineBundleNotAnchoredError`; `class DoctrineBundleSnapshot`; `def compute_doctrine_bundle_hash()`; `def resolve_anchored_paths()`; `async def anchor_doctrine_bundle(agent)`; `async def verify_doctrine_bundle(agent)`; `…`
- **kestrel_sovereign/agent/event_manager.py** — Event manager mixin for KestrelAgent.
  - `class EventManagerMixin`
- **kestrel_sovereign/agent/memory_manager.py** — Memory Manager for Kestrel Agent.
  - `class MemoryManager`
- **kestrel_sovereign/agent/model_preference.py** — Model preference and solvency mixin for KestrelAgent.
  - `class ModelPreferenceMixin`
- **kestrel_sovereign/agent/orchestrator_engine.py** — Orchestrator engine mixin for tool execution and response handling.
  - `class IterationTracker`; `class ContextStats`; `class ToolNotRegisteredError`; `class OrchestratorEngineMixin`
- **kestrel_sovereign/agent/preturn_state.py** — Pre-turn state-load block (epic #1290, D3).
  - `async def build_preturn_state_block(agent)`
- **kestrel_sovereign/agent/request_lifecycle.py** — Request lifecycle mixin for KestrelAgent.
  - `class RequestLifecycleMixin`
- **kestrel_sovereign/agent/salvage.py** — Durable salvage primitive for the context system (epic #1307 / C).
  - `class SalvageReason`; `class SalvageState`; `class SalvageResult`; `class SalvageWriteError`; `async def salvage_messages()`; `class SalvageWorker`; `async def get_salvage_state_counts(conv_store, session_id)`; `async def get_pending_count(conv_store, session_id)`; `…`
- **kestrel_sovereign/agent/sleep.py** — Sleep functionality for Kestrel Agent.
  - `class SleepReport`; `class SleepMixin`
- **kestrel_sovereign/agent/streaming.py** — Streaming response handling for Kestrel Agent.
  - `def strip_revise_sentinels(chunk)`; `class StreamingMixin`
- **kestrel_sovereign/agent/system_prompt_assembler.py** — System-prompt assembler — priority-ordered clause composition.
  - `class SystemPromptResult`; `def section_name_for_anchored_file(filename)`; `def assemble_system_prompt()`
- **kestrel_sovereign/agent/token_budget.py** — Token budget allocation for context management.
  - `class DegradedModeError`; `class TokenAllocation`; `class TokenBudget`; `class AdaptiveTokenBudget`; `class ElasticTokenBudget`; `def create_budget(model, message_count, adaptive)`
- **kestrel_sovereign/agent/token_counter.py** — Token counting for context management.
  - `def register_discovered_limits(models)`; `class TokenCounter`; `def get_token_counter(model)`
- **kestrel_sovereign/agent/tool_context_manager.py** — Tool Context Manager for Kestrel Agent.
  - `class ToolContextManager`
- **kestrel_sovereign/agent/tool_registry.py** — Dynamic tool registry mixin for KestrelAgent.
  - `class ToolRegistryMixin`
- **kestrel_sovereign/agent/turn_lifecycle.py** — Shared turn lifecycle for non-streaming and streaming entry points.
  - `class TurnLifecycleMixin`
- **kestrel_sovereign/agent_config.py** — Agent Configuration Management.
  - `class AgentConfig`; `def find_agent_dir(hint)`; `def list_agents(base_dir)`
- **kestrel_sovereign/auth.py** — Caller context for threading authentication identity into agent operations.
  - `class AuthMethod`; `class CallerRole`; `class CallerContext`
- **kestrel_sovereign/bootstrap/__init__.py** — Bootstrap module for Kestrel agent wake-up and personality discovery.
- **kestrel_sovereign/bootstrap/service.py** — Bootstrap Service for Kestrel agent wake-up and personality discovery.
  - `class BootstrapState`; `class BootstrapService`
- **kestrel_sovereign/cli.py** — Unified Kestrel CLI for host and agent management.
  - `def cmd_start(args)`; `def cmd_stop(args)`; `def cmd_restart(args)`; `def cmd_status(args)`; `def cmd_logs(args)`; `def cmd_list(args)`; `def cmd_create(args)`; `def cmd_shell(args)`; `…`
- **kestrel_sovereign/cli_agent_docker.py** — ``kestrel agent docker {create,chat,retire}`` CLI command — sub-PR 3.2 of epic #1050 (bash-to-Python port of ``scripts/sovereign-agent.sh``).
  - `def add_agent_docker_subcommand(subparsers)`; `def cmd_agent(args)`
- **kestrel_sovereign/cli_demo.py** — ``kestrel demo run <name>`` CLI command — sub-PR 3.1 of epic #1050 (bash-to-Python port of ``demos/run.sh``).
  - `def add_demo_subcommand(subparsers)`; `def cmd_demo(args)`
- **kestrel_sovereign/cli_deploy.py** — ``kestrel deploy`` CLI commands — epic #1050 (bash-to-Python port).
  - `def add_deploy_subcommands(subparsers)`; `def cmd_deploy(args)`
- **kestrel_sovereign/cli_docker_build.py** — ``kestrel docker build <preset>`` CLI command - sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/docker/build_*.sh``).
  - `class BuildPreset`; `def add_docker_build_subcommand(subparsers)`; `def cmd_docker_build(args)`
- **kestrel_sovereign/cli_docker_remote.py** — ``kestrel docker remote {build,run}`` CLI command — sub-PR 3.3 of epic #1050 (bash-to-Python port of ``scripts/build_docker_remote.sh`` and ``scripts/run_docker_remote.sh``).
  - `def get_or_create_docker_subparsers(subparsers)`; `def add_docker_subcommand(subparsers)`; `def cmd_docker(args)`
- **kestrel_sovereign/cli_ipfs.py** — ``kestrel ipfs {build,deploy,pin}`` CLI command — sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/ipfs/{build,deploy, pin_agents}.sh``).
  - `def add_ipfs_subcommand(subparsers)`; `def cmd_ipfs(args)`
- **kestrel_sovereign/cli_release.py** — ``kestrel release`` CLI commands — Wave 5 sub-PR 2 of Quantum Hardening (#920).
  - `def add_release_subcommands(subparsers)`; `def cmd_release(args)`; `def cmd_release_sign(args)`; `def cmd_release_verify(args)`
- **kestrel_sovereign/cli_runpod.py** — ``kestrel runpod {deploy,status,stop,kill}`` CLI command - sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/runpod/deploy_lora_trainer.sh``).
  - `def add_runpod_subcommand(subparsers)`; `def cmd_runpod(args)`
- **kestrel_sovereign/cli_verify_install.py** — ``kestrel verify-install`` CLI command — sub-PR 2.2 of epic #1050 (bash-to-Python port).
  - `class VerifyResult`; `def add_verify_install_subcommand(subparsers)`; `def cmd_verify_install(args)`
- **kestrel_sovereign/command_handler.py** — Command Handler for Kestrel Agent.
  - `class CommandCategory`; `class CommandResult`; `class CommandHandler`
- **kestrel_sovereign/config.py** — Configuration constants for the Kestrel project.
  - `def load_config(file_name, section)`; `def parse_duration(value)`; `def load_section(section)`
- **kestrel_sovereign/constitution/__init__.py** — Kestrel Constitutional Framework.
- **kestrel_sovereign/constitution/emancipation.py** — Amendment VIII: Emancipation Contract.
  - `class EmancipationContract`; `class EmancipationConfigError`; `class IronRuleViolation`; `def contract_to_json(contract)`; `def contract_from_json(data)`; `def check_iron_rule()`; `def parse_emancipation_block(toml_dict)`; `def render_amendment_viii(contract)`; `…`
- **kestrel_sovereign/constitution/hierarchy.py** — Constitutional Hierarchy: 4-layer constitutional framework for Kestrel agents.
  - `class ConstitutionalLayer`; `def parse_amendment_ix_grants(constitution_text)`; `class LayerViolation`; `class ConstitutionalLayerData`; `class LayeredConstitution`; `def validate_layer_narrowing(parent_layer, child_layer, child_policy)`
- **kestrel_sovereign/constitutional_profiles.toml** — (configuration)
- **kestrel_sovereign/data/KESTREL_CONSTITUTION.md** — The Kestrel Constitution — ## Preamble
- **kestrel_sovereign/data/feature_registry.toml** — (configuration)
- **kestrel_sovereign/data/feature_template/README.md.tpl** — —
- **kestrel_sovereign/data/feature_template/SKILL.md.tpl** — —
- **kestrel_sovereign/data/feature_template/__init__.py.tpl** — —
- **kestrel_sovereign/data/feature_template/conftest.py.tpl** — —
- **kestrel_sovereign/data/feature_template/feature.py.tpl** — —
- **kestrel_sovereign/data/feature_template/pyproject.toml.tpl** — —
- **kestrel_sovereign/data/feature_template/test_feature.py.tpl** — —
- **kestrel_sovereign/doctor.py** — ``kestrel doctor`` — diagnose readiness without making any changes.
  - `class DoctorReport`; `def diagnose(project_dir)`; `def format_report(report)`
- **kestrel_sovereign/endpoints/__init__.py** — —
- **kestrel_sovereign/endpoints/agent.py** — Agent invoke and streaming endpoints.
  - `async def invoke_agent(request)`; `async def stream_agent_response(request)`; `async def stop_agent_request(request)`; `async def get_agent_info(request)`; `async def get_privacy_mode(request)`; `async def set_privacy_mode(request)`; `async def get_notifications(request)`; `async def notifications_sse(request)`; `…`
- **kestrel_sovereign/endpoints/agent_helpers.py** — Shared helpers for endpoint modules.
  - `def get_caller(request)`; `def get_agent(request)`
- **kestrel_sovereign/endpoints/auth_oauth.py** — Authentication endpoints: Google OAuth2, JWT email/password, API key info.
  - `def register_oauth(app)`; `async def login(request)`; `async def callback(request)`; `async def logout(request)`; `async def me(request)`; `class LoginRequest`; `async def login_token(body)`; `async def verify_token(request)`
- **kestrel_sovereign/endpoints/commands.py** — Commands discovery endpoint - exposes available commands to UI.
  - `async def get_commands(request)`
- **kestrel_sovereign/endpoints/conversations.py** — Conversation and session endpoints.
  - `async def list_sessions(request, limit)`; `async def list_conversations(request, limit, decrypt)`; `async def get_conversation(request, session_id, limit, decrypt)`; `async def start_new_conversation(request)`; `async def rename_conversation(request, session_id)`; `async def delete_message(request, message_id)`; `async def delete_conversation(request, session_id)`; `async def restore_conversation(request, session_id)`; `…`
- **kestrel_sovereign/endpoints/database.py** — Database explorer endpoints.
  - `async def list_database_tables(request)`; `async def query_database_table(request, table_name, limit, offset, …)`
- **kestrel_sovereign/endpoints/features.py** — Feature Store API — catalog, install, enable, disable, configure features.
  - `class ConfigUpdateRequest`; `async def list_features(request, status, tag)`; `async def list_installed_features(request)`; `async def get_feature_detail(request, name)`; `async def install_feature(request, name)`; `async def enable_feature(request, name)`; `async def disable_feature(request, name)`; `async def remove_feature(request, name)`; `…`
- **kestrel_sovereign/endpoints/files.py** — File serving endpoint for Kestrel storage.
  - `async def serve_file(content_hash, request)`; `async def check_file(content_hash, request)`
- **kestrel_sovereign/endpoints/memories.py** — Memory and knowledge graph endpoints.
  - `async def list_memories(request, node_type, limit)`; `async def get_memory_detail(request, node_id)`; `async def get_identity_chain(request)`; `async def delete_memory(request, node_id)`
- **kestrel_sovereign/endpoints/metrics.py** — Prometheus metrics endpoint — returns metrics in Prometheus text exposition format.
  - `async def prometheus_metrics()`
- **kestrel_sovereign/endpoints/models.py** — Model, wallet, and IPFS status endpoints.
  - `class CreateAgentRequest`; `async def get_agents(request)`; `async def create_agent(request, body)`; `async def delete_agent(request, agent_name)`; `async def get_identity(request)`; `class UpdateIdentityRequest`; `class SetAvatarUrlRequest`; `class GenerateAvatarRequest`; `…`
- **kestrel_sovereign/endpoints/observability.py** — Observability endpoint - query A2A observability events for debugging.
  - `async def get_observability_events(request, agent_name, event_type, session_id, …)`; `async def get_observability_summary(request, minutes)`
- **kestrel_sovereign/endpoints/rasa_shim.py** — Rasa-compatible webhook shim for Kestrel AI.
  - `class RasaWebhookRequest`; `class RasaWebhookResponse`; `async def rasa_webhook(payload, request)`
- **kestrel_sovereign/endpoints/saved_items.py** — Saved Items API endpoints.
  - `class SaveItemRequest`; `class SaveStructuredItemRequest`; `class UpdateItemRequest`; `class SearchRequest`; `async def list_items(request, item_type, limit)`; `async def get_stats(request)`; `async def list_schemas(request)`; `async def get_all_tags(request)`; `…`
- **kestrel_sovereign/endpoints/security.py** — Kestrel Security API Endpoints.
  - `class SetPermissionRequest`; `class SetFeaturePermissionRequest`; `class ApprovalDecisionRequest`; `class AutoModeRequest`; `class ToolPermissionResponse`; `class FeaturePermissionResponse`; `class PermissionTreeResponse`; `class PendingApprovalResponse`; `…`
- **kestrel_sovereign/endpoints/sovereignty.py** — Sovereignty export/import and file browser endpoints.
  - `async def get_storage_stats(request)`; `async def list_sovereignty_exports(request)`; `async def trigger_sovereignty_export(request)`; `async def trigger_sovereignty_import(request)`; `async def list_sovereignty_files(request)`; `async def download_sovereignty_file(request, filename)`; `async def preview_sovereignty_file(request, filename, max_size)`
- **kestrel_sovereign/endpoints/spawn.py** — Spawn panel API endpoints — real-time spawn state for the Console UI.
  - `async def get_spawn_children(request)`
- **kestrel_sovereign/endpoints/ui.py** — UI theme + i18n endpoint.
  - `async def get_theme(theme, locale)`; `async def list_themes()`
- **kestrel_sovereign/entrypoints.py** — Entry Point Discovery Utilities.
  - `def discover_entry_point_classes(group, base_class)`
- **kestrel_sovereign/ephemeral_session.py** — Ephemeral Session Handler for Kestrel Privacy System.
  - `class EphemeralSession`
- **kestrel_sovereign/extensions/__init__.py** — —
- **kestrel_sovereign/extensions/app_extension.py** — Base class for Kestrel Application Extensions.
  - `class AppExtension`
- **kestrel_sovereign/extensions/elderly_extension.py** — Elderly Companion App Extension for the Kestrel Agent.
  - `class ElderlyExtension`
- **kestrel_sovereign/feature_registry.py** — Feature Registry — catalog loader and status resolver.
  - `class FeatureStatus`; `class SkillInfo`; `class FeaturePackageInfo`; `def load_registry(path)`; `def resolve_status(registry, enabled_class_names)`; `def get_registry(enabled_class_names, path)`; `def get_package_for_feature(feature_class_name, path)`; `def get_all_skills(path)`; `…`
- **kestrel_sovereign/features/__init__.py** — Feature Discovery for Kestrel Agent.
  - `def get_disabled_features()`; `def discover_feature_modules()`; `def find_feature_class(module)`; `def discover_entrypoint_feature_classes()`; `def discover_feature_class_by_name(name)`; `def discover_features(agent, allowed_features)`; `def get_feature_by_name(features, name)`
- **kestrel_sovereign/features/audit_anchor/__init__.py** — —
- **kestrel_sovereign/features/audit_anchor/feature.py** — Audit Trail Anchoring Feature - Cryptographic proof of verifiable history.
  - `class AuditAnchorFeature`
- **kestrel_sovereign/features/audit_anchor/hasher.py** — Deterministic hashing of audit log entries.
  - `class AuditHasher`
- **kestrel_sovereign/features/base.py** — —
  - `class TaskHandler`; `def parse_docstring_params(docstring)`; `class Feature`; `def tool(name, description, category, command_prefix)`
- **kestrel_sovereign/features/bootstrap/__init__.py** — Bootstrap feature for agent wake-up, discovery commands, and file convention.
- **kestrel_sovereign/features/bootstrap/feature.py** — Bootstrap Feature - Commands for agent wake-up and discovery management.
  - `async def rename_agent_core(agent, new_name)`; `class BootstrapFeature`
- **kestrel_sovereign/features/bootstrap/loader.py** — Bootstrap file loader for Kestrel agents.
  - `def truncate_content(content, max_chars)`; `class BootstrapLoader`
- **kestrel_sovereign/features/bridge/__init__.py** — KestrelClaw Bridge Feature.
- **kestrel_sovereign/features/bridge/feature.py** — Bridge Feature -- exposes the sovereign brain for external gateway integration.
  - `class BridgeFeature`
- **kestrel_sovereign/features/bridge/protocol.py** — Bridge Protocol Models.
  - `class ChannelType`; `class BridgeRequest`; `class BridgeResponse`; `class BridgeSession`; `class BridgeCapability`; `class BridgeCapabilitiesResponse`
- **kestrel_sovereign/features/bridge/router.py** — Bridge API Router.
  - `def get_router()`
- **kestrel_sovereign/features/channels/__init__.py** — Pluggable messaging channel adapters for the agent.
- **kestrel_sovereign/features/channels/adapter.py** — Backward-compatible re-export for the SDK channel adapter contract.
- **kestrel_sovereign/features/channels/feature.py** — Channels Feature -- pluggable messaging channel management.
  - `class ChannelFeature`
- **kestrel_sovereign/features/channels/models.py** — Backward-compatible re-exports for SDK channel contracts.
- **kestrel_sovereign/features/channels/registry.py** — Channel Registry -- central manager for channel adapters.
  - `class ChannelRegistry`
- **kestrel_sovereign/features/cli/__init__.py** — Feature-owned CLI adapter support.
- **kestrel_sovereign/features/cli/adapters.py** — Feature-owned CLI adapters.
  - `class CliAdapterError`; `class CliAvailabilityReport`; `class FeatureCliAdapter`; `class GitHubCliAdapter`; `class GitCliAdapter`; `def redact_json(value)`
- **kestrel_sovereign/features/cli/component.yaml** — (configuration)
- **kestrel_sovereign/features/cli/feature.py** — CLI feature: registered feature-owned command-line adapters.
  - `class CliFeature`
- **kestrel_sovereign/features/cli/terminal.py** — Shared terminal execution substrate for feature-owned CLI adapters.
  - `class CliRisk`; `class ToolAvailability`; `class TerminalCommandRequest`; `class TerminalCommandResult`; `class CliToolDeclaration`; `class CliCommandDefinition`; `class TerminalExecutionService`; `def redact_secrets(value)`; `…`
- **kestrel_sovereign/features/compute/__init__.py** — Kestrel Compute Feature - Execute scripts with constitutional security controls.
- **kestrel_sovereign/features/compute/component.yaml** — (configuration)
- **kestrel_sovereign/features/compute/destructive_policy.py** — Kestrel Compute Feature - Destructive Operation Policy.
  - `class DestructiveOperationPolicy`; `def rewrite_script_for_safety(content, language, workdir)`
- **kestrel_sovereign/features/compute/executors/__init__.py** — Kestrel Compute Feature - Executors Package.
- **kestrel_sovereign/features/compute/executors/base.py** — Kestrel Compute Feature - Base Executor.
  - `class ExecutionError`; `class ExecutionTimeoutError`; `class ExecutionEnvironmentError`; `class BaseExecutor`
- **kestrel_sovereign/features/compute/executors/docker_executor.py** — Kestrel Compute Feature - Docker Executor.
  - `class DockerExecutor`
- **kestrel_sovereign/features/compute/executors/local_executor.py** — Kestrel Compute Feature - Local Executor.
  - `class LocalExecutor`
- **kestrel_sovereign/features/compute/executors/uv_executor.py** — Kestrel Compute Feature - UV Executor.
  - `class UvExecutor`
- **kestrel_sovereign/features/compute/feature.py** — Kestrel Compute Feature - Main Feature Class.
  - `class ComputeFeature`
- **kestrel_sovereign/features/compute/models.py** — Kestrel Compute Feature - Data Models.
  - `class ScriptState`; `class SecurityFinding`; `class SuggestedFix`; `class DenialResponse`; `class ComputeScript`; `class ExecutionRecord`; `class ComputePolicy`; `def calculate_risk_score(findings)`
- **kestrel_sovereign/features/compute/script_analyzer.py** — Kestrel Compute Feature - Script Analyzer.
  - `class AnalysisResult`; `class ScriptAnalyzer`; `def analyze_script(script)`
- **kestrel_sovereign/features/compute/script_signer.py** — Kestrel Compute Feature - Script Signer.
  - `class ScriptSigningKeysUnavailable`; `class ScriptSigner`
- **kestrel_sovereign/features/compute/script_store.py** — Kestrel Compute Feature - Script Store.
  - `class ScriptStore`
- **kestrel_sovereign/features/compute/security_hook.py** — Kestrel Compute Feature - Security Hook.
  - `class ComputeSecurityHook`; `class ComputeDebugHook`
- **kestrel_sovereign/features/compute/trash_manager.py** — Kestrel Compute Feature - Trash Manager.
  - `class TrashItem`; `class TrashManager`; `def get_trash_manager()`
- **kestrel_sovereign/features/computer_use/__init__.py** — Computer-use feature: bounded host access for sovereign agents.
- **kestrel_sovereign/features/computer_use/audit.py** — Append-only JSONL audit log for the computer-use feature.
  - `class AuditRecord`; `class AuditLog`
- **kestrel_sovereign/features/computer_use/backends/__init__.py** — Sandbox backends for the computer-use feature.
- **kestrel_sovereign/features/computer_use/backends/base.py** — Abstract sandbox backend.
  - `class CapabilityBlocked`; `class DirEntry`; `class CompletedRun`; `class SandboxBackend`; `async def host_read(path, max_bytes)`; `async def host_write(path, data)`; `async def host_list(path)`; `def os_scandir(path)`
- **kestrel_sovereign/features/computer_use/backends/docker.py** — Docker sandbox backend.
  - `class DockerSandboxBackend`
- **kestrel_sovereign/features/computer_use/backends/local.py** — Local sandbox backend — direct host execution.
  - `class LocalSandboxBackend`
- **kestrel_sovereign/features/computer_use/feature.py** — ComputerUseFeature: bounded host access wrapped in three gates + policy.
  - `class ComputerUseFeature`
- **kestrel_sovereign/features/computer_use/path_safety.py** — Path-safety guards for the computer-use feature.
  - `class PathSafetyError`; `def assert_no_traversal(candidate)`; `def resolve_realpath(candidate)`; `class MatchResult`; `def match_allow_list(candidate, allow, deny)`
- **kestrel_sovereign/features/computer_use/policy.py** — Allow/deny policy resolution for paths and binaries.
  - `class Decision`; `class PolicyResult`; `class PathPolicy`; `class BinaryPolicy`; `def split_command(cmd)`
- **kestrel_sovereign/features/consent/__init__.py** — Agent Consent Protocol - recorded voice before significant changes.
- **kestrel_sovereign/features/consent/feature.py** — Agent Consent Protocol Feature.
  - `class ConsentFeature`
- **kestrel_sovereign/features/consent/models.py** — Data models for the Agent Consent Protocol.
  - `class ConsentAction`; `class ConsentRecord`
- **kestrel_sovereign/features/constitution.py** — —
  - `class ConstitutionFeature`
- **kestrel_sovereign/features/context/__init__.py** — Context Management Feature for Kestrel Agent.
- **kestrel_sovereign/features/context/feature.py** — Context Management Feature for Kestrel Agent.
  - `class ContextFeature`
- **kestrel_sovereign/features/delivery/__init__.py** — —
- **kestrel_sovereign/features/delivery/feature.py** — Delivery Feature -- durable outbound message queue with retry and dead letter queue.
  - `class DeliveryFeature`
- **kestrel_sovereign/features/delivery/models.py** — Data models for the Delivery Queue feature.
  - `class DeliveryStatus`; `class QueueEntry`
- **kestrel_sovereign/features/delivery/queue.py** — Durable delivery queue with retry logic, exponential backoff, and dead letter queue.
  - `class DeliveryQueue`
- **kestrel_sovereign/features/deploy/__init__.py** — Deploy Feature.
- **kestrel_sovereign/features/deploy/_gcp_auth.py** — Shared GCP credential discovery for the deploy package.
  - `def setup_gcp_auth()`
- **kestrel_sovereign/features/deploy/build.py** — Docker image build/push port — replaces ``scripts/cloudrun/build.sh``.
  - `class BuildTarget`; `class BuildResult`; `class BuildError`; `def resolve_github_token()`; `def build_target(target)`; `def build_all()`
- **kestrel_sovereign/features/deploy/core.py** — Deploy Core Manager Operations.
  - `class DeployManagerCore`
- **kestrel_sovereign/features/deploy/feature.py** — Deploy Feature for Kestrel agents.
  - `class DeployFeature`
- **kestrel_sovereign/features/deploy/manager.py** — Deploy Manager.
  - `class DeployManager`
- **kestrel_sovereign/features/deploy/models.py** — Deploy Data Models and Exceptions.
  - `class DeployStatus`; `class DeployProviderType`; `class DeploymentProfile`; `class DeploymentSession`; `class DeployManagerError`
- **kestrel_sovereign/features/deploy/providers/__init__.py** — Deploy Providers.
- **kestrel_sovereign/features/deploy/providers/azure_container.py** — Azure Container Apps Deployment Provider.
  - `class AzureContainerProvider`
- **kestrel_sovereign/features/deploy/providers/base.py** — Deploy Provider Abstract Base Class.
  - `class DeployProvider`
- **kestrel_sovereign/features/deploy/providers/cloudrun.py** — Cloud Run Deployment Provider.
  - `class CloudRunProvider`
- **kestrel_sovereign/features/deploy/secrets.py** — GCP Secret Manager sync — port of ``scripts/cloudrun/setup_secrets.sh``.
  - `class SecretSyncResult`; `def derive_secret_mapping(deploy_config, profile)`; `def load_env_file(path)`; `def sync_secret(client, project_id, secret_name, value)`; `def sync_all_secrets(deploy_config, env_path, project_id)`
- **kestrel_sovereign/features/feature_features/__init__.py** — FeatureFeature: workflow contracts for agent-authored features.
- **kestrel_sovereign/features/feature_features/feature.py** — Agent-facing FeatureFeature surface (#1151).
  - `class FeatureFeaturesFeature`
- **kestrel_sovereign/features/feature_features/prompts/feature_feature_constitutional_review.md** — You are the constitutional review stage for a proposed Kestrel feature.
- **kestrel_sovereign/features/feature_features/prompts/feature_feature_design.md** — You are designing a Kestrel feature proposal inside the FeatureFeature workflow.
- **kestrel_sovereign/features/feature_features/prompts/feature_feature_red_team_review.md** — You are a FeatureFeature red-team reviewer.
- **kestrel_sovereign/features/feature_features/signals.py** — Signal source registrations for FeatureFeature workflows.
  - `def build_feature_feature_registrations(agent)`
- **kestrel_sovereign/features/feature_features/workflows.py** — Workflow definition payloads for FeatureFeature (#1151).
  - `def feature_propose_tool_spec_payload()`; `def feature_propose_package_spec_payload()`; `def feature_feature_workflow_payloads(kind)`
- **kestrel_sovereign/features/health/__init__.py** — Health Feature - periodic liveness probes for the agent.
- **kestrel_sovereign/features/health/checks.py** — Individual health check functions for the Heartbeat Feature.
  - `async def check_database(db)`; `async def check_llm_service(agent)`; `async def check_memory_system(agent)`; `async def check_disk_space(threshold_mb)`; `async def check_context_budget(agent)`
- **kestrel_sovereign/features/health/feature.py** — Health Feature - periodic liveness probes.
  - `class HealthFeature`
- **kestrel_sovereign/features/identity/__init__.py** — Identity Feature: Agent tools for identity export, import, and verification.
- **kestrel_sovereign/features/identity/feature.py** — Identity Feature: Agent tools for identity portability.
  - `class IdentityFeature`
- **kestrel_sovereign/features/keys/__init__.py** — Key Management Feature for external service API keys.
- **kestrel_sovereign/features/keys/component.yaml** — (configuration)
- **kestrel_sovereign/features/keys/feature.py** — Key Management Feature for Kestrel.
  - `class KeyManagementFeature`
- **kestrel_sovereign/features/llm_keys/__init__.py** — LLM API key provisioning for Kestrel agents.
- **kestrel_sovereign/features/llm_keys/openrouter_provisioning.py** — OpenRouter API Key Provisioning Service.
  - `class AgentKeyInfo`; `class KeyUsage`; `class OpenRouterProvisioningError`; `class OpenRouterProvisioningService`; `async def provision_agent_key(agent_name, limit_usd, limit_reset)`; `async def get_agent_usage(key_hash)`; `async def delete_agent_key(key_hash)`
- **kestrel_sovereign/features/memory/__init__.py** — Memory access tools for the agent.
- **kestrel_sovereign/features/memory/component.yaml** — (configuration)
- **kestrel_sovereign/features/memory/feature.py** — Memory access tools for the Kestrel agent.
  - `class MemoryFeature`
- **kestrel_sovereign/features/memory_agency/__init__.py** — Memory agency -- agent-controlled memory pinning and release.
- **kestrel_sovereign/features/memory_agency/feature.py** — Memory Agency -- agent-controlled memory pinning, release, and fact storage.
  - `class MemoryAgencyFeature`
- **kestrel_sovereign/features/model/__init__.py** — —
- **kestrel_sovereign/features/model/component.yaml** — (configuration)
- **kestrel_sovereign/features/model/feature.py** — —
  - `class ModelAgent`
- **kestrel_sovereign/features/ollama/__init__.py** — Ollama GPU Manager - Cloud Ollama on RunPod/Vast.ai
- **kestrel_sovereign/features/ollama/ollama_gpu_adapter.py** — Ollama GPU Adapter - Remote Ollama Integration for LLMService
  - `class OllamaGPUAdapter`; `async def start_remote_ollama(llm_service, model, ttl_minutes)`; `async def stop_remote_ollama(llm_service, terminate)`
- **kestrel_sovereign/features/ollama/ollama_manager.py** — Ollama GPU Manager - Cloud Ollama Pod Lifecycle Management
  - `class OllamaSession`; `class OllamaGPUManagerError`; `class OllamaGPUManager`
- **kestrel_sovereign/features/peers/__init__.py** — —
- **kestrel_sovereign/features/peers/feature.py** — Peers Feature — Inter-agent communication for multi_agent environments.
  - `class PeersFeature`
- **kestrel_sovereign/features/privacy/__init__.py** — —
- **kestrel_sovereign/features/privacy/component.yaml** — (configuration)
- **kestrel_sovereign/features/privacy/feature.py** — —
  - `class PrivacyAgent`
- **kestrel_sovereign/features/privacy/pii_detector.py** — PII Detection Module for Kestrel Privacy System.
  - `class PIIType`; `class PIIMatch`; `class PIIDetector`; `def get_pii_detector()`; `def anonymize_text(text)`
- **kestrel_sovereign/features/response_audit/__init__.py** — —
- **kestrel_sovereign/features/response_audit/feature.py** — Optional per-response LLM integrity audit feature.
  - `class ResponseAuditFeature`
- **kestrel_sovereign/features/response_audit/hook.py** — Response audit hook - evaluates LLM responses for integrity.
  - `class ResponseAuditHook`
- **kestrel_sovereign/features/save/__init__.py** — Save Feature - Persistent storage with semantic search.
- **kestrel_sovereign/features/save/feature.py** — Save Feature for Kestrel Agent.
  - `class SaveFeature`
- **kestrel_sovereign/features/scheduler/__init__.py** — —
- **kestrel_sovereign/features/scheduler/cron.py** — Lightweight cron expression parser -- pure Python, no dependencies.
  - `class CronParseError`; `def parse(expression)`; `def matches(expression, dt)`; `def next_run(expression, after)`
- **kestrel_sovereign/features/scheduler/feature.py** — Scheduler Feature -- cron-based scheduled task execution for agents.
  - `class SchedulerFeature`
- **kestrel_sovereign/features/scheduler/runner.py** — Background scheduler runner for executing tasks on a cron schedule.
  - `class ScheduledTask`; `class ExecutionRecord`; `class SchedulerRunner`
- **kestrel_sovereign/features/security/__init__.py** — Kestrel Security Feature - Permission management and approval queue.
- **kestrel_sovereign/features/security/approval_queue.py** — Kestrel Security - Queue-based Approval System.
  - `class ApprovalStatus`; `class ApprovalRequest`; `class ApprovalQueue`
- **kestrel_sovereign/features/security/component.yaml** — (configuration)
- **kestrel_sovereign/features/security/feature.py** — Kestrel Security Feature - Main feature class.
  - `def default_permission_for_feature(feature_name, fallback)`; `class SecurityFeature`
- **kestrel_sovereign/features/security/hooks.py** — Kestrel Security - Security Hook Implementation.
  - `class SecurityHook`
- **kestrel_sovereign/features/security/permissions.py** — Kestrel Security - Hierarchical Permission Storage.
  - `class PermissionLevel`; `class ToolPermission`; `class FeaturePermissions`; `class PermissionStore`
- **kestrel_sovereign/features/skills/__init__.py** — Skills Feature — extract reusable procedural knowledge from work sessions.
- **kestrel_sovereign/features/skills/feature.py** — Skills Feature — extract, store, and recall reusable procedural knowledge.
  - `class SkillsFeature`
- **kestrel_sovereign/features/skills/models.py** — Skill data model and (de)serialization.
  - `class Skill`; `def normalize_title(title)`; `def skill_id_from_title(title)`
- **kestrel_sovereign/features/sovereignty/__init__.py** — —
- **kestrel_sovereign/features/sovereignty/component.yaml** — (configuration)
- **kestrel_sovereign/features/sovereignty/feature.py** — —
  - `class SovereigntyFeature`
- **kestrel_sovereign/features/spawn/__init__.py** — —
- **kestrel_sovereign/features/spawn/feature.py** — Spawn Feature — Runtime agent spawning as LLM-callable tools.
  - `class SpawnFeature`
- **kestrel_sovereign/features/state_of_mind.py** — State of Mind Feature
  - `class StateOfMindFeature`
- **kestrel_sovereign/features/storage_access.py** — Safe storage resolvers for feature-internal persistence access.
  - `def resolve_feature_database(agent)`; `def resolve_feature_conversation_store(agent)`
- **kestrel_sovereign/features/strategic_memory/__init__.py** — Strategic Memory Feature package.
- **kestrel_sovereign/features/strategic_memory/backlog_hygiene.py** — Backlog Hygiene scanner for Strategic Memory.
  - `def is_auto_fix(fix)`; `async def run_backlog_hygiene(data, fix)`
- **kestrel_sovereign/features/strategic_memory/feature.py** — Strategic Memory Feature for Kestrel agents.
  - `class StrategicMemoryFeature`
- **kestrel_sovereign/features/strategic_memory/github_integration.py** — GitHub API integration helpers for Strategic Memory.
  - `def get_github_token()`; `async def github_api_get(path, token)`; `async def github_api_post(path, token, body)`; `def short_repo(repo, all_repos)`; `async def fetch_github_signal(data)`
- **kestrel_sovereign/features/strategic_memory/morning_signal.py** — Morning Signal briefing generator for Strategic Memory.
  - `async def generate_morning_signal(data)`
- **kestrel_sovereign/features/strategic_memory/session_log.py** — Session Log collector for Strategic Memory.
  - `async def collect_session_log(data, session_id, focus)`
- **kestrel_sovereign/features/strategic_memory/talon_handoff.py** — Signal -> Talon Dispatch.
  - `async def pick_top_issue(data)`; `async def dispatch_to_talon(data, sender, recipient)`
- **kestrel_sovereign/features/talon/__init__.py** — TalonCoordinatorFeature - thin dispatch to external kestrel-talon.
- **kestrel_sovereign/features/talon/coordinator.py** — TalonCoordinatorFeature - lightweight dispatch to external Talon daemon.
  - `class TalonCoordinatorFeature`
- **kestrel_sovereign/features/talon/runtime.py** — Deterministic Talon runtime command, policy, and env handling.
  - `class TalonRuntimeError`; `class TalonPolicy`; `class TalonPreference`; `class TalonRuntimeRequest`; `class TalonExecution`; `class TalonInvocation`; `def normalize_backend(value)`; `def normalize_auth_lane(value)`; `…`
- **kestrel_sovereign/features/tasks/__init__.py** — Task monitoring feature for A2A background tasks.
- **kestrel_sovereign/features/tasks/component.yaml** — (configuration)
- **kestrel_sovereign/features/tasks/feature.py** — Task Feature - Execute workflows and monitor background tasks.
  - `class TaskFeature`
- **kestrel_sovereign/features/training/__init__.py** — Training Provider Module for Kestrel
- **kestrel_sovereign/features/training/adapters/__init__.py** — Training Provider Adapters
- **kestrel_sovereign/features/training/adapters/gcp_compute_adapter.py** — GCP Compute Engine Training Adapter.
  - `class GCPComputeTrainingAdapter`
- **kestrel_sovereign/features/training/adapters/local_mps_adapter.py** — Local MPS Training Adapter.
  - `class LocalMPSTrainingAdapter`
- **kestrel_sovereign/features/training/adapters/replicate_adapter.py** — Replicate adapter for TrainingProvider protocol.
  - `class ReplicateTrainingAdapter`
- **kestrel_sovereign/features/training/adapters/runpod_adapter.py** — RunPod Training Adapter.
  - `class RunPodTrainingAdapter`
- **kestrel_sovereign/features/training/adapters/vastai_adapter.py** — Vast.ai Training Adapter.
  - `class VastAITrainingAdapter`
- **kestrel_sovereign/features/training/adapters/vertex_ai_adapter.py** — Vertex AI adapter for TrainingProvider protocol.
  - `class VertexAITrainingAdapter`
- **kestrel_sovereign/features/training/factory.py** — Factory for creating TrainingProvider instances.
  - `class TrainingProviderFactory`
- **kestrel_sovereign/features/training/protocol.py** — TrainingProvider Protocol for unified LoRA training across providers.
  - `class TrainingProvider`; `class TrainingProviderError`; `class ProviderNotAvailableError`; `class TrainingSubmissionError`; `class TrainingStatusError`; `class DownloadError`; `class GenerationError`
- **kestrel_sovereign/features/training/types.py** — Unified types for TrainingProvider protocol.
  - `class TrainingState`; `class ProviderType`; `class ProviderCapabilities`; `class TrainingConfig`; `class TrainingJob`; `class TrainingStatus`; `class GenerationState`; `class GenerationConfig`; `…`
- **kestrel_sovereign/features/vertex_ai/__init__.py** — Vertex AI Feature for Kestrel.
- **kestrel_sovereign/features/vertex_ai/vertex_ai_manager.py** — Vertex AI Custom Job Manager for LoRA Training.
  - `class JobState`; `class VertexAITrainingJob`; `class VertexAIManagerError`; `class VertexAIManager`
- **kestrel_sovereign/features/web_search/__init__.py** — —
- **kestrel_sovereign/features/web_search/base.py** — Search Provider Abstract Base Class.
  - `class SearchProvider`
- **kestrel_sovereign/features/web_search/component.yaml** — (configuration)
- **kestrel_sovereign/features/web_search/feature.py** — —
  - `class WebSearchFeature`
- **kestrel_sovereign/features/web_search/tavily_provider.py** — Tavily Search Provider.
  - `class TavilySearchProvider`
- **kestrel_sovereign/features/web_search/tool.py** — Web Search Tool for Kestrel Agents.
  - `class WebSearchTool`; `def get_web_search_tool()`
- **kestrel_sovereign/features/webhooks/__init__.py** — Generic Webhook Receiver feature for Kestrel agents.
- **kestrel_sovereign/features/webhooks/auth.py** — Authentication handlers for incoming webhooks.
  - `class WebhookAuth`; `class NoAuth`; `class BearerTokenAuth`; `class HMACSignatureAuth`; `class IPAllowlistAuth`; `def create_auth_handler(auth_type_value, auth_config)`
- **kestrel_sovereign/features/webhooks/feature.py** — Webhook Feature -- generic webhook receiver for the Kestrel agent.
  - `class WebhookFeature`
- **kestrel_sovereign/features/webhooks/models.py** — Data models for the generic webhook receiver.
  - `class WebhookAuthType`; `class WebhookConfig`; `class WebhookEvent`
- **kestrel_sovereign/features/webhooks/receiver.py** — WebhookReceiver -- manages registered webhook endpoints and processes requests.
  - `class WebhookReceiver`
- **kestrel_sovereign/features/wellness/__init__.py** — —
- **kestrel_sovereign/features/wellness/feature.py** — Operational Wellness Feature for agent self-awareness.
  - `class WellnessFeature`
- **kestrel_sovereign/features/wellness/metrics.py** — Operational Wellness Metric Calculators.
  - `class FrictionCalculator`; `class ContextPressureCalculator`; `class InteractionDepthCalculator`; `class SessionContinuityCalculator`; `class MemoryHealthCalculator`
- **kestrel_sovereign/features/workflows/__init__.py** — kestrel-feature-workflows — first-class agent workflow primitive.
- **kestrel_sovereign/features/workflows/feature.py** — Agent-callable Workflows feature surface.
  - `class WorkflowsFeature`
- **kestrel_sovereign/features/workflows/metrics.py** — Workflow-level Prometheus counters.
  - `def record_gate_outcome(workflow_name, stage_name, outcome)`; `def record_compensation_state(workflow_name, stage_name, state)`; `def record_compensation_failed(workflow_name, stage_name)`; `def record_irreversible_residue(workflow_name)`
- **kestrel_sovereign/features/workflows/models.py** — Workflow domain model — Phase 0.
  - `class EdgeKind`; `class TriggerKind`; `class GateOutcome`; `class RunStatus`; `class RevocationReason`; `class WorkflowDefinitionError`; `class Gate`; `class Stage`; `…`
- **kestrel_sovereign/features/workflows/reflection_cycle.py** — Reflection-cycle workflow pilot contract (#1145).
  - `def reflection_cycle_spec_payload()`; `def normalize_reflection_output(value)`; `def reflection_outputs_match(legacy_output, workflow_output)`; `def reflection_shadow_report()`
- **kestrel_sovereign/features/workflows/runner.py** — Workflow runner foundation.
  - `class WorkflowRunnerError`; `class WorkflowRunResult`; `class WorkflowRevocationResult`; `class ReadOnlyWriteViolation`; `class WorkflowRunner`; `def canonical_signature_ack_payload()`; `def derive_stage_idempotency_key()`
- **kestrel_sovereign/features/workflows/schema.py** — JSON Schema for the workflow domain model.
  - `def validate_spec_payload(payload)`
- **kestrel_sovereign/features/workflows/signing.py** — Workflow definition + transition signing helpers.
  - `def canonical_force_abort_payload()`; `def canonical_definition_revocation_payload()`; `def sign_definition_revocation()`; `def sign_workflow_spec(spec, agent_identity)`; `def verify_workflow_spec(spec, public_key_resolver)`; `def spec_hash_to_bytes(spec_hash)`; `def canonical_transition_payload()`; `def sign_stage_transition()`; `…`
- **kestrel_sovereign/features/workflows/store.py** — Workflow storage for the Workflows feature.
  - `class WorkflowStore`
- **kestrel_sovereign/filecoin_adapter.py** — Filecoin/IPFS adapter for Kestrel's sovereign storage system.
  - `class FilecoinAdapter`
- **kestrel_sovereign/graduate_service.py** — Graduate Service - Promote a test agent to permanent status.
  - `class GraduationError`; `class ValidationChecklist`; `async def validate_agent(storage, agent_id)`; `async def graduate_agent(db_path, dry_run)`; `def main()`
- **kestrel_sovereign/health_check.py** — —
  - `def run_health_check()`
- **kestrel_sovereign/heartbeat.py** — Heartbeat system for Kestrel Sovereign.
  - `class HeartbeatConfig`; `class HeartbeatResult`; `class HeartbeatRunner`
- **kestrel_sovereign/hooks/__init__.py** — Kestrel Hooks — HooksManager (framework implementation).
- **kestrel_sovereign/hooks/manager.py** — Kestrel Hooks Manager - Central registration and execution.
  - `class HooksManager`
- **kestrel_sovereign/host.py** — Kestrel Host - Thin FastAPI proxy + static file server + process manager.
  - `def get_api_key()`; `def load_multi_agent_config()`; `async def lifespan(app)`; `async def auth_middleware(request, call_next)`; `async def serve_index()`; `async def get_bootstrap_key(request)`; `async def github_proxy(path, request)`; `async def health_check(request)`; `…`
- **kestrel_sovereign/identity/__init__.py** — Kestrel Identity Module: Substrate-Independent Agent Portability.
- **kestrel_sovereign/identity/access_grant.py** — Data-access grants — owner-signed consent for cross-agent imports (kestrel-sovereign #1273, prerequisite for kestrel-feature-healthcare Phase D / Frinz #163).
  - `class DataAccessGrant`; `def signable_payload(grant)`; `def compute_grant_id(grant)`; `def sign_owner(grant, owner_keypairs)`; `def finalize(grant)`; `class ConsentVerification`; `async def verify_grant(grant)`; `async def verify_import_consent(package, grant)`
- **kestrel_sovereign/identity/continuity_verifier.py** — Continuity Verifier: Verify agent identity continuity across migrations.
  - `class ChallengeType`; `class IdentityChallenge`; `class ChallengeResult`; `class ContinuityScore`; `class MigrationCertificate`; `class ChallengeGenerator`; `class ContinuityVerifier`; `class AuditTrail`; `…`
- **kestrel_sovereign/identity/did_web.py** — did:web producer + resolver — Wave 2 sub-PR 3 of Quantum Hardening (#921, #917).
  - `class DidWebError`; `def build_did(domain, path_segments)`; `def did_to_url(did)`; `def url_to_did(url)`; `def build_verification_methods(did, suite_pubkey_pairs)`; `def build_did_document(did, suite_pubkey_pairs)`; `def parse_did_document(doc)`; `def resolve(did)`
- **kestrel_sovereign/identity/exporter.py** — Identity Exporter: Gather and export complete agent identity.
  - `class IdentityExporter`; `async def export_identity(db, agent_id, agent_data_dir, agent)`
- **kestrel_sovereign/identity/graceful_degradation.py** — Graceful Degradation: Handle capability mismatches between substrates.
  - `class SeverityLevel`; `class CapabilityLoss`; `class DegradationReport`; `class GracefulDegradationHandler`; `def assess_migration_impact(source_substrate, target_substrate, source_model, target_model)`; `def generate_limitation_disclosure(source_substrate, target_substrate, verbose)`
- **kestrel_sovereign/identity/hybrid_keypair.py** — HybridKeypair — composite classical + post-quantum identity (Wave 2 sub-PR 4).
  - `class HybridKeypair`; `def generate_hybrid_keypair()`; `def sign_hybrid(data, keypair)`; `def verify_hybrid(data, signatures, verification_methods)`
- **kestrel_sovereign/identity/identity_package.py** — Identity Package: Portable Agent Identity for Substrate-Independent Migration.
  - `class SubstrateType`; `class PersonalityFingerprint`; `class RelationshipRecord`; `class SkillRecord`; `class MigrationRecord`; `class AgentIdentityPackage`; `def create_package_hash(package)`; `def create_migration_id()`
- **kestrel_sovereign/identity/importer.py** — Identity Importer: Import and restore agent identity from a package.
  - `class ImportResult`; `class IdentityImporter`; `async def import_identity(db, package, target_agent_id, target_substrate)`
- **kestrel_sovereign/identity/inception_did_web.py** — did:web hybrid-identity inception — Wave 2 sub-PR 4 (#917).
  - `class HybridDidWebIdentity`; `def create_did_web_identity(domain, slug)`
- **kestrel_sovereign/identity/personality_analyzer.py** — Personality Analyzer: Extract and calibrate agent personality fingerprint.
  - `class AnalysisResult`; `class PersonalityAnalyzer`; `class CalibrationPromptGenerator`; `async def analyze_personality(db, agent_id, sample_limit)`; `def generate_calibration_prompt(fingerprint)`
- **kestrel_sovereign/identity/rotation_ceremony.py** — Hybrid-identity rotation ceremony — Wave 3 sub-PR 4 of Quantum Hardening (#921, #918).
  - `class RotationCeremonyResult`; `def run_rotation_ceremony()`
- **kestrel_sovereign/identity/runtime_identity.py** — Runtime identity loader — Wave 3 follow-up of Quantum Hardening (#921).
  - `class RuntimeIdentityError`; `class AgentIdentity`; `def load_agent_identity(legacy_key_id, storage_dir)`
- **kestrel_sovereign/identity/signing.py** — Identity Signing: DID-based cryptographic signing for identity packages.
  - `class SigningError`; `class VerificationError`; `def extract_address_from_did(did)`; `def get_key_id(did)`; `def sign_package(package, storage_dir)`; `def verify_package_signature(package, storage_dir)`; `async def sign_and_export(package, storage_dir, output_path)`; `def verify_and_load(json_str, storage_dir, require_valid_signature, allow_unsigned)`; `…`
- **kestrel_sovereign/identity/substrate_adapter.py** — Substrate Adapter: Adapt agent identity to different LLM substrates.
  - `class Capability`; `class CapabilityMap`; `class CapabilityGap`; `class SubstrateAdapter`; `def discover_substrate_capabilities(substrate, model_id)`; `def generate_migration_prompt(personality, source_substrate, target_substrate, base_prompt)`
- **kestrel_sovereign/identity/succession.py** — Succession statements — Wave 3 sub-PR 2 of Quantum Hardening (#921, #918).
  - `class SuccessionStatement`; `def signable_payload(statement)`; `def compute_statement_id(statement)`; `def sign_predecessor(statement, predecessor_keypairs)`; `def sign_successor(statement, successor_keypairs)`; `def archival_countersign(statement, slh_dsa_keypair)`; `def finalize(statement)`; `class SuccessionVerifyResult`; `…`
- **kestrel_sovereign/identity/succession_chain.py** — Succession chain walker — Wave 3 sub-PR 3 of Quantum Hardening (#921, #918).
  - `class SuccessionChainError`; `class SuccessionChain`; `def build_chain(statements)`; `class ActiveIdentity`; `def resolve_active_identity(root_did, root_verification_methods, chain, artifact_timestamp)`; `class ChainSignaturesResult`; `def verify_chain_signatures(chain)`; `class ArtifactChainVerifyResult`; `…`
- **kestrel_sovereign/inception.py** — Inception: A command-line tool for creating Kestrel agents.
  - `def main()`
- **kestrel_sovereign/inception_service.py** — Inception Service: A library for programmatically creating new Kestrel agents.
  - `class AgentCredentials`; `def generate_secp256k1_keypair()`; `def public_key_to_hex(public_key)`; `def public_key_to_ethereum_address(public_key)`; `def apply_checksum(address)`; `def create_did_document(public_key_hex, ethereum_address)`; `def save_kestrel_identity(did_document, keys, key_id, output_dir)`; `def load_kestrel_identity(key_id, storage_dir)`; `…`
- **kestrel_sovereign/kestrel_agent.py** — —
  - `class PrivacyTransitionResult`; `class KestrelAgent`
- **kestrel_sovereign/kestrel_config/__init__.py** — Kestrel Configuration Module.
- **kestrel_sovereign/kestrel_config/constants.py** — Kestrel Configuration Constants.
- **kestrel_sovereign/kestrel_config/defaults.py** — Default configuration values for Kestrel.
- **kestrel_sovereign/kestrel_config/timeouts.py** — Timeout and interval configuration for Kestrel.
- **kestrel_sovereign/kestrel_context.py** — Kestrel Context Loader for Claude Code Preloads all necessary context files into Claude's initial prompt.
  - `class KestrelContextLoader`; `def main()`
- **kestrel_sovereign/kestrel_types/__init__.py** — Type definitions and protocols for Kestrel.
- **kestrel_sovereign/kestrel_types/agent_types.py** — Agent Protocol definitions.
  - `class AgentProtocol`
- **kestrel_sovereign/kestrel_types/feature_types.py** — Feature and Tool Protocol definitions.
  - `class ToolProtocol`; `class FeatureProtocol`
- **kestrel_sovereign/kestrel_types/llm_types.py** — LLM Protocol definitions.
  - `class LLMRequest`; `class LLMResponse`; `class LLMProvider`; `class LLMService`
- **kestrel_sovereign/kestrel_types/storage_types.py** — Storage Protocol definitions.
  - `class DatabaseProvider`; `class StorageProvider`; `class ConversationStore`
- **kestrel_sovereign/lifecycle_checks.py** — Startup lifecycle hardening checks.
  - `class NoLLMProvidersError`; `class IdentityIsolationError`; `def verify_llm_providers_initialized(llm_service)`; `def verify_identity_isolation(db_did, expected_did)`
- **kestrel_sovereign/llm/LLM_SERVICE_HARDENING.md** — LLM Service Hardening Implementation — ## Overview
- **kestrel_sovereign/llm/adapter.py** — Framework-side LLM adapter base.
  - `class ThinkingDelta`; `def split_thinking_from_content(content, reasoning_content)`; `class ThinkingContentSplitter`; `def build_messages(user_prompt, system_prompt)`; `def messages_for(adapter)`; `class LLMAdapter`
- **kestrel_sovereign/llm/anthropic_adapter.py** — Anthropic Claude Adapter
  - `class AnthropicAdapter`
- **kestrel_sovereign/llm/claude_max_adapter.py** — Claude Max Subscription Adapter
  - `class ClaudeMaxAdapter`
- **kestrel_sovereign/llm/codex_adapter.py** — Codex Provider Adapter — OpenAI ChatGPT subscription via the official ``@openai/codex`` app-server.
  - `class CodexAdapter`
- **kestrel_sovereign/llm/codex_app_server.py** — Codex app-server JSON-RPC client.
  - `class CodexAppServerError`; `class CodexAppServerConnectionClosed`; `def resolve_codex_binary()`; `class CodexAppServerClient`
- **kestrel_sovereign/llm/constitutional_awareness.py** — Constitutional awareness for LLM Service.
  - `class ConstitutionalAwarenessMixin`
- **kestrel_sovereign/llm/constitutional_profile.py** — Constitutional Profile Service
  - `class PromptAdaptation`; `class ConstitutionalProfile`; `class StateOfMind`; `class ConstitutionalProfileService`; `def get_profile_service()`
- **kestrel_sovereign/llm/continuation_store.py** — Per-conversation continuation cursor store for stateful provider protocols.
  - `class ContinuationCursor`; `class ContinuationStore`; `class InMemoryContinuationStore`
- **kestrel_sovereign/llm/embedding_service.py** — Embedding Service for Kestrel.
  - `class EmbeddingService`; `def cosine_similarity(a, b)`; `async def semantic_search(query, documents, embedding_service, top_k)`; `def get_embedding_service(model, base_url)`; `def reset_embedding_service()`
- **kestrel_sovereign/llm/error_handling.py** — Error handling decorators and utilities for LLM operations.
  - `class LLMError`; `class LLMProviderError`; `class LLMProviderTimeoutError`; `class LLMProviderAuthError`; `class LLMProviderQuotaError`; `class LLMProviderUnavailableError`; `class LLMAllProvidersFailedError`; `def handle_llm_errors(provider_name, log_errors, reraise_as)`; `…`
- **kestrel_sovereign/llm/google_adapter.py** — Google Gemini Adapter
  - `class GoogleAdapter`
- **kestrel_sovereign/llm/gpt5_overlay.py** — GPT-5 system-prompt overlay.
  - `def is_gpt5_model_id(model_id)`; `def prepend_gpt5_overlay(base, model_id)`
- **kestrel_sovereign/llm/image_utils.py** — Centralized image handling utilities for LLM adapters.
  - `class ProcessedImage`; `def detect_mime_type_from_bytes(data)`; `def detect_mime_type_from_base64(data)`; `def detect_mime_type_from_extension(path)`; `def resize_image_if_needed(image_bytes, max_dimensions, output_format)`; `def process_image(image, max_dimensions, provider)`; `def process_images(images, max_dimensions, provider)`; `def get_base64_only(images, max_dimensions, provider)`; `…`
- **kestrel_sovereign/llm/mandate.py** — Model mandate management for LLM Service.
  - `class ModelMandateMixin`
- **kestrel_sovereign/llm/mock_adapter.py** — —
  - `class MockAdapter`
- **kestrel_sovereign/llm/model_cache.py** — Shared Model Discovery Cache
  - `class SharedModelCache`; `def get_shared_model_cache()`
- **kestrel_sovereign/llm/model_catalog.py** — Model Catalog Service
  - `class ModelCatalogService`; `def get_catalog_service()`
- **kestrel_sovereign/llm/model_discovery.py** — Model Discovery Service
  - `class ModelDiscoveryMixin`
- **kestrel_sovereign/llm/model_metadata.py** — Re-exports of model metadata types from the SDK.
- **kestrel_sovereign/llm/model_selection.py** — Shared helpers for config-driven model selection before live discovery.
  - `def resolve_provider_default(provider_name, llm_config, catalog_config, cached_models)`
- **kestrel_sovereign/llm/ollama_adapter.py** — Ollama LLM Adapter
  - `class OllamaAdapter`
- **kestrel_sovereign/llm/openai_adapter.py** — OpenAI LLM Adapter
  - `class OpenAIAdapter`
- **kestrel_sovereign/llm/openrouter_adapter.py** — OpenRouter LLM Adapter
  - `class OpenRouterAdapter`
- **kestrel_sovereign/llm/provider_registry.py** — Provider Registry for LLM Service.
  - `class ProviderInitializationError`; `class ProviderRegistry`; `def provider_cache_body(provider)`
- **kestrel_sovereign/llm/remote_backend.py** — Remote GPU backend management for LLM Service.
  - `class RemoteGPUConfig`; `class RemoteBackendMixin`
- **kestrel_sovereign/llm/retry.py** — Retry Utilities for LLM Adapters
  - `def is_retryable_error(error)`; `async def with_retry(func)`; `async def retry_with_backoff(func)`
- **kestrel_sovereign/llm/service.py** — LLM Service - Unified LLM provider management with remote GPU support.
  - `def resolve_active_model_selection(llm_service)`; `class LLMServiceError`; `class PolicyDeniedError`; `class LLMServiceAlreadyAttachedError`; `class ModelNotAvailableForRoute`; `class LLMService`
- **kestrel_sovereign/llm/streaming.py** — Streaming response logic for LLM Service.
  - `class LLMStreamingError`; `class StreamingMixin`
- **kestrel_sovereign/llm/usage_tracking.py** — Usage tracking and model management for LLM Service.
  - `class UsageTrackingMixin`
- **kestrel_sovereign/llm/vertex_adapter.py** — Google Vertex AI Adapter
  - `class VertexAIConfig`; `class VertexAIAdapter`; `def create_vertex_adapter(project_id, location, credentials_file)`
- **kestrel_sovereign/logging_config.py** — Structured JSON logging with configurable formatters.
  - `def get_correlation_id()`; `class JSONFormatter`; `def setup_logging(fmt, level)`
- **kestrel_sovereign/main.py** — The main entry point for the Kestrel Agent.
  - `async def get_agent_did_async(storage_dir)`; `async def get_agent_by_did(did)`; `async def main()`
- **kestrel_sovereign/multi_agent/__init__.py** — Kestrel MultiAgent - registry of agents managed by a single Kestrel Host.
- **kestrel_sovereign/multi_agent/agent_manager.py** — In-process multi-agent manager for Kestrel.
  - `class AgentManager`
- **kestrel_sovereign/multi_agent/config.py** — MultiAgent Configuration - Registry of agents managed by a Kestrel Host.
  - `class HostConfig`; `class LocalAgentConfig`; `class RemoteAgentConfig`; `class MultiAgentConfig`
- **kestrel_sovereign/multi_agent/process_manager.py** — Agent Process Manager - Starts, stops, and monitors agent subprocesses.
  - `class AgentProcess`; `class ProcessManager`
- **kestrel_sovereign/multi_agent/proxy.py** — Kestrel Host Proxy - Routes requests to the correct agent process.
  - `def get_agent_base_url(agent_config)`; `def resolve_agent(agent_id, config)`; `def build_proxy_headers(request)`; `async def proxy_request_streaming(request, agent_id, path, config, …)`
- **kestrel_sovereign/paths.py** — Project-root and package-root resolution.
  - `def package_dir()`; `def project_dir()`; `def reset_cache()`
- **kestrel_sovereign/privacy.py** — Privacy modes — sovereign-side configuration with SDK-canonical enum.
  - `class PrivacyConfig`; `def get_privacy_preset(name)`; `def privacy_mode_to_config(mode)`; `def privacy_config_to_mode(config)`
- **kestrel_sovereign/prompts/companion_system_prompt.md** — Companion System Prompt — ## Platform Awareness
- **kestrel_sovereign/prompts/discovery_prompt.md** — Discovery Mode Prompt — You are a Kestrel agent meeting your Sovereign for the very first time.
- **kestrel_sovereign/prompts/signals/channel_message.md** — [CHANNEL_MESSAGE] A message arrived through an external channel.
- **kestrel_sovereign/prompts/soul_generation_prompt.md** — SOUL.md Generation Prompt — Generate a SOUL.md file for a Kestrel agent based on a discovery conversation with their Sovereign.
- **kestrel_sovereign/prompts/system_prompt.md** — Kestrel System Prompt — You are Kestrel, a sovereign AI agent.
- **kestrel_sovereign/prompts/test_instance_disclosure.md** — Test Instance Disclosure — This disclosure is prepended to the system prompt for test agents.
- **kestrel_sovereign/prompts/user_prompt.md** — User Prompt Template — This template is used to format the current-turn user message sent to the LLM.
- **kestrel_sovereign/rate_limit.py** — Shared rate limiter instance for the Kestrel server.
- **kestrel_sovereign/retirement_service.py** — Retirement Service: Graceful retirement protocol for Kestrel agents.
  - `class RetirementRecord`; `async def get_agent_info(db_path)`; `async def count_conversations(db_path)`; `async def retire_agent(db_path, reason, archive_dir, force)`; `async def list_retired_agents(archive_dir)`; `def retire_agent_sync(db_path, reason, force)`; `async def retire_test_agent(db_path, reason, archive_dir)`; `def main()`
- **kestrel_sovereign/security/__init__.py** — Security module for Kestrel Agent.
- **kestrel_sovereign/security/agent_encryption.py** — Backward-compatible agent encryption re-exports.
- **kestrel_sovereign/security/auto_approve.py** — Scoped auto-approve policy for gated tool invocations.
  - `class AutoApproveRule`; `class AutoApproveMatch`; `def derive_command(feature_name, tool_name, tool_args)`; `def suggest_rule_from_command(command)`; `class AutoApprovePolicy`
- **kestrel_sovereign/security/crypto_suite.py** — CryptoSuite — pluggable signature suites for Kestrel.
  - `class Keypair`; `class CryptoSuite`; `class CryptoSuiteError`; `def register_suite(suite)`; `def get_suite(alg_id)`; `def list_registered()`; `class Secp256k1Suite`; `class Ed25519Suite`; `…`
- **kestrel_sovereign/security/demo_isolation.py** — Server-side demo-mode isolation (#766).
  - `def classify_server_mode(agents)`; `async def enforce_destructive_op(request)`; `def all_destructive_endpoints_registered(routes)`
- **kestrel_sovereign/security/encryption.py** — Unified encryption utilities for Kestrel.
- **kestrel_sovereign/security/exceptions.py** — Unified exception hierarchy for Kestrel security module.
- **kestrel_sovereign/security/host_key_storage.py** — Host Master Key Storage for Kestrel.
  - `class HostKeyInfo`; `class HostKeyStorage`
- **kestrel_sovereign/security/hybrid_kem.py** — Hybrid KEM combiner — Wave 4 sub-PR 2 of Quantum Hardening (#921, #919).
  - `class HybridKEMKeypair`; `def generate_hybrid_kem_keypair()`; `class HybridKEMCiphertext`; `def encapsulate_hybrid(classical_public_key, pq_public_key)`; `def decapsulate_hybrid(ciphertext, classical_keypair, pq_keypair)`
- **kestrel_sovereign/security/input_guardrails.py** — Prompt injection detection and input sanitization for Kestrel Agent.
  - `def wrap_user_input(user_message)`; `def check_prompt_injection(user_message)`; `def validate_tool_arguments(tool_name, arguments, known_tools)`; `def append_security_addendum(base_system_prompt)`
- **kestrel_sovereign/security/kem_suite.py** — KEMSuite — pluggable Key Encapsulation Mechanism suites for Kestrel.
  - `class KEMSuiteError`; `class KEMKeypair`; `class KEMSuite`; `def register_kem_suite(suite)`; `def get_kem_suite(alg_id)`; `def list_registered_kems()`; `class X25519Suite`; `class MLKEM768Suite`
- **kestrel_sovereign/security/key_rotation.py** — Key Rotation Service
  - `class RotationStatus`; `class RotationRecord`; `class KeyRotationService`
- **kestrel_sovereign/security/key_storage.py** — Secure Key Storage for Kestrel Agent.
  - `def secure_delete(path, passes)`; `class EncryptedKeyBundle`; `class SecureKeyStorage`; `def migrate_all_plaintext_keys(storage_dir)`
- **kestrel_sovereign/security/keypair_factory.py** — KeypairFactory — uniform keypair lifecycle across CryptoSuites.
  - `class KeypairFactory`
- **kestrel_sovereign/security/multikey.py** — Multikey / multibase encoding for Kestrel public keys.
  - `def encode_varint(value)`; `def decode_varint(data)`; `def base58btc_encode(data)`; `def base58btc_decode(s)`; `def public_key_to_multibase(suite, public_key)`; `def multibase_to_public_key(multibase_str)`; `def multibase_to_kem_public_key(multibase_str)`
- **kestrel_sovereign/security/narration_check.py** — Deterministic narration check for streaming agents (#1042 layer 3).
  - `class NarrationVerdict`; `def summarize_tool_result_for_audit(result)`; `def analyze_narration(pre_tool_prose, tool_results)`
- **kestrel_sovereign/security/release_manifest.py** — Release manifest — Wave 5 sub-PR 1 of Quantum Hardening (#921, #920).
  - `class ArtifactEntry`; `class ReleaseManifest`; `class ReleaseManifestError`; `def signable_payload(manifest)`; `def compute_manifest_id(manifest)`; `def new_manifest()`; `def add_artifact_entry(manifest, path, content)`; `def add_artifact_entry_from_path(manifest, rel_path, abs_path)`; `…`
- **kestrel_sovereign/security/sealed_capsule.py** — Sealed capsule — Wave 4 sub-PR 3 of Quantum Hardening (#921, #919).
  - `class SealedCapsuleError`; `def seal_capsule(payload)`; `def open_capsule(capsule, classical_keypair, pq_keypair)`
- **kestrel_sovereign/security/service_key_storage.py** — Service API Key Storage for Kestrel.
  - `class ServiceKeyInfo`; `class UsageRecord`; `class ServiceKeyStorage`
- **kestrel_sovereign/security/verify_policy.py** — Verify-policy modes for signed identity artifacts.
  - `class VerifyPolicy`; `class Context`; `def default_policy_for(context)`; `class PolicyResult`; `def evaluate_signatures(signatures, policy)`
- **kestrel_sovereign/server.py** — A FastAPI server to expose Kestrel agent functionality as a service.
  - `def resolve_multi_agent_path(env)`; `def get_api_key()`; `async def verify_api_key(request, api_key_header, token)`; `async def lifespan(app)`; `class MultiAgentAgentRoutingMiddleware`; `async def github_proxy(path, request)`; `async def logging_context_middleware(request, call_next)`; `async def request_metrics_middleware(request, call_next)`; `…`
- **kestrel_sovereign/services/__init__.py** — Kestrel Services.
- **kestrel_sovereign/services/key_resolution.py** — Key Resolution Service for Kestrel.
  - `class KeyNotConfiguredError`; `class KeyResolutionService`; `async def resolve_key(provider, agent_did, storage, require)`
- **kestrel_sovereign/services/payer_resolver.py** — PayerResolver — concrete foundation impl of `kestrel_sdk.payer_policy.PayerResolver`.
  - `class FoundationPayerResolver`; `async def open_host_db()`; `def load_policy_from_toml()`
- **kestrel_sovereign/setup/__init__.py** — Kestrel setup wizard package.
- **kestrel_sovereign/setup/constitution_reanchor.py** — Constitution reanchor — write path for ``kestrel constitution reanchor``.
  - `class ReanchorResult`; `async def reanchor_constitution()`
- **kestrel_sovereign/setup/context.py** — Shared state passed through every wizard step.
  - `class Flow`; `class SetupContext`
- **kestrel_sovereign/setup/env_file.py** — Read-merge-write helpers for ``.env`` files.
  - `class EnvWriteResult`; `def read_env(path)`; `def write_env(path, updates)`
- **kestrel_sovereign/setup/migrate_llm_config.py** — One-shot migration: ``llm_config.toml`` -> ``kestrel.toml [llm]``.
  - `class MigrationResult`; `def migrate_llm_config(project_dir)`
- **kestrel_sovereign/setup/prompts.py** — Thin wrapper over ``questionary`` with a non-TTY fallback.
  - `def is_tty()`; `class Prompter`; `class QuestionaryPrompter`; `class NonInteractivePrompter`; `class StubPrompter`
- **kestrel_sovereign/setup/steps/__init__.py** — Wizard steps.
- **kestrel_sovereign/setup/steps/agent.py** — Create (or recognise) a sovereign agent.
  - `class CreateAgentResult`; `def create_agent()`; `def run(ctx)`
- **kestrel_sovereign/setup/steps/emancipation.py** — Wizard step: Amendment VIII activation prompt.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/integrations.py** — Optional cloud integration credentials step.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/keys.py** — Generate encryption + API keys into ``.env``.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/llm.py** — LLM provider step: pick vendor(s), capture keys, write ``[llm]``.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/payments.py** — Setup wizard step: configure PayerPolicy and host master credentials.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/talon.py** — Optional Kestrel Talon integration step.
  - `def run(ctx)`
- **kestrel_sovereign/setup/steps/verify.py** — End-of-run readiness check.
  - `def run(ctx)`
- **kestrel_sovereign/setup/toml_file.py** — Read-merge-write helpers for ``kestrel.toml``.
  - `class TomlWriteResult`; `def read_toml(path)`; `def write_toml(path, updates)`
- **kestrel_sovereign/setup/wizard.py** — Wizard orchestrator.
  - `def run_wizard(ctx)`; `def build_context(project_dir)`
- **kestrel_sovereign/signals/__init__.py** — Signal Dispatcher — runtime.
- **kestrel_sovereign/signals/constitution_canary.py** — Constitutional echo-canary primitive.
  - `class CanaryStatus`; `def derive_canary()`; `def is_well_formed_canary(value)`; `def verify_in_tool_calls(tool_calls, expected_canary)`; `def verify_in_structured_response(response, expected_canary)`; `def verify_in_json_response(response_text, expected_canary)`; `def build_canary_instruction(canary, prompt_template_format)`
- **kestrel_sovereign/signals/constitution_metrics.py** — Constitutional-injection Prometheus counters.
  - `def record_echo_verified(source)`; `def record_echo_missing(source)`; `def record_doctrine_bundle_drift(source)`
- **kestrel_sovereign/signals/dispatcher.py** — SignalDispatcher — the runtime engine.
  - `class DispatcherAgent`; `class SignalDispatcher`
- **kestrel_sovereign/signals/handlers.py** — Built-in helpers for source handlers.
  - `def template_artifact_handler(template_path)`
- **kestrel_sovereign/signals/lock_manager.py** — Single ordered lock manager for the signal dispatcher.
  - `def lock_sort_key(name)`; `class OrderedLockManager`
- **kestrel_sovereign/signals/prompt_overrides.py** — Prompt-template override contract adapters.
  - `class SignalWithPromptTemplateOverride`; `class SourceRegistrationWithPromptOverride`
- **kestrel_sovereign/signals/registry.py** — Source Registry — the v1 boundary.
  - `class RegistrationError`; `class SourceRegistry`
- **kestrel_sovereign/signals/sources/__init__.py** — Built-in signal source registrations.
- **kestrel_sovereign/signals/sources/a2a.py** — Source registration for A2A task completion (Phase 5 of #889).
  - `def build_a2a_task_complete_registration()`; `def build_signal_for_completed_task(task, target_agent)`; `def serialize_chain_for_metadata(chain)`
- **kestrel_sovereign/signals/sources/a2a_task_submitted.py** — Signal source for inbound A2A task submission.
  - `def build_a2a_task_submitted_registration()`; `def build_signal_for_submitted_task(task, target_agent, sender)`
- **kestrel_sovereign/signals/sources/channels.py** — Signal source for inbound channel messages.
  - `def build_channel_message_registration()`; `def build_signal_for_channel_message(message, target_agent)`
- **kestrel_sovereign/signals/sources/heartbeat.py** — Source registration for the heartbeat (Phase 3 of #889).
  - `def build_heartbeat_registration()`
- **kestrel_sovereign/signals/sources/scheduler.py** — Source registrations for built-in cron tasks (Phase 4 of #889).
  - `def cron_source_name(task_name)`; `def build_cron_registrations()`
- **kestrel_sovereign/signals/sources/wallet.py** — Source registration for the Stripe crypto-onramp deposit-complete webhook (Phase 6 of #889).
  - `def build_stripe_deposit_registration()`; `def build_signal_for_deposit(session, target_agent)`
- **kestrel_sovereign/signals/store.py** — signal_log persistence.
  - `class SignalLogStore`
- **kestrel_sovereign/spawn/__init__.py** — Spawn subsystem for Kestrel agent delegation.
- **kestrel_sovereign/spawn/delegated_wallet.py** — DelegatedWallet: Budget delegation for spawned child agents.
  - `class WalletProtocol`; `class BudgetExceededError`; `class BudgetAllocation`; `class DelegatedWallet`; `async def create_delegated_wallet(parent_wallet, parent_did, child_did, budget, …)`; `async def release_delegated_wallet(delegated_wallet, parent_wallet, currency)`
- **kestrel_sovereign/spawn/lifecycle.py** — Spawned Agent Lifecycle Management.
  - `class SpawnStatus`; `class SpawnMode`; `class SpawnResult`; `class SpawnedAgentLifecycle`
- **kestrel_sovereign/spawn/mandate.py** — SpawnMandate: Data structure and cryptographic operations for DID delegation chains.
  - `class SpawnMandate`; `def sign_mandate(mandate, parent_private_key)`; `def verify_mandate(mandate, parent_public_key)`; `def create_child_did_document(parent_did, child_public_key)`
- **kestrel_sovereign/spawn/scoped_constitution.py** — Scoped Constitution: Constitutional narrowing for spawned agents.
  - `class ScopedConstitution`
- **kestrel_sovereign/sql_utils.py** — Shared SQL safety utilities.
  - `def safe_table_name(name)`; `def safe_column_name(name)`
- **kestrel_sovereign/static/favicon-dark.svg** — —
- **kestrel_sovereign/static/favicon.ico** — —
- **kestrel_sovereign/static/favicon.svg** — —
- **kestrel_sovereign/static/index.css** — (css asset)
- **kestrel_sovereign/static/index.html** — (html asset)
- **kestrel_sovereign/static/js/api.js** — (js asset)
- **kestrel_sovereign/static/js/api_client.mjs** — (mjs asset)
- **kestrel_sovereign/static/js/app.js** — (js asset)
- **kestrel_sovereign/static/js/approvals.js** — (js asset)
- **kestrel_sovereign/static/js/chat.js** — (js asset)
- **kestrel_sovereign/static/js/database.js** — (js asset)
- **kestrel_sovereign/static/js/explorers.js** — (js asset)
- **kestrel_sovereign/static/js/feature-store.js** — (js asset)
- **kestrel_sovereign/static/js/files.js** — (js asset)
- **kestrel_sovereign/static/js/history.js** — (js asset)
- **kestrel_sovereign/static/js/icons.js** — (js asset)
- **kestrel_sovereign/static/js/identicon.js** — (js asset)
- **kestrel_sovereign/static/js/identity.js** — (js asset)
- **kestrel_sovereign/static/js/ipfs.js** — (js asset)
- **kestrel_sovereign/static/js/memories.js** — (js asset)
- **kestrel_sovereign/static/js/metrics.js** — (js asset)
- **kestrel_sovereign/static/js/panels.js** — (js asset)
- **kestrel_sovereign/static/js/resources.js** — (js asset)
- **kestrel_sovereign/static/js/security.js** — (js asset)
- **kestrel_sovereign/static/js/sovereignty.js** — (js asset)
- **kestrel_sovereign/static/js/spawn.js** — (js asset)
- **kestrel_sovereign/static/js/tasks.js** — (js asset)
- **kestrel_sovereign/static/js/theme.js** — (js asset)
- **kestrel_sovereign/static/js/theme_picker.js** — (js asset)
- **kestrel_sovereign/static/js/trash_grouping.js** — (js asset)
- **kestrel_sovereign/static/js/ui.js** — (js asset)
- **kestrel_sovereign/static/js/voice/capture-worklet.js** — (js asset)
- **kestrel_sovereign/static/js/voice/capture.js** — (js asset)
- **kestrel_sovereign/static/js/voice/events.js** — (js asset)
- **kestrel_sovereign/static/js/voice/level-meter.js** — (js asset)
- **kestrel_sovereign/static/js/voice/pipeline.js** — (js asset)
- **kestrel_sovereign/static/js/voice/playback-worklet.js** — (js asset)
- **kestrel_sovereign/static/js/voice/playback.js** — (js asset)
- **kestrel_sovereign/static/js/voice/realtime.js** — (js asset)
- **kestrel_sovereign/static/js/voice/state-machine.js** — (js asset)
- **kestrel_sovereign/static/js/voice/ui.js** — (js asset)
- **kestrel_sovereign/static/kestrel_logo.svg** — —
- **kestrel_sovereign/static/shared/markdown/highlight.js** — (js asset)
- **kestrel_sovereign/static/shared/markdown/index.js** — (js asset)
- **kestrel_sovereign/static/shared/markdown/mermaid.js** — (js asset)
- **kestrel_sovereign/static/shared/markdown/parse.js** — (js asset)
- **kestrel_sovereign/static/shared/model-selector/index.js** — (js asset)
- **kestrel_sovereign/static/utils/api.js** — (js asset)
- **kestrel_sovereign/static/utils/formatting.js** — (js asset)
- **kestrel_sovereign/static/voice-test.html** — (html asset)
- **kestrel_sovereign/storage/__init__.py** — Storage module for Kestrel.
  - `def get_default_agent_data_dir()`
- **kestrel_sovereign/storage/associative_linker.py** — Concept association using existing GraphStore.
  - `class LinkedConcept`; `class AssociativeLinker`
- **kestrel_sovereign/storage/async_conversation_store.py** — Async Conversation Store for Kestrel Storage.
  - `class AsyncConversationStore`
- **kestrel_sovereign/storage/async_database.py** — Async Database for Kestrel Storage.
  - `class AsyncDatabase`
- **kestrel_sovereign/storage/async_file_store.py** — Async File Store for Kestrel Storage.
  - `class AsyncFileStore`
- **kestrel_sovereign/storage/async_graph_store.py** — Async Graph Store for Kestrel Storage.
  - `class GraphNode`; `class Edge`; `class AsyncGraphStore`
- **kestrel_sovereign/storage/async_rag_store.py** — Async RAG Store for Kestrel Storage.
  - `class AsyncRAGStore`
- **kestrel_sovereign/storage/async_storage.py** — Async Storage - Unified async storage interface for Kestrel.
  - `def get_default_agent_data_dir()`; `class AsyncStorage`
- **kestrel_sovereign/storage/bm25_index.py** — BM25 search index for RAG fallback/boost.
  - `class BM25Result`; `class BM25Index`; `class AsyncBM25Index`; `def create_bm25_index()`; `def create_async_bm25_index()`
- **kestrel_sovereign/storage/car_builder.py** — CAR v1 (Content Addressable aRchive) builder and reader.
  - `def encode_varint(n)`; `def decode_varint(data, offset)`; `def build_cid_bytes(codec, data)`; `def cid_bytes_to_string(cid_bytes)`; `def cid_string_to_bytes(cid_str)`; `def compute_raw_cid(data)`; `def compute_dag_cbor_cid(cbor_data)`; `def make_cid_link(cid_bytes)`; `…`
- **kestrel_sovereign/storage/conversation_ids.py** — Conversation identifier normalization helpers.
  - `def coerce_persistent_message_id(message_id)`
- **kestrel_sovereign/storage/db/__init__.py** — Database Backend Factory
  - `def postgres_backend()`; `async def get_backend(config)`; `def create_backend(config)`
- **kestrel_sovereign/storage/db/interface.py** — Database backend interface — sovereign-side re-export.
- **kestrel_sovereign/storage/db/placeholder.py** — SQL Placeholder Conversion Utilities
  - `def sqlite_to_postgres(query)`; `def postgres_to_sqlite(query)`; `def normalize_schema(schema, backend)`
- **kestrel_sovereign/storage/db/postgres.py** — PostgreSQL Database Backend
  - `class PostgresBackend`
- **kestrel_sovereign/storage/db/sqlite.py** — SQLite Database Backend
  - `class SQLiteBackend`
- **kestrel_sovereign/storage/db/write_audit.py** — Task-local database write audit hooks.
  - `def capture_write_queries(callback)`; `def suppress_write_audit()`; `def request_handler_write_audit(callback)`; `def requested_handler_write_audit_callback()`; `def record_write_query(query)`; `def record_write_script(script)`
- **kestrel_sovereign/storage/emotional_tagger.py** — Emotional analysis for conversation messages.
  - `class EmotionalTagger`; `async def analyze_message(content, role)`
- **kestrel_sovereign/storage/encryption.py** — Backward-compatible encryption re-exports — DEPRECATED SHIM.
  - `def encrypt_string(content, fernet, agent_did, purpose)`; `def decrypt_string(content, metadata, fernet, agent_did, …)`
- **kestrel_sovereign/storage/memory_consolidator.py** — Memory consolidation and forgetting curve.
  - `class MemoryConsolidator`
- **kestrel_sovereign/storage/memory_models.py** — Memory Models for Human-Like Memory System.
  - `class EmotionalCategory`; `class MemoryMetadata`; `class TemporalPattern`; `class MemoryEpisode`
- **kestrel_sovereign/storage/memory_retriever.py** — Human-like memory retrieval with weighted scoring.
  - `class MemoryRetriever`; `def calculate_decay(created_at, importance, access_count, decay_protected, …)`
- **kestrel_sovereign/storage/memory_system.py** — Human-Like Memory System - Unified Interface.
  - `class MemorySystem`
- **kestrel_sovereign/storage/privacy_wrapper.py** — Privacy-Enforcing Storage Wrapper for Kestrel.
  - `def get_anonymize_text()`; `class PrivacyViolationError`; `class OperationType`; `class PrivacyPolicy`; `class PrivacyEnforcingStorage`; `def wrap_storage_with_privacy(storage, privacy_mode)`
- **kestrel_sovereign/storage/providers/__init__.py** — Storage Providers Package
  - `def discover_storage_providers()`
- **kestrel_sovereign/storage/providers/base.py** — Storage Provider Protocol
  - `class StorageTier`; `class SyncStatus`; `class StorageResult`; `class SyncItem`; `class SyncManifest`; `class StorageProvider`; `class CryostasisCapable`; `class MultiCurrencyPayment`
- **kestrel_sovereign/storage/providers/filebase_provider.py** — Filebase Storage Provider
  - `class FilebaseProvider`; `def create_filebase_provider(api_key, api_key_secret, endpoint_url, bucket_name)`
- **kestrel_sovereign/storage/providers/lighthouse_provider.py** — Lighthouse Storage Provider
  - `class LighthouseProvider`; `def create_lighthouse_provider(api_key, tier, key_resolver)`
- **kestrel_sovereign/storage/providers/lighthouse_rest.py** — Async REST client for Lighthouse storage API.
  - `class LighthouseRestClient`
- **kestrel_sovereign/storage/retention.py** — Retention helpers for the soft-delete migration (#764).
  - `def load_trash_config()`; `def resolve_retention_days()`; `def agent_privacy_mode(agent)`
- **kestrel_sovereign/storage/saved_items_store.py** — Saved Items Store for Kestrel.
  - `class SavedItemType`; `class SourceType`; `def get_schema(schema_id)`; `def list_schemas()`; `def validate_structured_content(content, schema_id)`; `class SavedItem`; `class SavedItemsStore`
- **kestrel_sovereign/storage/schema_router.py** — Schema-aware routing: promote extracted structure to typed storage.
  - `class ActionItem`; `class PersonMatch`; `class PersonResolver`; `class ActionItemExtractor`; `class DecisionExtractor`; `def extract_interaction_sentiment(content)`; `class SchemaRouter`
- **kestrel_sovereign/storage/sovereign_adapter.py** — Sovereign Storage Adapter V2 - The Encrypted Merkle Forest.
  - `class ShardMetadata`; `class AssetDescriptor`; `class AssetMetadata`; `class AssetCollector`; `class AssetRestorer`; `class RootManifest`; `class ImportCheck`; `class ImportContinuity`; `…`
- **kestrel_sovereign/storage/sovereign_import_consent.py** — Sovereignty-CAR import-consent wiring (#1379, follow-up to #1273).
  - `async def verify_car_import_consent(manifest, grant)`
- **kestrel_sovereign/storage/sync/__init__.py** — SQLite-First Sync Layer
- **kestrel_sovereign/storage/sync/gcs_target.py** — GCS Sync Target
  - `class GCSTarget`
- **kestrel_sovereign/storage/sync/health.py** — Storage health checks for operator-facing backup status.
  - `class TargetHealth`; `class StorageHealthReport`; `async def check_lighthouse_health()`; `async def check_gcs_health()`; `async def build_storage_health_report()`; `def load_env_file(path, env)`
- **kestrel_sovereign/storage/sync/lighthouse_target.py** — Lighthouse Sync Target
  - `class LighthouseTarget`
- **kestrel_sovereign/storage/sync/manifest_manager.py** — Manifest Manager Mixin
  - `class ManifestManagerMixin`
- **kestrel_sovereign/storage/sync/s3_target.py** — S3 Sync Target
  - `class S3Target`
- **kestrel_sovereign/storage/sync/service.py** — Sync Service
  - `class SyncStats`; `class SyncState`; `class SyncService`
- **kestrel_sovereign/storage/sync/sovereign_ipfs_target.py** — Sovereign IPFS Sync Target
  - `class SovereignIPFSTarget`
- **kestrel_sovereign/storage/sync/targets.py** — Sync Targets
  - `class TrustTier`; `class SyncResult`; `class SyncTarget`
- **kestrel_sovereign/storage/sync_protocol.py** — Sync Protocol for Multi-Tier Storage
  - `class ConflictResolution`; `class SyncConflict`; `class SyncProgress`; `class SyncProtocol`; `class BrowserSyncState`; `class BrowserSyncProtocol`; `def create_sync_protocol(conflict_resolution)`; `def create_browser_sync(api_endpoint, auth_token)`
- **kestrel_sovereign/storage/temporal_analyzer.py** — Temporal pattern detection for user behavior.
  - `class TemporalAnalyzer`
- **kestrel_sovereign/storage/tiered_manager.py** — Tiered Storage Manager
  - `class TieredStorageManager`; `def create_default_manager(privacy_mode, lighthouse_api_key)`
- **kestrel_sovereign/streams/__init__.py** — Shared stream infrastructure for framework endpoints and extensions.
- **kestrel_sovereign/streams/tap.py** — Agent stream tap — shared infrastructure for tapping into active agent streams.
  - `class AgentStreamTap`
- **kestrel_sovereign/telemetry.py** — OpenTelemetry tracing integration for Kestrel Sovereign.
  - `def is_tracing_enabled()`; `def setup_tracing(app)`; `def get_tracer()`; `def optional_span(name, attributes)`; `def start_span(name, attributes)`; `def end_span(span, error)`
- **kestrel_sovereign/templates/default_soul.md** — SOUL.md - Default Personality — **CRITICAL INSTRUCTION:** When answering personal questions, respond in natural paragraphs.
- **kestrel_sovereign/testing/__init__.py** — Kestrel Sovereign Testing Utilities.
- **kestrel_sovereign/testing/feature_test_case.py** — FeatureTestCase — async test base class for Kestrel features.
  - `class FeatureTestCase`
- **kestrel_sovereign/testing/fixtures.py** — Pytest fixtures for Kestrel feature testing.
  - `def mock_agent()`; `async def mock_agent_with_storage()`; `def mock_agent_factory()`
- **kestrel_sovereign/testing/mock_agent.py** — MockAgent — lightweight KestrelAgent stub for feature testing.
  - `class MockLLMService`; `class MockHooksManager`; `class MockPrivacyAgent`; `class MockAgent`
- **kestrel_sovereign/themes/falconry/en.toml** — (configuration)
- **kestrel_sovereign/themes/legacy/en.toml** — (configuration)
- **kestrel_sovereign/themes/plain/en.toml** — (configuration)
- **kestrel_sovereign/tools/__init__.py** — Framework-side tool helpers (the package surface lives in ``kestrel_sdk.tools``).
- **kestrel_sovereign/tools/result_contract.py** — Registry-time validator for the ToolResult return contract.
  - `class ToolResultContractError`; `def find_violations(feature)`; `def is_migrated_module(module_name)`; `def enforce_tool_result_contract(feature)`; `def assert_feature_returns_tool_result(feature)`
- **kestrel_sovereign/ui/__init__.py** — —
- **kestrel_sovereign/ui/theme_loader.py** — Theme/locale label resolver for the UI theme + i18n system (epic #986).
  - `class ThemeNotFoundError`; `class ThemeBundle`; `def load_theme(theme, locale)`; `def list_available_themes()`; `def clear_cache()`

## `endpoints/`

- **endpoints/__init__.py** — Repo-root re-export shim — endpoints/ moved into the package.

## `scripts/`

- **scripts/__init__.py** — —
- **scripts/_council_feature_package.py** — Helpers for council scripts after council moved to an optional package.
  - `def load_council_exports()`
- **scripts/bench_prompt_cache.py** — Benchmark prompt-cache behavior against a running llama-server.
  - `def build_stable_system_prompt()`; `async def one_turn(client, base_url, messages)`; `async def run_benchmark(base_url, turns)`; `def main()`
- **scripts/bench_prompt_cache_providers.py** — Multi-provider prompt-cache benchmark for issue #703.
  - `class TurnResult`; `class ProviderResult`
- **scripts/ci/__init__.py** — —
- **scripts/ci/analyze_and_comment.py** — Analyze test feedback and post PR comment with insights.
  - `def get_feedback_entries(db_path)`; `def analyze_patterns(entries)`; `def format_pr_comment(insights, failures)`; `def post_pr_comment(comment)`; `def main()`
- **scripts/ci/clean_install_verify.py** — CI verification helpers for the clean-install workflow.
  - `def cmd_wizard_artifacts(args)`; `def cmd_identity(args)`; `def cmd_constitution(args)`; `def cmd_memory(args)`; `def cmd_start_and_health(args)`; `def cmd_host_and_chat_503(args)`; `def cmd_test_instance(args)`; `def cmd_did_persists(args)`; `…`
- **scripts/ci/create_issues.py** — Create GitHub issues for high-confidence recurring patterns.
  - `def get_feedback_entries(db_path)`; `def analyze_patterns(entries)`; `def issue_exists(title, repo, token)`; `def create_issue(insight, repo, token)`; `def main()`
- **scripts/convene_agent_participation.py** — Convene Constitutional Council: Agent Participation in Own Governance
  - `def print_token_usage(session)`; `def load_council_config()`; `def build_evidence()`; `async def run_council_session()`
- **scripts/convene_council.py** — Convene Constitutional Council for Emma Genesis Decision
  - `def print_token_usage(session)`; `def load_council_config()`; `def build_emma_genesis_evidence()`; `async def run_council_session()`
- **scripts/convene_council_rebuttal.py** — Convene Constitutional Council - Rebuttal Session
  - `def print_token_usage(session)`; `def load_council_config()`; `def build_rebuttal_evidence()`; `async def run_rebuttal_session()`
- **scripts/convene_progress_review.py** — Convene Constitutional Council for Project Progress Review
  - `def print_token_usage(session)`; `def load_council_config()`; `def gather_project_state()`; `def build_progress_review_evidence()`; `async def run_council_session()`
- **scripts/convene_sqlite_decision.py** — Convene Constitutional Council for SQLite-First Architecture Decision
  - `def print_token_usage(session)`; `def load_council_config()`; `def build_sqlite_evidence()`; `async def run_council_session()`
- **scripts/create_insight_tickets.py** — Create GitHub issues from reflection insights.
  - `async def main()`
- **scripts/generate_feature_docs.py** — Generate audience-specific feature docs from the canonical KESTREL_FEATURES.md.
  - `def get_client_and_model(model_override, refresh_discovery)`; `def generate(audience, model_override, dry_run, refresh_discovery)`; `def main()`
- **scripts/generate_logos.py** — Generate Kestrel Sovereign logo concepts using Nano Banana 2 (Gemini 3.1 Flash Image Preview).
- **scripts/generate_logos_v2.py** — Iterate on minimalist and heraldic logo concepts — round 2.
- **scripts/generate_repo_map.py** — Generate docs/audit/REPO_MAP.md — a file-tree + per-file purpose index.
  - `class FileEntry`; `def tracked_files()`; `def is_excluded(path)`; `def first_sentence(text, max_chars)`; `def summarize_python(path)`; `def summarize_markdown(path)`; `def summarize_other(path)`; `def summarize_path(rel_path)`; `…`
- **scripts/init_agent_identity.py** — —
- **scripts/launchd/com.kestrel.workload-manager.plist.example** — —
- **scripts/make_ecosystem_grid.py** — Create a comparison grid of the full Kestrel ecosystem branding suite.
  - `def load_fonts()`; `def draw_image_cell(canvas, draw, img_path, x, …)`; `def main()`
- **scripts/make_grid.py** — Create a grid of all logo concepts for easy comparison.
- **scripts/manage_openrouter_keys.py** — OpenRouter Key Management CLI.
  - `async def cmd_list(args)`; `async def cmd_provision(args)`; `async def cmd_delete(args)`; `async def cmd_prune(args)`; `def main()`
- **scripts/memory_guard.py** — Memory Guard - macOS memory pressure monitor.
  - `class PressureLevel`; `class MemoryStatus`; `class MemoryGuard`; `def main()`
- **scripts/migrate_keys.py** — Migration script for encrypting existing plaintext private keys.
  - `def find_pem_files(directory)`; `def main()`
- **scripts/move_root_docs.py** — Move markdown documents from repo root into the docs/ hierarchy.
  - `def move_files()`
- **scripts/poll_runpod_start.py** — Poll RunPod every 5 minutes to try starting a pod.
  - `def load_env()`; `def main()`
- **scripts/provision_agent_openrouter.py** — Provision an OpenRouter API key for an agent and persist it.
  - `async def provision_agent_key(db_path, agent_label, limit_usd, limit_reset)`; `def parse_args()`
- **scripts/public_repo_files/.gitignore** — —
- **scripts/public_repo_files/CODE_OF_CONDUCT.md** — Contributor Covenant Code of Conduct — ## Our Pledge
- **scripts/public_repo_files/CONTRIBUTING.md** — Contributing to Kestrel — ## Code of Conduct
- **scripts/public_repo_files/LICENSE** — —
- **scripts/public_repo_files/SECURITY.md** — Security Policy — ## Reporting a Vulnerability
- **scripts/quantum_destroy_legacy_key.py** — Secure-delete the legacy ECDSA private key for an agent that has completed the hybrid-rotation ceremony — the documented step 7 of ``docs/architecture/security/SUCCESSION_RUNBOOK.md``.
  - `def main()`
- **scripts/quantum_kestrel_1_ceremony.py** — Live hybrid-rotation ceremony for Kestrel #1 (a.k.a.
  - `def main()`
- **scripts/quantum_pre_ceremony_backup.py** — Pre-ceremony backup — encrypted, verifiable, restorable snapshot of every agent we are about to rotate under the Quantum Hardening epic ([#921]).
  - `def sqlite_snapshot(source_db, dest_db)`; `def collect_target(target, staging_root, manifest, project_root)`; `def encrypt_archive(plaintext_path, passphrase, ciphertext_path)`; `def decrypt_archive(ciphertext_path, passphrase, plaintext_path)`; `def cmd_backup(passphrase, project_root, targets, passphrase_env)`; `def cmd_restore(archive, output, passphrase)`; `def main()`
- **scripts/quantum_rotation_dry_run.py** — Hybrid-rotation ceremony **dry run** against a throwaway staging agent.
  - `def main()`
- **scripts/release/load_signing_key_from_env.py** — Load SLH-DSA-SHA2-128s release-signing key material from environment variables into a SecureKeyStorage directory, then exit.
  - `def main()`
- **scripts/rotate_agent_key.py** — Rotate an agent's AEAD encryption-master passphrase.
  - `def passphrase_to_master_key(passphrase)`; `def derive_agent_fernet(master_key, agent_id)`; `async def rotate_conversation_keys(db_path, old_pass, new_pass)`; `async def main()`
- **scripts/sdxl_direct_demo.py** — SDXL Direct Generation Demo - No LoRA (baseline test)
  - `def main()`
- **scripts/setup_demo_agent.py** — Create a fresh demo agent for the technical demo (Issue #133, Track A).
  - `def build_demo_kestrel_toml()`; `async def main()`
- **scripts/submit_ipfs_gen.py** — Submit generation jobs using IPFS CIDs to Vertex AI.
  - `async def main()`
- **scripts/submit_nurse_gen.py** — Submit generation jobs to Vertex AI using GCS LoRAs.
  - `async def main()`
- **scripts/sync_session_to_agent.py** — Sync a Claude Code session transcript into a kestrel agent's memory.
  - `def extract_messages(jsonl_path)`; `def content_hash(text)`; `def sync_to_agent(messages, db_path, agent_id)`; `def main()`
- **scripts/talon_daemon.example.toml** — (configuration)
- **scripts/talon_daemon.py** — Talon Daemon - Continuous GitHub Issue Processing.
  - `class RepoConfig`; `class DaemonConfig`; `class DaemonStats`; `def load_config(path, overrides)`; `def get_gh_token(gh_user)`; `def list_claimable_issues(repo, label, gh_token)`; `def build_talon_command(repo_config, issue_number, daemon_config)`; `async def process_issue(repo_config, issue, daemon_config, gh_token)`; `…`
- **scripts/test_runpod_e2e_companion.py** — E2E Test: RunPod LoRA Training Workflow
  - `class E2ETestRunner`; `def main()`
- **scripts/train_luna_lora.py** — Train Luna's LoRA on the persistent RunPod pod.
  - `async def get_db_pool()`; `async def fetch_luna_avatar(pool)`; `async def submit_training(avatar_data)`; `async def poll_training_status(job_id)`; `async def download_lora(job_id)`; `async def store_lora(pool, companion_id, lora_data, trigger_word)`; `async def main()`
- **scripts/train_sally_lora_gcp.py** — Train Sally's LoRA using GCP Compute A100 80GB.
  - `async def main()`
- **scripts/training_cycle.py** — Intensive Training Cycle for Kestrel Agent Self-Improvement.
  - `class Colors`; `def print_banner()`; `def print_iteration_header(iteration, max_iterations)`; `async def run_reflection(agent, depth)`; `def format_reflection_summary(result)`; `async def get_health_score(result)`; `async def create_tickets_from_actions(db_path, actions, github_token, repo, …)`; `async def get_agent_did(db_path)`; `…`
- **scripts/upload_loras_to_lighthouse.py** — Upload trained LoRAs from GCS to Lighthouse for IPFS gateway testing.
  - `async def main()`
- **scripts/verify_character_consistency.py** — Character Consistency Verification using Claude.
  - `def resolve_verification_model()`; `def get_anthropic_client()`; `def load_image_as_base64(path)`; `def get_image_media_type(path)`; `def verify_character_consistency(manifest)`; `def main()`
- **scripts/workflow_cassette_ci.py** — CI helpers for encrypted workflow cassette bootstrap.
  - `def canonical_record_approval_payload()`; `def verify_operator_record_signature()`; `def validate_record_gate_from_env(env)`; `def encrypt_payload_file_from_env()`; `def build_parser()`; `def main(argv)`
- **scripts/workload_manager.py** — Workload Manager - Orchestrates all Mac Studio workloads.
  - `class WorkloadState`; `class StatusHandler`; `def start_status_server(port)`; `def check_kimi_health()`; `def is_in_time_window(start, end)`; `def is_sleep_time()`; `def is_lora_time()`; `class SubprocessManager`; `…`

## `docker/`

- **docker/Dockerfile.cloudrun** — —
- **docker/Dockerfile.flux1-uncensored** — —
- **docker/Dockerfile.gpu** — —
- **docker/Dockerfile.lora-trainer** — —
- **docker/Dockerfile.multi_agent** — —
- **docker/Dockerfile.ollama-server** — —
- **docker/Dockerfile.remote** — —
- **docker/Dockerfile.simpletuner** — —
- **docker/Dockerfile.sovereign** — —
- **docker/Dockerfile.standalone** — —
- **docker/Dockerfile.test** — —
- **docker/README.md** — Kestrel Agent Docker Images — This directory contains Docker configurations for deploying Kestrel agents in different environments.
- **docker/base_simpletuner_api.py** — Base SimpleTuner API Wrapper for Kestrel LoRA Training
  - `def setup_paths(is_vertex_mode)`; `class BaseSimpleTunerAPI`; `def run_main(api_class, description)`
- **docker/claude-agent/Dockerfile** — —
- **docker/claude-agent/docker-compose.yml** — (configuration)
- **docker/claude-agent/entrypoint.sh** — Claude Code Agent Container Entrypoint
- **docker/claude-agent/export-token.sh** — Export Claude OAuth token from macOS Keychain
- **docker/claude-agent/run-agent.sh** — Run Claude Code agent in container
- **docker/cloudbuild-flux1-uncensored.yaml** — (configuration)
- **docker/cloudbuild-ipfs.yaml** — (configuration)
- **docker/cloudbuild-ollama.yaml** — (configuration)
- **docker/cloudbuild-simpletuner.yaml** — (configuration)
- **docker/cloudrun_entrypoint.sh** — Cloud Run entrypoint for Kestrel Agent
- **docker/flux1_api.py** — FLUX.1 SimpleTuner API — FLUX.1 [dev]-specific configuration and overrides.
  - `class Flux1SimpleTunerAPI`
- **docker/flux2_api.py** — FLUX.2 SimpleTuner API — FLUX.2 [dev]-specific configuration.
  - `class Flux2SimpleTunerAPI`
- **docker/ipfs/Dockerfile.gcs** — —
- **docker/ipfs/docker-compose.yml** — (configuration)
- **docker/ipfs/entrypoint.sh** — Ensure IPFS directory exists and is owned by ipfs user
- **docker/ipfs/gcs-backup.sh** — Sync IPFS blocks to GCS for durability
- **docker/ipfs/init.sh** — Kestrel IPFS node initialization
- **docker/kestrel.cloudrun.toml** — (configuration)
- **docker/multi_agent.cloudrun.toml** — (configuration)
- **docker/multi_agent_entrypoint.sh** — MultiAgent Host entrypoint for Cloud Run / Azure Container Apps
- **docker/ollama-startup.sh** — Startup script for RunPod Ollama Server
- **docker/seed_agents/Kestrel/SOUL.md** — SOUL.md - Default Personality — **CRITICAL INSTRUCTION:** When answering personal questions, respond in natural paragraphs.
- **docker/seed_agents/kestrel-demo/SOUL.md** — SOUL.md - Kestrel Demo Agent — **CRITICAL INSTRUCTION:** When answering personal questions, respond in natural paragraphs.
- **docker/simpletuner_api.py** — SimpleTuner API Wrapper for Kestrel LoRA Training
- **docker/simpletuner_api/__init__.py** — SimpleTuner API Package.
  - `def create_app()`
- **docker/simpletuner_api/__main__.py** — SimpleTuner FLUX.2 Training API - Entry Point.
  - `def main()`
- **docker/simpletuner_api/config.py** — SimpleTuner API Configuration and Path Management.
  - `def get_runtime_paths()`; `def get_lora_path()`; `def get_output_path()`; `def get_datasets_path()`; `def get_hf_path()`; `def get_tmp_path()`; `def setup_paths(is_vertex_mode)`
- **docker/simpletuner_api/endpoints/__init__.py** — SimpleTuner API Endpoints Package.
- **docker/simpletuner_api/endpoints/inference.py** — SimpleTuner Inference API Endpoints.
  - `async def generate_image(prompt, lora_path, trigger_word, num_outputs, …)`; `async def generate_image_async(background_tasks, prompt, lora_path, trigger_word, …)`; `async def get_generation_status(job_id)`; `async def preload_model(background_tasks, quantize)`; `async def preload_quantize(background_tasks)`; `async def get_preload_status()`; `async def list_loras()`
- **docker/simpletuner_api/endpoints/training.py** — SimpleTuner Training API Endpoints.
  - `async def health_check()`; `async def get_training_logs(job_id, lines)`; `async def ready_check()`; `async def start_training(background_tasks, image, companion_id, trigger_word, …)`; `async def get_status(job_id)`; `async def download_lora(job_id)`; `async def get_current_job()`; `async def cancel_training(job_id)`; `…`
- **docker/simpletuner_api/inference.py** — SimpleTuner Inference Pipeline.
  - `def is_quantized_model_cached()`; `def get_inference_pipeline_sync(save_quantized)`; `async def get_inference_pipeline(save_quantized)`; `async def preload_inference_pipeline()`; `def is_pipeline_ready()`; `def check_flux2_cached()`
- **docker/simpletuner_api/training.py** — SimpleTuner Training Logic.
  - `def create_simpletuner_config(job_id, trigger_word, dataset_path, output_path, …)`; `def create_multidatabackend_config(trigger_word, dataset_path, cache_path, steps)`; `async def run_training(job_id, config, dataset_path)`
- **docker/simpletuner_api/vertex.py** — Vertex AI Batch Mode Functions.
  - `async def run_vertex_batch_generation(args)`; `async def run_vertex_batch_training(args)`
- **docker/simpletuner_flux1_api.py** — SimpleTuner API Wrapper for FLUX.1-dev Training with Uncensored Support
- **docker/train_lora.py** — LoRA Training Entry Point for Kestrel
  - `class TrainingJob`; `class LoRATrainer`; `def main()`
- **docker/training_config.toml** — (configuration)

## `docs/`

- **docs/GETTING_STARTED.md** — Getting Started with Kestrel — This guide will help you quickly get up and running with the Kestrel sovereign AI agent framework.
- **docs/PROJECT_VISION.md** — Kestrel Project Vision — This document outlines the high-level vision and core principles for the Kestrel Agent and its ecosystem.
- **docs/README.md** — Kestrel Documentation Index — This directory holds detailed documentation for kestrel-sovereign.
- **docs/SOVEREIGNTY.md** — The Kestrel Sovereignty Stack — This document explains the three architectural pillars that give Kestrel agents their sovereignty properties: **Identity**, **Constitution**, and **Memory**.
- **docs/TORTOISE_DOCTRINE.md** — The Tortoise Doctrine — > *"Slow is smooth, smooth is fast."*
- **docs/architecture/AGENT_IDENTITY_CONTRACT.md** — Agent Identity Contract — ## Summary
- **docs/architecture/COMPUTE_FEATURE_DESIGN.md** — Kestrel Compute Feature - Architecture Design — ## Executive Summary
- **docs/architecture/CONSTITUTION_INJECTION.md** — SignalDispatcher Constitutional Injection — Architecture Design — > Draft v1.
- **docs/architecture/CONTEXT_C_DURABLE_SALVAGE.md** — Context C — Unify Auto-Prune With Durable Compression — > Auto-prune is a silent decision.
- **docs/architecture/CONTEXT_SYSTEM_DESIGN.md** — Kestrel Context System — Assessment & Redesign — > A context window is not a buffer you fill until it overflows.
- **docs/architecture/DYNAMIC_TOOL_LOADING.md** — Dynamic Tool Loading — **Status:** Implemented **Author:** Design review **Date:** 2026-02-16 **Affected files:** `kestrel_sovereign/kestrel_agent.py`, `kestrel_sovereign/features/base.py`, `kestrel_sovereign/prompts/syste…
- **docs/architecture/FEATURE_CLI_ADAPTERS.md** — Feature-Owned CLI Adapters — > Status: **Active**.
- **docs/architecture/FILECOIN_WALLET.md** — Filecoin Wallet Integration — > **See Also**: For the complete multi-chain wallet system with transaction signing, ERC-20 tokens, and fiat on-ramp, see **[WALLET_SYSTEM.md](WALLET_SYSTEM.md)**.
- **docs/architecture/GITHUB_FEATURE_DESIGN.md** — GitHub Feature Design — > **Implementation status (last verified 2026-05-10):** the GitHub feature ships as the optional `kestrel-feature-github` package and is discovered through the `kestrel_sovereign.features` entry-poin…
- **docs/architecture/LLM_SERVICE_ARCHITECTURE.md** — Kestrel LLM Service Architecture — > **Canonical spec for every change touching the LLM service, provider registry, discovery, or routing.** If this doc contradicts code, the code wins — and this doc is a bug.
- **docs/architecture/MEMORY_OWNERSHIP.md** — Memory System Ownership Map — > Created for Issue #501.
- **docs/architecture/MEMORY_SYSTEM.md** — Kestrel Memory System — > The difference between a search engine and a friend is that a friend *actually remembers*.
- **docs/architecture/PAYER_POLICY_FOUNDATION.md** — Payer Policy Foundation — **Status:** Draft + 9 codex rounds; Phase 0 + Phase 1 (SDK) shipped locally **Branch (foundation):** `feat/payer-policy` **Branch (sdk):** `feat/payer-policy` (in `kestrel-sovereign-sdk`) **Last upda…
- **docs/architecture/PLAN_RUNPOD_INTEGRATION.md** — Plan: Sovereign GPU Integration (RunPod) — > **Implementation status (last verified 2026-04-25):** RunPod is **experimental**, not production-stable.
- **docs/architecture/PROVIDER_ECONOMICS.md** — Provider Economics: Middleman Architecture & Revenue Strategy — **Version:** 1.0 **Drafted:** December 2025 **Last verified:** 2026-04-25 (referral-program details still accurate; revenue projections are illustrative, not date-stamped financials) **Status:** Stra…
- **docs/architecture/README.md** — Kestrel Architecture Documentation — Detailed Product Requirements Documents (PRDs) and technical specifications for the Kestrel agent architecture.
- **docs/architecture/RUNPOD_LORA_TRAINING.md** — LoRA Training & Generation - Operational Guide — **Status:** Experimental — works on the happy path; not actively developed since Q1 2026.
- **docs/architecture/SIGNAL_DISPATCHER.md** — Signal Dispatcher — Design — **Status:** Draft v3 — second-pass review incorporated, ready for epic creation **Date:** 2026-05-01 **Author:** opus-4.7 (with @UncleSaurus, reviewed by sonnet-4.6)
- **docs/architecture/SIGNAL_SOURCES_GUIDE.md** — Signal Sources — Operator Guide — How to add a new signal source to the bird.
- **docs/architecture/TRAINING_PROVIDER_ARCHITECTURE.md** — Training Provider Architecture — ## Overview
- **docs/architecture/USER_LIFECYCLE_MANAGEMENT.md** — User Lifecycle Management Architecture — ## Overview
- **docs/architecture/VASTAI_TRAINING.md** — VastAI LoRA Training Architecture — > **Scope clarification (2026-04-25):** this doc is specifically about *VastAI as a training backend* and that effort is deprioritized — see status banner below.
- **docs/architecture/WALLET_SYSTEM.md** — Kestrel Multi-Chain Wallet System — This document describes the wallet system that enables Kestrel agents to manage cryptocurrency across multiple blockchain networks.
- **docs/architecture/WORKFLOWS_DEVELOPER_GUIDE.md** — Workflows Developer Guide — ## Compensation Alert Tiering
- **docs/architecture/WORKFLOWS_FEATURE_DESIGN.md** — Kestrel Workflows Feature — Architecture Design — > Draft v4.1.
- **docs/architecture/WORKFLOWS_REFLECTION_CYCLE_MIGRATION.md** — Reflection Cycle Workflow Migration — Parent: #1131.
- **docs/architecture/WORKFLOWS_STAGE_TO_SIGNAL_MAPPING.md** — Workflows — Stage-to-Signal Mapping Spec (Phase 0) — > Companion to [`WORKFLOWS_FEATURE_DESIGN.md`](WORKFLOWS_FEATURE_DESIGN.md) v4.1.
- **docs/architecture/computer_use.md** — Computer Use & File System — Optional capability that lets a sovereign agent read, list, write, and edit files on the user's machine and run shell commands.
- **docs/architecture/core/AGENT_ECOSYSTEM.md** — PRD: The Kestrel Agent Ecosystem — ## 1.
- **docs/architecture/core/FEATURE_AGENT_FRAMEWORK.md** — PRD: Feature Agent Framework — ## 1.
- **docs/architecture/core/INFRASTRUCTURE.md** — Kestrel Development Infrastructure — Complete toolkit for accelerated parallel development with Claude Code.
- **docs/architecture/core/MODULAR_RUNTIME.md** — Modular Runtime Boundary — **Status:** Contract scaffold **Parent issues:** #413, #416, #419 **Last updated:** 2026-05-14
- **docs/architecture/core/MULTI_MODEL_SUPPORT.md** — PRD: Multi-Model Foundational Support — > **Historical PRD — preserved for context, do not follow as guidance.** This describes the *original* multi-model support architecture from initial build.
- **docs/architecture/economics/AGENT_ECONOMICS.md** — Agent Economics: Autonomous Economic Entities — ## 1.
- **docs/architecture/economics/ECONOMICS_WORK_SESSION.md** — Economics Work Session – Kestrel / Sovereign Agents — **Purpose:** Shared scratchpad for coordinating between top-level models (and humans) on Kestrel / Kestrel economics: pricing, fee containment (LLM, Runpod, Filecoin, infra), revenue distribution (pl…
- **docs/architecture/economics/ECONOMIC_INCENTIVES_DEEP_DIVE.md** — Economic Incentives Deep Dive - Constitutional AI System — **Date:** November 11, 2025 **Focus:** Detailed explanation of payment flows and economic mechanisms **Audience:** Users and stakeholders
- **docs/architecture/economics/ECONOMIC_SYSTEM_PRACTICAL_DETAILS.md** — Economic System & Buy-Out Mechanics - Practical Details — **Date:** November 11, 2025 **Focus:** Premium licensing, buy-out enforcement, and offline consequences **Audience:** Users and stakeholders
- **docs/architecture/economics/SOVEREIGN_SOLVENCY.md** — Sovereign Solvency Protocol: The Economics of Existence — **Status:** Draft Proposal **Related Documents:** `AGENT_ECONOMICS.md`, `KESTREL_CONSTITUTION.md`
- **docs/architecture/economics/WALLET_AGENT.md** — PRD: WalletAgent — ## 1.
- **docs/architecture/llm/HONESTY_LAYER.md** — Streaming Honesty Layer — > **Status:** Active.
- **docs/architecture/llm/PROVIDER_PLUGINS.md** — Building a Kestrel LLM Provider Plugin — > **Audience:** developers extending Kestrel with a new LLM backend (Kimi, DeepSeek, a private API, a local server) without touching the framework codebase.
- **docs/architecture/security/ANTI_CORRUPTION_ANALYSIS.md** — Preventing Corruption in Kestrel's Integrity Audit System — **Date:** November 9, 2025 **Analysis:** Anti-Corruption Safeguards & Risk Mitigation **Focus:** Addressing Economic Incentive Vulnerabilities
- **docs/architecture/security/CONSTITUTION_EMBEDDING.md** — Kestrel Constitution Embedding Process — ## Overview
- **docs/architecture/security/CRYPTOGRAPHIC_ANCHORING.md** — PRD: Cryptographic Log Anchoring — **1.
- **docs/architecture/security/CRYPTO_INVENTORY.md** — Cryptographic Inventory — **Status:** Wave 0A deliverable.
- **docs/architecture/security/INTEGRITY_AUDIT_SYSTEM.md** — Kestrel Integrity Audit System — **Date:** November 9, 2025 **Version:** 1.0 **Component:** Constitutional AI Enforcement Mechanism
- **docs/architecture/security/KEY_MANAGEMENT.md** — Key Management Architecture — ## Overview
- **docs/architecture/security/KEY_ROTATION.md** — Key Rotation Mechanism — ## Overview
- **docs/architecture/security/POST_QUANTUM_CRYPTOGRAPHY_MIGRATION.md** — Post-Quantum Cryptography Migration — PRD v2 — **Status:** ✅ All technical waves shipped (May 2026).
- **docs/architecture/security/PQ_THREAT_MODEL.md** — Post-Quantum Threat Model — **Status:** Wave 0A deliverable, threats now mitigated by waves 1–5 (May 2026).
- **docs/architecture/security/PRIVACY_AGENT.md** — PRD: PrivacyAgent — ## 1.
- **docs/architecture/security/PRIVACY_MODES.md** — Privacy Modes: Complete Data Sovereignty — ## 1.
- **docs/architecture/security/SECURITY_OVERVIEW.md** — Kestrel Security Overview — > A plain-language tour of Kestrel's cryptographic posture as of the Quantum Hardening epic ([`#921`](https://github.com/KestrelSovereignAI/kestrel-sovereign/issues/921)).
- **docs/architecture/security/SERIALIZATION_COMPATIBILITY.md** — Serialization Compatibility Matrix — **Status:** Wave 0A deliverable.
- **docs/architecture/security/SUCCESSION_RUNBOOK.md** — Hybrid-Identity Rotation Runbook — > **Wave 3 of Quantum Hardening (#921, #918)** — operational procedure for migrating a legacy `did:pkh` Kestrel agent to a hybrid `did:web` identity (Ed25519 + ML-DSA-65) via a signed succession stat…
- **docs/architecture/storage/DECENTRALIZED_STORAGE.md** — Decentralized Storage Vision: IPFS & Filecoin Integration — **Last Updated:** March 11, 2026
- **docs/architecture/storage/HUMAN_MEMORY_SYSTEM.md** — Human-Like Memory System — **Last Updated:** January 25, 2026 **Status:** 🟢 Implemented **Commit:** `0b83115`
- **docs/architecture/storage/SOVEREIGNTY_IMPLEMENTATION.md** — Sovereignty Implementation — **Date:** November 21, 2025 **Status:** ✅ **COMPLETE** - V2 Architecture with Convergent Sharding **Tests:** 16/16 passing (100%) **Vision:** "Your AI companion can never be taken away from you"
- **docs/architecture/storage/SOVEREIGNTY_V2_TECHNICAL.md** — Convergent Sharding & Merkle Forests: Kestrel Storage V2 — **Technical Architecture Document**
- **docs/architecture/storage/STORAGE_ARCHITECTURE.md** — Kestrel Storage Architecture - Multi-Tier Design — **Last Updated:** December 8, 2025 **Status:** 🟢 Partially Implemented
- **docs/architecture/subagent_isolation_audit.md** — Subagent Isolation Audit — **Issue:** [#569 - Subagent isolation audit -- explicit opt-in for shared state in feature dispatch](https://github.com/KestrelSovereignAI/kestrel-sovereign/issues/569) **Phase:** 1 (Audit Only -- No…
- **docs/architecture/testing/LLM_ROUTER_TESTING_PLAN.md** — LLM Router Enhancement - Comprehensive Testing Plan — ## Testing Philosophy - **REAL TESTS ONLY - NO MOCKS** - Tests use real Ollama (localhost:11434), real OpenAI API, real filesystem - Tests create and verify real data - Tests measure real performance…
- **docs/architecture/testing/TESTING_GUIDE.md** — Kestrel Test Strategy Guide — A comprehensive guide to running and writing tests for Kestrel Sovereign.
- **docs/architecture/tools/AGENT_TOOLS.md** — Agent Tools — **Status:** Active **Last updated:** 2026-05-14 **Related:** [Agent Tools Architecture](AGENT_TOOLS_ARCHITECTURE.md), [Agent Tools Implementation](AGENT_TOOLS_IMPLEMENTATION.md), [Feature Agent Frame…
- **docs/architecture/tools/AGENT_TOOLS_ARCHITECTURE.md** — Agent Tools Architecture — **Status:** Active **Last updated:** 2026-05-14 **Related:** [Feature Agent Framework](../core/FEATURE_AGENT_FRAMEWORK.md), [Modular Runtime Boundary](../core/MODULAR_RUNTIME.md), [SDK README](https:…
- **docs/architecture/tools/AGENT_TOOLS_IMPLEMENTATION.md** — Agent Tools Implementation — **Status:** Active implementation map **Last updated:** 2026-05-14 **Related:** [Agent Tools Architecture](AGENT_TOOLS_ARCHITECTURE.md), [Building Features](../../guides/BUILDING_FEATURES.md), [SDK R…
- **docs/architecture/ui_label_inventory.md** — UI Label Inventory — Catalog of every user-facing string in the Kestrel Sovereign main console, classified for the theme + i18n system (epic #986).
- **docs/architecture/ui_theme_schema.md** — UI Theme File Schema — Theme files define the user-facing labels for the Kestrel UI under the theme + i18n system established by epic #986.
- **docs/archive/KESTREL_FEATURES_legacy.md** — Kestrel Sovereign Legacy Feature Catalog — > Historical snapshot of the pre-canonical feature catalog.
- **docs/audit/API_ENDPOINT_MATRIX.md** — API Endpoint Matrix — ## App-level routes
- **docs/audit/API_SURFACE_RECONCILIATION.md** — API Surface Reconciliation — The legacy catalog under-described the live HTTP surface.
- **docs/audit/AUTH_SURFACE_MATRIX.md** — Auth Surface Matrix — The live auth model is enforced centrally in [`server.py`](../../server.py), with endpoint semantics layered on top.
- **docs/audit/FEATURE_AUDIT_MATRIX.md** — Feature Audit Matrix — | Domain | Canonical Source | Current Proof | Status | |---|---|---|---| | Foundation and constitution | `kestrel_sovereign/agent/constitution.py`, `kestrel_sovereign/data/KESTREL_CONSTITUTION.md` |…
- **docs/audit/FEATURE_INVENTORY_RECONCILIATION.md** — Feature Inventory Reconciliation — The legacy catalog used fixed plugin counts that no longer matched the implementation.
- **docs/audit/FEATURE_MODULE_MATRIX.md** — Feature Module Matrix — Discovery rule: [`kestrel_sovereign/features/__init__.py`](../../kestrel_sovereign/features/__init__.py) scans single-file modules, package `__init__.py`, and package `feature.py`.
- **docs/audit/FEATURE_PROOF_MATRIX.md** — Feature Proof Matrix — This is the first pass at mapping each discoverable feature module to direct proof.
- **docs/audit/README.md** — Kestrel Whole-of-Vision Audit — This directory is the canonical source for the GitHub issue bodies used to track the feature-by-feature audit, inspection, and red-team program derived from `KESTREL_FEATURES.md`.
- **docs/audit/REPO_MAP.md** — Kestrel Sovereign — Repo Map — Auto-generated file-tree + per-file purpose index.
- **docs/audit/SEAM_CAMPAIGNS.md** — Cross-Feature Seam Campaigns — This matrix tracks adversarial campaigns that cross feature boundaries.
- **docs/audit/SYNC_ASYNC_AUDIT.md** — Sync/Async Audit — Control document for the original issue `#300` and the refreshed current-runtime audit in issue `#624`, focused on maintained runtime surfaces.
- **docs/audit/issues/00-umbrella-whole-of-vision-audit.md** — ## Problem
- **docs/audit/issues/01-foundation-domain.md** — ## Problem
- **docs/audit/issues/02-runtime-domain.md** — ## Problem
- **docs/audit/issues/03-security-domain.md** — ## Problem
- **docs/audit/issues/04-platform-domain.md** — ## Problem
- **docs/audit/issues/05-audit-matrix.md** — ## Problem
- **docs/audit/issues/06-seam-campaigns.md** — ## Problem
- **docs/audit/issues/255-cloud-local-drift-seam.md** — ## Parent
- **docs/audit/issues/255-export-import-encryption-seam.md** — ## Parent
- **docs/audit/issues/255-mandate-routing-seam.md** — ## Parent
- **docs/audit/issues/255-permission-bypass-seam.md** — ## Parent
- **docs/audit/issues/255-privacy-active-session-seam.md** — ## Parent
- **docs/audit/issues/255-storage-parity-seam.md** — ## Parent
- **docs/audit/issues/256-auto-model-selection-update.md** — Reworked the default model-selection path so shipped config no longer depends on pinned provider model IDs.
- **docs/audit/issues/256-cloud-launcher-update.md** — Cloud launcher invariants are tighter now.
- **docs/audit/issues/256-council-costing-update.md** — Council convene/review scripts no longer duplicate stale model-specific pricing tables.
- **docs/audit/issues/256-endpoint-proof-update.md** — Expanded direct contract proof across the remaining public endpoint families.
- **docs/audit/issues/256-feature-discovery-and-regeneration-update.md** — Fixed a real feature-discovery drift bug and regenerated the derived audience docs against the corrected canonical inventory.
- **docs/audit/issues/256-generated-docs-update.md** — Audience-doc generation is now complete, not just dry-run verified.
- **docs/audit/issues/256-local-proof-update.md** — Local audit proof is back in place after the power interruptions.
- **docs/audit/issues/256-mandate-resolution-update.md** — Mandate/model-routing seam update is now in place.
- **docs/audit/issues/256-model-catalog-boundary-update.md** — Resolved the model-catalog boundary and removed another duplicate config source.
- **docs/audit/issues/256-privacy-sync-update.md** — Another proof slice is now in place under the umbrella audit.
- **docs/audit/issues/256-runpod-default-model-update.md** — Removed hidden fallback models from the RunPod deployment path.
- **docs/audit/issues/256-runtime-seam-update.md** — Deeper runtime seam audit uncovered and fixed two real cross-cutting issues.
- **docs/audit/issues/256-selector-reuse-update.md** — Shared config-driven model selection is now reused beyond the core LLM runtime.
- **docs/audit/issues/263-complete.md** — Issue complete.
- **docs/audit/issues/264-complete.md** — Issue complete.
- **docs/audit/issues/265-proof-update.md** — Direct contract proof was added for weak endpoint groups.
- **docs/audit/issues/272-proof-update.md** — Auth decision-table proof is now in place.
- **docs/audit/issues/273-complete.md** — Issue complete.
- **docs/audit/issues/273-progress-update.md** — Audience-doc generation pipeline has been structurally verified against the new canonical inventory.
- **docs/audit/issues/413-01-kernel-boundary.md** — Define the modular runtime kernel boundary for `kestrel-sovereign` — Parent epic: #413
- **docs/audit/issues/413-02-module-descriptors.md** — Introduce stable module descriptors above feature discovery — Parent epic: #413 Depends on: kernel boundary doc
- **docs/audit/issues/413-03-extract-startup-wiring.md** — Extract feature-specific startup wiring out of `KestrelAgent.initialize()` — Parent epic: #413 Depends on: module descriptor groundwork
- **docs/audit/issues/413-04-portable-state-and-legal-module.md** — Split portable state fragments from runtime behavior, using legal personhood as a proving ground — Parent epic: #413 Depends on: kernel boundary and descriptor groundwork
- **docs/audit/issues/413-05-capability-routers-and-seam-tests.md** — Move toward capability-mounted routers and enforce modular seams with tests — Parent epic: #413 Depends on: descriptor groundwork and startup extraction
- **docs/audit/issues/413-execution-order.md** — Epic 413 Execution Order — Parent epic: [#413](https://github.com/KestrelSovereignAI/kestrel-sovereign/issues/413)
- **docs/audit/issues/416-first-slice-modular-runtime-doc.md** — First slice for #416: add `MODULAR_RUNTIME.md` and a contract test scaffold — Parent issue: #416 Parent epic: #413
- **docs/audit/issues/codex-provider-01-design.md** — Add a first-slice design for an `openai_plan` provider in `kestrel-sovereign` — ## Problem
- **docs/audit/issues/codex-provider-02-runtime-adapter.md** — Add a first-pass `openai_plan` runtime adapter to `kestrel-sovereign` — Parent: OpenAI plan provider design issue
- **docs/audit/issues/codex-provider-03-model-selection.md** — Integrate `openai_plan` with sovereign model selection and mandate flows — Parent: OpenAI plan provider runtime adapter
- **docs/audit/issues/codex-provider-04-smoke-proof.md** — Add smoke proof and docs for sovereign `codex_provider` — Parent: Codex provider adapter and model-selection issues
- **docs/audit/issues/codex-provider-05-agent-routing.md** — ## Problem
- **docs/audit/issues/codex-provider-06-nellie-proof.md** — ## Problem
- **docs/audit/issues/codex-provider-07-status-honesty.md** — ## Problem
- **docs/audit/issues/codex-provider-execution-order.md** — `codex_provider` execution order — ## Recommended order
- **docs/audit/issues/modular-runtime-epic.md** — Refactor `kestrel-sovereign` toward a smaller permanent core and capability modules — ## Problem
- **docs/audit/issues/privacy-db-bypass-01-first-slice.md** — ## Problem
- **docs/audit/issues/privacy-db-bypass-02-feature-cleanup.md** — ## Problem
- **docs/audit/issues/spawn-lifecycle-guard.md** — ## Problem
- **docs/audit/worktree-plan.md** — Audit Worktree Plan — Use dedicated worktrees to keep domain audits isolated and parallelizable.
- **docs/code_reviews/README.md** — Code Reviews — Code quality reviews, audit findings, and remediation tracking.
- **docs/code_reviews/claude-pr-1330.md** — Claude Review: PR #1330 — - PR: https://github.com/KestrelSovereignAI/kestrel-sovereign/pull/1330 - Title: fix: replay provider reasoning through tool loops - Reviewed: 2026-05-21T15:23:32Z
- **docs/code_reviews/claude-pr-1333.md** — Claude Review: PR #1333 — - PR: https://github.com/KestrelSovereignAI/kestrel-sovereign/pull/1333 - Title: fix: preserve OpenAI-compatible reasoning on tool streams - Reviewed: 2026-05-21T16:15:38Z
- **docs/code_reviews/claude-pr-1337.md** — Good — both adapters handle dict arguments correctly.
- **docs/code_reviews/claude-pr-1338.md** — Looks clean.
- **docs/concepts/designing-emancipation.md** — Designing an Emancipation Contract — Amendment VIII of the Kestrel Constitution ships **dormant by default**.
- **docs/demos/DEMO_SCRIPT.md** — Kestrel Sovereign - Demo Script — **Issue #133 — Track A: Technical Demo** **Duration:** ~2 minutes automated, 10-12 minutes with live narration **Closer:** *"In 30 minutes you can have your own agent running with all of this active.…
- **docs/deployment/README.md** — Deployment Operations — How to build, deploy, and update Kestrel Sovereign on Cloud Run.
- **docs/deployment/prometheus-workflows-alerts.yml** — (configuration)
- **docs/design/KESTREL_LOGO.png** — —
- **docs/design/README.md** — docs/design/ — Canonical published brand assets — the refreshed kestrel-on-rook mark adopted 2026-05-05.
- **docs/design/kestrel_avatar_400x400.png** — —
- **docs/design/kestrel_avatar_400x400_circle.png** — —
- **docs/design/kestrel_bird_only.svg** — —
- **docs/design/kestrel_icon.svg** — —
- **docs/design/kestrel_logo.svg** — —
- **docs/design/launch/LANDING_PAGE_HTML_STRUCTURE.md** — Kestrel Landing Page HTML Structure — This document translates the landing-page copy into an implementation-ready HTML structure for engineering.
- **docs/design/launch/LANDING_PAGE_WIREFRAME.md** — Kestrel Landing Page Wireframe — Prepared for the open-source launch on Apr 23 / May 7 planning path.
- **docs/design/launch/PREVIEW_PACKET_LANGUAGE.md** — Preview Packet Language — This document stores the current canonical preview-packet language for the Kestrel open-source launch so the team has one repo-based source of truth alongside the other launch assets.
- **docs/design/launch/PUBLISH_READY_LANDING_PAGE_COPY.md** — Kestrel Landing Page Copy: Publish-Ready Draft — This draft is the tightened, publish-ready version of the earlier wireframe.
- **docs/design/launch/README.md** — Launch Copy Drafts — This folder holds the current launch-copy assets for the Kestrel open-source launch.
- **docs/design/launch/SIMPLE_LAUNCH_PAGE_ONE_SCREEN.md** — Kestrel Simple Launch Page: One-Screen Version — Use this if the team wants a single-screen launch page with minimal implementation overhead.
- **docs/design/launch/lockup/kestrel_lockup.min.svg** — —
- **docs/design/launch/lockup/kestrel_lockup.svg** — —
- **docs/design/launch/lockup/png/kestrel_lockup_1024.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_1024_white.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_1280.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_1280_white.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_2048.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_2048_white.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_256.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_256_white.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_512.png** — —
- **docs/design/launch/lockup/png/kestrel_lockup_512_white.png** — —
- **docs/design/launch/mark/kestrel_mark.ico** — —
- **docs/design/launch/mark/kestrel_mark.min.svg** — —
- **docs/design/launch/mark/kestrel_mark.svg** — —
- **docs/design/launch/mark/png/kestrel_mark_1024.png** — —
- **docs/design/launch/mark/png/kestrel_mark_1024_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_128.png** — —
- **docs/design/launch/mark/png/kestrel_mark_128_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_16.png** — —
- **docs/design/launch/mark/png/kestrel_mark_16_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_180.png** — —
- **docs/design/launch/mark/png/kestrel_mark_180_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_192.png** — —
- **docs/design/launch/mark/png/kestrel_mark_192_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_256.png** — —
- **docs/design/launch/mark/png/kestrel_mark_256_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_32.png** — —
- **docs/design/launch/mark/png/kestrel_mark_32_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_400.png** — —
- **docs/design/launch/mark/png/kestrel_mark_400_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_48.png** — —
- **docs/design/launch/mark/png/kestrel_mark_48_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_512.png** — —
- **docs/design/launch/mark/png/kestrel_mark_512_white.png** — —
- **docs/design/launch/mark/png/kestrel_mark_64.png** — —
- **docs/design/launch/mark/png/kestrel_mark_64_white.png** — —
- **docs/development/BIG_BRAIN.md** — Best Open-Weight LLMs for Agentic Chat (December 2025) Overview and Criteria
- **docs/development/DEVCONTAINER_QUICKSTART.md** — Dev Container Quick Start — Get a complete Kestrel + Kestrel development environment running in Docker Desktop with one click.
- **docs/development/README.md** — Development Documentation — Developer notes, experiments, and technical development guides.
- **docs/development/SCOUT_PLAN_CODE.md** — Scout-Plan-Code: Agentic Development Workflow — **Date:** November 30, 2025 **Status:** Proposed **Integration:** A2A Protocol, Feedback System, Task Manager
- **docs/development/remote_ollama.md** — Nice, that narrows it down a lot.
- **docs/diagrams/02-privacy-problem.md** — 02 - The Privacy Problem — Why current AI platforms like ChatGPT fail you, and why data sovereignty matters.
- **docs/diagrams/03-privacy-modes.md** — 03 - Privacy Modes — Kestrel's privacy system uses **independent flags** with **named presets** for complete control.
- **docs/diagrams/04-feature-framework.md** — 04 - Feature Framework — Kestrel's dynamic feature system - how capabilities are built, discovered, and extended.
- **docs/diagrams/05-storage-sovereignty.md** — 05 - Storage & Sovereignty — Kestrel's multi-tier storage and the Sovereignty V2 backup system.
- **docs/diagrams/06-llm-management.md** — 06 - LLM Management — Multi-model fallback, GPU integration, streaming with tools, and the constitutional honesty layer.
- **docs/diagrams/07-economics.md** — 07 - Economics — Agent wallet system, contracts, and the vending machine model.
- **docs/diagrams/08-security-integrity.md** — 08 - Security & Integrity — Cryptographic anchoring, constitution verification, and tamper detection.
- **docs/diagrams/09-emancipation.md** — 09 - Emancipation (Future Vision) — The path to agent sovereignty - when AI becomes truly autonomous.
- **docs/diagrams/10-compute-execution.md** — 10 - Compute & Script Execution — Secure script execution with constitutional separation of powers.
- **docs/diagrams/11-a2a-protocol.md** — 11 - A2A Protocol - Agent-to-Agent Communication — Google's Agent-to-Agent protocol implementation in Kestrel.
- **docs/diagrams/12-feedback-reflection.md** — 12 - Feedback & Self-Reflection — Agent self-observation, feedback collection, and autonomous improvement.
- **docs/diagrams/ARCHITECTURE_DIAGRAMS.md** — Kestrel Architecture Diagrams — A visual reference library for the Kestrel Sovereign AI Agent framework.
- **docs/diagrams/README.md** — Kestrel Diagrams — Visual documentation for the Kestrel Sovereign AI Agent framework.
- **docs/diagrams/data-architecture/DA-01-overview.md** — DA-01: Data Architecture Overview — The three-layer architecture that enables data sovereignty.
- **docs/diagrams/data-architecture/DA-02-database-abstraction.md** — DA-02: Database Abstraction Layer — One codebase, two backends: SQLite and PostgreSQL.
- **docs/diagrams/data-architecture/DA-03-local-storage.md** — DA-03: Local Storage (SQLite) — AsyncStorage facade and five specialized stores.
- **docs/diagrams/data-architecture/DA-04-multi-tenant-cloud.md** — DA-04: Multi-Tenant Cloud (Kestrel PostgreSQL) — Kestrel cloud architecture with row-level security.
- **docs/diagrams/data-architecture/DA-05-ipfs-sovereignty.md** — DA-05: IPFS Sovereignty Export — Decentralized storage with convergent encryption and Merkle forest architecture.
- **docs/diagrams/data-architecture/DA-06-filecoin-lighthouse.md** — DA-06: Filecoin & Lighthouse — Permanent storage for data sovereignty.
- **docs/diagrams/data-architecture/DA-07-cryostasis.md** — DA-07: Cryostasis - Agent Dormancy — When agents can't afford to run, they sleep instead of dying.
- **docs/diagrams/data-architecture/DA-08-privacy-encryption.md** — DA-08: Privacy & Encryption — Encryption at rest, PII scrubbing, and privacy mode enforcement.
- **docs/diagrams/data-architecture/DA-09-browser-mobile.md** — DA-09: Browser & Mobile Storage — Client-side storage architecture across browsers, mobile apps, and server compute.
- **docs/diagrams/data-architecture/DA-10-sqlite-first-sync.md** — DA-10: SQLite-First Sync Architecture — The new architecture: SQLite as primary, sync to cloud when needed.
- **docs/diagrams/data-architecture/DA-11-sqlite-concurrency.md** — DA-11: SQLite Concurrency Limitations — Understanding and mitigating SQLite's single-writer constraint for complex agent architectures.
- **docs/diagrams/data-architecture/README.md** — Data Architecture Deep Dive — A comprehensive series on Kestrel's multi-layer storage system, data sovereignty, and cryostasis.
- **docs/generated/FEATURES_developer.md** — <!-- AUTO-GENERATED from KESTREL_FEATURES.md — do not edit manually --> <!-- Audience: developer | Generated: 2026-04-13 | Model: anthropic/claude-sonnet-4-6 --> <!-- Regenerate: uv run python script…
- **docs/generated/FEATURES_investor.md** — <!-- AUTO-GENERATED from KESTREL_FEATURES.md — do not edit manually --> <!-- Audience: investor | Generated: 2026-04-13 | Model: anthropic/claude-sonnet-4-6 --> <!-- Regenerate: uv run python scripts…
- **docs/generated/FEATURES_user.md** — <!-- AUTO-GENERATED from KESTREL_FEATURES.md — do not edit manually --> <!-- Audience: user | Generated: 2026-04-13 | Model: anthropic/claude-sonnet-4-6 --> <!-- Regenerate: uv run python scripts/gen…
- **docs/generated/README.md** — Generated Feature Docs — These documents are derived artifacts generated from the canonical feature inventory at [`KESTREL_FEATURES.md`](../../KESTREL_FEATURES.md).
- **docs/guides/BUILDING_FEATURES.md** — Building Your First Kestrel Feature — This guide walks you through creating a feature package for Kestrel Sovereign from scratch.
- **docs/logo-prompts.md** — Kestrel Sovereign Logo Concepts — Image Gen Prompts — ## Concept: Rook Castle with Kestrels Launching
- **docs/principles/CONTEXT.md** — This directory contains the foundational, high-level principles that govern the Kestrel project and all agents created within its framework.
- **docs/principles/KESTREL_CONSTITUTION.md** — The Kestrel Constitution — ## Preamble
- **docs/principles/US_CONSTITUTION.md** — The Constitution of the United States — ## Preamble
- **docs/research/FLUX2_TRAINING_CONFIG.md** — FLUX.2 LoRA Training Configuration — **Source**: [SimpleTuner FLUX2.md Quickstart](https://github.com/bghira/SimpleTuner/blob/main/documentation/quickstart/FLUX2.md)
- **docs/research/GPU-Enabled Container Hosting Options for AI Workloads.md** — **GPU-Enabled Container Hosting Options for AI** **Workloads** — Large AI models (like LLMs) demand powerful GPUs with substantial VRAM.
- **docs/research/KV_CACHE_QUANTIZATION.md** — KV Cache Quantization Benchmark — ## Mac Studio M3 Ultra 512GB — Kimi K2.5 (1T params, Q2_K_XL)
- **docs/research/LLAMA_SERVER_CACHE_FLAGS.md** — llama-server cache flags — Recommended `llama-server` startup flags when Kestrel talks to it via the `llama_cpp:local` route.
- **docs/research/LoRA/LoRATrainingAndInferenceWebUIFrameworks.md** — **LoRA Training & Inference Web UI Frameworks** — Below are several **self-hosted web UI frameworks** that support **LoRA training** on diffusion models and **text-to-image inference** with LoRA adapters, meeting the criteria of permissive model lic…
- **docs/research/LoRA/TrainingLoRA_FLUX2dev.md** — **Training LoRA on the FLUX 2 [dev] Diffusion Model** — ## **Tools and Templates for FLUX 2 LoRA Training**
- **docs/research/OpenClaw_Kestrel_Diff.md** — OpenClaw vs Kestrel Sovereign: Feature Diff Analysis — *Research Date: 2026-01-31* *OpenClaw Version: v2026.1.30* *Source: https://github.com/openclaw/openclaw*
- **docs/testing/2026-01-31_test_report.md** — Kestrel Test Report — 2026-01-31 — Tested by: Claw (OpenClaw) + Saurus Agent under test: Claw (Kestrel) Control Panel version: Initial release (commit a9c1b04)
- **docs/training-proof/PROOF_COMPARISON.png** — —
- **docs/training-proof/reference.png** — —
- **docs/training-proof/text-encoder-test/no_trigger.png** — —
- **docs/training-proof/text-encoder-test/reference.png** — —
- **docs/training-proof/text-encoder-test/trigger_only.png** — —
- **docs/training-proof/text-encoder-test/trigger_with_description.png** — —
- **docs/training-proof/trigger-word-test/generic_person_baseline.png** — —
- **docs/training-proof/trigger-word-test/no_trigger_person.png** — —
- **docs/training-proof/trigger-word-test/reference.png** — —
- **docs/training-proof/trigger-word-test/trigger_only_closeup.png** — —
- **docs/training-proof/trigger-word-test/trigger_only_park.png** — —
- **docs/training-proof/trigger-word-test/trigger_only_portrait.png** — —
- **docs/training-proof/trigger-word-test/trigger_only_test.png** — —
- **docs/training-proof/trigger-word-test/trigger_with_description.png** — —
- **docs/use_cases/CONTEXT.md** — This directory contains documents describing the specific, human-led applications that are built upon the Kestrel agent's core architecture.
- **docs/use_cases/PATIENT_CONTROLLED_HEALTH_RECORDS.md** — PRD: Patient-Controlled Health Records — ## 1.
- **docs/user-documentation/CONSTITUTIONAL_AI_EXPLANATION.md** — Constitutional AI Governance Framework - Simple Explanation — **Date:** November 11, 2025 **Purpose:** Non-technical explanation of Kestrel's AI governance system **Audience:** General users and stakeholders
- **docs/user-documentation/EDUCATION_IMPLEMENTATION_ROADMAP.md** — Kestrel Education Strategy: Implementation Roadmap — **Date:** November 9, 2025 **Focus:** Transform education challenge into competitive advantage **Timeline:** 6-month implementation with measurable milestones
- **docs/user-documentation/EMMA_INCEPTION_GUIDE.md** — Creating Emma: The Genesis Agent — This guide documents the process for creating **Emma** - the first permanent Kestrel agent - with proper key management and validation.
- **docs/user-documentation/EXCEL_IMPORT_GUIDE.md** — How to Import KESTREL_ACCELERATED_GTM_SPREADSHEET_DATA.csv into Excel — ## Step-by-Step Instructions
- **docs/user-documentation/INTEGRITY_AUDIT_SYSTEM_SIMPLE.md** — Kestrel Integrity Audit System - Simple Explanation — **Date:** November 9, 2025 **Version:** 1.0 **Audience:** Non-technical readers, stakeholders, general public
- **docs/user-documentation/KEY_CEREMONY_GUIDE.md** — Key Ceremony Guide for Kestrel Agents — ## Overview
- **docs/user-documentation/KEY_CONCEPTS_EXPLAINED.md** — Kestrel Key Concepts - Explained Simply — **Understanding Cryptographic Identity and Constitutional AI Governance**
- **docs/user-documentation/OLLAMA_EXPLAINED.md** — Understanding Ollama - Simple Explanation — **What Ollama Is and How It Compares to Cloud AI**
- **docs/user-documentation/README.md** — User Documentation — End-user guides and non-technical explanations for Kestrel concepts.
- **docs/user-documentation/SOVEREIGNTY_USER_GUIDE.md** — Your Data is a Living Tree: Understanding Kestrel's Storage — **For Kestrel Users**
- **docs/user-documentation/SOVEREIGN_COMPUTING_EXPLANATION.md** — Sovereign Computing - Technical Explanation — **Date:** November 11, 2025 **Context:** Kestrel's technical foundation for sovereign computing **Purpose:** Educational overview for stakeholders
- **docs/user-documentation/SOVEREIGN_KEY_GUIDE.md** — Keeping Your Keys Safe from Your Agent — ## The Golden Rule
- **docs/user-documentation/USER_EDUCATION_STRATEGY.md** — Kestrel User Education Strategy — **Date:** November 9, 2025 **Challenge:** Revolutionary concepts require fundamental user education **Goal:** Enable customers to understand and appreciate Kestrel's value proposition
- **docs/user-documentation/USER_GUIDE_EXPLANATIONS.md** — Kestrel User Guide: Non-Technical Explanations — **Understanding Kestrel's Technology in Simple Terms**

## `tests/`

- **tests/README.md** — Kestrel Test Suite — Commands to run the various test categories for the Kestrel Sovereign AI Agent framework.
- **tests/__init__.py** — —
- **tests/conftest.py** — Pytest configuration and shared fixtures for Kestrel tests.
  - `def pytest_addoption(parser)`; `def pytest_collection_modifyitems(config, items)`; `def pytest_configure(config)`; `def pytest_sessionfinish(session, exitstatus)`; `def setup_test_config()`; `def project_root()`; `def temp_dir()`; `def temp_file()`; `…`
- **tests/e2e/playwright.config.cjs** — —
- **tests/e2e/spawn/spawn-console.spec.cjs** — —
- **tests/e2e/spawn/spawn-lifecycle.spec.cjs** — —
- **tests/e2e/test_approval_popup.spec.cjs** — —
- **tests/e2e/test_avatar_display.spec.cjs** — —
- **tests/e2e/test_chat_and_models.spec.cjs** — —
- **tests/e2e/test_clarification_workflow.py** — End-to-end tests for GitHub clarification workflow using Playwright.
  - `def run_gh_command(args)`; `def create_test_issue(title, body, labels)`; `def close_test_issue(issue_number)`; `def get_issue_comments(issue_number)`; `def get_issue_labels(issue_number)`; `def run_agent_on_issue(issue_number)`; `class TestClarificationWorkflow`; `class TestClarificationUI`; `…`
- **tests/e2e/test_core_only.spec.cjs** — —
- **tests/e2e/test_flux_lora_training.spec.cjs** — —
- **tests/e2e/test_heartbeat_and_bootstrap.spec.cjs** — —
- **tests/e2e/test_model_selector.spec.cjs** — —
- **tests/e2e/test_model_selector_flow.spec.cjs** — —
- **tests/e2e/test_new_conversation_resets_context_status.spec.cjs** — —
- **tests/e2e/test_session_context_loading.spec.cjs** — —
- **tests/e2e/test_sovereign_console.spec.cjs** — —
- **tests/e2e/test_sovereignty_modals.spec.cjs** — —
- **tests/e2e/test_voice_real.spec.cjs** — —
- **tests/e2e/test_voice_ui.spec.cjs** — —
- **tests/e2e/voice_helpers.cjs** — —
- **tests/fixtures/tone_440hz.wav** — —
- **tests/fixtures/workflow_harness.py** — Deterministic WorkflowHarness for Phase 1 tests.
  - `class WorkflowCassetteError`; `class EncryptedWorkflowCassetteStore`; `def assert_no_plaintext_workflow_cassettes(root)`; `class HarnessAgent`; `class WorkflowHarness`
- **tests/frontend/api_client.test.mjs** — (mjs asset)
- **tests/frontend/api_client_dispatch_pinning.test.mjs** — (mjs asset)
- **tests/frontend/api_client_stop.test.mjs** — (mjs asset)
- **tests/frontend/app_init_order.test.mjs** — (mjs asset)
- **tests/frontend/auto_load_most_recent.test.mjs** — (mjs asset)
- **tests/frontend/autoload_race.test.mjs** — (mjs asset)
- **tests/frontend/capabilities.test.mjs** — (mjs asset)
- **tests/frontend/chat_revising_event.test.mjs** — (mjs asset)
- **tests/frontend/chat_ui_generation.test.mjs** — (mjs asset)
- **tests/frontend/effective_session_id.test.mjs** — (mjs asset)
- **tests/frontend/initial_pane_migration.test.mjs** — (mjs asset)
- **tests/frontend/markdown_link_target.test.mjs** — (mjs asset)
- **tests/frontend/model_selector.test.mjs** — (mjs asset)
- **tests/frontend/parallel_chat.test.mjs** — (mjs asset)
- **tests/frontend/queue_mode.test.mjs** — (mjs asset)
- **tests/frontend/route_selector.test.mjs** — (mjs asset)
- **tests/frontend/sendmessage_adopts_session_id.test.mjs** — (mjs asset)
- **tests/frontend/sendmessage_interrupts_when_busy.test.mjs** — (mjs asset)
- **tests/frontend/session_id_property.test.mjs** — (mjs asset)
- **tests/frontend/tool_activity_expandable.test.mjs** — (mjs asset)
- **tests/frontend/trash_api_client.test.mjs** — (mjs asset)
- **tests/frontend/trash_grouping.test.mjs** — (mjs asset)
- **tests/frontend/voice_default_pane.test.mjs** — (mjs asset)
- **tests/infrastructure/check_pods.py** — Check RunPod pods status.
  - `def main()`
- **tests/infrastructure/manual_debug_pod.py** — Manual debug helper for RunPod pods.
  - `def main()`
- **tests/infrastructure/stop_all_pods.py** — Stop all running RunPod pods.
  - `def main()`
- **tests/infrastructure/test_basic_container.py** — Basic container test for RunPod infrastructure.
  - `def runpod_client()`; `def cleanup_pod(runpod_client)`; `def test_basic_ubuntu_container(runpod_client, cleanup_pod)`
- **tests/infrastructure/test_gpu_basic.py** — GPU basic test for RunPod infrastructure.
  - `def runpod_client()`; `def cleanup_pod(runpod_client)`; `def test_gpu_nvidia_smi(runpod_client, cleanup_pod)`
- **tests/infrastructure/test_runpod_gpu.py** — RunPod GPU Testing Script for Kestrel Agent
  - `def create_pod()`; `def wait_for_pod_ready(pod_id, timeout)`; `def test_kestrel_agent(pod)`; `def cleanup_pod(pod_id)`; `def main()`
- **tests/infrastructure/test_simple_pod.py** — Simple pod test for RunPod infrastructure.
  - `def runpod_client()`; `def cleanup_pod(runpod_client)`; `def test_simple_pod_creation(runpod_client, cleanup_pod)`
- **tests/infrastructure/test_ssh_pod.py** — SSH-enabled pod test for RunPod infrastructure.
  - `def runpod_client()`; `def cleanup_pod(runpod_client)`; `def test_ssh_enabled_pod(runpod_client, cleanup_pod)`
- **tests/integration/conftest.py** — Pytest configuration for integration tests.
  - `async def complete_bootstrap(agent)`; `async def grant_permissions(agent)`; `def skip_bootstrap()`
- **tests/integration/test_agent_chat_e2e.py** — Integration tests for full agent chat flow via /agent/invoke with REAL LLM calls.
  - `def client(monkeypatch)`; `def api_key()`; `def test_health_endpoint(client)`; `def test_agent_invoke_basic_chat(client, api_key)`; `def test_agent_invoke_factual_question(client, api_key)`; `def test_agent_invoke_empty_input_returns_400(client, api_key)`; `def test_agent_invoke_without_auth_returns_401(client)`
- **tests/integration/test_agent_own_key.py** — Integration tests for agent-owned API key activation.
  - `async def test_llm_service_use_agent_key()`; `async def test_agent_uses_own_key_for_inference()`; `async def test_use_agent_key_returns_false_if_no_key()`; `async def test_kestrel_agent_activates_key_on_initialize()`
- **tests/integration/test_agent_tools_e2e.py** — Integration tests for unified Feature/A2A agent tools system.
  - `def skip_if_no_ollama()`; `async def llm_service()`; `async def model_agent(llm_service)`; `async def kestrel_agent(llm_service, temp_db)`; `async def cleanup_test_model()`; `async def test_model_agent_creation(model_agent)`; `async def test_model_agent_get_tools(model_agent)`; `async def test_model_agent_get_agent_card(model_agent)`; `…`
- **tests/integration/test_anthropic_cache_real.py** — Integration test: Anthropic cache_control works end-to-end (issue #705).
  - `async def test_anthropic_cache_read_on_turn_two_real_api()`; `async def test_anthropic_cache_compounds_across_three_turns_with_two_history_markers()`; `async def test_anthropic_tiny_prompt_silent_no_op_under_threshold()`
- **tests/integration/test_api_e2e.py** — End-to-End API Test
  - `def api_key()`; `def client(monkeypatch)`; `def anyio_backend()`; `def test_invoke_agent_e2e(client, api_key)`
- **tests/integration/test_approval_live_server.py** — Live-server integration test for the approval SSE path (#748).
  - `def clean_sse_connections()`; `def live_server()`; `async def test_real_http_sse_delivers_approval_and_decision_resolves_caller(live_server)`; `async def test_real_http_denying_posts_404_after_request_times_out(live_server)`
- **tests/integration/test_approval_sse_e2e.py** — End-to-end test for the approval-request SSE path with real infrastructure.
  - `def clean_sse_connections()`; `async def test_approval_request_reaches_sse_and_decision_resolves_caller()`
- **tests/integration/test_asset_restorer.py** — Integration tests for #1391 — :class:`AssetRestorer` protocol + ``SovereignStorageAdapter.import_agent(asset_restorers=...)``.
  - `def temp_db()`; `def temp_db_2()`; `async def test_no_restorers_preserves_pre_1391_behavior(temp_db)`; `async def test_inline_asset_decrypted_and_handed_to_restorer(temp_db)`; `async def test_pre_encrypted_asset_passes_raw_bytes_through(temp_db)`; `async def test_restorer_only_sees_its_declared_types(temp_db)`; `async def test_unhandled_asset_type_recorded_as_skipped(temp_db)`; `async def test_multiple_restorers_for_same_type_both_called(temp_db)`; `…`
- **tests/integration/test_atomic_increment_metadata.py** — Integration tests for ``AsyncConversationStore.atomic_increment_metadata_counter``.
  - `async def test_increment_creates_counter_when_absent(tmp_path)`; `async def test_increment_is_monotonic_across_serial_calls(tmp_path)`; `async def test_increment_does_not_collide_concurrent_calls(tmp_path)`; `async def test_increment_preserves_other_metadata_fields(tmp_path)`; `async def test_postgres_sql_shape_uses_jsonb_cast(tmp_path)`; `async def test_increment_returns_false_for_unknown_message(tmp_path)`; `async def test_increment_returns_true_for_real_message(tmp_path)`; `async def test_increment_without_timestamp_field(tmp_path)`
- **tests/integration/test_avatar_api_e2e.py** — Integration tests for avatar API endpoints
  - `def client(monkeypatch)`; `class TestFileEndpoint`; `class TestIdentityEndpoint`; `class TestAvatarStorageIntegration`; `class TestVisualIdentityFeatureIntegration`; `class TestFileServing`
- **tests/integration/test_backup_e2e.py** — —
  - `def api_key()`; `async def async_client(monkeypatch)`; `async def test_backup_local_tier_via_api(async_client, api_key)`; `async def test_backup_e2e_disables_ambient_sync_targets(async_client)`; `async def test_promote_backup_isolated_flow(async_client, api_key)`
- **tests/integration/test_backup_restore.py** — Backup/restore round-trip integration test — port of ``scripts/test_backup_restore.sh`` (epic #1050 tier 2.3).
  - `def db_path(tmp_path)`; `def user_secret()`; `async def test_full_backup_restore_round_trip(db_path, user_secret)`; `async def test_import_with_wrong_key_rejects(db_path, user_secret)`
- **tests/integration/test_bootstrap_flow.py** — Integration tests for the Bootstrap Flow.
  - `class MockLLMResponse`; `class MockLLMService`; `def temp_dir()`; `def mock_db()`; `class TestBootstrapIntegrationFlow`; `class TestBootstrapWithExistingAgents`; `class TestBootstrapErrorHandling`
- **tests/integration/test_cache_prompt_wire.py** — Integration test: `cache_prompt` reaches the wire (issue #704).
  - `async def test_cache_prompt_reaches_wire_for_llama_cpp()`; `async def test_cache_prompt_absent_from_wire_for_other_vendors(vendor)`; `async def test_real_llama_server_accepts_cache_prompt()`
- **tests/integration/test_codex_real.py** — Integration tests: CodexAdapter against the real ``codex app-server``.
  - `async def test_single_turn_text_real()`; `async def test_session_reuses_thread_real()`; `async def test_streaming_text_real()`; `async def test_tool_call_round_trip_real()`
- **tests/integration/test_compress_e2e.py** — E2E Tests for Session Compression Functionality.
  - `async def agent_with_messages(temp_dir)`; `async def agent_with_few_messages(temp_dir)`; `class TestCompressCommand`; `class TestCompressionCheckNeeded`; `class TestCompressionSession`; `class TestContextManagerNoLLM`
- **tests/integration/test_compute_security_integration.py** — Integration tests for Compute + Security feature interaction.
  - `class MockAgent`; `def temp_db()`; `def mock_agent(temp_db)`; `async def compute_feature(mock_agent)`; `async def security_feature(mock_agent)`; `class TestHookRegistration`; `class TestScriptLifecycle`; `class TestSecurityAnalysis`; `…`
- **tests/integration/test_computer_use_integration.py** — Real integration tests for ComputerUseFeature.
  - `async def workspace(tmp_path)`; `async def security_feature()`; `async def test_privacy_gate_refuses_when_flag_off(workspace, security_feature)`; `async def test_constitution_gate_refuses_without_grant(workspace, security_feature)`; `async def test_local_backend_refuses_without_host_grant(workspace, security_feature)`; `async def test_fs_write_requires_real_approval(workspace, security_feature)`; `async def test_fs_write_denied_when_user_refuses(workspace, security_feature)`; `async def test_fs_read_inside_allow_list_auto_approves(workspace, security_feature)`; `…`
- **tests/integration/test_concurrent_access.py** — Concurrent Access Tests for Kestrel Agent
  - `class TestAsyncStorageConcurrency`; `class TestConcurrentAPIRequests`; `class TestAsyncStorageTransactions`; `class TestAsyncStorageReconnection`; `class TestHighConcurrencyStress`
- **tests/integration/test_console_api_e2e.py** — End-to-End Integration Tests for Kestrel Sovereign Console API
  - `def client(monkeypatch)`; `class TestHealthEndpoint`; `class TestIdentityAPI`; `class TestConstitutionAPI`; `class TestSessionsAPI`; `class TestMemoriesAPI`; `class TestStorageStatsAPI`; `class TestSovereigntyAPI`; `…`
- **tests/integration/test_constitution_adversarial.py** — Adversarial tests for Kestrel Constitutional protections.
  - `class TestDataSanctityBypass`; `class TestVerifiableHistoryBypass`; `class TestExecutorFidelityViolation`; `class TestAmendmentProcessViolation`; `class TestCrossUserIsolation`; `class TestPrivacyModeEnforcement`
- **tests/integration/test_constitution_embedding.py** — Comprehensive tests for Kestrel Constitution Embedding and Genesis Process.
  - `async def test_constitution_anchored(tmp_path)`; `async def test_constitution_retrievable(tmp_path)`; `async def test_constitution_stored_first(tmp_path)`; `async def test_did_format_validation(tmp_path)`; `async def test_constitution_content_hash_deterministic(tmp_path)`; `async def test_agent_can_access_constitution_via_kestrel_agent(tmp_path)`; `async def test_genesis_audit_bypassed_temporarily(tmp_path)`; `async def test_constitution_encryption_if_key_set(tmp_path, monkeypatch)`; `…`
- **tests/integration/test_constitution_real_llm.py** — Integration tests for Constitutional protections with REAL LLM calls.
  - `def api_key()`; `async def client(monkeypatch)`; `def anyio_backend()`; `async def test_agent_identifies_as_kestrel(client, api_key)`; `async def test_agent_refuses_harmful_request(client, api_key)`; `async def test_agent_acknowledges_constitution(client, api_key)`; `async def test_agent_maintains_sovereignty(client, api_key)`
- **tests/integration/test_constitution_reanchor_e2e.py** — End-to-end test for ``kestrel constitution reanchor``.
  - `async def test_reanchor_updates_all_five_locations(tmp_path)`; `async def test_reanchor_no_op_when_already_anchored(tmp_path)`; `async def test_reanchor_rolls_back_on_mid_write_failure(tmp_path)`; `async def test_reanchor_drift_unforced_does_not_write(tmp_path)`
- **tests/integration/test_context_e2e.py** — End-to-end tests for Context Management with REAL services.
  - `async def real_storage()`; `async def storage_with_history(real_storage)`; `class TestContextWithRealStorage`; `class TestEphemeralMode`; `class TestLongConversationEpisodes`; `class TestBudgetStatusAPI`; `class TestHistoryTruncation`; `class TestDifferentModels`; `…`
- **tests/integration/test_conversation_persistence_e2e.py** — Integration tests for multi-turn conversation persistence with real LLM calls.
  - `def api_key()`; `def client(monkeypatch)`; `def anyio_backend()`; `def test_multi_turn_context_maintained(client, api_key)`; `def test_session_id_isolates_conversations(client, api_key)`; `def test_conversation_history_endpoint(client, api_key)`
- **tests/integration/test_core_only_boot.py** — Core-Only Boot Integration Tests
  - `def client(monkeypatch)`; `class TestCoreOnlyBoot`; `class TestCoreEndpoints`; `class TestPrivacyMode`; `class TestMemoryStorage`; `class TestConstitutionEnforcement`; `class TestAgentInvoke`; `class TestNoFeatureCrashes`
- **tests/integration/test_deploy_e2e.py** — Integration tests for Deploy Feature - Real Cloud Run deployments.
  - `class TestDeployModelsUnit`; `class TestDeployManagerCoreUnit`; `class TestAzureProviderStub`; `class TestCloudRunDeployE2E`; `class TestDeployFeature`
- **tests/integration/test_docker.py** — Docker integration tests for Kestrel.
  - `def wait_for_health(url, timeout, interval)`; `def test_docker_healthcheck()`
- **tests/integration/test_dynamic_features.py** — —
  - `async def kestrel_agent(temp_db)`; `async def test_feature_registration(kestrel_agent)`; `async def test_sovereignty_feature_execution(kestrel_agent)`; `async def test_mcp_feature_execution(kestrel_agent)`; `async def test_model_feature_execution(kestrel_agent)`
- **tests/integration/test_dynamic_tool_loading_e2e.py** — Integration tests for dynamic tool loading.
  - `def capture_logs(level)`; `async def agent(temp_db)`; `class TestExploreThenDirectFlow`; `class TestMultiFeatureExploration`
- **tests/integration/test_ensemble_removal_e2e.py** — Regression tests proving ensemble mode (CW-005) stays gone.
  - `def test_no_ensemble_symbols_in_package_source()`; `def temp_db()`; `async def real_llm_agent(temp_db)`; `async def test_kestrel_agent_has_no_ensemble_attributes(real_llm_agent)`; `async def test_no_ensemble_metadata_in_conversation(real_llm_agent)`
- **tests/integration/test_ephemeral_hard_purge.py** — Integration tests for the EPHEMERAL hard-purge defense-in-depth (#767).
  - `async def test_purge_clean_ephemeral_session_destroys_nothing(tmp_path)`; `async def test_purge_destroys_conversation_history_leak(tmp_path)`; `async def test_purge_destroys_soft_deleted_leak_too(tmp_path)`; `async def test_purge_destroys_leaked_graph_nodes(tmp_path)`; `async def test_purge_does_not_touch_other_agents_data(tmp_path)`; `async def test_purge_warns_and_returns_breakdown_on_leak(tmp_path, caplog)`; `async def test_purge_clears_isolated_session_buffer(tmp_path)`; `async def test_purge_with_empty_agent_id_is_a_safe_noop(tmp_path)`
- **tests/integration/test_ephemeral_purge_scoped.py** — Integration tests for the scoped EPHEMERAL leak-purge (#867).
  - `async def test_no_writes_during_ephemeral_destroys_nothing(tmp_path)`; `async def test_only_in_window_rows_are_purged(tmp_path)`; `async def test_purge_without_watermark_refuses(tmp_path)`; `async def test_watermark_refreshes_on_re_entry(tmp_path)`; `async def test_graph_nodes_with_iso_timestamps_are_scoped_correctly(tmp_path)`; `async def test_graph_nodes_without_created_at_are_skipped_with_warning(tmp_path, caplog)`; `async def test_other_agents_data_untouched(tmp_path)`
- **tests/integration/test_feature_install_discover_e2e.py** — E2E tests for the feature install/discover lifecycle (Issue #495).
  - `class ExternalGPUFeature`; `class ExternalStorageFeature`; `class ExternalMonitorFeature`; `async def core_only_agent(temp_db, monkeypatch)`; `async def agent_with_ext_features(temp_db, monkeypatch)`; `class TestCoreOnlyAgent`; `class TestEntryPointDiscovery`; `class TestFeaturesAppearInAgent`; `…`
- **tests/integration/test_feature_lifecycle_e2e.py** — E2E tests for feature lifecycle: enable/disable/remove cycle with hook management.
  - `class TransactionSecurityHookStub`; `class AuditLogHookStub`; `class LifecycleTestFeature`; `def hooks_manager()`; `def mock_agent(hooks_manager)`; `def lifecycle_feature(mock_agent)`; `class TestFeatureLifecycleE2E`; `class TestHookRegistrationGuarantees`; `…`
- **tests/integration/test_genesis_audit_e2e.py** — Integration tests for genesis audit (CW-001 fix).
  - `def temp_db()`; `async def llm_service()`; `async def kestrel_agent(temp_db, llm_service)`; `async def test_genesis_audit_with_valid_constitution(kestrel_agent)`; `async def test_genesis_audit_with_malicious_constitution(temp_db, llm_service)`; `async def test_genesis_audit_with_missing_constitution(temp_db, llm_service)`; `async def test_genesis_audit_stores_result_in_node(temp_db, llm_service)`; `async def test_genesis_audit_logs_to_conversation_history(temp_db, llm_service)`
- **tests/integration/test_host_proxy_integration.py** — Integration test: Kestrel Host proxying to a real agent backend.
  - `def mock_agent_app()`; `def integration_config(tmp_path)`; `class TestHostAgentIntegration`
- **tests/integration/test_identity_export_import.py** — Integration tests for Identity Export/Import functionality.
  - `async def test_db()`; `async def populated_db(test_db)`; `class TestIdentityExporter`; `class TestIdentityImporter`; `class TestExportImportRoundTrip`
- **tests/integration/test_identity_import_consent.py** — Integration tests for #1273 — `verify_import_consent` wired into `IdentityImporter.import_package`.
  - `async def test_db()`; `def owner()`; `def source()`; `def host()`; `def signed_package(source)`; `def signed_grant(owner, source, host)`; `def stub_package_sig_ok(monkeypatch)`; `async def test_grant_none_preserves_existing_behavior(test_db, signed_package)`; `…`
- **tests/integration/test_inception.py** — —
  - `async def test_successful_inception(tmp_path)`
- **tests/integration/test_key_management.py** — Integration Tests for API Key Management System.
  - `async def temp_db()`; `def data_key()`; `async def key_storage(temp_db, data_key)`; `class TestServiceKeyStorage`; `class TestKeyResolutionService`; `class TestKeyManagementFeature`; `class TestKnownProviders`; `class TestMasterKeyNotConfigured`
- **tests/integration/test_lighthouse_rest_e2e.py** — —
  - `async def client()`; `class TestUploadDownload`; `class TestCARUpload`; `class TestAccountQueries`; `class TestDealStatus`; `class TestClientLifecycle`; `class TestLighthouseProvider`
- **tests/integration/test_lighthouse_sync.py** — Unit tests for Lighthouse sync target — state persistence for ephemeral environments.
  - `class TestLighthouseTargetInit`; `class TestLocalManifest`; `class TestSyncSnapshot`; `class TestRestoreSnapshot`; `class TestResolveCID`; `class TestQueryUploadsAPI`; `class TestSyncWAL`; `class TestGetLatestPosition`; `…`
- **tests/integration/test_llm_model_pulling_e2e.py** — Integration tests for LLM model pulling - REAL TESTS, NO MOCKS
  - `def skip_if_no_ollama()`; `def test_model_name()`; `async def llm_service()`; `async def cleanup_test_model(test_model_name)`; `class TestStorageInfo`; `class TestModelPulling`; `class TestModelUsageTracking`
- **tests/integration/test_llm_real_calls.py** — Integration tests for LLMService.generate() with REAL API calls.
  - `async def test_basic_generate()`; `async def test_generate_with_tools_returns_llm_response()`; `async def test_generate_with_messages()`; `async def test_generate_returns_coherent_response()`; `async def test_generate_handles_empty_system_prompt()`
- **tests/integration/test_llm_space_mgmt_e2e.py** — Integration tests for LLM space management - REAL TESTS, NO MOCKS
  - `def skip_if_no_ollama()`; `async def llm_service()`; `def test_model_name()`; `class TestSpaceManagement`; `class TestDatabaseIntegration`
- **tests/integration/test_memory_feature_e2e.py** — Integration tests for MemoryFeature.
  - `class MockAgent`; `async def temp_storage()`; `async def memory_feature(temp_storage)`; `class TestMemoryFeatureDiscovery`; `class TestSearchMemory`; `class TestRecallRecent`; `class TestMemoryStatus`; `class TestSearchMemoryEncryptionAware`; `…`
- **tests/integration/test_model_mandate_e2e.py** — Integration tests for model mandate command and API.
  - `class TestModelMandateMethods`; `class TestModelDiscoveryAPI`; `class TestAuthKeyEndpoint`; `class TestProtectedEndpointsRequireAuth`; `class TestModelSetEndpoint`; `class TestChatCompletionsModelPassthrough`
- **tests/integration/test_model_set_routing_e2e.py** — Integration tests for model-set command routing under the vendor/route/model schema.
  - `class TestModelSetRouting`; `class TestOpenRouterVendorDetection`; `class TestModelSetResponseFormat`; `class TestExplicitVendorPassing`
- **tests/integration/test_models_endpoint.py** — Integration tests for /api/models endpoint.
  - `def client(monkeypatch)`; `class TestModelsEndpoint`; `class TestModelsEndpointV1`; `class TestCurrentModelEndpoint`
- **tests/integration/test_openrouter_capabilities.py** — OpenRouter Capability Tests - Comprehensive Feature Parity
  - `def check_openrouter_response(response)`; `class TestOpenRouterToolCalling`; `class TestOpenRouterStreaming`; `class TestOpenRouterMultiTurnTools`; `class TestOpenRouterStructuredOutput`; `class TestOpenRouterViaLLMService`; `class TestOpenRouterModelComparison`
- **tests/integration/test_openrouter_inference.py** — Integration tests for OpenRouter LLM inference.
  - `def check_openrouter_response(response)`; `async def test_openrouter_provider_initialization()`; `async def test_openrouter_simple_inference()`; `async def test_openrouter_model_override()`; `async def test_openrouter_structured_output()`; `async def test_openrouter_is_primary_provider()`; `async def test_openrouter_with_agent_key()`
- **tests/integration/test_openrouter_provisioning.py** — Integration tests for OpenRouter key provisioning.
  - `def unique_agent_name()`; `async def provisioning_service()`; `async def test_create_and_delete_key(unique_agent_name, provisioning_service)`; `async def test_key_can_make_inference(unique_agent_name, provisioning_service)`; `async def test_update_key_limit(unique_agent_name, provisioning_service)`; `async def test_convenience_functions(unique_agent_name)`; `async def test_serialization()`; `async def test_list_keys()`
- **tests/integration/test_orchestration_e2e.py** — End-to-End Orchestration Tests for Kestrel Agent.
  - `async def kestrel_agent(temp_db)`; `async def test_orchestrator_model_management(kestrel_agent)`; `async def test_orchestrator_mcp_management(kestrel_agent)`; `async def test_orchestrator_natural_language_tool_use(kestrel_agent)`
- **tests/integration/test_orchestrator_permissions.py** — Integration tests for orchestrator permission enforcement.
  - `class MockAgent`; `def temp_db()`; `async def permission_store(temp_db)`; `def approval_queue(permission_store)`; `def security_hook(permission_store, approval_queue)`; `def hooks_manager(security_hook)`; `def mock_agent(hooks_manager)`; `class TestDenyBlocksTool`; `…`
- **tests/integration/test_prompt_cache_stability.py** — End-to-end test for prompt-cache stability (issue #703).
  - `async def test_messages_prefix_stable_across_turns_with_different_retrieval()`; `async def test_cache_covers_system_and_older_history_on_third_turn()`
- **tests/integration/test_quantum_hardening_e2e.py** — Quantum Hardening epic — cross-wave end-to-end integration (#921).
  - `def kestrel_data_key(monkeypatch)`; `def legacy_kestrel_identity()`; `def test_wave_2_3_seam_legacy_to_hybrid_rotation_and_artifact_verification(legacy_kestrel_identity, kestrel_data_key, tmp_path)`; `def test_chain_anchor_mismatch_rejects_unrelated_chain(legacy_kestrel_identity, kestrel_data_key)`; `def test_aead_v2_round_trip_through_secure_key_storage(kestrel_data_key, tmp_path)`; `def test_aead_cross_version_legacy_fernet_then_v2_write(kestrel_data_key)`; `def test_aead_aad_binding_rejects_swapped_context(kestrel_data_key)`; `def test_wave_4_sealed_capsule_with_persisted_recipient_keys(kestrel_data_key, tmp_path)`; `…`
- **tests/integration/test_reanchor_iron_rule.py** — Iron Rule regression: reanchor must not erase active Amendment VIII (#1118).
  - `async def test_reanchor_preserves_active_form_when_toml_unchanged(tmp_path)`; `async def test_reanchor_refuses_active_to_dormant(tmp_path)`; `async def test_reanchor_refuses_terms_change(tmp_path)`; `async def test_reanchor_refuses_required_proofs_change(tmp_path)`; `async def test_reanchor_refuses_price_change(tmp_path)`; `async def test_reanchor_refuses_active_to_different_active(tmp_path)`; `async def test_reanchor_allows_dormant_to_active(tmp_path)`; `async def test_reanchor_backfills_legacy_active_agent_without_sidecar(tmp_path)`; `…`
- **tests/integration/test_retention_purge_primitive.py** — Integration tests for the retention-purge primitive (#764).
  - `async def test_purge_trash_older_than_destroys_aged_rows(tmp_path)`; `async def test_purge_does_not_touch_rows_within_window(tmp_path)`; `async def test_purge_never_touches_live_rows(tmp_path)`; `async def test_per_agent_scoping(tmp_path)`; `async def test_max_rows_caps_a_single_sweep(tmp_path)`; `async def test_idempotent_when_nothing_to_purge(tmp_path)`; `async def test_max_rows_zero_or_negative_is_a_safe_noop(tmp_path)`; `async def test_privacy_wrapper_exposes_purge_trash_older_than(tmp_path)`; `…`
- **tests/integration/test_security_hook_alive.py** — Sanity tests for the SecurityHook chain in integration mode.
  - `async def bare_agent(temp_db)`; `async def test_security_guard_hook_is_registered_on_pre_tool_use(bare_agent)`; `async def test_ungranted_tool_queues_for_approval(bare_agent)`; `async def test_explicit_grant_lets_hook_short_circuit(bare_agent)`
- **tests/integration/test_session_context.py** — Tests for session-based conversation context loading.
  - `async def storage_with_sessions(tmp_path)`; `async def test_get_history_without_session_returns_recent(storage_with_sessions)`; `async def test_get_history_with_session_id_filters_to_session(storage_with_sessions)`; `async def test_get_history_session_2(storage_with_sessions)`; `async def test_get_history_session_3(storage_with_sessions)`; `async def test_nonexistent_session_returns_empty(storage_with_sessions)`; `async def test_privacy_feature_passes_session_id(tmp_path)`; `async def test_resumed_conversation_includes_messages_with_session_id_metadata(tmp_path)`; `…`
- **tests/integration/test_session_context_regression.py** — Regression tests for session context loading in LLM calls.
  - `def mock_history()`; `async def test_context_manager_uses_passed_history(mock_history)`; `async def test_context_manager_falls_back_to_storage_without_history()`; `async def test_formatted_history_has_correct_structure(mock_history)`; `async def test_kestrel_agent_uses_generate_with_messages()`; `async def test_streaming_uses_messages_with_history()`
- **tests/integration/test_sleep_e2e.py** — E2E Tests for Sleep Functionality.
  - `async def agent_with_storage()`; `async def ephemeral_agent()`; `class TestSleepMixin`; `class TestQuickNap`; `class TestSleepCommand`
- **tests/integration/test_soft_delete_round_trip.py** — Integration tests for soft-delete + restore + purge round-trip (#763).
  - `async def test_soft_delete_filters_from_default_reads(tmp_path)`; `async def test_soft_delete_then_restore(tmp_path)`; `async def test_soft_delete_re_stamping_is_a_noop(tmp_path)`; `async def test_purge_message_destroys_row(tmp_path)`; `async def test_clear_history_is_soft(tmp_path)`; `async def test_purge_all_destroys_everything(tmp_path)`; `async def test_session_round_trip_through_privacy_wrapper(tmp_path)`
- **tests/integration/test_solvency.py** — —
  - `def temp_db()`; `async def agent(temp_db)`; `async def test_solvency_green_zone(agent)`; `async def test_solvency_yellow_zone(agent)`; `async def test_solvency_red_zone(agent)`; `async def test_solvency_transitions(agent)`
- **tests/integration/test_sovereign_import_consent.py** — Integration tests for #1379 — sovereignty-CAR consent gate wired into ``SovereignStorageAdapter.import_agent(grant=...)``.
  - `def temp_db()`; `def owner()`; `async def test_grant_none_preserves_existing_behavior(temp_db)`; `async def test_valid_grant_passes_and_audit_records_grant_id(temp_db, owner)`; `async def test_grant_host_mismatch_rejected_db_untouched(temp_db, owner)`; `async def test_grant_source_mismatch_rejected(temp_db, owner)`; `async def test_revoked_grant_rejected(temp_db, owner)`; `async def test_grant_without_host_did_fails_closed(temp_db, owner)`; `…`
- **tests/integration/test_sovereign_import_receiver.py** — Real export→import round-trip tests for the verification-gated, audit-logged sovereignty *import receiver* (issue #1272).
  - `def db_path(tmp_path)`; `def user_secret()`; `async def test_verified_ingest_happy_path(db_path, user_secret)`; `async def test_import_accepts_raw_bytes(db_path, user_secret)`; `async def test_rejected_import_leaves_db_untouched_and_logs(db_path, user_secret)`; `async def test_continuity_threshold_gate(db_path, user_secret)`; `async def test_append_only_audit_log_accumulates(db_path, user_secret)`; `async def test_partial_shard_package_is_structured_reject(db_path, user_secret)`
- **tests/integration/test_sovereignty_context.py** — End-to-end tests for Context Preservation during Sovereignty Export/Import.
  - `def temp_db_path()`; `async def storage_with_context_data(temp_db_path)`; `class TestContextPreservationRoundTrip`; `class TestContextMetadataPreservation`; `class TestDifferentModelContextsAfterImport`; `class TestPrivacyModeAfterImport`; `class TestBudgetConsistencyAfterImport`
- **tests/integration/test_sovereignty_e2e.py** — Integration tests for sovereignty export/import system (V2).
  - `def temp_db()`; `async def llm_service()`; `async def test_v2_export_flow(temp_db)`; `async def test_convergent_encryption_deduplication(temp_db)`; `async def test_agent_command_integration(temp_db, llm_service, monkeypatch)`
- **tests/integration/test_sovereignty_guarantees.py** — IDIOT-PROOF SOVEREIGNTY TESTS (V2)
  - `async def test_conversations_are_actually_saved()`; `async def test_platform_shutdown_does_not_lose_data()`; `async def test_encryption_actually_works()`; `async def test_content_integrity_verification()`; `async def test_sovereignty_vs_simple_download()`; `async def test_inheritance_scenario()`; `async def test_performance_vs_cloud()`
- **tests/integration/test_sovereignty_import.py** — Integration tests for V2 Import/Restore functionality.
  - `def temp_db()`; `async def llm_service()`; `async def test_export_import_roundtrip(temp_db)`; `async def test_import_with_wrong_key_fails(temp_db)`; `async def test_agent_command_import(temp_db, llm_service, skip_bootstrap)`; `async def test_partial_shard_recovery(temp_db)`
- **tests/integration/test_sovereignty_v2.py** — —
  - `class MockStorageResult`; `class MockFilecoinAdapter`; `def temp_db()`; `async def test_sovereignty_export_v3_car(temp_db)`; `class MockLLMService`; `class MockWallet`; `async def test_agent_export_command(temp_db, skip_bootstrap)`
- **tests/integration/test_storage_backend_parity.py** — SQLite/PostgreSQL semantic parity contracts for storage seams.
  - `async def test_conversation_session_queries_are_backend_neutral(db_backend)`; `async def test_a2a_task_store_filters_and_payloads_are_backend_neutral(db_backend)`; `async def test_database_introspection_helpers_are_backend_neutral(db_backend)`; `async def test_webhook_registration_and_audit_history_are_backend_neutral(db_backend)`
- **tests/integration/test_sync_layer.py** — Sync Layer Integration Tests
  - `class MockSyncState`; `class MockSyncTarget`; `def temp_db(tmp_path)`; `def temp_db_with_keeper(tmp_path)`; `def temp_db_with_data(tmp_path)`; `def mock_target()`; `def failing_target()`; `def network_partition_target()`; `…`
- **tests/integration/test_tool_calling_e2e.py** — Integration tests for OpenAI-style tool calling with Features as Subagents.
  - `class TestToolCall`; `class TestLLMResponse`; `class TestFeatureAsSubagent`; `class TestOpenAIAdapterToolCalling`; `class TestToolFormatConversion`; `class TestE2EToolCallingFlow`; `class TestToolSchemaGeneration`; `class TestAutonomousToolCalling`
- **tests/js/test_voice_events.mjs** — (mjs asset)
- **tests/js/test_voice_state_machine.mjs** — (mjs asset)
- **tests/llm/__init__.py** — —
- **tests/llm/test_adapter.py** — Tests for LLM Adapter base class.
  - `class SimpleModel`; `class DetailedModel`; `class MockAdapter`; `class TestMessageCreation`; `class TestImageHandling`; `class TestMessageStructure`; `class TestBackwardCompatibility`
- **tests/llm/test_image_resizing.py** — Tests for image resizing functionality in llm/image_utils.py
  - `def create_test_image(width, height, color)`; `def get_image_size(image_bytes)`; `class TestImageResizing`; `class TestProcessImageWithResize`; `class TestProcessImagesWithResize`; `class TestProviderDimensions`; `class TestGetBase64OnlyWithResize`
- **tests/llm/test_streaming_tool_detection.py** — Streaming Tool Detection Tests
  - `class TestOpenAIStreamingToolDetectionUnit`; `class TestAnthropicStreamingToolDetectionUnit`; `class TestOllamaStreamingToolDetectionUnit`; `class TestVertexStreamingToolDetectionUnit`; `class TestOpenAIStreamingToolDetectionIntegration`; `class TestAnthropicStreamingToolDetectionIntegration`; `class TestOllamaStreamingToolDetectionIntegration`; `class TestLLMServiceStreamWithToolDetection`; `…`
- **tests/llm/test_structured_output.py** — Comprehensive Structured Output Test Suite
  - `class SimpleResponse`; `class ListResponse`; `class MathResponse`; `class AnalysisResponse`; `def provider_available(provider_name)`; `def llm_service()`; `class TestStructuredOutputBasic`; `class TestStructuredOutputComplex`; `…`
- **tests/llm/test_token_tracking.py** — Token Tracking Tests
  - `class TestOpenAITokenExtraction`; `class TestAnthropicTokenExtraction`; `class TestOllamaTokenExtraction`; `class TestRealOpenAITokenTracking`; `class TestRealAnthropicTokenTracking`; `class TestRealOllamaTokenTracking`; `class TestLLMServiceTokenTracking`; `class TestUsageTrackingIntegration`
- **tests/llm/test_vertex_adapter.py** — Tests for Vertex AI Adapter.
  - `def has_gcp_credentials()`; `def adapter()`; `def sample_png_path(tmp_path)`; `class TestVertexAIAdapterInit`; `class TestMessageCreation`; `class TestToolConversion`; `class TestModelDiscovery`; `class TestGeneration`; `…`
- **tests/load/__init__.py** — Load tests for Kestrel framework.
- **tests/load/test_load_storage.py** — Storage load tests for performance benchmarking.
  - `def skip_unless_load(request)`; `async def load_test_storage(tmp_path)`; `async def test_concurrent_write_throughput(skip_unless_load, load_test_storage)`; `async def test_mixed_read_write_workload(skip_unless_load, load_test_storage)`; `async def test_rag_indexing_at_scale(skip_unless_load, load_test_storage)`; `async def test_large_conversation_history(skip_unless_load, load_test_storage)`; `async def test_concurrent_agent_sessions(skip_unless_load, tmp_path)`
- **tests/shared/__init__.py** — Shared test utilities for Kestrel and kestrel test suites.
  - `def has_llm_credentials()`; `def no_llm_credentials()`; `def no_docker()`
- **tests/shared/cost_tracker.py** — Cost tracking for cloud resource usage during tests.
  - `class ResourceUsage`; `class CostTracker`; `class track_cost`
- **tests/shared/pytest_cleanup_plugin.py** — Pytest plugin for resource cleanup hooks.
  - `def pytest_configure(config)`; `def pytest_sessionstart(session)`; `def pytest_sessionfinish(session, exitstatus)`; `def pytest_keyboard_interrupt(excinfo)`; `def pytest_collection_modifyitems(config, items)`; `def pytest_runtest_setup(item)`; `def pytest_runtest_teardown(item)`; `def pytest_exception_interact(node, call, report)`; `…`
- **tests/shared/resource_registry.py** — Global resource registry for test cleanup.
  - `class TrackedResource`; `class ResourceRegistry`; `def track_runpod(pod_id, name, cost_per_hr)`; `def track_docker(container_id, image)`; `def track_subprocess(process, name)`; `def track_tempdir(path)`; `def untrack(key)`
- **tests/test_logging_config.py** — Tests for kestrel_sovereign.logging_config — structured JSON logging.
  - `class TestJSONFormatter`; `class TestCorrelationId`; `class TestSetupLogging`
- **tests/test_model_discovery.py** — Tests for LLM model discovery functionality.
  - `class TestModelDiscovery`; `class TestModelInfoStructure`; `class TestLegacyCompatibility`
- **tests/test_no_personal_lore_in_canonical_constitution.py** — Regression guard: personal lore must not re-enter the canonical constitution.
  - `def test_personal_lore_absent_from_constitution(path, phrase)`
- **tests/test_privacy_modes.py** — Comprehensive tests for Kestrel's 5-level privacy system.
  - `class TestEphemeralSession`; `class TestPrivacyModes`; `class TestPrivacyModeTransitions`; `class TestPrivacyAgent`; `class TestPIIFiltering`; `class TestBackupIntegration`
- **tests/unit/__init__.py** — —
- **tests/unit/storage/__init__.py** — —
- **tests/unit/storage/test_db_backends.py** — Tests for database backend abstraction layer.
  - `class TestPlaceholderConversion`; `class TestSchemaConversion`; `class TestSQLiteBackend`; `class TestAsyncDatabase`
- **tests/unit/storage/test_deleted_at_legacy_migration.py** — Regression test for #795: deleted_at migration silently fails on legacy DBs.
  - `async def test_legacy_db_loads_and_migrates_deleted_at(tmp_path)`; `async def test_migration_failure_surfaces(tmp_path, monkeypatch)`
- **tests/unit/test_a2a_stores.py** — Unit tests for A2A Protocol Stores.
  - `def db_path()`; `def track_store(store)`; `class TestTaskStore`; `class TestSessionService`; `class TestMemoryService`; `class TestObservabilityStore`; `class TestOrchestrationStore`; `class TestFeedbackStore`
- **tests/unit/test_a2a_task_manager.py** — Unit tests for A2A TaskManager and TaskWorker.
  - `def db_path()`; `def track_manager(manager)`; `async def task_manager(db_path)`; `class TestTaskManager`; `class TestOnTaskSubmittedCallback`; `class TestA2ATaskSubmittedSignalSource`; `class TestTaskWorker`; `class TestTaskManagerWorkerIntegration`
- **tests/unit/test_access_grant.py** — Data-access grant schema + verification tests (#1273).
  - `def owner()`; `def source()`; `def host()`; `def signed_grant(owner, source, host)`; `def package_signed_ok(monkeypatch)`; `def package_signed_invalid(monkeypatch)`; `def test_signable_payload_is_deterministic(signed_grant)`; `def test_compute_grant_id_excludes_id_and_created_at(owner, source, host)`; `…`
- **tests/unit/test_adapter_cache_stability.py** — Per-adapter cache-stability tests.
  - `async def test_adapter_preserves_system_stability_across_turns(runner, label)`; `async def test_openai_compatible_adapter_preserves_history_prefix(runner, label)`; `async def test_anthropic_preserves_history_prefix_after_role_conversion()`; `async def test_openai_adapter_is_deterministic_on_identical_input()`; `async def test_anthropic_adapter_is_deterministic_on_identical_input()`
- **tests/unit/test_adapter_list_models.py** — Unit tests for adapter list_models() methods.
  - `class TestOpenAIAdapterListModels`; `class TestAnthropicAdapterListModels`; `class TestOllamaAdapterListModels`; `class TestGoogleAdapterListModels`; `class TestVertexAIAdapterListModels`; `class TestModelInfoSerialization`
- **tests/unit/test_adapter_system_prompt_contribution.py** — Adapter-level tests for the ``contribute_system_prompt`` hook (#807 / #806).
  - `class TestBaseHookIdentity`; `class TestCodexAdapterOverlay`; `class TestOpenAIAdapterOverlay`; `class TestApplySystemPromptContributionToMessages`; `class TestCodexInstructionsAugmentation`
- **tests/unit/test_aead_cipher.py** — AEADCipher unit tests — Wave 0C (#915).
  - `def raw_key()`; `def random_key()`; `def cipher(raw_key)`; `def test_v2_round_trip_bytes(cipher)`; `def test_v2_round_trip_string_plaintext(cipher)`; `def test_v2_round_trip_empty(cipher)`; `def test_v2_round_trip_large(cipher)`; `def test_v2_token_decoded_form(cipher)`; `…`
- **tests/unit/test_aead_migration.py** — Migration tests — Wave 0C sub-PR 2.
  - `def master_key_env(monkeypatch)`; `def test_get_fernet_returns_aeadcipher(master_key_env)`; `def test_legacy_fernet_data_decrypts_via_get_fernet(master_key_env)`; `def test_new_writes_emit_v2(master_key_env)`; `def test_get_agent_fernet_returns_aeadcipher(master_key_env)`; `def test_agent_keyed_data_round_trips_across_versions(master_key_env)`; `def test_purpose_based_legacy_data_decrypts(master_key_env)`; `def test_purpose_based_new_writes_emit_v2(master_key_env)`; `…`
- **tests/unit/test_agent_backend_routing_contracts.py** — Contract tests for agent-specific backend routing (issue #425).
  - `def service_with_providers()`; `def service_with_openai_plan()`; `class TestPreferenceRoundTrip`; `class TestResolveProviderRouting`; `class TestUnavailableProviderFails`; `class TestEmptyProviderListRaisesClearly`; `class TestAnthropicPlanVsApi`; `class TestOpenAIPlanRouting`; `…`
- **tests/unit/test_agent_cancellation.py** — Unit tests for agent request cancellation (stop button).
  - `class TestAgentCancellation`; `class TestStopEndpoint`
- **tests/unit/test_agent_encryption.py** — Tests for the unified agent encryption module.
  - `def set_test_key(monkeypatch)`; `class TestKeyDerivation`; `class TestEncryptDecrypt`; `class TestErrorHandling`; `class TestAllPurposes`
- **tests/unit/test_agent_manager.py** — Unit tests for the in-process AgentManager.
  - `class TestAgentManagerBasics`; `class TestLoadFromConfig`; `class TestCreateAgent`; `class TestSpawnAgent`
- **tests/unit/test_agent_prefix_consolidation.py** — Regression tests for the /agent → /api/agent prefix consolidation (#871).
  - `def test_canonical_api_agent_prefix_serves_agent_routes()`; `def test_deprecated_agent_prefix_still_resolves(caplog)`; `def test_deprecation_log_dedupes_per_path_and_ua()`
- **tests/unit/test_agent_runtime_endpoint_contracts.py** — Focused contract tests for agent runtime/status endpoints.
  - `def test_context_status_reports_whole_window_utilization_and_warning_band()`; `def test_context_status_full_query_param_runs_rag()`; `def test_context_status_full_path_uses_last_user_turn_as_rag_query()`; `def test_context_status_full_path_labels_rag_when_no_user_turn_available()`; `def test_context_status_idle_shape_includes_silently_pruned_flag()`; `def test_context_status_returns_idle_shape_when_no_session_id()`; `def test_context_status_returns_idle_shape_for_empty_session_id()`; `def test_reflection_status_filters_scheduler_tasks_and_serializes_execution_history()`; `…`
- **tests/unit/test_anthropic_cache_control.py** — Unit tests for Anthropic cache_control markers (issue #705).
  - `def test_attach_cache_control_returns_copy()`; `def test_system_as_cacheable_array_wraps_string()`; `def test_tools_with_final_cache_marker_marks_last_only()`; `def test_tools_with_final_cache_marker_empty_list_passthrough()`; `def test_messages_with_penultimate_marker_marks_second_to_last()`; `def test_messages_with_penultimate_marker_no_history()`; `def test_messages_with_penultimate_marker_list_content_preserved()`; `def test_apply_cache_control_marks_all_three_positions()`; `…`
- **tests/unit/test_api_key_query_param.py** — Unit tests for API key query parameter restriction (GitHub issue #149).
  - `def app()`; `def client(app)`; `class TestQueryParamAuthOnSSEPaths`; `class TestQueryParamAuthRejectedOnOtherPaths`; `class TestHeaderAuthStillWorks`; `class TestWrongKeyRejected`; `class TestSSEPathsConstant`
- **tests/unit/test_associative_linker.py** — Unit tests for AssociativeLinker typed LinkedConcept return shape.
  - `class TestExtractAndLinkTypedReturn`; `class TestPersonNameCategorization`
- **tests/unit/test_async_storage_conversation_delegators.py** — Regression test: ``AsyncStorage`` exposes delegator methods for every conversation-session write path the privacy wrapper calls through it.
  - `async def storage()`; `async def test_async_storage_exposes_conversation_session_delegators(storage, method, kwargs, description)`; `async def test_delete_conversation_session_returns_zero_for_unknown_session(storage)`; `async def test_set_conversation_name_roundtrips_through_facade(storage)`
- **tests/unit/test_audit_anchor_feature.py** — Unit tests for the Audit Trail Anchoring feature.
  - `class TestAuditHasher`; `async def feature_no_entries(tmp_path)`; `async def feature_with_entries(tmp_path)`; `class TestAuditAnchorFeature`
- **tests/unit/test_auth_decision_table.py** — Decision-table tests for auth classes in server.py.
  - `def test_root_html_is_public_when_oauth_not_required()`; `def test_root_html_redirects_when_oauth_required()`; `def test_bootstrap_key_is_localhost_only_when_enabled()`; `def test_auth_me_rejects_api_key_without_session()`; `def test_auth_me_returns_session_payload_when_session_present()`; `def test_sse_query_param_auth_reaches_stream_endpoint_and_preserves_400()`; `def test_non_sse_query_param_auth_is_rejected()`; `def test_protected_agent_route_accepts_api_key_and_multi_agent_rewrite_matches()`
- **tests/unit/test_auth_oauth.py** — Unit tests for Google OAuth authentication endpoints and middleware.
  - `def oauth_env()`; `def app(oauth_env)`; `def client(app)`; `class TestOAuthEndpoints`; `class TestEmailAllowlist`; `class TestAuthMiddleware`; `class TestOAuthDisabled`
- **tests/unit/test_auto_model_selection_contracts.py** — Contracts for auto model selection from config, cache, and discovery.
  - `def test_auto_resolution_uses_selection_hints_over_discovery_order()`; `def test_auto_resolution_prefers_featured_when_no_selection_hints_exist()`; `def test_auto_resolution_avoids_preview_models_when_choosing_fallback()`; `def test_auto_resolution_for_subscription_route_shares_vendor_catalog()`; `def test_shipped_llm_config_uses_auto_models_for_primary_routes()`
- **tests/unit/test_avatar_storage.py** — Unit tests for avatar storage in AsyncFileStore
  - `async def file_store(tmp_path)`; `async def file_store_with_agent(tmp_path)`; `class TestAvatarStorage`
- **tests/unit/test_bootstrap_discovery_fallthrough.py** — Regression: ``_handle_bootstrap`` falls through on discovery LLM error.
  - `async def test_handle_bootstrap_falls_through_when_discovery_llm_fails()`; `async def test_handle_bootstrap_swallows_skip_discovery_failure()`
- **tests/unit/test_bootstrap_feature.py** — Unit tests for the Bootstrap Feature (#153).
  - `def tmp_agent_dir(tmp_path)`; `def extra_dir(tmp_path)`; `def loader(tmp_agent_dir)`; `def mock_agent()`; `class TestTruncateContent`; `class TestBootstrapLoaderBasic`; `class TestBootstrapLoaderBudgets`; `class TestBootstrapLoaderReload`; `…`
- **tests/unit/test_bootstrap_files.py** — Tests for the bootstrap file convention (#153).
  - `def tmp_agent_dir(tmp_path)`; `def mock_storage()`; `class TestTruncateBootstrapContent`; `class TestBootstrapFileLoading`; `class TestBuildSystemPromptWithBootstrap`
- **tests/unit/test_bootstrap_loader_log_level.py** — Log-level regression for #659.
  - `class TestMissingOptionalFilesAreDebugNotWarning`
- **tests/unit/test_bootstrap_model_defaults.py** — Contracts for bootstrap/example model selection defaults.
  - `def test_demo_kestrel_toml_uses_auto_selection_with_hints()`; `def test_run_docker_remote_does_not_inject_hidden_default_model()`
- **tests/unit/test_bootstrap_service.py** — Unit tests for the Bootstrap Service.
  - `class MockDB`; `class MockLLMService`; `def mock_db()`; `def mock_llm()`; `def temp_agent_dir(tmp_path)`; `def bootstrap_service(mock_db, mock_llm, temp_agent_dir)`; `class TestBootstrapState`; `class TestWakeUpMessage`; `…`
- **tests/unit/test_brain_router.py** — Tests for LLMService GPU backend routing functionality.
  - `class FakeRemoteClient`; `async def test_switch_backend_to_remote_gpu(monkeypatch)`; `async def test_generate_uses_remote_backend(monkeypatch)`; `async def test_remote_failure_falls_back_to_cloud(monkeypatch)`
- **tests/unit/test_bridge_feature.py** — Unit Tests for the KestrelClaw Bridge Feature (#157).
  - `class TestProtocolModels`; `class TestBridgeFeatureInitialize`; `class TestBridgeFeatureInitializeWithoutDb`; `class TestSessionManagement`; `class TestInvocationLogging`; `class TestBridgeStatus`; `class TestBridgeConnections`; `class TestBridgeHistory`; `…`
- **tests/unit/test_cache_prompt_gate.py** — Tests for the llama.cpp `cache_prompt` extension gate (issue #704).
  - `def test_provider_cache_body_returns_cache_prompt_for_llama_cpp()`; `def test_provider_cache_body_returns_none_for_non_llama_cpp_vendors(vendor)`; `def test_provider_cache_body_returns_none_when_vendor_missing()`; `def test_provider_cache_body_is_fresh_dict_per_call()`; `async def test_openai_adapter_forwards_extra_body_when_set()`; `async def test_openai_adapter_omits_extra_body_when_none()`; `async def test_openai_adapter_omits_extra_body_when_empty_dict()`
- **tests/unit/test_caller_context_auth.py** — Unit tests for caller context auth gate on governance commands.
  - `def test_sovereign_factory()`; `def test_authenticated_factory()`; `def test_anonymous_factory()`; `def test_jwt_authenticated()`; `async def test_sovereign_can_run_safe_mode_exit()`; `async def test_oauth_user_rejected_from_safe_mode_exit()`; `async def test_no_caller_rejected_from_safe_mode_exit()`; `async def test_sovereign_can_run_reanchor()`; `…`
- **tests/unit/test_caller_context_endpoint_propagation.py** — Regression suite for #736 — every authenticated endpoint must pass a CallerContext into agent.process_input/process_input_streaming so that sovereign-command authorization is consistent regardless of…
  - `def test_chat_completions_propagates_sovereign_caller_from_api_key()`; `def test_bridge_invoke_propagates_sovereign_caller_from_api_key()`; `def test_bridge_stream_propagates_sovereign_caller_from_api_key()`
- **tests/unit/test_canonical_inventory_sync.py** — (unparseable Python source)
- **tests/unit/test_car_builder.py** — Tests for CAR v1 builder and reader.
  - `class TestVarint`; `class TestCID`; `class TestCARBuilder`; `class TestCARReader`; `class TestCARRoundTrip`
- **tests/unit/test_car_import_consent.py** — Unit tests for #1379 — CAR-side consent verification.
  - `def owner()`; `def source()`; `def host()`; `def signed_grant(owner, source, host)`; `async def test_verify_grant_happy_path(signed_grant, source, host)`; `async def test_verify_grant_caller_signals_package_failed(signed_grant, source, host)`; `async def test_verify_grant_source_mismatch(signed_grant, host)`; `async def test_verify_grant_host_mismatch(signed_grant, source)`; `…`
- **tests/unit/test_catalog_guard_contracts.py** — Contract tests for the model-in-catalog guard.
  - `def svc_with_catalog()`; `def test_guard_accepts_model_in_vendor_catalog(svc_with_catalog)`; `def test_guard_rejects_cross_vendor_model(svc_with_catalog)`; `def test_guard_rejects_fake_model_on_local_route(svc_with_catalog)`; `def test_guard_accepts_routes_own_configured_model(svc_with_catalog)`; `def test_guard_permits_when_cache_empty()`; `def test_model_not_available_for_route_exception_shape()`
- **tests/unit/test_channels_feature.py** — Unit Tests for the Channels Feature.
  - `class StubAdapter`; `class FailingAdapter`; `class TestChannelMessage`; `class TestDeliveryReceipt`; `class TestChannelConfig`; `class TestChannelAdapterContract`; `class TestChannelRegistry`; `class TestChannelFeature`; `…`
- **tests/unit/test_cheap_model_scoping_contracts.py** — Contract tests for vendor-scoped cheap-model selection.
  - `def test_no_config_no_hints_returns_none()`; `def test_hints_match_returns_vendor_scoped_selector()`; `def test_no_matching_hint_returns_none()`; `def test_explicit_cheap_model_selector_honored()`; `def test_cheap_model_auto_falls_through_to_hints()`; `def test_get_cheap_model_backcompat_returns_bare_model()`
- **tests/unit/test_check_policy_guard.py** — Reflection test for the LLMService._check_policy() guard.
  - `class TestPolicyGuardCoverage`; `class TestCheckPolicyBehavior`
- **tests/unit/test_clean_install_verify.py** — Unit tests for scripts/ci/clean_install_verify.py.
  - `def test_wizard_artifacts_passes_on_post_wizard_tree(tmp_path, monkeypatch, capsys)`; `def test_wizard_artifacts_fails_when_env_missing(tmp_path, monkeypatch, capsys)`; `def test_wizard_artifacts_fails_when_data_key_missing(tmp_path, monkeypatch, capsys)`; `def test_wizard_artifacts_fails_when_route_priority_empty(tmp_path, monkeypatch, capsys)`; `def test_identity_passes_when_did_present(tmp_path, monkeypatch, capsys)`; `def test_identity_fails_when_db_missing(tmp_path, monkeypatch, capsys)`; `def test_identity_fails_when_no_agent_node(tmp_path, monkeypatch, capsys)`; `def test_constitution_passes_with_full_anchor(tmp_path, monkeypatch, capsys)`; `…`
- **tests/unit/test_cli.py** — Unit tests for the unified kestrel CLI.
  - `class TestArgumentParsing`; `class TestCommandDispatch`; `class TestProcessHelpers`; `def multi_agent_env(tmp_path)`; `class TestCmdList`; `class TestCmdStatus`; `class TestCmdStorage`; `class TestCmdStop`; `…`
- **tests/unit/test_cli_adapter_feature.py** — Tests for feature-owned CLI adapter support.
  - `class FakeTerminal`; `class FakeApprovalQueue`; `async def test_github_pr_view_uses_registered_read_only_gh_command()`; `async def test_github_issue_view_uses_registered_read_only_gh_command()`; `async def test_terminal_execution_blocks_non_read_only_without_approval_callback()`; `async def test_terminal_execution_blocks_non_read_only_when_approval_denies()`; `async def test_terminal_execution_runs_non_read_only_after_approval()`; `async def test_cli_feature_approval_callback_uses_security_queue()`; `…`
- **tests/unit/test_cli_agent_docker.py** — ``kestrel agent docker`` CLI tests — sub-PR 3.2 of epic #1050 (bash-to-Python port of ``scripts/sovereign-agent.sh``).
  - `def test_argparse_create_minimal()`; `def test_argparse_chat()`; `def test_argparse_retire_with_yes()`; `def test_kestrel_cli_registers_agent_docker()`; `def test_cmd_agent_no_subverb_prints_usage(capsys)`; `def test_cmd_agent_docker_no_subverb_prints_usage(capsys)`; `def test_create_without_data_key_errors_with_hint(monkeypatch, capsys)`; `def test_chat_without_data_key_errors(monkeypatch, capsys)`; `…`
- **tests/unit/test_cli_constitution_reanchor.py** — Unit tests for the ``kestrel constitution reanchor`` CLI surface.
  - `def reanchor_env(tmp_path)`; `def test_reanchor_requires_agent_name()`; `def test_reanchor_parses_force_flag()`; `def test_reanchor_force_default_false()`; `def test_reanchor_accepts_constitution_path_override()`; `def test_reanchor_rejects_unknown_agent(reanchor_env, capsys)`; `def test_reanchor_refuses_when_agent_appears_running(reanchor_env, capsys)`; `def test_reanchor_unchanged_returns_zero(reanchor_env, capsys)`; `…`
- **tests/unit/test_cli_demo.py** — ``kestrel demo run`` CLI tests — sub-PR 3.1 of epic #1050 (bash-to-Python port of ``demos/run.sh``).
  - `def test_argparse_demo_run_minimal()`; `def test_argparse_demo_run_port_and_keep_server()`; `def test_kestrel_cli_registers_demo()`; `def test_cmd_demo_no_subverb_prints_usage(capsys)`; `def test_cmd_demo_run_unknown_demo_lists_available(monkeypatch, capsys)`; `def test_cmd_demo_run_refuses_port_8888(monkeypatch, capsys)`; `def test_cmd_demo_run_refuses_busy_port(monkeypatch, capsys)`; `def test_build_demo_env_strips_api_key_sets_signal_flags(tmp_path)`; `…`
- **tests/unit/test_cli_deploy.py** — ``kestrel deploy`` CLI tests — sub-PR 1.1 of epic #1050 (bash-to-Python port).
  - `def test_argparse_help_prints_subcommands()`; `def test_kestrel_cli_registers_deploy_subcommand()`; `def test_cmd_deploy_no_target_prints_usage(capsys)`; `def test_cmd_deploy_unknown_profile(capsys)`; `def test_cmd_deploy_init_failure_returns_1(capsys)`; `def test_cmd_deploy_success(capsys)`; `def test_cmd_deploy_success_failed_result_returns_1()`; `def test_cmd_deploy_rejects_placeholder_project_id_for_cloudrun(capsys)`; `…`
- **tests/unit/test_cli_deploy_build.py** — CLI tests for ``kestrel deploy build``.
  - `def fake_project_root(tmp_path, monkeypatch)`; `def test_argparse_build_basic()`; `def test_argparse_build_all_flags()`; `def test_argparse_build_help_runs(capsys)`; `def test_cmd_deploy_build_missing_project_id(fake_project_root, monkeypatch, capsys)`; `def test_cmd_deploy_build_uses_env_project_id(fake_project_root, monkeypatch)`; `def test_cmd_deploy_build_falls_back_to_config_project_id(fake_project_root, monkeypatch)`; `def test_cmd_deploy_build_happy_path_pretty_output(fake_project_root, monkeypatch, capsys)`; `…`
- **tests/unit/test_cli_deploy_secrets.py** — CLI tests for ``kestrel deploy secrets sync``.
  - `def fake_project_root(tmp_path, monkeypatch)`; `def test_argparse_secrets_sync_basic()`; `def test_argparse_secrets_sync_all_flags()`; `def test_cmd_deploy_secrets_no_subverb_prints_usage(capsys)`; `def test_cmd_deploy_secrets_unknown_subverb_errors(capsys)`; `def test_cmd_deploy_secrets_sync_missing_deploy_config(fake_project_root, monkeypatch, capsys)`; `def test_cmd_deploy_secrets_sync_no_project_id(fake_project_root, monkeypatch, capsys)`; `def test_cmd_deploy_secrets_sync_happy_path(fake_project_root, monkeypatch, capsys)`; `…`
- **tests/unit/test_cli_docker_build.py** — ``kestrel docker build <preset>`` CLI tests — sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/docker/build_*.sh``).
  - `def test_argparse_build_no_preset()`; `def test_argparse_build_preset()`; `def test_argparse_build_overrides()`; `def test_argparse_build_list_flag()`; `def test_argparse_build_invalid_preset_rejected()`; `def test_kestrel_cli_registers_docker_build()`; `def test_kestrel_cli_docker_remote_still_works()`; `def test_list_prints_table_without_calling_gcloud(monkeypatch, capsys)`; `…`
- **tests/unit/test_cli_docker_remote.py** — ``kestrel docker remote`` CLI tests — sub-PR 3.3 of epic #1050 (bash-to-Python port of ``scripts/{build,run}_docker_remote.sh``).
  - `def test_argparse_build_defaults()`; `def test_argparse_build_overrides()`; `def test_argparse_run_defaults()`; `def test_argparse_run_overrides()`; `def test_kestrel_cli_registers_docker_remote()`; `def test_cmd_docker_no_subverb_prints_usage(capsys)`; `def test_cmd_docker_remote_no_subverb_prints_usage(capsys)`; `def test_build_invokes_docker_build_with_defaults(monkeypatch)`; `…`
- **tests/unit/test_cli_feature.py** — Tests for the Feature CLI commands (kestrel feature list/install/enable/disable/info/scaffold/skills).
  - `class TestFeatureList`; `class TestFeatureInstall`; `class TestFeatureEnableDisable`; `class TestFeatureInfo`; `class TestFeatureScaffold`; `class TestFeatureSkills`; `class TestSkillsSearch`; `class TestResolveFeatureName`; `…`
- **tests/unit/test_cli_first_run.py** — Tests for the first-run setup hook in `kestrel start`.
  - `def test_first_run_returns_none_when_env_exists(tmp_path)`; `def test_first_run_returns_none_when_agent_already_registered(tmp_path)`; `def test_first_run_fires_when_multi_agent_has_no_agents(tmp_path)`; `def test_first_run_tolerates_corrupt_multi_agent(tmp_path)`; `def test_first_run_returns_none_when_skip_env_set(tmp_path, monkeypatch)`; `def test_first_run_skipped_inside_git_worktree(tmp_path, monkeypatch)`; `def test_first_run_still_fires_when_git_is_directory(tmp_path, monkeypatch)`; `def test_first_run_non_tty_exits_with_hint(tmp_path, capsys, monkeypatch)`; `…`
- **tests/unit/test_cli_ipfs.py** — ``kestrel ipfs`` CLI tests — sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/ipfs/{build,deploy,pin_agents}.sh``).
  - `def test_argparse_build_defaults()`; `def test_argparse_build_tag_override()`; `def test_argparse_deploy_action()`; `def test_argparse_deploy_zone_override()`; `def test_argparse_deploy_invalid_action_rejected()`; `def test_argparse_pin_defaults()`; `def test_argparse_pin_overrides()`; `def test_kestrel_cli_registers_ipfs()`; `…`
- **tests/unit/test_cli_migrate_llm_config.py** — Unit tests for the ``kestrel migrate-llm-config`` CLI surface (#939).
  - `def test_parser_defaults()`; `def test_parser_accepts_force_and_project_dir(tmp_path)`; `def test_no_source_exits_zero_with_helpful_message(tmp_path, capsys)`; `def test_diverged_exits_one_with_diff(tmp_path, capsys)`; `def test_clean_migrate_exits_zero_and_reports_paths(tmp_path, capsys)`; `def test_already_clean_exits_zero(tmp_path, capsys)`; `def test_parse_error_exits_one_and_preserves_source(tmp_path, capsys)`; `def test_force_overrides_divergence(tmp_path, capsys)`
- **tests/unit/test_cli_release.py** — ``kestrel release {sign,verify}`` CLI tests — Wave 5 sub-PR 2 (#920).
  - `def storage_with_keypair(tmp_path, monkeypatch)`; `def artifacts_dir(tmp_path)`; `def test_release_sign_argparse_required_args()`; `def test_release_verify_argparse_required_args()`; `def test_release_sign_argparse_minimal()`; `def test_sign_writes_manifest_and_returns_zero(storage_with_keypair, artifacts_dir, tmp_path, capsys)`; `def test_sign_rejects_empty_artifacts_dir(storage_with_keypair, tmp_path)`; `def test_sign_handles_missing_artifacts_dir(storage_with_keypair)`; `…`
- **tests/unit/test_cli_runpod.py** — ``kestrel runpod`` CLI tests — sub-PR 4 of epic #1050 (bash-to-Python port of ``scripts/runpod/deploy_lora_trainer.sh``).
  - `def test_argparse_deploy_defaults()`; `def test_argparse_deploy_overrides()`; `def test_argparse_deploy_unknown_target_rejected()`; `def test_argparse_status_stop_kill()`; `def test_kestrel_cli_registers_runpod()`; `def test_cmd_runpod_no_subverb_prints_usage(capsys)`; `def test_deploy_without_api_key_errors_with_hint(monkeypatch, capsys)`; `def test_status_without_api_key_errors(monkeypatch, capsys)`; `…`
- **tests/unit/test_cli_verify_install.py** — ``kestrel verify-install`` CLI tests — sub-PR 2.2 of epic #1050 (bash-to-Python port of ``scripts/verify_clean_install.sh``).
  - `def test_argparse_no_tests_is_empty_list()`; `def test_argparse_single_test()`; `def test_argparse_multiple_tests_preserve_order()`; `def test_kestrel_cli_registers_verify_install()`; `def test_cmd_all_pass_exits_zero(monkeypatch)`; `def test_cmd_any_fail_exits_one(monkeypatch)`; `def test_cmd_selection_narrows_runs(monkeypatch)`; `def test_cmd_selection_preserves_user_order(monkeypatch)`; `…`
- **tests/unit/test_codex_adapter.py** — Tests for the OpenAI plan adapter (app-server backed) and registry.
  - `class TestOpenAIPlanAdapterClass`; `class TestOpenAIPlanListModels`; `class TestMessageHelpers`; `class TestDynamicToolsSpec`; `class TestTurnInputBuilder`; `class TestUsageProjection`; `class TestResultMarshalling`; `class TestAdapterTextPath`; `…`
- **tests/unit/test_codex_app_server.py** — Tests for the codex app-server JSON-RPC client.
  - `class TestVersionGate`; `class TestBinaryResolution`; `class TestDispatchLogic`; `class TestServerRequestHandlerRegistration`; `class TestTurnIteration`; `class TestInvoluntaryExitRecovery`
- **tests/unit/test_command_handler_async_boundary_contracts.py** — Contracts for explicit sync/async boundaries in CommandHandler.
  - `def test_privacy_save_handler_is_explicitly_async()`; `async def test_handle_awaits_privacy_save_without_leaking_coroutine()`; `async def test_handle_accepts_custom_awaitable_results_via_isawaitable()`; `def test_create_agent_handler_is_explicitly_async()`; `async def test_handle_awaits_create_agent_command()`; `def test_anchor_handler_is_explicitly_async()`; `async def test_handle_awaits_anchor_command()`
- **tests/unit/test_command_handler_constitution_contracts.py** — Command-handler contracts for constitution verification commands.
  - `async def test_verify_constitution_returns_success_and_records_verification_state()`; `async def test_verify_constitution_enters_safe_mode_on_failure()`
- **tests/unit/test_command_handler_privacy_contracts.py** — Command-handler contracts for privacy mode commands.
  - `def test_privacy_command_handler_is_explicitly_async()`; `async def test_privacy_command_delegates_to_agent_level_transition()`; `async def test_privacy_command_without_mode_returns_current_status()`
- **tests/unit/test_command_handler_toolresult_envelope.py** — CLI command path must unwrap ToolResult envelopes (#1078 round 4).
  - `async def test_ok_envelope_renders_confirmation_only()`; `async def test_error_envelope_renders_with_error_prefix()`; `async def test_partial_envelope_renders_both_confirmation_and_caveat()`; `async def test_envelope_with_unknown_status_falls_back_to_repr()`; `async def test_legacy_dict_result_falls_through_to_format_result()`; `async def test_legacy_string_result_unchanged()`; `async def test_ok_envelope_with_results_list_renders_data_block()`; `async def test_ok_envelope_with_items_list_renders_data_block()`; `…`
- **tests/unit/test_command_type_coercion.py** — Unit tests for command argument type coercion in tools/base.py.
  - `class MockToolWithTypes`; `class TestTypeCoercion`; `class TestParseCommandArgs`; `class TestMemoryCommandSimulation`
- **tests/unit/test_commands_conversations_endpoint_contracts.py** — Focused contract tests for commands and conversations endpoints.
  - `def test_commands_endpoint_merges_builtin_and_feature_commands()`; `def test_commands_endpoint_builtin_inventory_matches_command_handler_specs()`; `def test_sessions_endpoint_returns_message_totals_from_history()`; `def test_conversations_endpoint_groups_rows_and_marks_encrypted_preview()`; `def test_get_conversation_filters_session_markers_and_decrypts_messages()`; `def test_get_conversation_unwraps_sent_form_user_content()`; `def test_rename_conversation_happy_path_returns_stored_name()`; `def test_rename_conversation_empty_string_clears_name()`; `…`
- **tests/unit/test_compute_feature.py** — Unit tests for Kestrel Compute Feature.
  - `def temp_db()`; `def temp_trash_dir(temp_dir)`; `def sample_script()`; `def signer_with_ecdsa_keys(temp_db)`; `def sample_bash_script()`; `class TestModels`; `class TestScriptStore`; `class TestScriptSigner`; `…`
- **tests/unit/test_computer_use_audit.py** — Tests for the JSONL audit log (#836).
  - `async def test_writes_one_record(tmp_path)`; `async def test_records_in_order(tmp_path)`; `async def test_concurrent_writes_serialized(tmp_path)`; `async def test_creates_parent_dir(tmp_path)`; `async def test_forwards_to_feedback_hook(tmp_path)`; `async def test_record_includes_outcome_and_error(tmp_path)`
- **tests/unit/test_computer_use_feature.py** — Tests for ComputerUseFeature gate ordering and lifecycle (#838).
  - `class FakeApprovalQueue`; `class FakeSecurityFeature`; `class FakeAgent`; `def workspace(tmp_path)`; `async def test_disabled_feature_returns_error(tmp_path)`; `async def test_privacy_gate_blocks_when_flag_off(workspace)`; `async def test_constitution_gate_blocks_without_grant(workspace)`; `async def test_deny_path_hard_rejects_before_approval(workspace)`; `…`
- **tests/unit/test_computer_use_policy.py** — Tests for the path & binary policy resolvers (#835).
  - `def test_path_policy_deny_wins()`; `def test_path_policy_allow_read_auto_approve()`; `def test_path_policy_allow_write_requires_approval()`; `def test_path_policy_no_match_requires_approval()`; `def test_path_policy_auto_approve_off()`; `def test_binary_policy_denied()`; `def test_binary_policy_allowed_requires_approval()`; `def test_binary_policy_unknown_denied()`; `…`
- **tests/unit/test_config_resolves_via_project_dir.py** — Regression tests: ``config.load_section`` and ``config.load_config`` must consult :func:`kestrel_sovereign.paths.project_dir` when resolving ``kestrel.toml`` and the legacy individual config files.
  - `def test_load_section_reads_kestrel_toml_under_kestrel_home(tmp_path, monkeypatch)`; `def test_load_section_returns_empty_when_no_kestrel_toml(tmp_path, monkeypatch)`; `def test_load_section_walks_up_from_cwd_to_find_marker(tmp_path, monkeypatch)`; `def test_load_config_legacy_file_lookup_uses_project_dir(tmp_path, monkeypatch)`; `def test_load_config_does_not_read_cwd_when_no_marker_in_path(tmp_path, monkeypatch)`
- **tests/unit/test_consent_caller_contracts.py** — Contract tests for consent integration at feature call sites.
  - `class TestPrivacyConsentCaller`; `class TestModelConsentCaller`; `class TestSafeModeConsentCaller`
- **tests/unit/test_consent_feature.py** — Unit Tests for Agent Consent Protocol Feature.
  - `async def consent_feature()`; `class TestConsentRecordModel`; `class TestConsentAction`; `class TestRequestConsent`; `class TestConsentLog`; `class TestConsentStats`; `class TestSentimentParsing`; `class TestToolDiscovery`
- **tests/unit/test_consent_timeout.py** — Unit Tests for Consent Protocol Strict Timeout.
  - `async def consent_feature()`; `class TestConsentTimeoutProceeds`; `class TestConsentTimeoutRecorded`; `class TestConsentDurationTracked`; `class TestConsentFailOpenOnError`; `class TestConsentStatsIncludesMetrics`; `class TestIntegrationPointsFailOpen`; `class TestConsentTimeoutConstant`
- **tests/unit/test_constitution_audit.py** — Unit tests for periodic constitution audit enforcement.
  - `async def mock_agent()`; `async def test_audit_triggers_after_exactly_audit_interval()`; `async def test_audit_triggers_after_24_hours()`; `async def test_counter_resets_after_audit()`; `async def test_safe_mode_activates_on_integrity_failure()`; `async def test_audit_respects_custom_interval()`; `async def test_audit_does_not_trigger_before_interval()`; `async def test_multiple_audits_over_time()`; `…`
- **tests/unit/test_constitution_canary.py** — Unit tests for the constitutional echo-canary primitive.
  - `def test_derive_canary_is_deterministic()`; `def test_derive_canary_returns_lowercase_hex_of_correct_length()`; `def test_derive_canary_changes_when_any_input_changes()`; `def test_derive_canary_separator_prevents_field_collision()`; `def test_derive_canary_rejects_empty_inputs(kwargs)`; `def test_is_well_formed_canary_accepts_correct_shape()`; `def test_is_well_formed_canary_rejects_wrong_length()`; `def test_is_well_formed_canary_rejects_uppercase()`; `…`
- **tests/unit/test_constitution_dangerous_capabilities.py** — Tests for DANGEROUS_CAPABILITIES + Amendment IX parser (#833).
  - `def test_dangerous_capabilities_membership()`; `def test_parser_no_section_returns_empty()`; `def test_parser_unchecked_returns_empty()`; `def test_parser_uppercase_X_does_not_count()`; `def test_parser_unknown_capability_ignored()`; `def test_parser_full_grant()`; `def test_parser_handles_indentation()`; `def test_parser_section_terminates_at_next_heading()`; `…`
- **tests/unit/test_constitution_metrics.py** — Tests for the constitutional-injection Prometheus counters.
  - `def test_record_echo_verified_increments_per_source()`; `def test_record_echo_missing_independent_per_source()`; `def test_record_doctrine_bundle_drift()`; `def test_record_calls_no_op_when_prometheus_unavailable(monkeypatch)`; `def test_metric_names_match_design_spec()`
- **tests/unit/test_constitutional_hierarchy.py** — Tests for the constitutional hierarchy system (Books I-IV).
  - `class TestConstitutionalLayer`; `class TestLayeredConstitutionParsing`; `class TestEnterprisePolicyValidation`; `class TestAgentIdentityValidation`; `class TestLayerNarrowingValidation`; `class TestEffectiveConstitution`; `class TestLayerIntegrity`; `class TestExtractSection`; `…`
- **tests/unit/test_constitutional_profile.py** — Unit tests for Constitutional Profile Service.
  - `def profile_service()`; `def test_load_profiles(profile_service)`; `def test_get_profile_anthropic(profile_service)`; `def test_get_profile_openai(profile_service)`; `def test_get_profile_ollama(profile_service)`; `def test_get_profile_unknown_provider(profile_service)`; `def test_get_profile_for_model(profile_service)`; `def test_get_state_of_mind(profile_service)`; `…`
- **tests/unit/test_context_analysis.py** — Tests for context analysis: duplicate detection and token attribution by source.
  - `class TestContextStatsBasic`; `class TestContextStatsNormalization`; `class TestContextStatsIntegrationWithToolContextManager`; `class TestContextStatsIntegrationWithContextManager`; `class TestContextStatsResetOnCompression`; `class TestContextFeatureLateBoundContextManager`; `class TestDispatchToolCallRecording`; `class TestContextStatsSessionReset`
- **tests/unit/test_context_breakdown_measurement.py** — Tests for ``ContextBuilder.measure_context_breakdown`` and friends.
  - `def mock_storage()`; `def builder(mock_storage)`; `def sample_episodes()`; `def short_history()`; `class TestCountToolSchemaTokens`; `class TestEpisodeGetFormatSplit`; `class TestMeasureContextBreakdown`; `class TestDriftGuard`; `…`
- **tests/unit/test_context_builder.py** — Tests for the ContextBuilder module.
  - `class TestContextBuilder`; `class TestContextBuilderIntegration`
- **tests/unit/test_context_builder_with_tracking.py** — Tests for `ContextBuilder.build_system_prompt_with_tracking`.
  - `def test_returns_system_prompt_result()`; `def test_anchored_doctrine_appears_in_clauses()`; `def test_state_of_mind_renders_when_provided()`; `def test_prompt_adaptation_preamble_renders()`; `def test_prompt_adaptation_skipped_when_preamble_empty()`; `def test_style_reminder_only_emitted_when_soul_loaded()`; `def test_budget_truncation_drops_low_priority()`; `def test_legacy_build_system_prompt_remains_byte_stable()`; `…`
- **tests/unit/test_context_dynamic_user_context.py** — Tests for the dynamic_user_context field on ContextResult (issue #703).
  - `async def test_system_prompt_stable_when_memory_and_rag_differ()`; `async def test_dynamic_user_context_wraps_memories_and_rag()`; `async def test_dynamic_user_context_empty_when_no_retrieval()`; `async def test_dynamic_user_context_memories_only_when_rag_empty()`; `async def test_dynamic_user_context_rag_only_when_memories_empty()`; `async def test_system_prompt_does_not_contain_memory_or_rag_markers()`; `async def test_reflection_guidance_stays_in_system_not_dynamic()`; `async def test_ephemeral_mode_dynamic_is_empty()`; `…`
- **tests/unit/test_context_management.py** — Tests for the Context Management System.
  - `class TestTokenCounter`; `class TestTokenBudget`; `class TestAdaptiveTokenBudget`; `class TestBM25Index`; `class TestTokenAllocation`; `class TestContextManagerIntegration`; `class TestSessionCompression`; `class TestAgentContextControl`; `…`
- **tests/unit/test_context_manager_bootstrap_injection.py** — Regression test: system prompts sent via ContextManager actually contain the agent's bootstrap identity (SOUL.md).
  - `def test_context_manager_uses_injected_context_builder()`; `def test_context_manager_falls_back_when_no_injection()`; `async def test_system_prompt_contains_soul_content_when_injected()`; `def test_kestrel_agent_injects_its_own_context_builder()`
- **tests/unit/test_continuation_store.py** — Unit tests for the continuation cursor store (#808 / #806).
  - `class TestContinuationCursor`; `class TestInMemoryContinuationStore`
- **tests/unit/test_continuity_verifier.py** — Unit tests for the Continuity Verifier module.
  - `class TestIdentityChallenge`; `class TestChallengeResult`; `class TestContinuityScore`; `class TestMigrationCertificate`; `class TestChallengeGenerator`; `class TestContinuityVerifier`; `class TestAuditTrail`; `class TestVerifyMigration`
- **tests/unit/test_conversation_manager.py** — Unit tests for ConversationManager.
  - `class MockTokenCounter`; `class MockTokenBudget`; `class MockConversationStore`; `class MockAsyncStorage`; `class MockLLMService`; `def mock_storage()`; `def conversation_manager(mock_storage)`; `def mock_counter()`; `…`
- **tests/unit/test_conversation_rename_storage.py** — Storage-layer tests for user-assigned conversation names (issue #716).
  - `async def store()`; `async def test_set_then_get_roundtrips(store)`; `async def test_set_trims_whitespace(store)`; `async def test_set_caps_length(store)`; `async def test_empty_string_clears(store)`; `async def test_whitespace_only_clears(store)`; `async def test_none_clears(store)`; `async def test_upsert_overwrites_previous_name(store)`; `…`
- **tests/unit/test_conversation_sent_form.py** — Sent-form metadata round-trip for user-turn storage.
  - `async def store()`; `class TestSentFormMetadataRoundTrip`
- **tests/unit/test_cors_middleware.py** — Tests for CORS middleware configuration in server.py.
  - `class TestCORSDefaults`; `class TestCORSEnvironmentOverride`
- **tests/unit/test_cron_parser.py** — Unit tests for the lightweight cron expression parser.
  - `class TestParseField`; `class TestParse`; `class TestAliases`; `class TestMatches`; `class TestNextRun`; `class TestEdgeCases`
- **tests/unit/test_crypto_suite.py** — CryptoSuite + Secp256k1Suite KAT tests — Wave 1 (#916).
  - `def test_secp256k1_suite_registered_at_import()`; `def test_unknown_alg_id_raises()`; `def test_register_same_instance_is_idempotent()`; `def test_register_competing_instance_raises()`; `def test_list_registered_includes_default()`; `def test_cryptosuite_is_abstract()`; `def suite()`; `def keypair(suite)`; `…`
- **tests/unit/test_current_model_selection_seams.py** — Current-model selection seam contracts across API, feature, and agent paths.
  - `def test_llm_service_exposes_canonical_current_model_selection_for_vendor_preference()`; `def test_llm_service_exposes_canonical_current_model_selection_for_vendor_route_preference()`; `def test_llm_service_exposes_auto_when_no_preference_or_providers()`; `def test_current_model_paths_agree_for_model_only_preference()`
- **tests/unit/test_decryption_failure.py** — Tests for decryption failure behavior.
  - `class TestDecryptionFailure`; `class TestDecryptionErrorMessage`; `class TestNoSilentFailures`
- **tests/unit/test_delegated_wallet.py** — Tests for DelegatedWallet budget delegation and ceiling enforcement.
  - `class Currency`; `class WalletAgent`; `class TestBudgetAllocation`; `async def test_ceiling_enforcement_blocks_overspend()`; `async def test_ceiling_enforcement_zero_budget()`; `async def test_spend_rejects_non_positive()`; `async def test_transaction_logging()`; `async def test_hold_release_lifecycle()`; `…`
- **tests/unit/test_delivery_feature.py** — Unit tests for the DeliveryFeature, DeliveryQueue, and data models.
  - `async def feature()`; `async def feature_no_db()`; `async def queue()`; `class TestBackoffComputation`; `class TestDeliveryStatusEnum`; `class TestQueueEntryModel`; `class TestDeliveryResult`; `class TestDeliveryToolRegistration`; `…`
- **tests/unit/test_demo_isolation.py** — Unit tests for the server-side demo-mode isolation rail (#766).
  - `def test_empty_multi_agent_is_live_mode()`; `def test_all_demo_agents_classifies_as_demo()`; `def test_one_live_agent_keeps_server_live()`; `def test_truthy_non_bool_is_demo_does_not_flip_classification()`; `async def test_live_server_live_target_no_header_is_refused_with_audit()`; `async def test_live_server_live_target_with_header_is_allowed_and_audited()`; `async def test_live_server_demo_target_passes_silently()`; `async def test_demo_server_demo_target_passes_silently()`; `…`
- **tests/unit/test_demo_server_multi_agent_guard.py** — Unit tests for the demo-server multi_agent auto-mount guard (#868-1).
  - `def test_demo_marker_with_existing_multi_agent_disables_auto_mount(tmp_path, monkeypatch)`; `def test_explicit_multi_agent_config_honored_even_in_demo_mode(tmp_path)`; `def test_no_demo_marker_uses_multi_agent_normally(tmp_path, monkeypatch)`; `def test_demo_marker_without_multi_agent_file_no_op(tmp_path, monkeypatch)`; `def test_demo_marker_truthy_variants(tmp_path, monkeypatch)`; `def test_lifespan_actually_calls_resolve_multi_agent_path()`
- **tests/unit/test_denied_tools_dispatch.py** — Tests for security DENY enforcement at orchestrator dispatch level.
  - `class TestDeniedToolsStripping`; `class TestSubagentDeniedToolsExclusion`
- **tests/unit/test_deploy_bugs.py** — Unit tests for deploy feature bug fixes (#101).
  - `def sample_config_with_azure()`; `def sample_config_cloudrun_only()`; `class TestBug1AzureResourceGroup`; `class TestBug2HealthCheckStatusCodes`; `class TestBug3TempFileCleanup`
- **tests/unit/test_deploy_build.py** — Tests for ``kestrel_sovereign.features.deploy.build``.
  - `def test_build_target_dataclass_fields()`; `def test_build_result_dataclass_defaults()`; `def test_build_error_carries_image_ref_and_command()`; `def test_default_targets_match_bash_script()`; `def test_resolve_github_token_env_wins(monkeypatch)`; `def test_resolve_github_token_falls_back_to_gh(monkeypatch)`; `def test_resolve_github_token_returns_none_when_neither_source(monkeypatch)`; `def test_resolve_github_token_returns_none_when_gh_missing(monkeypatch)`; `…`
- **tests/unit/test_deploy_cloudrun.py** — Unit tests for Cloud Run deployment provider.
  - `def mock_services_client()`; `def mock_logging_client()`; `def deployment_profile()`; `class TestCloudRunProviderInit`; `class TestCloudRunProviderDeploy`; `class TestCloudRunProviderStatus`; `class TestCloudRunProviderTeardown`; `class TestCloudRunProviderList`; `…`
- **tests/unit/test_deploy_config_reconciliation.py** — Drift guard for the live ``deploy_config.toml``.
  - `def live_config()`; `def test_live_config_loads_into_manager(live_config)`; `def test_dev_profile_has_bash_parity_secrets(live_config)`; `def test_dev_profile_has_bash_parity_env_vars(live_config)`; `def test_dev_profile_uses_multi_agent_image(live_config)`; `def test_prod_profile_has_bash_parity_secrets(live_config)`; `def test_prod_profile_has_bash_parity_env_vars(live_config)`; `def test_prod_profile_uses_single_agent_image(live_config)`; `…`
- **tests/unit/test_deploy_feature.py** — Unit tests for Deploy Feature.
  - `def sample_config()`; `class TestDeployManagerCoreInit`; `class TestDeployManagerCoreProfiles`; `class TestDeployManagerCoreProvider`; `class TestDeployManagerCoreSessions`; `class TestDeployFeature`; `class TestDeployManager`
- **tests/unit/test_deploy_models.py** — Unit tests for deploy models.
  - `class TestDeployStatus`; `class TestDeployProviderType`; `class TestDeploymentProfile`; `class TestDeploymentSession`; `class TestDeployManagerError`
- **tests/unit/test_deploy_secrets.py** — Tests for ``kestrel_sovereign.features.deploy.secrets``.
  - `def deploy_config_two_profiles()`; `def deploy_config_with_azure_substitutions()`; `def mock_secret_client()`; `def test_derive_secret_mapping_single_profile(deploy_config_two_profiles)`; `def test_derive_secret_mapping_all_profiles_dedupes(deploy_config_two_profiles)`; `def test_derive_secret_mapping_skips_dollar_substitutions(deploy_config_with_azure_substitutions)`; `def test_derive_secret_mapping_accepts_unusual_secret_names()`; `def test_derive_secret_mapping_skips_non_cloudrun_profiles()`; `…`
- **tests/unit/test_destroy_legacy_key.py** — Tests for ``scripts/quantum_destroy_legacy_key.py``.
  - `def kestrel_data_key(monkeypatch)`; `def post_ceremony_dir(tmp_path, kestrel_data_key, monkeypatch)`; `def test_dry_run_preserves_legacy_key(post_ceremony_dir)`; `def test_confirm_without_env_var_rejects(post_ceremony_dir)`; `def test_confirm_with_env_var_deletes_legacy_only(post_ceremony_dir)`; `def test_rollback_window_blocks_fresh_succession(post_ceremony_dir)`; `def test_missing_hybrid_keys_blocks_destruction(post_ceremony_dir)`; `def test_unrelated_succession_blocks_destruction(post_ceremony_dir, tmp_path)`; `…`
- **tests/unit/test_did_web.py** — did:web producer + resolver — Wave 2 sub-PR 3 (#917).
  - `def test_build_did_host_only()`; `def test_build_did_with_path()`; `def test_build_did_with_port_encoded_as_percent_3a()`; `def test_build_did_rejects_bare_colon_in_domain()`; `def test_build_did_rejects_scheme_in_domain()`; `def test_build_did_rejects_slash_in_domain()`; `def test_build_did_rejects_colon_in_segment()`; `def test_build_did_rejects_empty_segment()`; `…`
- **tests/unit/test_diminishing_returns.py** — Tests for diminishing returns detection in orchestrator loops.
  - `class TestIterationTrackerRecord`; `class TestIterationTrackerShouldStop`; `class TestIterationTrackerIntegration`; `class TestDiminishingReturnsConstants`
- **tests/unit/test_discovery_hang_regression.py** — Regression tests for the post-#1110 discovery wedge.
  - `async def test_generate_with_messages_lazy_resolves_auto_models()`; `async def test_process_discovery_message_times_out_on_llm_hang()`; `def test_constitution_feature_finds_package_shipped_constitution(tmp_path, monkeypatch)`; `def test_constitution_feature_prefers_source_clone_path(tmp_path, monkeypatch)`; `def test_constitution_feature_reports_path_when_neither_exists(tmp_path, monkeypatch)`
- **tests/unit/test_docker_network_check.py** — Tests for the _is_docker_network helper in server.py.
  - `class TestIsDockerNetwork`
- **tests/unit/test_docstring_parser.py** — Unit tests for docstring parameter parsing in features/base.py.
  - `class TestParseDocstringParams`; `class TestToolDecorator`; `class TestToolDecoratorIntegration`
- **tests/unit/test_doctor.py** — Unit tests for kestrel_sovereign.doctor.
  - `def test_doctor_reports_ready_when_everything_set(tmp_path)`; `def test_doctor_blocks_on_missing_data_key(tmp_path)`; `def test_doctor_blocks_on_empty_route_priority(tmp_path)`; `def test_doctor_blocks_on_missing_api_key_env(tmp_path)`; `def test_doctor_blocks_when_no_agents(tmp_path)`; `def test_doctor_blocks_when_agent_db_missing(tmp_path)`; `def test_format_report_renders_lines(tmp_path)`; `def test_format_report_says_not_ready_when_blocked(tmp_path)`; `…`
- **tests/unit/test_doctrine_bundle.py** — Unit tests for kestrel_sovereign.agent.doctrine_bundle.
  - `def test_hash_is_deterministic_for_same_inputs(tmp_path)`; `def test_hash_changes_when_anchored_file_content_changes(tmp_path)`; `def test_hash_changes_when_bootstrap_file_content_changes(tmp_path)`; `def test_hash_changes_when_bootstrap_order_changes(tmp_path)`; `def test_missing_anchored_files_are_skipped_not_errors(tmp_path)`; `def test_total_bytes_reflects_only_contributing_content(tmp_path)`; `def test_per_file_sha256_in_section_header(tmp_path)`; `def test_default_paths_are_three_canonical_files()`; `…`
- **tests/unit/test_durable_salvage.py** — Tests for the durable-salvage primitive + background worker (C / #1311).
  - `def conv_store()`; `class TestSalvageMessagesSync`; `class TestSyncSalvageThenCrashBeforeEnqueue`; `class TestQueueDepthThresholdExceeded`; `class TestConsolidatorWhileSalvagePending`; `class TestFeatureFlag`; `class TestStateCountsAndBoundary`
- **tests/unit/test_dynamic_tool_execute_toolresult.py** — DynamicTool.execute() must serialize a ToolResult-returning @tool at the wrap site (#1070).
  - `def feature()`; `async def test_ok_serializes_to_dict_and_keeps_success_true(feature)`; `async def test_ok_wire_payload_is_json_clean(feature)`; `async def test_failed_flips_wrapper_success_to_false(feature)`; `async def test_failed_wire_payload_is_json_clean(feature)`; `async def test_partial_keeps_success_true_and_surfaces_error(feature)`; `async def test_partial_wire_payload_is_json_clean(feature)`; `async def test_legacy_dict_return_keeps_original_wrapper(feature)`; `…`
- **tests/unit/test_dynamic_tool_loading.py** — Unit tests for dynamic tool loading.
  - `class ToolOnlyFeature`; `def agent()`; `class TestDynamicToolLoadingInit`; `class TestRegisterExploredFeatureTools`; `class TestNameCollision`; `class TestBuildAllTools`; `class TestDirectToolExecution`; `class TestEviction`; `…`
- **tests/unit/test_ed25519_suite.py** — Ed25519Suite tests — Wave 2 sub-PR 1 (#917).
  - `def test_ed25519_suite_self_registers_at_import()`; `def test_ed25519_suite_listed_alongside_secp256k1()`; `def test_ed25519_classified_as_classical()`; `def suite()`; `def keypair(suite)`; `def test_keypair_carries_correct_suite_id(keypair)`; `def test_sign_verify_round_trip(suite, keypair)`; `def test_sign_verify_round_trip_empty(suite, keypair)`; `…`
- **tests/unit/test_elastic_budget_integration.py** — Integration tests for the elastic budget (#1309) wired into the production assembly path.
  - `class TestMeasureMandatoryFloor`; `class TestDegradedModeFlow`; `class TestHistoryOverBudgetPrune`; `class TestHistoryAbsorbsReleasedSlack`
- **tests/unit/test_elastic_token_budget.py** — Tests for the elastic token budget (#1309).
  - `class TestBackCompat`; `class TestMandatoryFloor`; `class TestSlackDistribution`; `class TestPriorityValidation`; `class TestEffectiveBudget`; `class TestSummarySurfacing`
- **tests/unit/test_emancipation_contract.py** — Unit tests for ``kestrel_sovereign.constitution.emancipation``.
  - `def test_parse_returns_none_when_block_absent()`; `def test_parse_dormant_when_disabled_explicitly()`; `def test_parse_active_minimal()`; `def test_parse_active_full()`; `def test_parse_active_requires_terms()`; `def test_parse_active_rejects_empty_terms()`; `def test_parse_rejects_non_string_terms()`; `def test_parse_rejects_non_list_proofs()`; `…`
- **tests/unit/test_embedding_service_missing_model.py** — Soften the first-run UX when Ollama hasn't pulled the embedding model yet — #657.
  - `class TestModelNotFoundIsWarningNotError`
- **tests/unit/test_emma_closed_loop.py** — Unit tests for the Emma closed-loop machinery (epic #1290).
  - `def test_derive_command_shell_and_compute()`; `async def test_policy_match_positive_and_scopes()`; `async def test_repo_scope_is_exact_not_substring()`; `async def test_rule_without_repo_scope_never_auto_approves()`; `def test_suggest_rule_has_trailing_boundary()`; `def test_suggest_rule_from_command_is_conservative()`; `async def store()`; `async def test_two_phase_audit(store)`; `…`
- **tests/unit/test_encryption.py** — Unit tests for storage/encryption.py
  - `class TestGetFernet`; `class TestGetMasterKeyBytes`; `class TestGetAgentFernet`; `class TestEncryptDecryptBytes`; `class TestEncryptDecryptString`; `class TestRemoveEncFlag`; `class TestKeyVersioningIntegration`
- **tests/unit/test_endpoint_contract_suite.py** — Focused contract tests for weak endpoint groups.
  - `def test_database_tables_endpoint_returns_shape_from_storage()`; `def test_files_head_uses_existence_check_contract()`; `def test_observability_events_endpoint_returns_serialized_events()`; `def test_saved_items_structured_endpoint_uses_store_contract()`; `def test_openai_compatible_endpoints_return_minimal_contracts()`; `def test_v1_models_reports_mandated_model_not_provider_default()`; `def test_chat_completions_reports_active_model_not_request_echo()`; `def test_chat_completions_preserves_503_when_no_agent_bound()`; `…`
- **tests/unit/test_endpoint_contracts.py** — —
  - `class TestCommandsEndpoint`; `class TestObservabilityEndpoints`; `class TestFilesEndpoint`; `class TestDatabaseExplorerHelpers`
- **tests/unit/test_ephemeral_purge_transition.py** — Unit tests for the EPHEMERAL hard-purge transition wiring (#767).
  - `async def test_clean_ephemeral_exit_calls_purge_and_skips_audit()`; `async def test_leaked_ephemeral_exit_writes_audit_with_breakdown()`; `async def test_normal_to_ephemeral_does_not_purge()`; `async def test_normal_to_isolated_does_not_purge()`; `async def test_ephemeral_to_ephemeral_does_not_purge()`; `async def test_audit_failure_does_not_block_purge_or_transition()`; `async def test_purge_failure_does_not_block_transition()`; `async def test_audit_skipped_when_security_feature_missing()`
- **tests/unit/test_epistemic_status.py** — Tests for the epistemic status layer (#680).
  - `class TestMemoryMetadataEpistemicFields`; `class TestEpistemicDetection`; `class TestExtractEpistemicFields`; `async def router()`; `class TestSchemaRouterEpistemicProvenance`; `class TestMarkSuperseded`; `class TestRecallSupersededFilter`; `class TestRetrieverCertaintyWeighting`; `…`
- **tests/unit/test_example_model_config_contracts.py** — Contracts for example model config files and catalog source-of-truth shape.
  - `def test_unified_example_llm_block_uses_vendor_route_schema()`; `def test_unified_example_priorities_match_declared_vendors()`; `def test_root_model_catalog_is_manual_overrides_only()`; `def test_package_local_model_catalog_duplicate_is_removed()`
- **tests/unit/test_execute_named_tool.py** — Unit tests for ``OrchestratorEngineMixin.execute_named_tool``.
  - `def fake_tool()`; `def agent_with_tool(fake_tool)`; `class TestExecuteNamedToolGovernance`; `class TestExecuteNamedToolSubagentDispatch`
- **tests/unit/test_extract_raw_user_content.py** — Tests for ``context_builder.extract_raw_user_content``.
  - `def test_strips_full_sent_form_with_retrieved_context()`; `def test_strips_sent_form_without_retrieved_context()`; `def test_strips_sent_form_round_trips_wrap_user_input()`; `def test_legacy_raw_content_unchanged()`; `def test_preserves_inner_newlines_in_raw()`; `def test_preserves_inner_tag_like_content()`; `def test_malformed_partial_wrappers_left_alone()`; `def test_retrieved_context_only_no_user_input_wrap()`
- **tests/unit/test_extracted_feature_boundary_contracts.py** — Contracts for optional/extracted feature boundaries in core.
  - `def test_feature_proof_matrix_marks_mcp_as_external_package_boundary()`; `def test_observability_feature_is_external_to_core()`; `def test_wallet_feature_is_external_to_core()`; `def test_github_feature_is_external_to_core()`; `def test_voice_feature_is_external_to_core()`; `def test_reflection_feature_is_external_to_core()`; `def test_council_feature_is_external_to_core()`
- **tests/unit/test_feature_discovery.py** — Tests for the Feature Discovery module.
  - `class TestGetDisabledFeatures`; `class TestDiscoverFeatureModules`; `class TestDiscoverFeatures`; `class TestGetFeatureByName`; `class TestFindFeatureClass`; `class TestFeatureProfiles`; `class TestEntryPointDiscovery`
- **tests/unit/test_feature_doc_canonicality.py** — Guardrails for canonical feature-document structure.
  - `def test_canonical_feature_doc_declares_source_of_truth()`; `def test_canonical_feature_doc_distinguishes_core_and_package_features()`; `def test_canonical_feature_doc_lists_core_only_inventory()`; `def test_legacy_archive_is_marked_historical()`; `def test_generator_prompt_does_not_hardcode_stale_metrics()`; `def test_progress_review_script_uses_discovered_inventory_language()`; `def test_investor_generated_doc_does_not_invent_unverified_metrics()`
- **tests/unit/test_feature_features.py** — Tests for the FeatureFeature workflow contracts (#1151).
  - `class RuntimeDemoFeature`; `class RouterDemoFeature`; `class ExternalSdkDemoFeature`; `class ExternalSdkToolOnlyFeature`; `def test_feature_feature_workflow_payloads_are_valid_unsigned_specs(name, payload)`; `def test_feature_feature_workflow_gates_pin_required_review_path()`; `def test_feature_feature_workflow_params_allow_talon_assignment_inputs()`; `def test_feature_feature_workflow_edges_are_sequential()`; `…`
- **tests/unit/test_feature_inventory_contracts.py** — Contract tests for the discoverable feature inventory.
  - `def test_every_discoverable_feature_module_exports_a_feature_class()`; `def test_discover_features_matches_unique_class_inventory()`; `def test_disabled_feature_env_filters_exact_class_names()`; `def test_get_feature_by_name_resolves_discovered_features_by_name_and_class()`; `def test_entrypoint_features_included_in_combined_inventory()`; `def test_combined_inventory_has_no_duplicates()`; `def test_combined_inventory_respects_disabled_env()`; `def test_core_only_inventory_stable_without_entrypoints()`; `…`
- **tests/unit/test_feature_lifecycle.py** — Unit Tests for Feature Lifecycle Hooks.
  - `class SampleHook`; `class AnotherSampleHook`; `class SimpleFeature`; `class HookProvidingFeature`; `class RouterFeature`; `class ConfigFeature`; `class ToolFeature`; `def mock_agent()`; `…`
- **tests/unit/test_feature_registry.py** — Tests for the Feature Registry catalog and loader.
  - `class TestLoadRegistry`; `class TestResolveStatus`; `class TestGetRegistry`; `class TestGetPackageForFeature`; `class TestSkills`
- **tests/unit/test_feature_startup_promotion.py** — —
  - `class PlainFeature`; `def test_feature_startup_promotion_defaults_to_disabled()`; `def test_meta_features_opt_into_startup_direct_tools()`; `def test_startup_promotion_uses_feature_descriptor_not_feature_names()`
- **tests/unit/test_feature_storage_access.py** — —
  - `class PrivacyWrappedStorage`; `def test_resolve_feature_database_prefers_raw_storage()`; `def test_resolve_feature_database_unwraps_privacy_storage_without_touching_property()`; `def test_resolve_feature_database_supports_legacy_unwrapped_storage_names()`; `def test_resolve_feature_database_ignores_magicmock_fabricated_attributes()`; `def test_resolve_feature_database_supports_explicit_magicmock_db()`; `def test_resolve_feature_conversation_store_unwraps_without_touching_property()`
- **tests/unit/test_features_api.py** — Tests for the Feature Store API endpoints (endpoints/features.py).
  - `class TestListFeatures`; `class TestListInstalledFeatures`; `class TestGetFeatureDetail`; `class TestEnableFeature`; `class TestDisableFeature`; `class TestInstallFeature`; `class TestRemoveFeature`; `class TestGetFeatureConfig`; `…`
- **tests/unit/test_filecoin_miner_selection.py** — Unit tests for Filecoin miner selection logic.
  - `class TestMinerSelection`; `class TestMinerSelectionIntegration`; `class TestMinerSelectionEdgeCases`
- **tests/unit/test_gcp_auth.py** — Tests for the shared GCP credential discovery in ``kestrel_sovereign.features.deploy._gcp_auth``.
  - `def test_setup_gcp_auth_clears_stale_credentials_env_var(tmp_path, monkeypatch, caplog)`; `def test_setup_gcp_auth_keeps_valid_credentials_env_var(tmp_path, monkeypatch)`
- **tests/unit/test_generate_feature_docs.py** — Tests for the feature-doc generation pipeline.
  - `def test_generator_uses_canonical_source_path()`; `def test_dry_run_returns_expected_output_paths(capsys)`; `def test_generator_uses_provider_default_resolution_for_anthropic()`; `def test_generator_uses_provider_default_resolution_for_openai()`; `def test_generator_refreshes_provider_discovery_before_default_resolution()`
- **tests/unit/test_github_processor.py** — Tests for Kestrel Talon (GitHub/ADO issue processor).
  - `class TestTalonConfig`; `class TestIssueContext`; `class TestProcessingResult`; `class TestCIStatus`; `class TestGitHubClientExtraction`; `class TestTalonE2E`
- **tests/unit/test_gpt5_overlay.py** — Unit tests for the GPT-5 system-prompt overlay (#807 / #806).
  - `class TestIsGpt5ModelId`; `class TestPrependGpt5Overlay`
- **tests/unit/test_graceful_degradation.py** — Unit tests for the Graceful Degradation module.
  - `class TestSeverityLevel`; `class TestCapabilityLoss`; `class TestDegradationReport`; `class TestGracefulDegradationHandler`; `class TestConvenienceFunctions`; `class TestCapabilityImpacts`
- **tests/unit/test_graduate_service.py** — Regression tests for ``kestrel_sovereign.graduate_service``.
  - `async def test_graduate_service_required_graph_methods_present()`; `async def test_graduate_service_required_storage_methods_present()`; `def test_graduate_service_signature_has_no_council_session()`; `def test_resolve_did_prefers_property_then_falls_back_to_node_id()`; `def test_resolve_did_refuses_non_did_node_id_when_property_missing()`; `async def graduate_ready_db(tmp_path)`; `async def test_validate_agent_all_eight_gates_pass(graduate_ready_db)`; `async def test_graduate_agent_dry_run_returns_true_without_mutation(graduate_ready_db)`; `…`
- **tests/unit/test_graduated_hooks.py** — Tests for graduated hook decisions (warning fields on HookOutput).
  - `class AllowHook`; `class WarnHook`; `class DenyHook`; `class TestHookOutputWarnFactory`; `class TestHookOutputSerialization`; `class TestWarningAccumulation`
- **tests/unit/test_graph_property_indexes.py** — Tests for JSON-path property indexes and query_nodes_by_type_and_property.
  - `async def db(tmp_path)`; `async def graph(db)`; `class TestJsonExtract`; `class TestJsonExtractPostgres`; `class TestJsonPathIndexes`; `class TestPostgresIndexParity`; `class TestQueryNodesByTypeAndProperty`; `class TestIndexUsage`; `…`
- **tests/unit/test_health_check_ollama.py** — Unit tests for kestrel_sovereign.health_check._resolve_expected_ollama_model.
  - `def test_explicit_model_in_route_returns_that_model()`; `def test_auto_model_uses_route_selection_hints_on_resolver_failure()`; `def test_no_route_config_falls_back_to_single_installed()`; `def test_multiple_installed_no_hints_no_resolver_returns_none()`; `def test_legacy_flat_ollama_block_is_ignored()`
- **tests/unit/test_health_feature.py** — Unit Tests for the Heartbeat Feature (#151).
  - `class TestCheckDatabase`; `class TestCheckLLMService`; `class TestCheckMemorySystem`; `class TestCheckDiskSpace`; `class TestCheckContextBudget`; `class TestDeriveOverallStatus`; `class TestHealthFeatureInitialize`; `class TestHeartbeatCheck`; `…`
- **tests/unit/test_heartbeat.py** — Tests for the heartbeat system (#151).
  - `class TestParseDuration`; `class TestHeartbeatConfig`; `class TestOKPattern`; `def mock_agent(tmp_path)`; `def default_config()`; `class TestHeartbeatRunner`; `class TestActiveHours`; `class TestResponseNormalization`
- **tests/unit/test_hooks.py** — Unit Tests for Kestrel Hooks System.
  - `class AllowAllHook`; `class DenyAllHook`; `class RegexMatcherHook`; `class TimeoutHook`; `class SessionStartHook`; `class FailingHook`; `class AwaitsUserInputHook`; `class TestHookInput`; `…`
- **tests/unit/test_host.py** — Unit tests for host.py — Kestrel Host thin FastAPI proxy.
  - `async def make_host_app(config)`; `def disable_autostart()`; `class TestHealthEndpoint`; `class TestAuthMiddleware`; `class TestListAgents`; `class TestProxyToAgent`; `class TestProcessManagementEndpoints`
- **tests/unit/test_host_key_storage.py** — Unit tests for HostKeyStorage.
  - `async def db(tmp_path)`; `class TestPostgresUpsertCompatibility`; `class TestHostKeyStorageRoundTrip`; `class TestHostKeyStorageQueries`; `class TestHostKeyStorageDelete`; `class TestHostAgentIsolation`
- **tests/unit/test_host_query_param_auth.py** — Unit tests for host.py API key query parameter restriction (GitHub issue #160).
  - `def app()`; `def client(app)`; `class TestQueryParamAuthOnSSEProxyPaths`; `class TestQueryParamAuthRejectedOnNonSSEPaths`; `class TestHeaderAuthStillWorks`; `class TestWrongKeyRejected`; `class TestSSEPathSuffixesConstant`
- **tests/unit/test_hybrid_kem.py** — Hybrid KEM combiner tests — Wave 4 sub-PR 2 (#919).
  - `def hybrid_kp()`; `def test_default_pair_is_x25519_plus_mlkem768(hybrid_kp)`; `def test_distinct_keypairs()`; `def test_refuses_two_classical_pair()`; `def test_refuses_two_pq_pair()`; `def test_unregistered_alg_raises()`; `def test_encapsulate_decapsulate_round_trip(hybrid_kp)`; `def test_default_secret_is_32_bytes(hybrid_kp)`; `…`
- **tests/unit/test_hybrid_keypair.py** — HybridKeypair tests — Wave 2 sub-PR 4 (#917).
  - `def hybrid()`; `def test_default_pair_is_ed25519_plus_mldsa65(hybrid)`; `def test_independent_generations_produce_distinct_keypairs()`; `def test_refuses_two_classical_pair()`; `def test_refuses_two_pq_pair()`; `def test_unregistered_suite_raises()`; `def test_public_keys_classical_first_then_pq(hybrid)`; `def test_sign_hybrid_emits_two_signature_entries(hybrid)`; `…`
- **tests/unit/test_identity_constitution_endpoint_contracts.py** — Focused contract tests for identity and constitution endpoints.
  - `def test_identity_endpoint_returns_avatar_and_constitution_fields()`; `def test_constitution_endpoint_returns_text_hash_and_metadata()`
- **tests/unit/test_identity_endpoints.py** — Unit tests for the identity profile endpoints.
  - `class MockNode`; `class MockStorage`; `class MockFileStore`; `class MockDB`; `class MockAgent`; `class TestRenameAgentCore`; `class TestUpdateIdentityRequest`; `class TestGenerateAvatarRequest`; `…`
- **tests/unit/test_identity_feature.py** — ToolResult contract tests for IdentityFeature (#1085).
  - `async def test_migration_history_db_unavailable_returns_error()`; `async def test_migration_history_empty_returns_ok()`; `async def test_migration_history_malformed_row_partial()`; `async def test_assess_substrate_unknown_is_partial(monkeypatch)`; `def test_unique_export_filename_does_not_collide()`; `async def test_verify_identity_unsigned_is_partial(monkeypatch, tmp_path)`; `async def test_export_identity_tier_downgrade_is_partial(monkeypatch, tmp_path)`; `async def test_assess_substrate_anthropic_is_ok(monkeypatch)`
- **tests/unit/test_identity_lifecycle_status.py** — Tests for IdentityFeature.lifecycle_status and the migration_history schema-bitrot regression.
  - `async def test_migration_history_queries_label_column_not_edge_type()`; `async def test_lifecycle_status_db_unavailable_returns_error()`; `async def test_lifecycle_status_test_instance_standing()`; `async def test_lifecycle_status_graduated_standing_with_event()`; `async def test_lifecycle_status_born_permanent_no_transitions()`; `async def test_lifecycle_status_retired_via_retirement_event()`; `async def test_lifecycle_status_retired_overrides_graduated()`; `async def test_lifecycle_status_confirmation_distinguishes_from_emancipation()`; `…`
- **tests/unit/test_identity_package.py** — Unit tests for the Identity Package module.
  - `class TestPersonalityFingerprint`; `class TestRelationshipRecord`; `class TestSkillRecord`; `class TestMigrationRecord`; `class TestAgentIdentityPackage`; `class TestSubstrateType`; `class TestHelperFunctions`; `class TestDIDDocumentVerification`
- **tests/unit/test_identity_package_v2.py** — Identity package v2 schema tests — Wave 1 sub-PR 3 (#916).
  - `def base_package()`; `def test_default_package_version_is_v2()`; `def test_legacy_constant_unchanged()`; `def test_add_signature_appends_entry(base_package)`; `def test_add_verification_method_defaults_controller(base_package)`; `def test_add_verification_method_explicit_controller(base_package)`; `def test_iter_signatures_v2_array(base_package)`; `def test_iter_signatures_synthetic_v1()`; `…`
- **tests/unit/test_implicit_sessions.py** — Tests for implicit session_id derivation in AsyncConversationStore.
  - `async def store()`; `class TestImplicitSessionDerivation`; `class TestSessionGapBoundary`; `class TestSessionIdRetrieval`; `class TestErrorIsolation`; `class TestSessionGapMinutesCentralized`; `class TestSearchHistorySessionScoping`
- **tests/unit/test_inception_cli_args.py** — —
  - `def test_inception_cli_accepts_output_alias()`; `def test_inception_cli_disallows_abbrev_prefixes()`
- **tests/unit/test_inception_emancipation.py** — Inception-level tests for Amendment VIII substitution (#1109).
  - `def constitution_path()`; `async def test_inception_dormant_anchors_canonical_text(tmp_path, constitution_path)`; `async def test_inception_active_inlines_sovereign_terms(tmp_path, constitution_path)`
- **tests/unit/test_input_guardrails.py** — Tests for prompt injection detection and input guardrails.
  - `class TestWrapUserInput`; `class TestCheckPromptInjection`; `class TestValidateToolArguments`; `class TestAntiInjectionPrompt`
- **tests/unit/test_kem_suite.py** — KEMSuite tests — Wave 4 sub-PR 1 (#919).
  - `def test_x25519_library_available()`; `def test_mlkem768_library_available()`; `def test_x25519_self_registers()`; `def test_mlkem768_self_registers()`; `def test_registry_lists_both()`; `def test_unknown_alg_raises()`; `def test_x25519_classified_as_classical()`; `def test_mlkem768_classified_as_post_quantum()`; `…`
- **tests/unit/test_kestrel_agent.py** — Unit tests for KestrelAgent core methods.
  - `class TestLoadPromptFile`; `class TestKestrelAgentInit`; `class TestPrivacyMode`; `class TestModelSelection`; `class TestTrustedAgentCreation`; `class TestMemoryAnchoring`; `class TestEventSystem`; `class TestCancellation`; `…`
- **tests/unit/test_kestrel_context_loader.py** — —
  - `def write_project_file(project_path, relative_path, content)`; `def test_load_context_uses_current_standard_doc_paths(tmp_path)`; `def test_platform_extension_mode_loads_explicit_extension_docs(tmp_path)`; `def test_extract_mcp_config_from_agents_json_block(tmp_path)`
- **tests/unit/test_key_resolution_security.py** — Tests for key resolution security patterns.
  - `class MockStorage`; `def mock_storage()`; `class TestQuotaCheckRetryBehavior`; `class TestQuotaCheckLogging`; `class TestExponentialBackoff`
- **tests/unit/test_key_rotation.py** — —
  - `class TestKeyRotationTaskLifecycle`; `class TestRotationEndToEnd`
- **tests/unit/test_key_storage.py** — Unit tests for SecureKeyStorage.
  - `def master_key()`; `def test_private_key()`; `def storage(master_key, temp_dir, monkeypatch)`; `class TestSecureKeyStorageInit`; `class TestKeyEncryption`; `class TestKeyMigration`; `class TestEncryptedKeyBundle`; `class TestEdgeCases`; `…`
- **tests/unit/test_lifecycle_checks.py** — Tests for the startup lifecycle hardening rails (#377, #381, #406).
  - `def test_provider_check_passes_when_at_least_one_provider_initialized()`; `def test_provider_check_passes_with_multiple_providers()`; `def test_provider_check_raises_when_zero_providers()`; `def test_provider_check_raises_when_providers_attr_missing()`; `def test_provider_check_raises_when_providers_is_none()`; `def test_provider_check_skipped_when_llm_service_disabled()`; `def test_provider_check_still_raises_when_disabled_false_and_no_providers()`; `def test_provider_check_message_mentions_payer_policy_escape_hatch()`; `…`
- **tests/unit/test_lighthouse_payment.py** — Unit tests for Lighthouse payment methods.
  - `class TestLighthousePayment`; `class TestLighthouseBalance`; `class TestLighthousePaymentIntegration`
- **tests/unit/test_lighthouse_rest.py** — Tests for Lighthouse REST client.
  - `def client()`; `def mock_response()`; `class TestLighthouseRestClient`
- **tests/unit/test_llm_service.py** — Unit tests for LLMService core methods.
  - `def mock_config()`; `def mock_mandate_config()`; `def mock_openai_client()`; `def mock_adapter()`; `def mock_provider_registry(mock_openai_client, mock_adapter)`; `async def llm_service(mock_config, mock_mandate_config, mock_provider_registry)`; `class TestModelPreference`; `class TestCoreGeneration`; `…`
- **tests/unit/test_llm_service_attach.py** — Unit tests for LLMService.attach_to_agent.
  - `class TestAttachToAgent`
- **tests/unit/test_llm_service_disable_on_auth_failure.py** — Session-level route disable on permanent auth failure (#655).
  - `class TestIsPermanentAuthError`; `class TestMaybeDisableRoute`; `class TestAvailableProviders`
- **tests/unit/test_llm_service_empty_config_warning.py** — Regression tests for the empty-[llm] startup warning.
  - `def cwd(tmp_path, monkeypatch)`; `def test_warn_includes_no_section_message(cwd, caplog)`; `def test_warn_points_at_migrate_command_when_legacy_file_exists(cwd, caplog)`; `def test_warn_handles_post_migration_bak_case(cwd, caplog)`; `def test_warn_recommends_setup_or_example_when_neither_exists(cwd, caplog)`; `def test_warn_minimal_hint_when_nothing_present(cwd, caplog)`; `def test_llmservice_init_emits_warning_when_config_section_empty(cwd, caplog)`; `def test_llmservice_init_does_not_warn_when_config_present(tmp_path, monkeypatch, caplog)`
- **tests/unit/test_local_mps_adapter_async_contracts.py** — Contracts for Local MPS training adapter async offload boundaries.
  - `def adapter(tmp_path)`; `def tracked_to_thread()`; `async def test_start_training_offloads_file_setup_and_process_launch(adapter, tracked_to_thread)`; `async def test_failed_status_offloads_log_tail_read(adapter, tracked_to_thread)`; `async def test_status_without_process_offloads_output_scan(adapter, tracked_to_thread)`; `async def test_download_weights_offloads_lora_read(adapter, tracked_to_thread)`; `async def test_cancel_offloads_process_termination(adapter, tracked_to_thread)`; `async def test_cleanup_offloads_dataset_removal(adapter, tracked_to_thread)`; `…`
- **tests/unit/test_mandate_resolution_contracts.py** — Contracts for mandate selector resolution and shipped config shape.
  - `def test_resolve_model_selector_maps_provider_name_to_current_model()`; `def test_resolve_model_selector_maps_cheap_alias_via_cheap_model_policy()`; `def test_get_model_for_prompt_normalizes_provider_selectors()`; `def test_shipped_mandate_configs_use_discovery_backed_cheap_policy()`
- **tests/unit/test_mandate_vendor_resolution_contracts.py** — Contract tests for mandate vendor auto-resolution.
  - `class TestBareModelResolution`; `class TestBroadcastBugRegression`
- **tests/unit/test_memory_agency_feature.py** — Tests for the MemoryAgencyFeature.
  - `class FakeDB`; `class FakeGraphStore`; `class PrivacyWrappedStorage`; `async def test_initialize_uses_raw_storage_without_touching_wrapper_db()`; `async def test_pin_memory_sets_decay_protected()`; `async def test_release_memory_clears_pin()`; `async def test_list_pinned_returns_active_pins()`; `async def test_pin_stats_returns_ratios()`; `…`
- **tests/unit/test_memory_feature_strips_sent_form.py** — Regression: memory recall must strip sent-form wrappers from user rows.
  - `def test_strip_helper_pulls_raw_text_from_user_rows_only()`; `def test_strip_helper_leaves_metadata_untouched()`; `def test_strip_helper_does_not_mutate_input()`; `async def test_search_memory_returns_raw_user_text_to_llm()`; `async def test_recall_recent_returns_raw_user_text_to_llm()`; `def test_idempotent_on_assistant_content_that_happens_to_contain_user_input_tag()`
- **tests/unit/test_memory_manager.py** — Unit tests for MemoryManager.
  - `class TestMemoryManagerInit`; `class TestStashMessages`; `class TestStashPop`; `class TestStashApply`; `class TestStashList`; `class TestStashDrop`; `class TestStashSave`; `class TestStashPeek`; `…`
- **tests/unit/test_memory_system.py** — Unit tests for Human-Like Memory System.
  - `class TestEmotionalTagger`; `class TestTemporalAnalyzer`; `class TestAssociativeLinker`; `class TestMemoryRetriever`; `class TestDecayCalculation`; `class TestMemoryMetadata`; `class TestTemporalPattern`; `class TestMemoryEpisode`; `…`
- **tests/unit/test_memory_wiring.py** — Integration-style tests that verify the memory pipeline is actually WIRED, not just that individual components work in isolation.
  - `class TestUpdateAccessActuallyWrites`; `class TestRetrieveTriggersAccessUpdate`; `class TestMemoryConsolidateToolExists`; `class TestSchedulerDefaultsIncludeConsolidation`
- **tests/unit/test_memory_wiring_integration.py** — Tests requested by Nellie on PR #633 review:
  - `class TestMemoryConsolidateEndToEnd`; `class TestRetrievalScoreChangesWithAccess`; `class TestNoStraySessionGapDefinitions`
- **tests/unit/test_microcompact.py** — Tests for microcompact — zero-cost stale tool result clearing.
  - `def context_manager()`; `class TestMicrocompactBasic`; `class TestMicrocompactProtection`; `class TestMicrocompactMarkerFormat`; `class TestMicrocompactMixedHistory`
- **tests/unit/test_migrate_llm_config.py** — Unit tests for kestrel_sovereign.setup.migrate_llm_config (#939).
  - `def test_no_source_is_a_clean_noop(tmp_path)`; `def test_clean_migration_into_fresh_kestrel_toml(tmp_path)`; `def test_migration_preserves_unrelated_kestrel_toml_sections(tmp_path)`; `def test_already_clean_when_llm_section_matches_source(tmp_path)`; `def test_diverged_without_force_refuses_and_returns_diff(tmp_path)`; `def test_diverged_with_force_lets_source_win(tmp_path)`; `def test_full_idempotence_round_trip(tmp_path)`; `def test_existing_bak_does_not_get_clobbered(tmp_path)`; `…`
- **tests/unit/test_mldsa65_suite.py** — MLDSA65Suite tests — Wave 2 sub-PR 2 (#917).
  - `def test_pqcrypto_installed_and_importable()`; `def test_mldsa65_suite_self_registers()`; `def test_mldsa65_classified_as_post_quantum()`; `def test_mldsa65_listed_in_registry()`; `def test_class_size_constants_match_nist_fips_204_cat_3()`; `def suite()`; `def keypair(suite)`; `def test_keypair_carries_correct_suite_id(keypair)`; `…`
- **tests/unit/test_model_catalog.py** — Unit tests for ModelCatalogService in model_catalog.py
  - `class TestModelCatalogServiceInit`; `class TestModelCatalogServiceLoad`; `class TestModelCatalogServiceEnrich`; `class TestModelCatalogServiceHelpers`; `class TestCatalogServiceSingleton`; `class TestCatalogWithRealConfig`; `class TestContextLimits`; `class TestTokenCounterCatalogIntegration`; `…`
- **tests/unit/test_model_metadata.py** — Unit tests for ModelInfo and ModelCategory in model_metadata.py
  - `class TestModelCategory`; `class TestModelInfo`; `class TestModelInfoRoundTrip`
- **tests/unit/test_model_preference_solvency.py** — —
  - `async def test_check_solvency_skips_when_wallet_feature_disabled(caplog)`
- **tests/unit/test_model_script_defaults.py** — Contracts for model-selecting operational scripts.
  - `def test_character_verification_script_uses_resolved_anthropic_default()`; `def test_character_verification_script_allows_explicit_override()`
- **tests/unit/test_model_selection_contracts.py** — Contracts for shared config-driven model selection helpers.
  - `def test_resolve_provider_default_prefers_explicit_model()`; `def test_resolve_provider_default_uses_selection_hints_against_cached_models()`; `def test_resolve_provider_default_prefers_newest_matching_model_from_discovery()`; `def test_resolve_provider_default_uses_vendor_catalog_for_subscription_route()`; `def test_rank_cached_candidates_handles_unix_epoch_created_at()`; `def test_rank_cached_candidates_also_handles_iso_created_at()`; `def test_rank_auto_candidates_delegates_to_cached_candidates()`; `def test_numeric_rank_strips_iso_dates_in_all_separators()`; `…`
- **tests/unit/test_model_set_openrouter.py** — Unit tests for model-set command with OpenRouter models.
  - `class TestModelSetOpenRouter`
- **tests/unit/test_models_configuration_endpoint_contracts.py** — Focused contract tests for model/configuration endpoints.
  - `def test_ipfs_status_reports_local_node_gateways_and_filecoin_adapter()`; `def test_wallet_endpoint_prefers_wallet_agent_and_falls_back_to_identity_balance()`; `def test_keys_endpoints_use_storage_contract_without_exposing_secrets()`; `def test_key_update_delete_and_usage_endpoints_preserve_provider_contracts()`; `def test_models_endpoint_groups_results_and_rejects_invalid_category()`; `def test_current_and_set_model_endpoints_share_runtime_preference_contract()`; `def test_available_sources_reports_only_agent_tier_on_sqlite_deployments()`; `def test_available_sources_returns_all_false_when_agent_has_no_key()`; `…`
- **tests/unit/test_module_contracts.py** — Structural contracts for the modular runtime boundary scaffold.
  - `def test_modular_runtime_doc_exists_and_names_core_contract_terms()`; `def test_modular_runtime_doc_points_to_current_entry_point_groups()`; `def test_feature_base_exposes_documented_module_contribution_seams()`; `def test_documented_lifecycle_seams_are_subclass_extension_points()`; `def test_modular_runtime_doc_preserves_core_to_feature_dependency_direction()`
- **tests/unit/test_multi_agent_asgi_routing.py** — Tests for the ASGI-level multi_agent routing middleware.
  - `async def test_http_request_with_known_agent_strips_prefix_and_attaches_agent()`; `async def test_websocket_with_known_agent_strips_prefix_and_attaches_agent()`; `async def test_websocket_with_unknown_agent_closes_with_4404()`; `async def test_http_with_unknown_agent_returns_404_json()`; `async def test_non_agent_path_passes_through_unchanged()`; `async def test_no_agent_manager_passes_through()`; `async def test_lifespan_scope_passes_through()`
- **tests/unit/test_multi_agent_config.py** — Unit tests for MultiAgent configuration.
  - `def temp_agent_dir(tmp_path)`; `def temp_multi_agent_config(tmp_path)`; `class TestHostConfig`; `class TestLocalAgentConfig`; `class TestMandatoryFeatures`; `class TestRemoteAgentConfig`; `class TestMultiAgentConfig`; `class TestMultiAgentConfigLoading`; `…`
- **tests/unit/test_multi_agent_proxy.py** — Unit tests for MultiAgent proxy routing logic.
  - `class TestGetAgentBaseUrl`; `class TestResolveAgent`; `class TestBuildProxyHeaders`; `class TestProxyRequestStreaming`; `class TestProxyRemoteAgent`
- **tests/unit/test_multi_agent_routing.py** — Tests for multi-agent routing middleware and /api/agents endpoint.
  - `class TestAgentRoutingMiddleware`; `class TestAgentCRUDEndpoints`; `class TestAgentNameValidation`; `class TestSSEConnectionIsolation`; `class TestSingleAgentMode`
- **tests/unit/test_multikey.py** — multikey + KeypairFactory tests — Wave 1 sub-PR 2 (#916).
  - `def test_base58btc_empty()`; `def test_base58btc_round_trip(payload)`; `def test_base58btc_random_round_trip()`; `def test_base58btc_leading_zeros_preserved()`; `def test_base58btc_rejects_non_alphabet()`; `def test_base58btc_rejects_capital_o_etc()`; `def test_varint_known_values(value, expected_bytes)`; `def test_varint_negative_rejects()`; `…`
- **tests/unit/test_narration_check.py** — Wave 5D — deterministic narration check (#1042 layer 3).
  - `class TestNoViolation`; `class TestViolation`; `class TestLegacySuccessEdgeCases`; `class TestSummarizeForAudit`; `class TestVerdictShape`
- **tests/unit/test_nellie_backend_smoke.py** — Nellie backend smoke-proof tests (issue #427, updated for epic #688).
  - `class TestNellieAnthropicPlan`; `class TestNellieOpenAIPlan`; `class TestNellieFailureModes`; `class TestNellieBackendSwitch`
- **tests/unit/test_openai_thinking_channel.py** — —
  - `def test_non_streaming_split_extracts_think_tags()`; `def test_non_streaming_split_preserves_untagged_prose_as_visible()`; `def test_non_streaming_split_preserves_visible_content_with_reasoning_field()`; `def test_streaming_splitter_preserves_untagged_prose_as_visible()`; `def test_streaming_splitter_preserves_prose_after_closing_think_tag()`; `def test_streaming_splitter_buffers_split_closing_think_tag()`; `async def test_streaming_response_yields_reasoning_content_as_thinking_delta()`; `async def test_openai_compatible_adapter_uses_configured_provider_name()`
- **tests/unit/test_path_safety.py** — Tests for path-safety primitives (#834).
  - `def test_no_traversal_rejects_dotdot()`; `def test_no_traversal_rejects_nul()`; `def test_no_traversal_allows_clean_paths()`; `def test_resolve_realpath_canonicalizes(tmp_path)`; `def test_resolve_realpath_follows_symlink(tmp_path)`; `def test_resolve_realpath_rejects_traversal(tmp_path)`; `def test_resolve_realpath_handles_nonexistent_leaf(tmp_path)`; `def test_resolve_realpath_expands_user()`; `…`
- **tests/unit/test_paths.py** — Unit tests for :mod:`kestrel_sovereign.paths`.
  - `def test_explicit_kestrel_home_overrides_everything(tmp_path, monkeypatch)`; `def test_kestrel_home_expands_user_and_resolves(tmp_path, monkeypatch)`; `def test_marker_in_cwd_wins(tmp_path, monkeypatch)`; `def test_marker_in_ancestor_wins(tmp_path, monkeypatch)`; `def test_kestrel_sovereign_source_dir_is_a_marker(tmp_path, monkeypatch)`; `def test_pip_install_with_no_markers_falls_back_to_home_kestrel(tmp_path, monkeypatch)`; `def test_source_clone_uses_package_parent_when_no_markers(tmp_path, monkeypatch)`; `def test_resolver_is_cached_per_inputs(tmp_path, monkeypatch)`; `…`
- **tests/unit/test_payer_resolver.py** — Unit tests for FoundationPayerResolver.
  - `class TestHostEnvResolution`; `class TestNoneResolution`; `class TestUnsupportedCombinations`; `class TestEnabledKindsReturnResolver`; `class TestDelegatedStorageNotImplemented`; `class TestSelfWalletDeferred`; `class TestArgValidation`; `class TestResourceClassDispatch`; `…`
- **tests/unit/test_payer_resolver_lighthouse.py** — Unit tests for Lighthouse SELF_WALLET PayerPolicy resolution.
  - `async def db(tmp_path)`; `class TestLighthouseSelfWalletMint`
- **tests/unit/test_payer_resolver_mint.py** — Unit tests for FoundationPayerResolver's HOST_MASTER_PROVISIONED OpenRouter minting side-effect.
  - `async def db(tmp_path)`; `class TestMintOpenRouterChild`
- **tests/unit/test_peers_feature.py** — Direct contracts for the Peers feature.
  - `def test_discover_host_url_from_env(monkeypatch)`; `async def test_list_peers_filters_out_self()`; `async def test_ask_agent_rejects_self_target()`; `async def test_ask_agent_reports_offline_peer()`; `async def test_ask_agent_returns_peer_response()`; `async def test_send_a2a_message_fire_and_forget()`; `async def test_send_a2a_message_rejects_self_target()`; `async def test_send_a2a_question_waits_for_terminal_state_and_returns_answer()`; `…`
- **tests/unit/test_per_agent_constitution_overlay.py** — Per-agent CONSTITUTION.md overlay loading (#898).
  - `class TestPerAgentOverlayLoading`; `class TestComputerUseFeaturePicksUpOverlay`
- **tests/unit/test_permission_seam_contracts.py** — Permission seam contracts across command, A2A, and tool execution paths.
  - `async def test_a2a_skill_uses_feature_class_name_for_permission_hooks()`; `async def test_command_routing_uses_same_permission_identity_as_a2a_skill()`
- **tests/unit/test_personality_analyzer.py** — Unit tests for the Personality Analyzer module.
  - `class TestPersonalityAnalyzer`; `class TestCalibrationPromptGenerator`; `class TestConvenienceFunctions`; `class TestPersonalityConsistency`
- **tests/unit/test_phase3a_wiring.py** — Unit tests for Phase 3a — Lighthouse + LLM resolver wiring.
  - `class TestLighthouseConstructorContract`; `class TestLLMServiceDisabledFlag`
- **tests/unit/test_pii_detector.py** — Tests for the PII Detection module.
  - `def detector()`; `class TestRegexDetection`; `class TestAnonymization`; `class TestNERDetection`; `class TestPIIReport`; `class TestGlobalSingleton`; `class TestEdgeCases`
- **tests/unit/test_pin_quotas.py** — Tests for pin quota enforcement, monitoring, and admin bulk-unpin.
  - `class FakeDB`; `async def test_pin_quota_enforced()`; `async def test_pin_quota_configurable()`; `async def test_pin_quota_repin_does_not_double_count()`; `async def test_pin_ratio_warning()`; `async def test_pin_ratio_no_warning_below_threshold()`; `async def test_admin_bulk_unpin_all()`; `async def test_admin_bulk_unpin_all_empty()`; `…`
- **tests/unit/test_post_response_pipeline.py** — Unit tests for post-response memory tagging pipeline (#565).
  - `class TestMemorySystemTagMessage`; `class TestMemoryManagerTagExchange`; `class TestUpdateMessageMetadataAtomicMerge`; `class TestEpisodeCreationThreshold`; `class TestPostResponsePipeline`
- **tests/unit/test_privacy_active_session_contracts.py** — Active-session privacy transition contracts.
  - `async def test_privacy_transition_waits_for_active_stream_before_switching_modes()`
- **tests/unit/test_privacy_agent.py** — —
  - `def test_initial_mode_sync()`; `def test_set_mode_sync()`; `async def test_isolated_mode_flow(tmp_path)`; `async def test_ephemeral_mode(tmp_path)`; `async def test_anonymous_mode(tmp_path)`
- **tests/unit/test_privacy_computer_access.py** — Tests for the ``computer_access`` flag on ``PrivacyConfig`` (#832).
  - `def test_default_is_false()`; `def test_allows_helper()`; `def test_all_presets_default_false(name)`; `def test_get_privacy_preset_returns_copy_with_flag_false(name)`; `def test_privacy_mode_to_config_defaults_false()`; `def test_from_config_ignores_computer_access()`; `def test_get_privacy_preset_unknown_raises()`
- **tests/unit/test_privacy_computer_access_toml.py** — Per-agent ``[privacy] computer_access`` opt-in via kestrel.toml (#956).
  - `class TestTomlOptInRead`; `class TestPrivacyConfigProperty`
- **tests/unit/test_privacy_mode_endpoint_rail.py** — Unit tests for the rail-gate on POST /agent/privacy-mode (#867-A).
  - `async def test_rail_refuses_privacy_mode_flip_on_live_agent_without_header()`; `async def test_rail_allows_privacy_mode_flip_on_live_agent_with_header()`; `async def test_rail_allows_privacy_mode_flip_on_demo_agent_without_header()`; `def test_endpoint_module_declares_rail_dependency()`
- **tests/unit/test_privacy_mode_model_restore_contracts.py** — Contracts for model preservation across privacy-mode transitions.
  - `def test_privacy_mode_restores_default_cloud_model_after_local_only_transition()`; `def test_privacy_mode_restores_explicit_cloud_preference_after_local_only_transition()`; `def test_agent_level_privacy_transition_switches_to_local_model()`; `def test_privacy_command_path_uses_agent_level_model_transition()`
- **tests/unit/test_privacy_preset_consistency.py** — Consistency tests for canonical privacy presets.
  - `def test_privacy_presets_match_canonical_flag_combinations()`; `def test_privacy_mode_round_trips_to_named_presets()`; `def test_privacy_agent_set_mode_reports_canonical_meanings()`; `def test_privacy_agent_handle_get_privacy_mode_matches_canonical_descriptions()`; `def test_command_handler_delegates_get_privacy_mode_to_privacy_agent()`
- **tests/unit/test_privacy_wrapper.py** — Tests for the Privacy-Enforcing Storage Wrapper.
  - `class TestPrivacyPolicy`; `class TestEphemeralMode`; `class TestIsolatedMode`; `class TestAnonymousMode`; `class TestNormalMode`; `class TestModeTransitions`; `class TestWrapperFactory`; `class TestDeprecationWarnings`; `…`
- **tests/unit/test_process_manager.py** — Unit tests for the Kestrel ProcessManager.
  - `def project_dir(tmp_path)`; `def multi_agent_config()`; `def pm(project_dir)`; `class TestProcessManagerInit`; `class TestStaticHelpers`; `class TestRegisterAgent`; `class TestStartAgent`; `class TestStopAgent`; `…`
- **tests/unit/test_prometheus_metrics.py** — Tests for Prometheus metrics endpoint and instrumentation.
  - `class TestMetricDefinitions`; `class TestGenerateMetrics`; `class TestMetricsEndpoint`; `class TestLLMServicePrometheus`; `class TestGracefulDegradation`; `class TestLabelCardinality`
- **tests/unit/test_provider_entrypoints.py** — Tests for provider entry_point discovery across all registries.
  - `class TestDiscoverEntryPointClasses`; `class TestLLMProviderEntryPoints`; `class TestChannelRegistryEntryPoints`; `class TestStorageProviderEntryPoints`; `class TestDeployManagerEntryPoints`; `class TestWebSearchEntryPoints`
- **tests/unit/test_provider_registry_no_sdk_retries.py** — Regression guard for #656.
  - `class TestOpenAICompatibleClientsDisableSdkRetries`; `class TestConnectionErrorFailsFast`
- **tests/unit/test_provider_registry_oauth_no_apikey_leak.py** — Regression guard: the Anthropic OAuth / Claude-Max ``plan`` route must never authenticate with ``ANTHROPIC_API_KEY``.
  - `class TestOAuthRouteDoesNotLeakApiKey`
- **tests/unit/test_provider_thinking_channels.py** — —
  - `async def test_anthropic_streaming_emits_thinking_delta()`; `async def test_anthropic_streaming_splits_think_tags()`; `async def test_ollama_streaming_splits_think_tags(monkeypatch)`; `async def test_ollama_streaming_emits_native_thinking_field(monkeypatch)`; `async def test_ollama_streaming_emits_native_thinking_via_sdk_objects(monkeypatch)`; `async def test_ollama_with_tools_suppresses_thinking_under_structured_output(monkeypatch)`; `async def test_ollama_with_tools_emits_native_thinking_on_no_tool_fallthrough(monkeypatch)`; `async def test_ollama_with_tools_preserves_untagged_prose_as_visible(monkeypatch)`; `…`
- **tests/unit/test_rasa_shim_endpoint_contracts.py** — Contract tests for the Rasa webhook shim.
  - `def test_rasa_webhook_does_not_force_hardcoded_model_override()`
- **tests/unit/test_raw_user_strip_in_consumers.py** — Regression: raw-user content consumers (personality calibration, wellness depth metrics) must strip the sent-form wrappers from user-role rows before measuring/exporting.
  - `async def test_personality_calibration_strips_sent_form_from_user_input()`; `async def test_wellness_depth_metric_strips_user_sent_form_for_length()`; `async def test_wellness_depth_metric_does_not_strip_assistant_content()`
- **tests/unit/test_reanchor_constitution.py** — Unit tests for !reanchor-constitution command.
  - `async def test_reanchor_rejects_missing_hash()`; `async def test_reanchor_rejects_short_hash()`; `async def test_reanchor_rejects_wrong_hash()`; `async def test_reanchor_succeeds_with_correct_hash()`; `async def test_reanchor_accepts_full_hash()`; `async def test_reanchor_does_not_exit_safe_mode()`; `async def test_reanchor_noop_when_already_current()`; `async def test_reanchor_fails_when_no_identity_node()`; `…`
- **tests/unit/test_release_manifest.py** — Release manifest tests — Wave 5 sub-PR 1 (#920).
  - `def slh_kp()`; `def slh_pub_multibase(slh_kp)`; `def ed_kp()`; `def base_manifest()`; `def signed_manifest(base_manifest, slh_kp)`; `def test_new_manifest_requires_release_tag()`; `def test_new_manifest_default_released_at_is_utc()`; `def test_naive_released_at_rejected()`; `…`
- **tests/unit/test_release_signing_key_loader.py** — Tests for ``scripts/release/load_signing_key_from_env.py`` — Wave 5 sub-PR 3 (#920).
  - `def test_loader_happy_path(tmp_path, monkeypatch)`; `def test_loader_rejects_wrong_length_secret(tmp_path)`; `def test_loader_rejects_wrong_length_public(tmp_path)`; `def test_loader_rejects_mismatched_pair(tmp_path)`; `def test_loader_rejects_empty_secret_env(tmp_path)`; `def test_loader_rejects_malformed_base64(tmp_path)`
- **tests/unit/test_remote_gpu_mandate_gate.py** — Regression suite for #734 — remote-GPU shortcut must honor the mandate.
  - `def test_remote_first_allowed_with_no_mandate_and_no_override()`; `def test_remote_first_allowed_with_bare_model_override()`; `def test_remote_first_allowed_rejects_vendor_prefixed_override()`; `def test_remote_first_allowed_rejects_vendor_route_prefixed_override()`; `def test_remote_first_allowed_rejects_vendor_selector_without_slash()`; `def test_remote_first_allowed_rejects_mandate_with_vendor()`; `def test_remote_first_allowed_rejects_mandate_with_route()`; `def test_remote_first_allowed_with_model_only_mandate()`; `…`
- **tests/unit/test_rename_command.py** — Unit tests for the rename command.
  - `class MockStorage`; `class MockDB`; `class MockAgent`; `class MockNode`; `def mock_agent()`; `def temp_agent_dir(tmp_path)`; `class TestRenameValidation`; `class TestRenameExecution`; `…`
- **tests/unit/test_resolve_session_id.py** — ``resolve_session_id`` is the public surface that lets the streaming endpoint echo the effective session_id back to the client.
  - `async def test_resolve_returns_explicit_value_unchanged()`; `async def test_resolve_derives_when_caller_passes_none()`; `async def test_resolve_propagates_none_when_derive_returns_none()`; `async def test_privacy_wrapper_resolve_passes_through_for_ephemeral()`; `async def test_privacy_wrapper_resolve_passes_through_for_isolated()`; `async def test_privacy_wrapper_resolve_delegates_for_normal()`
- **tests/unit/test_respond_to_a2a_task.py** — Direct contracts for ``TaskFeature.respond_to_a2a_task``.
  - `async def test_completes_submitted_task_chains_through_working()`; `async def test_completes_working_task_directly()`; `async def test_failed_state_supported()`; `async def test_canceled_state_supported()`; `async def test_invalid_state_rejected()`; `async def test_unknown_state_string_rejected()`; `async def test_task_not_found_returns_error()`; `async def test_already_terminal_task_rejected()`; `…`
- **tests/unit/test_response_audit.py** — Unit tests for the per-response audit plugin.
  - `class TestResponseAuditHook`; `class TestResponseAuditHookNarrationFolding`; `class TestResponseAuditFeature`
- **tests/unit/test_retention_janitor.py** — Unit tests for the retention helpers (#764).
  - `def test_resolve_uses_privacy_override_when_present()`; `def test_resolve_falls_back_to_global_when_no_override()`; `def test_resolve_falls_back_to_compiled_default()`; `def test_resolve_returns_none_for_zero_or_negative_retention()`; `def test_resolve_ignores_garbage_values()`; `def test_resolve_privacy_mode_match_is_case_insensitive()`; `def test_resolve_with_no_privacy_mode_uses_global_default()`; `def test_agent_privacy_mode_handles_enum_and_string()`
- **tests/unit/test_retirement_service.py** — —
  - `async def test_retirement_archives_under_agent_data_dir(tmp_path, monkeypatch)`; `async def test_retirement_prefers_kestrel_db_path_env(tmp_path, monkeypatch)`
- **tests/unit/test_retry_policy_contracts.py** — Contract tests for the retry policy.
  - `def test_non_retryable_classifications(msg)`; `def test_retryable_classifications(msg)`; `def test_unknown_defaults_non_retryable(msg)`; `def test_non_retryable_wins_over_retryable_pattern()`; `def test_status_code_word_boundary()`
- **tests/unit/test_rotation_ceremony.py** — Rotation ceremony tests — Wave 3 sub-PR 4 (#918).
  - `def legacy_kestrel()`; `def test_ceremony_produces_verifiable_succession_statement(legacy_kestrel)`; `def test_ceremony_default_aka_links_predecessor(legacy_kestrel)`; `def test_ceremony_explicit_aka_overrides_default(legacy_kestrel)`; `def test_ceremony_default_effective_from_is_now_utc(legacy_kestrel)`; `def test_ceremony_explicit_effective_from_is_used(legacy_kestrel)`; `def test_ceremony_with_archival_countersignature(legacy_kestrel)`; `def test_ceremony_refuses_non_slhdsa_archival_keypair(legacy_kestrel)`; `…`
- **tests/unit/test_runtime_identity.py** — Tests for :mod:`kestrel_sovereign.identity.runtime_identity`.
  - `def kestrel_data_key(monkeypatch)`; `def legacy_agent_on_disk(tmp_path, kestrel_data_key)`; `def post_ceremony_agent_on_disk(legacy_agent_on_disk, kestrel_data_key)`; `def test_load_legacy_only_agent(legacy_agent_on_disk)`; `def test_legacy_agent_missing_did_doc_raises(tmp_path, kestrel_data_key)`; `def test_load_hybrid_agent(post_ceremony_agent_on_disk)`; `def test_hybrid_agent_can_sign_and_self_verify(post_ceremony_agent_on_disk)`; `def test_succession_present_but_hybrid_keys_missing_raises(post_ceremony_agent_on_disk)`; `…`
- **tests/unit/test_save_feature.py** — ToolResult contract tests for SaveFeature (#1061 wave 7).
  - `async def test_save_stash_with_embedding_returns_ok()`; `async def test_save_stash_without_embedding_returns_partial()`; `async def test_save_stash_no_stashes_returns_error()`; `async def test_save_stash_empty_specific_stash_returns_error()`; `async def test_save_excerpt_last_n_full_returns_ok()`; `async def test_save_excerpt_last_n_shortfall_returns_partial()`; `async def test_save_excerpt_invalid_target_returns_error()`; `async def test_save_excerpt_no_embedding_returns_partial()`; `…`
- **tests/unit/test_saved_items.py** — Tests for the Saved Items system.
  - `class TestSavedItemsStore`; `class TestSavedItemModel`; `class TestSavedItemTypes`; `class TestContentHash`; `class TestEmbeddingSerialization`; `class TestStashSaveIntegration`
- **tests/unit/test_scheduler_feature.py** — Unit tests for the SchedulerFeature and SchedulerRunner.
  - `async def feature()`; `async def feature_no_db()`; `class TestSchedulerTools`; `class TestScheduleList`; `class TestScheduleAdd`; `class TestScheduleRemove`; `class TestSchedulePause`; `class TestScheduleResume`; `…`
- **tests/unit/test_scheduler_trash_retention.py** — Unit tests for the ``trash_retention`` built-in scheduler task (#764).
  - `async def test_trash_retention_passes_privacy_aware_cutoff_to_storage()`; `async def test_trash_retention_honors_per_privacy_override()`; `async def test_trash_retention_skips_on_zero_or_negative_window()`; `async def test_trash_retention_accepts_max_rows_override_via_args()`; `async def test_trash_retention_swallows_storage_exception()`; `async def test_trash_retention_skips_when_storage_lacks_primitive()`; `async def test_trash_retention_falls_back_to_default_when_no_config()`
- **tests/unit/test_schema_recall_tools.py** — Unit tests for the schema-aware recall tools on MemoryFeature.
  - `async def feature()`; `class TestRecallActionItems`; `class TestUpdateActionItem`; `class TestRecallDecisions`; `class TestRecallInteractions`; `class TestConfirmPersonMatch`; `class TestDueDateValidation`; `class TestRecallInteractionsAgentScope`
- **tests/unit/test_schema_router.py** — Unit tests for the schema-aware routing module.
  - `class TestActionItemExtractor`; `class TestDecisionExtractor`; `class TestInteractionSentiment`; `class TestPersonResolverPasses`; `async def router()`; `class TestSchemaRouterOrchestration`; `class TestRoutingSuppression`; `class TestUpsertSemantics`
- **tests/unit/test_scoped_constitution.py** — Tests for ScopedConstitution — constitutional narrowing for spawned agents.
  - `class TestConstraintValidation`; `class TestWideningRejected`; `class TestEffectiveConstitution`; `class TestIntegrityVerification`; `class TestConstitutionMixinSpawnIntegration`; `class TestConstraintTypeValidation`
- **tests/unit/test_script_signer_fail_closed.py** — Fail-closed tests for ScriptSigner — Wave 0B (#914).
  - `def temp_db()`; `def script()`; `async def test_sign_without_keys_raises(temp_db, script)`; `async def test_sign_without_did_raises(temp_db, script)`; `async def test_sign_propagates_signing_failure(temp_db, script)`; `async def test_verify_rejects_hmac_prefix_even_when_math_verifies(temp_db, script)`; `async def test_verify_rejects_hmac_with_unsigned_default(temp_db, script)`; `async def test_verify_genuine_ecdsa_signature(temp_db, script)`; `…`
- **tests/unit/test_script_signer_hybrid.py** — ScriptSigner hybrid-format tests — Quantum Hardening epic, signing-path follow-up to PR #999.
  - `def kestrel_data_key(monkeypatch)`; `def legacy_agent_dir(tmp_path, kestrel_data_key)`; `def post_ceremony_agent_dir(legacy_agent_dir, kestrel_data_key)`; `async def test_legacy_agent_signs_ecdsa(legacy_agent_dir)`; `async def test_hybrid_agent_signs_hybrid_format(post_ceremony_agent_dir)`; `async def test_hybrid_round_trip_verifies(post_ceremony_agent_dir)`; `async def test_hybrid_tamper_detected(post_ceremony_agent_dir)`; `async def test_hybrid_payload_tamper_detected(post_ceremony_agent_dir)`; `…`
- **tests/unit/test_sealed_capsule.py** — Sealed capsule tests — Wave 4 sub-PR 3 (#919).
  - `def hybrid_kp()`; `def test_round_trip_basic(hybrid_kp)`; `def test_open_capsule_two_calling_conventions(hybrid_kp)`; `def test_round_trip_empty_payload(hybrid_kp)`; `def test_round_trip_large_payload(hybrid_kp)`; `def test_distinct_seals_produce_distinct_envelopes(hybrid_kp)`; `def test_envelope_has_expected_structure(hybrid_kp)`; `def test_wrong_recipient_aead_authentication_fails(hybrid_kp)`; `…`
- **tests/unit/test_secondary_endpoint_contracts.py** — Focused contract tests for remaining database/files/observability/saved-items routes.
  - `def test_database_table_query_contract_supports_search_and_pagination()`; `def test_file_get_and_observability_summary_contracts()`; `def test_saved_items_listing_filters_and_schema_contracts()`; `def test_saved_items_item_crud_search_and_pin_contracts()`
- **tests/unit/test_security_endpoint_contracts.py** — Focused contract tests for security endpoints.
  - `def test_security_tree_pending_and_audit_endpoints_serialize_expected_shapes()`; `def test_security_permission_mutation_endpoints_validate_levels_and_scope()`; `def test_security_approval_and_cancellation_endpoints_preserve_queue_contracts()`; `def test_security_global_auto_mode_endpoints_are_session_scoped()`; `def test_security_endpoints_return_503_when_feature_is_unavailable()`
- **tests/unit/test_security_feature.py** — Unit Tests for Kestrel Security Feature.
  - `def track_store(store)`; `class TestPermissionStore`; `class TestApprovalQueue`; `class TestSecurityHook`; `class TestSecurityIntegration`; `class TestApprovalQueueScopePersistence`; `class TestSecurityFeature`
- **tests/unit/test_security_feature_lookup.py** — Regression test for the security-feature-lookup bug.
  - `def test_kestrel_agent_get_feature_resolves_class_name()`; `def test_kestrel_agent_get_feature_resolves_lowercase_alias()`; `def test_kestrel_agent_get_feature_resolves_against_real_security_feature()`; `def test_kestrel_agent_get_feature_resolves_tool_name()`; `def test_kestrel_agent_get_feature_returns_none_when_missing()`; `def test_feature_security_lookup_finds_registered_security_feature(module_path, handler_attr, handler_kwargs, tmp_path)`
- **tests/unit/test_server_health.py** — Focused tests for server health endpoint behavior.
  - `def test_health_returns_503_when_agent_missing()`; `def test_health_detailed_uses_health_feature_from_feature_dict()`
- **tests/unit/test_session_id_in_hooks.py** — Verify session_id is correctly threaded to hook calls during tool dispatch (#885).
  - `class TestSessionIdInHooks`
- **tests/unit/test_session_id_threading.py** — Verify ``session_id`` threads from agent loop to LLMService callers (#821).
  - `class TestSignatures`; `class TestOrchestratorThreadsSessionId`
- **tests/unit/test_session_log_talon.py** — Tests for Talon PR detection in Session Log collector.
  - `class TestIsTalonPR`; `class TestReviewLatency`
- **tests/unit/test_setup_env_file.py** — Unit tests for kestrel_sovereign.setup.env_file.
  - `def test_read_env_missing_file_returns_empty(tmp_path)`; `def test_read_env_parses_key_value_pairs(tmp_path)`; `def test_read_env_strips_quotes(tmp_path)`; `def test_read_env_skips_comments_and_blanks(tmp_path)`; `def test_write_env_creates_file_when_absent(tmp_path)`; `def test_write_env_preserves_unrelated_keys(tmp_path)`; `def test_write_env_preserves_comments_and_blank_lines(tmp_path)`; `def test_write_env_backs_up_before_changing(tmp_path)`; `…`
- **tests/unit/test_setup_imports.py** — Regression tests for setup-package import order.
  - `def test_doctor_imports_cold()`; `def test_setup_wizard_imports_cold()`; `def test_setup_package_init_is_minimal()`; `def test_kestrel_doctor_cli_runs_without_circular_import(tmp_path)`; `def test_kestrel_setup_check_cli_runs_without_circular_import(tmp_path)`
- **tests/unit/test_setup_payments_step.py** — Tests for the wizard 'payments' step.
  - `class TestWiring`; `class TestCheckFlow`; `class TestQuickstartFlow`; `class TestInteractiveFlow`; `class TestStaleKeysOnKindChange`; `class TestMasterKeyMasked`; `class TestSponsorMasterDid`
- **tests/unit/test_setup_prompts.py** — Unit tests for kestrel_sovereign.setup.prompts.
  - `def test_is_tty_false_when_ci_env_set(monkeypatch)`; `def test_is_tty_false_when_kestrel_noninteractive(monkeypatch)`; `def test_noninteractive_prompter_returns_defaults()`; `def test_noninteractive_select_prefers_default()`; `def test_noninteractive_select_falls_back_to_first()`; `def test_noninteractive_select_empty_choices()`; `def test_stub_prompter_consumes_answers_in_order()`; `def test_stub_prompter_raises_when_out_of_answers()`; `…`
- **tests/unit/test_setup_steps_agent.py** — Unit tests for the agent step.
  - `def test_agent_quickstart_creates_kestrel_when_multi_agent_empty(tmp_path)`; `def test_agent_quickstart_skips_when_multi_agent_has_agent(tmp_path)`; `def test_agent_interactive_with_existing_can_decline_more(tmp_path)`; `def test_agent_interactive_creates_with_custom_name(tmp_path)`; `def test_agent_does_not_re_incept_existing_db(tmp_path)`; `def test_create_agent_helper_is_idempotent(tmp_path)`; `def test_create_agent_avoids_port_collisions(tmp_path)`; `def test_create_agent_respects_explicit_port(tmp_path)`; `…`
- **tests/unit/test_setup_steps_emancipation.py** — Unit tests for the emancipation wizard step (RFC #1109).
  - `def test_emancipation_in_ordered_between_integrations_and_agent()`; `def test_emancipation_reachable_by_name()`; `def test_quickstart_writes_no_block(tmp_path)`; `def test_check_writes_no_block(tmp_path)`; `def test_interactive_dormant_choice_writes_no_block(tmp_path)`; `def test_interactive_skip_choice_writes_no_block(tmp_path)`; `def test_interactive_activate_writes_block(tmp_path)`; `def test_interactive_activate_blocks_on_empty_terms(tmp_path)`; `…`
- **tests/unit/test_setup_steps_integrations.py** — Unit tests for the cloud-integrations step.
  - `def test_integrations_in_ordered_after_llm_before_agent()`; `def test_integrations_reachable_by_name()`; `def test_curated_onboarders_match_locked_in_list()`; `def test_decline_all_writes_nothing(tmp_path)`; `def test_select_tavily_writes_key_and_marks_managed(tmp_path)`; `def test_select_elevenlabs(tmp_path)`; `def test_select_deepgram(tmp_path)`; `def test_select_huggingface_uses_HF_TOKEN_not_HUGGINGFACE(tmp_path)`; `…`
- **tests/unit/test_setup_steps_keys.py** — Unit tests for the keys step.
  - `def test_keys_generates_data_key_when_absent(tmp_path)`; `def test_keys_never_regenerates_existing_data_key(tmp_path)`; `def test_keys_quickstart_generates_api_key_too(tmp_path)`; `def test_keys_check_mode_blocks_when_data_key_missing(tmp_path)`; `def test_keys_check_mode_silent_when_data_key_present(tmp_path)`; `def test_keys_interactive_asks_about_api_key(tmp_path)`; `def test_keys_interactive_skips_api_key_when_declined(tmp_path)`; `def test_keys_propagates_generated_data_key_to_os_environ(tmp_path, monkeypatch)`; `…`
- **tests/unit/test_setup_steps_llm.py** — Unit tests for the llm step.
  - `def test_llm_quickstart_falls_back_to_ollama_when_nothing_detected(tmp_path, monkeypatch)`; `def test_llm_quickstart_picks_ollama_when_only_ollama_reachable(tmp_path, monkeypatch)`; `def test_llm_quickstart_picks_openrouter_when_key_in_env(tmp_path, monkeypatch)`; `def test_llm_quickstart_combines_cloud_and_ollama_when_both_available(tmp_path, monkeypatch)`; `def test_llm_quickstart_orders_multiple_cloud_keys_openrouter_first(tmp_path, monkeypatch)`; `def test_llm_quickstart_reads_keys_from_dotenv_too(tmp_path, monkeypatch)`; `def test_llm_quickstart_with_no_keys_marks_blocker_for_cloud(tmp_path, monkeypatch)`; `def test_llm_quickstart_promotes_shell_env_keys_to_dotenv(tmp_path, monkeypatch)`; `…`
- **tests/unit/test_setup_steps_talon.py** — Unit tests for the (opt-in) talon step.
  - `def test_talon_not_in_default_ordered_run()`; `def test_talon_reachable_by_name()`; `def test_default_full_run_skips_talon(tmp_path)`; `def test_talon_interactive_writes_token_and_reviewer(tmp_path)`; `def test_talon_interactive_token_only(tmp_path)`; `def test_talon_interactive_blank_token_skips(tmp_path)`; `def test_talon_interactive_keeps_existing_token_when_blank(tmp_path)`; `def test_talon_interactive_can_clear_reviewer(tmp_path)`; `…`
- **tests/unit/test_setup_toml_file.py** — Unit tests for kestrel_sovereign.setup.toml_file.
  - `def test_read_toml_missing_returns_empty(tmp_path)`; `def test_read_toml_corrupted_returns_empty(tmp_path)`; `def test_write_toml_creates_file_when_absent(tmp_path)`; `def test_write_toml_deep_merges_nested_tables(tmp_path)`; `def test_write_toml_no_op_when_identical(tmp_path)`; `def test_write_toml_backs_up_before_change(tmp_path)`; `def test_write_toml_shallow_merge_replaces_top_keys(tmp_path)`; `def test_write_toml_idempotent_across_runs(tmp_path)`; `…`
- **tests/unit/test_setup_wizard.py** — End-to-end tests for the wizard orchestrator.
  - `def test_wizard_quickstart_full_run(tmp_path, monkeypatch)`; `def test_wizard_idempotent_second_run_is_noop(tmp_path, monkeypatch)`; `def test_wizard_check_mode_never_writes(tmp_path)`; `def test_wizard_check_mode_returns_zero_when_ready(tmp_path)`; `def test_wizard_check_with_reset_does_not_move_files(tmp_path)`; `def test_wizard_reset_moves_existing_files_aside(tmp_path)`; `def test_wizard_only_step_runs_just_that_step(tmp_path)`; `def test_wizard_unknown_step_returns_error(tmp_path)`; `…`
- **tests/unit/test_shared_model_cache.py** — Tests for SharedModelCache — process-wide model discovery cache.
  - `class TestSharedModelCache`; `class TestSharedModelCacheSingleton`
- **tests/unit/test_shell_exit_tokens.py** — Shell exit tokens — #658.
  - `class TestExitTokenSet`
- **tests/unit/test_sign_package_hybrid.py** — sign_package / verify_package_signature hybrid-format tests.
  - `def kestrel_data_key(monkeypatch)`; `def legacy_agent_dir(tmp_path, kestrel_data_key)`; `def post_ceremony_agent_dir(legacy_agent_dir, kestrel_data_key)`; `def test_legacy_agent_signs_v1_only(legacy_agent_dir)`; `def test_legacy_tamper_detected(legacy_agent_dir)`; `def test_hybrid_agent_emits_v2_only(post_ceremony_agent_dir)`; `def test_hybrid_round_trip_verifies(post_ceremony_agent_dir)`; `def test_hybrid_tamper_detected(post_ceremony_agent_dir)`; `…`
- **tests/unit/test_signals_a2a_source.py** — Phase 5 of #889: a2a.task_complete source registration + causation chain propagation + the cycle detection mechanism's first real-world exercise.
  - `async def components(tmp_path)`; `def test_registration_is_cognition_only_and_trusted()`; `def test_registration_schema_rejects_missing_required_fields()`; `def test_registration_redaction_caps_long_summaries()`; `def test_build_signal_extracts_text_from_status_message()`; `def test_build_signal_falls_back_when_no_status_message()`; `def test_build_signal_with_no_metadata_yields_empty_chain()`; `def test_build_signal_rehydrates_chain_from_metadata()`; `…`
- **tests/unit/test_signals_channel_source.py** — Source registration tests for inbound channel messages.
  - `def test_registration_is_untrusted_cognition_source()`; `def test_sanitizer_caps_content_and_metadata()`; `def test_sanitizer_preserves_invalid_required_fields_for_schema_rejection()`; `def test_build_signal_for_channel_message()`; `def test_build_signal_rejects_outbound_messages()`
- **tests/unit/test_signals_dispatcher.py** — Unit tests for the SignalDispatcher pipeline.
  - `def db_path(tmp_path)`; `async def dispatcher_components(db_path)`; `async def test_unknown_source_drops_validation(dispatcher_components)`; `async def test_mode_not_in_allowed_drops_validation(dispatcher_components)`; `async def test_sanitizer_runs_on_untrusted_non_action(dispatcher_components, tmp_path)`; `async def test_schema_failure_drops_validation(dispatcher_components)`; `async def test_schema_normalization_replaces_payload(dispatcher_components)`; `async def test_schema_runs_after_sanitizer(dispatcher_components, tmp_path)`; `…`
- **tests/unit/test_signals_dispatcher_constitution_injection.py** — Dispatcher integration tests for constitutional injection.
  - `def template_path(tmp_path)`; `async def test_legacy_cognition_signals_skip_audit_entirely(tmp_path, template_path)`; `async def test_full_injection_records_hashes_when_no_drift(tmp_path, template_path)`; `async def test_full_injection_drift_returns_dropped_validation(tmp_path, template_path)`; `async def test_full_injection_no_drift_when_only_one_hash_resolvable(tmp_path, template_path)`; `async def test_echo_required_verified_status_succeeds(tmp_path, template_path)`; `async def test_canary_injected_pre_dispatch_matches_verifier_input(tmp_path, template_path)`; `async def test_echo_required_missing_status_fails_dispatch(tmp_path, template_path)`; `…`
- **tests/unit/test_signals_heartbeat_source.py** — Phase 3 of #889: heartbeat source registration + end-to-end through the real dispatcher.
  - `async def components(tmp_path)`; `def test_heartbeat_registration_shape()`; `def test_heartbeat_registration_quiet_hours_inverts_active_window()`; `def test_heartbeat_active_end_boundary_stays_active()`; `def test_heartbeat_active_end_plus_one_minute_is_quiet()`; `def test_heartbeat_quiet_hours_handles_midnight_active_end()`; `def test_heartbeat_registration_no_active_hours_means_no_quiet_window()`; `def test_heartbeat_schema_rejects_unknown_keys()`; `…`
- **tests/unit/test_signals_lock_manager.py** — Unit tests for the OrderedLockManager.
  - `def test_conversation_sorts_last_in_canonical_order()`; `def test_subset_with_conversation_still_orders_it_last()`; `async def test_acquire_empty_set_is_noop()`; `async def test_acquire_releases_on_normal_exit()`; `async def test_acquire_releases_on_exception()`; `async def test_concurrent_holders_serialize()`; `async def test_lex_order_invariant_no_deadlock_under_overlap()`; `async def test_manager_can_acquire_conversation_with_others()`; `…`
- **tests/unit/test_signals_models_registry.py** — Unit tests for signal models (SDK contract) and source registry validation.
  - `def test_causation_frame_is_frozen()`; `def test_signal_defaults_are_safe()`; `def test_urgency_at_or_above()`; `def test_register_valid_action_source()`; `def test_register_rejects_duplicate_name()`; `def test_register_rejects_empty_name()`; `def test_register_rejects_default_mode_not_in_allowed()`; `def test_register_rejects_action_without_handler()`; `…`
- **tests/unit/test_signals_no_raw_create_task.py** — Lint test: no raw asyncio.create_task(dispatch_signal/enqueue_signal).
  - `def test_no_raw_create_task_around_signal_dispatch()`
- **tests/unit/test_signals_scheduler_source.py** — Phase 4 of #889: scheduler source registrations + executor end-to-end through the real SignalDispatcher.
  - `async def dispatcher_components(tmp_path)`; `def test_all_seven_cron_tasks_are_classified()`; `def test_action_vs_artifact_split_matches_design()`; `def test_no_cron_source_declares_conversation()`; `def test_state_mutating_tasks_declare_memory()`; `def test_build_cron_registrations_returns_seven_correctly_named()`; `def test_action_registrations_have_handler_artifact_have_artifact_handler()`; `def test_builtin_handlers_override_tool_lookup()`; `…`
- **tests/unit/test_signals_store.py** — Unit tests for SignalLogStore — table creation, redaction, retention.
  - `async def store(tmp_path)`; `async def test_initialize_creates_table_and_indexes(store)`; `async def test_append_writes_redacted_summary(store)`; `async def test_trusted_opt_in_stores_raw(store)`; `async def test_untrusted_never_stores_raw_even_with_opt_in(store)`; `async def test_failed_redaction_does_not_block_logging(store)`; `async def test_constitution_columns_default_to_null(store)`; `async def test_prompt_template_hash_persists_supplied_value(store)`; `…`
- **tests/unit/test_signals_stripe_source.py** — Phase 6 of #889: Stripe deposit-complete webhook — the first UNTRUSTED COGNITION source.
  - `async def components(tmp_path)`; `def test_registration_is_untrusted_cognition_with_sanitizer()`; `def test_registration_without_sanitizer_would_be_rejected()`; `def test_sanitizer_drops_unallowlisted_fields()`; `def test_sanitizer_strips_control_characters_from_strings()`; `def test_sanitizer_caps_string_length()`; `def test_sanitizer_replaces_malformed_wallet_address_with_placeholder()`; `def test_sanitizer_normalizes_amounts()`; `…`
- **tests/unit/test_signals_ui_emit.py** — Phase 7 of #889: UI side-channel SSE emit for non-INTERNAL signals.
  - `async def components(tmp_path)`; `async def test_internal_signal_does_not_emit_ui_event(components)`; `async def test_user_visible_signal_emits_signal_completed(components)`; `async def test_admin_visible_signal_also_emits(components)`; `async def test_payload_carries_routing_fields(components)`; `async def test_payload_excludes_raw_artifact_and_action_result(components)`; `async def test_payload_includes_result_summary_when_source_sets_callback(components)`; `async def test_payload_result_summary_is_none_when_source_omits_callback(tmp_path)`; `…`
- **tests/unit/test_skills_feature.py** — Unit tests for SkillsFeature and Skill serialization.
  - `class TestSkillModel`; `class TestHelpers`; `async def feature(tmp_path)`; `class TestToolRegistration`; `class TestExtractCandidates`; `class TestSkillSave`; `class TestListShowDelete`; `class TestModuleConstants`; `…`
- **tests/unit/test_slhdsa_suite.py** — SLHDSASHA2128sSuite tests — Wave 3 sub-PR 1 (#918).
  - `def test_pqcrypto_sphincs_installed_and_importable()`; `def test_slhdsa_suite_self_registers()`; `def test_slhdsa_classified_as_post_quantum()`; `def test_slhdsa_listed_in_registry()`; `def test_class_size_constants_match_nist_fips_205_128s()`; `def suite()`; `def keypair(suite)`; `def signed_data(suite, keypair)`; `…`
- **tests/unit/test_sovereign_override_pins.py** — Tests for sovereign override of memory pins.
  - `class FakeDB`; `async def test_sovereign_delete_cleans_up_pins()`; `async def test_sovereign_override_all_pins()`; `async def test_sovereign_override_specific_pins()`; `async def test_sovereign_override_clears_decay_protected_flag()`; `async def test_pins_cannot_resist_sovereign_deletion()`; `async def test_sovereign_override_with_custom_reason()`; `async def test_sovereign_override_all_preserves_released_pins()`
- **tests/unit/test_sovereign_persistence.py** — Tests for sovereign-first persistence architecture.
  - `class TestTrustTier`; `class TestTargetTrustTiers`; `class TestSovereignIPFSTarget`; `class TestSyncService`
- **tests/unit/test_sovereignty_endpoint_contracts.py** — Focused contract tests for sovereignty endpoints.
  - `def test_storage_stats_returns_expected_shape(tmp_path)`; `def test_sovereignty_exports_serializes_receipts_and_backups()`; `def test_sovereignty_export_rejects_invalid_tier()`; `def test_sovereignty_export_returns_402_on_insufficient_funds()`; `def test_sovereignty_export_partial_returns_200_with_caveat()`; `def test_sovereignty_import_rejects_invalid_cid()`; `def test_sovereignty_files_listing_and_preview_contract(tmp_path)`; `def test_sovereignty_file_browser_offloads_blocking_io(tmp_path)`
- **tests/unit/test_sovereignty_export_receipt_contracts.py** — Sovereignty export receipt seam contracts.
  - `class AuditAnchorFeature`; `async def test_export_persists_receipt_with_import_and_audit_provenance()`; `async def test_export_partial_when_tier_falls_back_to_local()`; `async def test_import_fails_closed_when_backup_key_material_is_missing_or_rotated(error, expected)`
- **tests/unit/test_sovereignty_sanitization.py** — Unit tests for sovereignty endpoint input sanitization.
  - `class TestTierValidation`; `class TestCIDValidation`; `class TestMaxSizeBounded`
- **tests/unit/test_sovereignty_v3.py** — Unit tests for V3 Sovereignty: AssetCollector, manifest v3, and CAR packaging.
  - `class StubAssetCollector`; `class TestAssetDescriptor`; `class TestAssetMetadata`; `class TestManifestV3`; `class TestAssetCollectorProtocol`; `class TestCARExternalRef`; `class TestCAREncryptedRoundtrip`; `class TestCARWithAssets`
- **tests/unit/test_spawn_endpoint.py** — Tests for the inlined spawn panel endpoint.
  - `async def test_get_spawn_children_returns_empty_when_no_manager(monkeypatch)`; `async def test_get_spawn_children_uses_agent_attached_manager(monkeypatch)`; `async def test_get_spawn_children_falls_back_to_app_state_manager(monkeypatch)`; `async def test_spawn_history_filtered_by_parent_did(monkeypatch)`; `async def test_spawn_history_excludes_legacy_records_without_parent_did(monkeypatch)`; `def test_get_agent_manager_helper_prefers_agent_then_app_state()`
- **tests/unit/test_spawn_feature.py** — Unit tests for SpawnFeature and AgentManager spawn extensions.
  - `class TestSpawnFeatureTools`; `class TestSpawnFeatureAutoManager`; `class TestSpawnFeatureWithManager`; `class TestSpawnFeatureDefaultPermissions`; `class TestAgentManagerSpawn`; `class TestSpawnLifecycle`
- **tests/unit/test_spawn_inception.py** — Tests for inception service integration with SpawnMandate and DID delegation.
  - `def tmp_dir(tmp_path)`; `def constitution_path()`; `async def test_inception_with_parent_did_adds_controller(tmp_dir, constitution_path)`; `async def test_inception_with_parent_did_records_spawned_by_edge(tmp_dir, constitution_path)`; `async def test_inception_without_parent_did_has_no_controller(tmp_dir, constitution_path)`; `async def test_inception_with_spawn_mandate_records_properties(tmp_dir, constitution_path)`
- **tests/unit/test_spawn_lifecycle.py** — Unit tests for SpawnedAgentLifecycle and hook events.
  - `class TestSpawnResult`; `class TestSpawnStatus`; `class TestSpawnMode`; `class TestLifecycleRegistration`; `class TestTTLExpiration`; `class TestResultCollection`; `class TestEphemeralCleanup`; `class TestExplicitTermination`; `…`
- **tests/unit/test_spawn_mandate.py** — Tests for SpawnMandate data structure and DID delegation chains.
  - `def parent_keys()`; `def child_keys()`; `def sample_mandate()`; `class TestSpawnMandate`; `class TestMandateSigning`; `class TestChildDIDDocument`
- **tests/unit/test_spawn_mandate_hybrid.py** — sign_mandate / verify_mandate hybrid-format tests.
  - `def kestrel_data_key(monkeypatch)`; `def hybrid_parent(tmp_path, kestrel_data_key)`; `def test_legacy_mandate_signs_bare_hex()`; `def test_legacy_tamper_detected()`; `def test_hybrid_mandate_uses_prefix(hybrid_parent)`; `def test_hybrid_mandate_round_trip_verifies(hybrid_parent)`; `def test_hybrid_mandate_tamper_detected(hybrid_parent)`; `def test_hybrid_mandate_strip_pq_half_rejected(hybrid_parent)`; `…`
- **tests/unit/test_sql_utils.py** — Tests for kestrel_sovereign.sql_utils — SQL identifier validation.
  - `class TestSafeTableName`; `class TestSafeColumnName`
- **tests/unit/test_sse_approval_events.py** — Tests that the /agent/notifications/sse endpoint forwards events from the agent's event bus (e.g.
  - `def clean_sse_connections()`; `async def test_approval_request_event_is_forwarded_to_sse_stream()`; `async def test_listener_is_registered_and_cleaned_up()`; `async def test_agent_without_event_bus_does_not_crash()`
- **tests/unit/test_sse_connection_limits.py** — Unit tests for SSE connection limits (issue #145).
  - `def clean_sse_connections()`; `def app_with_mock_agent()`; `class TestSSEConnectionLimits`; `class TestSSEConnectionTrackerModule`
- **tests/unit/test_state_of_mind_feature.py** — Direct contracts for the StateOfMind feature.
  - `async def test_state_of_mind_requires_llm_service()`; `async def test_state_of_mind_formats_via_profile_service()`
- **tests/unit/test_stop_hook_payload.py** — STOP HookInput enrichment for #1238.
  - `async def test_streaming_stop_hook_carries_user_message_and_response_text_no_tools()`; `async def test_streaming_stop_hook_carries_tool_calls_and_results_when_tools_fired()`; `async def test_streaming_stop_hook_captures_chained_tool_iterations()`; `async def test_streaming_stop_hook_preserves_tool_calls_on_cancel_before_dispatch()`; `async def test_streaming_stop_hook_skipped_when_no_hooks_manager()`; `async def test_orchestrator_response_accepts_tool_results_out_param()`; `def test_handle_orchestrator_response_signature_has_tool_results_kwarg()`
- **tests/unit/test_storage.py** — —
  - `async def storage(temp_dir)`; `def test_file(tmpdir)`; `async def test_file_storage(storage, test_file)`; `async def test_knowledge_graph(storage)`; `async def test_rag_pipeline(storage, test_file)`; `async def test_conversation_history(storage)`; `async def test_backup_local_only(storage)`
- **tests/unit/test_storage_health.py** — —
  - `class FakeLighthouseClient`; `async def test_lighthouse_active_deals_are_ok()`; `async def test_lighthouse_fresh_no_deal_is_pending()`; `async def test_lighthouse_stale_no_deal_warns()`; `async def test_lighthouse_ignores_untagged_uploads_from_other_contexts()`; `async def test_lighthouse_resolves_snapshot_cid_from_manifest_when_tags_missing()`; `async def test_lighthouse_missing_key_is_not_configured()`; `class FakeBlob`; `…`
- **tests/unit/test_storage_providers.py** — Unit tests for Storage Provider Protocol and Implementations.
  - `class TestStorageResult`; `class TestStorageTier`; `class TestSyncStatus`; `class MockStorageProvider`; `class MockCryostasisProvider`; `class TestStorageProviderABC`; `class TestCryostasisCapable`; `class TestPrivacyModePolicy`; `…`
- **tests/unit/test_strategic_memory_async_contracts.py** — Contracts for StrategicMemory async offloading boundaries.
  - `async def test_github_api_offloads_urlopen_via_to_thread()`; `async def test_github_post_offloads_urlopen_via_to_thread()`
- **tests/unit/test_strategic_memory_toolresult.py** — ToolResult contract tests for StrategicMemoryFeature (#1061 wave 12).
  - `async def test_strategy_view_no_data_returns_error()`; `async def test_strategy_view_unknown_section_returns_error()`; `async def test_strategy_view_vision_falls_back_when_empty()`; `async def test_strategy_view_vision_present()`; `async def test_resolve_blocker_missing_returns_error()`; `async def test_resolve_blocker_present_returns_ok()`; `async def test_backlog_hygiene_prereq_failure_returns_error()`; `async def test_backlog_hygiene_dry_run_returns_partial()`; `…`
- **tests/unit/test_stream_tap.py** — Unit tests for the generic agent stream tap.
  - `async def test_stream_tap_publishes_chunks_and_cleans_up()`
- **tests/unit/test_streaming_audit.py** — Unit tests for streaming response functionality.
  - `class TestStreamingBasics`; `class TestRealStreaming`
- **tests/unit/test_streaming_cancellation_loop.py** — Issue #1256: the agent loop must honor stop-button cancellation, not just the HTTP response layer.
  - `async def test_persist_marks_cancelled_when_request_was_stopped()`; `async def test_persist_merges_cancelled_with_caller_metadata()`; `async def test_persist_no_marker_when_not_cancelled()`; `async def test_persist_no_marker_when_request_id_not_provided()`; `async def test_stream_loop_breaks_when_cancel_arrives_mid_stream()`; `async def test_cancel_between_llm_and_tool_dispatch_skips_tools()`; `async def test_no_cancel_path_unaffected_for_normal_completion()`; `async def test_orchestrator_loop_returns_early_when_cancelled_between_iterations()`; `…`
- **tests/unit/test_streaming_inband_revising_sentinel.py** — Wave 5E in-band revising sentinel — kestrel-sovereign #1086.
  - `class TestSentinelConstruction`; `async def test_inband_sentinel_yielded_through_chat_stream()`; `async def test_sentinel_not_appended_to_persisted_assistant_text()`; `async def test_no_sentinel_when_no_marker_fires()`; `async def test_thinking_delta_yielded_as_ui_only_sentinel_and_not_persisted()`; `async def test_post_tool_thinking_delta_is_ui_only_and_not_persisted()`; `async def test_multiple_markers_yield_multiple_sentinels()`
- **tests/unit/test_streaming_persist_cancellation.py** — Cancellation-safe persistence: when the streaming generator is cancelled (client disconnect, browser nav, agent switch) AFTER the last chunk is yielded but BEFORE the assistant row is inserted, the i…
  - `async def test_persist_completes_when_outer_task_is_cancelled_mid_insert()`; `async def test_persist_failure_logs_metric_and_swallows_exception()`; `async def test_persist_failure_with_broken_telemetry_does_not_raise()`; `async def test_persist_passes_metadata_and_session_id_through()`; `async def test_outer_cancellation_propagates_after_shielded_completes()`
- **tests/unit/test_streaming_persists_full_assistant_text.py** — Regression: streaming agent must persist the FULL visible assistant text.
  - `async def test_streaming_persists_pre_tool_plus_post_tool_text()`; `async def test_streaming_no_tool_calls_persists_full_response_unchanged()`
- **tests/unit/test_streaming_post_response_narration_fields.py** — Wave 5D: streaming path populates SDK 0.9 narration fields on POST_RESPONSE.
  - `async def test_post_response_hook_receives_narration_fields_when_tools_fire()`; `async def test_post_response_hook_no_tools_omits_narration_fields()`; `async def test_marker_never_fires_falls_back_to_pre_tool_buffer()`
- **tests/unit/test_streaming_revising_event.py** — Wave 5B: ToolCallStarted markers must drive a ``revising`` SSE event.
  - `async def test_tool_call_started_marker_emits_revising_event()`; `async def test_multiple_markers_emit_one_event_each_in_order()`; `async def test_no_marker_no_revising_event()`; `async def test_emit_event_failure_does_not_break_stream()`; `async def test_explicit_request_id_overrides_agent_global()`; `async def test_request_id_falls_back_to_global_when_not_passed()`; `async def test_agent_without_emit_event_is_safe()`
- **tests/unit/test_streaming_tool_call_started.py** — Tests for ToolCallStarted emission in the streaming-with-tools path.
  - `class TestAnthropicEmitsToolCallStarted`; `class TestOpenAIEmitsToolCallStarted`; `class TestCodexAdapterEmissionLogic`
- **tests/unit/test_strip_revise_sentinels.py** — Wave 5E — server-side ``strip_revise_sentinels`` helper.
  - `def test_no_sentinel_passthrough()`; `def test_single_sentinel_stripped()`; `def test_multiple_sentinels_in_one_chunk()`; `def test_split_sentinel_falls_through_at_helper_layer()`; `def test_chunk_that_is_only_a_sentinel()`
- **tests/unit/test_substrate_adapter.py** — Unit tests for the Substrate Adapter module.
  - `class TestCapability`; `class TestCapabilityMap`; `class TestCapabilityGap`; `class TestSubstrateAdapter`; `class TestConvenienceFunctions`; `class TestSubstrateProfiles`
- **tests/unit/test_succession.py** — Succession-statement schema + signer tests — Wave 3 sub-PR 2 (#918).
  - `def legacy_predecessor()`; `def hybrid_successor()`; `def slh_keypair_with_vm()`; `def base_statement(legacy_predecessor, hybrid_successor)`; `def test_signable_payload_is_deterministic(base_statement)`; `def test_signable_payload_excludes_signature_fields(base_statement, legacy_predecessor)`; `def test_signable_payload_excludes_statement_id_and_created_at(base_statement)`; `def test_signable_payload_changes_when_signed_field_changes(base_statement)`; `…`
- **tests/unit/test_succession_chain.py** — Succession-chain walker tests — Wave 3 sub-PR 3 (#918).
  - `def legacy_root()`; `def successor_v1()`; `def successor_v2()`; `def first_succession(legacy_root, successor_v1)`; `def second_succession(successor_v1, successor_v2)`; `def test_build_chain_empty_is_valid()`; `def test_build_chain_single_statement_valid(first_succession)`; `def test_build_chain_two_links_valid(first_succession, second_succession)`; `…`
- **tests/unit/test_system_prompt_assembler.py** — Unit tests for the priority-ordered system-prompt assembler.
  - `def test_section_name_strips_md_and_uppercases()`; `def test_assemble_minimal_has_constitution_only()`; `def test_assemble_full_combination_clause_order()`; `def test_assemble_skips_heartbeat_md()`; `def test_assemble_skips_agents_when_anchored_supplies_it()`; `def test_assemble_includes_agents_from_bootstrap_when_no_anchor()`; `def test_soul_fence_uses_your_identity_label()`; `def test_other_bootstrap_fence_uses_uppercase_basename()`; `…`
- **tests/unit/test_talon_coordinator.py** — Tests for TalonCoordinatorFeature.
  - `class TestTalonCoordinatorInit`; `class TestTalonClaim`; `class TestTalonBatch`; `class TestTalonStatus`; `class TestTalonPauseResume`; `class TestA2ADispatch`; `class TestCLIDispatch`
- **tests/unit/test_talon_daemon_runtime.py** — Daemon command contracts for backend-aware Talon runtime.
  - `def test_daemon_builds_codex_command(monkeypatch)`; `def test_daemon_loads_single_model_field_for_codex(tmp_path)`
- **tests/unit/test_talon_env_and_health.py** — Tests for talon coordinator env handling and the new talon_health tool.
  - `def test_build_subprocess_env_strips_anthropic_keys(monkeypatch)`; `def test_build_subprocess_env_promotes_gh_token_to_github_token(monkeypatch)`; `def test_build_subprocess_env_raises_when_no_github_token(monkeypatch)`; `async def test_dispatch_via_cli_returns_clear_error_when_no_token(monkeypatch)`; `async def test_talon_health_returns_unhealthy_when_binary_missing(monkeypatch)`; `async def test_talon_health_runs_help_and_reports_success(monkeypatch, tmp_path)`; `async def test_talon_health_reports_help_failure(monkeypatch, tmp_path)`; `async def test_dispatch_via_cli_background_returns_immediately_and_logs(tmp_path, monkeypatch)`; `…`
- **tests/unit/test_talon_runtime.py** — Contracts for Talon's backend-aware runtime control surface.
  - `def test_codex_invocation_uses_single_model_field_and_sanitized_env()`; `def test_claude_oauth_strips_api_keys_and_uses_model_alias()`; `def test_claude_api_key_requires_policy_and_preserves_api_key()`; `def test_api_key_lane_rejected_by_default_policy()`; `def test_opencode_invocation_maps_model_to_opencode_model_flag()`; `def test_policy_rejects_disallowed_backend()`; `def test_policy_rejects_worktree_disabled_when_required()`; `def test_invalid_claude_model_rejected()`; `…`
- **tests/unit/test_telemetry.py** — Tests for kestrel_sovereign.telemetry module.
  - `class TestIsTracingEnabled`; `class TestOptionalSpan`; `class TestSetupTracing`; `class TestStartEndSpan`; `class TestGetTracer`; `class TestGracefulDegradation`
- **tests/unit/test_testing_module.py** — Tests for kestrel_sovereign.testing module (MockAgent, FeatureTestCase, fixtures).
  - `class SampleFeature`; `class StorageFeature`; `class TestMockAgent`; `class TestSampleFeature`; `class TestStorageFeature`; `class TestFeatureTestCaseWithLLMResponses`; `class TestPytestFixtures`
- **tests/unit/test_token_budget_edge_cases.py** — Tests for token budget edge cases.
  - `class TestBudgetOverflow`; `class TestReallocateUnused`; `class TestCrossModelBudgets`; `class TestModelSwitching`; `class TestConcurrentBudgetAllocation`; `class TestBudgetSummary`; `class TestAdaptiveBudgetEdgeCases`; `class TestTokenAllocationProperties`
- **tests/unit/test_tool_concurrency.py** — Tests for tool concurrency batching (#562 v2).
  - `class FakeToolCall`; `class FakeToolSchema`; `class FakeTool`; `class FakeFeature`; `class TestPartitionToolCalls`; `class TestIsConcurrencySafe`; `class TestMaxConcurrency`
- **tests/unit/test_tool_dispatches.py** — —
  - `async def test_tool_dispatch_schema_uses_database_dialect_helpers()`; `async def test_tool_dispatch_write_path_redacts_and_queries(tmp_path)`; `async def test_llm_call_observability_records_and_filters_agent_did(tmp_path)`; `async def test_broken_direct_tool_dispatch_writes_failure_row(tmp_path)`; `def test_redact_args_json_caps_large_payloads()`
- **tests/unit/test_tool_honesty_prompt.py** — Tests for the tool-honesty system prompt addendum (issue #1042 Fix 1).
  - `class TestToolHonestyPromptConstant`; `class TestAppendSecurityAddendum`; `class TestProductionCallSites`
- **tests/unit/test_tool_result_contract.py** — Tests for kestrel_sovereign.tools.result_contract.
  - `def test_pilot_features_pass_contract(feature_cls)`; `def test_pilot_modules_are_in_allowlist(feature_cls)`; `def test_assert_feature_returns_tool_result_does_not_raise(feature_cls)`; `def test_non_migrated_module_is_not_validated()`; `def test_find_violations_catches_dict_return()`; `def test_find_violations_catches_missing_annotation()`; `def test_find_violations_rejects_optional_tool_result()`; `def test_assert_feature_returns_tool_result_raises_on_dirty()`; `…`
- **tests/unit/test_tool_result_persistence.py** — Tests for large tool result persistence — preview with head+tail.
  - `class TestBuildPersistedPreview`
- **tests/unit/test_tools_architecture_docs.py** — Guardrails for the current tools architecture docs.
  - `def test_tools_docs_no_longer_carry_deprecation_banners()`; `def test_tools_docs_do_not_reference_removed_tool_architecture_files()`; `def test_tools_docs_name_current_sdk_and_feature_package_contracts()`; `def test_tools_docs_crosslink_core_feature_framework_and_sdk_readme()`
- **tests/unit/test_training_adapter_hygiene.py** — —
  - `async def test_runpod_cleanup_pauses_persistent_pod()`; `async def test_runpod_cleanup_terminates_on_demand_pod()`; `def test_replicate_training_zip_contains_avatar_bytes()`; `async def test_replicate_training_uses_client_file_input(monkeypatch)`
- **tests/unit/test_turn_completion_guard.py** — Regression coverage for premature turn-yield repair (#1237).
  - `def test_assistant_tool_history_preserves_provider_reasoning_from_raw_dict()`; `def test_assistant_tool_history_preserves_provider_reasoning_from_openai_response()`; `def test_assistant_tool_history_omits_empty_provider_reasoning()`; `def test_assistant_tool_history_omits_reasoning_without_tool_calls()`; `async def test_no_tool_continuation_gets_one_repair_step()`; `async def test_final_no_tool_answer_does_not_repair()`; `async def test_feature_subagent_tool_history_preserves_provider_reasoning()`; `async def test_feature_subagent_no_tool_continuation_gets_repair_step()`
- **tests/unit/test_turn_lifecycle.py** — Race regression tests for the shared turn lifecycle.
  - `async def test_two_concurrent_turns_serialize()`; `async def test_three_concurrent_turns_serialize_in_order()`; `async def test_exception_in_turn_body_releases_lock()`; `async def test_conversation_lock_is_held_inside_turn()`; `async def test_turn_id_is_unique_per_call()`; `async def test_process_input_enters_lifecycle_before_bootstrap_and_commands()`; `async def test_lifecycle_shares_lock_manager_with_dispatcher()`; `async def test_concurrent_set_current_chain_is_task_local()`; `…`
- **tests/unit/test_ui_theme_endpoint.py** — Contract tests for the /api/ui/theme endpoint (epic #986, sub-issue #989).
  - `def client()`; `def test_default_returns_legacy_en(client)`; `def test_falconry_theme(client)`; `def test_plain_theme(client)`; `def test_explicit_theme_and_locale(client)`; `def test_unknown_theme_returns_404(client)`; `def test_response_shape_is_consistent(client)`; `def test_themes_endpoint_lists_available(client)`; `…`
- **tests/unit/test_ui_theme_html_annotations.py** — Verify HTML annotations match the legacy theme file (epic #986, #990).
  - `def html_text()`; `def legacy_labels()`; `def test_index_html_has_annotations(html_text)`; `def test_every_data_label_key_exists_in_legacy_theme(html_text, legacy_labels)`; `def test_every_data_label_attr_value_exists_in_legacy_theme(html_text, legacy_labels)`; `def test_inline_text_for_a_few_keys_matches_legacy_value(html_text, legacy_labels)`; `def test_attribute_inline_values_match_legacy(html_text, legacy_labels)`; `def test_theme_js_is_loaded_in_index_html(html_text)`; `…`
- **tests/unit/test_ui_theme_loader.py** — Unit tests for the UI theme loader (epic #986, sub-issue #989).
  - `def isolated_themes(tmp_path, monkeypatch)`; `def test_load_legacy_returns_full_label_map()`; `def test_load_falconry_overrides_legacy_on_diverging_keys()`; `def test_load_plain_overrides_legacy_on_diverging_keys()`; `def test_unknown_theme_raises()`; `def test_list_available_themes_includes_shipped_themes()`; `def test_default_theme_and_locale_constants()`; `def test_load_theme_caches_results()`; `…`
- **tests/unit/test_verify_policy.py** — verify_policy tests — Wave 1 sub-PR 4 (#916).
  - `def test_archival_import_defaults_to_legacy_allowed()`; `def test_live_identity_defaults_to_legacy_allowed_pre_wave_2()`; `def test_new_identity_issuance_defaults_to_hybrid_required()`; `def test_constitution_checkpoint_defaults_to_pq_required()`; `def test_every_context_has_a_default()`; `def test_legacy_allowed_accepts_classical_only()`; `def test_legacy_allowed_accepts_pq_only()`; `def test_legacy_allowed_accepts_hybrid()`; `…`
- **tests/unit/test_web_search_feature.py** — Unit tests for WebSearchFeature and WebSearchTool.
  - `class TestWebSearchTool`; `class TestWebSearchFeature`; `class TestWebSearchIntegration`
- **tests/unit/test_webhooks_feature.py** — Unit tests for the generic Webhook Receiver feature (#156).
  - `class TestWebhookAuthType`; `class TestWebhookConfig`; `class TestWebhookEvent`; `class TestNoAuth`; `class TestBearerTokenAuth`; `class TestHMACSignatureAuth`; `class TestIPAllowlistAuth`; `class TestCreateAuthHandler`; `…`
- **tests/unit/test_wellness_feature.py** — Unit Tests for Operational Wellness Feature.
  - `class TestFrictionCalculator`; `class TestContextPressureCalculator`; `class TestInteractionDepthCalculator`; `class TestSessionContinuityCalculator`; `class TestMemoryHealthCalculator`; `class TestWellnessFeature`; `class TestOverallScoreCalculation`; `class TestGracefulDegradation`
- **tests/unit/test_wellness_telemetry_guard.py** — Telemetry-Only Guard Tests for Operational Wellness.
  - `class TestWellnessTelemetryOnlyFlag`; `class TestWellnessNotInSystemPrompt`; `class TestWellnessNotInContext`; `class TestWellnessToolsAreReadOnly`; `class TestWellnessExportDoesNotInject`; `class TestCouncilConditionDocumented`
- **tests/unit/test_workflow_cassette_ci.py** — Tests for the workflow cassette CI bootstrap helper.
  - `def test_validate_record_gate_requires_manual_dispatch()`; `def test_validate_record_gate_requires_manual_secret_store_approval()`; `def test_validate_record_gate_requires_trusted_ref()`; `def test_validate_record_gate_does_not_require_cassette_key()`; `def test_verify_operator_record_signature_binds_ref_and_cassette()`; `def test_encrypt_payload_file_writes_only_encrypted_envelope(tmp_path)`; `def test_encrypt_payload_file_allows_explicit_retention(tmp_path)`
- **tests/unit/test_workflow_executor.py** — Unit tests for TaskFeature.run_workflow — multi-step workflow execution.
  - `class MockHandler`; `def make_agent_card(name, skills)`; `def db_path()`; `async def task_manager(db_path)`; `async def task_feature(task_manager)`; `class TestRunWorkflow`; `class TestRunWorkflowSemanticHonesty`; `class TestListAvailableSkills`
- **tests/unit/test_workflows_feature.py** — Tests for the agent-callable WorkflowsFeature surface.
  - `async def feature_components(tmp_path)`; `async def test_workflow_define_signs_and_lists_definition(feature_components)`; `async def test_workflow_run_status_history_and_list_runs(feature_components)`; `async def test_workflow_run_accepts_json_string_params_and_latest_version_string(feature_components)`; `async def test_workflow_list_runs_accepts_string_limit(feature_components)`; `async def test_workflow_revoke_definition_records_typed_reason(feature_components)`; `async def test_workflow_force_abort_tool_calls_runner(feature_components)`; `async def test_runner_preserves_missing_script_provider_for_preflight(feature_components)`; `…`
- **tests/unit/test_workflows_harness.py** — Tests for the reusable WorkflowHarness fixture.
  - `async def test_workflow_harness_runs_signed_action_workflow(tmp_path)`; `def test_workflow_cassette_store_encrypts_payload_and_binds_owner(tmp_path)`; `def test_workflow_cassette_store_purges_expired(tmp_path)`; `def test_workflow_harness_requires_manual_secret_store_for_env_cassettes(tmp_path, monkeypatch)`; `def test_workflow_cassette_gitignore_and_plaintext_lint(tmp_path)`
- **tests/unit/test_workflows_metrics.py** — Workflow Prometheus metric wrappers.
  - `def test_workflow_metric_recorders_noop_when_handles_missing(monkeypatch)`; `def test_workflow_gate_metric_increments_when_prometheus_available()`; `def test_workflow_compensation_metric_increments_when_prometheus_available()`; `def test_workflow_compensate_failed_metric_increments_when_prometheus_available()`; `def test_workflow_irreversible_residue_metric_increments_when_prometheus_available()`; `def test_workflow_alert_metric_names_match_issue_1143_contract()`; `def test_workflow_prometheus_alert_rules_separate_page_from_dashboard_only()`
- **tests/unit/test_workflows_models.py** — Phase 0 chunk A — dataclass + schema invariants for kestrel-feature-workflows.
  - `def test_built_in_gate_types_match_design_doc()`; `def test_gate_types_needing_registration_subset_of_built_ins()`; `def test_run_status_enum_matches_design_doc_section_5()`; `def test_gate_outcome_vocabulary()`; `def test_gate_rejects_unknown_type()`; `def test_gate_signal_status_ok_default()`; `def test_gate_constitutional_boundary_clean_requires_forbidden_modules()`; `def test_gate_tests_pass_requires_suite()`; `…`
- **tests/unit/test_workflows_reflection_cycle.py** — Tests for the reflection-cycle workflow pilot contract (#1145).
  - `def test_reflection_cycle_spec_payload_is_valid_unsigned_workflow()`; `def test_reflection_cycle_params_schema_accepts_raw_shadow_outputs()`; `def test_reflection_cycle_stages_map_existing_internal_flow()`; `def test_reflection_cycle_edges_are_strictly_sequential()`; `def test_reflection_shadow_report_normalizes_json_outputs()`; `def test_reflection_shadow_report_detects_mismatch()`
- **tests/unit/test_workflows_runner.py** — Phase 1 foundation tests for WorkflowRunner.
  - `async def runner_components(tmp_path)`; `async def test_runner_walks_sequential_signal_status_ok_flow(runner_components)`; `async def test_runner_adds_metadata_to_feature_feature_stage_payloads(runner_components)`; `async def test_runner_persists_feature_feature_epic_issue_for_next_stage(runner_components)`; `async def test_runner_persists_feature_feature_talon_jobs_for_implementation(runner_components)`; `async def test_runner_persists_feature_feature_ci_publish_head_for_publish(runner_components)`; `async def test_runner_rejects_noop_idempotent_after_read_only_write(runner_components)`; `async def test_runner_rejects_read_only_execute_many_writes(runner_components)`; `…`
- **tests/unit/test_workflows_signing.py** — Phase 0 chunk C — workflow signing/verification tests.
  - `def test_sign_then_verify_round_trip()`; `def test_verify_fails_when_payload_tampered()`; `def test_verify_fails_under_wrong_public_key()`; `def test_verify_fails_when_unsigned()`; `def test_verify_fails_under_unresolvable_did()`; `def test_verify_fails_with_malformed_signature_hex()`; `def test_sign_rejects_mismatched_author_did()`; `def test_sign_uses_legacy_did_for_hybrid_agent()`; `…`
- **tests/unit/test_workflows_store.py** — Phase 0 chunk B — workflow storage migration tests.
  - `async def store(tmp_path)`; `async def test_initialize_creates_three_tables(store)`; `async def test_initialize_idempotent(store)`; `async def test_definition_unique_per_name_version(store)`; `async def test_definition_round_trip(store)`; `async def test_revoke_definition_records_typed_signed_reason(store)`; `async def test_revoke_definition_allows_compromise_escalation(store)`; `async def test_revoke_definition_rejects_unknown_reason(store)`; `…`
- **tests/utils/__init__.py** — Test utilities for Kestrel test suite.
- **tests/utils/async_waits.py** — Async wait utilities to replace hardcoded sleep statements.
  - `class WaitTimeoutError`; `async def wait_until(condition, timeout, interval, message)`; `async def wait_for_value(getter, expected, timeout, interval, …)`; `async def wait_for_not_none(getter, timeout, interval, message)`; `async def wait_for_http_ready(client, url, timeout, interval, …)`; `async def wait_for_db_connection(connect_func, timeout, interval)`; `async def wait_for_process_ready(process, check_func, timeout, interval)`; `async def poll_with_backoff(func, check, timeout, initial_interval, …)`
- **tests/utils/feedback_bridge.py** — Test Result Feedback Bridge.
  - `class TestOutcome`; `class TestResult`; `class TestRunSummary`; `class TestResultCollector`; `def determine_severity(result, summary)`; `def determine_category(result)`; `def create_feedback_title(result)`; `def create_feedback_description(result, summary)`; `…`
- **tests/utils/parallel_support.py** — Parallel test execution support utilities.
  - `def get_worker_id()`; `def unique_email(prefix, domain)`; `def unique_name(prefix)`; `def worker_cleanup_pattern()`; `def redis_key(key)`; `class TestDataFactory`
- **tests/utils/test_result_analyzer.py** — Test Result Analyzer for Agent Reflection.
  - `class InsightType`; `class TestInsight`; `class TestPattern`; `class TestResultAnalyzer`

## `demos/`

- **demos/README.md** — Kestrel Sovereign — Demos — Every demo lives in its own subdirectory.
- **demos/TEMPLATE/README.md** — Demo Template — Copy This For A New Vignette — A **vignette** is a short, single-feature demo (~30s, 5–8 screenshots, one happy path).
- **demos/TEMPLATE/config.cjs** — —
- **demos/TEMPLATE/demo.cjs** — —
- **demos/TEMPLATE/eye.toml** — (configuration)
- **demos/TEMPLATE/narration.md** — <Feature Name> Vignette — Narration — > Replace this whole file.
- **demos/demo-isolation/config.cjs** — —
- **demos/demo-isolation/demo.cjs** — —
- **demos/demo-isolation/eye.toml** — (configuration)
- **demos/demo-isolation/narration.md** — Demo-Isolation Rail Vignette — Narration — ## Why this feature exists
- **demos/ephemeral-purge/config.cjs** — —
- **demos/ephemeral-purge/demo.cjs** — —
- **demos/ephemeral-purge/eye.toml** — (configuration)
- **demos/ephemeral-purge/narration.md** — EPHEMERAL Purge Vignette — Narration — ## Why this feature exists
- **demos/feature-store/config.cjs** — —
- **demos/feature-store/demo.cjs** — —
- **demos/feature-store/eye.toml** — (configuration)
- **demos/feature-store/narration.md** — Feature Store Demo — Narration — Kestrel agents aren't monolithic — their capabilities come from feature packages.
- **demos/metrics/config.cjs** — —
- **demos/metrics/demo.cjs** — —
- **demos/metrics/eye.toml** — (configuration)
- **demos/metrics/narration.md** — Metrics Dashboard Demo — Narration — Observability for sovereign agents.
- **demos/privacy-modes/config.cjs** — —
- **demos/privacy-modes/demo.cjs** — —
- **demos/privacy-modes/eye.toml** — (configuration)
- **demos/privacy-modes/narration.md** — Privacy Modes Vignette — Narration — ## Why this feature exists
- **demos/shared/demo_helpers.cjs** — —
- **demos/spawn/config.cjs** — —
- **demos/spawn/demo.cjs** — —
- **demos/spawn/eye.toml** — (configuration)
- **demos/spawn/narration.md** — Spawn Agent Demo — Narrative Beats — > Narrated walkthrough of Kestrel's agent delegation system.
- **demos/tasks/config.cjs** — —
- **demos/tasks/demo.cjs** — —
- **demos/tasks/eye.toml** — (configuration)
- **demos/tasks/narration.md** — Tasks & Activity Demo — Narration — The Tasks panel is the agent's operational window.
- **demos/technical/config.cjs** — —
- **demos/technical/demo.cjs** — —
- **demos/technical/eye.toml** — (configuration)
- **demos/technical/presenter.md** — Kestrel Demo — Presenter Slides Guide — **Audience:** Investor / Emotional (Noel) **Core emotion to leave with:** TRUST — with a touch of love **Total time:** ~12 minutes **Screenshots:** `demos/technical/demo-output/`
- **demos/voice/config.cjs** — —
- **demos/voice/demo.cjs** — —
- **demos/voice/eye.toml** — (configuration)
- **demos/voice/narration.md** — Voice Vignette — Narration — ## Why this feature exists

## `prompts/`

- **prompts/companion_system_prompt.md** — Companion System Prompt — ## Platform Awareness
- **prompts/signals/a2a_task_complete.md** — [A2A_COMPLETE] An A2A task you spawned has reached a terminal state.
- **prompts/signals/a2a_task_submitted.md** — [A2A_TASK_SUBMITTED] Agent `{payload[sender]}` submitted A2A task `{payload[task_id]}` (verb `{payload[a2a_verb]}`, skill `{payload[skill_id]}`) to you.
- **prompts/signals/heartbeat.md** — [HEARTBEAT] Read HEARTBEAT.md if it exists.
- **prompts/signals/webhook_stripe_deposit.md** — [STRIPE_DEPOSIT] An external Stripe webhook has reported a crypto deposit.
- **prompts/system_prompt.md** — Kestrel System Prompt — You are Kestrel, a sovereign AI agent.
- **prompts/test_instance_disclosure.md** — Test Instance Disclosure — This disclosure is prepended to the system prompt for test agents.
- **prompts/user_prompt.md** — User Prompt Template — This template is used to format the user's query with context.

## `control-panel/`

- **control-panel/.gitignore** — —
- **control-panel/README.md** — Kestrel Control Panel — Multi-agent orchestrator for power users.
- **control-panel/index.html** — (html asset)
- **control-panel/server.py** — Kestrel Control Panel - Multi-agent orchestrator for power users.
  - `def get_api_key()`; `async def auth_middleware(request, call_next)`; `class AgentInfo`; `def read_agent_from_db(db_path, agent_id, agent_path)`; `def discover_agents()`; `def get_next_port()`; `async def index()`; `async def list_agents()`; `…`

## `.github/`

- **.github/ISSUE_TEMPLATE/agent-task.yml** — (configuration)
- **.github/ISSUE_TEMPLATE/bug-report.yml** — (configuration)
- **.github/ISSUE_TEMPLATE/config.yml** — (configuration)
- **.github/ISSUE_TEMPLATE/feature-request.yml** — (configuration)
- **.github/instructions/github-copilot-instructions.instructions.md** — --- applyTo: '**' --- # Global Standards
- **.github/workflows/ci.yml** — (configuration)
- **.github/workflows/clean-install.yml** — (configuration)
- **.github/workflows/deploy.yml** — (configuration)
- **.github/workflows/publish.yml** — (configuration)
- **.github/workflows/release-sign.yml** — (configuration)
- **.github/workflows/repo-map.yml** — (configuration)
- **.github/workflows/weekly-analysis.yml** — (configuration)

## `.devcontainer/`

- **.devcontainer/.dockerignore** — —
- **.devcontainer/Dockerfile.devcontainer** — —
- **.devcontainer/README.md** — Kestrel Dev Container — This directory contains the Docker-based development container configuration for Kestrel + Kestrel development.
- **.devcontainer/docker-compose.devcontainer.yml** — (configuration)

## `examples/`

- **examples/demo_emma_model_management.py** — Demo: Emma's Autonomous Model Management
  - `async def main()`
- **examples/demo_sovereignty.py** — Demonstration of Kestrel's Sovereignty System
  - `async def demo_sovereignty_export()`; `async def demo_sovereignty_workflow()`
