From 120f860640cd406276deeee98913fdd0b2de2f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:36:35 +0800 Subject: [PATCH] Add files via upload --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 4ead5548..7db91d69 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -45,6 +45,7 @@ type ProjectConfig struct { Enabled bool `yaml:"enabled" json:"enabled"` DefaultProjectID string `yaml:"default_project_id,omitempty" json:"default_project_id,omitempty"` // 机器人/批量等无显式项目时绑定的默认项目 FactIndexMaxRunes int `yaml:"fact_index_max_runes,omitempty" json:"fact_index_max_runes,omitempty"` + FactIndexPathMaxRunes int `yaml:"fact_index_path_max_runes,omitempty" json:"fact_index_path_max_runes,omitempty"` FactSummaryMaxRunes int `yaml:"fact_summary_max_runes,omitempty" json:"fact_summary_max_runes,omitempty"` DefaultInjectDeprecated bool `yaml:"default_inject_deprecated,omitempty" json:"default_inject_deprecated,omitempty"` } @@ -57,6 +58,14 @@ func (c ProjectConfig) FactIndexMaxRunesEffective() int { return c.FactIndexMaxRunes } +// FactIndexPathMaxRunesEffective 攻击路径速览段的最大 rune 数(从 fact_index_max_runes 预算中预留)。 +func (c ProjectConfig) FactIndexPathMaxRunesEffective() int { + if c.FactIndexPathMaxRunes <= 0 { + return 1000 + } + return c.FactIndexPathMaxRunes +} + // FactSummaryMaxRunesEffective upsert 时 summary 最大 rune 数(索引一行,宜含验证要点)。 func (c ProjectConfig) FactSummaryMaxRunesEffective() int { if c.FactSummaryMaxRunes <= 0 {