---
target: {{target_path}}
branch: null
work_type:
fix:
fixed_headings: []
dependencies: []
---
# Scratch Pad — Fix — Replace With Defect Identifier
## Flow Overview
- [ ] Phase 0: Establish evidence + reproduction
- [ ] Phase 1: Check for existing test coverage
- [ ] Phase 2: Add missing test (must fail)
- [ ] Phase 3: Implement fix
- [ ] Phase 4: Validate (tests + no regressions)
## Phase 0 — Diagnose
### Action: Write defect summary and expected behavior
#### Example
- Observed: creating a `fix` scratch pad uses the generic scratch template.
- Expected: `fix` scratch pad uses a `fix`-specific template.
- Spec: `../../spec/specman-data-model/spec.md#work-type`
- Done when: the intended template is selected by default and validated by tests.
### Action: Capture reproduction steps and evidence
#### Example
- Command: `specman create scratch --name scratch-repro --target impl://specman-library --work-type fix`
- Evidence: persisted `scratch.md` contains the generic sections, not the fix flow.
## Phase 1 — Existing Coverage
### Action: Search for existing tests that cover the bug
#### Example
- Searched: `src/crates/specman/tests/` and `src/crates/specman/src/service.rs` tests.
- Found: scratchpad creation smoke tests; no assertion on default template selection.
## Phase 2 — Add Test (If Missing)
### Action: Add a failing test that demonstrates the defect
#### Example
- Add test: `scratchpad_worktype_fix_uses_fix_template_by_default`.
- Assert: provenance locator is `embedded://scratch-fix` (once Phase 3 wiring exists).
## Phase 3 — Fix
### Action: Implement the smallest fix that makes the test pass
#### Example
- Map `WorkType("fix")` to an embedded asset key that loads `templates/scratch/fix.md`.
## Phase 4 — Validate
### Action: Run tests and record results
#### Example
- Ran: `cargo test -p specman`
- Result: pass
## Notes
## Decisions
## Next Steps