| feat(cache): add LangGraph node-level Replay Guard for framework regression testing
Replay mode previously only mocked LLM calls but let KernelVerifier run
real compilation. When the environment differed from recording time
(e.g. missing AVX512/OpenMP), the verifier would fail and route to
conductor, which had no cached LLM response — causing a silent retry
loop until max_step was exhausted.
Introduce ReplaySnapshotStore that records each node's key output fields
during cache_mode=record and verifies them during cache_mode=replay.
On mismatch (e.g. verifier_result expected=True but actual=False due to
env issues), a ReplayGuardError is raised immediately, preventing the
workflow from entering un-cached error-handling branches.
Key changes:
- New replay_guard.py: ReplaySnapshotStore with per-node field snapshots
using sha256 fingerprints for large text fields
- Extend track_node decorator to call record/verify after each node
- Add _replay_guard field to BaseState so LangGraph preserves it
- Inject ReplaySnapshotStore into state in LangGraphTask when
cache_mode is record or replay
- Add _node_snapshots to existing cache sample JSON files
- 14 new unit tests for replay guard logic
The guard is completely inactive (zero overhead) when cache_mode is off,
which is the default for all normal workflows.
Made-with: Cursor
| 1 个月前 |
| feat(cache): add LangGraph node-level Replay Guard for framework regression testing
Replay mode previously only mocked LLM calls but let KernelVerifier run
real compilation. When the environment differed from recording time
(e.g. missing AVX512/OpenMP), the verifier would fail and route to
conductor, which had no cached LLM response — causing a silent retry
loop until max_step was exhausted.
Introduce ReplaySnapshotStore that records each node's key output fields
during cache_mode=record and verifies them during cache_mode=replay.
On mismatch (e.g. verifier_result expected=True but actual=False due to
env issues), a ReplayGuardError is raised immediately, preventing the
workflow from entering un-cached error-handling branches.
Key changes:
- New replay_guard.py: ReplaySnapshotStore with per-node field snapshots
using sha256 fingerprints for large text fields
- Extend track_node decorator to call record/verify after each node
- Add _replay_guard field to BaseState so LangGraph preserves it
- Inject ReplaySnapshotStore into state in LangGraphTask when
cache_mode is record or replay
- Add _node_snapshots to existing cache sample JSON files
- 14 new unit tests for replay guard logic
The guard is completely inactive (zero overhead) when cache_mode is off,
which is the default for all normal workflows.
Made-with: Cursor
| 1 个月前 |
| feat(cache): add LangGraph node-level Replay Guard for framework regression testing
Replay mode previously only mocked LLM calls but let KernelVerifier run
real compilation. When the environment differed from recording time
(e.g. missing AVX512/OpenMP), the verifier would fail and route to
conductor, which had no cached LLM response — causing a silent retry
loop until max_step was exhausted.
Introduce ReplaySnapshotStore that records each node's key output fields
during cache_mode=record and verifies them during cache_mode=replay.
On mismatch (e.g. verifier_result expected=True but actual=False due to
env issues), a ReplayGuardError is raised immediately, preventing the
workflow from entering un-cached error-handling branches.
Key changes:
- New replay_guard.py: ReplaySnapshotStore with per-node field snapshots
using sha256 fingerprints for large text fields
- Extend track_node decorator to call record/verify after each node
- Add _replay_guard field to BaseState so LangGraph preserves it
- Inject ReplaySnapshotStore into state in LangGraphTask when
cache_mode is record or replay
- Add _node_snapshots to existing cache sample JSON files
- 14 new unit tests for replay guard logic
The guard is completely inactive (zero overhead) when cache_mode is off,
which is the default for all normal workflows.
Made-with: Cursor
| 1 个月前 |