Skip to content

fix: --validate checks --acceptance field, add validation.on-close config#2654

Closed
seanmartinsmith wants to merge 1 commit intosteveyegge:mainfrom
seanmartinsmith:fix/validate-acceptance-and-close-reason
Closed

fix: --validate checks --acceptance field, add validation.on-close config#2654
seanmartinsmith wants to merge 1 commit intosteveyegge:mainfrom
seanmartinsmith:fix/validate-acceptance-and-close-reason

Conversation

@seanmartinsmith
Copy link
Contributor

@seanmartinsmith seanmartinsmith commented Mar 16, 2026

Summary

Unifies --validate with LintIssue() so the --acceptance field is recognized
(#2468 parity), fixes --dry-run silently bypassing --validate, and adds
validation.on-close config for terse close reason warnings.

Context

#1472 and #2468 fixed the acceptance field gap in bd lint, but --validate
still used the old ValidateTemplate() path - same bug, different entry point.
this unifies them so both go through LintIssue(). no new validation logic,
just one code path instead of two.

found while dogfooding on 85+ beads: --acceptance was never used because
--validate didn't recognize it, and 26% of close reasons were terse
one-liners ("done", "fixed"). validation.on-close follows the existing
validation.on-create pattern - defaults to off, warn mode doesn't block.

separate from the alias approach in #2638/#2639 (which makes wrong commands
work) - this fixes the validation path so the existing flags work correctly.

also noticed --dry-run completely skips --validate due to an early return.
moved validation before the dry-run exit so users get feedback during preview.

Test plan

  • 8 new TestValidateCloseReason unit tests
  • config default + file loading for validation.on-close
  • script tests: 3 create validation, 2 close validation cases
  • golangci-lint clean, gofmt clean, go test -race pass

@seanmartinsmith seanmartinsmith force-pushed the fix/validate-acceptance-and-close-reason branch from 60d1af7 to 0391aa4 Compare March 16, 2026 23:20
…nfig

Three fixes for validation consistency:

1. bd create --validate now uses LintIssue() instead of ValidateTemplate(),
   bringing it to parity with bd lint. A non-empty --acceptance field now
   satisfies the "Acceptance Criteria" requirement without needing the
   heading in --description. (GH#2468 parity)

2. --dry-run no longer bypasses --validate. Validation now runs before the
   dry-run exit, so users get feedback on template issues during preview.

3. New validation.on-close config option (none|warn|error, default: none).
   When enabled, warns on terse close reasons (<20 chars) or default
   "Closed" reasons. Mirrors existing validation.on-create pattern.
   Does not block any workflow unless explicitly set to error.
@seanmartinsmith seanmartinsmith force-pushed the fix/validate-acceptance-and-close-reason branch from 0391aa4 to cbbad52 Compare March 17, 2026 00:22
@seanmartinsmith
Copy link
Contributor Author

related: #2664 surfaces the quality/lifecycle commands in prime output and the beads-section template, plus adds doctor --check=conventions

steveyegge added a commit that referenced this pull request Mar 19, 2026
…nfig (PR #2654)

Three fixes for validation consistency:

1. bd create --validate now uses LintIssue() instead of ValidateTemplate(),
   bringing it to parity with bd lint. A non-empty --acceptance field now
   satisfies the "Acceptance Criteria" requirement without needing the
   heading in --description. (GH#2468 parity)

2. --dry-run no longer bypasses --validate. Validation now runs before the
   dry-run exit, so users get feedback on template issues during preview.

3. New validation.on-close config option (none|warn|error, default: none).
   When enabled, warns on terse close reasons (<20 chars) or default
   "Closed" reasons. Mirrors existing validation.on-create pattern.

Co-Authored-By: seanmartinsmith <114885497+seanmartinsmith@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@steveyegge
Copy link
Owner

Fix-merged to main in 63432ac. Rebased onto current main (resolved config.go conflict from sync.mode cleanup). All validation tests pass. Thanks @seanmartinsmith — clean work.

@steveyegge steveyegge closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants