Skip to content

Commit 1e9edb0

Browse files
committed
doc: spec-driver
1 parent e64b04b commit 1e9edb0

8 files changed

Lines changed: 452 additions & 159 deletions

File tree

.claude/settings.local.json

Lines changed: 0 additions & 64 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/pi-mono
23
/result
34
.spec-driver/run/*

.spec-driver/deltas/DE-115-core_utility_extraction_parse_date_sequential_ids_title_extraction_atomic_write_block_patterns/DE-115.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ phases: []
3939
## 1. Summary & Context
4040
4141
- **Technical Spec(s)**: SPEC-117 (decisions), SPEC-126 (policies), SPEC-127 (standards)
42-
- **Change Drivers**: Code quality audit identified 8 reimplementations of sequential ID generation, 3 identical `parse_date()` copies, 3 identical title extraction blocks, 3 inlined atomic write patterns, 5 duplicated code-fence regex patterns, 2 identical `_matches_pattern` functions.
42+
- **Change Drivers**: Code quality audit identified 8 reimplementations of sequential ID generation, 3 identical `parse_date()` copies, 3 identical title extraction blocks, 3 inlined atomic write patterns, 6 duplicated code-fence regex patterns, 2 identical `_matches_pattern` functions.
4343
- **Governance**: POL-001 (maximise code reuse), ADR-009 (standard registry convention)
4444

4545
## 2. Motivation
@@ -52,15 +52,15 @@ Multiple utility functions are copy-pasted across domain modules with zero or tr
5252
| Sequential ID generation | 8 (`_next_identifier`, `determine_next_identifier`, `generate_next_adr_id`, `generate_next_policy_id`, `generate_next_standard_id`, `_next_ledger_id`, `next_identifier`, `CardRegistry.next_id`) | Same algorithm, different prefix strings |
5353
| Title extraction from H1 | 3 (decisions, policies, standards registries) | Same logic, different prefix |
5454
| Atomic file write | 3 (`review_io.py` extracted, `state_io.py` + `handoff_io.py` inlined) | Identical pattern |
55-
| Code-fence block regex | 5 (delta.py, verification.py, relationships.py, plan.py ×2) | Same regex template, different marker |
55+
| Code-fence block regex | 6 (delta.py, relationships.py, verification.py, plan.py ×3) | Same regex template, different marker |
5656
| `_matches_pattern` | 2 (common.py, find.py) | Byte-for-byte identical |
5757
| `create_title_slug` | 2 (policies, standards creation) | 1-line passthrough to `slugify()` |
5858

5959
## 3. Scope & Objectives
6060

6161
- **Primary Outcomes**:
6262
- New `core/dates.py`: shared `parse_date(value) -> date | None`
63-
- New `core/ids.py`: shared `next_sequential_id(directory, prefix, pattern) -> str`
63+
- New `core/ids.py`: shared `next_sequential_id(names, prefix, separator="-") -> str`
6464
- Extend `core/spec_utils.py`: shared `extract_title_from_content(content, prefix) -> str`
6565
- New `core/io.py`: shared `atomic_write(path, content)` (promoted from `review_io._atomic_write`)
6666
- Extend `blocks/yaml_utils.py`: `make_block_pattern(marker) -> re.Pattern`

0 commit comments

Comments
 (0)