Compare commits

...

8 Commits

Author SHA1 Message Date
cal
87599a67d5 Merge pull request 'docs: refractor card art mockup and visual spec' (#53) from wip/refractor-card-art into main 2026-04-04 03:13:34 +00:00
cal
e266f814ca Merge branch 'main' into wip/refractor-card-art 2026-04-04 03:13:29 +00:00
cal
c1f06eb9c7 Merge pull request 'fix: scrub exposed credentials from docs' (#52) from fix/scrub-exposed-credentials into main 2026-04-01 18:02:01 +00:00
cal
d6b65594b8 Merge branch 'main' into fix/scrub-exposed-credentials 2026-04-01 18:01:56 +00:00
Cal Corum
94fd72344d fix: scrub exposed API token from docs
Replace real API token in PD_CARDS_CLI_REFERENCE.md example command
with placeholder value to prevent credential exposure in the repo.

Closes #50
2026-04-01 11:58:58 -05:00
Cal Corum
43aff3568f fix: increase API timeouts to prevent bulk query failures
db_calls.py default timeouts raised from 3s to 30s across all methods
(db_get, url_get, db_patch, db_post, db_put). scouting_batters.py
fetch_data now passes timeout=120 for large card rating queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 07:53:58 -05:00
Cal Corum
6f67cfec9a docs: address PR #51 review — rarity naming, OPS threshold, truncation invariant
- Add rarity name cross-reference table in Background section mapping PRD
  display names (Replacement/Reserve/Starter/All-Star/MVP/Hall of Fame) to
  codebase names (Common/Bronze/Silver/Gold/Diamond/HoF) with IDs
- Fix T4-2: correct Gold OPS threshold from 0.700 to 0.900 (confirmed in
  rarity_thresholds.py); add note that 0.700 is the Bronze floor
- Fix T4-1: restate truncation invariant as a single precise assertion —
  sum(columns) == 108 - truncated_amount — instead of two independent checks
  that can both pass while the sum is wrong for unrelated reasons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 16:07:18 -05:00
Cal Corum
f2c09d09e6 docs: add Refractor Phase 2 design validation spec
Seven pre-implementation test cases covering: 108-sum invariant
preservation under profile-based boosts, D20 probability shift
magnitude at T4, pipeline collision risk between T4 rarity upgrade
and live-series post_player_updates, HoF rarity cap (non-contiguous
ID ladder), RP T1 achievability, SP/RP/batter T4 parity, and the
cross-season stat accumulation design decision that must be confirmed
before Phase 2 code is written.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 09:07:09 -05:00
3 changed files with 7 additions and 7 deletions

View File

@ -61,7 +61,7 @@ async def db_get(
object_id: int = None,
params: list = None,
none_okay: bool = True,
timeout: int = 3,
timeout: int = 30,
) -> Optional[dict]:
req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id, params=params)
log_string = f"get:\n{endpoint} id: {object_id} params: {params}"
@ -86,7 +86,7 @@ async def db_get(
raise ValueError(f"DB: {e}")
async def url_get(url: str, timeout: int = 3) -> dict:
async def url_get(url: str, timeout: int = 30) -> dict:
log_string = f"get:\n{url}"
logger.info(log_string) if master_debug else logger.debug(log_string)
@ -105,7 +105,7 @@ async def url_get(url: str, timeout: int = 3) -> dict:
async def db_patch(
endpoint: str, object_id: int, params: list, api_ver: int = 2, timeout: int = 3
endpoint: str, object_id: int, params: list, api_ver: int = 2, timeout: int = 30
) -> dict:
req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id, params=params)
log_string = f"patch:\n{endpoint} {params}"
@ -126,7 +126,7 @@ async def db_patch(
async def db_post(
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 3
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 30
) -> dict:
req_url = get_req_url(endpoint, api_ver=api_ver)
log_string = f"post:\n{endpoint} payload: {payload}\ntype: {type(payload)}"
@ -147,7 +147,7 @@ async def db_post(
async def db_put(
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 3
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 30
) -> dict:
req_url = get_req_url(endpoint, api_ver=api_ver)
log_string = f"put:\n{endpoint} payload: {payload}\ntype: {type(payload)}"

View File

@ -418,7 +418,7 @@ pd-cards upload s3 --cardset <name> [OPTIONS]
cd /mnt/NV2/Development/paper-dynasty/database
DATABASE_TYPE=postgresql POSTGRES_HOST=10.10.0.42 POSTGRES_DB=paperdynasty_dev \
POSTGRES_USER=sba_admin POSTGRES_PASSWORD=<pw> POSTGRES_PORT=5432 \
API_TOKEN=Tp3aO3jhYve5NJF1IqOmJTmk \
API_TOKEN=your-api-token-here \
uvicorn app.main:app --host 0.0.0.0 --port 8000
# Terminal 2: Upload with local rendering

View File

@ -96,7 +96,7 @@ def build_c_throw(all_positions, pos_code):
async def fetch_data(data):
start_time = log_time("start", print_to_console=False)
this_query = await db_get(endpoint=data[0], params=data[1])
this_query = await db_get(endpoint=data[0], params=data[1], timeout=120)
log_time("end", print_to_console=False, start_time=start_time)
return this_query