So an operator who sets diff_cap_lines = 0 to remove the cap gets 400 instead -- the number they were trying to get rid of. The '0 means unlimited' branch exists in StageDiffCap (internal/domain/workflow/steps.go:92, 'if tc.Cfg.DiffCapLines <= 0 { return nil }') but is unreachable from any loaded configuration, because defaulting has already replaced 0 by the time a task runs.
There is also an unvalidated edge: a NEGATIVE diff_cap_lines is not rejected by validate, and does reach the unlimited branch. So the only way to actually get unlimited today is a value the schema and validation both treat as nonsense.
Decide one behaviour and make all three surfaces agree (loader default, schema description, StageDiffCap):
keep 0 as 'unset -> 400' and fix the schema text, wiring an explicit sentinel (e.g. -1) for unlimited; or
make 0 genuinely mean unlimited and stop defaulting it.
Either way add validation so a negative value is either rejected or documented as the sentinel, and correct the schema Description, which is what led an operator to believe 0 removed the cap.
Close reason
Closed on GitHub; syncing bead state
Imported from beads archie-core-mp4d · GitHub #831 · type bug · priority P2 · created 2026-09-17 · closed 2026-09-26
internal/webui/config_schema.go:111 describes diff_cap_lines as 'Max diff size (lines)' with Description: '0 means unlimited.'
That is wrong. internal/infrastructure/configuration/defaults.go:188 coerces an unset/zero value at load time:
if cfg.DiffCapLines == 0 {
cfg.DiffCapLines = defaultDiffCapLines // 400
}
So an operator who sets diff_cap_lines = 0 to remove the cap gets 400 instead -- the number they were trying to get rid of. The '0 means unlimited' branch exists in StageDiffCap (internal/domain/workflow/steps.go:92, 'if tc.Cfg.DiffCapLines <= 0 { return nil }') but is unreachable from any loaded configuration, because defaulting has already replaced 0 by the time a task runs.
There is also an unvalidated edge: a NEGATIVE diff_cap_lines is not rejected by validate, and does reach the unlimited branch. So the only way to actually get unlimited today is a value the schema and validation both treat as nonsense.
Decide one behaviour and make all three surfaces agree (loader default, schema description, StageDiffCap):
- keep 0 as 'unset -> 400' and fix the schema text, wiring an explicit sentinel (e.g. -1) for unlimited; or
- make 0 genuinely mean unlimited and stop defaulting it.
Either way add validation so a negative value is either rejected or documented as the sentinel, and correct the schema Description, which is what led an operator to believe 0 removed the cap.
### Close reason
Closed on GitHub; syncing bead state
---
_Imported from beads `archie-core-mp4d` · GitHub #831 · type bug · priority P2 · created 2026-09-17 · closed 2026-09-26_
sam
added the mediumbug labels 2026-10-27 13:40:27 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
internal/webui/config_schema.go:111 describes diff_cap_lines as 'Max diff size (lines)' with Description: '0 means unlimited.'
That is wrong. internal/infrastructure/configuration/defaults.go:188 coerces an unset/zero value at load time:
So an operator who sets diff_cap_lines = 0 to remove the cap gets 400 instead -- the number they were trying to get rid of. The '0 means unlimited' branch exists in StageDiffCap (internal/domain/workflow/steps.go:92, 'if tc.Cfg.DiffCapLines <= 0 { return nil }') but is unreachable from any loaded configuration, because defaulting has already replaced 0 by the time a task runs.
There is also an unvalidated edge: a NEGATIVE diff_cap_lines is not rejected by validate, and does reach the unlimited branch. So the only way to actually get unlimited today is a value the schema and validation both treat as nonsense.
Decide one behaviour and make all three surfaces agree (loader default, schema description, StageDiffCap):
Either way add validation so a negative value is either rejected or documented as the sentinel, and correct the schema Description, which is what led an operator to believe 0 removed the cap.
Close reason
Closed on GitHub; syncing bead state
Imported from beads
archie-core-mp4d· GitHub #831 · type bug · priority P2 · created 2026-09-17 · closed 2026-09-26