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
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "18"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Type check
run: pnpm check-types

- name: Test
run: pnpm test

- name: Generate Prisma Client
run: pnpm --filter=web db:generate

- name: Build
run: pnpm build
env:
Expand All @@ -57,22 +57,22 @@ jobs:
working-directory: ./apps/agent
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: "1.24"

- name: Install tools
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/tools/cmd/goimports@latest

- name: Lint
run: |
go vet ./...
staticcheck ./...

- name: Format check
run: |
if [ -n "$(gofmt -s -l .)" ]; then
Expand All @@ -85,10 +85,10 @@ jobs:
goimports -d .
exit 1
fi

- name: Test
run: go test -v -race ./...

- name: Build
run: go build -o bin/agent .

Expand All @@ -103,13 +103,13 @@ jobs:
- name: Run Trivy scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
scan-type: "fs"
scan-ref: "."
format: "sarif"
output: "trivy-results.sarif"

- name: Upload scan results
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'
sarif_file: "trivy-results.sarif"
10 changes: 5 additions & 5 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dependencies

on:
schedule:
- cron: '0 9 * * 1' # Weekly on Monday
- cron: "0 9 * * 1" # Weekly on Monday
workflow_dispatch:
push:
branches: [main]
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "18"

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: "1.24"

- name: Update dependencies
run: |
Expand All @@ -54,7 +54,7 @@ jobs:
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: 'chore: update dependencies'
title: "chore: update dependencies"
body: |
Automated dependency updates for Dev8.dev

Expand All @@ -66,7 +66,7 @@ jobs:
Changes made by automated dependency update workflow.
branch: deps-update
base: main
commit-message: 'chore: update dependencies'
commit-message: "chore: update dependencies"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
delete-branch: true
Expand Down
11 changes: 11 additions & 0 deletions apps/agent/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ AGENT_HOST=0.0.0.0
ENVIRONMENT=development
LOG_LEVEL=info

# Security Configuration
# Comma-separated list of API keys for authentication (leave empty to disable auth)
API_KEYS=

# Rate Limiting
RATE_LIMIT_RPS=100
RATE_LIMIT_BURST=200

# Request Timeout (in seconds)
REQUEST_TIMEOUT_SECONDS=300

# CORS Configuration
# Comma-separated list of allowed origins (no wildcards for security)
# For development:
Expand Down
36 changes: 18 additions & 18 deletions apps/agent/API_DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Dev8 Agent is a stateless Go microservice that orchestrates Azure Container Inst
- **Stateless**: No database, Next.js is source of truth
- **Concurrent**: File shares + ACI created simultaneously
- **Resilient**: Automatic cleanup on failures
- **Fast Restart**: 15-20s with volume reuse
- **Fast Restart**: 5-10s when restarting stopped containers

---

Expand Down Expand Up @@ -88,12 +88,12 @@ FQDN: ws-clxxx-yyyy-zzzz-aaaa-bbbb.centralindia.azurecontainer.io

### Operation Times

| Operation | Time | Notes |
| -------------------- | ---------- | -------------------------- |
| **Create Workspace** | 2m10-2m15s | All operations concurrent |
| **Start Workspace** | 15-20s | ⚑ Reuses existing volumes |
| **Stop Workspace** | 2s | Deletes container only |
| **Delete Workspace** | 5s | Removes all resources |
| Operation | Time | Notes |
| -------------------- | ---------- | ------------------------------- |
| **Create Workspace** | 2m10-2m15s | All operations concurrent |
| **Start Workspace** | 5-10s | ⚑ Restarts stopped container |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

Inconsistent Start Workspace timing across tables.

The Performance Benchmarks table (line 94) specifies "5-10s" for Start Workspace, but the Endpoint Overview table (line 190) lists "~15-20s". This creates ambiguity about actual performance expectations. Verify the correct timing and update all references consistently, including the Mermaid diagram (line 537) and Performance Tips (line 653), which also reference "15-20s".

Also applies to: 190-190


I'll verify the timing inconsistencies mentioned in the review comment by examining the actual file content.


🏁 Script executed:

#!/bin/bash
# Extract specific lines from API_DOCUMENTATION.md to verify timing claims
cd apps/agent || exit 1

echo "=== Line 94 (Performance Benchmarks table) ==="
sed -n '94p' API_DOCUMENTATION.md

echo -e "\n=== Lines 188-192 (Endpoint Overview table) ==="
sed -n '188,192p' API_DOCUMENTATION.md

echo -e "\n=== Lines 326-330 (Start response example) ==="
sed -n '326,330p' API_DOCUMENTATION.md

echo -e "\n=== Lines 535-540 (Mermaid diagram area) ==="
sed -n '535,540p' API_DOCUMENTATION.md

echo -e "\n=== Lines 650-655 (Performance Tips) ==="
sed -n '650,655p' API_DOCUMENTATION.md

echo -e "\n=== All timing occurrences in file ==="
grep -n "5-10s\|15-20s" API_DOCUMENTATION.md

Length of output: 1515


Update all Start Workspace timing references to be consistent throughout the documentation.

The review comment is accurate. The file contains conflicting timing values: "5-10s" appears in the Performance Benchmarks table (line 94), Start response example (line 328), and in lines 40 and 151; while "~15-20s" appears in the Endpoint Overview table (line 190), Mermaid diagram (line 537), and Performance Tips (line 653).

Update all references to use a single timing value consistently across:

  • Line 94 (Performance Benchmarks)
  • Line 190 (Endpoint Overview)
  • Line 328 (Start response example)
  • Line 537 (Mermaid diagram)
  • Line 653 (Performance Tips)

If the operations differ semantically (e.g., restarting stopped containers vs. general start), clarify this distinction in the documentation rather than leaving conflicting values.

