Draft
Unify resolver return types for consistent CLI pipeline behavior#153
Conversation
Co-authored-by: acbart <897227+acbart@users.noreply.github.com>
Co-authored-by: acbart <897227+acbart@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] What do Resolvers return?
Unify resolver return types for consistent CLI pipeline behavior
Sep 2, 2025
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.
Resolvers in Pedal were returning inconsistent data types, causing CLI pipelines to break and requiring brittle workarounds. This PR standardizes all resolver return types to use a unified dictionary format.
Problem
Previously, different resolvers returned different data types:
simple.resolve()andfull.resolve()returnedFinalFeedbackobjectsstatistics.resolve()returned a dictionary with{'final': dict, 'considered': list}silent.resolve()returned an empty stringsectional.resolve()returned a dictionary with group mappingsThis inconsistency required workaround code like:
Solution
All main resolvers now consistently return the unified format:
{ 'final': final_feedback_dict, # The chosen feedback as JSON 'considered': [feedback_dicts] # All considered feedback as JSON }This format:
Changes Made
simple.py,full.py, andsilent.pyto return the unified formatisinstancechecks in CLI codeTesting
All CLI functionality has been validated:
pedal grade simple_test.py submissions/correct.py --environment terminal✅pedal sandbox submissions/correct.py✅pedal --help✅The sectional resolver maintains its existing format since it handles multiple sections differently, but the main single-result resolvers are now fully unified.
Fixes #140.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.