Skip to content

refactor: extract validation and transaction logic into separate modules#9

Merged
dkmnx merged 2 commits intomainfrom
refactor/code-improvements
Feb 15, 2026
Merged

refactor: extract validation and transaction logic into separate modules#9
dkmnx merged 2 commits intomainfrom
refactor/code-improvements

Conversation

@dkmnx
Copy link
Owner

@dkmnx dkmnx commented Feb 15, 2026

Summary

  • Extract transaction logic from cmd/config.go into cmd/config_tx.go
  • Extract environment variable handling into cmd/env.go
  • Add harness functionality in cmd/harness.go
  • Extract provider validation into internal/validate/provider.go
  • Add comprehensive tests for validation module

…rors

When users have a newer config file with fields that don't exist in their
installed kairo binary, they now see a helpful guide to reinstall kairo
using the appropriate script for their platform.

Changes:
- Added handleConfigError() to detect outdated binary errors
- Show curl | sh script for Linux/macOS
- Show irm | iex script for Windows
- Link to manual installation docs
- Updated all config loading sites to use the new error handler
- Added tests for the new error handling
- Added unknown field detection in config loader
- Move cross-provider config validation to internal/validate/provider.go
- Move transaction/backup logic to cmd/config_tx.go
- Move env var merging to cmd/env.go
- Add unit tests for ValidateCrossProviderConfig and ValidateProviderModel
- Optimize mergeEnvVars with O(1) index map for duplicate removal
- Add backup cleanup on successful transactions
- Upgrade Go to 1.25.7 to fix TLS vulnerability (GO-2026-4337)
- Fix redundant nil check in errors test
- Improve getHarness parameter naming for clarity
@dkmnx dkmnx merged commit 5c889ec into main Feb 15, 2026
16 checks passed
@dkmnx dkmnx deleted the refactor/code-improvements branch February 15, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant