feat(doctor): make stale closed issues check configurable (#1291)
Add stale_closed_issues_days config option to metadata.json: - 0 (default): Check disabled - repos keep unlimited beads - >0: Enable check with specified day threshold Design philosophy: Time-based cleanup is a crude proxy for the real concern (database size). Disabled by default since a repo with 100 closed issues from 5 years ago doesn't need cleanup. Also adds a warning when check is disabled but database has >10,000 closed issues, recommending users enable the threshold. Co-Authored-By: SageOx <ox@sageox.ai> Executed-By: beads/crew/emma Rig: beads Role: crew
This commit is contained in:
@@ -18,7 +18,7 @@ type Config struct {
|
||||
// Deletions configuration
|
||||
DeletionsRetentionDays int `json:"deletions_retention_days,omitempty"` // 0 means use default (3 days)
|
||||
|
||||
// Dolt server mode configuration (bd-dolt.2.2)
|
||||
// Dolt server mode configuration (bd-dolt.2.2)
|
||||
// When Mode is "server", connects to external dolt sql-server instead of embedded.
|
||||
// This enables multi-writer access for multi-agent environments.
|
||||
DoltMode string `json:"dolt_mode,omitempty"` // "embedded" (default) or "server"
|
||||
@@ -27,6 +27,10 @@ type Config struct {
|
||||
DoltServerUser string `json:"dolt_server_user,omitempty"` // MySQL user (default: root)
|
||||
// Note: Password should be set via BEADS_DOLT_PASSWORD env var for security
|
||||
|
||||
// Stale closed issues check configuration
|
||||
// 0 = disabled (default), positive = threshold in days
|
||||
StaleClosedIssuesDays int `json:"stale_closed_issues_days,omitempty"`
|
||||
|
||||
// Deprecated: LastBdVersion is no longer used for version tracking.
|
||||
// Version is now stored in .local_version (gitignored) to prevent
|
||||
// upgrade notifications firing after git operations reset metadata.json.
|
||||
@@ -152,6 +156,15 @@ func (c *Config) GetDeletionsRetentionDays() int {
|
||||
return c.DeletionsRetentionDays
|
||||
}
|
||||
|
||||
// GetStaleClosedIssuesDays returns the configured threshold for stale closed issues.
|
||||
// Returns 0 if disabled (the default), or a positive value if enabled.
|
||||
func (c *Config) GetStaleClosedIssuesDays() int {
|
||||
if c.StaleClosedIssuesDays < 0 {
|
||||
return 0
|
||||
}
|
||||
return c.StaleClosedIssuesDays
|
||||
}
|
||||
|
||||
// Backend constants
|
||||
const (
|
||||
BackendSQLite = "sqlite"
|
||||
|
||||
Reference in New Issue
Block a user