asepharyana
ab1a54b72e
Refactor error handling in IAM and CMS crates
...
- Introduced `RepositoryError` and `ServiceError` enums in both IAM and CMS domains for better error management.
- Updated domain traits and services to return specific error types instead of `anyhow::Result`.
- Enhanced session and OAuth repository implementations to handle errors more explicitly.
- Refactored session service methods to return `Result<T, ServiceError>` for improved error handling.
- Updated HTTP handlers to utilize the new error types.
- Modified password hashing functions to run in a blocking context using `tokio::task::spawn_blocking`.
- Added tests for new error handling mechanisms and async password functions.
2026-07-20 06:14:23 +07:00
asepharyana
5aaedbf787
docs: tambah doc comment, logging, dan inline comments di semua 255 file
...
Meliputi:
- File-level //! doc comment: tujuan file, alur kerja, komponen utama
- Function-level /// doc comment: apa, parameter, return, flow, edge cases
- Struct/enum/trait /// doc comment: peran, field docs
- Tracing logging (tracing::info!/debug!/trace!/warn!/error!) di setiap fungsi
- Inline comments untuk variable dan branching logic penting
- Seluruh 8 crates di workspace: zesdex-backend, zesdex-cms, zesdex-entities,
zesdex-iam, zesdex-infra, zesdex-ipc, zesdex-middleware, zesdex-utils
- Build: 0 errors, 242/242 tests passed
2026-07-19 17:05:47 +07:00
asepharyana and Claude Opus 4.8
7d8487cefb
refactor: consolidate #![allow(clippy::cast_*)] to crate roots
...
Add the cast-allow block to zesdex-entities/src/lib.rs and
zesdex-utils/src/lib.rs (which lacked it), then remove from
65 sub-files across all 8 crates. Build and all 223 tests
continue to pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-18 03:18:27 +07:00
asepharyana and Claude Opus 4.8
4cd38c9291
refactor: extract write_json_atomic helper, DRY 8 call sites
...
Move the crash-safe write-then-rename pattern into
zesdex-utils::write_json_atomic and apply it across:
- zesdex-cms: app_config_repo, conversation_repo, settings_repo
- zesdex-iam: oauth_repo, session_repo
- zesdex-entities: Conversation::save_conversation, Session::save
Excluded (non-JSON format):
- rewind_blob_repo (binary blob)
- memory_repo (markdown + frontmatter, not JSON)
- session_lock (PID string, not JSON)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-18 03:18:27 +07:00
asepharyana
9a67137954
refactor: massive codebase restructuring — naming, splitting, DRY
...
Crate renames:
- zesdex-entities::seaorm → domain (misleading name, no SeaORM used)
- zesdex-dto → merged into zesdex-entities (100% re-exports)
- zesdex-libs → zesdex-infra (vague name)
Module renames:
- app/harness → guard (misleading: safety gatekeeper, not test harness)
- runtime/commands → action_dispatch (name clashed with controller/command)
- resources → prompts (embedded prompt text, not general resources)
- tool/seqthink → sequential_think (unreadable abbreviation)
- msglog/query → insert (module only inserts, never queries)
Dead code removal:
- app/mode/help.rs (orphaned — not declared in mod.rs)
- app/mode/loading.rs (orphaned — not declared in mod.rs)
File splitting (71 new files, avg ~115 lines/file):
- app/runtime/actions/: 1→8 files (was 2030 lines)
- view/overlays/: 1→16 files (was 1167 lines)
- tool/lsp/: 1→8 per-tool files (was 909 lines)
- main.rs: 1→5 files (session, daemon, attach, event_loop)
- workflow/engine + hive_mind: 2→10 files
- subagent/engine + auto: 2→9 files
- lsp/provisioner: 1→5 files
- review/: 1→6 files
- guard/: 1→2 files (extracted patterns)
- state/misc: 1→3 files (input, scroll)
- mcp/: 1→3 files (transport, adapter)
- stream/json_repair extracted from turn.rs
DRY:
- Pattern constants (STUB_PATTERNS etc) in guard/patterns shared with subagent
- 3 near-identical background spawners → 1 generic + thin wrappers
- Shared spawn_subagent_with_drain() extracted
- Shared create_session() in main
- write_osc52 deduplicated
Bug fixes:
- archive_message(): sess.db → db (wrong variable name)
- execute_one_tool(): wrong parameter name
- check_credential_read() function was missing (restored from test expectations)
2026-07-17 09:08:41 +07:00