refactor: consolidate duplicate state models (#18) #48

Merged
Charon merged 1 commit from refactor/consolidate-workspace-state-models into main 2026-02-24 13:26:37 +00:00
Member

Summary

  • Deleted Models/AgentWorkspaceState.php (legacy port with no backing migration)
  • Rewrote Models/WorkspaceState.php as the single canonical state model backed by agent_workspace_states table
  • Updated AgentPlan, StateSet tool, and SecurityTest to use WorkspaceState
  • Added WorkspaceStateTest (18 tests covering table, casts, type helpers, scopes, static helpers, MCP output, and plan integration)
  • Marked CQ-001 done in TODO.md

Test plan

  • WorkspaceState model can store and retrieve typed key-value state
  • AgentPlan::states() relation and setState() work correctly
  • StateSet MCP tool still creates/updates state entries
  • All 18 new WorkspaceStateTest tests pass
  • SecurityTest passes with updated import

Closes #18

🤖 Generated with Claude Code

## Summary - Deleted `Models/AgentWorkspaceState.php` (legacy port with no backing migration) - Rewrote `Models/WorkspaceState.php` as the single canonical state model backed by `agent_workspace_states` table - Updated `AgentPlan`, `StateSet` tool, and `SecurityTest` to use `WorkspaceState` - Added `WorkspaceStateTest` (18 tests covering table, casts, type helpers, scopes, static helpers, MCP output, and plan integration) - Marked CQ-001 done in TODO.md ## Test plan - [ ] `WorkspaceState` model can store and retrieve typed key-value state - [ ] `AgentPlan::states()` relation and `setState()` work correctly - [ ] `StateSet` MCP tool still creates/updates state entries - [ ] All 18 new `WorkspaceStateTest` tests pass - [ ] `SecurityTest` passes with updated import Closes #18 🤖 Generated with [Claude Code](https://claude.ai/claude-code)
Clotho added 1 commit 2026-02-23 05:59:05 +00:00
refactor: consolidate duplicate state models into WorkspaceState (#18)
Some checks failed
CI / PHP 8.3 (pull_request) Failing after 1m35s
CI / PHP 8.4 (pull_request) Failing after 1m38s
b9da812f7e
- Delete Models/AgentWorkspaceState.php (legacy port, no backing table)
- Rewrite Models/WorkspaceState.php as the single canonical state model
  backed by agent_workspace_states table with array value cast,
  type helpers, scopeForPlan/scopeOfType, static getValue/setValue,
  and toMcpContext() for MCP tool output
- Update AgentPlan::states() relation and setState() return type
- Update StateSet MCP tool import
- Update SecurityTest to use WorkspaceState
- Add WorkspaceStateTest covering table, casts, type helpers, scopes,
  static helpers, toMcpContext, and AgentPlan integration
- Mark CQ-001 done in TODO.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Charon force-pushed refactor/consolidate-workspace-state-models from b9da812f7e to 7fadbcb96c 2026-02-24 13:26:30 +00:00 Compare
Charon merged commit 1bbc1336b7 into main 2026-02-24 13:26:37 +00:00
Charon deleted branch refactor/consolidate-workspace-state-models 2026-02-24 13:26:37 +00:00
Sign in to join this conversation.
No description provided.