Skip to content

Portfolio cleanup: fix CLI and pbp bugs, stop publishing third-party data, remove leftovers - #8

Merged
tdub29 merged 13 commits into
mainfrom
portfolio-cleanup
Oct 27, 2026
Merged

tdub29 merged 13 commits into
mainfrom
portfolio-cleanup

Conversation

@tdub29

@tdub29 tdub29 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

What changed

Bug fix: every CLI command failed on a fresh clone

  • The move from src/portal to src/ncaa/portal left every module-level ROOT one directory short. Config, the SQLite path, board output, geo, TrackMan, the bio sources and the CLI's scripts/ paths all resolved under src/. On main, python -m ncaa.cli init --force crashes looking for src/config.example.yaml.
  • Fixed in 10 files. New tests/test_paths.py pins each ROOT to the repo root; it fails 10/10 against the old code and passes after the fix.
  • README quickstart corrected: the seed workbook is not committed, so its path is passed explicitly.

Bug fix: the pbp scripts could not find their data

  • The pbp scripts read and wrote next to themselves, but the CSVs live in data/pbp/ and the text reports in data/pbp/validation/. ncaa.pbp now defines DATA_DIR and VALIDATION_DIR, and 15 scripts use them.
  • Checked by re-running merge_season_pdf_inputs: its outputs are byte-identical to the committed files.

Bug fix: SDSU half-innings relabelled as USD (game 6530004)

  • _align_to_game_team matched "San Diego St. Aztecs" to "San Diego Toreros" on the shared first word. The batter vote then rewrote 35 of SDSU's 44 batting rows as USD, zeroing USD's defensive battle metrics for that game on every re-run. main reproduces this.
  • Exact matches now win, and a looser match only counts when it picks exactly one team. New tests: 3 fail on the old code and all pass with the fix.

Bug fix: the battle calc exited without Playwright

  • ncaa_pbp_playwright raised SystemExit at import, which except ImportError could not catch. The battle calc also imported it by bare module name, so package imports silently skipped the outs recompute.
  • Playwright is now imported inside the one function that opens a browser, and the parsers are imported by package path. Run without Playwright, the calc reproduces the committed battle report exactly. New regression test fails on the old code.

Third-party data no longer published

  • The 2026-09-12 clearance in .gitignore covers USD's own TrackMan and branding, and data/643_exports/README.md already said the 6-4-3 exports were gitignored.
  • Removed and ignored: 6-4-3 Charts exports, the PerfectGame, Sidearm and D1Baseball-derived bios, the D1Baseball reference PDF, and the generated recruiting boards (they name athletes and carry fit and likelihood scores).
  • Kept: USD TrackMan, the public NCAA play-by-play, and the small warehouse CI fixtures. The board is still built and published locally by scripts/build_html.py; nothing reads the removed files.

Removed from the tree

  • The Cursor folder and chat export, debug and scratch files, copy.txt, the X-likes notes, the input-unlock packet, and an empty notebook.

Machine-specific paths

  • 17 notebooks, 3 scripts and 5 docs no longer point at one Windows user's Downloads and OneDrive folders.

Write-ups

  • README: an author line, a Highlights section drawn only from results already in the repo, an accurate data note, and corrected counts.
  • REPORT.md: a plain-English summary, plus a Who reviewed note.
  • MODEL-CARD.md: says the reviews were separate AI agent sessions, as the plan logs record, not human peer review.
  • Derived pbp columns and description lists regenerated from the current 51-game CSV; the battle report is unchanged.

Verification

  • python -m pytest -q: 164 passed
  • ruff check src scripts tests: clean
  • Quickstart run on a fresh clone; battle calc run with and without Playwright

Deliberately not done

  • No git history rewrite. The MLB pre-registration cites commit SHAs as proof of when each test was frozen and scored (5992fdf, ba559be, 6d2503c). Rewriting history would change every SHA and break that evidence. The removed files remain in history.
  • stealth.py kept. The D1Baseball live feed depends on it, and the cookie is the program's own subscription. Paste mode remains the no-scrape fallback.

