Files
headquarter/openspec/changes/archive/2026-06-14-completed-specs-archive/repo-clone-mode/spec.md
T
Developer c8db6ce933 fix: disable native touch panning on mobile terminal and archive specs
- Change mobile terminal CSS to use touch-action: none and
  overscroll-behavior: none so the custom touch handler owns swipes
- Archive completed/partial OpenSpec specs to
  openspec/changes/archive/2026-06-14-completed-specs-archive/
- Regenerate project maps

Quality gates: npm run typecheck, npm run lint (apps/web)
2026-06-14 18:07:01 +00:00

60 lines
2.3 KiB
Markdown

# Repository Clone Mode Specification
## Purpose
Support host-side repository cloning for tool instances, enabling isolated development environments with full git history and SSH key access for container git operations.
## Requirements
### Requirement: Host-side repository cloning
The system SHALL clone repositories on the host filesystem before container startup when clone mode is selected.
#### Scenario: Clone repository with branch selection
- **GIVEN** a repository with a remote URL and SSH key
- **WHEN** an instance is created in clone mode with branch="feature-x"
- **THEN** the system runs `git clone --branch feature-x <remote_url> <instance_dir>/repo-clone/`
- **AND** the clone includes full history
#### Scenario: Clone repository with default branch
- **GIVEN** a repository with a remote URL and SSH key
- **WHEN** an instance is created in clone mode without specifying a branch
- **THEN** the system defaults to branch="main"
- **AND** runs `git clone --branch main <remote_url> <instance_dir>/repo-clone/`
### Requirement: SSH key preparation for containers
The system SHALL decrypt and prepare SSH keys for container mounting.
#### Scenario: Prepare SSH key files
- **GIVEN** a repository with an associated SSH key
- **WHEN** a clone-mode instance is started
- **THEN** the private key is decrypted and written to `instance_dir/.ssh/id_ed25519` with mode 600
- **AND** the public key is written to `instance_dir/.ssh/id_ed25519.pub`
- **AND** an SSH config is written to `instance_dir/.ssh/config` with `StrictHostKeyChecking no`
### Requirement: Repository dirty state detection
The system SHALL detect uncommitted changes in cloned repositories.
#### Scenario: Detect clean repository
- **GIVEN** a cloned repository with no changes
- **WHEN** dirty state is checked
- **THEN** the result indicates no uncommitted changes
#### Scenario: Detect dirty repository
- **GIVEN** a cloned repository with modified files
- **WHEN** dirty state is checked
- **THEN** the result indicates uncommitted changes with file details
## Dependencies
- Database models: GitRepository, ToolInstance, SSHKey
- Docker Compose volume mounting
- Git installed on host and in containers
## Quality Gates
- `pytest` must pass
- `mypy .` must pass
- `ruff check .` must pass
- `npm run typecheck` must pass
- `npm run lint` must pass