Documentation
¶
Index ¶
- Constants
- type Action
- type ActionKind
- type AutoLevel
- type Category
- type Confidence
- type Finding
- func ChapterGaps(snap *Snapshot) []Finding
- func ChapterPlanInjectionGap(snap *Snapshot) []Finding
- func ChronicLowDimension(snap *Snapshot) []Finding
- func CompassDrift(snap *Snapshot) []Finding
- func ContextCompactionPressure(snap *Snapshot) []Finding
- func ContinuitySupportWeak(snap *Snapshot) []Finding
- func ContractExecutionWeak(snap *Snapshot) []Finding
- func ContractMissPattern(snap *Snapshot) []Finding
- func ExcessiveRewrites(snap *Snapshot) []Finding
- func GhostCharacter(snap *Snapshot) []Finding
- func HookWeakChain(snap *Snapshot) []Finding
- func MissingSummaries(snap *Snapshot) []Finding
- func OrphanedSteer(snap *Snapshot) []Finding
- func OutlineExhausted(snap *Snapshot) []Finding
- func PayoffMissPattern(snap *Snapshot) []Finding
- func PhaseFlowMismatch(snap *Snapshot) []Finding
- func RelationshipStagnation(snap *Snapshot) []Finding
- func RewriteAfterCompaction(snap *Snapshot) []Finding
- func RewritePendingPressure(snap *Snapshot) []Finding
- func StaleForeshadow(snap *Snapshot) []Finding
- func TimelineGaps(snap *Snapshot) []Finding
- func WordCountAnomaly(snap *Snapshot) []Finding
- type Report
- type RuleFunc
- type Severity
- type Snapshot
- type Stats
Constants ¶
const ( ThresholdDimScoreLow = 70 // ChronicLowDimension: 维度均分低于此值告警 ThresholdContractMissRate = 0.3 // ContractMissPattern: 合同未达成率上限 ThresholdRewriteRate = 0.5 // ExcessiveRewrites: 改写率上限 ThresholdWordShortRatio = 0.4 // WordCountAnomaly: 字数低于均值此比例视为异常 ThresholdWordLongRatio = 2.5 // WordCountAnomaly: 字数高于均值此比例视为异常 ThresholdHookWeakScore = 75 // HookWeakChain: hook 低于此分视为偏弱 ThresholdHookWeakChain = 3 // HookWeakChain: 连续偏弱章数阈值 ThresholdPayoffMissRate = 0.4 // PayoffMissPattern: payoff 未兑现率上限 ThresholdCompassDrift = 15 // CompassDrift: 指南针未更新章数上限 ThresholdTimelineGapRate = 0.3 // TimelineGaps: 缺失率容忍上限 ThresholdForeshadowMin = 8 // StaleForeshadow: 伏笔停滞最小章数 ThresholdDesignWeakRate = 0.6 // 设计诊断:症状与缺口相关性的最低比例 ThresholdDesignMinSamples = 2 // 设计诊断:最少样本数 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
SourceRule string // 来源规则名
Kind ActionKind // 动作类型
Severity Severity // 继承自 Finding
Summary string // 简短描述
Message string // 传递给控制流的消息
Fingerprint string // 来源 Finding 的稳定指纹,用于运行时去重
}
Action 是 Planner 根据高置信 Finding 生成的可执行动作。
func PlanActions ¶
PlanActions 根据高置信 Finding 生成可执行动作。 只有 Confidence==high && AutoLevel==safe 的 Finding 才会产出 Action。
type ActionKind ¶
type ActionKind string
ActionKind 表示诊断动作的类型。
const ( ActionEmitNotice ActionKind = "emit_notice" // 发系统提示 ActionEnqueueFollowUp ActionKind = "enqueue_follow_up" // 注入 coordinator follow-up )
type Confidence ¶
type Confidence string
Confidence 表示规则判定的置信度。
const ( ConfHigh Confidence = "high" // 确定性强,可信赖 ConfMedium Confidence = "medium" // 启发式判断,可能有误判 ConfLow Confidence = "low" // 粗略信号,仅供参考 )
type Finding ¶
type Finding struct {
Rule string // 规则名,如 "StaleForeshadow"
Category Category // 分类
Severity Severity // 严重程度
Confidence Confidence // 判定置信度
AutoLevel AutoLevel // 自动化级别
Target string // 建议作用面,如 "runtime.flow"
Title string // 一行摘要
Evidence string // 具体数据证据
Suggestion string // 改进建议(指向 prompt/flow/config)
}
Finding 是一条可执行的诊断结果。
func ChapterPlanInjectionGap ¶
ChapterPlanInjectionGap 检测问题章节是否普遍缺失 chapter_plan 注入。
func ChronicLowDimension ¶
ChronicLowDimension 检测某评审维度跨多章持续低分。
func ContextCompactionPressure ¶
ContextCompactionPressure 检测上下文压缩是否过于频繁。
func ContinuitySupportWeak ¶
ContinuitySupportWeak 检测 continuity 问题是否常伴随时间线/状态变化支持缺失。
func ContractExecutionWeak ¶
ContractExecutionWeak 判断 contract 问题更像上下文缺失还是 Writer 执行不足。
func ContractMissPattern ¶
ContractMissPattern 检测合同履约率过低。
func ExcessiveRewrites ¶
ExcessiveRewrites 检测改写率过高。
func GhostCharacter ¶
GhostCharacter 检测 core/important 角色长期未出现。
func MissingSummaries ¶
MissingSummaries 检测已完成章节缺少摘要。
func OutlineExhausted ¶
OutlineExhausted 检测大纲耗尽但小说未完结。
func PayoffMissPattern ¶
PayoffMissPattern 检测带 payoff_points 的章节长期未兑现。
func PhaseFlowMismatch ¶
PhaseFlowMismatch 检测阶段与流程状态不匹配。
func RelationshipStagnation ¶
RelationshipStagnation 检测关系数据停止更新。
func RewriteAfterCompaction ¶
RewriteAfterCompaction 检测压缩后的章节是否更容易被要求重写。
func RewritePendingPressure ¶
RewritePendingPressure 检测存在待改写章节(当前仅检测状态存在,不判定停滞)。
type Snapshot ¶
type Snapshot struct {
Progress *domain.Progress
RunMeta *domain.RunMeta
Compass *domain.StoryCompass
Outline []domain.OutlineEntry
Volumes []domain.VolumeOutline
Characters []domain.Character
CastLedger []domain.CastEntry
WorldRules []domain.WorldRule
Timeline []domain.TimelineEvent
Foreshadow []domain.ForeshadowEntry
Relationships []domain.RelationshipEntry
StateChanges []domain.StateChange
StyleRules *domain.WritingStyleRules
Reviews map[int]*domain.ReviewEntry
Plans map[int]*domain.ChapterPlan
Summaries map[int]*domain.ChapterSummary
ContextBoundaries []domain.RuntimeContextBoundary
ContextEvidence map[int]domain.ContextBuildEvidence
ReviewEvidence map[int]domain.ReviewOutcomeEvidence
ChapterTraces map[int]*chapterTrace
LoadErrors []string // 非 NotExist 的加载失败,区分"无数据"和"读取出错"
}
Snapshot 是对 output 目录全部工件的只读快照。 所有规则函数只接收 Snapshot,不直接访问文件系统。
func (*Snapshot) CompletedCount ¶
CompletedCount 返回已完成章节数(安全访问)。
func (*Snapshot) LatestCompleted ¶
LatestCompleted 返回最大已完成章节号;无则返回 0。