From db7e5842b8e12a7b2a1c21d383f0e61c543c337a Mon Sep 17 00:00:00 2001 From: James Xian Date: Sun, 22 Mar 2026 16:07:35 +0800 Subject: [PATCH 1/4] feat(hello): step 1 - implement hello module with tests --- src/__init__.py | 0 src/hello.py | 3 +++ tests/test_hello.py | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 src/__init__.py create mode 100644 src/hello.py create mode 100644 tests/test_hello.py diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/hello.py b/src/hello.py new file mode 100644 index 0000000..3c2df23 --- /dev/null +++ b/src/hello.py @@ -0,0 +1,3 @@ +def hello(name: str) -> str: + """Return a greeting string for the given name.""" + return f"Hello, {name}!" diff --git a/tests/test_hello.py b/tests/test_hello.py new file mode 100644 index 0000000..6c0e62a --- /dev/null +++ b/tests/test_hello.py @@ -0,0 +1,13 @@ +from src.hello import hello + + +def test_hello_world() -> None: + assert hello("World") == "Hello, World!" + + +def test_hello_empty() -> None: + assert hello("") == "Hello, !" + + +def test_hello_alice() -> None: + assert hello("Alice") == "Hello, Alice!" From 9678b73e020d84a4576684f0e3fffc7d21b0b284 Mon Sep 17 00:00:00 2001 From: James Xian Date: Sun, 22 Mar 2026 16:08:17 +0800 Subject: [PATCH 2/4] docs: update plan and progress for step 1 --- specs/add-hello-module/plan.md | 37 ++++++++++++++++++++++++++++++ specs/add-hello-module/progress.md | 5 ++++ 2 files changed, 42 insertions(+) create mode 100644 specs/add-hello-module/plan.md create mode 100644 specs/add-hello-module/progress.md diff --git a/specs/add-hello-module/plan.md b/specs/add-hello-module/plan.md new file mode 100644 index 0000000..5885087 --- /dev/null +++ b/specs/add-hello-module/plan.md @@ -0,0 +1,37 @@ +# Implementation Plan: Hello Module + +## Dependency Graph + +```mermaid +graph LR + S1[Step 1: Hello module + tests] +``` + +## Checklist +- [x] Step 1: Implement hello module with tests + +--- + +## Step 1: Implement hello module with tests + +**Depends on**: none + +**Objective**: Create the `hello` module and its unit tests in a single step, since the module is trivially small and the tests are tightly coupled to it. + +**Related Files**: +- `src/hello.py` (create) — the hello function +- `tests/test_hello.py` (create) — unit tests +- `pyproject.toml` (read) — check for test runner config + +**Test Requirements** (TDD — write tests first): +- Test `hello("World")` returns `"Hello, World!"` +- Test `hello("")` returns `"Hello, !"` +- Test `hello("Alice")` returns `"Hello, Alice!"` + +All three test cases from design.md's Integration Testing section are covered here. + +**Implementation Guidance**: +- Create `src/hello.py` with the `hello(name: str) -> str` function per design.md Components & Interfaces +- Create `tests/test_hello.py` importing from `src.hello` and testing all cases above +- No external dependencies, no error handling +- Run tests with `pytest` to verify diff --git a/specs/add-hello-module/progress.md b/specs/add-hello-module/progress.md new file mode 100644 index 0000000..300893b --- /dev/null +++ b/specs/add-hello-module/progress.md @@ -0,0 +1,5 @@ +## Step 1: Implement hello module with tests +- **Files changed**: `src/__init__.py` (created), `src/hello.py` (created), `tests/test_hello.py` (created) +- **What was built**: Hello module with a single `hello(name: str) -> str` function and unit tests +- **Tests**: 3 unit tests added (test_hello_world, test_hello_empty, test_hello_alice), all passing +- **Notes**: Added `src/__init__.py` to make `src` a proper Python package for imports From 3151e6e78580aa331067af5b3f01cfcc91a42e92 Mon Sep 17 00:00:00 2001 From: James Xian Date: Sun, 22 Mar 2026 16:10:23 +0800 Subject: [PATCH 3/4] docs: add implementation summary and review --- .../implementation-summary.md | 39 +++++++++++++++++++ specs/add-hello-module/review-round-1.md | 25 ++++++++++++ specs/add-hello-module/source-issue | 1 + 3 files changed, 65 insertions(+) create mode 100644 specs/add-hello-module/implementation-summary.md create mode 100644 specs/add-hello-module/review-round-1.md create mode 100644 specs/add-hello-module/source-issue diff --git a/specs/add-hello-module/implementation-summary.md b/specs/add-hello-module/implementation-summary.md new file mode 100644 index 0000000..44c5f22 --- /dev/null +++ b/specs/add-hello-module/implementation-summary.md @@ -0,0 +1,39 @@ +## implementation-summary.md + +### Overview + +Added a simple `hello` module to `freematters/testbed`. The module provides a single function `hello(name: str) -> str` that returns a greeting string `"Hello, !"`. Includes 3 unit tests covering normal usage and edge cases. + +### Steps Completed + +| Step | Title | Status | Commit | +|------|-------|--------|--------| +| 1 | Implement hello module with tests | ✅ Done | `db7e584` | + +### Test Summary + +- **Total tests added**: 3 +- **All passing**: Yes +- **Coverage**: `hello()` function fully covered — normal input, empty string, named input + +### Files Created/Modified + +| File | Description | +|------|-------------| +| `src/__init__.py` | Package init to make `src` importable | +| `src/hello.py` | The `hello(name: str) -> str` function | +| `tests/test_hello.py` | 3 unit tests for the hello function | + +### How to Run + +```bash +# Run tests +uv run pytest tests/test_hello.py -v + +# Use the function +python -c "from src.hello import hello; print(hello('World'))" +``` + +### Remaining Work + +None — implementation is complete per spec. diff --git a/specs/add-hello-module/review-round-1.md b/specs/add-hello-module/review-round-1.md new file mode 100644 index 0000000..ab1fdfd --- /dev/null +++ b/specs/add-hello-module/review-round-1.md @@ -0,0 +1,25 @@ +## Review Round 1 — PASS + +### Verdict: PASS + +### Issues by Severity + +| Severity | Count | +|----------|-------| +| 🔴 Major | 0 | +| 🟠 Medium | 0 | +| 🟡 Minor | 3 | + +### Minor Issues (not blocking) +1. **Docstring examples** — could add usage examples to docstring (style preference) +2. **Empty string behavior** — `hello("")` returns `"Hello, !"` which is by-design per requirements (pass through all inputs) +3. **Limited edge case tests** — no tests for special characters or very long names (not required per spec) + +### Spec Compliance +✅ All requirements met. Function signature, behavior, tests, and constraints all match design.md. + +### Code Quality +✅ Clean, idiomatic Python. No duplication, YAGNI violations, or readability issues. + +### Correctness & Security +✅ No bugs, injection risks, or security issues. All 3 tests + existing 11 tests pass. diff --git a/specs/add-hello-module/source-issue b/specs/add-hello-module/source-issue new file mode 100644 index 0000000..b3b8c4a --- /dev/null +++ b/specs/add-hello-module/source-issue @@ -0,0 +1 @@ +freematters/testbed#16 From b1d7887d7c9908730c740b8a4d3533d860a2a1da Mon Sep 17 00:00:00 2001 From: James Xian Date: Sun, 22 Mar 2026 16:11:47 +0800 Subject: [PATCH 4/4] chore: exclude specs directory from repository --- .gitignore | 1 + .../implementation-summary.md | 39 ------------------- specs/add-hello-module/plan.md | 37 ------------------ specs/add-hello-module/progress.md | 5 --- specs/add-hello-module/review-round-1.md | 25 ------------ specs/add-hello-module/source-issue | 1 - 6 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 specs/add-hello-module/implementation-summary.md delete mode 100644 specs/add-hello-module/plan.md delete mode 100644 specs/add-hello-module/progress.md delete mode 100644 specs/add-hello-module/review-round-1.md delete mode 100644 specs/add-hello-module/source-issue diff --git a/.gitignore b/.gitignore index a9dedaa..ec0a770 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist/ build/ .venv/ .pytest_cache/ +specs/ diff --git a/specs/add-hello-module/implementation-summary.md b/specs/add-hello-module/implementation-summary.md deleted file mode 100644 index 44c5f22..0000000 --- a/specs/add-hello-module/implementation-summary.md +++ /dev/null @@ -1,39 +0,0 @@ -## implementation-summary.md - -### Overview - -Added a simple `hello` module to `freematters/testbed`. The module provides a single function `hello(name: str) -> str` that returns a greeting string `"Hello, !"`. Includes 3 unit tests covering normal usage and edge cases. - -### Steps Completed - -| Step | Title | Status | Commit | -|------|-------|--------|--------| -| 1 | Implement hello module with tests | ✅ Done | `db7e584` | - -### Test Summary - -- **Total tests added**: 3 -- **All passing**: Yes -- **Coverage**: `hello()` function fully covered — normal input, empty string, named input - -### Files Created/Modified - -| File | Description | -|------|-------------| -| `src/__init__.py` | Package init to make `src` importable | -| `src/hello.py` | The `hello(name: str) -> str` function | -| `tests/test_hello.py` | 3 unit tests for the hello function | - -### How to Run - -```bash -# Run tests -uv run pytest tests/test_hello.py -v - -# Use the function -python -c "from src.hello import hello; print(hello('World'))" -``` - -### Remaining Work - -None — implementation is complete per spec. diff --git a/specs/add-hello-module/plan.md b/specs/add-hello-module/plan.md deleted file mode 100644 index 5885087..0000000 --- a/specs/add-hello-module/plan.md +++ /dev/null @@ -1,37 +0,0 @@ -# Implementation Plan: Hello Module - -## Dependency Graph - -```mermaid -graph LR - S1[Step 1: Hello module + tests] -``` - -## Checklist -- [x] Step 1: Implement hello module with tests - ---- - -## Step 1: Implement hello module with tests - -**Depends on**: none - -**Objective**: Create the `hello` module and its unit tests in a single step, since the module is trivially small and the tests are tightly coupled to it. - -**Related Files**: -- `src/hello.py` (create) — the hello function -- `tests/test_hello.py` (create) — unit tests -- `pyproject.toml` (read) — check for test runner config - -**Test Requirements** (TDD — write tests first): -- Test `hello("World")` returns `"Hello, World!"` -- Test `hello("")` returns `"Hello, !"` -- Test `hello("Alice")` returns `"Hello, Alice!"` - -All three test cases from design.md's Integration Testing section are covered here. - -**Implementation Guidance**: -- Create `src/hello.py` with the `hello(name: str) -> str` function per design.md Components & Interfaces -- Create `tests/test_hello.py` importing from `src.hello` and testing all cases above -- No external dependencies, no error handling -- Run tests with `pytest` to verify diff --git a/specs/add-hello-module/progress.md b/specs/add-hello-module/progress.md deleted file mode 100644 index 300893b..0000000 --- a/specs/add-hello-module/progress.md +++ /dev/null @@ -1,5 +0,0 @@ -## Step 1: Implement hello module with tests -- **Files changed**: `src/__init__.py` (created), `src/hello.py` (created), `tests/test_hello.py` (created) -- **What was built**: Hello module with a single `hello(name: str) -> str` function and unit tests -- **Tests**: 3 unit tests added (test_hello_world, test_hello_empty, test_hello_alice), all passing -- **Notes**: Added `src/__init__.py` to make `src` a proper Python package for imports diff --git a/specs/add-hello-module/review-round-1.md b/specs/add-hello-module/review-round-1.md deleted file mode 100644 index ab1fdfd..0000000 --- a/specs/add-hello-module/review-round-1.md +++ /dev/null @@ -1,25 +0,0 @@ -## Review Round 1 — PASS - -### Verdict: PASS - -### Issues by Severity - -| Severity | Count | -|----------|-------| -| 🔴 Major | 0 | -| 🟠 Medium | 0 | -| 🟡 Minor | 3 | - -### Minor Issues (not blocking) -1. **Docstring examples** — could add usage examples to docstring (style preference) -2. **Empty string behavior** — `hello("")` returns `"Hello, !"` which is by-design per requirements (pass through all inputs) -3. **Limited edge case tests** — no tests for special characters or very long names (not required per spec) - -### Spec Compliance -✅ All requirements met. Function signature, behavior, tests, and constraints all match design.md. - -### Code Quality -✅ Clean, idiomatic Python. No duplication, YAGNI violations, or readability issues. - -### Correctness & Security -✅ No bugs, injection risks, or security issues. All 3 tests + existing 11 tests pass. diff --git a/specs/add-hello-module/source-issue b/specs/add-hello-module/source-issue deleted file mode 100644 index b3b8c4a..0000000 --- a/specs/add-hello-module/source-issue +++ /dev/null @@ -1 +0,0 @@ -freematters/testbed#16