- Verify() pokreće build, vet, test sa merenjem trajanja - Ako build padne, ostalo se preskače - parseTestCount parsira go test -v output - FormatResult za čitljiv ispis - 10 checker testova — svi prolaze Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83 lines
1.9 KiB
Markdown
83 lines
1.9 KiB
Markdown
# T04: Checker — verifikacija posle agenta
|
|
|
|
**Kreirao:** planer
|
|
**Datum:** 2026-02-20
|
|
**Agent:** coder
|
|
**Model:** Sonnet
|
|
**Zavisi od:** T01 ✅
|
|
|
|
---
|
|
|
|
## Opis
|
|
|
|
Posle svake Claude Code sesije, nezavisno pokrene build + test + vet.
|
|
Parsira output, broji testove, meri vreme svake provere.
|
|
|
|
## Fajlovi za kreiranje
|
|
|
|
```
|
|
code/internal/supervisor/
|
|
├── checker.go ← Verify(), CheckResult, VerifyResult
|
|
└── checker_test.go ← testovi sa privremenim Go projektom
|
|
```
|
|
|
|
## Strukture
|
|
|
|
```go
|
|
type CheckResult struct {
|
|
Name string // "build", "test", "vet"
|
|
Status string // "pass", "fail"
|
|
Output string // stdout + stderr
|
|
Duration time.Duration
|
|
TestCount int // samo za test (parsira "ok ... N tests")
|
|
}
|
|
|
|
type VerifyResult struct {
|
|
Build CheckResult
|
|
Vet CheckResult
|
|
Test CheckResult
|
|
AllPassed bool
|
|
}
|
|
```
|
|
|
|
## Funkcije
|
|
|
|
- `Verify(projectPath string) VerifyResult` — pokrene sva tri checka
|
|
- `runCheck(name, command, projectPath string) CheckResult` — pokrene jednu komandu
|
|
- `parseTestCount(output string) int` — parsira broj testova iz go test outputa
|
|
|
|
## Komande koje pokreće
|
|
|
|
```bash
|
|
go build ./...
|
|
go vet ./...
|
|
go test ./... -count=1 -v
|
|
```
|
|
|
|
## Testovi
|
|
|
|
- Napravi temp Go projekat koji prolazi → Verify vraća AllPassed=true
|
|
- Napravi temp Go projekat sa syntax error → Build fail, ostalo preskočeno
|
|
- Napravi temp Go projekat sa failing testom → Test fail
|
|
- parseTestCount: "ok github.com/dal/kaos 0.003s" → parsira tačno
|
|
- parseTestCount: "FAIL" → 0
|
|
- Proveri da Duration > 0 za svaki check
|
|
- Proveri da se Output popunjava
|
|
|
|
## Očekivani izlaz
|
|
|
|
Verify pokrene tri komande, parsira svaku, vrati VerifyResult.
|
|
`go test ./internal/supervisor/ -v` — svi testovi zeleni.
|
|
|
|
---
|
|
|
|
## Pitanja
|
|
|
|
*(agent piše pitanja ovde, planer odgovara)*
|
|
|
|
---
|
|
|
|
## Odgovori
|
|
|
|
*(planer piše odgovore ovde)*
|