Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/email-writing-judge-tdd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Email Writing Judge TDD

on:
push:
branches:
- cursor/llm-email-writing-judge-task7-8f24
pull_request:
paths:
- backend/services/email_writing_judge.py
- backend/tests/test_email_writing_judge.py
- backend/tests/test_email_writing_judge_terminal_coverage.py
- backend/tests/fixtures/email_writing/judge_outputs.json
- backend/requirements-hashes.txt
- .github/workflows/email-writing-judge-tdd.yml
Comment thread
coderabbitai[bot] marked this conversation as resolved.
workflow_dispatch:

permissions:
contents: read

concurrency:
group: email-writing-judge-tdd-${{ github.event.pull_request.head.sha || github.sha }}
cancel-in-progress: true

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
PYTHONWARNINGS: error
DISABLE_BACKGROUND_WORKERS: "1"

jobs:
task7-independent-judge:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
cache: pip
cache-dependency-path: backend/requirements-hashes.txt
- name: Install hash-locked application dependencies
run: python -m pip install --disable-pip-version-check --require-hashes -r backend/requirements-hashes.txt
- name: Install hash-verified coverage tool
run: |
set -euo pipefail
mkdir -p /tmp/coverage-wheel
cat >/tmp/coverage-lock.txt <<'EOF'
coverage==7.15.2 --hash=sha256:eb6bcae8d1a9d305351ecb108232441d11c5cfe9de840a04388ba5d2db8d735c
EOF
python -m pip download \
--disable-pip-version-check \
--require-hashes \
--no-deps \
--only-binary=:all: \
--platform any \
--python-version 3.14 \
--implementation py \
--abi none \
--dest /tmp/coverage-wheel \
-r /tmp/coverage-lock.txt
python -m pip install --disable-pip-version-check --no-deps \
/tmp/coverage-wheel/coverage-7.15.2-py3-none-any.whl
- name: Run Task 7 independent-Judge tests
run: |
cd backend
python -m pytest -q \
tests/test_email_writing_judge.py \
tests/test_email_writing_judge_terminal_coverage.py
- name: Verify Task 7 statement and branch coverage
run: |
cd backend
python -m coverage erase
python -m coverage run --branch \
--include='services/email_writing_judge.py' \
-m pytest -q \
tests/test_email_writing_judge.py \
tests/test_email_writing_judge_terminal_coverage.py
python -m coverage report --show-missing --fail-under=100 \
services/email_writing_judge.py
- name: Verify shipped Python docstrings
run: |
cd backend
python - <<'PY'
import ast
from pathlib import Path

paths = [
Path("services/email_writing_judge.py"),
]
missing: list[str] = []
for path in paths:
tree = ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
if ast.get_docstring(tree) is None:
missing.append(f"{path}:<module>")
for node in ast.walk(tree):
if isinstance(node, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)):
if ast.get_docstring(node) is None:
missing.append(f"{path}:{node.lineno}:{node.name}")
if missing:
raise SystemExit("Missing shipped docstrings:\n" + "\n".join(missing))
print(f"Docstring gate passed for {len(paths)} shipped modules")
PY
- name: Lint Task 7 source and tests
run: |
cd backend
python -m ruff check \
services/email_writing_judge.py \
tests/test_email_writing_judge.py \
tests/test_email_writing_judge_terminal_coverage.py
- name: Compile Task 7 source and tests
run: |
python -m compileall -q \
backend/services/email_writing_judge.py \
backend/tests/test_email_writing_judge.py \
backend/tests/test_email_writing_judge_terminal_coverage.py
Loading
Loading