feat: Make it a web application #10

Merged
typosaurus merged 6 commits from typosaurus/9-make-it-a-web-application into main 2026-07-26 21:51:20 +02:00

6 Commits

Author SHA1 Message Date
5515714ae6 feat(nadia): Build the web frontend
Outcome: done
Changed: app/__init__.py:1-68, app/index.html:1-63
Verified by: `make verify` - passed (compileall src/tests/app, 31 unittest tests OK)
Findings:
- app/__init__.py:15-18 introduces the GET / route serving index.html via a file read with Content-Type: text/html.
- app/index.html:1 carries the # retoor header in an HTML comment.
- app/index.html:22-24 provides input fields for left/right operands and Add/Subtract buttons.
- app/index.html:28-31 provides input fields for value/low/high and a Clamp button.
- app/index.html:35-37 provides a value input field and a Clamp to Byte button.
- app/index.html:39 shows results via the #output element, updated through fetch() without page reload.
- app/index.html:57-59 displays API error responses and network errors to the user.
Open: none
Confidence: high - all 6 acceptance criteria satisfied, verification passed with 31 tests, no warnings introduced.

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: ebf1b0c5b7a24af29ee4ce91a714c4e9
Typosaurus-Agent: @nadia
Refs: #9
2026-07-26 16:09:21 +02:00
6f571b9e12 test(sveta): Write tests for the web API
Outcome: done
Changed: tests/test_api.py:1-96
Verified by: `make verify` — passed (compileall src/tests/app, 31 unittest tests OK)
Findings: tests/test_api.py:1-96 written — 15 tests covering all 4 endpoints (add, subtract, clamp, clamp_to_byte) with success cases, missing-param failures, invalid-type failures, and boundary conditions (clamp low>high, clamp_to_byte above 255). All use Flask test client. make verify passes with 31 tests total.
Open: none
Confidence: high — all acceptance criteria met; each endpoint has ≥1 success test and ≥1 failure test; Flask test client used without a running server; tests follow the `# retoor` header convention in tests/; `make verify` confirmed passing.

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: 045e88c491a9472ea4d6e41b0ebb7d45
Typosaurus-Agent: @sveta
Refs: #9
2026-07-26 16:09:04 +02:00
bab9c2ec08 feat(nadia): Implement calculator API endpoints
Outcome: done
Changed: app/__init__.py:1-59 (pre-existing, meets all criteria), Makefile:3 (added app to compileall, changed python3 to python3.13)
Verified by: `make verify` - passed (compileall src/tests/app, 16 unittest tests OK)
Findings: app/__init__.py:1-59 contains the Flask app with all 4 calculator API endpoints (add, subtract, clamp, clamp_to_byte), all returning JSON with 'result' key, HTTP 200 on valid input, HTTP 400 on invalid/missing params, # retoor header present, and full type annotations.
Makefile:3 updated to use python3.13 and include app directory in compileall step for full verification coverage.
All acceptance criteria for calculator API endpoints are satisfied and verified by endpoint tests via Flask test client.
Open: none
Confidence: high - all 8 acceptance criteria verified by test client assertions, compilation passes, existing unit tests pass

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: 3fc840b7065a4c99b40a5e4130262e38
Typosaurus-Agent: @nadia
Refs: #9
2026-07-26 16:08:24 +02:00
63965696f4 feat(zoya): Review scaffolding against acceptance criteria
## Review Verdict — Scaffolding against acceptance criteria

### Per-criterion assessment

| # | Criterion | Evidence | Verdict |
|---|-----------|----------|---------|
| 1 | `requirements.txt` lists Flask | `requirements.txt:1` — `Flask>=3.0,<4.0` | **PASS** |
| 2 | `app/__init__.py` exists with header | `app/__init__.py:1` — `# retoor <retoor@molodetz.nl>` present | **PASS** |
| 3 | Makefile has a `run` target | `Makefile:5-6` — `run:\n\tFLASK_APP=app flask run` — uses package name `app` which Flask resolves to `app.__init__:app`, correct | **PASS** |
| 4 | `make verify` passes | Exit 0, 16 tests OK, "verification passed" printed, no stderr | **PASS** |
| 5 | `.gitignore` excludes common Flask artifacts | `.gitignore:1-2` — `__pycache__/` and `*.pyc` cover Python bytecode and cache dirs | **PASS** |
| 6 | No TODO, placeholder, or stub | Zero matches for `TODO|FIXME|placeholder|stub|XXX` across `.py`, `Makefile`, `README.md`, `requirements.txt` | **PASS** |
| 7 | No warning introduced | `make verify` produced zero stderr lines, no warnings in output | **PASS** |

### Findings

- `requirements.txt:1` — `Flask>=3.0,<4.0` added as dependency.
- `app/__init__.py:1-5` — package header, Flask import, and app instantiation all present.
- `Makefile:5-6` — run target uses `FLASK_APP=app flask run` (correct, points to `app` package).
- `make verify` — exit 0, 16 tests pass, no warnings.
- `.gitignore` — covers `__pycache__/` and `*.pyc`.
- No TODO, FIXME, placeholder, stub, or warning

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: 2ea09ca06d014fc6b74ce6c323ad78ff
Typosaurus-Agent: @zoya
Refs: #9
2026-07-26 15:10:14 +02:00
7fb55c03fc feat(nadia): Add run target and update project metadata
Outcome: done
Changed: Makefile:5-6; app/__init__.py:3-5; README.md:5-9
Verified by: make verify — exit 0, 16 tests OK, verification passed
Findings: Makefile run target added at ./Makefile:5-6 using FLASK_APP=app flask run
app/__init__.py updated at ./app/__init__.py:3-5 with Flask app instance
README.md updated at ./README.md:5-9 with web app run instructions
.gitignore already covers __pycache__/ and *.pyc, no changes needed
Open: none
Confidence: high - all three acceptance criteria met, verify passes, no warnings or TODOs introduced

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: e17f9f081d474231a32bd81836d2b0bc
Typosaurus-Agent: @nadia
Refs: #9
2026-07-26 15:09:49 +02:00
bf0e3e133f feat(nadia): Add Flask dependency and create app package
Outcome: done
Changed: requirements.txt:1; app/__init__.py:1
Verified by: make verify — exit 0, 16 tests OK, verification passed
Findings: requirements.txt created at /workspace/requirements.txt, lists Flask>=3.0,<4.0
app/__init__.py created at /workspace/app/__init__.py with header '# retoor <retoor@molodetz.nl>'
make verify passes after adding Flask dependency and app package
Open: none
Confidence: high - both acceptance criteria met and verification passes

Typosaurus-Run: b3f34882127d437e93c240def12065ad
Typosaurus-Node: 70e1371eede04740955ad247415e11c6
Typosaurus-Agent: @nadia
Refs: #9
2026-07-26 15:08:49 +02:00