Skip to content

Fix Hive enum drift regressions and Wax memory clear persistence#64

Open
christopherkarani wants to merge 1 commit intomainfrom
codex/check-frameworks-issues-20260318
Open

Fix Hive enum drift regressions and Wax memory clear persistence#64
christopherkarani wants to merge 1 commit intomainfrom
codex/check-frameworks-issues-20260318

Conversation

@christopherkarani
Copy link
Owner

Summary

This PR fixes mission-critical correctness issues surfaced during the framework audit and hardens regression coverage.

What was fixed

  1. Compile blocker (P0): non-exhaustive HiveEventKind switch in determinism canonicalization.

    • Updated HiveDeterminism.canonicalKind(_:) to handle fork lifecycle events:
      • forkStarted
      • forkCompleted
      • forkFailed
    • This restores compile safety after upstream Hive enum expansion.
  2. Correctness gap (P1): non-exhaustive HiveRuntimeError mapping in GraphAgent.

    • Added explicit mappings for newly introduced runtime errors:
      • checkpointNotFound
      • resumeInterruptMismatch
      • forkSourceCheckpointMissing
      • forkCheckpointStoreMissing
      • forkCheckpointQueryUnsupported
      • forkTargetThreadConflict
      • forkSchemaGraphMismatch
      • forkMalformedCheckpoint
    • Prevents unknown-case drift and improves deterministic error behavior.
  3. API compatibility fix (P1): updated checkpoint query test expectation to typed enum payload.

    • Adjusted HiveCheckpointQueryError assertion to .unsupported(operation: .listCheckpoints).
  4. Data correctness / isolation bug (P1): WaxMemory.clear() did not clear persisted backing data.

    • clear() now removes persisted Wax artifacts before reopening the store.
    • Eliminates stale retrieval leakage across clears/tests.
  5. Regression tests added (P1):

    • Added deterministic canonicalization test for fork lifecycle events in ChatGraphTests.
    • Validates canonical kind+attribute projection for fork events.

Validation

  • swift test --filter determinismUtilities_canonicalizesForkEvents
  • swift test --filter WaxMemoryTests
  • swift test
  • swift build

All commands pass locally.

Files touched

  • Sources/Swarm/HiveSwarm/RuntimeHardening.swift
  • Sources/Swarm/HiveSwarm/GraphAgent.swift
  • Sources/Swarm/Integration/Wax/WaxMemory.swift
  • Tests/HiveSwarmTests/ChatGraphTests.swift

…ax clear semantics

- add missing fork lifecycle canonicalization in HiveDeterminism transcript projection

- handle newly added HiveRuntimeError cases in GraphAgent error mapper to avoid silent fallthrough

- update checkpoint query test for typed unsupported(operation:) API

- add regression test covering forkStarted/forkCompleted/forkFailed canonical transcript attributes

- fix WaxMemory.clear() to remove persisted Wax artifacts before reopening store

- verify with focused and full runs: swift test --filter determinismUtilities_canonicalizesForkEvents, swift test --filter WaxMemoryTests, swift test, swift build
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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