fix/ci-deploy-reset #7

Merged
starmen1265 merged 40 commits from fix/ci-deploy-reset into main 2026-03-11 19:15:45 +08:00
Owner
No description provided.
starmen1265 added 39 commits 2026-03-11 19:15:15 +08:00
- Test OutputCapture._is_prompt for prompt pattern detection
- Test OutputCapture.capture_until_complete for output capture
- Test CommandExecutor._detect_errors for error keyword detection
- Test CommandExecutor.execute for full command execution flow
- Test CommandResult dataclass for result storage
- Test CommandExecutor.send_command for pane interaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add CommandResult dataclass for storing execution results
- Add OutputCapture class with prompt detection and stabilization
- Add CommandExecutor class for command execution and error detection
- Support common shell prompts ($, ❯, ➜, >)
- Detect errors in both English and Chinese
- Use 60s default timeout from CONTEXT.md decision
- Mock-based testing (no real tmux required)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add CommandResult, OutputCapture, and CommandExecutor to __init__.py
exports for public API access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add test_approval_handler.py with 8 tests for:
  - Approval request detection (AskUserQuestion, 需要确认)
  - Approval card creation with confirm/reject buttons
  - Callback handling (approved, rejected, error)
- Add test_progress_monitor.py with 7 tests for:
  - Progress extraction (percentage, fraction, phase)
  - Update throttling (60 second interval)
  - Progress card formatting

TDD RED phase - tests will fail until implementation is complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ApprovalState dataclass for approval workflow state
- Add ApprovalHandler class with:
  - APPROVAL_PATTERNS for detection (AskUserQuestion, ExitPlanMode, 需要确认, Please confirm)
  - detect_approval_request() to find approval requests in output
  - create_approval_card() with confirm/reject buttons using CardButton
  - handle_callback() to process approval actions
  - In-memory pending_approvals cache
- Fix test assertions to use kwargs instead of positional args

All 8 tests pass for approval handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ProgressInfo dataclass for progress data
- Add ProgressMonitor class with:
  - PROGRESS_PATTERNS for extraction (percentage, fraction, phase, completion)
  - extract_progress() to find progress indicators in output
  - should_send_update() with 60 second throttling
  - create_progress_card() for Feishu card formatting
- Fix fraction pattern to allow content after fraction (e.g., [3/5 tasks])
- Fix should_send_update() to return False on first call
- Fix test assertions to use kwargs instead of positional args

All 7 tests pass for progress monitoring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add exports for:
- ApprovalHandler, ApprovalState
- ProgressMonitor, ProgressInfo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Created 03-02-SUMMARY.md with:
  - Approval workflow with confirm/reject card buttons
  - Progress monitoring with 60-second throttled updates
  - 15 tests across approval and progress modules
- Updated STATE.md with decisions and metrics
- Updated ROADMAP.md with plan progress
- Marked BRDG-04, BRDG-05 requirements complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test orchestrator initialization with dependencies
- Test command parsing for /gsd:* pattern extraction
- Test handle_message routing (session creation, command execution, error handling)
- Test handle_callback routing for approval workflow
- Add integration-style tests for full flows

18 tests total covering all orchestrator functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Orchestrator class with handle_message() and handle_callback() entry points
- Command parsing via regex: /gsd:* pattern extraction
- Auto-session-creation per CONTEXT.md decision
- Error handling with try/except returning format_error() cards
- Approval detection integration with ApprovalHandler
- Output truncation to 2000 chars for Feishu card limits
- 18 tests passing with full coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Orchestrator to __init__.py exports
- Update SKILL.md with "How It Works" section explaining orchestrator.py entry point
- Document command routing and approval workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Orchestrator class integrates all Phase 3 components
- handle_message() provides complete command routing flow
- Auto-session-creation works per CONTEXT.md decision
- Error handling returns formatted error cards
- Approval workflow integrates with callback handling
- All exports added to __init__.py
- SKILL.md documents orchestrator integration
- 18 tests with full coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test Orchestrator initializes with UserContextManager
- Test _handle_new_project creates session before executing
- Test _handle_new_project updates user context
- Test _handle_new_project executes command in session
- Test _handle_new_project returns success card
- Test handle_message routes new-project command
- Test empty project name returns error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add UserContextManager for per-user project tracking
- Add _handle_new_project method that pre-creates sessions
- Update user context after new-project creation
- Route new-project command in handle_message
- Add LONG_COMMANDS class attribute for timeout control

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test _handle_use_project updates user context
- Test success card when project exists
- Test error card with Create button when project doesn't exist
- Test handle_message routes use command
- Test empty project name returns error
- Test subsequent commands use project from user context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add TestUserContext: tests for UserContext dataclass (creation, to_dict, from_dict)
- Add TestUserContextManager: tests for manager initialization and load
- Add TestAtomicWrites: tests for atomic save with backup rotation
- Add TestMultiUser: tests for multi-user isolation and convenience methods
- Add tmp_users_root and user_context_manager fixtures to conftest.py
- Export UserContext and UserContextManager from __init__.py

Note: Implementation was already done in commit 9bd29a2 as part of 04-02 plan.
This commit adds the tests that should have been part of 04-01 TDD workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add _handle_use_project method
- Update user context when switching projects
- Return error card with Create button for non-existent projects
- Route use command in handle_message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Generic commands now use project from user context first
- Fall back to context param or default if no user context
- Add users_root parameter to Orchestrator for test isolation
- Update integration tests to use tmp_users_root fixture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 04-01-SUMMARY.md with execution details and deviations
- Update STATE.md to reflect Phase 4 progress (1/3 plans complete)
- Update ROADMAP.md to mark 04-01 as complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Created 04-02-SUMMARY.md with TDD execution details
- Updated STATE.md with new decisions and position
- Updated ROADMAP.md with 04-02 completion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add LONG_COMMANDS set with execute-phase, plan-phase, discuss-phase, new-project
- Add _is_long_command method to detect long-running commands
- Add TestLongCommands test class with 5 test cases
- Long commands will use no timeout in execute()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add _is_long_command method to detect long-running commands
- Update handle_message to use adaptive timeout based on command type
- Long commands (execute-phase, plan-phase, etc.) use timeout=None
- Regular commands use DEFAULT_TIMEOUT (60 seconds)
- Add TestAdaptiveTimeout test class with 6 test cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add new-project action handling in handle_callback
- Supports Create New Project button from error cards
- Updates user context when project is created via callback
- Add 4 new tests in TestHandleCallback for new-project action

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create SUMMARY.md with execution results
- Update STATE.md with decisions and metrics
- Mark BRDG-06 requirement as complete
- Update ROADMAP.md with phase 4 completion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
docs(phase-04): complete GSD integration phase execution
PR Test / lint (pull_request) Successful in 1s
faca5c9559
starmen1265 added 1 commit 2026-03-11 19:15:24 +08:00
Merge branch 'main' into fix/ci-deploy-reset
PR Test / lint (pull_request) Successful in 2s
1824e5b1e8
starmen1265 merged commit b8107b1d61 into main 2026-03-11 19:15:45 +08:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starmen1265/kb-skills#7