Files
Agent-System-Backend/internal/quality/checker.go
T
weichen f1302ed5b3 Enable canonical versioned Go module consumption
Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements.

Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate.

Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable.

Refs: Versioned dependencies U1/U3; feature/dependency-workspace
2026-10-13 15:47:16 +00:00

33 lines
886 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package quality
import (
"os"
"path/filepath"
"strings"
"time"
"git-ssh.u1680832.nyat.app/weichen/Agent-Squad.git/squad"
)
// Checker 把评分卡接到小队质检。不通过时把意见写到工作区 quality-feedback.md,
// 供返修步骤读入。
type Checker struct{}
func (Checker) Check(req squad.CheckRequest) *squad.QualityReport {
path := filepath.Join(req.Workspace, req.Deliverable)
scored := ScoreFile(path)
report := &squad.QualityReport{
CheckedAt: time.Now(),
Score: float64(scored.Score),
Passed: scored.Passed,
Violations: scored.Violations,
}
if !scored.Passed {
body := "质检未通过,请按下列意见改一版,不要解释规则本身。\n\n"
body += strings.Join(scored.Violations, "\n")
body += "\n"
_ = os.WriteFile(filepath.Join(req.Workspace, "quality-feedback.md"), []byte(body), 0o644)
}
return report
}