conductor(plan): mark Phase 1 (scaffold + error types + dataclasses) complete [161d8da]
This commit is contained in:
@@ -8,17 +8,17 @@ Standalone tooling track. The deliverable is a `scripts/twitter_threads/` packag
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Scaffold + Error Types + Data Classes
|
||||
## Phase 1: Scaffold + Error Types + Data Classes [checkpoint: 161d8da]
|
||||
|
||||
Focus: create the package directory, the shared error type, and the typed dataclasses (`ThreadData`, `PostData`) that the rest of the pipeline passes around.
|
||||
|
||||
- [ ] **Task 1.1: Create the `scripts/twitter_threads/` directory + `__init__.py`**
|
||||
- [x] **Task 1.1: Create the `scripts/twitter_threads/` directory + `__init__.py`**
|
||||
|
||||
WHERE: `scripts/twitter_threads/__init__.py`
|
||||
WHAT: A docstring documenting the namespace, the per-module responsibilities, and the standalone-usage note (no `src/` imports; copy-pasteable to another repo).
|
||||
HOW: Mirror `scripts/video_analysis/__init__.py`.
|
||||
|
||||
- [ ] **Task 1.2: Write `error_types.py` (the shared Result[T, ErrorInfo] shape)**
|
||||
- [x] **Task 1.2: Write `error_types.py` (the shared Result[T, ErrorInfo] shape)**
|
||||
|
||||
WHERE: `scripts/twitter_threads/error_types.py`
|
||||
WHAT: Copy the shape of `scripts/video_analysis/error_types.py`: `ErrorInfo` dataclass (frozen, slots) + `make_error` factory. Standalone — no import from `scripts.video_analysis`.
|
||||
@@ -38,7 +38,7 @@ def make_error(kind: str, source: str, detail: str) -> ErrorInfo:
|
||||
```
|
||||
VERIFY: `python -c "from scripts.twitter_threads.error_types import ErrorInfo, make_error; print(make_error('X','y','z'))"` prints the dataclass repr.
|
||||
|
||||
- [ ] **Task 1.3: Write the typed dataclasses (`ThreadData`, `PostData`)**
|
||||
- [x] **Task 1.3: Write the typed dataclasses (`ThreadData`, `PostData`)**
|
||||
|
||||
WHERE: `scripts/twitter_threads/error_types.py` (same file; keeps the standalone file count low) OR a new `scripts/twitter_threads/types.py` (if the user prefers separation). Default: same file.
|
||||
WHAT:
|
||||
@@ -71,14 +71,14 @@ class ThreadData:
|
||||
HOW: Per `conductor/code_styleguides/data_oriented_design.md` §8.5 — typed, frozen, slots. No `dict[str, Any]`.
|
||||
VERIFY: `python -c "from scripts.twitter_threads.error_types import PostData; print(PostData.__slots__)"` prints the slots tuple.
|
||||
|
||||
- [ ] **Task 1.4: Write tests for the error types + dataclasses**
|
||||
- [x] **Task 1.4: Write tests for the error types + dataclasses**
|
||||
|
||||
WHERE: `tests/test_twitter_threads_types.py`
|
||||
WHAT: Construct `ErrorInfo`, `PostData`, `ThreadData` instances. Assert field access, frozen-ness (mutation raises `FrozenInstanceError`), slots-ness (no `__dict__`).
|
||||
HOW: Per the TDD red-first protocol — write the tests first, run them (they fail because the types don't exist yet), then implement Task 1.2 + 1.3 to make them pass.
|
||||
VERIFY: `uv run pytest tests/test_twitter_threads_types.py -v` passes.
|
||||
|
||||
- [ ] **Task 1.5: Commit Phase 1**
|
||||
- [x] **Task 1.5: Commit Phase 1**
|
||||
|
||||
```bash
|
||||
git add scripts/twitter_threads/__init__.py scripts/twitter_threads/error_types.py tests/test_twitter_threads_types.py
|
||||
|
||||
Reference in New Issue
Block a user