Codex Verify Swift Actor JSON Persistence Across Reloads
Keep a memory index and JSON file behind a Swift actor and verify local updates and recovery.
中文Install in Codex
Use a Swift concurrency toolchain and XCTest or Swift Testing. The exercise uses a temporary directory and a Sendable Codable model.
- Copy the pinned `docs/zh-CN/skills/swift-actor-persistence/` directory into `.agents/skills/swift-actor-persistence/` in the project.
- Give Codex the local directory, model identifier, and error behavior. Ask it to define the actor's public API first.
Example task
Save two versions of ID `p1` to `DraftStore` with values `one` and `two`. Reopen the temporary file in a new instance and check the ID and value.What to check
The new instance returns `two` for `p1`, and the file decodes to a single record.
Original SKILL.md on GitHub · Updated
Frequently asked question
How should a failed write be reported?
Expose an error and apply the project's memory/disk consistency rules so the UI cannot silently treat a failed write as saved.