Skip to content

itdove/devaiflow#364: Make project/repo selection optional for daf investigate command#395

Merged
itdove merged 1 commit into
mainfrom
364
May 31, 2026
Merged

itdove/devaiflow#364: Make project/repo selection optional for daf investigate command#395
itdove merged 1 commit into
mainfrom
364

Conversation

@itdove
Copy link
Copy Markdown
Owner

@itdove itdove commented May 31, 2026

Now I have all the context. Here's the filled template:

Jira Issue:

Description

Makes project/repo selection optional for the daf investigate command by adding an interactive location prompt when no --path or --projects flag is specified.

Previously, daf investigate without explicit flags would automatically fall back to the current directory without giving users control over where they want to work. Now users are presented with clear options:

  1. Work in current directory - Uses os.getcwd() as-is
  2. Clone to temp directory - Only shown when current dir is a git repo; creates a clean clone
  3. Specify a different path - Allows entering an arbitrary path with existence validation
  4. Select from workspace - Existing workspace selection flow
  5. Cancel - Exit gracefully without creating a session

Key changes:

  • Added _prompt_for_investigation_location() helper in investigate_command.py with context-aware options (temp clone only shown in git repos)
  • Added temp directory utility support in devflow/utils/temp_directory.py
  • Backward compatible: --path and --projects/--workspace flags bypass all prompts
  • JSON mode skips interactive prompts and uses sensible defaults

Assisted-by: Claude

Testing

Steps to test

  1. Pull down the PR
  2. Run daf investigate --goal "Test" from inside a git repository — verify all 5 options appear including "Clone to temp directory"
  3. Run daf investigate --goal "Test" from a non-git directory (e.g., ~/Documents) — verify 4 options appear (no temp clone option)
  4. Run daf investigate --goal "Test" --path /tmp — verify prompts are skipped and /tmp is used directly
  5. Run daf investigate --goal "Test" --projects "repo1" --workspace default — verify multi-project mode still works without prompts
  6. Run DAF_MOCK_MODE=1 daf investigate --goal "Test" --json — verify no interactive prompts in JSON mode
  7. Choose "Cancel" option when prompted — verify graceful exit without creating a session
  8. Choose "Specify a different path" and enter an invalid path — verify error message is shown
  9. Run pytest tests/test_investigate_command.py to confirm unit tests pass
  10. Run bash integration-tests/test_investigation.sh to confirm integration tests pass

Scenarios tested

  • Interactive prompt from a git repository (all 5 options displayed)
  • Interactive prompt from a non-git directory (4 options, no temp clone)
  • Direct path bypass with --path flag (backward compatibility)
  • Multi-project mode with --projects + --workspace (backward compatibility)
  • Cancel flow exits cleanly
  • Invalid path entry shows error
  • Unit and integration tests pass

Deployment considerations

  • This code change is ready for deployment on its own
  • This code change requires the following considerations before being deployed:

…y support

- Extract workspace repo selection into _select_from_workspace_repos helper
- Add _prompt_investigation_location with 4 options: cwd, temp dir, custom path, workspace
- Add create_empty_temp_directory utility for ephemeral investigation workspaces
- Update investigate command to use new location prompt when no path specified
- Add integration and unit tests for temp directory and location prompt flows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@itdove itdove marked this pull request as ready for review May 31, 2026 19:29
@itdove itdove merged commit 26a7477 into main May 31, 2026
7 checks passed
@itdove itdove deleted the 364 branch May 31, 2026 19:29
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.

1 participant