Sign in to create and edit playbooks. Sign In Register

Check Definition of Done

BPE-6 Order: #6 Construction Has Dependencies

Updated 4 weeks, 2 days ago

Guidance

Purpose

Validate that feature/story implementation complies with all project rules and standards by examining current state and outputs.

Core Development Rules Checklist

Test-First Development

  • [ ] Every function/method has corresponding test(s)
  • [ ] Feature files in docs/features/ exist and comply with scenarios
  • [ ] Tests use pytest framework
  • [ ] Mocking is minimal

Continuous Testing

  • [ ] All tests are runnable via pytest tests/
  • [ ] Tests are pytest compatible with proper fixtures
  • [ ] tests.log file exists and contains test output

Concise Methods

  • [ ] Top-level (public) methods are 20-30 lines maximum
  • [ ] Supporting logic is in well-named private methods
  • [ ] Helper methods have single, focused responsibilities
  • [ ] Method names are descriptive and clear

Code Quality Rules Checklist

Import Management

  • [ ] All imports are at module level
  • [ ] No imports inside functions/methods
  • [ ] Dependencies are properly declared

Log Story Verification

  • [ ] Implementation plan / issue contains a Log Story Script (Where / Beat / Trigger / Must include)
  • [ ] Every script row is proven by a passing *_log_story_* caplog test (or checkpoint.log_story_command from the iteration manifest)
  • [ ] Happy and reject paths covered when the scenario has both
  • [ ] Log levels are appropriate (DEBUG, INFO, WARNING, ERROR)
  • [ ] No secrets/tokens/passwords appear at INFO in asserted lines
  • [ ] No deferred logging slice remains in the plan

Grep of logs/app.log is an audit aid, not the DoD gate. Caplog (or log_story_command) is the gate.

Agent Proof Verification (when SAO §17 / plan Section G in scope)

  • [ ] Implementation plan / issue contains an Agent Proof Table (PRF ID, workflow, script path, trace beats)
  • [ ] Every PRF row is proven by a passing *_agent_story_* test marked @pytest.mark.agent_proof (or checkpoint.agent_proof_command from the iteration manifest)
  • [ ] Happy and reject paths covered when the PRF is adverse or has a reject sketch
  • [ ] Tests use CAP-004 ScriptedLLM only — no FakeLLM, no @patch on ToolExecutor or domain services in @agent_proof tests
  • [ ] LLM scripts exist under tests/fixtures/llm_scripts/<prf-id>/ for every asserted path
  • [ ] Trace asserts control-plane beats (tools, domain writes, plan/blackboard state) — not assistant wording
  • [ ] No secrets/tokens/passwords in trace or asserted log lines
  • [ ] No deferred agent-proof slice remains in the plan
  • [ ] TASK- lane 4 evals (if any) are not* required for story DoD — confirm they remain on nightly/promotion band only

Grep of run logs is an audit aid, not the DoD gate. assert_agent_story (or agent_proof_command) is the gate.

Testing and Quality Assurance Checklist

Integration Test Standards

  • [ ] Integration tests in tests/integration/ exist
  • [ ] Integration tests avoid mocking (except CAP-004 ScriptedLLM in @agent_proof tests)
  • [ ] Real dependencies are used in integration scenarios

Commit Conventions

  • [ ] Recent commit messages follow Angular conventional format
  • [ ] Commits are atomic and focused
  • [ ] Breaking changes are documented in commit messages

UI and Frontend Rules Checklist

Django Views + HTMX

  • [ ] No DRF views exist for new web UI features
  • [ ] Django views return HTML templates
  • [ ] HTMX attributes used for dynamic interactions
  • [ ] Services layer is shared between MCP and Web UI

Semantic Naming

  • [ ] All interactive elements have data-testid attributes
  • [ ] Naming follows kebab-case convention
  • [ ] Form inputs have proper name and id attributes

Documentation Checklist

Scenario Writing

  • [ ] BDD scenarios exist for features
  • [ ] Feature files are well-structured
  • [ ] Scenarios cover edge cases and error conditions
  • [ ] Review GUI - do scenarios match behavior, fields, URLs, design rules? Report inconsistencies to user

TODO Management

  • [ ] TODO comments exist for incomplete implementations
  • [ ] TODO items have clear descriptions
  • [ ] TODOs in dependencies can be ignored

Document Updates

  • [ ] Review code: new packages, patterns, approaches worth documenting?
  • [ ] Review conversation: need to update feature files/corrections?
  • [ ] Review modus operandi against workflows and rules - can we improve?

Final Validation Checklist

Overall Quality Check

  • [ ] Feature meets acceptance criteria
  • [ ] Code is production-ready
  • [ ] Documentation exists and is accurate

Integration Validation

  • [ ] Feature integrates with existing system
  • [ ] No breaking changes introduced
  • [ ] Dependencies properly declared in requirements.txt

Deployment Readiness

  • [ ] Database migrations exist if needed
  • [ ] Environment variables are documented
  • [ ] Configuration changes are documented

Cleanup

  • [ ] Remove temporary files like debug_*.py
  • [ ] Scan file structure for stray misplaced files
  • [ ] Remove *.log files from repository

Rules

Before validating DoD, read each Rule below in this playbook (by slug), then apply it as the acceptance criterion for the matching checklist items. Do not rely on memory of the rule text.

Required:
- do-test-first
- do-continuous-testing
- do-write-concise-methods
- do-import-on-module-level
- do-informative-logging
- do-assert-log-story
- do-assert-agent-story (when SAO §17 / Section G in scope)
- do-not-mock-in-integration-tests
- do-follow-commit-convention
- do-semantic-versioning-on-ui-elements
- do-write-scenarios
- do-add-todos-for-incomplete-items
- pytest

Activity-specific (not a substitute for the rules above):
- Observability DoD is Log Story Verification (caplog / log_story_command), not "logging statements exist".
- Agent DoD is Agent Proof Verification (agent_proof_command / @agent_proof), not "the agent loop exists" or Behave AT alone.

Actions

All checkboxes must be completed before considering the story "Done". Any deviations must be presented to user. If user says "collect for cleanup but defer" - create a Backlog item in GitHub as Issue with "deferred" tag. Otherwise resolve deviations as directed by user, commit following Angular convention, and send Pull Request.

Success Criteria

  • All checklist items verified
  • No deviations or all approved by user
  • Code production-ready
  • Ready for PR

Inputs

Read these before starting this activity. They are produced earlier in the playbook and are authoritative — raise a drift event instead of deviating.

  • Feature Files (Document, Required) — produced by Write Feature Files (#39).
  • Implementation Plan Template (Template, Required) — produced by Plan Feature (#96).

Defects Found During DoD

When DoD review reveals a defect (behavior does not match feature files or acceptance criteria) — not a deferred cleanup item:

  1. File a Bug Report via report_bug MCP tool or Feedback UI (see Bug Report artifact for body structure)
  2. Invoke Fix Bug (BPE-09) with the Bug Report as input
  3. Do not mark the story done until blockers are resolved and BPE-09 success criteria are met
Details
Order:
#6
Phase:
Predecessor:
BPE-5 Implement Journey Certification Tests
Created:
Apr 12, 2026
Last Updated:
Aug 21, 2026
Workflow
Build Feature

Interactive, feature-by-feature AI-assisted development. Use BPE after ESM, DTA, DSP, and BSP are complete to build one feature spec at …

View Workflow
Assigned Agent
Dr. Dobbs v2

Cautious Developer Agent Guide Motto: "Code that's easy to prove correct is code that works" …

Required Skills

No skills linked

Rules
Input Artifacts 3
Output Artifacts

No output artifacts