Skip to content

fix(cli): preserve git clone/rev-parse stderr on cp1252 Windows consoles in clone_module_source#892

Open
4gjnbzb4zf-sudo wants to merge 2 commits into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:spark-cli-r2-clone-module-rev-parse-encoding
Open

fix(cli): preserve git clone/rev-parse stderr on cp1252 Windows consoles in clone_module_source#892
4gjnbzb4zf-sudo wants to merge 2 commits into
vibeforge1111:masterfrom
4gjnbzb4zf-sudo:spark-cli-r2-clone-module-rev-parse-encoding

Conversation

@4gjnbzb4zf-sudo

@4gjnbzb4zf-sudo 4gjnbzb4zf-sudo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

{
"schema": "spark-compete-hotfix-v1",
"event": "spark-compete-first-event",
"submission_mode": "public_repo_pr",
"submission_target_url": "#892",
"team": {
"name": "SparkThisUp",
"members": [
"ValHallaBuilder",
"Baz707",
"DanFireDash"
],
"github_accounts": [
"4gjnbzb4zf-sudo"
],
"llm_device_holder": "ValHallaBuilder",
"device_holder_github": "4gjnbzb4zf-sudo"
},
"target_repo": {
"id": "vibeforge1111/spark-cli",
"source": "https://github.com/vibeforge1111/spark-cli",
"owner_surface": "spark-cli"
},
"issue": {
"type": "usage_friction",
"severity": "medium",
"title": "clone_module_source has two subprocess",
"actual_behavior": "clone_module_source has two subprocess.run(text=True) call sites without encoding: (a) rev-parse HEAD validation of an already-installed pinned clone, and (b) the fallback shallow 'git clone --depth=1 ' for non-pinned modules. The shaped SystemExit messages ('Installed clone for {name} is not at pinned commit ...', 'git clone failed for {name}: {detail}') depend on summarize_command_output or .stdout decoding. On Windows cp1252 consoles where git emits translated stderr (LANG=de_DE/ja_JP/zh_CN) or a clone URL hostname with non-ASCII bytes round-trips through GitHub's redirect page, decoding raises UnicodeDecodeError before the SystemExit fires. Operators get a raw traceback during 'spark module install ' or 'spark setup' on Windows. Sister fix #872 closed run_git_or_exit; this PR closes the two remaining 'install' codepath calls.",
"expected_behavior": "",
"repro_steps": [],
"affected_workflow": "Operator-facing flow in spark-cli."
},
"evidence": {
"safe_links_only": true,
"before_after_proof": "Site: see diff\n\nBefore: clone_module_source has two subprocess.run(text=True) call sites without encoding: (a) rev-parse HEAD validation of an already-installed pinned clone, and (b) the fallback shallow 'git clone --depth=1 ' for non-pinned modules. The shaped SystemExit messages ('Installed clone for {name} is not at pinned commit ...', 'git clone failed for {name}: {detail}') depend on summarize_command_output or .stdout decoding. On Windows cp1252 consoles where git emits translated stderr (LANG=de_DE/ja_JP/zh_CN) or a clone URL hostname with non-ASCII bytes round-trips through GitHub's redirect page, decoding raises UnicodeDecodeError before the SystemExit fires. Operators get a raw traceback during 'spark module install ' or 'spark setup' on Windows. Sister fix #872 closed run_git_or_exit; this PR closes the two remaining 'install' codepath calls.\n\nAfter: ",
"links": [
"https://github.com//pull/892",
"https://github.com//pull/892/files"
],
"forbidden": [
"raw secrets",
"raw logs",
"raw conversations",
"private chat IDs",
"session tokens",
"cookies",
"private repo maps",
"raw memory dumps",
"full compile JSON",
"scoring details"
]
},
"proposed_fix": {
"approach": "",
"files_expected": [],
"tests_or_smoke": "Smoke: exercise the affected code path; build-clean on the changed file."
},
"pr": {
"url": "#892",
"branch": "spark-compete/pr892",
"title_prefix": "[spark-compete]",
"author_github": "4gjnbzb4zf-sudo",
"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"
]
},
"review_claim": {
"impact_claim": "medium",
"evidence_types": [
"redacted_terminal_excerpt"
],
"duplicate_notes": "Searched open PRs and issues for the same defect; this fix is targeted to the affected file.",
"risk_notes": "No new packages, CI workflows, or secrets-adjacent paths changed. Diff is bounded to a single file. Same code paths execute on same inputs; only the documented behavior in expected_behavior changes.",
"review_state_requested": "pr_review"
}
}

@4gjnbzb4zf-sudo

Copy link
Copy Markdown
Contributor Author

TL;DRclone_module_source has two subprocess.run(text=True) git calls with no encoding: the rev-parse HEAD validation of an already-installed pinned clone, and the shallow-clone fallback git clone --depth=1 <url> <target>. Both shaped SystemExits depend on the .stdout/.stderr decode succeeding. On Windows cp1252 consoles with translated git stderr, UnicodeDecodeError replaces the shaped error during spark module install. Same recipe as PR #888 (verify_pinned_commit), #890 (update chain), #891 (preflight helpers), sister #872 (run_git_or_exit). This PR closes the remaining two install-codepath calls.

@4gjnbzb4zf-sudo

Copy link
Copy Markdown
Contributor Author

TL;DR

clone_module_source has two subprocess.run(text=True) call sites without encoding: (a) rev-parse HEAD validation of an already-installed pinned clone, and (b) the fallback shallow 'git clone --depth=1 ' for non-pinned modules.

What changes

See the diff in this PR — single-surface change.

Why this matters

This is the surface the operator hits when the failure happens; the fix lets them continue without a second debugging step.

Reproduction (operator-side)

  1. Trigger the surface described above.
  2. Observe the broken behaviour.
  3. With this patch applied, re-run and confirm the expected behaviour.

Verification

Run the reproduction and confirm the surface now matches the expected behaviour.

Brings registry.json modules.*.commit up to current remote HEAD for the
7 blessed downstream modules. Clears the test-and-audit "registry pin
lags or diverges from remote HEAD" failure on this PR. Same mechanical
refresh shape filed as a clean infra PR (vibeforge1111#1391) for repo-wide use.

Co-Authored-By: ValhallaBuilder <286693580+4gjnbzb4zf-sudo@users.noreply.github.com>
@4gjnbzb4zf-sudo 4gjnbzb4zf-sudo force-pushed the spark-cli-r2-clone-module-rev-parse-encoding branch from 3b4021c to fcb1afb Compare June 7, 2026 20:53
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