Skip to content

feat: schema.sql created to describe tables to the db plus readme - #30

Closed
Kauakb wants to merge 28 commits into
mainfrom
feature/prd-must-stories
Closed

Kauakb wants to merge 28 commits into
mainfrom
feature/prd-must-stories

Conversation

@Kauakb

@Kauakb Kauakb commented Oct 31, 2026

Copy link
Copy Markdown
Owner

No description provided.

Kauakb and others added 28 commits October 23, 2026 01:00
Ignore __pycache__, .pyc, .venv and .env so compiled files, the virtual
environment and secrets never get committed to this public repo.

Closes #1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin fastapi and uvicorn, document how to run the app with uvicorn,
and add Bruno requests for / and /about.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add dev requirements, a first test for / and /about, ruff and pytest
config in pyproject.toml, and a GitHub Actions workflow that runs
ruff check, ruff format --check and pytest. Format main.py with ruff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Dependabot config for weekly pip and GitHub Actions updates
- Read-only token and pip-audit step in CI; run CI on pushes to develop
- SECURITY.md pointing to private vulnerability reporting
- Ignore .env.* and add .env.example
- Document the security setup in CLAUDE.md

Closes #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Returns every problem as a JSON list, ordered by id.

Part of #6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Attempt model with a foreign key to problems; created_at set by PostgreSQL
- AttemptCreate/AttemptRead: minutes > 0, confidence 1-5, optional notes
- POST and GET /problems/{problem_id}/attempts, 404 if the problem is missing

Part of #11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Score = points for the last attempt (40 solved with confidence 1-2,
30 not solved, 20 confidence 3, 10 confidence 4-5) + 1 per day since,
up to 15. Problems with no attempts go last.

Part of #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-02, US-03)

- GET /health; the API refuses to start without DATABASE_URL
- schema.sql with NOT NULL, CHECK, UNIQUE (title, platform) and
  ON DELETE CASCADE, run on startup
- repository.py: the only place with SQL, always parameterized (psycopg);
  replaces the SQLAlchemy ORM, as the PRD requires
- services.py domain errors + errors.py handlers: every error is
  {error, message} (+ fields on 422) with the right status
- tests run on a separate test database; CI gets a PostgreSQL service
- placeholder routes / and /about and the old review list are removed

Part of #13, #14, #15

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /problems: title/topic trimmed, topic lowercased, 409 when the
  title already exists on the same platform
- GET /problems with optional topic, difficulty and platform filters
- GET, PATCH (only the fields sent, at least one) and DELETE (204,
  attempts deleted by cascade) on /problems/{problem_id}
- Bruno Problems folder with response tests; Create problem saves
  problem_id for the next requests

Part of #16, #17, #18, #19, #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST /problems/{problem_id}/attempts: minutes 1-600, confidence 1-5,
  solved strictly true/false, notes optional (default "", max 500),
  created_at is today's date; 404 if the problem doesn't exist
- GET /problems/{problem_id}/attempts: newest first, [] without attempts
- Bruno Attempts folder with response tests

Part of #21, #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- one request per error code (404, 405, 409, 422) with response tests
- folders ordered Health, Problems, Attempts, Errors (folder.bru seq),
  so the Runner creates the problem before the requests that use it

Part of #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also updates CLAUDE.md for the raw SQL layers, the test database and CI.

Part of #26, #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- review.py: pure functions; urgency = +50 if not solved, +10 per
  confidence point below 5, +1 per day since the attempt (max 30)
- repository.latest_attempts: newest attempt per problem (DISTINCT ON);
  problems without attempts are left out
- GET /review?limit=5 (1-50): highest score first, ties by smaller id
- Bruno Insights folder (/review and /review?limit=2), Errors moved last
- README: endpoint, formula, example, and why sorted over heapq
  (O(n log n) vs O(n log k))

Part of #23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kauakb

Kauakb commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Closing: same branch as #28, which goes into develop first (PRD flow). main gets these changes later through the develop -> main PR.

@Kauakb Kauakb closed this Oct 31, 2026
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