Worked journey
Cancel one line without cancelling the whole order
A support lead asks to cancel one unshipped item. Workshop notes mention refunds, but the agreed scope only covers order changes. There is no existing implementation to cite for partial cancellation.
Spec-driven development for a new feature
Intended, not yet built
Plan line-item cancellation against existing order, shipment and payment boundaries, with clear criteria for behaviour that does not exist yet.
New behaviour starts at the top of the twin with nothing below it. Existing order lines, shipment checks and payment interfaces supply the evidence for its boundaries.
Requirements
Use cases and stories recovered from existing code, plus new ones a team asks for. Each points at the behaviour that implements it, or says nothing does yet.
use case Customer cancels an order story Require a cancellation reason criterion Shipped orders stay ineligible code none yet
Walkthrough
Step by step.
Separate the request from the evidence
Cite existing order-line identity, shipment checks and payment interfaces where available. Keep partial cancellation labelled as intended. The lead records whether refunds are part of this release instead of letting a plan silently decide.
Write outcomes the reviewer can check
Given two open lines, cancel the selected line and keep the other active. Given a shipped selected line, return a refusal and preserve both states. Decide separately what the aggregate status should do when the last active line is cancelled.
Plan dependencies and open questions
Inventory release may need its own integration and evidence. Payment remains an open question unless the scope includes it. The plan records exactly where it stops so a coding agent can avoid inventing work outside the approved feature.
Examples the plan must distinguish
| Starting state | Action | Expected outcome |
|---|---|---|
| Two unshipped active lines | Cancel one authorized line | Only the selected line changes |
| Selected line has shipped | Request the same cancellation | Refuse and preserve both states |
| Only one active line remains | Cancel the final line | Apply the aggregate-state decision agreed in the requirement |
| A refund is mentioned only in workshop notes | Review scope | Resolve the disagreement before adding payment work |