3.6 KiB
3.6 KiB
Verification Gates
Required checks before ANY bead close. No exceptions.
Gate Sequence
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Typecheck │────▶│ Lint │────▶│ Test │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
0 errors 0 warnings All pass
0 warnings Fix or or skip
document with reason
Required Commands
All Code Changes
npm run typecheck # Must PASS with 0 errors
npm run lint # Must PASS with 0 warnings (or documented exceptions)
npm run test # Must PASS all tests
UI Changes (add to above)
# Capture screenshots at all breakpoints
npm run capture:mobile # artifacts/xxx-mobile.png
npm run capture:tablet # artifacts/xxx-tablet.png
npm run capture:desktop # artifacts/xxx-desktop.png
API Changes (add to above)
npm run test:api # Route integration tests
# or
node --test tests/api/
Gate Failure Protocol
Typecheck Fails
- Fix type errors
- Re-run typecheck
- Only proceed when 0 errors
- Document: "typecheck: PASS (0 errors)"
Lint Fails
- Fix warnings if trivial
- If intentional violation: add eslint-disable with comment explaining WHY
- Document in notes: "lint: PASS (0 warnings)" or "lint: PASS (1 intentional - see line 42)"
- Never merge with unexplained lint violations
Tests Fail
- Analyze failure output
- Determine: bug in code or bug in test?
- Fix the bug (not the test to pass)
- Re-run tests
- Only proceed when ALL pass
- Document: "test: PASS (47/47)"
Flaky Tests
- Identify flaky test
- Options:
- Fix flakiness (preferred)
- Quarantine with .skip and create bead to fix
- Never skip without tracking
Evidence Format
In Bead Notes
bd update bb-xyz --notes "Verification:
- typecheck: PASS (0 errors, 0 warnings)
- lint: PASS (0 warnings)
- test: PASS (47/47 tests in 2.3s)
- UI screenshots: artifacts/kanban-390.png, artifacts/kanban-768.png, artifacts/kanban-1440.png"
In Close Reason
bd close bb-xyz --reason "Implemented X with full gate coverage. All tests passing. Screenshots captured."
Gate Checklist
□ npm run typecheck → PASS (cite output)
□ npm run lint → PASS (cite output)
□ npm run test → PASS (cite output)
□ UI changed? → Screenshots captured (list paths)
□ API changed? → Route tests pass
□ New file? → Included in test suite
□ Notes updated? → Evidence cited
Any unchecked? Don't close. Keep working.
Special Cases
"No Tests Exist Yet"
- Create tests for new code
- Run existing test suite to ensure no regressions
- Document: "test: PASS (existing suite), NEW: added tests for X"
"Tests Are Slow"
- Run them anyway
- Consider: parallelize, optimize, cache
- Never skip for speed
"CI Will Catch It"
- Run locally first
- CI is backup, not replacement
- Local failures = faster feedback
"Just Documentation Change"
- Still run typecheck (links, imports)
- Still run lint (formatting)
- Test may not be needed - document why skipped
Post-Close Verification
After bd close:
bd show <id> # Verify status is closed
bd ready # Confirm it's not still showing as ready
If still shows as ready after close: bd sync then re-check.