Commit 8e709c5
Adds core/tests/test_persisted_schema_roundtrip.rs — a dependency-free,
seeded round-trip fuzz over the persisted graph (LoopCheckpoint, RunRecord
incl. all three 3.3.0 AgentEvent variants, SubagentTaskSnapshot, TraceEvent,
VerificationReport, Message/ContentBlock, and the largest root SessionData),
asserting serialize→deserialize→re-serialize stability. Plus cross-version
coverage: backward-compat (pre-3.3.0 payloads missing schema_version /
identity fields / using the `todos` alias load with defaults), forward-compat
(unknown fields ignored — guards rolling cluster upgrades against a stray
deny_unknown_fields), the untagged ToolResultContentField and the persisted
untagged PermissionRule dual-form hazards.
Closes a real gap surfaced while writing it: LoopCheckpoint documented that
loads from a future schema version must be rejected, but no impl enforced it.
Adds LoopCheckpoint::ensure_loadable() and calls it in both the file and
memory store load paths, so resume_run surfaces the error and the live-run
sink starts fresh rather than misinterpreting an incompatible checkpoint.
Co-authored-by: Claude <claude@anthropic.com>
1 parent 4470293 commit 8e709c5
4 files changed
Lines changed: 880 additions & 2 deletions
File tree
- core
- src
- store
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
72 | 102 | | |
73 | 103 | | |
74 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
471 | 475 | | |
472 | 476 | | |
473 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
| |||
0 commit comments