Skip to content

feat(#115): add persistent state tracking for workflow phases - #121

Merged
admarble merged 3 commits into
mainfrom
feature/115-add-persistent-state-tracking-for-workflow-phases
Jan 18, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/115-add-persistent-state-tracking-for-workflow-phases

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add persistent workflow state tracking to .sequant/state.json for tracking issue progress across sessions
  • Update sequant run to write state on phase transitions
  • Enhance sequant status with --issues flag to display tracked issues and their phase progress
  • Add utilities for rebuilding state from logs and cleaning up stale entries

Changes

  • New files:

    • state-schema.ts - Zod schemas and types for workflow state
    • state-manager.ts - CRUD operations with atomic writes
    • state-hook.ts - Utility for skills to update state in standalone mode
    • state-utils.ts - Rebuild and cleanup utilities
  • Modified files:

    • run.ts - Integrated state tracking on phase transitions
    • status.ts - Added issue state display with --issues and --json flags
    • index.ts - Exported new state management APIs

Test plan

  • Unit tests for StateManager (28 tests)
  • Unit tests for state-hook (16 tests)
  • Unit tests for state-utils (8 tests)
  • All existing tests pass (431 total)
  • npm run build succeeds

Closes #115

🤖 Generated with Claude Code

- Add state schema with Zod validation (state-schema.ts)
- Add StateManager with atomic writes using temp file + rename (state-manager.ts)
- Add state hook for skills to update state in standalone mode (state-hook.ts)
- Add rebuild from logs and cleanup utilities (state-utils.ts)
- Update sequant run to track phase transitions
- Enhance sequant status to display issue progress
- Add comprehensive tests for all new functionality

The state file is stored at .sequant/state.json and tracks:
- Issue status (not_started, in_progress, ready_for_merge, merged, blocked, abandoned)
- Phase progress (pending, in_progress, completed, failed, skipped)
- PR information, worktree paths, session IDs for resume

Co-Authored-By: Claude Opus 4.5 <[email protected]>
admarble and others added 2 commits January 17, 2026 22:50
- Add --rebuild flag to rebuild state from run logs via CLI
- Add --cleanup flag to remove stale/orphaned entries via CLI
- Add --dry-run modifier for cleanup preview
- Add --max-age option to remove old entries
- Add tests for new CLI flags

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rebuild tests now create actual log files and verify state output
- Cleanup tests create state with orphaned worktrees and old entries
- Tests verify actual behavior, not just console output strings
- Added test for actual state modification after cleanup

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit ebf16f4 into main Jan 18, 2026
@admarble
admarble deleted the feature/115-add-persistent-state-tracking-for-workflow-phases branch January 18, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add persistent state tracking for workflow phases

1 participant