Repository navigation
Redesign refute flow and function-call table; fix refute handler bugs - #154
Open
CoffeePoweredComputers wants to merge 1 commit into
Open
CoffeePoweredComputers wants to merge 1 commit into
CoffeePoweredComputers wants to merge 1 commit into
Conversation
Refute (counterexample) problems: - Single Submit flow: remove the client-side Test step; every attempt is a real synchronous submission. RefuteFeedback now renders an enumerated list (last 10) of attempts from submission history — input tried, what it returned, and whether it disproved the claim. - Fix RefuteHandler reading submission.type_specific_data, which is not a DB column: serialize_result/extract_test_results now reconstruct the outcome by re-executing the reference solution against raw_input (same pattern as the MCQ handler). - Fix _extract_function_name to accept "def "-prefixed signatures, matching the frontend parser (previously fell back to "f" and failed execution for e.g. "def abs_val(x: int) -> int"). - ProblemSet: handle refute sync submission results (status, cache, notifications) instead of falling through to the MCQ branch. Function Call Table (prompt problems) — "Ledger" redesign: - Left-aligned, larger type, syntax-colored calls via --color-syntax-* tokens, green pill chips for return values, primary-gradient header rule, hover row tint with accent tick. Theme tokens only. Accessibility (WCAG AA, measured): - Returns accent → --color-info (gradient-start was 3.9:1 on striped rows) - Refute badges/banner: solid pill for DISPROVES (6.0:1), secondary text for attempt numbers and "claim holds" (was #999 at ~4.3:1) Also: left-align problem description markdown (was inheriting text-align:center from .main-content), en/es locale updates, refute handler unit tests updated to the reconstruction contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three related UX/correctness changes to the problem-solving view, all verified live end-to-end.
Refute (counterexample) problems — submit-only flow
RefuteInputnow has a single Submit; every attempt is a real synchronous submission.RefuteFeedbackrenders an enumerated attempt list (last 10, newest first) from submission history: the call tried (abs_val(x=0)), what it returned, and a ✓ DISPROVES / Claim holds / Error badge, plus a "Counterexample Found!" banner once solved.ProblemSet.handleSyncSubmissionResultgains a refute branch (was MCQ-only).Two pre-existing backend bugs fixed (
handlers/refute/handler.py)serialize_result/extract_test_resultsreadsubmission.type_specific_data— which is not a DB column (it only exists on the transientProcessingResult), so per-attempt refute results were always empty. They now reconstruct the outcome by re-executing the reference solution against the storedraw_input, following the MCQ handler's precedent (refute grading is deterministic and in-process)._extract_function_namedidn't handledef-prefixed signatures —"def abs_val(x: int) -> int"fell back to"f"and execution failed with "Function 'f' not defined". Regex now matches the frontend parser.Function Call Table (prompt problems) — "Ledger" redesign
Replaces the cramped centered white-on-black grid: left-aligned larger type, syntax-colored calls (via the theme's
--color-syntax-*tokens), green pill chips for return values, a primary-gradient header rule, and a hover row tint with accent tick. Theme tokens only — no hardcoded colors.Accessibility (WCAG AA, ratios measured in-browser)
--color-info(5.3:1);--color-primary-gradient-startmeasured 3.9:1--color-text-secondary(9.5:1); solved banner text → primary (12.2:1)text-align: centerfrom.main-contentTest plan
pytest tests/unit/test_handlers_refute.py— 70 pass (tests updated to the reconstruction contract)pytest -m architecture— 51 passvitest run— 464 pass; eslint/stylelint/i18n-parity clean (en/es 1358/1358)x=5→ claim holds) and counterexample (x=0→ ✓ DISPROVES, problem completed); verified prompt table rendering🤖 Generated with Claude Code