feat(ensi): T-004 — SurrealDB 3.0 embedded init + SCHEMAFULL schema (Week 1)#74
Closed
renatobardi wants to merge 1 commit intomainfrom
Closed
feat(ensi): T-004 — SurrealDB 3.0 embedded init + SCHEMAFULL schema (Week 1)#74renatobardi wants to merge 1 commit intomainfrom
renatobardi wants to merge 1 commit intomainfrom
Conversation
…ain/ports + ensi-db SurrealDB embedded init - T-001: Cargo workspace with 8 crates (ensi-core, ensi-db, ensi-events, ensi-pipeline, ensi-server, ensi-daemon, ensi-frontend, ensi-cli) and shared workspace.dependencies - T-002: ensi-core domain entities — Workspace, Member, Agent, Project, Issue, PipelineState, Task, TaskMessage, Artifact, Comment, PAT, DaemonToken - T-003: ensi-core port traits — IssueRepository, ProjectRepository, WorkspaceRepository, MemberRepository, AgentRepository, TaskRepository, ArtifactRepository, PipelineRepository, EventPublisher, AgentExecutor, ArtifactStore, DaemonTokenRepository, PatRepository, CommentRepository - T-004: ensi-db SurrealDB 3.0 embedded init (~/ensi_data/ via kv-surrealkv), SCHEMAFULL schema for all 12 tables, idempotent migration runner via _migration table, DB health check on boot. Integration tests: connect+healthcheck, migration recorded once, all 12 tables present in schema. cargo check passes with zero warnings.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Story
REN-16 / T-004: ensi-db — SurrealDB 3.0 embedded init + SCHEMAFULL schema
Includes prerequisites T-001/T-002/T-003 (no prior implementation existed).
What was implemented
T-001 — Cargo workspace scaffold
ensi/Cargo.tomlworkspace manifest with 8 member crates and shared[workspace.dependencies]Cargo.toml+ entry files for all 8 crates (ensi-core, ensi-db, ensi-events, ensi-pipeline, ensi-server, ensi-daemon, ensi-frontend, ensi-cli).env.exampleand.gitignoreT-002 — ensi-core: domain entities
Workspace,Member,Agent,Project,Issue,PipelineState,Task,TaskMessage,Artifact,Comment,Pat,DaemonTokenCoreErrorenum viathiserrorT-003 — ensi-core: port traits
IssueRepository,ProjectRepository,WorkspaceRepository,MemberRepository,AgentRepository,TaskRepository,ArtifactRepository,PipelineRepository,EventPublisher,AgentExecutor,ArtifactStore,DaemonTokenRepository,PatRepository,CommentRepositoryResult<_, CoreError>T-004 — ensi-db: SurrealDB 3.0 embedded init + schema
DbClient::connect(DbConfig)— opens SurrealDB 3.0 embedded (kv-surrealkv) at~/ensi_data/DbConfig::from_env()— readsENSI_DATA_PATH,ENSI_DB_USER,ENSI_DB_PASS_migrationtableV001__initial_schema.surql— SCHEMAFULL schema for all 12 tables with field assertions, indexes, and constraints matching the architecture specDbClient::health_check()— called at boot, panics on failure (unrecoverable startup error)Acceptance criteria coverage
~/ensi_data/cargo check,cargo test)Tests
3 integration tests in
ensi-db:test_db_connect_and_health_check— connect + health check roundtriptest_migrations_are_recorded_once— migration table has exactly 1 entry after inittest_schema_defines_all_12_tables—INFO FOR TABLEsucceeds for all 12 tablesAll pass:
cargo test -p ensi-db→ 3 passed, 0 failed.