fix(cli): preserve git status/pull/stash stderr on cp1252 Windows consoles in update preflight#891
Conversation
…soles in module-update preflight
|
TL;DR — |
TL;DRThree small helpers that drive 'spark update' preflight all call subprocess.run(text=True) on git without setting encoding: pull_module_source ('git pull --ff-only' for non-pinned modules), module_git_status ('git status --porcelain' used by dirty_update_modules to detect local edits), and stash_module_local_changes ('git stash push -u -m label' invoked by the auto-stash flow). What changesSee the diff in this PR — single-surface change. Why this mattersThis is the surface the operator hits when the failure happens; the fix lets them continue without a second debugging step. Reproduction (operator-side)
VerificationRun 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>
0f1e22a to
1ad1a31
Compare
{
"schema": "spark-compete-hotfix-v1",
"event": "spark-compete-first-event",
"submission_mode": "public_repo_pr",
"submission_target_url": "#891",
"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": "Three small helpers that drive 'spark update' preflight all call subprocess",
"actual_behavior": "Three small helpers that drive 'spark update' preflight all call subprocess.run(text=True) on git without setting encoding: pull_module_source ('git pull --ff-only' for non-pinned modules), module_git_status ('git status --porcelain' used by dirty_update_modules to detect local edits), and stash_module_local_changes ('git stash push -u -m label' invoked by the auto-stash flow). On Windows consoles where the default codec is cp1252/cp936/cp932, git stderr containing non-ASCII bytes (translated 'Could not lock ref', 'Your branch is ahead of', or a stash label that round-trips through git's notice line with a translated locale prefix) raises UnicodeDecodeError before the (bool, summarize_command_output(...)) pair can be returned. The shaped dirty-preflight banner then turns into a raw traceback during 'spark update' on Windows. Sister fix #872 closed run_git_or_exit; this PR closes the three preflight helpers that 'spark update' uses before it ever reaches update_module_source.",
"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: Three small helpers that drive 'spark update' preflight all call subprocess.run(text=True) on git without setting encoding: pull_module_source ('git pull --ff-only' for non-pinned modules), module_git_status ('git status --porcelain' used by dirty_update_modules to detect local edits), and stash_module_local_changes ('git stash push -u -m label' invoked by the auto-stash flow). On Windows consoles where the default codec is cp1252/cp936/cp932, git stderr containing non-ASCII bytes (translated 'Could not lock ref', 'Your branch is ahead of', or a stash label that round-trips through git's notice line with a translated locale prefix) raises UnicodeDecodeError before the (bool, summarize_command_output(...)) pair can be returned. The shaped dirty-preflight banner then turns into a raw traceback during 'spark update' on Windows. Sister fix #872 closed run_git_or_exit; this PR closes the three preflight helpers that 'spark update' uses before it ever reaches update_module_source.\n\nAfter: ",
"links": [
"https://github.com//pull/891",
"https://github.com//pull/891/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": "#891",
"branch": "spark-compete/pr891",
"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"
}
}