refactor!: remove the diff-size cap and its gate.diff-size step

This commit is contained in:
sam committed 2026-10-24 22:19:23 +11:00
1 parent e577b48860
commit 7abc816735
20 files changed
+132 -241

No files matched your search

@@ -97,10 +97,6 @@ func (h *hybridTrees) Snapshot(ctx context.Context, dir, destDir string) error {
return h.local.Snapshot(ctx, dir, destDir)
}
func (h *hybridTrees) ChangedLines(ctx context.Context, dir, base string) (int, error) {
return h.local.ChangedLines(ctx, dir, base)
}
// ChangedFileStats forwards to the local worktree manager.
func (h *hybridTrees) ChangedFileStats(ctx context.Context, dir, base string) (task.ChangeStats, error) {
return h.local.ChangedFileStats(ctx, dir, base)
+6 -7
View File
@@ -110,13 +110,12 @@ var reloadableFields = map[string]bool{
// Per-task snapshot: ForTask carries these into every dispatched
// TaskContext (config.go ForTask), built fresh from d.Cfg.Get() at
// dispatch.
"DiffCapLines": true,
"Budgets": true,
"Dispatch": true,
"Models": true,
"ModelLimits": true,
"Notify": true,
"Review": true,
"Budgets": true,
"Dispatch": true,
"Models": true,
"ModelLimits": true,
"Notify": true,
"Review": true,
// Poll loops read the dispatch label each cycle.
"Label": true,
// MaxRetries has two consumers, both re-reading it: the webui maxRetriesFor
@@ -132,7 +132,6 @@ func runtimeToolConfigFrom(ctx context.Context, reader controlplanerpc.ResourceR
if err := layerResourceJSON(ctx, reader, versions, TaskPolicyKind, &policy); err != nil {
return config.Config{}, nil, err
}
out.DiffCapLines = new(policy.DiffCapLines)
out.Notify = config.Notify{Webhook: policy.NotifyWebhook, MinSeverity: policy.NotifyMinSeverity, Secret: policy.NotifySecret}
if err := layerResource(ctx, reader, versions, ToolSettingsKind, func(settings toolSettings) error {
+1 -5
View File
@@ -11,7 +11,6 @@ import (
const TaskPolicyKind = "task-policy"
type taskPolicy struct {
DiffCapLines int `json:"diff_cap_lines"`
NotifyWebhook string `json:"notify_webhook"`
NotifyMinSeverity string `json:"notify_min_severity"`
NotifySecret config.SecretRef `json:"notify_secret"`
@@ -22,9 +21,6 @@ func taskPolicyDefinition() Definition {
return taskPolicyOf(cfg)
}, Validate: func(input []byte) error {
return validateAs(input, func(doc taskPolicy) error {
if doc.DiffCapLines < 0 {
return fmt.Errorf("diff_cap_lines must not be negative")
}
if doc.NotifyWebhook != "" {
parsed, err := url.Parse(doc.NotifyWebhook)
if err != nil || parsed.Host == "" || (parsed.Scheme != "http" && parsed.Scheme != "https") {
@@ -44,7 +40,7 @@ func taskPolicyDefinition() Definition {
func taskPolicyOf(cfg config.Config) taskPolicy {
return taskPolicy{
DiffCapLines: cfg.DiffCap(), NotifyWebhook: cfg.Notify.Webhook,
NotifyWebhook: cfg.Notify.Webhook,
NotifyMinSeverity: cfg.Notify.MinSeverity, NotifySecret: cfg.Notify.Secret,
}
}