Skip to content

CLI-29: Migrate Parser to Use Unified SessionState #24

@dugshub

Description

@dugshub

Priority

P0 - Critical (blocks CLI-31/32)

Effort

S (2-3 hours)

Description

Update the parser system to use the unified SessionState from core instead of its own Context type. This ensures the parser and wizard system share the same state model, which is essential for integration.

Background

The parser currently has its own Context type in ui/parser/types.py. With the wizard system now using a unified SessionState model (from CLI-4/5), we need to migrate the parser to use this same state model to enable proper integration.

Dependencies

  • CLI-4 (Complete ✅)
  • CLI-5 (Complete ✅)

Tasks

  • Update ui/parser/types.py to import and use SessionState from cli_patterns.core.models
  • Migrate Context fields to SessionState structure
  • Update all parser implementations to use SessionState
  • Update parser tests to use SessionState
  • Remove old Context class
  • Ensure MyPy strict mode compliance
  • Run all parser tests to verify migration

Acceptance Criteria

  • Parser uses SessionState instead of custom Context
  • All parser tests pass with updated state model
  • No references to old Context type remain
  • MyPy strict mode passes
  • Parser and wizard systems share unified state model

Technical Notes

  • This is primarily a refactoring task - functionality should remain the same
  • The unified SessionState already has fields for parser state (parse_mode, command_history)
  • Estimated ~150-200 lines changed

References

  • cli-patterns-docs/future-work/CLI-4-follow-up-issues.md (lines 7-23)
  • src/cli_patterns/core/models.py (SessionState definition)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions