fix(store): prevent steering and runner status deadlocks - #290
shyamsridhar123 merged 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The lock inversion is corrected with consistent revalidation and comprehensive focused evidence.
Pull request overview
Prevents steering/run-status deadlocks by enforcing run-before-agent lock ordering and revalidating message destinations.
Changes:
- Locks the observed run before agent grant checks.
- Adds PostgreSQL concurrency and rollback regressions.
- Adds a bounded status-stream fixture and validation evidence.
File summaries
| File | Description |
|---|---|
crates/crony-store/src/lib.rs |
Implements lock ordering and destination revalidation. |
crates/crony-store/src/steering_lock_tests.rs |
Adds concurrency and authority regressions. |
crates/crony-store/Cargo.toml |
Adds Tokio test dependency. |
Cargo.lock |
Records dependency metadata. |
scripts/fake-codex-app-server.mjs |
Adds opt-in status contention fixture. |
docs/EVALS.md |
Documents validation procedure. |
docs/evidence/2026-09-15-steering-lock-order.md |
Records scope and runtime evidence. |
Review details
- Files reviewed: 6/7 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
shyamsridhar123
left a comment
There was a problem hiding this comment.
Reviewed commit 35b76f162e3fbf7f80ae2819ac639fab906de8de against ECorp's product, architecture, security, and eval contract.
Recommend approval.
Validation: Complete production/test/evidence diff reviewed; migration checker and cargo fmt passed; all 10 ignored issue223 PostgreSQL tests explicitly executed on owned PostgreSQL 17 fixture and passed (19.30s); six exact-head hosted checks green. Authored full-stack synthetic-fixture evidence inspected, not independently replayed.
Summary
Steering could deadlock with a concurrent runner status event because the two transactions acquired agent and run locks in opposite orders. Lock the exact observed run first, retain the existing agent/lease protection, and revalidate the destination before inserting a command. Changed destinations fail with a conflict and rollback; committed replay retains its original destination.
Closes #223.
Provenance and scope
Validation
Evidence and reproduction.
No hosted CI pass, real-vendor acceptance or global deadlock freedom is claimed. PRs #283 and #255 touch the store file but their inspected patches did not change these functions; refresh before integration. Merge, auto-merge, deployment and Factory intake remain disabled and unauthorized.