# robson-core
**Core crate.** Zero dependencies on other robson-* crates. All other crates in this workspace depend on robson-core.
## Responsibilities
- **AppState** — shared application state (`db: DatabaseConnection`, `config: Config`)
- **Config** — `robson.toml` parsing; owns all shared config types (`JiraConfig`, `BitbucketConfig`, `ContainerConfig`, `SlackAgentConfig`)
- **Database layer** — SQLite entities (sea_orm), migrations, connection helpers
- **AI agentic loop** — Slack Socket Mode agent, LLM provider, chat TUI, scheduler, sensorium, processor, effector
## Key Modules
- `src/app_config/mod.rs` — `Config`, `JiraConfig`, `BitbucketConfig`, `ContainerConfig`, `SlackAgentConfig`, `OrchestratorConfig`
- `src/agent.rs` — `SlackAgent`: Socket Mode listener + command dispatcher
- `src/scheduler.rs` — task scheduling for the agent loop
- `src/sensorium.rs` — event sensing / input handling
- `src/processor.rs` — message processing pipeline
- `src/effector.rs` — side-effect execution
- `src/llm.rs` — `LlmProvider` trait + `ClaudeProvider`
- `src/chat/` — interactive TUI chat (ratatui)
- `src/entities/` — sea_orm entity models: `Task`, `Repo`, `TaskRepo`, `Conversation`, `AllowedChannel`, `RateLimit`
- `src/migration/` — sea_orm `Migrator` with all schema migrations
## Shared Config Types
These types are defined here and re-exported by integration crates:
| `JiraConfig` | `robson-jira` |
| `BitbucketConfig` | `robson-git` |
| `ContainerConfig` | `robson-implementation-workflow` |
## DB Public API
```rust
pub async fn connect(db_path: &str) -> Result<DatabaseConnection>
pub async fn connect_and_migrate(db_path: &str) -> Result<DatabaseConnection>
pub async fn run_migrations(db: &DatabaseConnection) -> Result<()>
// Re-exported types
pub use Task, TaskActiveModel, TaskEntity, TaskStatus, validate_repo_url
pub use Repo, RepoActiveModel, RepoEntity
pub use TaskRepo, TaskRepoActiveModel, TaskRepoEntity, TaskRepoStatus
pub use entities::{allowed_channel, conversation, rate_limit}
```
## Task Status Lifecycle
`Pending → InProgress → Done | Failed | Unfinished`
## Dependencies
**Zero robson-* dependencies.** Only external crates: `sea-orm`, `sea-orm-migration`, `tokio`, `ratatui`, `crossterm`, `reqwest`, `serde`, `tracing`, `uuid`, `toml`, `tempfile`, `chrono`, `futures-util`, `tokio-tungstenite`, `async-trait`.
## Tests
`tests/` — integration tests using the public crate API.
## Testing Rules — MANDATORY
**Tests must only be placed in `tests/`.**
- Never write `#[test]` or `#[cfg(test)]` inside `src/` files
- The only valid location is `crates/robson-core/tests/*.rs`