Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 16 additions & 110 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@ on:
branches: [main]

jobs:
test-go:
name: Test Go (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
defaults:
run:
working-directory: thop-go
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand All @@ -25,7 +19,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: thop-go/go.sum
cache-dependency-path: go.sum

- name: Download dependencies
run: go mod download
Expand All @@ -34,19 +28,15 @@ jobs:
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: thop-go/coverage.out
files: coverage.out
flags: go
fail_ci_if_error: false

integration-test-go:
name: Integration Test Go
integration-test:
name: Integration Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: thop-go

services:
sshd:
Expand All @@ -68,7 +58,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: thop-go/go.sum
cache-dependency-path: go.sum

- name: Wait for SSH to be ready
run: |
Expand All @@ -86,13 +76,10 @@ jobs:
THOP_INTEGRATION_TESTS: "1"
run: go test -v -tags=integration ./internal/session/...

build-go:
name: Build Go
build:
name: Build
runs-on: ubuntu-latest
needs: test-go
defaults:
run:
working-directory: thop-go
needs: test

strategy:
matrix:
Expand All @@ -107,7 +94,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: thop-go/go.sum
cache-dependency-path: go.sum

- name: Build
env:
Expand All @@ -120,14 +107,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: thop-${{ matrix.goos }}-${{ matrix.goarch }}
path: thop-go/thop-${{ matrix.goos }}-${{ matrix.goarch }}
path: thop-${{ matrix.goos }}-${{ matrix.goarch }}

lint-go:
name: Lint Go
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: thop-go

steps:
- name: Checkout code
Expand All @@ -137,88 +121,10 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache-dependency-path: thop-go/go.sum
cache-dependency-path: go.sum

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
working-directory: thop-go
args: --timeout=5m

test-rust:
name: Test Rust (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
defaults:
run:
working-directory: thop-rust

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: thop-rust

- name: Run tests
run: cargo test --verbose

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Check formatting
run: cargo fmt -- --check

build-rust:
name: Build Rust
runs-on: ubuntu-latest
needs: test-rust
defaults:
run:
working-directory: thop-rust

strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross-compilation tools
if: contains(matrix.target, 'apple')
run: |
# Cross-compilation to macOS from Linux requires special setup
# For now, we'll just check that the code compiles
echo "Cross-compilation to macOS is best done on macOS runners"

- name: Build (Linux)
if: contains(matrix.target, 'linux')
run: cargo build --release --target ${{ matrix.target }}

- name: Check (macOS targets)
if: contains(matrix.target, 'apple')
run: cargo check --target ${{ matrix.target }}

- name: Upload artifact (Linux)
if: contains(matrix.target, 'linux')
uses: actions/upload-artifact@v4
with:
name: thop-rust-${{ matrix.target }}
path: thop-rust/target/${{ matrix.target }}/release/thop
38 changes: 26 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Binaries
bin/
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool
coverage.out
coverage.html

# Dependency directories
vendor/

# IDE
.idea/
.vscode/
Expand All @@ -9,19 +27,15 @@
.DS_Store
Thumbs.db

# Editor backups
*.bak
*.orig

# Temporary files
*.tmp
*.temp
# Debug
__debug_bin

# Debian package build outputs
# Debian build artifacts
debian/.debhelper/
debian/debhelper-build-stamp
debian/files
debian/*.substvars
debian/thop/
*.deb
*.buildinfo
*.changes

# Build outputs
thop-go/thop
thop-rust/target/
File renamed without changes.
46 changes: 9 additions & 37 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,25 @@ This document provides instructions for AI agents and automated tools contributi
- State sharing between instances via file

**Architecture**: Shell wrapper (no daemon)
**Languages**: Evaluating Go and Rust in Phase 0
**Language**: Go

## Repository Structure

```
thop/
├── PRD.md # Product requirements (v0.2.0)
├── RESEARCH.md # Architecture research findings
├── TODO.md # Task list by phase
├── PROGRESS.md # Completion tracking
├── CLAUDE.md # Claude Code-specific guide
├── AGENTS.md # This file
├── thop-go/ # Go prototype (Phase 0)
│ ├── cmd/
│ ├── internal/
│ └── go.mod
└── thop-rust/ # Rust prototype (Phase 0)
├── src/
└── Cargo.toml
├── cmd/ # Main entry point
├── internal/ # Internal packages
└── go.mod
```

## Key Documents

| Document | Purpose |
|----------|---------|
| `PRD.md` | Complete requirements (v0.2.0 - shell wrapper) |
| `RESEARCH.md` | Architecture decisions and language evaluation |
| `TODO.md` | Actionable task list with phases |
| `PROGRESS.md` | Implementation status tracking |

Expand Down Expand Up @@ -72,10 +64,8 @@ thop/

### Before Starting Work

1. Read `PRD.md` for requirements context
2. Check `TODO.md` for current phase tasks
3. Review `PROGRESS.md` for status
4. Identify which prototype (Go or Rust) to work on
1. Check `TODO.md` for current phase tasks
2. Review `PROGRESS.md` for status

### During Development

Expand All @@ -92,19 +82,11 @@ thop/

## Technical Stack

### Go Prototype
- **Language**: Go 1.21+
- **SSH**: `golang.org/x/crypto/ssh`
- **Config**: `github.com/pelletier/go-toml`
- **State**: JSON file with file locking

### Rust Prototype
- **Language**: Rust 1.70+
- **SSH**: `russh` crate
- **Config**: `toml` crate
- **Async**: `tokio`
- **CLI**: `clap`

## Slash Commands

| Command | Action |
Expand Down Expand Up @@ -137,8 +119,7 @@ All errors must be:

| Phase | Focus |
|-------|-------|
| **Phase 0** | Build prototypes in Go and Rust, evaluate |
| **Phase 1** | Core MVP in chosen language |
| **Phase 1** | Core MVP |
| **Phase 2** | Robustness (reconnection, timeouts) |
| **Phase 3** | Polish (SSH config, completions) |
| **Phase 4** | Advanced (PTY, async) |
Expand All @@ -162,18 +143,11 @@ All errors must be:

## Code Quality Standards

### Go
- `gofmt` for formatting
- `golint` for style
- No `panic()` in production paths
- Error wrapping with context

### Rust
- `rustfmt` for formatting
- `clippy` for lints
- No `unwrap()` in production paths
- Proper error propagation with `?`

## Security Requirements

- Never store passwords
Expand All @@ -200,7 +174,5 @@ All errors must be:

## Getting Help

- `PRD.md` Section 5: Functional Requirements
- `PRD.md` Section 7: Technical Architecture
- `PRD.md` Section 11: Error Handling
- `RESEARCH.md`: Architecture decisions
- `TODO.md`: Task list and requirements
- `README.md`: User documentation
Loading
Loading