strat-gameplay-webapp/backend/app/config/base_config.py
Cal Corum 197d91edfb CLAUDE: Remove defensive alignment field completely
Removed the unused alignment field from DefensiveDecision model and all
related code across backend and frontend.

Backend changes:
- models/game_models.py: Removed alignment field and validator
- terminal_client/display.py: Removed alignment from display
- core/ai_opponent.py: Updated log message
- tests/unit/models/test_game_models.py: Removed alignment tests
- tests/unit/core/test_validators.py: Removed alignment validation test

Frontend changes:
- types/game.ts: Removed alignment from DefensiveDecision interface
- components/Decisions/DefensiveSetup.vue:
  * Removed alignment section from template
  * Removed alignment from localSetup initialization
  * Removed alignmentOptions array
  * Removed alignmentDisplay computed property
  * Removed alignment from hasChanges comparison
  * Removed alignment from visual preview (reorganized to col-span-2)

Rationale: Defensive alignment is not active in the game and will not be
used. Per Cal's decision, remove completely rather than keep as dead code.

Tests: All 728 backend unit tests passing (100%)

Session 1 Part 3 - Change #6 complete
Part of cleanup work from demo review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 13:02:22 -06:00

65 lines
1.8 KiB
Python

"""
Base configuration class for league-specific game rules.
Provides abstract interface that all league configs must implement.
Author: Claude
Date: 2025-10-28
"""
from abc import ABC, abstractmethod
from pydantic import BaseModel, Field
class BaseGameConfig(BaseModel, ABC):
"""
Abstract base configuration for all leagues.
Defines common game rules and requires league-specific implementations
to provide result chart names, API endpoints, and feature flags.
"""
league_id: str = Field(..., description="League identifier ('sba' or 'pd')")
version: str = Field(default="1.0.0", description="Config version for compatibility")
# Basic baseball rules (same across leagues)
innings: int = Field(default=9, description="Standard innings per game")
outs_per_inning: int = Field(default=3, description="Outs required per half-inning")
@abstractmethod
def get_result_chart_name(self) -> str:
"""
Get name of result chart to use for this league.
Returns:
Chart name identifier (e.g., 'sba_standard_v1')
"""
pass
@abstractmethod
def supports_auto_mode(self) -> bool:
"""
Whether this league supports auto-resolution of outcomes.
Auto mode uses digitized player ratings to automatically generate
outcomes without human input. This is only available for leagues
with fully digitized card data.
Returns:
True if auto mode is supported, False otherwise
"""
pass
@abstractmethod
def get_api_base_url(self) -> str:
"""
Get base URL for league's external API.
Returns:
Base URL for roster/player data API
"""
pass
class Config:
"""Pydantic configuration."""
frozen = True # Immutable config - prevents accidental modification