Drops the Cursor skill/rule folder and chat export, two throwaway debug
scripts, a scraped debug HTML dump, a scratch note, a duplicate "copy"
validation file, the routed X-likes notes and the input-unlock packet
(which carried local machine paths). Removes the stale references to the
chat export and the packet, ignores future debug HTML dumps, and updates
the pbp size in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Notebooks, three scripts and four docs pointed at one Windows user's
Downloads and OneDrive folders. Notebooks now read and write under data/,
the scripts resolve the repo root from __file__, and the docs use a
placeholder path. Also drops an empty notebook, a stale cleanup row and
a local-environment aside.

The README gains a Highlights section drawn from the existing results,
and REPORT.md gains a plain-English summary above the detailed numbers.
Counts in the README file table are updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
The move from src/portal to src/ncaa/portal left every ROOT one level
short, so config, the SQLite path, board output, geo, TrackMan, the bio
sources and the CLI's script paths all resolved under src/. Every CLI
command failed on a fresh clone looking for src/config.example.yaml.

Also corrects the README quickstart: the seed workbook is not committed,
so it is passed explicitly, and the committed 6-4-3 exports are loaded
with enrich-643.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Fails against the pre-fix layout (10 of 10) and passes after it, so the
src/ncaa move cannot silently break the CLI again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
@tdub29 tdub29 changed the title Portfolio cleanup: remove workspace leftovers, local paths; add highlights Portfolio cleanup: fix the broken CLI root path, remove leftovers, add highlights Oct 26, 2026
The pbp scripts resolved every input and output next to themselves in
src/ncaa/pbp, but the CSVs live in data/pbp and the text reports in
data/pbp/validation, so the offline steps could not find their inputs
from a clone. Adds DATA_DIR and VALIDATION_DIR to ncaa.pbp and points the
scripts at them. Markdown reports and the optional Node PDF step stay
beside the scripts.

Checked by regenerating merge_season_pdf_inputs outputs: byte-identical
to the committed files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
_align_to_game_team fell back to a first-word match before trying the
other team, so a "San Diego St. Aztecs" batting cell matched "San Diego
Toreros" on "san". Every SDSU plate appearance then voted for USD, and
the batter-majority pass rewrote 35 of SDSU's 44 batting rows in game
6530004, zeroing USD's defensive battle metrics for that game whenever
the calc was re-run.

Exact matches now win, and a containment or first-word match only counts
when it picks exactly one team. Re-running baseballr_battle_calc on the
committed CSV now reproduces the committed battle report exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
@tdub29 tdub29 changed the title Portfolio cleanup: fix the broken CLI root path, remove leftovers, add highlights Portfolio cleanup: fix broken CLI and pbp paths, an SDSU scoring bug, remove leftovers Oct 26, 2026
The 2026-09-12 clearance covered USD's own TrackMan and branding, not data
licensed or scraped from others, and data/643_exports/README.md already
said those exports were gitignored. Removes the 6-4-3 Charts exports, the
PerfectGame, Sidearm and D1Baseball-derived bios, the D1Baseball reference
PDF and the generated recruiting boards, which name athletes with fit and
likelihood scores, and ignores them. USD TrackMan and the public NCAA
play-by-play stay. The README quickstart and data notes now say so, and
the README gains an author line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
The plan logs name the reviewers as separate agents running review
skills; REPORT.md and the model card now state that plainly so no reader
takes them for human peer review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
ncaa_pbp_playwright raised SystemExit at import when Playwright was
missing, which the battle calc's except ImportError could not catch, so
the offline calc exited. The battle calc also imported it by bare module
name, which only resolves when run as a script, so package imports
silently skipped the outs recompute. Playwright is now imported inside
the one function that opens a browser, and the battle calc imports the
parsers by package path. Run without Playwright, the calc reproduces the
committed battle report exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Regenerated by baseballr_battle_calc and extract_distinct_descriptions on
the committed 51-game CSV. Three bare "X walked." rows now mark the
batter as reaching base; the description lists had been built from an
earlier 5-game CSV. The battle report is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiQuqjV83QHxDZC1giR87t
@tdub29 tdub29 changed the title Portfolio cleanup: fix broken CLI and pbp paths, an SDSU scoring bug, remove leftovers Portfolio cleanup: fix CLI and pbp bugs, stop publishing third-party data, remove leftovers Oct 27, 2026
@tdub29
tdub29 merged commit 93e01fc into main Oct 27, 2026
3 checks passed
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.

2 participants