Skip to content

Improve sampler course: divide-with-edge-cases probeable + EiPL segmentation - #153

Merged
CoffeePoweredComputers merged 2 commits into
masterfrom
fix/sampler-probeable-divide-and-eipl-segmentation
Jul 14, 2026
Merged

CoffeePoweredComputers merged 2 commits into
masterfrom
fix/sampler-probeable-divide-and-eipl-segmentation

Conversation

@CoffeePoweredComputers

Copy link
Copy Markdown
Owner

Summary

Two fixes to the Question Types Sampler seed command (seed_sampler_course), aligning the committed source with content already corrected on production.

1. Probeable Code → "divide two numbers" with edge cases

The old task was a transform (3n+1) machine — too on-the-nose; probing basically handed over the answer's shape. Replaced with a high-level goal ("Implement a function that divides two numbers") where the edge cases must be discovered by probing. The oracle is a // b, guarded on b == 0, exposing three edge cases via hidden test cases:

  • divide(7, 2) = 3 — floor division, not 3.5
  • divide(-7, 2) = -4 — floor rounds toward −∞
  • divide(5, 0) = 0 — divide-by-zero returns 0 instead of crashing

Slug renamed sampler-probeable-code-transform → sampler-probeable-code-divide.

2. EiPL → add prompt segmentation analysis

The sampler EiPL shipped with segmentation_config = {}, so comprehension grading (relational vs. multi-structural) had no few-shot examples to ground it — unlike every other EiPL problem. Added relational + multi_structural examples tailored to the sum_evens reference code, matching the established schema (verbatim-substring segments, non-overlapping 1-indexed code_lines, threshold 2).

Notes

  • Both changes were already applied to the production DB directly; this PR makes a fresh re-seed / image rebuild reproduce that state rather than reverting to transform.
  • Seed command remains idempotent (get_or_create).

🤖 Generated with Claude Code

…ntation

Two fixes to the Question Types Sampler seed command:

Probeable Code problem: replace the "mystery transform" (3n+1) task with a
high-level "divide two numbers" task whose edge cases must be discovered by
probing. The description states the goal but not the tricky behavior, and the
oracle (a // b, guarded on b == 0) exposes three edge cases via hidden test
cases: floor division (7/2 = 3), floor toward negative infinity (-7/2 = -4),
and divide-by-zero returning 0. Renames the slug to
sampler-probeable-code-divide.

EiPL problem: add prompt segmentation analysis config, which was previously
empty ({}), leaving comprehension grading ungrounded. Adds relational and
multi_structural few-shot examples tailored to the sum_evens reference code,
matching the schema used by every other EiPL problem.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jul 14, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ems_app/management/commands/seed_sampler_course.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CoffeePoweredComputers
CoffeePoweredComputers merged commit 1d12794 into master Jul 14, 2026
10 checks passed
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.

2 participants