Skip to content

Commit c239da2

Browse files
authored
Merge pull request #26 from argon-it/feat/ci-feedback-loop
feat: add CI feedback loop for agent code quality
2 parents 634f06b + 218f4f1 commit c239da2

File tree

4 files changed

+150
-12
lines changed

4 files changed

+150
-12
lines changed

.githooks/pre-commit

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Pre-commit hook for Seedfast CLI
4+
#
5+
# Enable by running: git config core.hooksPath .githooks
6+
#
7+
8+
set -euo pipefail
9+
10+
RED='\033[0;31m'
11+
GREEN='\033[0;32m'
12+
NC='\033[0m' # No Color
13+
14+
failed=0
15+
16+
echo "Running pre-commit checks..."
17+
18+
# 1. Check formatting on staged .go files only
19+
staged_go_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.go' || true)
20+
if [ -n "$staged_go_files" ]; then
21+
unformatted=""
22+
for file in $staged_go_files; do
23+
if [ -f "$file" ]; then
24+
output=$(gofmt -l "$file" 2>/dev/null || true)
25+
if [ -n "$output" ]; then
26+
unformatted="$unformatted\n $file"
27+
fi
28+
fi
29+
done
30+
if [ -n "$unformatted" ]; then
31+
echo -e "${RED}FAIL${NC} go fmt: unformatted files detected:${unformatted}"
32+
echo " Run: gofmt -w . (or go fmt ./...)"
33+
failed=1
34+
else
35+
echo -e "${GREEN}PASS${NC} go fmt"
36+
fi
37+
else
38+
echo -e "${GREEN}SKIP${NC} go fmt (no staged .go files)"
39+
fi
40+
41+
# 2. go vet
42+
echo -n "Running go vet... "
43+
if ! go vet ./... 2>&1; then
44+
echo -e "${RED}FAIL${NC} go vet"
45+
failed=1
46+
else
47+
echo -e "${GREEN}PASS${NC} go vet"
48+
fi
49+
50+
# 3. Production build
51+
echo -n "Running go build... "
52+
if ! go build ./... 2>&1; then
53+
echo -e "${RED}FAIL${NC} go build (production)"
54+
failed=1
55+
else
56+
echo -e "${GREEN}PASS${NC} go build (production)"
57+
fi
58+
59+
# 4. Dev build
60+
echo -n "Running go build -tags dev... "
61+
if ! go build -tags dev ./... 2>&1; then
62+
echo -e "${RED}FAIL${NC} go build -tags dev"
63+
failed=1
64+
else
65+
echo -e "${GREEN}PASS${NC} go build -tags dev"
66+
fi
67+
68+
# 5. Check for staged docs/ files
69+
staged_docs=$(git diff --cached --name-only -- 'docs/' || true)
70+
if [ -n "$staged_docs" ]; then
71+
echo -e "${RED}FAIL${NC} docs/ files staged for commit (internal docs, not for public repo):"
72+
echo "$staged_docs" | sed 's/^/ /'
73+
echo " Unstage with: git reset HEAD docs/"
74+
failed=1
75+
else
76+
echo -e "${GREEN}PASS${NC} no docs/ files staged"
77+
fi
78+
79+
if [ "$failed" -ne 0 ]; then
80+
echo ""
81+
echo -e "${RED}Pre-commit checks failed.${NC} Fix the issues above and try again."
82+
exit 1
83+
fi
84+
85+
echo ""
86+
echo -e "${GREEN}All pre-commit checks passed.${NC}"

.github/workflows/ci.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ permissions:
1010
contents: write
1111

1212
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.25.1'
24+
cache: true
25+
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v6
28+
with:
29+
version: latest
30+
1331
ci:
1432
name: CI
1533
runs-on: ubuntu-latest
@@ -59,5 +77,21 @@ jobs:
5977
- name: Vet
6078
run: go vet ./...
6179

62-
- name: Test
63-
run: go test ./... -timeout 300s
80+
- name: Test with coverage
81+
run: go test -coverprofile=coverage.out -timeout 300s ./...
82+
83+
- name: Coverage summary
84+
if: always()
85+
run: |
86+
if [ -f coverage.out ]; then
87+
echo "### Coverage Summary"
88+
go tool cover -func=coverage.out | tail -1
89+
fi
90+
91+
- name: Upload coverage profile
92+
if: always()
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: coverage-profile
96+
path: coverage.out
97+
retention-days: 30

.golangci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
run:
2+
timeout: 3m
3+
go: "1.24"
4+
5+
linters:
6+
enable:
7+
- errcheck
8+
- ineffassign
9+
- staticcheck
10+
- unused
11+
- govet
12+
- gofmt
13+
14+
issues:
15+
exclude-files:
16+
- ".*\\.pb\\.go$"
17+
exclude-rules:
18+
- path: _test\.go
19+
linters:
20+
- errcheck

CLAUDE.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,14 @@ The main Claude Code session acts as the team lead. It coordinates all work by s
6363

6464
Sequential issue pipeline:
6565

66-
1. **Coder** implements fix -> proactively notifies tester
67-
2. **Tester** designs test plan:
68-
- Define precise expected behavior for each scenario (not "one of these outcomes is fine")
69-
- Proactively consult KB manager for existing knowledge about how the feature should work
70-
- Cover edge cases aggressively -- that's the whole point of a test plan
71-
- Agree expected behavior with team lead before executing
72-
- Never test log levels or implementation details -- only observable behavior
73-
- Submit plan to team lead for approval -> execute after approval
74-
3. **KB manager** proactively updates knowledge base once testing passes
75-
4. Team proceeds to next issue
66+
1. **Coder** implements fix → proactively notifies tester
67+
2. **Tester** designs test plan → submits to team lead for approval → executes after approval
68+
3. **Test results:**
69+
- **PASS** → KB manager updates docs → proceed to next issue
70+
- **FAIL** → tester sends structured error report (see go-tester.md template) → coder
71+
4. **Coder** fixes based on structured report → notifies tester (retry from step 3)
72+
5. **Max 3 iterations** — if tests still fail after 3 coder→tester cycles, escalate to team lead
73+
6. **Team lead** decides: alternative approach, accept with known issues, or architectural change
7674

7775
### Key Team Rules
7876

0 commit comments

Comments
 (0)