diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 17:02:25 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 19:03:16 +0300 |
| commit | de0f43a061162a223c5946a4b50aa9f9ac7ab8d7 (patch) | |
| tree | f1267f8c3d0f1b7775a5ad513ee7353faa133546 /AGENTS.md | |
| parent | ea3a4db72f676ca180a8e0ca61c730c0cf9ed920 (diff) | |
test: add state invariants for refactor safety
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -49,6 +49,8 @@ Run `just check` before committing unless Can explicitly accepts narrower valida Unit tests live next to the code (`#[cfg(test)] mod tests`). New `AppState` or `Workspace` behavior should be testable with `AppState::test_new()` and `Workspace::test_new()` without PTYs. +For broad refactors or release-risk regressions, classify the risk before editing. Treat changes as refactor-risk when they touch two or more core surfaces, persisted state, protocol/API IDs, workspace/tab/pane identity, restore/handoff, agent detection authority, or UI/input state projection. Before moving code, identify the protected behavior and add or name characterization tests. Identity/state refactors should use the test-only invariants `AppState::assert_invariants_for_test()` or `Workspace::assert_invariants_for_test()` with adversarial state from `AppState::test_with_adversarial_identity_state()` or `Workspace::test_adversarial_identity_state()`. Run a roundtable for broad refactors and release-risk regressions, not for routine local fixes. + When testing a new Herdr build from inside an existing Herdr session, use `cargo run -- ...` and clear inherited Herdr socket overrides so the debug binary talks to the debug `herdr-dev` server instead of the installed stable |
