Skip to content

Normalize API contract, fix scoring keys, and remove tracked bytecode#4

Merged
MohammedAlkindi merged 1 commit into
mainfrom
codex/cleanup-curio-repository-for-mergeability
Apr 1, 2026
Merged

Normalize API contract, fix scoring keys, and remove tracked bytecode#4
MohammedAlkindi merged 1 commit into
mainfrom
codex/cleanup-curio-repository-for-mergeability

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Owner

Motivation

  • Previous large patch left duplicated/contradictory fragments between schema aliases, scoring weight names, and frontend consumption fields; the change aligns them into a single coherent contract.
  • Tracked Python bytecode and virtualenv files cluttered the repo and risked re-introducing inconsistent behavior; they should be ignored and untracked.

Description

  • Unified Pydantic model configuration to v2 style using model_config = ConfigDict(populate_by_name=True) for request/response models so alias handling is explicit and consistent across the API (backend/app/models/schemas.py).
  • Normalized scoring weight keys in the engine and all references so BASE_WEIGHTS keys match the score breakdown component names (favorite_overlap, avoid_terms) and updated scoring logic to use the new keys (backend/app/scoring/engine.py).
  • Simplified frontend summary rendering to a single deterministic path and removed transitional fragments so the UI text uses meta.summary and meta.appliedRefinements consistently (frontend/main.js).
  • Added a valid example JSON response to the README.md that matches the backend/frontend contract (camelCase response aliases).
  • Updated .gitignore to include .venv and backend/.venv and removed tracked __pycache__/ and .pyc artifacts from the repository.

Testing

  • Ran python -m compileall backend/app to ensure backend code compiles; result: success.
  • Ran node --check frontend/main.js to validate frontend JS syntax; result: success.
  • Performed a lightweight contract smoke check by creating a RecommendationResult via to_result(...).model_dump(by_alias=True) and confirmed the serialized keys include imageUrl, detailsUrl, scoreBreakdown, and matchReasons; result: success.
  • Verified tracked bytecode enumeration and removed files, then committed changes; removal operation and commit succeeded.

Codex Task

@MohammedAlkindi
MohammedAlkindi merged commit 00785dc into main Apr 1, 2026
1 check passed
@MohammedAlkindi
MohammedAlkindi deleted the codex/cleanup-curio-repository-for-mergeability branch April 1, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant