anthropics / anthropics/skills

Sub-Issue 2: Implement Config Hierarchy (User > Repo)

Đang mở
#108 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
176k
Fork
20.8k
Merge trung bình
7 giờ 21 phút
Pull request đã merge (30 ngày)
5

Mô tả

**Parent Issue:** #84
**Estimated Time:** ~30 minutes
**Phase:** 2 (Sequential after Phase 1)

## Goal
Implement two-tier config loading where user config (`~/.config/vipunen/config.yaml`) overrides repo defaults (`.workspace/config.yaml`).

## Files
- Modify: `.workspace/scripts/config.py:1-45`
- Test: `.workspace/tests/test_config_hierarchy.py` (new file)

## Dependencies
**Requires:** Sub-Issue 1 (vault_location field) completed
**Phase:** Phase 2 (sequential after Phase 1)

## Implementation Steps

See full implementation steps in issue #84 under "Sub-Issue 2: Implement Config Hierarchy (User > Repo)"

### Summary
1. Write failing tests for config hierarchy (4 tests)
2. Implement `_deep_merge()` helper function
3. Update `load_config()` to support user/repo paths
4. Run tests to verify they pass
5. Test backward compatibility
6. Run type checker
7. Commit changes
8. Verify no regressions
9. Close this sub-issue

## Acceptance Criteria
- [ ] User config overrides repo defaults (deep merge)
- [ ] Missing user config falls back to repo defaults
- [ ] Missing repo config raises error
- [ ] Deep merge works for nested dictionaries
- [ ] Backward compatible (no args still works)
- [ ] All tests pass
- [ ] Type checking passes

## Testing Commands
```bash
uv run pytest .workspace/tests/test_config_hierarchy.py -v
uv run python -c "from workspace.scripts.config import load_config; c = load_config(); print(f'✓ Loaded: {c.paths}')"
uv run pyright .workspace/scripts/config.py
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.