Files
goclaw/internal/tools/team_blocker_escalation_config.go
viettranx ae6615d962 feat(teams): blocker escalation, audit events, review workflow + docs
- Add comment_type column (note/blocker) with migration 000028
- Blocker comments auto-fail task, cancel member session via
  EventTeamTaskFailed broadcast, and escalate to leader via
  InboundMessage (system:escalation bypasses debounce)
- Enrich audit events: fix tenant scope bug (context.Background →
  WithTenantID), add 4 missing types (commented/progress/updated/stale),
  populate data field (reason, comment_text, progress_percent)
- Add blocker escalation config toggle in team settings UI
- Add audit logs modal with paginated team events (Clock icon)
- Update features modal: all features now available (no coming soon)
- Update code comments: reviewer role not yet active, all flows via leader
- Update docs: remove v1/v2 versioning, add blocker escalation and
  review workflow sections, document enriched audit events
2026-03-23 13:51:28 +07:00

35 lines
978 B
Go

package tools
import "encoding/json"
// BlockerEscalationConfig controls whether blocker comments trigger
// auto-fail + leader escalation.
type BlockerEscalationConfig struct {
Enabled bool `json:"enabled"` // default: true
}
// DefaultBlockerEscalationConfig returns the default (enabled) config.
func DefaultBlockerEscalationConfig() BlockerEscalationConfig {
return BlockerEscalationConfig{Enabled: true}
}
// ParseBlockerEscalationConfig extracts blocker escalation config from team settings.
func ParseBlockerEscalationConfig(settings json.RawMessage) BlockerEscalationConfig {
cfg := DefaultBlockerEscalationConfig()
if len(settings) == 0 {
return cfg
}
var s struct {
BlockerEscalation *struct {
Enabled *bool `json:"enabled"`
} `json:"blocker_escalation"`
}
if json.Unmarshal(settings, &s) != nil || s.BlockerEscalation == nil {
return cfg
}
if s.BlockerEscalation.Enabled != nil {
cfg.Enabled = *s.BlockerEscalation.Enabled
}
return cfg
}