Skip to content

Repo hygiene: license, CI, pinned deps, complete env example, no personal data in source - #12

Merged
pythonjeff merged 1 commit into
mainfrom
chore/repo-hygiene
Sep 14, 2026
Merged

pythonjeff merged 1 commit into
mainfrom
chore/repo-hygiene

Conversation

@pythonjeff

Copy link
Copy Markdown
Owner

Summary

First of four cleanup stages ahead of scaling Palmer (hygiene → package layout → test consolidation → docs split). No behaviour changes.

  • LICENSE — all rights reserved, source available for reading. The repo is public and Palmer is a product.
  • CI — .github/workflows/ci.yml runs ruff check . and pytest -q on every push and PR. No secrets needed: the suite is offline and the workflow sets placeholder values for the keys a few modules read at import time.
  • Pinned requirements.txt to the versions the venv actually runs, plus requests, which three modules import directly and which only resolved transitively. New requirements-dev.txt.
  • .env.example is complete — all 14 variables the code reads, with comments. It listed 5, missing TAVILY_API_KEY, so a fresh clone failed on import. Verified the suite passes in a clean env holding only these placeholders.
  • README facts — price watches are twice-daily on a cron with a flat $2 bar in either direction, not "every 6h" and "≥ 15% drop". Same stale claim fixed in shopping.py docstrings. Added Development section, License section, CI badge.
  • Personal data out of source — NWS User-Agent contact is now PALMER_CONTACT_EMAIL; guards.py, test_repetition.py, test_profile_freshness.py no longer carry real users' names, neighbourhoods or verbatim texts; the one non-555 phone in the suite is now reserved.
  • Dead code removed (each verified to have no caller): artifacts.publish, db.get_all_phones, home.home_url, cards.AMBER, shows.resolve_show + its two tests. wxaudit gets a __main__; send_morning.py gets a __main__ guard (importing it sent real SMS).
  • Five comments still pointed at the deleted alerts.py; reworded.
  • ruff.toml selects E/F/W, ignoring line length, imports-after-load_dotenv(), and the conn = _conn(); cur = ... house style.

Kept on purpose: shopping._daily_ok mirrors watches._daily_ok, but shopping sits below agent in the import graph and watches above it; sharing one definition would invert the dependency direction.

Flagged, not fixed: db.get_user_flight_watches has no caller because list_watches never lists flight watches. A user can add one and never see it again. Product gap for its own PR.

Test plan

  • ruff check . clean
  • pytest -q — 1,403 passed (1,405 on main minus the two resolve_show tests)
  • Suite passes in a clean environment with only .env.example placeholders
  • grep for the removed names, email and phone number: no hits
  • PALMER_NO_SCHEDULER=1 python -c "import main; import send_morning" imports without sending
  • CI green on this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_018QpUhnYC3U7KxF8QCeenfQ

…onal data in source

The code was fine; the packaging around it read as a prototype. This is the
first of four cleanup stages (hygiene, package layout, test consolidation,
docs split) ahead of scaling Palmer.

- LICENSE (all rights reserved, source available for reading) and a README
  License section. The repo is public and Palmer is a product.
- .github/workflows/ci.yml runs ruff and the full suite on every push and PR.
  The suite is offline; a few modules read their API key at import time, so
  the workflow sets placeholder values rather than secrets.
- requirements.txt pinned to the versions the venv actually runs, and
  `requests` added — it is imported directly by three modules and only
  resolved through a transitive dependency. requirements-dev.txt adds pytest
  and ruff.
- .env.example lists all 14 variables the code reads. It listed five, and
  TAVILY_API_KEY was not one of them, so a fresh clone failed on import.
  Verified: the suite passes in a clean environment holding only these
  placeholders.
- README: price watches run twice daily on a cron and alert on any move over
  a flat $2 in either direction, not "every 6h" on a "15% drop" — the code
  changed twice and the prose did not. Same stale claim fixed in shopping.py's
  docstrings. Added a Development section and the CI badge.
- Personal data out of the source tree: the NWS User-Agent contact is now
  PALMER_CONTACT_EMAIL; guards.py and two test files no longer carry real
  users' names, neighbourhoods or verbatim texts; the one non-555 phone
  number in the suite is now a reserved one. The repetition fixture keeps a
  two-word city because opening_shape compares three meaningful words.
- Dead code removed, each verified to have no caller: artifacts.publish,
  db.get_all_phones, home.home_url, cards.AMBER, shows.resolve_show (the
  follow_show dispatch uses find_shows) and its two tests. wxaudit gets a
  __main__ so `python wxaudit.py` prints the scoreboard. send_morning.py gets
  a __main__ guard — importing it sent real SMS.
- Five comments still pointed at the deleted alerts.py; reworded.
- ruff.toml selects E/F/W and deliberately ignores line length, imports
  below load_dotenv()/init_db(), and the `conn = _conn(); cur = ...` house
  style, so the linter enforces mistakes rather than taste.

Kept on purpose: shopping._daily_ok mirrors watches._daily_ok, but shopping
sits below agent in the import graph and watches above it, so sharing one
definition would invert the dependency direction.

Flagged, not fixed: db.get_user_flight_watches has no caller because
list_watches never lists flight watches — a user can add one and never see
it again. That is a product gap for its own PR.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018QpUhnYC3U7KxF8QCeenfQ
@pythonjeff
pythonjeff merged commit 7f83fd0 into main Sep 14, 2026
1 check passed
@pythonjeff
pythonjeff deleted the chore/repo-hygiene branch September 14, 2026 19:38
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.

1 participant