···11-# next steps
22-33-## critical fixes
44-55-### 1. label validation must fail loudly
66-77-**problem:** when users specify labels that don't exist in the repo's subscribed label definitions, they're silently ignored. no error, no warning, just nothing happens.
88-99-**current behavior:**
1010-```python
1111-create_repo_issue(repo="owner/repo", labels=["demo", "nonexistent"])
1212-# -> creates issue with NO labels, returns success
1313-```
1414-1515-**what should happen:**
1616-```python
1717-create_repo_issue(repo="owner/repo", labels=["demo", "nonexistent"])
1818-# -> raises ValueError:
1919-# "invalid labels: ['demo', 'nonexistent']
2020-# available labels for this repo: ['wontfix', 'duplicate', 'good-first-issue', ...]"
2121-```
2222-2323-**fix locations:**
2424-- `src/tangled_mcp/_tangled/_issues.py:_apply_labels()` - validate before applying
2525-- add `validate_labels()` helper that checks against repo's subscribed labels
2626-- fail fast with actionable error message listing available labels
2727-2828-### 2. list_repo_issues should include label information
2929-3030-**problem:** `list_repo_issues` returns issues but doesn't include their labels. labels are stored separately in `sh.tangled.label.op` records and need to be fetched and correlated.
3131-3232-**impact:** users can't see what labels an issue has without manually querying label ops or checking the UI.
3333-3434-**fix:**
3535-- add `labels: list[str]` field to `IssueInfo` model
3636-- in `list_repo_issues`, fetch label ops and correlate with issues
3737-- return label names (not URIs) for better UX
3838-3939-### 3. fix pydantic field warning
4040-4141-**warning:**
4242-```
4343-UnsupportedFieldAttributeWarning: The 'default' attribute with value None was provided
4444-to the `Field()` function, which has no effect in the context it was used.
4545-```
4646-4747-**likely cause:** somewhere we're using `Field(default=None)` in an `Annotated` type or union context where it doesn't make sense.
4848-4949-**fix:** audit all `Field()` uses and remove invalid `default=None` declarations.
5050-5151-## enhancements
5252-5353-### 4. better error messages for repo resolution failures
5454-5555-when a repo doesn't exist or handle can't be resolved, give users clear next steps:
5656-- is the repo name spelled correctly?
5757-- does the repo exist on tangled.org?
5858-- do you have access to it?
5959-6060-### 5. add label listing tool
6161-6262-users need to know what labels are available for a repo before they can use them.
6363-6464-**new tool:**
6565-```python
6666-list_repo_labels(repo: str) -> list[str]
6767-# returns: ["wontfix", "duplicate", "good-first-issue", ...]
6868-```
6969-7070-### 6. pagination cursor handling
7171-7272-currently returning raw cursor strings. consider:
7373-- documenting cursor format
7474-- providing helper for "has more pages" checking
7575-- clear examples in docstrings
7676-7777-## completed improvements (this session)
7878-7979-### ✅ types architecture refactored
8080-- moved from single `types.py` to `types/` directory
8181-- separated concerns: `_common.py`, `_branches.py`, `_issues.py`
8282-- public API in `__init__.py`
8383-- parsing logic moved into types via `.from_api_response()` class methods
8484-8585-### ✅ proper validation with annotated types
8686-- `RepoIdentifier = Annotated[str, AfterValidator(normalize_repo_identifier)]`
8787-- strips `@` prefix automatically
8888-- validates format before processing
8989-9090-### ✅ clickable URLs instead of AT Protocol internals
9191-- issue operations return `https://tangled.org/@owner/repo/issues/N`
9292-- removed useless `uri` and `cid` from user-facing responses
9393-- URL generation encapsulated in types via `@computed_field`
9494-9595-### ✅ proper typing everywhere
9696-- no more `dict[str, Any]` return types
9797-- pydantic models for all results
9898-- type safety throughout
9999-100100-### ✅ minimal test coverage
101101-- 17 tests covering public contracts
102102-- no implementation details tested
103103-- validates key behaviors: URL generation, validation, parsing
104104-105105-### ✅ demo scripts
106106-- full lifecycle demo
107107-- URL format handling demo
108108-- branch listing demo
109109-- label manipulation demo (revealed silent failure issue)
110110-111111-### ✅ documentation improvements
112112-- MCP client installation instructions in collapsible details
113113-- clear usage examples for multiple clients
114114-115115-## technical debt
116116-117117-### remove unused types
118118-- `RepoInfo`, `PullInfo`, `CreateRepoResult`, `GenericResult` - not used anywhere
119119-- clean up or remove from public API
120120-121121-### consolidate URL generation logic
122122-- `_tangled_issue_url()` helper was created to DRY the URL generation
123123-- good pattern, consider extending to other URL types if needed
124124-125125-### consider lazy evaluation for expensive validations
126126-- repo resolution happens on every tool call
127127-- could cache repo metadata (knot, did) for duration of connection
128128-- tradeoff: freshness vs performance
129129-130130-## priorities
131131-132132-1. **critical:** fix label validation (fails silently)
133133-2. **high:** add labels to list_repo_issues output
134134-3. **medium:** add list_repo_labels tool
135135-4. **medium:** fix pydantic warning
136136-5. **low:** better error messages
137137-6. **low:** clean up unused types