Add manifest-driven fixture selection for degradation curves#135
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a more flexible fixtures_for_manifest_family method in DegradationCurveGenerator to support multiple fixture families beyond the default layered admissibility curve, along with comprehensive unit tests for these new capabilities. The reviewer correctly identified a performance concern regarding redundant disk I/O and JSON parsing, suggesting that caching the manifest content would better align with the project's high-efficiency and industrial-grade performance requirements.
| ) -> tuple[Path, ...]: | ||
| level_to_path: dict[str, Path] = {} | ||
|
|
||
| for entry in self._load_fixture_manifest(manifest_path): |
There was a problem hiding this comment.
The manifest is re-loaded and parsed from disk on every call to fixtures_for_manifest_family. In a high-efficiency context (as emphasized in the Repository Style Guide), especially when generating multiple curves or running a large test suite, this redundant I/O and JSON parsing can become a performance bottleneck. Consider caching the manifest content to improve efficiency.
References
- The project mission emphasizes high-efficiency technical-log compression and industrial-grade performance. (link)
Motivation
Description
fixtures_for_manifest_family(self, family, levels=LAYERED_CURVE_LEVELS, manifest_path=MANIFEST_PATH)tosrc/validation/degradation_curve_generator.pythat loads the manifest, filters byfamily, selects only requesteddegradation_levels in explicit order, and returnsPathtuples.ValueErrorfor missing requested levels, duplicate family+level entries, or missingpathvalues to fail fast on manifest issues.fixtures_for_layered_admissibility_curve(...)as a backward-compatible wrapper that calls the new generic selector withLAYERED_CURVE_FAMILYandLAYERED_CURVE_LEVELS.tests/test_degradation_curve_generator.pyto verify selection for bothcoding_workflow_pr_reviewandincident_response_page_triage, wrapper compatibility, and error cases for missing family/level and duplicate entries.Testing
pytest tests/test_degradation_curve_generator.py -qand observed18 passedfor the updated file-level tests.pytest tests/test_manifest_fixture_families.py -qandpytest tests/test_fixture_manifest.py -qand observed3 passedand8 passed, respectively.npm run check(which runs layout, typecheck, validate, build, and the full pytest suite) and observed the full test run succeed with207 passedandnpm run checkcompleted successfully.Codex Task