Release v1.0.0: Production-ready SWOOSH with durability guarantees
Major enhancements: - Added production-grade durability guarantees with fsync operations - Implemented BadgerDB WAL for crash recovery and persistence - Added comprehensive HTTP API (GET/POST /state, POST /command) - Exported ComputeStateHash for external use in genesis initialization - Enhanced snapshot system with atomic write-fsync-rename sequence - Added API integration documentation and durability guarantees docs New files: - api.go: HTTP server implementation with state and command endpoints - api_test.go: Comprehensive API test suite - badger_wal.go: BadgerDB-based write-ahead log - cmd/swoosh/main.go: CLI entry point with API server - API_INTEGRATION.md: API usage and integration guide - DURABILITY.md: Durability guarantees and recovery procedures - CHANGELOG.md: Version history and changes - RELEASE_NOTES.md: Release notes for v1.0.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -614,7 +614,9 @@ func joinRationale(r []string) string {
|
||||
return strings.Join(r, "; ")
|
||||
}
|
||||
|
||||
func computeStateHash(state OrchestratorState) (string, error) {
|
||||
// ComputeStateHash calculates the SHA256 hash of the canonical JSON representation.
|
||||
// This is exported for use by main.go during genesis state initialization.
|
||||
func ComputeStateHash(state OrchestratorState) (string, error) {
|
||||
payload, err := canonicalJSON(state)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -624,6 +626,11 @@ func computeStateHash(state OrchestratorState) (string, error) {
|
||||
return hex.EncodeToString(sum[:]), nil
|
||||
}
|
||||
|
||||
// computeStateHash is the internal wrapper (for backwards compatibility)
|
||||
func computeStateHash(state OrchestratorState) (string, error) {
|
||||
return ComputeStateHash(state)
|
||||
}
|
||||
|
||||
func canonicalJSON(value any) ([]byte, error) {
|
||||
buf, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user