ed
|
cf7ef3fc66
|
conductor(plan): mark Phase 2 complete (per SPEC_CORRECTION_phase_2.md)
Phase 2 is now COMPLETE via Option A (incremental, dict-compat).
VC8 (flat_config returns typed ProjectContext) PASSES.
Implementation:
- 6 new dataclasses added to src/models.py: ProjectMeta,
ProjectOutput, ProjectFiles, ProjectScreenshots, ProjectDiscussion,
ProjectContext
- ProjectContext has __getitem__ and get methods so existing
consumers using .get() / [] patterns work unchanged
- src/project_manager.py:flat_config body rewritten to construct
ProjectContext from the proj dict
- src/project_manager.py:flat_config return type changed from
Metadata (dict[str, Any]) to ProjectContext
- tests/test_project_context_20260627.py: NEW 10-test regression-guard
file covering imports, return type, zero defaults, full input,
dict-compat methods, to_dict round-trip, sentinel, output_dir
required field, consumer patterns unchanged
- 10 tests pass; all existing consumer tests pass (aggregate, MMA,
orchestrator_pm, etc.)
VCs status:
- VC1-VC2: PASS (Phase 1)
- VC3: PARTIAL (7 boundary dict[str,Any] remain per spec FR1)
- VC4: NOT DONE (60 Any params; scope too large)
- VC5: PASS (Phase 6, 30/30)
- VC6: PARTIAL (1 hasattr in aggregate.py)
- VC7: PASS
- VC8: PASS (Phase 2, this commit)
- VC9: PASS (Phase 5)
- VC10: PASS (all 7 audit gates)
- VC11: NOT VERIFIED
- VC12: NOT MEASURED
- VC13: PASS (boundary audit)
- VC14: PASS
|
2026-06-26 05:46:41 -04:00 |
|
ed
|
0d0b433a2e
|
refactor(app_controller): remove redundant hasattr(f, ...) defensive checks
Phase 3 (partial): self.files guarantee (FR4 row 1)
Before: 13 hasattr(f, ...) defensive checks in src/app_controller.py
After: 0 (self.files is GUARANTEED List[FileItem] per init at 1996-2005)
Delta: -13 sites
Per the spec's FR4 row 1: 'After Phase 3, self.files is GUARANTEED
List[FileItem]. Every hasattr(f, "path") check is redundant. Remove it.'
The init code at src/app_controller.py:1996-2005 already does the correct
isinstance check + FileItem.from_dict() pattern, so all 13 hasattr checks
on self.files / self.context_files are redundant defensive code.
Verification:
- audit_weak_types --strict: OK (107 <= 112 baseline)
- py_check_syntax src/app_controller.py: OK
- 59 tests pass (type_aliases, openai_schemas, rag_engine, file_item, etc.)
OUT OF SCOPE (deferred):
- 18 hasattr(f, 'path') checks in src/gui_2.py (Phase 3 follow-up)
- Phase 4: _do_generate return type
- Phase 5: rag_engine.search() return type
- Phase 6: 30 Optional[T] returns
- Phase 7: 59 Any params + 10 dict[str, Any] params
See TRACK_COMPLETION_cruft_elimination_20260627.md for full scope.
|
2026-06-26 04:35:49 -04:00 |
|