Skip to content

fix(autograder): level-based grader with 5 bug fixes#2

Merged
lassebenni merged 1 commit into
mainfrom
fix/autograder-week9
Jun 29, 2026
Merged

fix(autograder): level-based grader with 5 bug fixes#2
lassebenni merged 1 commit into
mainfrom
fix/autograder-week9

Conversation

@lassebenni

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the minimal completeness-only test.sh with a 7-level structured grader that uses grader_lib.sh (shared from the Week 6 autograder pattern)
  • Fixes 5 bugs where the scaffold could score ≥50 without any student work

Bugs fixed

# Bug Impact
1 file_is_filled() only caught standalone TODO lines — -- TODO: GROUP BY … HAVING COUNT(*) > 1 passed the check AND triggered keyword matches Untouched scaffold scored 45/100, crossing the old passingScore: 50 threshold automatically
2 Task 1.4 orphaned-key check (LEFT JOIN / NOT EXISTS) not graded Students could skip the relationship check with no point loss
3 Task 2 negative fare filter (WHERE fare_amount >= 0) not verified Core cleaning step could be omitted with no point loss
4 Task 2 TIMESTAMP cast not verified Students who skip it break their own Task 4 queries but still scored full Task 2 marks
5 score.example.json had passingScore: 50 while test.sh wrote passingScore: 60 Inconsistent bar

Grading ladder (verified)

Level What is checked Points
1 All 5 required files present 10
2 validation_queries.sql: 4 checks (duplicates, NULLs, range, orphans) 20
3 schema_setup.sql: views defined + fare filter + TIMESTAMP cast 30
4 data_dictionary.md: grain + primary key + measures 15
5 verification_results.sql: borough + revenue + time-pattern queries 15
6 assets/borough_count.png screenshot 5
7 AI_ASSIST.md: 4 sections filled 5

Scaffold → 10/100 (fail) · Working solution → 100/100 (pass)

Test plan

  • Run .hyf/test.sh against the unmodified scaffold in this repo — should score 10/100 (fail)
  • Run .hyf/test.sh against a completed solution — should score ≥60/100 (pass)

🤖 Generated with Claude Code

…grader

Five bugs in the original test.sh:

1. file_is_filled() only matched standalone TODO lines, so `-- TODO: GROUP BY
   ... HAVING COUNT(*) > 1` passed the check AND triggered the HAVING COUNT
   keyword match → scaffold scored 45/100 and crossed the old passingScore 50
   threshold automatically (untouched scaffold = instant pass).

2. Task 1.4 (orphaned-key LEFT JOIN / NOT EXISTS check) not graded at all.

3. Task 2: negative fare filter (WHERE fare_amount >= 0) not verified — the
   core cleaning step could be omitted with no point loss.

4. Task 2: pickup_datetime::TIMESTAMP cast not verified — students who skip
   it break their own Task 4 time-pattern queries but still scored full marks.

5. score.example.json had passingScore 50 while test.sh wrote passingScore 60.

Changes:
- Add grader_lib.sh (shared pass/fail/warn helpers from Week 6 autograder).
- Rewrite test.sh: 7 levels, structured pass/fail output per check, rich
  feedback messages pointing to the exact task and pattern needed.
- Fix file_is_filled() to catch any occurrence of TODO (case-insensitive).
- Grade all four Task 1 checks, including the relationship orphan check.
- Grade Task 2 fare filter and TIMESTAMP cast explicitly.
- Align score.example.json passingScore with the 60-point threshold in the
  grader (was 50, now 60).
- Update .hyf/README.md with the grading table.

Ladder verified: scaffold → 10/100 (fail), working solution → 100/100 (pass).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lassebenni lassebenni merged commit d0be558 into main Jun 29, 2026
@lassebenni lassebenni deleted the fix/autograder-week9 branch June 29, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant