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
33 lines
886 B
Go
33 lines
886 B
Go
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
|
||
}
|