Skip to content

refactor(drills): decouple scenario strings into modular YAML catalog (#7) - #8

Open
celttechie wants to merge 1 commit into
mainfrom
refactor/7-drill-yaml-catalog
Open

celttechie wants to merge 1 commit into
mainfrom
refactor/7-drill-yaml-catalog

Conversation

@celttechie

Copy link
Copy Markdown
Owner

Description

Closes #7.

Refactors scripts/drill_manager.py by extracting all hardcoded string dictionaries (scenarios, multi-line JSON patches, tutor hints, explanations, and cheatsheet rows) into a modular YAML catalog under scripts/drills/.

Key Changes

  • Modular Scenarios: Created 10 standalone YAML scenario files in scripts/drills/ using YAML literal block scalars (|) for clean multi-line shell commands.
  • Typed Loader & Templating: Added Scenario and TutorStep @dataclass models in drill_manager.py with schema validation and dynamic ${NAMESPACE} parameterization.
  • Cheatsheet Decoupling: Moved diagnostic tables into scripts/drills/cheatsheet.yaml.
  • Test Coverage: Added test cases in tests/test_drill_manager.py validating that all YAML files meet schema requirements without hardcoded namespaces.

Verification

  • python3 -m unittest discover -v -s tests (8/8 tests pass)
  • make drill-list renders all 10 scenarios across 5 domains
  • make drill-cheatsheet renders the 4 diagnostic reference tables

…#7)

- Extract 10 troubleshooting scenario definitions into scripts/drills/*.yaml
- Externalize CLI diagnostic reference into scripts/drills/cheatsheet.yaml
- Implement typed Scenario/TutorStep dataclasses and dynamic ${NAMESPACE} loader
- Reduce drill_manager.py from 1,041 to 537 lines while preserving all CLI behavior
- Add unit tests for YAML schema validation and dynamic namespace templating
- Update README and architecture documentation with scripts/drills/ catalog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(drills): Decouple scenario content into modular YAML catalog

1 participant