Add planning baseline: BC, SA, PP and two gateways

Create the Business Case, Stakeholder Analysis (S01 course participant,
S02 Udemy coursists, S03 GitHub viewers), Project Plan and the milestone
documents MIL-001 (project setup, 6 tasks) and MIL-002 (game
implementation, 8 tasks) for the console Blackjack game.

Register PP and MIL in the artifact registry, set the PO language to en,
and link the synced Gitea milestones in the Gateway Schedule.

Refs #1
Refs #2
Refs #3
Refs #4
Refs #5
Refs #6
Refs #7
Refs #8
Refs #9
Refs #10
Refs #11
Refs #12
Refs #13
Refs #14
This commit is contained in:
2026-10-04 21:38:09 +08:00
parent 52febca25e
commit 1d35410b8d
123 changed files with 5978 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
# Gateway 1 - Project Setup
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-001 |
| CrossReference | [BC-001] |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-04 | Accepted | Jens Tirsvad Nielsen | S01 | Initial version | pending |
---
## Purpose
Decide whether the project foundation (repository metadata, layout, tooling, documentation skeleton) is ready so that game code can be added on top of it.
## Deliverable
A repository with `src/`, `tests/`, `docs/`, a `pyproject.toml` (Python 3.13+, no runtime dependencies), `constants.py`, a Python `.gitignore`, a `Doxyfile`, a `README.md` that documents the local `.venv` and the pip upgrade, and a repository description with topics on the git host.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | `pip install -e .` works in a fresh `.venv` on Python 3.13+ | Succeeds | Fails |
| 2 | `python -m unittest` runs (with at least one smoke test) | Exit code 0 | Non-zero |
| 3 | `doxygen Doxyfile` runs | No errors | Errors |
| 4 | README documents venv creation, `python -m pip install --upgrade pip`, run and test | All present | Any missing |
| 5 | Repository has a description and topics | Visible on the git host | Missing |
| 6 | `.env` is git-ignored and not referenced by any file under `src/` or `tests/` | True | False |
## Dependencies
| Depends on | Reason |
| --- | --- |
| None | First gateway |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 4, 5 and 6 | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-06 - within the two-evening effort assumed in the Business Case.
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Add repository description and topics | Set a one-line description and topics (python, blackjack, udemy, 100-days-of-code, cli-game) on the git host repository through its API, using the token from the local `.env`. The `.env` file is for personal use only and is never imported, tested or committed. | No | |
| 2 | Create project layout and pyproject.toml | Create `src/`, `tests/` and a `pyproject.toml` that requires Python 3.13 or newer, defines the package under `src/`, has no runtime dependencies and configures the unittest entry. Verify the existing Python `.gitignore` covers `.venv/` and `.env`. | No | |
| 3 | Add constants module | Create `constants.py` with the deck list `[11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]`, the blackjack target 21, the dealer stand threshold 17, the ace values and the emoji card faces, so no magic numbers appear in game code. | No | |
| 4 | Add Doxyfile | Add a `Doxyfile` that reads `src/`, writes to `docs/doxygen/`, and extracts Python documentation from Doxygen-style comments. | No | |
| 5 | Write README with venv and run/test instructions | Write `README.md` (standard layout) with description, requirements, creating and activating a local `.venv`, `python -m pip install --upgrade pip`, installing the project, running the game, running the tests and generating Doxygen documentation. | No | |
| 6 | Add smoke test for package import | Add one unittest that imports the package, so the test command is proven to work before any game logic exists. | No | |
---
[BC-001]: ../business-case.md
@@ -0,0 +1,74 @@
# Gateway 2 - Game Implementation
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-002 |
| CrossReference | [BC-001] |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-04 | Accepted | Jens Tirsvad Nielsen | S01 | Initial version | pending |
---
## Purpose
Decide whether the Blackjack game is complete, correct under the house rules and ready to be played from the console.
## Deliverable
A runnable console game (`python -m blackjack` from the activated venv) with emoji cards and the course logo, a unit-test suite covering the rules, and Doxygen comments on all public functions.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | Unit tests for `deal_card`, `calculate_score` and `compare` cover every house rule | All pass | Any fail |
| 2 | An Ace + 10 two-card hand scores 0 (blackjack); an Ace is demoted from 11 to 1 when the hand exceeds 21 | Verified by test | Not verified |
| 3 | The dealer draws while its score is below 17 | Verified by test | Not verified |
| 4 | A scripted full game (hit, stand, restart answer) runs to the end without error | Passes | Fails |
| 5 | Rule functions contain no `input()` or `print()` calls | True | False |
| 6 | `doxygen Doxyfile` documents every public function | No warnings | Warnings |
## Dependencies
| Depends on | Reason |
| --- | --- |
| [MIL-001] | Needs the layout, constants, tooling and test runner |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 1, 2, 3 and 5 | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-11 - five days after the setup gateway, within the Business Case effort estimate.
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Implement deal_card | Return a random card from the deck constant using `random.choice`. The deck is unlimited and cards are never removed, so each draw is independent. Add a Doxygen comment and unit tests with `random.choice` patched. | No | |
| 2 | Implement calculate_score | Sum a list of cards, return 0 for a two-card Ace + 10 blackjack, and replace an 11 with 1 while the total exceeds 21. Pure function without console I/O; unit-tested for blackjack, bust, multiple aces and normal totals. | No | |
| 3 | Implement compare | Take user and computer scores and return the outcome: draw on equal scores, user loses on dealer blackjack or user bust, user wins on user blackjack or dealer bust, otherwise the higher score wins. Check order follows the assignment's hint 13. | No | |
| 4 | Render emoji cards and logo | Convert card values to emoji faces (suit emoji with the card rank) from the constants, and print the course logo from `art.py` at the start of each game. Keep rendering separate from the rules. | No | |
| 5 | Implement dealer play and game loop | Deal two cards each, show hands, let the user hit or stand until bust, blackjack or stand, then let the dealer draw while below 17, compare and print the result. Console input and output sit in one module that calls the pure rule functions. | No | |
| 6 | Implement restart prompt and console clear | After each game ask whether to play again; on yes clear the console and start a new game, on no exit cleanly. Handle invalid answers by asking again. | No | |
| 7 | Add scripted end-to-end test | Run a full game with `input` and `random.choice` patched, covering hit, stand, bust, blackjack and restart, and assert the printed outcome. | No | |
| 8 | Add Doxygen comments and generate docs | Ensure every public module, function and constant has a Doxygen comment, run `doxygen Doxyfile` and fix any warnings. | No | |
---
[BC-001]: ../business-case.md
[MIL-001]: ./mil-001-project-setup.md