[spark-compete] fix: guard json.loads in config.py - #573
Open
huzaifakhan98 wants to merge 1 commit into
Open
Conversation
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.
Spark Compete Packet
{ "schema": "spark-compete-hotfix-v1", "event": "spark-compete-first-event", "submission_mode": "public_repo_pr", "submission_target_url": "https://github.com/vibeforge1111/spark-researcher/pull/573", "team": { "name": "AKDAO", "members": [ "huzaifakhan98", "friend_member_1", "friend_member_2" ], "llm_device_holder": "huzaifakhan98", "device_holder_github": "huzaifakhan98", "github_accounts": [ "huzaifakhan98" ] }, "target_repo": { "id": "vibeforge1111/spark-researcher", "source": "https://github.com/vibeforge1111/spark-researcher", "owner_surface": "researcher" }, "issue": { "type": "bug", "severity": "medium", "title": "fix: guard json.loads in config.py", "actual_behavior": "Raw json.loads in src/spark_researcher/config.py is completely unguarded. If input JSON is corrupted or malformed, it raises an unhandled JSONDecodeError and crashes.", "expected_behavior": "The json.loads statement should be wrapped in try-except block throwing meaningful RuntimeErrors.", "repro_steps": [ "1. Inject malformed JSON into input parsed by config.py.", "2. Run execution workflow.", "3. Observe unhandled JSONDecodeError traceback and crash." ], "affected_workflow": "JSON parsing in config.py" }, "evidence": { "safe_links_only": true, "before_after_proof": "Wrapped raw json.loads in try-except in src/spark_researcher/config.py.", "links": [ "https://github.com/vibeforge1111/spark-researcher" ], "forbidden": [ "tokens", "raw logs", "private repo maps" ] }, "proposed_fix": { "approach": "Wrap json.loads in try-except block catching (json.JSONDecodeError, OSError).", "files_expected": [ "src/spark_researcher/config.py" ], "tests_or_smoke": "manual review" }, "pr": { "branch": "fix/guard-json-src-spark_researcher-config", "title_prefix": "[spark-compete]", "author_github": "huzaifakhan98", "body_must_include": [ "packet", "team", "pr_author", "repo", "actual_behavior", "expected_behavior", "repro_steps", "before_after_proof", "tests_or_smoke", "duplicate_notes", "risk_notes", "review_claim" ], "url": "https://github.com/vibeforge1111/spark-researcher/pull/573" }, "review_claim": { "impact_claim": "medium", "evidence_types": [ "smoke_test" ], "duplicate_notes": "First automated fix for this JSON parsing crash.", "risk_notes": "Low risk try-except block addition.", "review_state_requested": "pr_review" } }Description
Wrapped unguarded json.loads in
src/spark_researcher/config.pyto catch JSONDecodeError and OSError, returning a clean RuntimeError instead of crashing the process.