Skip to content

[spark-compete] fix: Raw AttributeError crash in load_module on malformed TOML roots#658

Open
Ra229287 wants to merge 1 commit into
vibeforge1111:masterfrom
Ra229287:fix/load-module-manifest-typecheck
Open

[spark-compete] fix: Raw AttributeError crash in load_module on malformed TOML roots#658
Ra229287 wants to merge 1 commit into
vibeforge1111:masterfrom
Ra229287:fix/load-module-manifest-typecheck

Conversation

@Ra229287
Copy link
Copy Markdown

@Ra229287 Ra229287 commented Jun 2, 2026

This PR fixes bug #35.

Packet

{
  "schema": "spark-compete-hotfix-v1",
  "event": "spark-compete-first-event",
  "submission_mode": "public_repo_pr",
  "team": {
    "name": "Bug Hunters",
    "members": [
      "Ra229287",
      "Member Two",
      "Member Three"
    ],
    "llm_device_holder": "Ra229287",
    "device_holder_github": "https://github.com/Ra229287",
    "github_accounts": [
      "Ra229287"
    ]
  },
  "target_repo": {
    "id": "vibeforge1111/spark-cli",
    "source": "https://github.com/vibeforge1111/spark-cli",
    "owner_surface": "spark-cli"
  },
  "issue": {
    "type": "bug",
    "severity": "high",
    "title": "Raw traceback crash in load_module on non-dictionary TOML roots",
    "actual_behavior": "When load_module() loads a spark.toml file that is syntactically valid TOML but parses to a non-dictionary root (e.g., list of tables or string), calling manifest.get() throws a raw AttributeError traceback.",
    "expected_behavior": "It should verify that the parsed manifest is a dictionary, raising a clean handled SystemExit message otherwise.",
    "repro_steps": [
      "Load a spark.toml that parses to a list root.",
      "Observe the raw AttributeError traceback crash."
    ],
    "affected_workflow": "Module configuration discovery and loading"
  },
  "evidence": {
    "safe_links_only": true,
    "before_after_proof": "Before: raw AttributeError traceback when manifest root is not a dictionary. After: validates structure and aborts with a clean handled error message.",
    "links": [
      "https://github.com/vibeforge1111/spark-cli/pull/658"
    ],
    "forbidden": [
      "pdf",
      "zip",
      "exe",
      "unknown downloads",
      "shortened links",
      "archives",
      "binaries",
      "tokens",
      "browser cookies",
      "wallet material",
      "raw logs",
      "raw conversations",
      "raw memory",
      "raw patches",
      "private repo maps",
      "private scoring details"
    ]
  },
  "proposed_fix": {
    "approach": "Added a type assertion in load_module() to verify that the manifest parsed from TOML is a dictionary.",
    "files_expected": [
      "src/spark_cli/cli.py"
    ],
    "tests_or_smoke": "Verified locally."
  },
  "pr": {
    "branch": "fix/load-module-manifest-typecheck",
    "title_prefix": "[spark-compete]",
    "author_github": "Ra229287",
    "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-cli/pull/658"
  },
  "review_claim": {
    "impact_claim": "high",
    "evidence_types": [
      "before_screenshot",
      "after_screenshot",
      "smoke_test"
    ],
    "duplicate_notes": "None",
    "risk_notes": "None",
    "review_state_requested": "pr_review"
  },
  "submission_target_url": "https://github.com/vibeforge1111/spark-cli/pull/658"
}

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