Skip to content

[spark-compete] fix: guard json.loads in config.py - #573

Open
huzaifakhan98 wants to merge 1 commit into
vibeforge1111:mainfrom
huzaifakhan98:fix/guard-json-src-spark_researcher-config
Open

[spark-compete] fix: guard json.loads in config.py#573
huzaifakhan98 wants to merge 1 commit into
vibeforge1111:mainfrom
huzaifakhan98:fix/guard-json-src-spark_researcher-config

Conversation

@huzaifakhan98

@huzaifakhan98 huzaifakhan98 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

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.py to catch JSONDecodeError and OSError, returning a clean RuntimeError instead of crashing the process.

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