@@ -44,12 +44,22 @@ type Config struct {
4444 // Transfer configures cross-repository issue routing.
4545 Transfer TransferConfig `yaml:"transfer,omitempty"`
4646
47+ // AutoClose configures the automatic closure of confirmed duplicate issues.
48+ AutoClose AutoCloseConfig `yaml:"auto_close,omitempty"`
49+
4750 // BotUsers is a list of GitHub usernames whose events should be ignored
4851 // to prevent infinite comment loops. Built-in heuristics (e.g. "[bot]" suffix,
4952 // "gh-simili" prefix) always apply in addition to this list.
5053 BotUsers []string `yaml:"bot_users,omitempty"`
5154}
5255
56+ // AutoCloseConfig configures the auto-close behavior for duplicate issues.
57+ type AutoCloseConfig struct {
58+ GracePeriodHours int `yaml:"grace_period_hours"` // Hours after labeling before auto-close (default: 72)
59+ GracePeriodMinutesOverride int `yaml:"-"` // CLI-only override in minutes (for testing; 0 = use GracePeriodHours)
60+ DryRun bool `yaml:"dry_run,omitempty"` // If true, log actions without executing
61+ }
62+
5363// QdrantConfig holds Qdrant connection settings.
5464type QdrantConfig struct {
5565 URL string `yaml:"url"`
@@ -286,6 +296,10 @@ func (c *Config) applyDefaults() {
286296 if c .Transfer .RepoCollection == "" {
287297 c .Transfer .RepoCollection = "simili_repos"
288298 }
299+ // Auto-close defaults
300+ if c .AutoClose .GracePeriodHours == 0 {
301+ c .AutoClose .GracePeriodHours = 72
302+ }
289303}
290304
291305// mergeConfigs merges a child config onto a parent config.
@@ -376,6 +390,14 @@ func mergeConfigs(parent, child *Config) *Config {
376390 result .Transfer .RepoCollection = child .Transfer .RepoCollection
377391 }
378392
393+ // AutoClose: override if fields are set
394+ if child .AutoClose .GracePeriodHours != 0 {
395+ result .AutoClose .GracePeriodHours = child .AutoClose .GracePeriodHours
396+ }
397+ if child .AutoClose .DryRun {
398+ result .AutoClose .DryRun = child .AutoClose .DryRun
399+ }
400+
379401 return & result
380402}
381403
0 commit comments