feat: 支持六维评审评分及别名管理

This commit is contained in:
voocel
2026-03-12 22:25:34 +08:00
parent bce0adeff1
commit 16e790a372
14 changed files with 344 additions and 40 deletions

View File

@@ -34,18 +34,49 @@ type RelationshipEntry struct {
// ConsistencyIssue 一致性问题。
type ConsistencyIssue struct {
Type string `json:"type"` // timeline / foreshadow / relationship / character
Severity string `json:"severity"` // error / warning
Type string `json:"type"` // consistency / character / pacing / continuity / foreshadow / hook
Severity string `json:"severity"` // critical / error / warning
Description string `json:"description"`
Suggestion string `json:"suggestion,omitempty"`
}
// DimensionScore 单维度评审评分。
type DimensionScore struct {
Dimension string `json:"dimension"` // consistency / character / pacing / continuity / foreshadow / hook
Score int `json:"score"` // 0-100
Verdict string `json:"verdict"` // pass / warning / fail
Comment string `json:"comment,omitempty"` // 该维度的简要结论
}
// ReviewEntry Editor 的审阅条目。
type ReviewEntry struct {
Chapter int `json:"chapter"`
Scope string `json:"scope"` // chapter / global
Scope string `json:"scope"` // chapter / global / arc
Issues []ConsistencyIssue `json:"issues"`
Verdict string `json:"verdict"` // accept / polish / rewrite
Dimensions []DimensionScore `json:"dimensions,omitempty"` // 分维度评分
Verdict string `json:"verdict"` // accept / polish / rewrite
Summary string `json:"summary"`
AffectedChapters []int `json:"affected_chapters,omitempty"` // 需要重写/打磨的章节号
}
// CriticalCount 返回 critical 级别问题数量。
func (r *ReviewEntry) CriticalCount() int {
n := 0
for _, issue := range r.Issues {
if issue.Severity == "critical" {
n++
}
}
return n
}
// ErrorCount 返回 error 级别问题数量。
func (r *ReviewEntry) ErrorCount() int {
n := 0
for _, issue := range r.Issues {
if issue.Severity == "error" {
n++
}
}
return n
}

View File

@@ -18,6 +18,7 @@ type OutlineEntry struct {
// Character 角色档案。
type Character struct {
Name string `json:"name"`
Aliases []string `json:"aliases,omitempty"` // 别名/称号/绰号(如"废物少年"、"炎哥"
Role string `json:"role"`
Description string `json:"description"`
Arc string `json:"arc"`

11
domain/tracking.go Normal file
View File

@@ -0,0 +1,11 @@
package domain
// StateChange 角色/实体状态变化记录。
type StateChange struct {
Chapter int `json:"chapter"`
Entity string `json:"entity"` // 角色名或实体名
Field string `json:"field"` // 变化属性realm/location/status/power/relation 等
OldValue string `json:"old_value,omitempty"` // 变化前(首次出现可空)
NewValue string `json:"new_value"` // 变化后
Reason string `json:"reason,omitempty"` // 变化原因
}