Skip to content

Spec-to-feature pipeline: executable .feature files never generated after spec update #159

@nullhack

Description

@nullhack

Summary

A spec update added new delivery items to product_definition.md but the corresponding executable .feature files were never created. The feature-discovery flow state found existing .feature files on disk and passed silently — it does not cross-check delivery order items against the artifact inventory.

Concrete example of the gap

product_definition.md:
  Phase 5:
  23. [ ] payment_gateway — Stripe integration with refund support
  24. [ ] payment_gateway — webhook handling for async confirmations

docs/features/on_disk:
  auth.feature
  dashboard.feature
  settings.feature
  # ← payment_gateway.feature MISSING

The product_definition line items reference a feature but no .feature file exists. The domain spec and glossary were updated with the payment gateway design, but the executable BDD specification — the .feature file with Rule: and Example: blocks that drives beehave generate → TDD → review → acceptance — was never written.

Why this is hard to catch

  1. Feature-discovery finds files on disk and says "done." If you already have N .feature files from a prior cycle, a new delivery item without a corresponding file is invisible.
  2. Simulation validates existing .feature files against specs. If the .feature file doesn't exist, there's nothing to validate — the gap is silent.
  3. The spec update was committed directly without passing through the flow states that transform prose into BDD feature files.

What to fix (developer guidance)

1. Add cross-check in feature-discovery

Before transitioning done, diff the delivery order slugs against the .feature file stems on disk:

delivery_order_slugs   = {"auth", "dashboard", "settings", "payment_gateway"}
feature_files_on_disk  = {"auth", "dashboard", "settings"}
gap                    = delivery_order_slugs - feature_files_on_disk
# → {"payment_gateway"}

If gap is non-empty, either:

  • Create the missing .feature file from the template and populate it with Rule: blocks from the domain spec, OR
  • Exit via a new transition like needs-feature-creation that routes to a state responsible for filling the gap.

2. Add artifact verification at simulation entry

Before running simulation, verify that every bounded context has a .feature file on disk. If a context described in the domain spec has no corresponding file, flag it as a simulation precondition failure — don't skip it silently.

3. Guard against untracked spec commits

Consider a check that runs before transition done in spec-creation: if new delivery order items were added to product_definition.md, confirm that at least one new .feature file exists for each before allowing the transition.

Action items

  • Create missing .feature files for delivery items without corresponding feature files
  • Update affected existing .feature files when domain spec rules reference them but aren't reflected in their Rule: blocks
  • Run simulation to validate the new and updated feature files
  • Implement delivery-order-to-disk cross-check in feature-discovery state
  • Implement bounded-context-to-feature verification at simulation entry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions