-
Notifications
You must be signed in to change notification settings - Fork 1
feat(email-writing): add independent criterion Judge #1402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
7
commits into
feat/llm-email-writing-candidate-task6
Choose a base branch
from
cursor/llm-email-writing-judge-task7-8f24
base: feat/llm-email-writing-candidate-task6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c780370
test(email-writing): add independent Judge contracts
cursoragent bc77b0b
feat(email-writing): add independent Judge port
cursoragent 1837035
test(email-writing): close Judge terminal coverage
cursoragent 3420f49
ci(email-writing): add read-only Task 7 TDD workflow
cursoragent 4155985
fix(email-writing): keep Judge payloads and IRT columns honest
cursoragent d6b205f
ci(email-writing): rerun Judge TDD when the lockfile changes
cursoragent 3d6b334
test(judge): keep score guard errors deterministic
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.