Phase 7: Review
Delivered in Pull Requests #8 and #9
Each pull request's Files changed tab shows what it delivered.
- Pull request #8 (
phase-seven): the README, the Requirements Rubric, and the fixes from the end-to-end review. - Pull request #9 (
phase-seven-p2): the tidy-ups: the committed check scripts, the web test workflow, and the reorganized docs.
Status: Built. Merged into main as pull request #8, with the follow-up tidy-ups and docs reorganization merged as pull request #9. The README is written, and the Requirements Rubric maps every requirement to the code and docs that meet it. Two end-to-end checks rebuilt the project from a clean copy, checked the live services, and found and fixed the problems listed in What Did the Checks Find and Fix?. The three GitHub workflows that existed then passed on the merge.
Phase 7 finishes the project and checks it before it is handed in. It writes the README, checks the docs and comments against the finished code, rebuilds the project from a clean copy using only the README, and walks the acceptance checklist with evidence for each item. Writing the README and reviewing the project are one phase because both read the finished project and neither adds code.
Needs first: Phases 1 to 6, all built, and every phase branch merged into main.
How Does the Phase Run?
flowchart TB
A["1. Write the README"] --> B["2. Check the docs<br/>and comments"]
B --> C["3. Rebuild from a clean copy,<br/>using only the README"]
C --> D["4. Check the live API<br/>and web app"]
D --> E["5. Walk the acceptance<br/>checklist with evidence"]
E --> F["6. Pre-commit checks,<br/>then the final pull request"]
C -->|"something missing"| A
- The README comes first, because the clean rebuild follows only the README. Anything the rebuild needs that the README does not say goes back into the README.
- The checks come last, so they run on the finished files.
Checklist
Step 1: Write the README
The README is README.md in the project folder. It must hold everything in 10. README, and it links to these docs for detail.
- Project overview: what the project predicts, who it is for, and that it is a coursework project not affiliated with the National Football League.
- The dataset: the nflverse games file, with its link, and the games used (regular season, 2020 through 2026 week 10).
- The model and its result: logistic regression on two inputs, validation 63.10% (171 of 271) against the always-home baseline of 53.87%, and test 59.06% (88 of 149). Each number is recomputed from
results/run-summary.jsonbefore it is written. - The cloud services: S3 for the data and the web app, Lambda behind API Gateway for the API, CloudFront for the web app, DynamoDB for the feedback form, and GitHub Pages for the docs.
- How to train the model:
make train, and what it writes. - How to build and test the API locally:
make start, acurlrequest with the worked example, andmake pytest. - How to run it in Docker:
make docker-trainandmake docker-serve. - How to deploy to the cloud: a short summary with links to the Phase 4 and Phase 5 Deployment Guides.
- Links: the live API (
https://9awodatqc5.execute-api.us-east-1.amazonaws.com), the live web app (https://d1nubiunzfwm0q.cloudfront.net), the docs site, and the dataset. - The run environment: Python 3.13, the pinned
requirements.txt, Node.js 22.12 or later for the web app, Docker Desktop for the images, and AWS CLI version 2 for deployment. - Limitations: what the model leaves out (injuries, weather, anything after the standings date), that predictions are for reference only, and that no personal data is collected.
- A file tree and a short diagram of how the pieces fit together.
- Add the README to the docs: the docs home page is a condensed copy of it and links to it, and the Requirements Rubric marks the README requirements met.
Step 2: Check the Docs and Comments
- Every page describes what exists now. Each column, command, output file, and chart caption matches the current code. Anything the code no longer does is removed.
- Every number is recomputed from the data or the code: test totals, scores, game counts, file sizes, and hashes. Where a number appears on more than one page, every copy matches.
- One page owns each explanation. Other pages link to it instead of repeating it.
- The Requirements Rubric covers every requirement, each quoted from Project Requirements, with its file, function, setting, or command, and the page that explains it.
- The comments and docstrings read plainly, explain why rather than repeat the code, and match what the code does. A comment-only edit is checked to leave the code unchanged.
- The docs site builds with
mkdocs build --strict, and the published site on GitHub Pages shows the latest pages.
Step 3: Rebuild From a Clean Copy
Done in the end-to-end checks, on a copy of exactly the files git commits (no virtual environment, no installed packages, no trained model, and no MLflow records), following the README's setup steps. Nothing the copy needed was missing from the README.
- Create the virtual environment and install
requirements.txt. -
make pytestgives 93 passed, 2 skipped before training (the two skipped tests need a saved model). -
make trainprints the expected scores, andresults/run-summary.jsonstays byte for byte the committed one. -
make pytestgives 95 passed after training. -
make startand the worked example return 0.3296. -
make web-testgives 60 passed, 2 skipped (the count at the time of the check; the two every-game checks need files in the ignoredbuild/folder). The web tests have grown since: the project now has 65 in 12 files, or 63 passed and 2 skipped without those files. -
make docker-trainandmake docker-servebuild and give the same numbers. -
make start-web-mlshows the runs, andmake docsshows the site.
Step 4: Check the Live Services
Done in the end-to-end checks, against the live API and the live web app. The workflow runs are from the merge of pull request #8.
-
GET /healthon the live API returns status 200 with modelv1.0. -
POST /predicton the live API with the worked example returns 0.3296. - The live web app loads every tab. Custom Matchup with home New England Patriots and away Tennessee Titans gives 63.8%.
- The browser contacts only CloudFront and the API, and no tab shows an error. The headless browser did not keep a console log, so a console warning with no visible effect would not have been recorded.
- The latest runs of all three GitHub workflows passed on the merge of pull request #8. Test Python's first run, on the pull request itself, also passed.
Step 5: Walk the Acceptance Checklist
The evidence for each item (the file, the command, and its result) is on the Requirements Rubric.
- 1. Problem and dataset: public dataset, task, target, and metric named.
- 2. Cloud storage: cleaned data in S3, and a script that downloads it.
- 3. Pipeline: ingestion, preprocessing, split, training, and evaluation, driven by
config.yaml. - 4. Tracking: runs, parameters, metrics, and artifacts logged to MLflow.
- 5. Docker: the image builds and runs locally, with training and serving entry points.
- 6. API:
/predictreturns a prediction from JSON input, checked locally. - 7. Deployment: the API on Lambda behind API Gateway, publicly reachable, with CORS allowing the web app.
- 8. Front-end: the Vite app on S3 and CloudFront calls the live API and shows predictions.
- 9. Repository: every required file present, and work merged through pull requests #1 to #9.
- 10. README: overview, dataset, model, cloud services, setup and usage, and both endpoint links.
- 11. Ethics and limitations: the README's Limitations section.
Step 6: Pre-Commit Checks and the Final Pull Request
- No secrets or generated files are tracked: no
.env,*.pem, or credentials file, andbuild/,site/,models/,mlflow.db,mlartifacts/,node_modules/,frontend/dist/,local/,local-docs/,specs/,.cursor/, and.kiro/are ignored. - No absolute path or user name in any committed file, including
mlflow-reference/. - Every relative link resolves in
README.mdanddocs/. - An independent review of the code and settings, with each finding fixed or noted: two end-to-end checks by Cursor (one report-only, one with fixes), and a review of the project's structure against the requirements.
- The final pull requests are opened and merged by the developer: pull request #8, then pull request #9 for the follow-up.
Small Items Left From Earlier Phases
These are tidy-ups, not requirements. They were done after the merge of pull request #8, and merged in pull request #9.
- The confusion-matrix picture: the axis name "What the model picked" now sits above the grid with its column labels, and the legend sits just under the grid. See Confusion Matrix.
- The MLflow artifacts screenshot:
mlflow-reference/screenshots/run-artifacts.pngnow shows the picture's preview, cropped so no path shows. - The latest MLflow run's commit tag: one
make trainafter the merge tagged run49a0841fwith commit9562f88onmain. The scores did not change, andresults/run-summary.jsonis byte for byte the same. - The every-game check scripts are committed in
scripts/checks/, so a fresh copy can rerun them. Their outputs stay in the git-ignoredbuild/folder. A rerun matched the live API on every game with 0 mismatches. See the Testing Guide. - The web app's tests run on each pull request that changes
frontend/, through the new Test Web App workflow. - The data steps run in the train image. See Run the Data Steps in the Container.
What Is Not in This Phase
- New features, new models, or new inputs.
- Changes to AWS, except to fix something the live checks find.
Where to Read More
- Project Requirements lists every requirement and the acceptance checklist.
- Requirements Rubric shows where each finished requirement lives.
- Makefile explains every command the README uses.
Implementation
This section records how the review was run, what the two checks found and fixed, and what was left as is.
How Was the Review Done?
flowchart TB
A["Write the README and<br/>the Requirements Rubric"] --> B["End-to-end check<br/>report only"]
B --> C["Fix the findings,<br/>rerun the checks"]
C --> D["Merge<br/>pull request #8"]
D --> E["Tidy-ups<br/>pull request #9"]
Cursor ran each check from a written spec. The developer reviewed the results, decided what to fix, and ran every git command.
What Did the Checks Find and Fix?
| Finding | Fix |
|---|---|
The download did not check the four columns src/season.py reads |
Added to NEEDED_COLUMNS in src/data/fetch_raw.py |
| No workflow ran the Python tests | New test-python.yml runs make pytest on each pull request |
| scipy, which training uses, was pinned only for serving | scipy==1.18.1 pinned in requirements.txt too |
| The download and S3 download steps had no tests | New tests/test_fetch_raw.py and tests/test_download_from_s3.py |
| Two pages gave only the before-training test count | Every page gives 93 passed and 2 skipped before training, 95 after |
| An unused setting and two misnamed tests | OMITTED_TAGS removed, two web tests renamed |
The second check rebuilt everything in a fresh copy of the committed files and matched on every step: the tests, the scores and run summary hash, the local API, both Docker images, and the AWS role permissions.
What Was Tidied After the Merge?
The small items under Small Items Left From Earlier Phases were all done in pull request #9. Further details:
- The every-game check scripts moved from the ignored
build/folder toscripts/checks/. - The web app's tests run through
test-web.yml. - The docs were reorganized for the Version 1.0 Release Notes: the Overview first, the Developer Docs and Extras grouped by topic, and every diagram fitted to the page width.
What Was Left As Is?
- The data stops at 2026 week 10. The project is a fixed snapshot.
POST /predicthas no rate limit. OnlyPOST /feedbackis throttled, because it writes to the database.- The deployed Lambda zip was not replaced. The live API already matches the local model on every game.