# Duplicate-Code Baseline 2026-05-18

Task: `DUPLICATE-CODE-ENFORCEMENT-20260518`

Command:

```bash
npm run duplicates
```

Result: pass. The configured threshold is 5%; current total duplicated lines
are 0.24%.

## Summary

| Format | Files analyzed | Clones | Duplicated lines |
| ------ | -------------- | ------ | ---------------- |
| TypeScript | 160 | 8 | 119 (0.34%) |
| Total | 275 | 8 | 119 (0.24%) |

## Findings

- `src/workflow-task-service.ts`: repeated mutation/event shape for task removal
  paths.
- `src/workflow-approval-service.ts`: repeated approval record construction.
- `src/telemetry-export.ts`: repeated telemetry export handling.
- `src/skills-planning.ts`: repeated skill-source grouping logic.
- `src/phase-executor.ts` and `src/qa-coverage.ts`: repeated text/classification
  helpers.
- `src/phase-executor.ts` and `src/planning-commands.ts`: repeated rendering or
  summary logic.
- `src/cli.ts` and `src/upgrade-commands.ts`: repeated command/option parsing
  shape.
- `src/autonomous-run-state.ts`: repeated phase status transition shape.

## Decision

The baseline is accepted for this enforcement task because the duplication is
below threshold and no finding blocks CI. Future work should address repeated
domain lists or command matrices using `collection-standards`; repeated control
flow should be refactored only when it reduces meaningful complexity.