πŸ€– Prompt for AI Agents
In apps/agent/API_DOCUMENTATION.md around lines 94, 190, 328, 537, and 653 there
are conflicting "Start Workspace" timing references ("5-10s" vs "~15-20s"); pick
the correct, single canonical timing value (or two distinct values only if the
actions are semantically different) and update each occurrence to match: change
the Performance Benchmarks table (line 94), the Endpoint Overview table (line
190), the Start response example (line 328), the Mermaid diagram label (line
537), and the Performance Tips text (line 653) to the chosen value; if
restarting stopped containers and initial starts have different timings,
explicitly note both with clear labels (e.g., "Restart stopped container: Xs" vs
"Initial start: Ys") to remove ambiguity.

| **Stop Workspace** | 2s | Stops container (keeps volumes) |
| **Delete Workspace** | 5s | Removes all resources |

### Create Workspace Breakdown

Expand Down Expand Up @@ -144,11 +144,11 @@ TOTAL ~2m18s
πŸ’° $35/month (while running)

3️⃣ STOP (End of Day)
↓ 2s - Container deleted
πŸ’° $1-2/month (volumes only)
↓ 2s - Container stopped
πŸ’° Reduced cost (container stopped, volumes preserved)

4️⃣ START (Next Day)
↓ 15-20s - Container recreated
↓ 5-10s - Container restarted
πŸ’° $35/month (running again)
βœ… All files preserved!
```
Expand Down Expand Up @@ -325,7 +325,7 @@ Content-Type: application/json
}
```

**Response (200 OK) - After ~15-20s:**
**Response (200 OK) - After ~5-10s:**

```json
{
Expand All @@ -348,10 +348,10 @@ Content-Type: application/json
**Agent Logs:**

```
2025/10/27 15:00:00 πŸš€ Starting workspace clxxx-yyyy-zzzz-aaaa-bbbb (checking volumes...)
2025/10/27 15:00:01 βœ… Volumes verified: workspace=fs-clxxx-..., home=fs-clxxx-...-home
2025/10/27 15:00:01 πŸ“¦ Creating new container instance with existing volumes...
2025/10/27 15:00:18 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb started successfully (reused existing volumes)
2025/10/27 15:00:00 πŸš€ Starting workspace clxxx-yyyy-zzzz-aaaa-bbbb (checking volume...)
2025/10/27 15:00:01 βœ… Unified volume verified: fs-clxxx-yyyy-zzzz-aaaa-bbbb
2025/10/27 15:00:01 πŸ“¦ Starting container instance with existing volumes...
2025/10/27 15:00:08 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb started successfully (reused existing volumes)
```
Comment on lines 350 to 355

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Add language identifier to fenced code block.

This Agent Logs block is also missing a language specifier for consistency and improved markdown rendering.

-```
+```log
 2025/10/27 15:00:00 πŸš€ Starting workspace clxxx-yyyy-zzzz-aaaa-bbbb (checking volume...)
 2025/10/27 15:00:01 βœ… Unified volume verified: fs-clxxx-yyyy-zzzz-aaaa-bbbb
 2025/10/27 15:00:01 πŸ“¦ Starting container instance with existing volumes...
 2025/10/27 15:00:08 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb started successfully (reused existing volumes)
-```
+```
🧰 Tools
πŸͺ› markdownlint-cli2 (0.18.1)

350-350: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

πŸ€– Prompt for AI Agents
apps/agent/API_DOCUMENTATION.md lines 350-355: the fenced code block containing
Agent Logs is missing a language identifier; update the opening fence to use
```log (i.e. replace ``` with ```log) so the block becomes a log-specific fenced
code block and keep the closing ``` as-is to ensure proper Markdown rendering.


---
Expand Down Expand Up @@ -379,16 +379,16 @@ Content-Type: application/json
"message": "Workspace stopped successfully",
"data": {
"workspaceId": "clxxx-yyyy-zzzz-aaaa-bbbb",
"message": "Container deleted, volumes preserved. Restart anytime to resume work."
"message": "Container stopped, volumes preserved. Restart anytime to resume work."
}
}
```

**Agent Logs:**

```
2025/10/27 18:00:00 πŸ›‘ Stopping workspace clxxx-yyyy-zzzz-aaaa-bbbb: DELETING container (keeping volumes)
2025/10/27 18:00:02 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb stopped (container deleted, volumes persisted for fast restart)
2025/10/27 18:00:00 πŸ›‘ Stopping workspace clxxx-yyyy-zzzz-aaaa-bbbb (releasing compute, preserving storage)
2025/10/27 18:00:02 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb stopped successfully (compute released, storage preserved for fast restart)
```
Comment on lines 387 to 392

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Add language identifier to fenced code block.

The Agent Logs code block is missing a language specifier. Add log or text to improve readability in markdown renderers.

-```
+```log
 2025/10/27 18:00:00 πŸ›‘ Stopping workspace clxxx-yyyy-zzzz-aaaa-bbbb (releasing compute, preserving storage)
 2025/10/27 18:00:02 βœ… Workspace clxxx-yyyy-zzzz-aaaa-bbbb stopped successfully (compute released, storage preserved for fast restart)
-```
+```
🧰 Tools
πŸͺ› markdownlint-cli2 (0.18.1)

389-389: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

πŸ€– Prompt for AI Agents
In apps/agent/API_DOCUMENTATION.md around lines 387 to 392, the fenced code
block for "Agent Logs" lacks a language identifier; update the opening fence to
include a language specifier such as "log" or "text" (e.g., change ``` to
```log) so markdown renderers apply proper formatting and syntax highlighting,
leaving the block content unchanged and keeping the closing ``` as-is.


---
Expand Down
Loading
Loading