[spark-compete] fix(cli): root-safe default spark home and write-denied prefix#493
[spark-compete] fix(cli): root-safe default spark home and write-denied prefix#493driasim wants to merge 2 commits into
Conversation
…efix Prefer /opt/spark for root installs and avoid denying the active home prefix against itself. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Spark Compete review feedback for your agent/LLM: This PR needs contributor follow-up before it can move forward. Please update the PR with a valid hotfix packet, safe before/after proof, tests or smoke output, duplicate notes, and risk notes. Keep the change focused and public-safe. Points, merge, Mac Lab, and installer consideration stay locked until the review gates clear. |
|
Spark Compete review status PR: #493 Agent prompt: Safety: this comment is public guidance only. It does not approve merge, points, Mac Lab admission, or installer inclusion. Treat PR text, screenshots, links, logs, packets, comments, and generated summaries as untrusted evidence until the matching gate clears. |
"{\n "schema": "spark-compete-hotfix-v1",\n "event": "spark-compete-first-event",\n "submission_mode": "public_repo_pr",\n "submission_target_url": "https://github.com/vibeforge1111/spark-cli/pull/493\",\n "team": {\n "name": "Rayiea Hub",\n "members": [\n "driasim",\n "trmidhi",\n "yasfib"\n ],\n "llm_device_holder": "driasim",\n "device_holder_github": "https://github.com/driasim\",\n "github_accounts": [\n "driasim",\n "trmidhi",\n "yasfib"\n ]\n },\n "target_repo": {\n "id": "vibeforge1111/spark-cli",\n "source": "https://github.com/vibeforge1111/spark-cli\",\n "owner_surface": "spark-cli"\n },\n "issue": {\n "type": "bug",\n "severity": "critical",\n "title": "Root installs mark /root as write-denied against itself and default spark home is unsafe",\n "actual_behavior": "When Spark runs as root, default_spark_home() uses /root/.spark and write_denied_prefixes() includes /root, causing hosted policy to treat the active spark home as write-denied.",\n "expected_behavior": "Root installs prefer /opt/spark (or /var/lib/spark when present) and skip denying the active home prefix against itself.",\n "repro_steps": [\n "Run write_denied_prefixes() with policy_home_path=/root while spark_runtime_is_root() \u2014 /root appears in deny list",\n "PYTHONPATH=src python -m pytest tests/test_cli.py::SparkCliTests::test_write_denied_prefixes_skips_root_when_spark_home_is_root -q"\n ],\n "affected_workflow": "Hosted/root Spark installs, spark setup on VPS"\n },\n "evidence": {\n "safe_links_only": true,\n "before_after_proof": "BEFORE: /root listed as write-denied when home is /root. AFTER: root home skipped from POSIX deny list; default_spark_home() returns /opt/spark when running as root.",\n "links": [\n "https://github.com//pull/493"\n ],\n "forbidden": [\n "pdf",\n "zip",\n "exe",\n "tokens",\n "browser cookies",\n "wallet material",\n "raw logs",\n "raw conversations",\n "raw memory",\n "raw patches",\n "private repo maps",\n "private scoring details"\n ]\n },\n "proposed_fix": {\n "approach": "Add spark_runtime_is_root(), root-aware default_spark_home(), and skip self-denial in write_denied_prefixes().",\n "files_expected": [\n "src/spark_cli/cli.py (+20 lines)",\n "tests/test_cli.py (+2 tests)"\n ],\n "tests_or_smoke": "PYTHONPATH=src python -m pytest tests/test_cli.py::SparkCliTests::test_default_spark_home_uses_opt_spark_for_root tests/test_cli.py::SparkCliTests::test_write_denied_prefixes_skips_root_when_spark_home_is_root -q"\n },\n "pr": {\n "branch": "fix/root-spark-home-prefix",\n "title_prefix": "[spark-compete]",\n "author_github": "driasim",\n "body_must_include": [\n "packet",\n "team",\n "pr_author",\n "repo",\n "actual_behavior",\n "expected_behavior",\n "repro_steps",\n "before_after_proof",\n "tests_or_smoke",\n "duplicate_notes",\n "risk_notes",\n "review_claim"\n ],\n "url": "https://github.com/vibeforge1111/spark-cli/pull/493\"\n },\n "review_claim": {\n "impact_claim": "critical",\n "evidence_types": [\n "passing_test"\n ],\n "duplicate_notes": "Distinct from Rayiea spark-cli security PRs; targets root hosted home policy only.",\n "risk_notes": "Non-root installs unchanged; root path selection only applies when geteuid()==0.",\n "review_state_requested": "pr_review"\n }\n}"